From c0630b4000e9a116781253053974436a50a8f7e3 Mon Sep 17 00:00:00 2001
From: Ramesh Mane <101566080+rameshmane7218@users.noreply.github.com>
Date: Tue, 12 Mar 2024 06:44:57 +0000
Subject: [PATCH] fix(nc-gui): update base icon in cmd k
---
packages/nc-gui/components/cmd-k/index.vue | 38 ++++++++++++-------
.../dashboard/TreeView/ProjectNode.vue | 8 ++--
.../src/services/command-palette.service.ts | 3 ++
3 files changed, 31 insertions(+), 18 deletions(-)
diff --git a/packages/nc-gui/components/cmd-k/index.vue b/packages/nc-gui/components/cmd-k/index.vue
index a78001545f..fe5bfcb37d 100644
--- a/packages/nc-gui/components/cmd-k/index.vue
+++ b/packages/nc-gui/components/cmd-k/index.vue
@@ -17,6 +17,7 @@ interface CmdAction {
keywords?: string[]
section?: string
is_default?: number | null
+ iconHue?: number
}
const props = defineProps<{
@@ -385,20 +386,29 @@ defineExpose({
@click="fireAction(act)"
>
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
{{ act.title }}
diff --git a/packages/nc-gui/components/dashboard/TreeView/ProjectNode.vue b/packages/nc-gui/components/dashboard/TreeView/ProjectNode.vue
index 0a542e680c..08ff2c6182 100644
--- a/packages/nc-gui/components/dashboard/TreeView/ProjectNode.vue
+++ b/packages/nc-gui/components/dashboard/TreeView/ProjectNode.vue
@@ -420,12 +420,12 @@ const projectDelete = () => {
-
diff --git a/packages/nocodb/src/services/command-palette.service.ts b/packages/nocodb/src/services/command-palette.service.ts
index 7bf3ac2585..f57bb59c77 100644
--- a/packages/nocodb/src/services/command-palette.service.ts
+++ b/packages/nocodb/src/services/command-palette.service.ts
@@ -2,6 +2,7 @@ import { Injectable } from '@nestjs/common';
import { type UserType, ViewTypes } from 'nocodb-sdk';
import { Base } from '~/models';
import { TablesService } from '~/services/tables.service';
+import { deserializeJSON } from '~/utils/serialize';
const viewTypeAlias: Record
= {
[ViewTypes.GRID]: 'grid',
@@ -28,6 +29,7 @@ export class CommandPaletteService {
id: `p-${base.id}`,
title: base.title,
icon: 'project',
+ iconHue: deserializeJSON(base.meta)?.iconHue,
section: 'Bases',
scopePayload: {
scope: `p-${base.id}`,
@@ -70,6 +72,7 @@ export class CommandPaletteService {
id: `p-${b.id}`,
title: b.title,
icon: 'project',
+ iconHue: deserializeJSON(b.meta)?.iconHue,
section: 'Bases',
});
}