From 3b1f76da75559b65909493f43a848053ebdc7605 Mon Sep 17 00:00:00 2001 From: Muhammed Mustafa Date: Fri, 22 Sep 2023 15:21:22 +0530 Subject: [PATCH 1/5] fix: Fixed sidebar node context menu based on ACL and added tests for it based on roles --- packages/nc-gui/assets/style.scss | 4 + .../components/dashboard/Sidebar/UserInfo.vue | 2 +- .../dashboard/TreeView/BaseOptions.vue | 2 +- .../dashboard/TreeView/ProjectNode.vue | 68 +++--- .../dashboard/TreeView/TableNode.vue | 7 +- .../smartsheet/toolbar/ViewActions.vue | 4 +- packages/nc-gui/lib/acl.ts | 10 +- .../Dashboard/Grid/Column/LTAR/LinkRecord.ts | 2 +- .../pages/Dashboard/Grid/Column/index.ts | 6 +- .../playwright/pages/Dashboard/Grid/index.ts | 2 +- .../pages/Dashboard/Settings/Acl.ts | 2 +- .../Dashboard/Sidebar/ProjectNode/index.ts | 131 +++++++++++ .../Dashboard/Sidebar/TableNode/index.ts | 69 ++++++ .../pages/Dashboard/Sidebar/UserMenu/index.ts | 2 +- .../pages/Dashboard/Sidebar/index.ts | 30 ++- tests/playwright/pages/Dashboard/TreeView.ts | 2 +- .../pages/Dashboard/common/Cell/index.ts | 9 +- tests/playwright/pages/SharedForm/index.ts | 2 +- tests/playwright/setup/index.ts | 20 +- .../db/features/projectCollaboration.spec.ts | 204 ++++++++++++++++++ 20 files changed, 516 insertions(+), 62 deletions(-) create mode 100644 tests/playwright/pages/Dashboard/Sidebar/ProjectNode/index.ts create mode 100644 tests/playwright/pages/Dashboard/Sidebar/TableNode/index.ts create mode 100644 tests/playwright/tests/db/features/projectCollaboration.spec.ts diff --git a/packages/nc-gui/assets/style.scss b/packages/nc-gui/assets/style.scss index 5dee33bf42..3ba970b751 100644 --- a/packages/nc-gui/assets/style.scss +++ b/packages/nc-gui/assets/style.scss @@ -583,3 +583,7 @@ input[type='number'] { .ant-pagination .ant-pagination-item-link-icon { @apply !block !py-1.5; } + +.nc-button.ant-btn.nc-sidebar-node-btn { + @apply opacity-0 group-hover:(opacity-100) text-gray-600 hover:(bg-gray-400 bg-opacity-20 text-gray-900) duration-100; +} diff --git a/packages/nc-gui/components/dashboard/Sidebar/UserInfo.vue b/packages/nc-gui/components/dashboard/Sidebar/UserInfo.vue index 2c4337caa6..700c82b8ab 100644 --- a/packages/nc-gui/components/dashboard/Sidebar/UserInfo.vue +++ b/packages/nc-gui/components/dashboard/Sidebar/UserInfo.vue @@ -78,7 +78,7 @@ onMounted(() => {