fix: removed old filters & sort by logic from all list view
This commit is contained in:
parent
8660312684
commit
b590985b56
@ -43,22 +43,17 @@ import {
|
|||||||
} from '@/utils'
|
} from '@/utils'
|
||||||
import { usersStore } from '@/stores/users'
|
import { usersStore } from '@/stores/users'
|
||||||
import { contactsStore } from '@/stores/contacts'
|
import { contactsStore } from '@/stores/contacts'
|
||||||
import { useOrderBy } from '@/composables/orderby'
|
import { createResource, Breadcrumbs } from 'frappe-ui'
|
||||||
import { useFilter } from '@/composables/filter'
|
import { computed } from 'vue'
|
||||||
import { useDebounceFn } from '@vueuse/core'
|
|
||||||
import { createResource, Breadcrumbs, FeatherIcon } from 'frappe-ui'
|
|
||||||
import { computed, watch } from 'vue'
|
|
||||||
|
|
||||||
const { getUser } = usersStore()
|
const { getUser } = usersStore()
|
||||||
const { getContact } = contactsStore()
|
const { getContact } = contactsStore()
|
||||||
const { get: getOrderBy } = useOrderBy()
|
|
||||||
const { getArgs, storage } = useFilter()
|
|
||||||
|
|
||||||
const breadcrumbs = [{ label: 'Call Logs', route: { name: 'Call Logs' } }]
|
const breadcrumbs = [{ label: 'Call Logs', route: { name: 'Call Logs' } }]
|
||||||
|
|
||||||
function getParams() {
|
function getParams() {
|
||||||
const filters = getArgs() || {}
|
const filters = {}
|
||||||
const order_by = getOrderBy() || 'creation desc'
|
const order_by = 'creation desc'
|
||||||
|
|
||||||
return {
|
return {
|
||||||
doctype: 'CRM Call Log',
|
doctype: 'CRM Call Log',
|
||||||
@ -73,26 +68,6 @@ const callLogs = createResource({
|
|||||||
auto: true,
|
auto: true,
|
||||||
})
|
})
|
||||||
|
|
||||||
watch(
|
|
||||||
() => getOrderBy(),
|
|
||||||
(value, old_value) => {
|
|
||||||
if (!value && !old_value) return
|
|
||||||
callLogs.params = getParams()
|
|
||||||
callLogs.reload()
|
|
||||||
},
|
|
||||||
{ immediate: true }
|
|
||||||
)
|
|
||||||
|
|
||||||
watch(
|
|
||||||
storage,
|
|
||||||
useDebounceFn((value, old_value) => {
|
|
||||||
if (JSON.stringify([...value]) === JSON.stringify([...old_value])) return
|
|
||||||
callLogs.params = getParams()
|
|
||||||
callLogs.reload()
|
|
||||||
}, 300),
|
|
||||||
{ deep: true }
|
|
||||||
)
|
|
||||||
|
|
||||||
const rows = computed(() => {
|
const rows = computed(() => {
|
||||||
if (!callLogs.data?.data) return []
|
if (!callLogs.data?.data) return []
|
||||||
return callLogs.data.data.map((callLog) => {
|
return callLogs.data.data.map((callLog) => {
|
||||||
|
|||||||
@ -62,16 +62,11 @@ import Filter from '@/components/Filter.vue'
|
|||||||
import ViewSettings from '@/components/ViewSettings.vue'
|
import ViewSettings from '@/components/ViewSettings.vue'
|
||||||
import { FeatherIcon, Breadcrumbs, Dropdown, createResource } from 'frappe-ui'
|
import { FeatherIcon, Breadcrumbs, Dropdown, createResource } from 'frappe-ui'
|
||||||
import { organizationsStore } from '@/stores/organizations.js'
|
import { organizationsStore } from '@/stores/organizations.js'
|
||||||
import { useOrderBy } from '@/composables/orderby'
|
|
||||||
import { useFilter } from '@/composables/filter'
|
|
||||||
import { dateFormat, dateTooltipFormat, timeAgo } from '@/utils'
|
import { dateFormat, dateTooltipFormat, timeAgo } from '@/utils'
|
||||||
import { useDebounceFn } from '@vueuse/core'
|
import { ref, computed } from 'vue'
|
||||||
import { ref, computed, watch } from 'vue'
|
|
||||||
import { useRoute } from 'vue-router'
|
import { useRoute } from 'vue-router'
|
||||||
|
|
||||||
const { getOrganization } = organizationsStore()
|
const { getOrganization } = organizationsStore()
|
||||||
const { get: getOrderBy } = useOrderBy()
|
|
||||||
const { getArgs, storage } = useFilter()
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
|
|
||||||
const showContactModal = ref(false)
|
const showContactModal = ref(false)
|
||||||
@ -101,8 +96,8 @@ const currentView = ref({
|
|||||||
})
|
})
|
||||||
|
|
||||||
function getParams() {
|
function getParams() {
|
||||||
const filters = getArgs() || {}
|
const filters = {}
|
||||||
const order_by = getOrderBy() || 'modified desc'
|
const order_by = 'modified desc'
|
||||||
|
|
||||||
return {
|
return {
|
||||||
doctype: 'Contact',
|
doctype: 'Contact',
|
||||||
@ -117,26 +112,6 @@ const contacts = createResource({
|
|||||||
auto: true,
|
auto: true,
|
||||||
})
|
})
|
||||||
|
|
||||||
watch(
|
|
||||||
() => getOrderBy(),
|
|
||||||
(value, old_value) => {
|
|
||||||
if (!value && !old_value) return
|
|
||||||
contacts.params = getParams()
|
|
||||||
contacts.reload()
|
|
||||||
},
|
|
||||||
{ immediate: true }
|
|
||||||
)
|
|
||||||
|
|
||||||
watch(
|
|
||||||
storage,
|
|
||||||
useDebounceFn((value, old_value) => {
|
|
||||||
if (JSON.stringify([...value]) === JSON.stringify([...old_value])) return
|
|
||||||
contacts.params = getParams()
|
|
||||||
contacts.reload()
|
|
||||||
}, 300),
|
|
||||||
{ deep: true }
|
|
||||||
)
|
|
||||||
|
|
||||||
const rows = computed(() => {
|
const rows = computed(() => {
|
||||||
if (!contacts.data?.data) return []
|
if (!contacts.data?.data) return []
|
||||||
return contacts.data.data.map((contact) => {
|
return contacts.data.data.map((contact) => {
|
||||||
|
|||||||
@ -79,9 +79,6 @@ import ViewSettings from '@/components/ViewSettings.vue'
|
|||||||
import { usersStore } from '@/stores/users'
|
import { usersStore } from '@/stores/users'
|
||||||
import { organizationsStore } from '@/stores/organizations'
|
import { organizationsStore } from '@/stores/organizations'
|
||||||
import { statusesStore } from '@/stores/statuses'
|
import { statusesStore } from '@/stores/statuses'
|
||||||
import { useOrderBy } from '@/composables/orderby'
|
|
||||||
import { useFilter } from '@/composables/filter'
|
|
||||||
import { useDebounceFn } from '@vueuse/core'
|
|
||||||
import {
|
import {
|
||||||
dateFormat,
|
dateFormat,
|
||||||
dateTooltipFormat,
|
dateTooltipFormat,
|
||||||
@ -98,15 +95,13 @@ import {
|
|||||||
Breadcrumbs,
|
Breadcrumbs,
|
||||||
} from 'frappe-ui'
|
} from 'frappe-ui'
|
||||||
import { useRouter } from 'vue-router'
|
import { useRouter } from 'vue-router'
|
||||||
import { ref, computed, reactive, watch } from 'vue'
|
import { ref, computed, reactive } from 'vue'
|
||||||
|
|
||||||
const breadcrumbs = [{ label: 'Deals', route: { name: 'Deals' } }]
|
const breadcrumbs = [{ label: 'Deals', route: { name: 'Deals' } }]
|
||||||
|
|
||||||
const { getUser } = usersStore()
|
const { getUser } = usersStore()
|
||||||
const { getOrganization } = organizationsStore()
|
const { getOrganization } = organizationsStore()
|
||||||
const { getDealStatus } = statusesStore()
|
const { getDealStatus } = statusesStore()
|
||||||
const { get: getOrderBy } = useOrderBy()
|
|
||||||
const { getArgs, storage } = useFilter()
|
|
||||||
|
|
||||||
const currentView = ref({
|
const currentView = ref({
|
||||||
label: 'List',
|
label: 'List',
|
||||||
@ -114,8 +109,8 @@ const currentView = ref({
|
|||||||
})
|
})
|
||||||
|
|
||||||
function getParams() {
|
function getParams() {
|
||||||
const filters = getArgs() || {}
|
const filters = {}
|
||||||
const order_by = getOrderBy() || 'modified desc'
|
const order_by = 'modified desc'
|
||||||
|
|
||||||
return {
|
return {
|
||||||
doctype: 'CRM Deal',
|
doctype: 'CRM Deal',
|
||||||
@ -130,26 +125,6 @@ const deals = createResource({
|
|||||||
auto: true,
|
auto: true,
|
||||||
})
|
})
|
||||||
|
|
||||||
watch(
|
|
||||||
() => getOrderBy(),
|
|
||||||
(value, old_value) => {
|
|
||||||
if (!value && !old_value) return
|
|
||||||
deals.params = getParams()
|
|
||||||
deals.reload()
|
|
||||||
},
|
|
||||||
{ immediate: true }
|
|
||||||
)
|
|
||||||
|
|
||||||
watch(
|
|
||||||
storage,
|
|
||||||
useDebounceFn((value, old_value) => {
|
|
||||||
if (JSON.stringify([...value]) === JSON.stringify([...old_value])) return
|
|
||||||
deals.params = getParams()
|
|
||||||
deals.reload()
|
|
||||||
}, 300),
|
|
||||||
{ deep: true }
|
|
||||||
)
|
|
||||||
|
|
||||||
const rows = computed(() => {
|
const rows = computed(() => {
|
||||||
if (!deals.data?.data) return []
|
if (!deals.data?.data) return []
|
||||||
return deals.data.data.map((deal) => {
|
return deals.data.data.map((deal) => {
|
||||||
|
|||||||
@ -78,9 +78,6 @@ import ViewSettings from '@/components/ViewSettings.vue'
|
|||||||
import { usersStore } from '@/stores/users'
|
import { usersStore } from '@/stores/users'
|
||||||
import { organizationsStore } from '@/stores/organizations'
|
import { organizationsStore } from '@/stores/organizations'
|
||||||
import { statusesStore } from '@/stores/statuses'
|
import { statusesStore } from '@/stores/statuses'
|
||||||
import { useOrderBy } from '@/composables/orderby'
|
|
||||||
import { useFilter } from '@/composables/filter'
|
|
||||||
import { useDebounceFn } from '@vueuse/core'
|
|
||||||
import { dateFormat, dateTooltipFormat, timeAgo, formatTime } from '@/utils'
|
import { dateFormat, dateTooltipFormat, timeAgo, formatTime } from '@/utils'
|
||||||
import {
|
import {
|
||||||
FeatherIcon,
|
FeatherIcon,
|
||||||
@ -91,15 +88,13 @@ import {
|
|||||||
Breadcrumbs,
|
Breadcrumbs,
|
||||||
} from 'frappe-ui'
|
} from 'frappe-ui'
|
||||||
import { useRouter } from 'vue-router'
|
import { useRouter } from 'vue-router'
|
||||||
import { ref, computed, reactive, watch } from 'vue'
|
import { ref, computed, reactive } from 'vue'
|
||||||
|
|
||||||
const breadcrumbs = [{ label: 'Leads', route: { name: 'Leads' } }]
|
const breadcrumbs = [{ label: 'Leads', route: { name: 'Leads' } }]
|
||||||
|
|
||||||
const { getUser } = usersStore()
|
const { getUser } = usersStore()
|
||||||
const { getOrganization } = organizationsStore()
|
const { getOrganization } = organizationsStore()
|
||||||
const { getLeadStatus } = statusesStore()
|
const { getLeadStatus } = statusesStore()
|
||||||
const { get: getOrderBy } = useOrderBy()
|
|
||||||
const { getArgs, storage } = useFilter()
|
|
||||||
|
|
||||||
const currentView = ref({
|
const currentView = ref({
|
||||||
label: 'List',
|
label: 'List',
|
||||||
@ -107,12 +102,9 @@ const currentView = ref({
|
|||||||
})
|
})
|
||||||
|
|
||||||
function getParams() {
|
function getParams() {
|
||||||
const filters = {
|
const filters = { converted: 0 }
|
||||||
converted: 0,
|
|
||||||
...(getArgs() || {}),
|
|
||||||
}
|
|
||||||
|
|
||||||
const order_by = getOrderBy() || 'modified desc'
|
const order_by = 'modified desc'
|
||||||
|
|
||||||
return {
|
return {
|
||||||
doctype: 'CRM Lead',
|
doctype: 'CRM Lead',
|
||||||
@ -127,26 +119,6 @@ const leads = createResource({
|
|||||||
auto: true,
|
auto: true,
|
||||||
})
|
})
|
||||||
|
|
||||||
watch(
|
|
||||||
() => getOrderBy(),
|
|
||||||
(value, old_value) => {
|
|
||||||
if (!value && !old_value) return
|
|
||||||
leads.params = getParams()
|
|
||||||
leads.reload()
|
|
||||||
},
|
|
||||||
{ immediate: true }
|
|
||||||
)
|
|
||||||
|
|
||||||
watch(
|
|
||||||
storage,
|
|
||||||
useDebounceFn((value, old_value) => {
|
|
||||||
if (JSON.stringify([...value]) === JSON.stringify([...old_value])) return
|
|
||||||
leads.params = getParams()
|
|
||||||
leads.reload()
|
|
||||||
}, 300),
|
|
||||||
{ deep: true }
|
|
||||||
)
|
|
||||||
|
|
||||||
const rows = computed(() => {
|
const rows = computed(() => {
|
||||||
if (!leads.data?.data) return []
|
if (!leads.data?.data) return []
|
||||||
return leads.data.data.map((lead) => {
|
return leads.data.data.map((lead) => {
|
||||||
|
|||||||
@ -63,9 +63,6 @@ import OrganizationsListView from '@/components/ListViews/OrganizationsListView.
|
|||||||
import SortBy from '@/components/SortBy.vue'
|
import SortBy from '@/components/SortBy.vue'
|
||||||
import Filter from '@/components/Filter.vue'
|
import Filter from '@/components/Filter.vue'
|
||||||
import ViewSettings from '@/components/ViewSettings.vue'
|
import ViewSettings from '@/components/ViewSettings.vue'
|
||||||
import { useOrderBy } from '@/composables/orderby'
|
|
||||||
import { useFilter } from '@/composables/filter'
|
|
||||||
import { useDebounceFn } from '@vueuse/core'
|
|
||||||
import { FeatherIcon, Breadcrumbs, Dropdown, createResource } from 'frappe-ui'
|
import { FeatherIcon, Breadcrumbs, Dropdown, createResource } from 'frappe-ui'
|
||||||
import {
|
import {
|
||||||
dateFormat,
|
dateFormat,
|
||||||
@ -73,12 +70,10 @@ import {
|
|||||||
timeAgo,
|
timeAgo,
|
||||||
formatNumberIntoCurrency,
|
formatNumberIntoCurrency,
|
||||||
} from '@/utils'
|
} from '@/utils'
|
||||||
import { ref, computed, watch } from 'vue'
|
import { ref, computed } from 'vue'
|
||||||
import { useRoute } from 'vue-router'
|
import { useRoute } from 'vue-router'
|
||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const { get: getOrderBy } = useOrderBy()
|
|
||||||
const { getArgs, storage } = useFilter()
|
|
||||||
|
|
||||||
const showOrganizationModal = ref(false)
|
const showOrganizationModal = ref(false)
|
||||||
|
|
||||||
@ -107,8 +102,8 @@ const currentView = ref({
|
|||||||
})
|
})
|
||||||
|
|
||||||
function getParams() {
|
function getParams() {
|
||||||
const filters = getArgs() || {}
|
const filters = {}
|
||||||
const order_by = getOrderBy() || 'modified desc'
|
const order_by = 'modified desc'
|
||||||
|
|
||||||
return {
|
return {
|
||||||
doctype: 'CRM Organization',
|
doctype: 'CRM Organization',
|
||||||
@ -123,26 +118,6 @@ const organizations = createResource({
|
|||||||
auto: true,
|
auto: true,
|
||||||
})
|
})
|
||||||
|
|
||||||
watch(
|
|
||||||
() => getOrderBy(),
|
|
||||||
(value, old_value) => {
|
|
||||||
if (!value && !old_value) return
|
|
||||||
organizations.params = getParams()
|
|
||||||
organizations.reload()
|
|
||||||
},
|
|
||||||
{ immediate: true }
|
|
||||||
)
|
|
||||||
|
|
||||||
watch(
|
|
||||||
storage,
|
|
||||||
useDebounceFn((value, old_value) => {
|
|
||||||
if (JSON.stringify([...value]) === JSON.stringify([...old_value])) return
|
|
||||||
organizations.params = getParams()
|
|
||||||
organizations.reload()
|
|
||||||
}, 300),
|
|
||||||
{ deep: true }
|
|
||||||
)
|
|
||||||
|
|
||||||
const rows = computed(() => {
|
const rows = computed(() => {
|
||||||
if (!organizations.data?.data) return []
|
if (!organizations.data?.data) return []
|
||||||
return organizations.data.data.map((organization) => {
|
return organizations.data.data.map((organization) => {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user