Browse Source

Merge pull request #5419 from gitstart/NCDBOSS-39

🔦 Feature:  Confirmation on delete record
feat/export-nest-pw
աɨռɢӄաօռɢ 2 years ago committed by GitHub
parent
commit
95a079ff3a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 19
      packages/nc-gui/components/smartsheet/Grid.vue
  2. 1
      tests/playwright/pages/Dashboard/Grid/index.ts

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

@ -752,6 +752,23 @@ const closeAddColumnDropdown = () => {
columnOrder.value = null
addColumnDropdown.value = false
}
const confirmDeleteRow = (row: number) => {
Modal.confirm({
title: `Do you want to delete this row?`,
wrapClassName: 'nc-modal-row-delete',
okText: 'Yes',
okType: 'danger',
cancelText: 'No',
onOk() {
try {
deleteRow(row)
} catch (e: any) {
message.error(e.message)
}
},
})
}
</script>
<template>
@ -973,7 +990,7 @@ const closeAddColumnDropdown = () => {
<template v-if="!isLocked && hasEditPermission" #overlay>
<a-menu class="shadow !rounded !py-0" @click="contextMenu = false">
<a-menu-item v-if="contextMenuTarget" @click="deleteRow(contextMenuTarget.row)">
<a-menu-item v-if="contextMenuTarget" @click="confirmDeleteRow(contextMenuTarget.row)">
<div v-e="['a:row:delete']" class="nc-project-menu-item">
<!-- Delete Row -->
{{ $t('activity.deleteRow') }}

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

@ -151,6 +151,7 @@ export class GridPage extends BasePage {
// Click text=Delete Row
await this.rootPage.locator('text=Delete Row').click();
await this.rootPage.locator('text=Yes').click();
// todo: improve selector
await this.rootPage
.locator('span.ant-dropdown-menu-title-content > nc-project-menu-item')

Loading…
Cancel
Save