Browse Source

fix(nc-gui): use colour picker for base icon instead of hue picker

pull/7807/head
Ramesh Mane 8 months ago
parent
commit
e4c917d3a4
  1. 7
      packages/nc-gui/components/cmd-k/index.vue
  2. 20
      packages/nc-gui/components/dashboard/TreeView/ProjectNode.vue
  3. 13
      packages/nc-gui/components/dlg/ProjectDelete.vue
  4. 2
      packages/nc-gui/components/dlg/ProjectDuplicate.vue
  5. 13
      packages/nc-gui/components/dlg/share-and-collaborate/View.vue
  6. 191
      packages/nc-gui/components/general/BaseIconColorPicker.vue
  7. 104
      packages/nc-gui/components/general/ColorPicker.vue
  8. 48
      packages/nc-gui/components/general/ProjectIcon.vue
  9. 12
      packages/nc-gui/components/project/View.vue
  10. 14
      packages/nc-gui/components/smartsheet/Form.vue
  11. 2
      packages/nc-gui/components/smartsheet/toolbar/ViewInfo.vue
  12. 19
      packages/nc-gui/components/workspace/ProjectList.vue
  13. 4
      packages/nocodb/src/services/command-palette.service.ts

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

@ -17,7 +17,7 @@ interface CmdAction {
keywords?: string[]
section?: string
is_default?: number | null
iconHue?: number
iconColor?: string
}
const props = defineProps<{
@ -387,10 +387,7 @@ defineExpose({
>
<div class="cmdk-action-content w-full">
<template v-if="title === 'Bases' || act.icon === 'project'">
<GeneralBaseIconColorPicker :key="act.iconHue" :hue="act.iconHue" size="small" readonly>
<template #default>
<GeneralProjectIcon type="database" />
</template>
<GeneralBaseIconColorPicker :key="act.iconColor" :color="act.iconColor" type="database" readonly>
</GeneralBaseIconColorPicker>
</template>
<template v-else>

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

@ -75,6 +75,8 @@ useTabs()
const { meta: metaKey, ctrlKey } = useMagicKeys()
const { refreshCommandPalette } = useCommandPalette()
const editMode = ref(false)
const tempTitle = ref('')
@ -172,18 +174,20 @@ defineExpose({
enableEditMode,
})
const setColor = async (hue: number, base: BaseType) => {
const setColor = async (color: string, base: BaseType) => {
try {
const meta = {
...parseProp(base.meta),
iconHue: hue,
iconColor: color,
}
basesStore.updateProject(base.id!, { meta: JSON.stringify(meta) })
$e('a:base:icon:color:navdraw', { iconHue: hue })
$e('a:base:icon:color:navdraw', { iconColor: color })
} catch (e: any) {
message.error(await extractSdkResponseErrorMsg(e))
} finally {
refreshCommandPalette()
}
}
@ -425,15 +429,13 @@ const projectDelete = () => {
<div v-else>
<GeneralBaseIconColorPicker
:key="`${base.id}_${parseProp(base.meta).iconHue}`"
:hue="parseProp(base.meta).iconHue"
:key="`${base.id}_${parseProp(base.meta).iconColor}`"
:type="base?.type"
:model-value="parseProp(base.meta).iconColor"
size="small"
:readonly="(base?.type && base?.type !== 'database') || !isUIAllowed('baseRename')"
@color-selected="setColor($event, base)"
@update:model-value="setColor($event, base)"
>
<template #default>
<GeneralProjectIcon :type="base?.type" />
</template>
</GeneralBaseIconColorPicker>
</div>
</div>

13
packages/nc-gui/components/dlg/ProjectDelete.vue

@ -52,18 +52,7 @@ const onDelete = async () => {
<GeneralDeleteModal v-model:visible="visible" :entity-name="$t('objects.project')" :on-delete="onDelete">
<template #entity-preview>
<div v-if="base" class="flex flex-row items-center py-2 px-2.25 bg-gray-50 rounded-lg text-gray-700 mb-4">
<GeneralBaseIconColorPicker
:key="parseProp(base.meta).iconHue"
:hue="parseProp(base.meta).iconHue"
size="small"
class="!w-auto !h-auto"
icon-class="nc-view-icon w-6 h-6"
readonly
>
<template #default>
<GeneralProjectIcon :type="base.type" class="nc-view-icon w-6 h-6" />
</template>
</GeneralBaseIconColorPicker>
<GeneralProjectIcon :color="parseProp(base.meta).iconColor" :type="base.type" class="nc-view-icon w-6 h-6 mx-1" />
<div
class="capitalize text-ellipsis overflow-hidden select-none w-full pl-1.75"
:style="{ wordBreak: 'keep-all', whiteSpace: 'nowrap', display: 'inline' }"

2
packages/nc-gui/components/dlg/ProjectDuplicate.vue

@ -62,7 +62,7 @@ const _duplicate = async () => {
primaryColor: color,
accentColor: complement.toHex8String(),
},
iconHue: parseProp(props.base.meta).iconHue,
iconColor: parseProp(props.base.meta).iconColor,
}),
},
})

13
packages/nc-gui/components/dlg/share-and-collaborate/View.vue

@ -154,18 +154,7 @@ watch(showShareModal, (val) => {
</div>
<div class="share-base">
<div class="flex flex-row items-center gap-x-2 px-4 pt-3 pb-3 select-none">
<GeneralBaseIconColorPicker
:key="parseProp(base.meta).iconHue"
:hue="parseProp(base.meta).iconHue"
size="small"
class="!w-auto !h-auto"
icon-class="nc-view-icon group-hover"
readonly
>
<template #default>
<GeneralProjectIcon :type="base.type" class="nc-view-icon group-hover" />
</template>
</GeneralBaseIconColorPicker>
<GeneralProjectIcon :color="parseProp(base.meta).iconColor" :type="base.type" class="nc-view-icon group-hover" />
<div>{{ $t('activity.shareBase.label') }}</div>
<div

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

@ -1,37 +1,37 @@
<script lang="ts" setup>
import tinycolor from 'tinycolor2'
import { BASE_ICON_COLOR_HUE_DATA as preDefinedHueData } from '#imports'
const props = defineProps<{
hue?: number | null
size?: 'small' | 'medium' | 'large' | 'xlarge'
readonly?: boolean
disableClearing?: boolean
iconClass?: string
}>()
const emit = defineEmits(['colorSelected'])
import { NcProjectType } from '#imports'
const props = withDefaults(
defineProps<{
type?: NcProjectType | string
modelValue?: string
size?: 'small' | 'medium' | 'large' | 'xlarge'
readonly?: boolean
iconClass?: string
}>(),
{
type: NcProjectType.DB,
size: 'small',
},
)
const { hue, size = 'medium', readonly } = props
const emit = defineEmits(['update:modelValue'])
const defaultHueColor = {
h: 199,
s: 79,
v: 100,
}
const defaultIconColors = ['#36BFFF', '#FA8231', '#FCBE3A', '#27D665', '#6A7184', '#FF4A3F', '#FC3AC6', '#7D26CD']
const defaultHueValue = 199
const { modelValue, size, readonly } = props
const isOpen = ref(false)
const colorRef = ref({
...defaultHueColor,
h: !(hue !== 0 && !hue) ? hue : defaultHueValue,
})
const colorRef = ref(tinycolor(modelValue).isValid() ? modelValue : defaultIconColors[0])
const updateColorHue = (value?: string | number | null) => {
colorRef.value.h = !isNaN(parseInt(`${value}`)) ? +Math.min(parseInt(`${value}`), 360) : 0
const updateIconColor = (color: string) => {
const tcolor = tinycolor(color)
if (tcolor.isValid()) {
colorRef.value = color
}
}
const onClick = (e: Event) => {
@ -45,8 +45,8 @@ const onClick = (e: Event) => {
watch(
isOpen,
(value) => {
if (!value && colorRef.value.h !== hue) {
emit('colorSelected', colorRef.value.h)
if (!value && colorRef.value !== modelValue) {
emit('update:modelValue', colorRef.value)
}
},
{
@ -72,108 +72,25 @@ watch(
>
<NcTooltip placement="topLeft" :disabled="readonly">
<template #title> {{ $t('tooltip.changeIconColour') }} </template>
<template v-if="hue !== 0 && !hue && colorRef.h === defaultHueValue">
<slot name="default" />
</template>
<template v-else>
<svg width="16" height="16" viewBox="0 0 1073 1073" fill="none" xmlns="http://www.w3.org/2000/svg" :class="iconClass">
<mask
id="mask0_1749_80944"
style="mask-type: luminance"
maskUnits="userSpaceOnUse"
x="94"
y="40"
width="885"
height="993"
>
<path d="M978.723 40H94V1033H978.723V40Z" fill="white" />
</mask>
<g mask="url(#mask0_1749_80944)">
<path
fill-rule="evenodd"
clip-rule="evenodd"
d="M638.951 291.265L936.342 462.949C966.129 480.145 980.256 502.958 978.723 525.482V774.266C980.256 796.789 966.129 819.602 936.342 836.798L638.951 1008.48C582.292 1041.19 490.431 1041.19 433.773 1008.48L136.381 836.798C106.595 819.602 92.4675 796.789 93.9999 774.266L93.9999 525.482C92.4675 502.957 106.595 480.145 136.381 462.949L433.773 291.265C490.431 258.556 582.292 258.556 638.951 291.265Z"
:fill="
tinycolor(
preDefinedHueData && preDefinedHueData[`_${colorRef.h}`]
? `hsv(${preDefinedHueData[`_${colorRef.h}`].shade.h},${preDefinedHueData[`_${colorRef.h}`].shade.s}%, ${
preDefinedHueData[`_${colorRef.h}`].shade.v
}%)`
: `hsv(${colorRef.h ?? defaultHueValue}, 100%, 30%)`,
).toHexString()
"
/>
<path
fill-rule="evenodd"
clip-rule="evenodd"
d="M638.951 65.0055L936.342 236.69C966.129 253.886 980.256 276.699 978.723 299.222V548.006C980.256 570.529 966.129 593.343 936.342 610.538L638.951 782.223C582.292 814.931 490.431 814.931 433.773 782.223L136.381 610.538C106.595 593.343 92.4675 570.529 93.9999 548.006L93.9999 299.222C92.4675 276.699 106.595 253.886 136.381 236.69L433.773 65.0055C490.431 32.2968 582.292 32.2968 638.951 65.0055Z"
:fill="
tinycolor(
preDefinedHueData && preDefinedHueData[`_${colorRef.h}`]
? `hsv(${preDefinedHueData[`_${colorRef.h}`].tint.h},${preDefinedHueData[`_${colorRef.h}`].tint.s}%, ${
preDefinedHueData[`_${colorRef.h}`].tint.v
}%)`
: `hsv(${colorRef.h ?? defaultHueValue}, 50%, 100%)`,
).toHexString()
"
/>
</g>
</svg>
</template>
<div>
<GeneralProjectIcon :color="colorRef" :type="type" />
</div>
</NcTooltip>
</div>
<template #overlay>
<div class="nc-base-icon-color-picker-dropdown relative bg-white rounded-lg border-1 border-gray-200">
<div class="flex items-center p-2 space-x-2">
<div
v-for="(h, i) of Object.keys(preDefinedHueData)"
:key="i"
class="nc-pre-defined-hue-item-wrapper p-1 rounded cursor-pointer hover:bg-gray-200"
>
<div
class="nc-pre-defined-hue-item rounded h-6 w-6"
:tabindex="0"
:class="{
selected: `_${colorRef.h}` === h,
}"
:style="{
backgroundColor: preDefinedHueData[h].pickerColor,
}"
@click.stop="updateColorHue(preDefinedHueData[h].tint.h)"
@keydown.enter.stop="updateColorHue(preDefinedHueData[h].tint.h)"
></div>
</div>
</div>
<div class="p-3 border-t-1 border-gray-200 flex flex-col space-y-2.5">
<div class="uppercase text-xs font-medium">{{ $t('labels.customColour') }}</div>
<div class="flex flex-row items-center gap-x-3">
<LazyGeneralColorSliderWrapper
:model-value="colorRef"
class="!min-w-none"
@update:model-value="
(value) => {
updateColorHue(value?.h)
}
"
/>
<input
:value="parseInt(`${colorRef.h ?? 0}`)"
class="nc-color-hue-input"
:class="{
selected: !preDefinedHueData[`_${colorRef.h}`],
}"
type="number"
:min="0"
:max="360"
@input="
(value) => {
updateColorHue(value.target?.value)
}
"
/>
</div>
<template #overlay>
<div
class="nc-base-icon-color-picker-dropdown relative bg-white rounded-lg border-1 border-gray-200 overflow-hidden max-w-[342px]"
>
<div class="flex justify-start">
<GeneralColorPicker
:model-value="colorRef"
:colors="defaultIconColors"
:is-new-design="true"
class="nc-base-icon-color-picker"
@input="updateIconColor"
/>
</div>
</div>
</template>
@ -185,28 +102,4 @@ watch(
.nc-base-icon-color-picker-dropdown {
box-shadow: 0px 8px 8px -4px #0000000a, 0px 20px 24px -4px #0000001a;
}
.nc-pre-defined-hue-item-wrapper {
.nc-pre-defined-hue-item:focus,
.nc-pre-defined-hue-item.selected {
@apply outline-none;
box-shadow: 0 0 0 2px #fff, 0 0 0 4px #3069fe;
}
}
.nc-color-hue-input {
@apply outline-none text-sm rounded-lg border-gray-200 py-1 px-3 w-14 text-center;
-moz-appearance: textfield;
&:focus,
&.selected {
@apply ring-transparent border-brand-500;
}
/* Chrome, Safari, Edge, Opera */
&::-webkit-outer-spin-button,
&::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
}
}
</style>

104
packages/nc-gui/components/general/ColorPicker.vue

@ -1,4 +1,5 @@
<script lang="ts" setup>
import tinycolor from 'tinycolor2'
import { computed, enumColor, ref, watch } from '#imports'
interface Props {
@ -7,7 +8,7 @@ interface Props {
rowSize?: number
advanced?: boolean
pickButton?: boolean
borders?: string[]
colorBoxBorder?: boolean
isNewDesign?: boolean
}
@ -17,6 +18,7 @@ const props = withDefaults(defineProps<Props>(), {
rowSize: 10,
advanced: true,
pickButton: false,
colorBoxBorder: false,
isNewDesign: false,
})
@ -41,7 +43,8 @@ const selectColor = (color: string, closeModal = false) => {
const isPickerOn = ref(false)
const compare = (colorA: string, colorB: string) => colorA.toLowerCase() === colorB.toLowerCase()
const compare = (colorA: string, colorB: string) =>
colorA.toLowerCase() === colorB.toLowerCase() || colorA.toLowerCase() === tinycolor(colorB).toHex8String().toLowerCase()
watch(picked, (n, _o) => {
vModel.value = n
@ -50,31 +53,57 @@ watch(picked, (n, _o) => {
<template>
<div class="color-picker">
<div v-for="colId in Math.ceil(props.colors.length / props.rowSize)" :key="colId" class="color-picker-row">
<button
<div
v-for="colId in Math.ceil(props.colors.length / props.rowSize)"
:key="colId"
class="color-picker-row"
:class="{
'mt-2': colId > 1,
}"
>
<div
v-for="(color, i) of colors.slice((colId - 1) * rowSize, colId * rowSize)"
:key="`color-${colId}-${i}`"
class="color-selector"
:class="{ 'selected': compare(picked, color), 'new-design': isNewDesign }"
:style="{
'background-color': `${color}`,
'border': borders?.length && borders[i] ? `1px solid ${borders[i]}` : undefined,
class="p-1 rounded-md flex h-8"
:class="{
'hover:bg-gray-200': isNewDesign,
}"
@click="selectColor(color, true)"
>
{{ compare(picked, color) && !isNewDesign ? '&#10003;' : '' }}
</button>
<button class="h-6 w-6 mt-2.7 ml-1 border-1 border-[grey] rounded-md" @click="isPickerOn = !isPickerOn">
<GeneralTooltip>
<template #title>{{ $t('activity.moreColors') }}</template>
<div class="flex items-center justify-center">
<GeneralIcon :icon="isPickerOn ? 'minus' : 'plus'" class="w-4 h-4" />
</div>
</GeneralTooltip>
</button>
<button
class="color-selector"
:class="{ 'selected': compare(picked, color), 'new-design': isNewDesign }"
:style="{
'background-color': `${color}`,
'border': colorBoxBorder ? `1px solid ${tinycolor(color).darken(30).toString()}` : undefined,
}"
@click="selectColor(color, true)"
>
{{ compare(picked, color) && !isNewDesign ? '&#10003;' : '' }}
</button>
</div>
<div
class="p-1 rounded-md h-8"
:class="{
'hover:bg-gray-200': isNewDesign,
}"
>
<button class="nc-more-colors-trigger h-6 w-6 border-1 border-gray-400 rounded" @click="isPickerOn = !isPickerOn">
<GeneralTooltip>
<template #title>{{ $t('activity.moreColors') }}</template>
<div class="flex items-center justify-center">
<GeneralIcon :icon="isPickerOn ? 'minus' : 'plus'" class="w-4 h-4" />
</div>
</GeneralTooltip>
</button>
</div>
</div>
<a-card v-if="props.advanced" class="w-full mt-2" :body-style="{ padding: '0px' }" :bordered="false">
<a-card
v-if="props.advanced"
class="w-full mt-2"
:body-style="{ paddingLeft: '4px !important', paddingRight: '4px !important' }"
:bordered="false"
>
<div v-if="isPickerOn" class="flex justify-center">
<LazyGeneralChromeWrapper v-model="picked" class="!w-full !shadow-none" />
</div>
@ -82,25 +111,15 @@ watch(picked, (n, _o) => {
</div>
</template>
<style scoped>
<style lansg="scss" scoped>
.color-picker {
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
background: white;
padding: 10px;
@apply flex flex-col items-center justify-center bg-white p-2.5;
}
.color-picker-row {
display: flex;
flex-direction: row;
@apply flex flex-row space-x-1;
}
.color-selector {
position: relative;
height: 25px;
width: 25px;
margin: 10px 5px;
border-radius: 5px;
@apply h-6 w-6 rounded;
-webkit-text-stroke-width: 1px;
-webkit-text-stroke-color: white;
}
@ -108,19 +127,14 @@ watch(picked, (n, _o) => {
filter: brightness(90%);
-webkit-filter: brightness(90%);
}
.color-selector.selected:not(.new-design) {
filter: brightness(90%);
-webkit-filter: brightness(90%);
}
.color-selector:focus.new-design {
.color-selector:focus,
.color-selector.selected,
.nc-more-colors-trigger:focus {
outline: none;
box-shadow: 0px 0px 0px 2px #fff, 0px 0px 0px 4px #3069fe;
}
.color-selector.selected.new-design {
box-shadow: 0px 0px 0px 2px #fff, 0px 0px 0px 4px #3069fe;
}
:deep(.vc-chrome-toggle-icon) {
@apply ml-3!important;
@apply !ml-3;
}
</style>

48
packages/nc-gui/components/general/ProjectIcon.vue

@ -1,18 +1,58 @@
<script lang="ts" setup>
const { hoverable } = defineProps<{
import tinycolor from 'tinycolor2'
const { hoverable, color } = defineProps<{
type?: string
hoverable?: boolean
color?: string
}>()
const iconColor = computed(() => {
return color
? {
tint: tinycolor(color || '#36BFFF')
.lighten(10)
.toHexString(),
shade: tinycolor(color || '#36BFFF')
.darken(40)
.toHexString(),
}
: {
tint: '#36BFFF',
shade: '#142966',
}
})
</script>
<template>
<GeneralIcon
icon="project"
<svg
width="16"
height="16"
viewBox="0 0 1073 1073"
fill="none"
xmlns="http://www.w3.org/2000/svg"
class="text-[#2824FB] base"
:class="{
'nc-base-icon-hoverable': hoverable,
}"
/>
>
<mask id="mask0_1749_80944" style="mask-type: luminance" maskUnits="userSpaceOnUse" x="94" y="40" width="885" height="993">
<path d="M978.723 40H94V1033H978.723V40Z" fill="white" />
</mask>
<g mask="url(#mask0_1749_80944)">
<path
fill-rule="evenodd"
clip-rule="evenodd"
d="M638.951 291.265L936.342 462.949C966.129 480.145 980.256 502.958 978.723 525.482V774.266C980.256 796.789 966.129 819.602 936.342 836.798L638.951 1008.48C582.292 1041.19 490.431 1041.19 433.773 1008.48L136.381 836.798C106.595 819.602 92.4675 796.789 93.9999 774.266L93.9999 525.482C92.4675 502.957 106.595 480.145 136.381 462.949L433.773 291.265C490.431 258.556 582.292 258.556 638.951 291.265Z"
:fill="iconColor.shade"
/>
<path
fill-rule="evenodd"
clip-rule="evenodd"
d="M638.951 65.0055L936.342 236.69C966.129 253.886 980.256 276.699 978.723 299.222V548.006C980.256 570.529 966.129 593.343 936.342 610.538L638.951 782.223C582.292 814.931 490.431 814.931 433.773 782.223L136.381 610.538C106.595 593.343 92.4675 570.529 93.9999 548.006L93.9999 299.222C92.4675 276.699 106.595 253.886 136.381 236.69L433.773 65.0055C490.431 32.2968 582.292 32.2968 638.951 65.0055Z"
:fill="iconColor.tint"
/>
</g>
</svg>
</template>
<style scoped>

12
packages/nc-gui/components/project/View.vue

@ -82,17 +82,7 @@ watch(
<div class="flex flex-row items-center gap-x-3">
<GeneralOpenLeftSidebarBtn />
<div class="flex flex-row items-center h-full gap-x-2.5">
<GeneralBaseIconColorPicker
:key="parseProp(openedProject?.meta).iconHue"
:hue="parseProp(openedProject?.meta).iconHue"
size="small"
class="!w-auto !h-auto"
readonly
>
<template #default>
<GeneralProjectIcon :type="openedProject?.type" />
</template>
</GeneralBaseIconColorPicker>
<GeneralProjectIcon :type="openedProject?.type" :color="parseProp(openedProject?.meta).iconColor" />
<NcTooltip class="flex font-medium text-sm capitalize truncate max-w-150" show-on-truncate-only>
<template #title> {{ openedProject?.title }}</template>
<span class="truncate">

14
packages/nc-gui/components/smartsheet/Form.vue

@ -1541,19 +1541,9 @@ useEventListener(
'#E5D4F5',
'#FFCFE6',
]"
:borders="[
'#6A7184',
'#FF4A3F',
'#FA8231',
'#FCBE3A',
'#27D665',
'#36BFFF',
'#FC3AC6',
'#7D26CD',
'#B33771',
]"
:color-box-border="true"
:is-new-design="true"
class="nc-form-theme-color-picker !p-0 !-ml-1"
class="nc-form-theme-color-picker !pb-0"
@input="handleChangeBackground"
/>
</div>

2
packages/nc-gui/components/smartsheet/toolbar/ViewInfo.vue

@ -50,7 +50,7 @@ const openedBaseUrl = computed(() => {
</template>
<div class="flex flex-row items-center gap-x-1.5">
<GeneralProjectIcon
:meta="{ type: base?.type }"
:type="base?.type"
class="!grayscale min-w-4"
:style="{
filter: 'grayscale(100%) brightness(115%)',

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

@ -182,16 +182,16 @@ function onProjectTitleClick(index: number) {
}
}
const setColor = async (hue: number, base: BaseType) => {
const setColor = async (color: string, base: BaseType) => {
try {
const meta = {
...parseProp(base.meta),
iconHue: hue,
iconColor: color,
}
basesStore.updateProject(base.id!, { meta: JSON.stringify(meta) })
$e('a:base:icon:color:navdraw', { iconHue: hue })
$e('a:base:icon:color:navdraw', { iconColor: color })
} catch (e: any) {
message.error(await extractSdkResponseErrorMsg(e))
}
@ -252,15 +252,12 @@ const setColor = async (hue: number, base: BaseType) => {
<div class="flex items-center nc-base-title gap-2.5 max-w-full -ml-1.5">
<div class="flex items-center gap-2 text-center">
<GeneralBaseIconColorPicker
:key="parseProp(record.meta).iconHue"
:hue="parseProp(record.meta).iconHue"
size="small"
readonly
@color-selected="setColor($event, record)"
:key="`${record.id}_${parseProp(record.meta).iconColor}`"
:type="record?.type"
:model-value="parseProp(record.meta).iconColor"
:readonly="(record?.type && record?.type !== 'database') || !isUIAllowed('baseRename')"
@update:model-value="setColor($event, record)"
>
<template #default>
<GeneralProjectIcon :type="record.type" />
</template>
</GeneralBaseIconColorPicker>
<!-- todo: replace with switch -->
</div>

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

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

Loading…
Cancel
Save