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)"
>
<div class="cmdk-action-content w-full">
<template v-if="title === 'Bases'">
<GeneralBaseIconColorPicker
:key="act.iconColor"
:model-value="act.iconColor"
:emoji="typeof act.icon === 'string' ? act.icon : ''"
type="database"
readonly
>
<template v-if="title === 'Bases' || act.icon === 'project'">
<GeneralBaseIconColorPicker :key="act.iconColor" :model-value="act.iconColor" type="database" readonly>
</GeneralBaseIconColorPicker>
</template>
<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}`"
:type="base?.type"
:model-value="parseProp(base.meta).iconColor"
:emoji="parseProp(base.meta).icon"
size="small"
:readonly="(base?.type && base?.type !== 'database') || !isUIAllowed('baseRename')"
@update:model-value="setColor($event, base)"

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

@ -7,7 +7,6 @@ const props = withDefaults(
defineProps<{
type?: NcProjectType | string
modelValue?: string
emoji?: string
size?: 'small' | 'medium' | 'large' | 'xlarge'
readonly?: boolean
iconClass?: string
@ -59,7 +58,7 @@ watch(
<div>
<a-dropdown v-model:visible="isOpen" :trigger="['click']" :disabled="readonly">
<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="{
'hover:bg-gray-500 hover:bg-opacity-15 cursor-pointer': !readonly,
'bg-gray-500 bg-opacity-15': isOpen,
@ -74,11 +73,7 @@ watch(
<template #title> {{ $t('tooltip.changeIconColour') }} </template>
<div>
<LazyGeneralEmojiPicker :key="emoji" :emoji="emoji" readonly size="small">
<template #default>
<GeneralProjectIcon :color="colorRef" :type="type" />
</template>
</LazyGeneralEmojiPicker>
<GeneralProjectIcon :color="colorRef" :type="type" />
</div>
</NcTooltip>
</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}`"
:type="record?.type"
:model-value="parseProp(record.meta).iconColor"
:emoji="parseProp(record.meta).icon"
:readonly="(record?.type && record?.type !== 'database') || !isUIAllowed('baseRename')"
@update:model-value="setColor($event, record)"
>

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

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

Loading…
Cancel
Save