fix: implemented customListActions in all other listviews
This commit is contained in:
parent
9f5bea6b22
commit
401bd8cade
@ -103,7 +103,7 @@ import {
|
||||
Dropdown,
|
||||
call,
|
||||
} from 'frappe-ui'
|
||||
import { setupBulkActions, createToast } from '@/utils'
|
||||
import { setupListActions, createToast } from '@/utils'
|
||||
import { globalStore } from '@/stores/global'
|
||||
import { onMounted, ref, watch } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
@ -181,6 +181,7 @@ function deleteValues(selections, unselectAll) {
|
||||
}
|
||||
|
||||
const customBulkActions = ref([])
|
||||
const customListActions = ref([])
|
||||
|
||||
function bulkActions(selections, unselectAll) {
|
||||
let actions = [
|
||||
@ -209,7 +210,18 @@ function bulkActions(selections, unselectAll) {
|
||||
|
||||
onMounted(() => {
|
||||
if (!list.value?.data) return
|
||||
setupBulkActions(list.value.data)
|
||||
setupListActions(list.value.data, {
|
||||
list: list.value,
|
||||
call,
|
||||
createToast,
|
||||
$dialog,
|
||||
router,
|
||||
})
|
||||
customBulkActions.value = list.value?.data?.bulkActions || []
|
||||
customListActions.value = list.value?.data?.listActions || []
|
||||
})
|
||||
|
||||
defineExpose({
|
||||
customListActions,
|
||||
})
|
||||
</script>
|
||||
|
||||
@ -103,7 +103,7 @@
|
||||
import PhoneIcon from '@/components/Icons/PhoneIcon.vue'
|
||||
import EditValueModal from '@/components/Modals/EditValueModal.vue'
|
||||
import { globalStore } from '@/stores/global'
|
||||
import { createToast } from '@/utils'
|
||||
import { setupListActions, createToast } from '@/utils'
|
||||
import {
|
||||
Avatar,
|
||||
ListView,
|
||||
@ -117,7 +117,8 @@ import {
|
||||
Dropdown,
|
||||
call,
|
||||
} from 'frappe-ui'
|
||||
import { ref, watch } from 'vue'
|
||||
import { ref, watch, onMounted } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
|
||||
const props = defineProps({
|
||||
rows: {
|
||||
@ -150,6 +151,8 @@ const emit = defineEmits([
|
||||
const pageLengthCount = defineModel()
|
||||
const list = defineModel('list')
|
||||
|
||||
const router = useRouter()
|
||||
|
||||
const { $dialog } = globalStore()
|
||||
|
||||
watch(pageLengthCount, (val, old_value) => {
|
||||
@ -199,6 +202,8 @@ function deleteValues(selections, unselectAll) {
|
||||
})
|
||||
}
|
||||
|
||||
const customListActions = ref([])
|
||||
|
||||
function bulkActions(selections, unselectAll) {
|
||||
let actions = [
|
||||
{
|
||||
@ -212,4 +217,21 @@ function bulkActions(selections, unselectAll) {
|
||||
]
|
||||
return actions
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
if (!list.value?.data) return
|
||||
setupListActions(list.value.data, {
|
||||
list: list.value,
|
||||
call,
|
||||
createToast,
|
||||
$dialog,
|
||||
router,
|
||||
})
|
||||
// customBulkActions.value = list.value?.data?.bulkActions || []
|
||||
customListActions.value = list.value?.data?.listActions || []
|
||||
})
|
||||
|
||||
defineExpose({
|
||||
customListActions,
|
||||
})
|
||||
</script>
|
||||
|
||||
@ -146,7 +146,7 @@ import {
|
||||
call,
|
||||
Tooltip,
|
||||
} from 'frappe-ui'
|
||||
import { setupBulkActions, createToast } from '@/utils'
|
||||
import { setupListActions, createToast } from '@/utils'
|
||||
import { globalStore } from '@/stores/global'
|
||||
import { onMounted, ref, watch } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
@ -234,6 +234,7 @@ function deleteValues(selections, unselectAll) {
|
||||
}
|
||||
|
||||
const customBulkActions = ref([])
|
||||
const customListActions = ref([])
|
||||
|
||||
function bulkActions(selections, unselectAll) {
|
||||
let actions = [
|
||||
@ -266,7 +267,18 @@ function bulkActions(selections, unselectAll) {
|
||||
|
||||
onMounted(() => {
|
||||
if (!list.value?.data) return
|
||||
setupBulkActions(list.value.data)
|
||||
setupListActions(list.value.data, {
|
||||
list: list.value,
|
||||
call,
|
||||
createToast,
|
||||
$dialog,
|
||||
router,
|
||||
})
|
||||
customBulkActions.value = list.value?.data?.bulkActions || []
|
||||
customListActions.value = list.value?.data?.listActions || []
|
||||
})
|
||||
|
||||
defineExpose({
|
||||
customListActions,
|
||||
})
|
||||
</script>
|
||||
|
||||
@ -85,7 +85,7 @@
|
||||
<script setup>
|
||||
import EditValueModal from '@/components/Modals/EditValueModal.vue'
|
||||
import { globalStore } from '@/stores/global'
|
||||
import { createToast } from '@/utils'
|
||||
import { setupListActions, createToast } from '@/utils'
|
||||
import {
|
||||
ListView,
|
||||
ListHeader,
|
||||
@ -98,7 +98,8 @@ import {
|
||||
call,
|
||||
Tooltip,
|
||||
} from 'frappe-ui'
|
||||
import { ref, watch } from 'vue'
|
||||
import { ref, watch, onMounted } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
|
||||
const props = defineProps({
|
||||
rows: {
|
||||
@ -132,6 +133,8 @@ const emit = defineEmits([
|
||||
const pageLengthCount = defineModel()
|
||||
const list = defineModel('list')
|
||||
|
||||
const router = useRouter()
|
||||
|
||||
const { $dialog } = globalStore()
|
||||
|
||||
watch(pageLengthCount, (val, old_value) => {
|
||||
@ -181,6 +184,8 @@ function deleteValues(selections, unselectAll) {
|
||||
})
|
||||
}
|
||||
|
||||
const customListActions = ref([])
|
||||
|
||||
function bulkActions(selections, unselectAll) {
|
||||
let actions = [
|
||||
{
|
||||
@ -194,4 +199,21 @@ function bulkActions(selections, unselectAll) {
|
||||
]
|
||||
return actions
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
if (!list.value?.data) return
|
||||
setupListActions(list.value.data, {
|
||||
list: list.value,
|
||||
call,
|
||||
createToast,
|
||||
$dialog,
|
||||
router,
|
||||
})
|
||||
// customBulkActions.value = list.value?.data?.bulkActions || []
|
||||
customListActions.value = list.value?.data?.listActions || []
|
||||
})
|
||||
|
||||
defineExpose({
|
||||
customListActions,
|
||||
})
|
||||
</script>
|
||||
|
||||
@ -88,7 +88,7 @@
|
||||
<script setup>
|
||||
import EditValueModal from '@/components/Modals/EditValueModal.vue'
|
||||
import { globalStore } from '@/stores/global'
|
||||
import { createToast } from '@/utils'
|
||||
import { setupListActions, createToast } from '@/utils'
|
||||
import {
|
||||
Avatar,
|
||||
ListView,
|
||||
@ -102,7 +102,8 @@ import {
|
||||
Dropdown,
|
||||
call,
|
||||
} from 'frappe-ui'
|
||||
import { ref, watch } from 'vue'
|
||||
import { ref, watch, onMounted } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
|
||||
const props = defineProps({
|
||||
rows: {
|
||||
@ -135,6 +136,8 @@ const emit = defineEmits([
|
||||
const pageLengthCount = defineModel()
|
||||
const list = defineModel('list')
|
||||
|
||||
const router = useRouter()
|
||||
|
||||
const { $dialog } = globalStore()
|
||||
|
||||
watch(pageLengthCount, (val, old_value) => {
|
||||
@ -184,6 +187,8 @@ function deleteValues(selections, unselectAll) {
|
||||
})
|
||||
}
|
||||
|
||||
const customListActions = ref([])
|
||||
|
||||
function bulkActions(selections, unselectAll) {
|
||||
let actions = [
|
||||
{
|
||||
@ -197,4 +202,21 @@ function bulkActions(selections, unselectAll) {
|
||||
]
|
||||
return actions
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
if (!list.value?.data) return
|
||||
setupListActions(list.value.data, {
|
||||
list: list.value,
|
||||
call,
|
||||
createToast,
|
||||
$dialog,
|
||||
router,
|
||||
})
|
||||
// customBulkActions.value = list.value?.data?.bulkActions || []
|
||||
customListActions.value = list.value?.data?.listActions || []
|
||||
})
|
||||
|
||||
defineExpose({
|
||||
customListActions,
|
||||
})
|
||||
</script>
|
||||
|
||||
@ -106,7 +106,7 @@ import CalendarIcon from '@/components/Icons/CalendarIcon.vue'
|
||||
import EditValueModal from '@/components/Modals/EditValueModal.vue'
|
||||
import { dateFormat } from '@/utils'
|
||||
import { globalStore } from '@/stores/global'
|
||||
import { createToast } from '@/utils'
|
||||
import { setupListActions, createToast } from '@/utils'
|
||||
import {
|
||||
Avatar,
|
||||
ListView,
|
||||
@ -120,7 +120,8 @@ import {
|
||||
call,
|
||||
Tooltip,
|
||||
} from 'frappe-ui'
|
||||
import { ref, watch } from 'vue'
|
||||
import { ref, watch, onMounted } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
|
||||
const props = defineProps({
|
||||
rows: {
|
||||
@ -154,6 +155,8 @@ const emit = defineEmits([
|
||||
const pageLengthCount = defineModel()
|
||||
const list = defineModel('list')
|
||||
|
||||
const router = useRouter()
|
||||
|
||||
const { $dialog } = globalStore()
|
||||
|
||||
watch(pageLengthCount, (val, old_value) => {
|
||||
@ -203,6 +206,8 @@ function deleteValues(selections, unselectAll) {
|
||||
})
|
||||
}
|
||||
|
||||
const customListActions = ref([])
|
||||
|
||||
function bulkActions(selections, unselectAll) {
|
||||
let actions = [
|
||||
{
|
||||
@ -216,4 +221,21 @@ function bulkActions(selections, unselectAll) {
|
||||
]
|
||||
return actions
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
if (!list.value?.data) return
|
||||
setupListActions(list.value.data, {
|
||||
list: list.value,
|
||||
call,
|
||||
createToast,
|
||||
$dialog,
|
||||
router,
|
||||
})
|
||||
// customBulkActions.value = list.value?.data?.bulkActions || []
|
||||
customListActions.value = list.value?.data?.listActions || []
|
||||
})
|
||||
|
||||
defineExpose({
|
||||
customListActions,
|
||||
})
|
||||
</script>
|
||||
|
||||
@ -3,6 +3,12 @@
|
||||
<template #left-header>
|
||||
<Breadcrumbs :items="breadcrumbs" />
|
||||
</template>
|
||||
<template #right-header>
|
||||
<CustomActions
|
||||
v-if="callLogsListView?.customListActions"
|
||||
:actions="callLogsListView.customListActions"
|
||||
/>
|
||||
</template>
|
||||
</LayoutHeader>
|
||||
<ViewControls
|
||||
ref="viewControls"
|
||||
@ -13,6 +19,7 @@
|
||||
doctype="CRM Call Log"
|
||||
/>
|
||||
<CallLogsListView
|
||||
ref="callLogsListView"
|
||||
v-if="callLogs.data && rows.length"
|
||||
v-model="callLogs.data.page_length_count"
|
||||
v-model:list="callLogs"
|
||||
@ -43,6 +50,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import CustomActions from '@/components/CustomActions.vue'
|
||||
import PhoneIcon from '@/components/Icons/PhoneIcon.vue'
|
||||
import LayoutHeader from '@/components/LayoutHeader.vue'
|
||||
import ViewControls from '@/components/ViewControls.vue'
|
||||
@ -63,6 +71,8 @@ const { getContact, getLeadContact } = contactsStore()
|
||||
|
||||
const breadcrumbs = [{ label: 'Call Logs', route: { name: 'Call Logs' } }]
|
||||
|
||||
const callLogsListView = ref(null)
|
||||
|
||||
// callLogs data is loaded in the ViewControls component
|
||||
const callLogs = ref({})
|
||||
const loadMore = ref(1)
|
||||
|
||||
@ -4,6 +4,10 @@
|
||||
<Breadcrumbs :items="breadcrumbs" />
|
||||
</template>
|
||||
<template #right-header>
|
||||
<CustomActions
|
||||
v-if="contactsListView?.customListActions"
|
||||
:actions="contactsListView.customListActions"
|
||||
/>
|
||||
<Button variant="solid" label="Create" @click="showContactModal = true">
|
||||
<template #prefix><FeatherIcon name="plus" class="h-4" /></template>
|
||||
</Button>
|
||||
@ -18,6 +22,7 @@
|
||||
doctype="Contact"
|
||||
/>
|
||||
<ContactsListView
|
||||
ref="contactsListView"
|
||||
v-if="contacts.data && rows.length"
|
||||
v-model="contacts.data.page_length_count"
|
||||
v-model:list="contacts"
|
||||
@ -52,6 +57,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import CustomActions from '@/components/CustomActions.vue'
|
||||
import ContactsIcon from '@/components/Icons/ContactsIcon.vue'
|
||||
import LayoutHeader from '@/components/LayoutHeader.vue'
|
||||
import ContactModal from '@/components/Modals/ContactModal.vue'
|
||||
@ -87,6 +93,8 @@ const breadcrumbs = computed(() => {
|
||||
return items
|
||||
})
|
||||
|
||||
const contactsListView = ref(null)
|
||||
|
||||
// contacts data is loaded in the ViewControls component
|
||||
const contacts = ref({})
|
||||
const loadMore = ref(1)
|
||||
|
||||
@ -4,6 +4,10 @@
|
||||
<Breadcrumbs :items="breadcrumbs" />
|
||||
</template>
|
||||
<template #right-header>
|
||||
<CustomActions
|
||||
v-if="dealsListView?.customListActions"
|
||||
:actions="dealsListView.customListActions"
|
||||
/>
|
||||
<Button variant="solid" label="Create" @click="showNewDialog = true">
|
||||
<template #prefix><FeatherIcon name="plus" class="h-4" /></template>
|
||||
</Button>
|
||||
@ -18,6 +22,7 @@
|
||||
doctype="CRM Deal"
|
||||
/>
|
||||
<DealsListView
|
||||
ref="dealsListView"
|
||||
v-if="deals.data && rows.length"
|
||||
v-model="deals.data.page_length_count"
|
||||
v-model:list="deals"
|
||||
@ -65,6 +70,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import CustomActions from '@/components/CustomActions.vue'
|
||||
import DealsIcon from '@/components/Icons/DealsIcon.vue'
|
||||
import LayoutHeader from '@/components/LayoutHeader.vue'
|
||||
import DealsListView from '@/components/ListViews/DealsListView.vue'
|
||||
@ -92,6 +98,8 @@ const { getDealStatus } = statusesStore()
|
||||
|
||||
const router = useRouter()
|
||||
|
||||
const dealsListView = ref(null)
|
||||
|
||||
// deals data is loaded in the ViewControls component
|
||||
const deals = ref({})
|
||||
const loadMore = ref(1)
|
||||
|
||||
@ -4,6 +4,10 @@
|
||||
<Breadcrumbs :items="breadcrumbs" />
|
||||
</template>
|
||||
<template #right-header>
|
||||
<CustomActions
|
||||
v-if="emailTemplatesListView?.customListActions"
|
||||
:actions="emailTemplatesListView.customListActions"
|
||||
/>
|
||||
<Button variant="solid" label="Create" @click="showEmailTemplateModal = true">
|
||||
<template #prefix><FeatherIcon name="plus" class="h-4" /></template>
|
||||
</Button>
|
||||
@ -18,6 +22,7 @@
|
||||
doctype="Email Template"
|
||||
/>
|
||||
<EmailTemplatesListView
|
||||
ref="emailTemplatesListView"
|
||||
v-if="emailTemplates.data && rows.length"
|
||||
v-model="emailTemplates.data.page_length_count"
|
||||
v-model:list="emailTemplates"
|
||||
@ -54,6 +59,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import CustomActions from '@/components/CustomActions.vue'
|
||||
import EmailIcon from '@/components/Icons/EmailIcon.vue'
|
||||
import LayoutHeader from '@/components/LayoutHeader.vue'
|
||||
import ViewControls from '@/components/ViewControls.vue'
|
||||
@ -67,6 +73,8 @@ const breadcrumbs = [
|
||||
{ label: 'Email Templates', route: { name: 'Email Templates' } },
|
||||
]
|
||||
|
||||
const emailTemplatesListView = ref(null)
|
||||
|
||||
// emailTemplates data is loaded in the ViewControls component
|
||||
const emailTemplates = ref({})
|
||||
const loadMore = ref(1)
|
||||
|
||||
@ -4,6 +4,10 @@
|
||||
<Breadcrumbs :items="breadcrumbs" />
|
||||
</template>
|
||||
<template #right-header>
|
||||
<CustomActions
|
||||
v-if="organizationsListView?.customListActions"
|
||||
:actions="organizationsListView.customListActions"
|
||||
/>
|
||||
<Button
|
||||
variant="solid"
|
||||
label="Create"
|
||||
@ -22,6 +26,7 @@
|
||||
doctype="CRM Organization"
|
||||
/>
|
||||
<OrganizationsListView
|
||||
ref="organizationsListView"
|
||||
v-if="organizations.data && rows.length"
|
||||
v-model="organizations.data.page_length_count"
|
||||
v-model:list="organizations"
|
||||
@ -55,6 +60,7 @@
|
||||
<OrganizationModal v-model="showOrganizationModal" />
|
||||
</template>
|
||||
<script setup>
|
||||
import CustomActions from '@/components/CustomActions.vue'
|
||||
import OrganizationsIcon from '@/components/Icons/OrganizationsIcon.vue'
|
||||
import LayoutHeader from '@/components/LayoutHeader.vue'
|
||||
import OrganizationModal from '@/components/Modals/OrganizationModal.vue'
|
||||
@ -72,6 +78,7 @@ import { useRoute } from 'vue-router'
|
||||
|
||||
const route = useRoute()
|
||||
|
||||
const organizationsListView = ref(null)
|
||||
const showOrganizationModal = ref(false)
|
||||
|
||||
const currentOrganization = computed(() => {
|
||||
|
||||
@ -4,6 +4,10 @@
|
||||
<Breadcrumbs :items="breadcrumbs" />
|
||||
</template>
|
||||
<template #right-header>
|
||||
<CustomActions
|
||||
v-if="tasksListView?.customListActions"
|
||||
:actions="tasksListView.customListActions"
|
||||
/>
|
||||
<Button variant="solid" label="Create" @click="createTask">
|
||||
<template #prefix><FeatherIcon name="plus" class="h-4" /></template>
|
||||
</Button>
|
||||
@ -18,6 +22,7 @@
|
||||
doctype="CRM Task"
|
||||
/>
|
||||
<TasksListView
|
||||
ref="tasksListView"
|
||||
v-if="tasks.data && rows.length"
|
||||
v-model="tasks.data.page_length_count"
|
||||
v-model:list="tasks"
|
||||
@ -47,6 +52,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import CustomActions from '@/components/CustomActions.vue'
|
||||
import EmailIcon from '@/components/Icons/EmailIcon.vue'
|
||||
import LayoutHeader from '@/components/LayoutHeader.vue'
|
||||
import ViewControls from '@/components/ViewControls.vue'
|
||||
@ -61,6 +67,8 @@ const breadcrumbs = [{ label: 'Tasks', route: { name: 'Tasks' } }]
|
||||
|
||||
const { getUser } = usersStore()
|
||||
|
||||
const tasksListView = ref(null)
|
||||
|
||||
// tasks data is loaded in the ViewControls component
|
||||
const tasks = ref({})
|
||||
const loadMore = ref(1)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user