Browse Source

chore(nc-gui): remove unnecessary ? operators

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

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

@ -70,7 +70,7 @@ const getIcon = (c: ColumnType) =>
})
const groupingFieldColumnId = computed({
get: () => kanbanMetaData?.value?.grp_column_id,
get: () => kanbanMetaData.value.grp_column_id,
set: async (val) => {
if (val) {
await updateKanbanMeta({
@ -78,7 +78,7 @@ const groupingFieldColumnId = computed({
})
await loadKanbanMeta()
await loadKanbanData()
;(activeView.value?.view as KanbanType).grp_column_id = val
;(activeView.value.view as KanbanType).grp_column_id = val
}
},
})

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

@ -267,8 +267,8 @@ openNewRecordFormHook?.on(async () => {
<div v-if="formattedData[stack.title]" class="mt-5 text-center">
<mdi-plus class="text-pint-500 text-lg text-primary cursor-pointer" @click="openNewRecordFormHook.trigger()" />
<div class="nc-kanban-data-count">
{{ formattedData[stack.title]?.length }}
{{ formattedData[stack.title]?.length !== 1 ? $t('objects.records') : $t('objects.record') }}
{{ formattedData[stack.title].length }}
{{ formattedData[stack.title].length !== 1 ? $t('objects.records') : $t('objects.record') }}
</div>
</div>
</a-layout-footer>

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

@ -107,7 +107,7 @@ export function useKanbanViewData(
} else {
// build stack meta
groupingFieldColOptions.value = [
...(groupingFieldColumn.value?.colOptions?.options ?? []),
...(groupingFieldColumn.value.colOptions.options ?? []),
// enrich uncategorized stack
{ id: 'uncategorized', title: 'Uncategorized', order: 0, color: enumColor.light[2] },
].sort((a: Record<string, any>, b: Record<string, any>) => a.order - b.order)

Loading…
Cancel
Save