Browse Source

refactor(gui): show clear cell option for LTAR

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/4046/head
Pranav C 2 years ago
parent
commit
c32a1814d5
  1. 8
      packages/nc-gui/components/smartsheet/Grid.vue
  2. 3
      packages/nc-gui/components/smartsheet/column/FormulaOptions.vue

8
packages/nc-gui/components/smartsheet/Grid.vue

@ -273,8 +273,6 @@ const showContextMenu = (e: MouseEvent, target?: { row: number; col: number }) =
} }
} }
const rowRefs = $ref<any[]>()
const saveOrUpdateRecords = async (args: { metaValue?: TableType; viewMetaValue?: ViewType; data?: any } = {}) => { const saveOrUpdateRecords = async (args: { metaValue?: TableType; viewMetaValue?: ViewType; data?: any } = {}) => {
let index = -1 let index = -1
for (const currentRow of args.data || data.value) { for (const currentRow of args.data || data.value) {
@ -581,7 +579,11 @@ watch(
<!-- Clear cell --> <!-- Clear cell -->
<a-menu-item <a-menu-item
v-if="contextMenuTarget && !isVirtualCol(fields[contextMenuTarget.col])" v-if="
contextMenuTarget &&
(fields[contextMenuTarget.col].uidt === UITypes.LinkToAnotherRecord ||
!isVirtualCol(fields[contextMenuTarget.col]))
"
@click="clearCell(contextMenuTarget, fields[contextMenuTarget.col])" @click="clearCell(contextMenuTarget, fields[contextMenuTarget.col])"
> >
<div v-e="['a:row:clear']" class="nc-project-menu-item">{{ $t('activity.clearCell') }}</div> <div v-e="['a:row:clear']" class="nc-project-menu-item">{{ $t('activity.clearCell') }}</div>

3
packages/nc-gui/components/smartsheet/column/FormulaOptions.vue

@ -257,7 +257,8 @@ function validateAgainstMeta(parsedTree: any, errors = new Set(), typeErrors = n
const neighbours = [ const neighbours = [
...new Set( ...new Set(
(c.colOptions.formula.match(/cl_\w{14}/g) || []).filter( (c.colOptions.formula.match(/cl_\w{14}/g) || []).filter(
(colId: string) => columns.value.filter((col: ColumnType) => col.id === colId && col.uidt === UITypes.Formula).length, (colId: string) =>
columns.value.filter((col: ColumnType) => col.id === colId && col.uidt === UITypes.Formula).length,
), ),
), ),
] ]

Loading…
Cancel
Save