{
@click="changeField(field, $event)"
>
@@ -927,7 +955,13 @@ const onFieldOptionUpdate = () => {
@click="changeField(displayColumn, $event)"
>
@@ -1810,8 +1802,7 @@ onKeyStroke('ArrowDown', onDown)
>
@@ -1827,8 +1818,7 @@ onKeyStroke('ArrowDown', onDown)
diff --git a/packages/nc-gui/components/smartsheet/header/Cell.vue b/packages/nc-gui/components/smartsheet/header/Cell.vue
index be95ede623..2c48516fe8 100644
--- a/packages/nc-gui/components/smartsheet/header/Cell.vue
+++ b/packages/nc-gui/components/smartsheet/header/Cell.vue
@@ -17,6 +17,8 @@ const hideMenu = toRef(props, 'hideMenu')
const isForm = inject(IsFormInj, ref(false))
+const isLocked = inject(IsLockedInj, ref(false))
+
const isSurveyForm = inject(IsSurveyFormInj, ref(false))
const isExpandedForm = inject(IsExpandedFormOpenInj, ref(false))
@@ -46,12 +48,16 @@ const closeAddColumnDropdown = () => {
}
const openHeaderMenu = () => {
+ if (isLocked.value) return
+
if (!isForm.value && !isExpandedForm.value && isUIAllowed('fieldEdit') && !isMobileMode.value) {
editColumnDropdown.value = true
}
}
const openDropDown = (e: Event) => {
+ if (isLocked.value) return
+
if (isForm.value || isExpandedForm.value || (!isUIAllowed('fieldEdit') && !isMobileMode.value)) return
e.preventDefault()
diff --git a/packages/nc-gui/components/smartsheet/header/VirtualCell.vue b/packages/nc-gui/components/smartsheet/header/VirtualCell.vue
index 62d595a52c..9b0c4d390e 100644
--- a/packages/nc-gui/components/smartsheet/header/VirtualCell.vue
+++ b/packages/nc-gui/components/smartsheet/header/VirtualCell.vue
@@ -36,6 +36,8 @@ const editColumnDropdown = ref(false)
const isDropDownOpen = ref(false)
+const isLocked = inject(IsLockedInj, ref(false))
+
provide(ColumnInj, column)
const { metas } = useMetas()
@@ -124,12 +126,16 @@ const closeAddColumnDropdown = () => {
}
const openHeaderMenu = () => {
+ if (isLocked.value) return
+
if (!isForm.value && !isExpandedForm.value && isUIAllowed('fieldEdit') && !isMobileMode.value) {
editColumnDropdown.value = true
}
}
const openDropDown = (e: Event) => {
+ if (isLocked.value) return
+
if (isForm.value || isExpandedForm.value || (!isUIAllowed('fieldEdit') && !isMobileMode.value)) return
e.preventDefault()
diff --git a/packages/nc-gui/components/smartsheet/toolbar/ViewActionMenu.vue b/packages/nc-gui/components/smartsheet/toolbar/ViewActionMenu.vue
index e93b9eaa6b..7616aaf08e 100644
--- a/packages/nc-gui/components/smartsheet/toolbar/ViewActionMenu.vue
+++ b/packages/nc-gui/components/smartsheet/toolbar/ViewActionMenu.vue
@@ -18,8 +18,6 @@ const { isUIAllowed } = useRoles()
const isPublicView = inject(IsPublicInj, ref(false))
-const isLocked = inject(IsLockedInj, ref(false))
-
const { $api, $e } = useNuxtApp()
const { t } = useI18n()
@@ -58,7 +56,7 @@ const quickImportDialogs: Record<(typeof quickImportDialogTypes)[number], Ref>
const onImportClick = (dialog: any) => {
- if (isLocked.value) return
+ if (lockType.value === LockType.Locked) return
emits('closeModal')
dialog.value = true
@@ -163,10 +161,17 @@ const onDelete = async () => {
-
+
{{ $t('activity.renameView') }}
+
+ {{ $t('msg.info.disabledAsViewLocked') }}
+
+
+ {{ $t('activity.renameView') }}
+
+
{{ $t('labels.duplicateView') }}
@@ -205,7 +210,7 @@ const onDelete = async () => {
},
]"
class="nc-base-menu-item"
- :class="{ disabled: isLocked }"
+ :class="{ disabled: lockType === LockType.Locked }"
>
{{ `${$t('general.upload')} ${type.toUpperCase()}` }}
@@ -274,7 +279,18 @@ const onDelete = async () => {
-
+
+ {{ $t('msg.info.disabledAsViewLocked') }}
+
+
+ {{
+ $t('general.deleteEntity', {
+ entity: $t('objects.view'),
+ })
+ }}
+
+
+
{{
$t('general.deleteEntity', {
diff --git a/packages/nc-gui/components/virtual-cell/BelongsTo.vue b/packages/nc-gui/components/virtual-cell/BelongsTo.vue
index 0e21901103..0049ec7fc7 100644
--- a/packages/nc-gui/components/virtual-cell/BelongsTo.vue
+++ b/packages/nc-gui/components/virtual-cell/BelongsTo.vue
@@ -6,7 +6,6 @@ import {
CellValueInj,
ColumnInj,
IsFormInj,
- IsLockedInj,
IsUnderLookupInj,
ReadonlyInj,
ReloadRowDataHookInj,
@@ -35,8 +34,6 @@ const readOnly = inject(ReadonlyInj, ref(false))
const isForm = inject(IsFormInj, ref(false))
-const isLocked = inject(IsLockedInj, ref(false))
-
const isUnderLookup = inject(IsUnderLookupInj, ref(false))
const { isUIAllowed } = useRoles()
@@ -103,7 +100,7 @@ const belongsToColumn = computed(
-
+
column.value?.title || '')
@@ -79,15 +77,13 @@ const onAttachRecord = () => {
const openChildList = () => {
if (isUnderLookup.value) return
- if (!isLocked.value) {
- childListDlg.value = true
- }
+ childListDlg.value = true
}
useSelectedCellKeyupListener(inject(ActiveCellInj, ref(false)), (e: KeyboardEvent) => {
switch (e.key) {
case 'Enter':
- if (isLocked.value || listItemsDlg.value) return
+ if (listItemsDlg.value) return
childListDlg.value = true
e.stopPropagation()
break
@@ -112,7 +108,7 @@ const openListDlg = () => {
{
-
+
-
+
-
+
{
},
})
+ const isActiveViewLocked = computed(() => activeView.value?.lock_type === 'locked')
+
// Used for Grid View Pagination
const isPaginationLoading = ref(true)
@@ -317,6 +319,7 @@ export const useViewsStore = defineStore('viewsStore', () => {
removeFromRecentViews,
activeSorts,
activeNestedFilters,
+ isActiveViewLocked,
}
})
diff --git a/tests/playwright/pages/Dashboard/Grid/index.ts b/tests/playwright/pages/Dashboard/Grid/index.ts
index 3c4d6e62dc..e377f2a75e 100644
--- a/tests/playwright/pages/Dashboard/Grid/index.ts
+++ b/tests/playwright/pages/Dashboard/Grid/index.ts
@@ -55,7 +55,7 @@ export class GridPage extends BasePage {
async verifyLockMode() {
// add new row button
- expect(await this.btn_addNewRow.count()).toBe(0);
+ expect(await this.btn_addNewRow.count()).toBe(1);
await this.toolbar.verifyLockMode();
await this.footbar.verifyLockMode();
diff --git a/tests/playwright/pages/Dashboard/common/Footbar/index.ts b/tests/playwright/pages/Dashboard/common/Footbar/index.ts
index df4349dd27..f0e6c6e438 100644
--- a/tests/playwright/pages/Dashboard/common/Footbar/index.ts
+++ b/tests/playwright/pages/Dashboard/common/Footbar/index.ts
@@ -45,7 +45,7 @@ export class FootbarPage extends BasePage {
async verifyLockMode() {
// add record button
- await expect(this.btn_addNewRow).toBeVisible({ visible: false });
+ await expect(this.btn_addNewRow).toBeVisible({ visible: true });
}
async verifyCollaborativeMode() {
diff --git a/tests/playwright/pages/Dashboard/common/Toolbar/ViewMenu.ts b/tests/playwright/pages/Dashboard/common/Toolbar/ViewMenu.ts
index 477713a47a..37d509e9cd 100644
--- a/tests/playwright/pages/Dashboard/common/Toolbar/ViewMenu.ts
+++ b/tests/playwright/pages/Dashboard/common/Toolbar/ViewMenu.ts
@@ -86,6 +86,9 @@ export class ToolbarViewMenuPage extends BasePage {
// todo: Move verification out of the click method
async click({ menu, subMenu, verificationInfo }: { menu: string; subMenu?: string; verificationInfo?: any }) {
await this.viewsMenuBtn.click();
+
+ await this.rootPage.waitForTimeout(1000);
+
await this.get().locator(`.ant-dropdown-menu-title-content:has-text("${menu}")`).first().click();
if (subMenu) {
// for CSV download, pass locator instead of clicking it here
diff --git a/tests/playwright/tests/db/general/viewMenu.spec.ts b/tests/playwright/tests/db/general/viewMenu.spec.ts
index ca3ef4fbae..fc6b931fa8 100644
--- a/tests/playwright/tests/db/general/viewMenu.spec.ts
+++ b/tests/playwright/tests/db/general/viewMenu.spec.ts
@@ -23,7 +23,7 @@ test.describe('Grid view locked', () => {
// enable view lock
await dashboard.grid.toolbar.viewsMenu.click({
- menu: 'Collaborative',
+ menu: 'View Mode',
subMenu: 'Locked',
});
@@ -32,7 +32,7 @@ test.describe('Grid view locked', () => {
// enable collaborative view
await dashboard.grid.toolbar.viewsMenu.click({
- menu: 'Locked',
+ menu: 'View Mode',
subMenu: 'Collaborative',
});