Browse Source

fix(gui): viewIcon - handle if view meta is not defined

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/4696/head
Pranav C 2 years ago
parent
commit
d1e1906d2f
  1. 2
      packages/nc-gui/components/dashboard/settings/data-sources/CreateBase.vue
  2. 6
      packages/nc-gui/components/general/ViewIcon.vue
  3. 4
      packages/nc-gui/components/smartsheet/sidebar/RenameableMenuItem.vue
  4. 2
      packages/nc-gui/layouts/shared-view.vue

2
packages/nc-gui/components/dashboard/settings/data-sources/CreateBase.vue

@ -112,7 +112,7 @@ const validators = computed(() => {
'title': [
{
required: true,
message: 'Project name is required',
message: 'Base name is required',
},
projectTitleValidator,
],

6
packages/nc-gui/components/general/ViewIcon.vue

@ -1,11 +1,13 @@
<script lang="ts" setup>
import { Icon as IcIcon } from '@iconify/vue'
import type { TableType } from 'nocodb-sdk'
import { viewIcons } from '#imports'
import { toRef, viewIcons } from '#imports'
const { meta: viewMeta } = defineProps<{
const props = defineProps<{
meta: TableType
}>()
const viewMeta = toRef(props, 'meta')
</script>
<template>

4
packages/nc-gui/components/smartsheet/sidebar/RenameableMenuItem.vue

@ -168,9 +168,9 @@ function onStopEdit() {
<div v-e="['a:view:open', { view: vModel.type }]" class="text-xs flex items-center w-full gap-2" data-testid="view-item">
<div class="flex w-auto min-w-5" :data-testid="`view-sidebar-drag-handle-${vModel.alias || vModel.title}`">
<a-dropdown :trigger="['click']" @click.stop>
<component :is="isUIAllowed('tableIconCustomisation') ? Tooltip : 'div'">
<component :is="isUIAllowed('viewIconCustomisation') ? Tooltip : 'div'">
<GeneralViewIcon :meta="props.view" class="nc-view-icon"></GeneralViewIcon>
<template v-if="isUIAllowed('tableIconCustomisation')" #title>Change icon</template>
<template v-if="isUIAllowed('viewIconCustomisation')" #title>Change icon</template>
</component>
<template v-if="isUIAllowed('viewIconCustomisation')" #overlay>

2
packages/nc-gui/layouts/shared-view.vue

@ -59,7 +59,7 @@ export default {
</template>
<div v-else class="text-xl font-semibold truncate text-white nc-shared-view-title flex gap-2 items-center">
<GeneralViewIcon class="!text-xl" :meta="sharedView" />
<GeneralViewIcon v-if="sharedView" class="!text-xl" :meta="sharedView" />
{{ sharedView?.title }}
</div>
</div>

Loading…
Cancel
Save