mirror of
https://github.com/nocodb/nocodb.git
synced 2026-04-25 06:25:29 +00:00
fix: update base icon in cmd modal
This commit is contained in:
@@ -16,6 +16,8 @@ interface CmdAction {
|
|||||||
keywords?: string[]
|
keywords?: string[]
|
||||||
section?: string
|
section?: string
|
||||||
iconColor?: string
|
iconColor?: string
|
||||||
|
managed_app_master?: boolean
|
||||||
|
managed_app_id?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
@@ -90,6 +92,8 @@ const nestedScope = computed(() => {
|
|||||||
section: parentEl?.section,
|
section: parentEl?.section,
|
||||||
iconType: parentEl?.iconType,
|
iconType: parentEl?.iconType,
|
||||||
iconColor: parent.startsWith('ws-') ? parentEl?.iconColor : null,
|
iconColor: parent.startsWith('ws-') ? parentEl?.iconColor : null,
|
||||||
|
managed_app_master: !!parentEl?.managed_app_master,
|
||||||
|
managed_app_id: parentEl?.managed_app_id || '',
|
||||||
})
|
})
|
||||||
parent = parentEl?.parent || 'root'
|
parent = parentEl?.parent || 'root'
|
||||||
}
|
}
|
||||||
@@ -431,9 +435,13 @@ defineExpose({
|
|||||||
|
|
||||||
<template v-else-if="el.section === 'Bases' || el.icon === 'project'">
|
<template v-else-if="el.section === 'Bases' || el.icon === 'project'">
|
||||||
<GeneralBaseIconColorPicker
|
<GeneralBaseIconColorPicker
|
||||||
:key="el.iconColor"
|
:key="`${el.iconColor}-${el.managed_app_id}-${el.managed_app_master}`"
|
||||||
:model-value="el.iconColor"
|
:model-value="el.iconColor"
|
||||||
type="database"
|
type="database"
|
||||||
|
:managed-app="{
|
||||||
|
managed_app_master: el.managed_app_master,
|
||||||
|
managed_app_id: el.managed_app_id,
|
||||||
|
}"
|
||||||
readonly
|
readonly
|
||||||
class="cmdk-action-icon !w-5"
|
class="cmdk-action-icon !w-5"
|
||||||
>
|
>
|
||||||
@@ -544,10 +552,14 @@ defineExpose({
|
|||||||
/>
|
/>
|
||||||
<template v-else-if="item.data.section === 'Bases' || item.data.icon === 'project'">
|
<template v-else-if="item.data.section === 'Bases' || item.data.icon === 'project'">
|
||||||
<GeneralBaseIconColorPicker
|
<GeneralBaseIconColorPicker
|
||||||
:key="item.data.iconColor"
|
:key="`${item.data.iconColor}-${item.data.managed_app_id}-${item.data.managed_app_master}`"
|
||||||
:model-value="item.data.iconColor"
|
:model-value="item.data.iconColor"
|
||||||
type="database"
|
type="database"
|
||||||
readonly
|
readonly
|
||||||
|
:managed-app="{
|
||||||
|
managed_app_master: item.data.managed_app_master,
|
||||||
|
managed_app_id: item.data.managed_app_id,
|
||||||
|
}"
|
||||||
>
|
>
|
||||||
</GeneralBaseIconColorPicker>
|
</GeneralBaseIconColorPicker>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -219,7 +219,14 @@ onMounted(() => {
|
|||||||
</div>
|
</div>
|
||||||
<div class="flex w-1/2 justify-end text-nc-content-gray-subtle2">
|
<div class="flex w-1/2 justify-end text-nc-content-gray-subtle2">
|
||||||
<div class="flex gap-2 px-2 py-1 rounded-md items-center">
|
<div class="flex gap-2 px-2 py-1 rounded-md items-center">
|
||||||
<component :is="iconMap.project" class="w-4 h-4" />
|
<GeneralProjectIcon
|
||||||
|
:managed-app="{
|
||||||
|
managed_app_master: cmdOption?.managed_app_master,
|
||||||
|
managed_app_id: cmdOption?.managed_app_id,
|
||||||
|
}"
|
||||||
|
:color="cmdOption?.iconColor"
|
||||||
|
class="!h-4 !w-4"
|
||||||
|
/>
|
||||||
<a-tooltip overlay-class-name="!px-2 !py-1 !rounded-lg" :tooltip-style="{ zIndex: 1100 }">
|
<a-tooltip overlay-class-name="!px-2 !py-1 !rounded-lg" :tooltip-style="{ zIndex: 1100 }">
|
||||||
<template #title>
|
<template #title>
|
||||||
{{ cmdOption.baseName }}
|
{{ cmdOption.baseName }}
|
||||||
|
|||||||
@@ -1,5 +1,10 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
const color1 = ref('')
|
const color1 = ref('')
|
||||||
|
|
||||||
|
const managedApp = ref({
|
||||||
|
managed_app_master: false,
|
||||||
|
managed_app_id: 'prr1pr4xx9vqn5c',
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -8,8 +13,17 @@ const color1 = ref('')
|
|||||||
<h4>Simple</h4>
|
<h4>Simple</h4>
|
||||||
|
|
||||||
Selected color: {{ color1 }}
|
Selected color: {{ color1 }}
|
||||||
|
|
||||||
|
<div class="flex items-center gap-2">
|
||||||
|
<NcSwitch v-model:checked="managedApp.managed_app_master"> Toggle Managed App state </NcSwitch>
|
||||||
|
</div>
|
||||||
<div class="inline-block min-h-[24px] min-w-[24px] h-[24px] w-[24px] rounded-md" :class="[`bg-${color1}`]"></div>
|
<div class="inline-block min-h-[24px] min-w-[24px] h-[24px] w-[24px] rounded-md" :class="[`bg-${color1}`]"></div>
|
||||||
<GeneralBaseIconColorPicker :model-value="color1" type="database" @update:model-value="color1 = $event">
|
<GeneralBaseIconColorPicker
|
||||||
|
:model-value="color1"
|
||||||
|
type="database"
|
||||||
|
@update:model-value="color1 = $event"
|
||||||
|
:managed-app="managedApp"
|
||||||
|
>
|
||||||
</GeneralBaseIconColorPicker>
|
</GeneralBaseIconColorPicker>
|
||||||
</a-card>
|
</a-card>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1264,7 +1264,7 @@ export const useViewsStore = defineStore('viewsStore', () => {
|
|||||||
|
|
||||||
const tableName = tablesStore.baseTables.get(view.base_id)?.find((t) => t.id === view.fk_model_id)?.title
|
const tableName = tablesStore.baseTables.get(view.base_id)?.find((t) => t.id === view.fk_model_id)?.title
|
||||||
|
|
||||||
const baseName = bases.basesList.find((p) => p.id === view.base_id)?.title
|
const base = bases.basesList.find((p) => p.id === view.base_id)
|
||||||
allRecentViews.value = [
|
allRecentViews.value = [
|
||||||
{
|
{
|
||||||
viewId: view.id,
|
viewId: view.id,
|
||||||
@@ -1274,7 +1274,10 @@ export const useViewsStore = defineStore('viewsStore', () => {
|
|||||||
viewType: view.type,
|
viewType: view.type,
|
||||||
workspaceId: activeWorkspaceId.value,
|
workspaceId: activeWorkspaceId.value,
|
||||||
tableName: tableName as string,
|
tableName: tableName as string,
|
||||||
baseName: baseName as string,
|
baseName: base?.title as string,
|
||||||
|
managed_app_master: base?.managed_app_master,
|
||||||
|
managed_app_id: base?.managed_app_id,
|
||||||
|
iconColor: parseProp(base?.meta).iconColor,
|
||||||
},
|
},
|
||||||
...allRecentViews.value.filter((f) => f.viewId !== view.id || f.tableID !== view.fk_model_id),
|
...allRecentViews.value.filter((f) => f.viewId !== view.id || f.tableID !== view.fk_model_id),
|
||||||
]
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user