Browse Source

fix(nc-gui): some more fixes

pull/7611/head
DarkPhoenix2704 9 months ago
parent
commit
2390c06c83
  1. 4
      packages/nc-gui/components/smartsheet/toolbar/FieldsMenu.vue
  2. 3
      packages/nc-gui/composables/useCalendarViewStore.ts
  3. 8
      packages/nocodb/src/models/View.ts

4
packages/nc-gui/components/smartsheet/toolbar/FieldsMenu.vue

@ -370,7 +370,7 @@ useMenuCloseOnEsc(open)
<div <div
v-if=" v-if="
filteredFieldList filteredFieldList
.filter((el) => el !== gridDisplayValueField && el.title.toLowerCase().includes(filterQuery.toLowerCase())) .filter((el) => (activeView.type !== ViewTypes.CALENDAR ? el !== gridDisplayValueField : true))
.includes(field) .includes(field)
" "
:key="field.id" :key="field.id"
@ -403,7 +403,7 @@ useMenuCloseOnEsc(open)
<div class="flex-1" /> <div class="flex-1" />
</div> </div>
</template> </template>
<template v-if="activeView?.type === ViewTypes.GRID || activeView?.type === ViewTypes.CALENDAR" #header> <template v-if="activeView?.type === ViewTypes.GRID" #header>
<div <div
v-if="gridDisplayValueField && filteredFieldList[0].title.toLowerCase().includes(filterQuery.toLowerCase())" v-if="gridDisplayValueField && filteredFieldList[0].title.toLowerCase().includes(filterQuery.toLowerCase())"
:key="`pv-${gridDisplayValueField.id}`" :key="`pv-${gridDisplayValueField.id}`"

3
packages/nc-gui/composables/useCalendarViewStore.ts

@ -37,7 +37,7 @@ const [useProvideCalendarViewStore, useCalendarViewStore] = useInjectionState(
const { isUIAllowed } = useRoles() const { isUIAllowed } = useRoles()
const displayField = ref<ColumnType>() const displayField = computed(() => meta.value?.columns?.find((c) => c.pv))
const activeCalendarView = ref<'month' | 'year' | 'day' | 'week'>() const activeCalendarView = ref<'month' | 'year' | 'day' | 'week'>()
@ -530,7 +530,6 @@ const [useProvideCalendarViewStore, useCalendarViewStore] = useInjectionState(
fk_to_col: range.fk_to_column_id ? meta.value?.columns!.find((col) => col.id === range.fk_to_column_id) : null, fk_to_col: range.fk_to_column_id ? meta.value?.columns!.find((col) => col.id === range.fk_to_column_id) : null,
} }
}) as any }) as any
displayField.value = meta.value.columns.find((col) => col.pv)
} }
async function loadCalendarData() { async function loadCalendarData() {

8
packages/nocodb/src/models/View.ts

@ -572,7 +572,13 @@ export default class View implements ViewType {
await KanbanViewColumn.insert(modifiedInsertObj, ncMeta); await KanbanViewColumn.insert(modifiedInsertObj, ncMeta);
break; break;
case ViewTypes.CALENDAR: case ViewTypes.CALENDAR:
await CalendarViewColumn.insert(modifiedInsertObj, ncMeta); await CalendarViewColumn.insert(
{
...insertObj,
fk_view_id: view.id,
},
ncMeta,
);
break; break;
} }
} }

Loading…
Cancel
Save