Browse Source

feat(nc-gui): kanban v-e

pull/3818/head
Wing-Kam Wong 2 years ago
parent
commit
a03d52b325
  1. 2
      packages/nc-gui/components/smartsheet-toolbar/KanbanStackEditOrAdd.vue
  2. 6
      packages/nc-gui/components/smartsheet-toolbar/StackedBy.vue
  3. 10
      packages/nc-gui/components/smartsheet/Kanban.vue
  4. 3
      packages/nc-gui/composables/useKanbanViewData.ts

2
packages/nc-gui/components/smartsheet-toolbar/KanbanStackEditOrAdd.vue

@ -29,7 +29,7 @@ provide(IsKanbanInj, ref(true))
>
<div class="nc-kanban-btn">
<a-button
v-e="['c:kanban-stack-edit-or-add']"
v-e="['c:kanban:edit-or-add-stack']"
class="nc-kanban-add-edit-stack-menu-btn nc-toolbar-btn"
:disabled="isLocked"
>

6
packages/nc-gui/components/smartsheet-toolbar/StackedBy.vue

@ -80,7 +80,11 @@ const handleChange = () => {
overlay-class-name="nc-dropdown-kanban-stacked-by-menu"
>
<div class="nc-kanban-btn">
<a-button v-e="['c:stacked-by']" class="nc-kanban-stacked-by-menu-btn nc-toolbar-btn" :disabled="isLocked">
<a-button
v-e="['c:kanban:change-grouping-field']"
class="nc-kanban-stacked-by-menu-btn nc-toolbar-btn"
:disabled="isLocked"
>
<div class="flex items-center gap-1">
<mdi-arrow-down-drop-circle-outline />
<span class="text-capitalize !text-sm font-weight-normal">

10
packages/nc-gui/components/smartsheet/Kanban.vue

@ -269,6 +269,7 @@ onMounted(async () => {
<a-menu class="ml-6 !text-sm !px-0 !py-2 !rounded">
<a-menu-item
v-if="isUIAllowed('xcDatatableEditable')"
v-e="['c:kanban:add-new-record']"
@click="openNewRecordFormHook.trigger(stack.title === 'uncategorized' ? null : stack.title)"
>
<div class="py-2 flex gap-2 items-center">
@ -276,7 +277,7 @@ onMounted(async () => {
{{ $t('activity.addNewRecord') }}
</div>
</a-menu-item>
<a-menu-item @click="handleCollapseStack(stackIdx)">
<a-menu-item v-e="['c:kanban:collapse-stack']" @click="handleCollapseStack(stackIdx)">
<div class="py-2 flex gap-2 items-center">
<mdi-arrow-collapse class="text-gray-500" />
{{ $t('activity.kanban.collapseStack') }}
@ -284,6 +285,7 @@ onMounted(async () => {
</a-menu-item>
<a-menu-item
v-if="stack.title !== 'uncategorized' && isUIAllowed('xcDatatableEditable')"
v-e="['c:kanban:delete-stack']"
@click="handleDeleteStackClick(stack.title, stackIdx)"
>
<div class="py-2 flex gap-2 items-center">
@ -426,8 +428,10 @@ onMounted(async () => {
{{ $t('msg.info.deleteKanbanStackConfirmation', { stackToBeDeleted, groupingField }) }}
</div>
<template #footer>
<a-button key="back" @click="deleteStackVModel = false">{{ $t('general.cancel') }}</a-button>
<a-button key="submit" type="primary" @click="handleDeleteStackConfirmClick">
<a-button key="back" v-e="['c:kanban:cancel-delete-stack']" @click="deleteStackVModel = false">
{{ $t('general.cancel') }}
</a-button>
<a-button key="submit" v-e="['c:kanban:confirm-delete-stack']" type="primary" @click="handleDeleteStackConfirmClick">
{{ $t('general.delete') }}
</a-button>
</template>

3
packages/nc-gui/composables/useKanbanViewData.ts

@ -18,7 +18,7 @@ export function useKanbanViewData(
const { t } = useI18n()
const { api } = useApi()
const { project } = useProject()
const { $api } = useNuxtApp()
const { $e, $api } = useNuxtApp()
const { sorts, nestedFilters } = useSmartsheetStoreOrThrow()
const { sharedView, fetchSharedViewData } = useSharedView()
const { isUIAllowed } = useUIPermission()
@ -363,6 +363,7 @@ export function useKanbanViewData(
stackMetaObj.value[kanbanMetaData.value.grp_column_id!].splice(stackIdx, 1)
groupingFieldColOptions.value.splice(stackIdx, 1)
await updateKanbanStackMeta()
$e('a:kanban:delete-stack')
} catch (e: any) {
message.error(await extractSdkResponseErrorMsg(e))
}

Loading…
Cancel
Save