Browse Source

fix(nc-gui): add support to show base emoji if exist

pull/7807/head
Ramesh Mane 9 months ago
parent
commit
5eabbb77c1
  1. 10
      packages/nc-gui/components/cmd-k/index.vue
  2. 1
      packages/nc-gui/components/dashboard/TreeView/ProjectNode.vue
  3. 7
      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,8 +386,14 @@ 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' || act.icon === 'project'"> <template v-if="title === 'Bases'">
<GeneralBaseIconColorPicker :key="act.iconColor" :color="act.iconColor" type="database" readonly> <GeneralBaseIconColorPicker
: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,6 +432,7 @@ 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)"

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

@ -7,6 +7,7 @@ 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
@ -73,7 +74,11 @@ watch(
<template #title> {{ $t('tooltip.changeIconColour') }} </template> <template #title> {{ $t('tooltip.changeIconColour') }} </template>
<div> <div>
<GeneralProjectIcon :color="colorRef" :type="type" /> <LazyGeneralEmojiPicker :key="emoji" :emoji="emoji" readonly size="small">
<template #default>
<GeneralProjectIcon :color="colorRef" :type="type" />
</template>
</LazyGeneralEmojiPicker>
</div> </div>
</NcTooltip> </NcTooltip>
</div> </div>

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

@ -255,6 +255,7 @@ 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: 'project', icon: deserializeJSON(base.meta)?.icon,
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: 'project', icon: deserializeJSON(b.meta)?.icon,
iconColor: deserializeJSON(b.meta)?.iconColor, iconColor: deserializeJSON(b.meta)?.iconColor,
section: 'Bases', section: 'Bases',
}); });

Loading…
Cancel
Save