diff --git a/packages/nc-gui/components/account/Breadcrumb.vue b/packages/nc-gui/components/account/Breadcrumb.vue index 097082944b..376f2cf841 100644 --- a/packages/nc-gui/components/account/Breadcrumb.vue +++ b/packages/nc-gui/components/account/Breadcrumb.vue @@ -44,6 +44,13 @@ const breadcrumb = computed(() => { }) break } + case 'setup': { + payload.push({ + title: t('labels.setup'), + active: true, + }) + break + } } switch (route.params.nestedPage) { diff --git a/packages/nc-gui/components/account/Setup.vue b/packages/nc-gui/components/account/Setup.vue new file mode 100644 index 0000000000..8721bef153 --- /dev/null +++ b/packages/nc-gui/components/account/Setup.vue @@ -0,0 +1,62 @@ + + + + + diff --git a/packages/nc-gui/components/account/setup/Email.vue b/packages/nc-gui/components/account/setup/Email.vue new file mode 100644 index 0000000000..10178bed20 --- /dev/null +++ b/packages/nc-gui/components/account/setup/Email.vue @@ -0,0 +1,115 @@ + + + + + diff --git a/packages/nc-gui/components/account/setup/Storage.vue b/packages/nc-gui/components/account/setup/Storage.vue new file mode 100644 index 0000000000..b1471b43ec --- /dev/null +++ b/packages/nc-gui/components/account/setup/Storage.vue @@ -0,0 +1,114 @@ + + + + + diff --git a/packages/nc-gui/composables/useAccountSetupStore.ts b/packages/nc-gui/composables/useAccountSetupStore.ts new file mode 100644 index 0000000000..96cbae53b6 --- /dev/null +++ b/packages/nc-gui/composables/useAccountSetupStore.ts @@ -0,0 +1,46 @@ +import rfdc from 'rfdc' +import type { ColumnReqType, ColumnType, PluginType, TableType } from 'nocodb-sdk' +import { UITypes, isLinksOrLTAR } from 'nocodb-sdk' +import type { Ref } from 'vue' +import type { RuleObject } from 'ant-design-vue/es/form' +import { generateUniqueColumnName } from '~/helpers/parsers/parserHelpers' + +const [useProvideAccountSetupStore, useAccountSetupStore] = createInjectionState(() => { + const apps = ref<(PluginType & { parsedInput?: Record; tags?: string[] })[]>([]) + + const { $api, $e } = useNuxtApp() + + const emailApps = computed(() => apps.value.filter((app) => app.category === 'Email')) + const storageApps = computed(() => apps.value.filter((app) => app.category === ('Storage'))) + + const loadSetupApps = async () => { + try { + const plugins = (await $api.plugin.list()).list ?? [] + + apps.value = plugins.map((p) => ({ + ...p, + tags: p.tags ? p.tags.split(',') : [], + parsedInput: p.input && JSON.parse(p.input as string), + })) as any[] + } catch (e: any) { + message.error(await extractSdkResponseErrorMsg(e)) + } + } + + return { + apps, + emailApps, + storageApps, + loadSetupApps, + } +}) + +export { useProvideAccountSetupStore } + +export function useAccountSetupStoreOrThrow() { + const columnCreateStore = useAccountSetupStore() + + if (columnCreateStore == null) throw new Error('Please call `useProvideAccountSetupStore` on the appropriate parent component') + + return columnCreateStore +} diff --git a/packages/nc-gui/lang/en.json b/packages/nc-gui/lang/en.json index 438ccfc4a3..681f4aa50b 100644 --- a/packages/nc-gui/lang/en.json +++ b/packages/nc-gui/lang/en.json @@ -616,6 +616,9 @@ "categories": "Categories" }, "labels": { + "setup": "Setup", + "setupLabel": "Setup {label}", + "switchToProd": "Switch to a production-ready app database", "fieldID": "Field ID", "addDescription": "Add description", "editDescription": "Edit description", diff --git a/packages/nc-gui/pages/account/index.vue b/packages/nc-gui/pages/account/index.vue index 5bff58c070..b6fefaa2ac 100644 --- a/packages/nc-gui/pages/account/index.vue +++ b/packages/nc-gui/pages/account/index.vue @@ -60,6 +60,21 @@ const logout = async () => {
{{ $t('labels.account') }}
+ +
+ + +
{{ $t('labels.setup') }}
+
+
+
+ diff --git a/packages/nc-gui/pages/account/index/setup/[[nestedPage]].vue b/packages/nc-gui/pages/account/index/setup/[[nestedPage]].vue new file mode 100644 index 0000000000..c92bbadb07 --- /dev/null +++ b/packages/nc-gui/pages/account/index/setup/[[nestedPage]].vue @@ -0,0 +1,21 @@ + + +