Skip to content

πŸ”₯ πŸ”₯ πŸ”₯ A Free & Self-hostable Airtable Alternative

fix(nc-gui): show user icon in place of placeholder personal view user icon

Ramesh Mane3800f0f8a17a
diff --git a/packages/nc-gui/components/dashboard/TreeView/Views/Node.vue b/packages/nc-gui/components/dashboard/TreeView/Views/Node.vue
index 287a5d1d72..7be98d42ff 100644
--- a/packages/nc-gui/components/dashboard/TreeView/Views/Node.vue
+++ b/packages/nc-gui/components/dashboard/TreeView/Views/Node.vue
@@ -387,7 +387,19 @@ watch(isDropdownOpen, async () => {
</div>
</NcTooltip>
<div v-if="!isEditing && [LockType.Locked, ViewLockType.Personal].includes(vModel?.lock_type)" class="flex-1 flex">
+ <div
+ v-if="vModel.lock_type === ViewLockType.Personal && vModel.owned_by && idUserMap[vModel.owned_by]"
+ class="flex items-center justify-center"
+ >
+ <GeneralUserIcon
+ :user="idUserMap[vModel.owned_by]"
+ size="auto"
+ class="flex-none !text-[7px] !h-[14px] !min-h-[14px]"
+ />
+ </div>
+
<component
+ v-else
:is="viewLockIcons[vModel.lock_type].icon"
class="ml-1 flex-none w-3.5 h-3.5"
:class="{
diff --git a/packages/nc-gui/components/smartsheet/toolbar/ViewInfo.vue b/packages/nc-gui/components/smartsheet/toolbar/ViewInfo.vue
index b4d41ed0c7..2900249424 100644
--- a/packages/nc-gui/components/smartsheet/toolbar/ViewInfo.vue
+++ b/packages/nc-gui/components/smartsheet/toolbar/ViewInfo.vue
@@ -247,15 +247,28 @@ const viewModeInfo = computed(() => {
</span>
</NcTooltip>
- <component
- :is="viewLockIcons[activeView.lock_type].icon"
- v-if="[ViewLockType.Locked, ViewLockType.Personal].includes(activeView?.lock_type)"
- class="flex-none w-3.5 h-3.5 mx-0.5"
- :class="{
- 'text-brand-400': activeView?.lock_type === ViewLockType.Personal && isViewOwner,
- 'text-gray-400': !(activeView?.lock_type === ViewLockType.Personal && isViewOwner),
- }"
- />
+ <template v-if="[ViewLockType.Locked, ViewLockType.Personal].includes(activeView?.lock_type)">
+ <div
+ v-if="activeView?.lock_type === ViewLockType.Personal && activeView.owned_by && idUserMap[activeView.owned_by]"
+ class="flex items-center justify-center"
+ >
+ <GeneralUserIcon
+ :user="idUserMap[activeView.owned_by]"
+ size="auto"
+ class="flex-none !text-[7px] !h-[14px] !min-h-[14px]"
+ />
+ </div>
+
+ <component
+ v-else
+ :is="viewLockIcons[activeView.lock_type].icon"
+ class="flex-none w-3.5 h-3.5 mx-0.5"
+ :class="{
+ 'text-brand-400': activeView?.lock_type === ViewLockType.Personal && isViewOwner,
+ 'text-gray-400': !(activeView?.lock_type === ViewLockType.Personal && isViewOwner),
+ }"
+ />
+ </template>
<GeneralIcon
icon="chevronDown"