Browse Source

Merge pull request #6460 from nocodb/fix/disable-insert-row

fix: disable insert row option from cell context menu
pull/6469/head
Raju Udava 12 months ago committed by GitHub
parent
commit
3f6cb22eb6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  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