fix: removed default view button from view control
This commit is contained in:
parent
feb5536ec8
commit
38f2d75816
@ -83,7 +83,6 @@ import ViewModal from '@/components/Modals/ViewModal.vue'
|
|||||||
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 ColumnSettings from '@/components/ColumnSettings.vue'
|
import ColumnSettings from '@/components/ColumnSettings.vue'
|
||||||
import { createToast } from '@/utils'
|
|
||||||
import { globalStore } from '@/stores/global'
|
import { globalStore } from '@/stores/global'
|
||||||
import { viewsStore } from '@/stores/views'
|
import { viewsStore } from '@/stores/views'
|
||||||
import { usersStore } from '@/stores/users'
|
import { usersStore } from '@/stores/users'
|
||||||
@ -104,7 +103,7 @@ const props = defineProps({
|
|||||||
})
|
})
|
||||||
|
|
||||||
const { $dialog } = globalStore()
|
const { $dialog } = globalStore()
|
||||||
const { reload: reloadView, getView, getDefaultView } = viewsStore()
|
const { reload: reloadView, getView } = viewsStore()
|
||||||
const { isManager } = usersStore()
|
const { isManager } = usersStore()
|
||||||
|
|
||||||
const list = defineModel()
|
const list = defineModel()
|
||||||
@ -362,20 +361,6 @@ const viewActions = computed(() => {
|
|||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
let defaultView = getDefaultView()
|
|
||||||
if (
|
|
||||||
!defaultView ||
|
|
||||||
(route.query.view && route.query.view != defaultView.name) ||
|
|
||||||
(!route.query.view &&
|
|
||||||
(defaultView.route_name != route.name || defaultView.is_view))
|
|
||||||
) {
|
|
||||||
actions[0].items.push({
|
|
||||||
label: 'Make Default',
|
|
||||||
icon: () => h(FeatherIcon, { name: 'star', class: 'h-4 w-4' }),
|
|
||||||
onClick: () => makeDefault(),
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
if (route.query.view && (!view.value.public || isManager())) {
|
if (route.query.view && (!view.value.public || isManager())) {
|
||||||
actions[0].items.push(
|
actions[0].items.push(
|
||||||
{
|
{
|
||||||
@ -431,21 +416,6 @@ const viewActions = computed(() => {
|
|||||||
return actions
|
return actions
|
||||||
})
|
})
|
||||||
|
|
||||||
function makeDefault() {
|
|
||||||
call('crm.fcrm.doctype.crm_view_settings.crm_view_settings.make_default', {
|
|
||||||
name: route.query.view || '',
|
|
||||||
doctype: props.doctype,
|
|
||||||
route_name: route.name,
|
|
||||||
}).then(() => {
|
|
||||||
createToast({
|
|
||||||
title: 'Default View Set',
|
|
||||||
icon: 'check',
|
|
||||||
iconClasses: 'text-green-600',
|
|
||||||
})
|
|
||||||
reloadView()
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
function duplicateView() {
|
function duplicateView() {
|
||||||
view.value.name = ''
|
view.value.name = ''
|
||||||
view.value.label = getView(route.query.view).label + ' New'
|
view.value.label = getView(route.query.view).label + ' New'
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user