Browse Source

fix(nc-gui): revert show base emoji if exist changes

pull/7807/head
Ramesh Mane 10 months ago
parent
commit
5baa8da556
  1. 10
      packages/nc-gui/components/cmd-k/index.vue
  2. 1
      packages/nc-gui/components/dashboard/TreeView/ProjectNode.vue
  3. 9
      packages/nc-gui/components/general/BaseIconColorPicker.vue
  4. 1
      packages/nc-gui/components/workspace/ProjectList.vue
  5. 4
      packages/nocodb/src/services/command-palette.service.ts

10
packages/nc-gui/components/cmd-k/index.vue

@ -386,14 +386,8 @@ defineExpose({
@click="fireAction(act)" @click="fireAction(act)"
> >
<div class="cmdk-action-content w-full"> <div class="cmdk-action-content w-full">
<template v-if="title === 'Bases'"> <template v-if="title === 'Bases' || act.icon === 'project'">
<GeneralBaseIconColorPicker <GeneralBaseIconColorPicker :key="act.iconColor" :model-value="act.iconColor" type="database" readonly>
:key="act.iconColor"
:model-value="act.iconColor"
:emoji="typeof act.icon === 'string' ? act.icon : ''"
type="database"
readonly
>
</GeneralBaseIconColorPicker> </GeneralBaseIconColorPicker>
</template> </template>
<template v-else> <template v-else>

1
packages/nc-gui/components/dashboard/TreeView/ProjectNode.vue

@ -432,7 +432,6 @@ const projectDelete = () => {
:key="`${base.id}_${parseProp(base.meta).iconColor}`" :key="`${base.id}_${parseProp(base.meta).iconColor}`"
:type="base?.type" :type="base?.type"
:model-value="parseProp(base.meta).iconColor" :model-value="parseProp(base.meta).iconColor"
:emoji="parseProp(base.meta).icon"
size="small" size="small"
:readonly="(base?.type && base?.type !== 'database') || !isUIAllowed('baseRename')" :readonly="(base?.type && base?.type !== 'database') || !isUIAllowed('baseRename')"
@update:model-value="setColor($event, base)" @update:model-value="setColor($event, base)"

9
packages/nc-gui/components/general/BaseIconColorPicker.vue

@ -7,7 +7,6 @@ const props = withDefaults(
defineProps<{ defineProps<{
type?: NcProjectType | string type?: NcProjectType | string
modelValue?: string modelValue?: string
emoji?: string
size?: 'small' | 'medium' | 'large' | 'xlarge' size?: 'small' | 'medium' | 'large' | 'xlarge'
readonly?: boolean readonly?: boolean
iconClass?: string iconClass?: string
@ -59,7 +58,7 @@ watch(
<div> <div>
<a-dropdown v-model:visible="isOpen" :trigger="['click']" :disabled="readonly"> <a-dropdown v-model:visible="isOpen" :trigger="['click']" :disabled="readonly">
<div <div
class="flex flex-row justify-center items-center select-none rounded-md nc-emoji" class="flex flex-row justify-center items-center select-none rounded-md nc-base-icon-picker-trigger"
:class="{ :class="{
'hover:bg-gray-500 hover:bg-opacity-15 cursor-pointer': !readonly, 'hover:bg-gray-500 hover:bg-opacity-15 cursor-pointer': !readonly,
'bg-gray-500 bg-opacity-15': isOpen, 'bg-gray-500 bg-opacity-15': isOpen,
@ -74,11 +73,7 @@ watch(
<template #title> {{ $t('tooltip.changeIconColour') }} </template> <template #title> {{ $t('tooltip.changeIconColour') }} </template>
<div> <div>
<LazyGeneralEmojiPicker :key="emoji" :emoji="emoji" readonly size="small"> <GeneralProjectIcon :color="colorRef" :type="type" />
<template #default>
<GeneralProjectIcon :color="colorRef" :type="type" />
</template>
</LazyGeneralEmojiPicker>
</div> </div>
</NcTooltip> </NcTooltip>
</div> </div>

1
packages/nc-gui/components/workspace/ProjectList.vue

@ -255,7 +255,6 @@ const setColor = async (color: string, base: BaseType) => {
:key="`${record.id}_${parseProp(record.meta).iconColor}`" :key="`${record.id}_${parseProp(record.meta).iconColor}`"
:type="record?.type" :type="record?.type"
:model-value="parseProp(record.meta).iconColor" :model-value="parseProp(record.meta).iconColor"
:emoji="parseProp(record.meta).icon"
:readonly="(record?.type && record?.type !== 'database') || !isUIAllowed('baseRename')" :readonly="(record?.type && record?.type !== 'database') || !isUIAllowed('baseRename')"
@update:model-value="setColor($event, record)" @update:model-value="setColor($event, record)"
> >

4
packages/nocodb/src/services/command-palette.service.ts

@ -28,7 +28,7 @@ export class CommandPaletteService {
cmdData.push({ cmdData.push({
id: `p-${base.id}`, id: `p-${base.id}`,
title: base.title, title: base.title,
icon: deserializeJSON(base.meta)?.icon, icon: 'project',
iconColor: deserializeJSON(base.meta)?.iconColor, iconColor: deserializeJSON(base.meta)?.iconColor,
section: 'Bases', section: 'Bases',
scopePayload: { scopePayload: {
@ -71,7 +71,7 @@ export class CommandPaletteService {
cmdData.push({ cmdData.push({
id: `p-${b.id}`, id: `p-${b.id}`,
title: b.title, title: b.title,
icon: deserializeJSON(b.meta)?.icon, icon: 'project',
iconColor: deserializeJSON(b.meta)?.iconColor, iconColor: deserializeJSON(b.meta)?.iconColor,
section: 'Bases', section: 'Bases',
}); });

Loading…
Cancel
Save