From 673bc3510861cb4bced7cac0056bdc758b238e80 Mon Sep 17 00:00:00 2001 From: mertmit Date: Thu, 9 May 2024 16:22:58 +0000 Subject: [PATCH] feat: increase number of sources per base --- .../dashboard/settings/DataSources.vue | 36 ++++--------------- .../components/dashboard/settings/Modal.vue | 11 ++---- .../nc-gui/components/project/AllTables.vue | 4 +-- packages/nc-gui/lang/ar.json | 2 +- packages/nc-gui/lang/bn_IN.json | 2 +- packages/nc-gui/lang/cs.json | 2 +- packages/nc-gui/lang/da.json | 2 +- packages/nc-gui/lang/de.json | 2 +- packages/nc-gui/lang/en.json | 2 +- packages/nc-gui/lang/eu.json | 2 +- packages/nc-gui/lang/fa.json | 2 +- packages/nc-gui/lang/fi.json | 2 +- packages/nc-gui/lang/he.json | 2 +- packages/nc-gui/lang/hi.json | 2 +- packages/nc-gui/lang/hr.json | 2 +- packages/nc-gui/lang/id.json | 2 +- packages/nc-gui/lang/ja.json | 2 +- packages/nc-gui/lang/lv.json | 2 +- packages/nc-gui/lang/nl.json | 2 +- packages/nc-gui/lang/no.json | 2 +- packages/nc-gui/lang/pt.json | 2 +- packages/nc-gui/lang/pt_BR.json | 2 +- packages/nc-gui/lang/ru.json | 2 +- packages/nc-gui/lang/sk.json | 2 +- packages/nc-gui/lang/sl.json | 2 +- packages/nc-gui/lang/sv.json | 2 +- packages/nc-gui/lang/th.json | 2 +- packages/nc-gui/lang/tr.json | 2 +- packages/nc-gui/lang/uk.json | 2 +- packages/nc-gui/lang/vi.json | 2 +- packages/nc-gui/lang/zh-Hant.json | 2 +- 31 files changed, 39 insertions(+), 68 deletions(-) diff --git a/packages/nc-gui/components/dashboard/settings/DataSources.vue b/packages/nc-gui/components/dashboard/settings/DataSources.vue index d57b76a3d7..f3b0d2b7be 100644 --- a/packages/nc-gui/components/dashboard/settings/DataSources.vue +++ b/packages/nc-gui/components/dashboard/settings/DataSources.vue @@ -10,7 +10,7 @@ interface Props { const props = defineProps() -const emits = defineEmits(['update:state', 'update:reload', 'awaken']) +const emits = defineEmits(['update:state', 'update:reload']) const vState = useVModel(props, 'state', emits) @@ -20,7 +20,9 @@ const { $api, $e } = useNuxtApp() const { t } = useI18n() -const { loadProject } = useBases() +const basesStore = useBases() +const { loadProject } = basesStore +const { isDataSourceLimitReached } = storeToRefs(basesStore) const baseStore = useBase() const { base } = storeToRefs(baseStore) @@ -37,10 +39,6 @@ const clientType = ref(ClientType.MYSQL) const isReloading = ref(false) -const forceAwakened = ref(false) - -const dataSourcesAwakened = ref(false) - const isDeleteBaseModalOpen = ref(false) const toBeDeletedBase = ref() @@ -142,12 +140,6 @@ const moveBase = async (e: any) => { } } -const forceAwaken = () => { - forceAwakened.value = !forceAwakened.value - dataSourcesAwakened.value = forceAwakened.value - emits('awaken', forceAwakened.value) -} - watch( projectPageTab, () => { @@ -169,20 +161,6 @@ watch( }, ) -watch( - () => sources.value.length, - (l) => { - if (l > 1 && !forceAwakened.value) { - dataSourcesAwakened.value = false - emits('awaken', false) - } else { - dataSourcesAwakened.value = true - emits('awaken', true) - } - }, - { immediate: true }, -) - watch( vState, async (newState) => { @@ -211,7 +189,7 @@ watch( vState.value = DataSourcesSubTab.New break case DataSourcesSubTab.New: - if (sources.value.length > 1 && !forceAwakened.value) { + if (isDataSourceLimitReached.value) { vState.value = '' } break @@ -292,7 +270,7 @@ const isEditBaseModalOpen = computed({
-
{{ $t('general.visibility') }}
+
{{ $t('general.visibility') }}
{{ $t('general.name') }}
{{ $t('general.type') }}
{{ $t('labels.actions') }}
diff --git a/packages/nc-gui/components/dashboard/settings/Modal.vue b/packages/nc-gui/components/dashboard/settings/Modal.vue index c7c60682a9..74335859d7 100644 --- a/packages/nc-gui/components/dashboard/settings/Modal.vue +++ b/packages/nc-gui/components/dashboard/settings/Modal.vue @@ -45,9 +45,9 @@ const { $e } = useNuxtApp() const { t } = useI18n() -const dataSourcesReload = ref(false) +const { isDataSourceLimitReached } = storeToRefs(useBases()) -const dataSourcesAwakened = ref(false) +const dataSourcesReload = ref(false) const tabsInfo: TabGroup = { // teamAndAuth: { @@ -139,10 +139,6 @@ const selectedTab = computed(() => tabsInfo[selectedTabKeys.value[0]]) const selectedSubTabKeys = ref([firstKeyOfObject(selectedTab.value.subTabs)]) const selectedSubTab = computed(() => selectedTab.value.subTabs[selectedSubTabKeys.value[0]]) -const handleAwaken = (val: boolean) => { - dataSourcesAwakened.value = val -} - watch( () => selectedTabKeys.value[0], (newTabKey) => { @@ -221,7 +217,7 @@ watch(
Number(openedProject.value?.sources?.length) > 1) - const { isUIAllowed } = useRoles() const { $e } = useNuxtApp() diff --git a/packages/nc-gui/lang/ar.json b/packages/nc-gui/lang/ar.json index faf8cb873e..c6e5262f18 100644 --- a/packages/nc-gui/lang/ar.json +++ b/packages/nc-gui/lang/ar.json @@ -1009,7 +1009,7 @@ "group": "Group" }, "tooltip": { - "reachedSourceLimit": "Limited to only one data source for the moment", + "reachedSourceLimit": "Limited to 10 data sources per base for the moment", "saveChanges": "حفظ التغييرات", "xcDB": "إنشاء مشروع جديد", "extDB": "يدعم MySQL ، PostgreSQL ، SQL Server و SQLite", diff --git a/packages/nc-gui/lang/bn_IN.json b/packages/nc-gui/lang/bn_IN.json index 9b74257170..7dde4c62dd 100644 --- a/packages/nc-gui/lang/bn_IN.json +++ b/packages/nc-gui/lang/bn_IN.json @@ -1009,7 +1009,7 @@ "group": "Group" }, "tooltip": { - "reachedSourceLimit": "Limited to only one data source for the moment", + "reachedSourceLimit": "Limited to 10 data sources per base for the moment", "saveChanges": "परिवर्तनों को सुरक्षित करें", "xcDB": "একটি নতুন প্রকল্প তৈরি করুন", "extDB": "মাইএসকিউএল, পোস্টগ্রেসকিউএল, এসকিউএল সার্ভার এবং এসকিউএলাইট সমর্থন করে", diff --git a/packages/nc-gui/lang/cs.json b/packages/nc-gui/lang/cs.json index 46f6951d47..308fbeab58 100644 --- a/packages/nc-gui/lang/cs.json +++ b/packages/nc-gui/lang/cs.json @@ -1009,7 +1009,7 @@ "group": "Group" }, "tooltip": { - "reachedSourceLimit": "Limited to only one data source for the moment", + "reachedSourceLimit": "Limited to 10 data sources per base for the moment", "saveChanges": "Uložit změny", "xcDB": "Vytvoření nového projektu", "extDB": "Podpora MySQL, PostgreSQL, SQL Server a SQLite", diff --git a/packages/nc-gui/lang/da.json b/packages/nc-gui/lang/da.json index f08744b3ea..d1c896ca59 100644 --- a/packages/nc-gui/lang/da.json +++ b/packages/nc-gui/lang/da.json @@ -1009,7 +1009,7 @@ "group": "Group" }, "tooltip": { - "reachedSourceLimit": "Limited to only one data source for the moment", + "reachedSourceLimit": "Limited to 10 data sources per base for the moment", "saveChanges": "Gem ændringer", "xcDB": "Opret et nyt projekt", "extDB": "Understøtter MySQL, PostgreSQL, SQL Server & SQLITE", diff --git a/packages/nc-gui/lang/de.json b/packages/nc-gui/lang/de.json index a060ec8562..6bffbe8393 100644 --- a/packages/nc-gui/lang/de.json +++ b/packages/nc-gui/lang/de.json @@ -1009,7 +1009,7 @@ "group": "Group" }, "tooltip": { - "reachedSourceLimit": "Limited to only one data source for the moment", + "reachedSourceLimit": "Limited to 10 data sources per base for the moment", "saveChanges": "Änderungen speichern", "xcDB": "Neues Projekt erstellen", "extDB": "Unterstützt MySQL, PostgreSQL, SQL Server & SQLite", diff --git a/packages/nc-gui/lang/en.json b/packages/nc-gui/lang/en.json index 6006065a98..75811c6035 100644 --- a/packages/nc-gui/lang/en.json +++ b/packages/nc-gui/lang/en.json @@ -1009,7 +1009,7 @@ "group": "Group" }, "tooltip": { - "reachedSourceLimit": "Limited to only one data source for the moment", + "reachedSourceLimit": "Limited to 10 data sources per base for the moment", "saveChanges": "Save changes", "xcDB": "Create a new base", "extDB": "Supports MySQL, PostgreSQL, SQL Server & SQLite", diff --git a/packages/nc-gui/lang/eu.json b/packages/nc-gui/lang/eu.json index c74bc9dcdb..1b60155328 100644 --- a/packages/nc-gui/lang/eu.json +++ b/packages/nc-gui/lang/eu.json @@ -1009,7 +1009,7 @@ "group": "Group" }, "tooltip": { - "reachedSourceLimit": "Limited to only one data source for the moment", + "reachedSourceLimit": "Limited to 10 data sources per base for the moment", "saveChanges": "Save changes", "xcDB": "Create a new project", "extDB": "Supports MySQL, PostgreSQL, SQL Server & SQLite", diff --git a/packages/nc-gui/lang/fa.json b/packages/nc-gui/lang/fa.json index 3c120e1c89..45f40e258c 100644 --- a/packages/nc-gui/lang/fa.json +++ b/packages/nc-gui/lang/fa.json @@ -1009,7 +1009,7 @@ "group": "Group" }, "tooltip": { - "reachedSourceLimit": "Limited to only one data source for the moment", + "reachedSourceLimit": "Limited to 10 data sources per base for the moment", "saveChanges": "ذخیره تغییرات", "xcDB": "ایجاد یک پروژه جدید", "extDB": "پشتیبانی از MySQL ،PostgreSQL ،SQL Server و SQLite", diff --git a/packages/nc-gui/lang/fi.json b/packages/nc-gui/lang/fi.json index 1d19b60fe0..da5262347d 100644 --- a/packages/nc-gui/lang/fi.json +++ b/packages/nc-gui/lang/fi.json @@ -1009,7 +1009,7 @@ "group": "Group" }, "tooltip": { - "reachedSourceLimit": "Limited to only one data source for the moment", + "reachedSourceLimit": "Limited to 10 data sources per base for the moment", "saveChanges": "Tallenna muutokset", "xcDB": "Luo uusi projekti", "extDB": "Tukee MySQL, PostgreSQL, SQL Server & Sqlite", diff --git a/packages/nc-gui/lang/he.json b/packages/nc-gui/lang/he.json index aa7530efea..202f5a9209 100644 --- a/packages/nc-gui/lang/he.json +++ b/packages/nc-gui/lang/he.json @@ -1009,7 +1009,7 @@ "group": "Group" }, "tooltip": { - "reachedSourceLimit": "Limited to only one data source for the moment", + "reachedSourceLimit": "Limited to 10 data sources per base for the moment", "saveChanges": "שמור שינויים", "xcDB": "צור פרויקט חדש", "extDB": "תומך MySQL, PostgreSQL, SQL Server & SQLite", diff --git a/packages/nc-gui/lang/hi.json b/packages/nc-gui/lang/hi.json index 8887dba7a2..671248d706 100644 --- a/packages/nc-gui/lang/hi.json +++ b/packages/nc-gui/lang/hi.json @@ -1009,7 +1009,7 @@ "group": "Group" }, "tooltip": { - "reachedSourceLimit": "Limited to only one data source for the moment", + "reachedSourceLimit": "Limited to 10 data sources per base for the moment", "saveChanges": "परिवर्तनों को सुरक्षित करें", "xcDB": "एक नया प्रोजेक्ट बनाएं", "extDB": "MySQL, PostgreSQL, SQL सर्वर और SQLite का समर्थन करता है", diff --git a/packages/nc-gui/lang/hr.json b/packages/nc-gui/lang/hr.json index 047c4128d5..94937eb4c2 100644 --- a/packages/nc-gui/lang/hr.json +++ b/packages/nc-gui/lang/hr.json @@ -1009,7 +1009,7 @@ "group": "Group" }, "tooltip": { - "reachedSourceLimit": "Limited to only one data source for the moment", + "reachedSourceLimit": "Limited to 10 data sources per base for the moment", "saveChanges": "Spremi promjene", "xcDB": "Stvoriti novi projekt", "extDB": "Podržava MySQL, PostgreSQL, SQL Server & Sqlite", diff --git a/packages/nc-gui/lang/id.json b/packages/nc-gui/lang/id.json index f6ae66b423..171764d8a2 100644 --- a/packages/nc-gui/lang/id.json +++ b/packages/nc-gui/lang/id.json @@ -1009,7 +1009,7 @@ "group": "Group" }, "tooltip": { - "reachedSourceLimit": "Limited to only one data source for the moment", + "reachedSourceLimit": "Limited to 10 data sources per base for the moment", "saveChanges": "Simpan perubahan", "xcDB": "Buat proyek baru", "extDB": "Mendukung MySQL, PostgreSQL, SQL Server & SQLite", diff --git a/packages/nc-gui/lang/ja.json b/packages/nc-gui/lang/ja.json index e7f76f1072..d35ef62154 100644 --- a/packages/nc-gui/lang/ja.json +++ b/packages/nc-gui/lang/ja.json @@ -1009,7 +1009,7 @@ "group": "Group" }, "tooltip": { - "reachedSourceLimit": "Limited to only one data source for the moment", + "reachedSourceLimit": "Limited to 10 data sources per base for the moment", "saveChanges": "変更を保存", "xcDB": "プロジェクトを作成", "extDB": "MySQL、PostgreSQL、SQL Server&SQLiteをサポートしています", diff --git a/packages/nc-gui/lang/lv.json b/packages/nc-gui/lang/lv.json index 0f49502889..caed10d75e 100644 --- a/packages/nc-gui/lang/lv.json +++ b/packages/nc-gui/lang/lv.json @@ -1009,7 +1009,7 @@ "group": "Group" }, "tooltip": { - "reachedSourceLimit": "Limited to only one data source for the moment", + "reachedSourceLimit": "Limited to 10 data sources per base for the moment", "saveChanges": "Saglabāt izmaiņas", "xcDB": "Izveidot jaunu projektu", "extDB": "Atbalsta MySQL, PostgreSQL, SQL Server & SQLite", diff --git a/packages/nc-gui/lang/nl.json b/packages/nc-gui/lang/nl.json index 70fbe2aef0..e3dd098a29 100644 --- a/packages/nc-gui/lang/nl.json +++ b/packages/nc-gui/lang/nl.json @@ -1009,7 +1009,7 @@ "group": "Group" }, "tooltip": { - "reachedSourceLimit": "Limited to only one data source for the moment", + "reachedSourceLimit": "Limited to 10 data sources per base for the moment", "saveChanges": "Wijzigingen opslaan", "xcDB": "Maak een nieuw project", "extDB": "Ondersteunt MySQL, PostgreSQL, SQL Server & Sqlite", diff --git a/packages/nc-gui/lang/no.json b/packages/nc-gui/lang/no.json index 95394e0d1d..697403c7b5 100644 --- a/packages/nc-gui/lang/no.json +++ b/packages/nc-gui/lang/no.json @@ -1009,7 +1009,7 @@ "group": "Group" }, "tooltip": { - "reachedSourceLimit": "Limited to only one data source for the moment", + "reachedSourceLimit": "Limited to 10 data sources per base for the moment", "saveChanges": "Lagre endringer", "xcDB": "Opprett et nytt prosjekt", "extDB": "Støtter MySQL, PostgreSQL, SQL Server & Sqlite", diff --git a/packages/nc-gui/lang/pt.json b/packages/nc-gui/lang/pt.json index ce87c03c94..28d55ec3e8 100644 --- a/packages/nc-gui/lang/pt.json +++ b/packages/nc-gui/lang/pt.json @@ -1009,7 +1009,7 @@ "group": "Group" }, "tooltip": { - "reachedSourceLimit": "Limited to only one data source for the moment", + "reachedSourceLimit": "Limited to 10 data sources per base for the moment", "saveChanges": "Salvar alterações", "xcDB": "Criar um novo projecto", "extDB": "Suporta MySQL, PostgreSQL, SQL Server & SQLite", diff --git a/packages/nc-gui/lang/pt_BR.json b/packages/nc-gui/lang/pt_BR.json index bf11f2f7ee..0f493f2f95 100644 --- a/packages/nc-gui/lang/pt_BR.json +++ b/packages/nc-gui/lang/pt_BR.json @@ -1009,7 +1009,7 @@ "group": "Group" }, "tooltip": { - "reachedSourceLimit": "Limited to only one data source for the moment", + "reachedSourceLimit": "Limited to 10 data sources per base for the moment", "saveChanges": "Salvar alterações", "xcDB": "Criar um novo projeto", "extDB": "Suporta MySQL, PostgreSQL, SQL Server e SQLite", diff --git a/packages/nc-gui/lang/ru.json b/packages/nc-gui/lang/ru.json index 9d9127cb9f..246066d226 100644 --- a/packages/nc-gui/lang/ru.json +++ b/packages/nc-gui/lang/ru.json @@ -1009,7 +1009,7 @@ "group": "Group" }, "tooltip": { - "reachedSourceLimit": "Limited to only one data source for the moment", + "reachedSourceLimit": "Limited to 10 data sources per base for the moment", "saveChanges": "Сохранить изменения", "xcDB": "Создать новый проект", "extDB": "Поддерживает MySQL, PostgreSQL, SQL Server & Sqlite", diff --git a/packages/nc-gui/lang/sk.json b/packages/nc-gui/lang/sk.json index bee8073a8e..b83602ad5d 100644 --- a/packages/nc-gui/lang/sk.json +++ b/packages/nc-gui/lang/sk.json @@ -1009,7 +1009,7 @@ "group": "Group" }, "tooltip": { - "reachedSourceLimit": "Limited to only one data source for the moment", + "reachedSourceLimit": "Limited to 10 data sources per base for the moment", "saveChanges": "Uloženie zmien", "xcDB": "Vytvorenie nového projektu", "extDB": "Podporuje MySQL, PostgreSQL, SQL Server a SQLite", diff --git a/packages/nc-gui/lang/sl.json b/packages/nc-gui/lang/sl.json index 335b13ba31..aaa6f2c27c 100644 --- a/packages/nc-gui/lang/sl.json +++ b/packages/nc-gui/lang/sl.json @@ -1009,7 +1009,7 @@ "group": "Group" }, "tooltip": { - "reachedSourceLimit": "Limited to only one data source for the moment", + "reachedSourceLimit": "Limited to 10 data sources per base for the moment", "saveChanges": "Shrani spremembe", "xcDB": "Ustvari nov projekt", "extDB": "Podpira MySQL, PostgreSQL, SQL Server & SqLite", diff --git a/packages/nc-gui/lang/sv.json b/packages/nc-gui/lang/sv.json index 5aa1e03e53..2d4baa9ac8 100644 --- a/packages/nc-gui/lang/sv.json +++ b/packages/nc-gui/lang/sv.json @@ -1009,7 +1009,7 @@ "group": "Group" }, "tooltip": { - "reachedSourceLimit": "Limited to only one data source for the moment", + "reachedSourceLimit": "Limited to 10 data sources per base for the moment", "saveChanges": "Spara ändringar", "xcDB": "Skapa ett nytt projekt", "extDB": "Stödjer MySQL, PostgreSQL, SQL Server & SQLite", diff --git a/packages/nc-gui/lang/th.json b/packages/nc-gui/lang/th.json index b902e28812..2b69dc94ed 100644 --- a/packages/nc-gui/lang/th.json +++ b/packages/nc-gui/lang/th.json @@ -1009,7 +1009,7 @@ "group": "Group" }, "tooltip": { - "reachedSourceLimit": "Limited to only one data source for the moment", + "reachedSourceLimit": "Limited to 10 data sources per base for the moment", "saveChanges": "บันทึกการเปลี่ยนแปลง", "xcDB": "สร้างโครงการใหม่", "extDB": "รองรับ MySQL, POSTGRESQL, SQL Server & SQLite", diff --git a/packages/nc-gui/lang/tr.json b/packages/nc-gui/lang/tr.json index 84482ec2d2..39a733a385 100644 --- a/packages/nc-gui/lang/tr.json +++ b/packages/nc-gui/lang/tr.json @@ -1009,7 +1009,7 @@ "group": "Group" }, "tooltip": { - "reachedSourceLimit": "Limited to only one data source for the moment", + "reachedSourceLimit": "Limited to 10 data sources per base for the moment", "saveChanges": "Değişiklikleri Kaydet", "xcDB": "Yeni bir proje oluştur", "extDB": "MySQL, PostgreSQL, SQL Server & SQLite destekler", diff --git a/packages/nc-gui/lang/uk.json b/packages/nc-gui/lang/uk.json index b4eb4f6f38..8652e3e19f 100644 --- a/packages/nc-gui/lang/uk.json +++ b/packages/nc-gui/lang/uk.json @@ -1009,7 +1009,7 @@ "group": "Group" }, "tooltip": { - "reachedSourceLimit": "Limited to only one data source for the moment", + "reachedSourceLimit": "Limited to 10 data sources per base for the moment", "saveChanges": "Зберегти зміни", "xcDB": "Створити новий проєкт", "extDB": "Підтримує MySQL, PostgreSQL, SQL Server та SQLite", diff --git a/packages/nc-gui/lang/vi.json b/packages/nc-gui/lang/vi.json index 3a7f3703be..e73dcf3c37 100644 --- a/packages/nc-gui/lang/vi.json +++ b/packages/nc-gui/lang/vi.json @@ -1009,7 +1009,7 @@ "group": "Group" }, "tooltip": { - "reachedSourceLimit": "Limited to only one data source for the moment", + "reachedSourceLimit": "Limited to 10 data sources per base for the moment", "saveChanges": "Lưu thay đổi", "xcDB": "Tạo một dự án mới", "extDB": "Hỗ trợ MySQL, PostgreSQL, SQL Server & SQLite", diff --git a/packages/nc-gui/lang/zh-Hant.json b/packages/nc-gui/lang/zh-Hant.json index fe21534bc6..d98e963638 100644 --- a/packages/nc-gui/lang/zh-Hant.json +++ b/packages/nc-gui/lang/zh-Hant.json @@ -1009,7 +1009,7 @@ "group": "Group" }, "tooltip": { - "reachedSourceLimit": "Limited to only one data source for the moment", + "reachedSourceLimit": "Limited to 10 data sources per base for the moment", "saveChanges": "儲存更動", "xcDB": "建立新專案", "extDB": "支援 MySQL、PostgreSQL、SQL Server 和 SQLite",