Browse Source

fix(nocodb): handle error in gui

pull/7687/head
DarkPhoenix2704 9 months ago
parent
commit
cf4df9f0a4
  1. 30
      packages/nc-gui/composables/useCalendarViewStore.ts
  2. 1
      packages/nc-gui/lang/en.json

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

@ -514,21 +514,23 @@ const [useProvideCalendarViewStore, useCalendarViewStore] = useInjectionState(
}) })
if (!base?.value?.id || !meta.value?.id || !viewMeta.value?.id) return if (!base?.value?.id || !meta.value?.id || !viewMeta.value?.id) return
const res = !isPublic.value
? await api.dbViewRow.calendarCount('noco', base.value.id!, meta.value!.id!, viewMeta.value.id, { try {
...queryParams.value, const res = !isPublic.value
...{}, ? await api.dbViewRow.calendarCount('noco', base.value.id!, meta.value!.id!, viewMeta.value.id, {
...{}, ...queryParams.value,
...{ filterArrJson: JSON.stringify([...activeDateFilter]) }, ...{},
}) ...{},
: await fetchSharedViewActiveDate({ ...{ filterArrJson: JSON.stringify([...activeDateFilter]) },
sortsArr: sorts.value, })
filtersArr: activeDateFilter, : await fetchSharedViewActiveDate({
}) sortsArr: sorts.value,
if (res) { filtersArr: activeDateFilter,
})
activeDates.value = res.map((dateObj: unknown) => dayjs(dateObj)) activeDates.value = res.map((dateObj: unknown) => dayjs(dateObj))
} else { } catch (e) {
activeDates.value = [] message.error(`${t('msg.error.fetchingActiveDates')} ${await extractSdkResponseErrorMsg(e)}`)
console.log(e)
} }
} }

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

@ -1286,6 +1286,7 @@
"groupClearIsNotSupportedOnLinksColumn": "Group clear operation is not supported on Links/LinkToAnotherRecord column" "groupClearIsNotSupportedOnLinksColumn": "Group clear operation is not supported on Links/LinkToAnotherRecord column"
}, },
"error": { "error": {
"fetchingActiveDates": "Error fetching active dates",
"scopesRequired": "Scopes required", "scopesRequired": "Scopes required",
"authUrlRequired": "Auth URL is required", "authUrlRequired": "Auth URL is required",
"userNameAttributeRequired": "Username attribute is required", "userNameAttributeRequired": "Username attribute is required",

Loading…
Cancel
Save