fix: rename view
This commit is contained in:
parent
c46c5d3736
commit
ca3a2bbf8e
@ -65,6 +65,7 @@
|
|||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
|
import EditIcon from '@/components/Icons/EditIcon.vue'
|
||||||
import DuplicateIcon from '@/components/Icons/DuplicateIcon.vue'
|
import DuplicateIcon from '@/components/Icons/DuplicateIcon.vue'
|
||||||
import PinIcon from '@/components/Icons/PinIcon.vue'
|
import PinIcon from '@/components/Icons/PinIcon.vue'
|
||||||
import UnpinIcon from '@/components/Icons/UnpinIcon.vue'
|
import UnpinIcon from '@/components/Icons/UnpinIcon.vue'
|
||||||
@ -295,19 +296,26 @@ const viewActions = computed(() => {
|
|||||||
{
|
{
|
||||||
label: 'Duplicate',
|
label: 'Duplicate',
|
||||||
icon: () => h(DuplicateIcon, { class: 'h-4 w-4' }),
|
icon: () => h(DuplicateIcon, { class: 'h-4 w-4' }),
|
||||||
onClick: () => setupDuplicate(),
|
onClick: () => duplicateView(),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
if (route.query.view) {
|
if (route.query.view) {
|
||||||
actions[0].items.push({
|
actions[0].items.push(
|
||||||
label: view.value.pinned ? 'Unpin View' : 'Pin View',
|
{
|
||||||
icon: () =>
|
label: 'Rename',
|
||||||
h(view.value.pinned ? UnpinIcon : PinIcon, { class: 'h-4 w-4' }),
|
icon: () => h(EditIcon, { class: 'h-4 w-4' }),
|
||||||
onClick: () => pinView(),
|
onClick: () => renameView(),
|
||||||
})
|
},
|
||||||
|
{
|
||||||
|
label: view.value.pinned ? 'Unpin View' : 'Pin View',
|
||||||
|
icon: () =>
|
||||||
|
h(view.value.pinned ? UnpinIcon : PinIcon, { class: 'h-4 w-4' }),
|
||||||
|
onClick: () => pinView(),
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
actions.push({
|
actions.push({
|
||||||
group: 'Delete View',
|
group: 'Delete View',
|
||||||
@ -337,12 +345,18 @@ const viewActions = computed(() => {
|
|||||||
return actions
|
return actions
|
||||||
})
|
})
|
||||||
|
|
||||||
function setupDuplicate() {
|
function duplicateView() {
|
||||||
view.value.name = ''
|
view.value.name = ''
|
||||||
view.value.label = view.value.label + ' New'
|
view.value.label = view.value.label + ' New'
|
||||||
showViewModal.value = true
|
showViewModal.value = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function renameView() {
|
||||||
|
view.value.name = route.query.view
|
||||||
|
view.value.label = getView(route.query.view).label
|
||||||
|
showViewModal.value = true
|
||||||
|
}
|
||||||
|
|
||||||
function pinView() {
|
function pinView() {
|
||||||
call('crm.fcrm.doctype.crm_view_settings.crm_view_settings.pin', {
|
call('crm.fcrm.doctype.crm_view_settings.crm_view_settings.pin', {
|
||||||
name: route.query.view,
|
name: route.query.view,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user