Browse Source

fix: disable insert row option from cell context menu

Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com>
pull/6460/head
Raju Udava 1 year ago
parent
commit
b3b1dfbd50
  1. 12
      packages/nc-gui/components/smartsheet/Gallery.vue
  2. 14
      packages/nc-gui/components/smartsheet/grid/Table.vue
  3. 4
      tests/playwright/pages/Dashboard/Grid/index.ts
  4. 2
      tests/playwright/tests/db/general/tableColumnOperation.spec.ts

12
packages/nc-gui/components/smartsheet/Gallery.vue

@ -218,12 +218,12 @@ watch(
</div>
</a-menu-item>
<a-menu-item v-if="contextMenuTarget" @click="openNewRecordFormHook.trigger()">
<div v-e="['a:row:insert']" class="nc-project-menu-item">
<!-- Insert New Row -->
{{ $t('activity.insertRow') }}
</div>
</a-menu-item>
<!-- <a-menu-item v-if="contextMenuTarget" @click="openNewRecordFormHook.trigger()"> -->
<!-- <div v-e="['a:row:insert']" class="nc-project-menu-item"> -->
<!-- &lt;!&ndash; Insert New Row &ndash;&gt; -->
<!-- {{ $t('activity.insertRow') }} -->
<!-- </div> -->
<!-- </a-menu-item> -->
</a-menu>
</template>

14
packages/nc-gui/components/smartsheet/grid/Table.vue

@ -1507,13 +1507,13 @@ const expandAndLooseFocus = (row: Row, col: Record<string, any>) => {
</div>
</a-menu-item>
<a-menu-item v-if="contextMenuTarget && selectedRange.isSingleCell()" @click="addEmptyRow(contextMenuTarget.row + 1)">
<div v-e="['a:row:insert']" class="nc-project-menu-item">
<GeneralIcon icon="plus" />
<!-- Insert New Row -->
{{ $t('activity.insertRow') }}
</div>
</a-menu-item>
<!-- <a-menu-item v-if="contextMenuTarget && selectedRange.isSingleCell()" @click="addEmptyRow(contextMenuTarget.row + 1)"> -->
<!-- <div v-e="['a:row:insert']" class="nc-project-menu-item"> -->
<!-- <GeneralIcon icon="plus" /> -->
<!-- &lt;!&ndash; Insert New Row &ndash;&gt; -->
<!-- {{ $t('activity.insertRow') }} -->
<!-- </div> -->
<!-- </a-menu-item> -->
<a-menu-item v-if="contextMenuTarget" data-testid="context-menu-item-copy" @click="copyValue(contextMenuTarget)">
<div v-e="['a:row:copy']" class="nc-project-menu-item">

4
tests/playwright/pages/Dashboard/Grid/index.ts

@ -364,7 +364,7 @@ export class GridPage extends BasePage {
await this.get().locator(`td[data-testid="cell-${columnHeader}-0"]`).click({
button: 'right',
});
await expect(this.rootPage.locator('text=Insert New Row')).not.toBeVisible();
// await expect(this.rootPage.locator('text=Insert New Row')).not.toBeVisible();
// in cell-add
await this.cell.get({ index: 0, columnHeader: 'Cities' }).hover();
@ -395,7 +395,7 @@ export class GridPage extends BasePage {
await this.get().locator(`td[data-testid="cell-${columnHeader}-0"]`).click({
button: 'right',
});
await expect(this.rootPage.locator('text=Insert New Row')).toBeVisible();
// await expect(this.rootPage.locator('text=Insert New Row')).toBeVisible();
// in cell-add
await this.cell.get({ index: 0, columnHeader: 'Cities' }).hover();

2
tests/playwright/tests/db/general/tableColumnOperation.spec.ts

@ -69,6 +69,6 @@ test.describe('Table Column Operations', () => {
});
// add new row using right-click menu
await grid.addRowRightClickMenu(0);
// await grid.addRowRightClickMenu(0);
});
});

Loading…
Cancel
Save