Browse Source

fix(nocodb): handle error in gui

pull/7687/head
DarkPhoenix2704 9 months ago
parent
commit
5dbc4653c4
  1. 9
      packages/nc-gui/components/smartsheet/calendar/index.vue
  2. 3
      packages/nc-gui/composables/useCalendarViewStore.ts
  3. 1
      packages/nc-gui/lang/en.json

9
packages/nc-gui/components/smartsheet/calendar/index.vue

@ -41,6 +41,7 @@ provide(IsKanbanInj, ref(false))
provide(IsCalendarInj, ref(true)) provide(IsCalendarInj, ref(true))
const { const {
calendarRange,
calDataType, calDataType,
loadCalendarMeta, loadCalendarMeta,
loadCalendarData, loadCalendarData,
@ -256,6 +257,7 @@ const headerText = computed(() => {
</NcButton> </NcButton>
</NcTooltip> </NcTooltip>
</div> </div>
<template v-if="calendarRange">
<LazySmartsheetCalendarYearView v-if="activeCalendarView === 'year'" /> <LazySmartsheetCalendarYearView v-if="activeCalendarView === 'year'" />
<template v-if="!isCalendarDataLoading"> <template v-if="!isCalendarDataLoading">
<LazySmartsheetCalendarMonthView <LazySmartsheetCalendarMonthView
@ -284,9 +286,16 @@ const headerText = computed(() => {
@new-record="newRecord" @new-record="newRecord"
/> />
</template> </template>
<div v-if="isCalendarDataLoading && activeCalendarView !== 'year'" class="flex w-full items-center h-full justify-center"> <div v-if="isCalendarDataLoading && activeCalendarView !== 'year'" class="flex w-full items-center h-full justify-center">
<GeneralLoader size="xlarge" /> <GeneralLoader size="xlarge" />
</div> </div>
</template>
<template>
<div v-if="isCalendarDataLoading && activeCalendarView !== 'year'" class="flex w-full items-center h-full justify-center">
{{ $t('activity.noRange') }}
</div>
</template>
</div> </div>
<LazySmartsheetCalendarSideMenu <LazySmartsheetCalendarSideMenu
v-if="!isMobileMode" v-if="!isMobileMode"

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

@ -123,6 +123,8 @@ const [useProvideCalendarViewStore, useCalendarViewStore] = useInjectionState(
const sideBarFilter = computed(() => { const sideBarFilter = computed(() => {
let combinedFilters: any = [] let combinedFilters: any = []
if (!calendarRange.value) return []
if (sideBarFilterOption.value === 'allRecords') { if (sideBarFilterOption.value === 'allRecords') {
combinedFilters = [] combinedFilters = []
} else if (sideBarFilterOption.value === 'withoutDates') { } else if (sideBarFilterOption.value === 'withoutDates') {
@ -336,6 +338,7 @@ const [useProvideCalendarViewStore, useCalendarViewStore] = useInjectionState(
} }
const filterJSON = computed(() => { const filterJSON = computed(() => {
if (!calendarRange.value) return []
const combinedFilters: any = { const combinedFilters: any = {
is_group: true, is_group: true,
logical_op: 'and', logical_op: 'and',

1
packages/nc-gui/lang/en.json

@ -686,6 +686,7 @@
} }
}, },
"activity": { "activity": {
"noRange": "Calendar view requires a date range",
"goToToday": "Go to Today", "goToToday": "Go to Today",
"toggleSidebar": "Toggle Sidebar", "toggleSidebar": "Toggle Sidebar",
"addEndDate": "Add end date", "addEndDate": "Add end date",

Loading…
Cancel
Save