From 2b26e1a5b9f5e980d163343298bf08f961e2fcc6 Mon Sep 17 00:00:00 2001 From: Ramesh Mane <101566080+rameshmane7218@users.noreply.github.com> Date: Sun, 4 Aug 2024 10:20:16 +0530 Subject: [PATCH] Nc fix/show inherited role in project members table (#9134) * fix(nc-gui): show inherted workspace role at project level * fix(nc-gui): update project members table role selector * fix(nc-gui): rebase conflict issue --- .../components/project/AccessSettings.vue | 1 + packages/nc-gui/components/roles/Selector.vue | 37 ++++++++++++++++--- packages/nc-gui/lang/en.json | 3 +- 3 files changed, 35 insertions(+), 6 deletions(-) diff --git a/packages/nc-gui/components/project/AccessSettings.vue b/packages/nc-gui/components/project/AccessSettings.vue index ebed374551..7f993778c1 100644 --- a/packages/nc-gui/components/project/AccessSettings.vue +++ b/packages/nc-gui/components/project/AccessSettings.vue @@ -357,6 +357,7 @@ const customRow = (record: Record) => ({ ? WorkspaceRolesToProjectRoles[record.workspace_roles] : null " + show-inherit :description="false" :on-role-change="(role) => updateCollaborator(record, role as ProjectRoles)" /> diff --git a/packages/nc-gui/components/roles/Selector.vue b/packages/nc-gui/components/roles/Selector.vue index b87631abdf..4dd5c54b6e 100644 --- a/packages/nc-gui/components/roles/Selector.vue +++ b/packages/nc-gui/components/roles/Selector.vue @@ -5,23 +5,26 @@ import type { SelectValue } from 'ant-design-vue/es/select' const props = withDefaults( defineProps<{ - border?: boolean role: keyof typeof RoleLabels roles: (keyof typeof RoleLabels)[] + onRoleChange: (role: keyof typeof RoleLabels) => void + border?: boolean description?: boolean inherit?: string - onRoleChange: (role: keyof typeof RoleLabels) => void size?: 'sm' | 'md' | 'lg' + showInherit?: boolean }>(), { border: true, description: true, size: 'sm', + showInherit: false, }, ) const roleRef = toRef(props, 'role') const inheritRef = toRef(props, 'inherit') +const showInherit = toRef(props, 'showInherit') const descriptionRef = toRef(props, 'description') const isDropdownOpen = ref(false) const dropdownRef = ref(null) @@ -36,14 +39,38 @@ function onChangeRole(val: SelectValue) {