From c8bc89fd0919c58b5e4c93bc7087d105f672bf99 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Thu, 6 Oct 2022 12:09:21 +0530 Subject: [PATCH 001/125] fix(gui): hide external db project creation option if disabled Signed-off-by: Pranav C --- packages/nc-gui/pages/index/index/index.vue | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/nc-gui/pages/index/index/index.vue b/packages/nc-gui/pages/index/index/index.vue index 6c132554a1..ee105dd7ee 100644 --- a/packages/nc-gui/pages/index/index/index.vue +++ b/packages/nc-gui/pages/index/index/index.vue @@ -16,6 +16,7 @@ import { useApi, useNuxtApp, useUIPermission, + useGlobal } from '#imports' definePageMeta({ @@ -32,6 +33,8 @@ const filterQuery = ref('') const projects = ref() +const { appInfo, } = $(useGlobal()) + const loadProjects = async () => { const response = await api.project.list({}) projects.value = response.list @@ -177,7 +180,7 @@ onBeforeMount(loadProjects) - +
Date: Thu, 6 Oct 2022 12:18:35 +0530 Subject: [PATCH 002/125] fix(api): disable external project creation in api level Signed-off-by: Pranav C --- packages/nocodb/src/lib/meta/api/projectApis.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/nocodb/src/lib/meta/api/projectApis.ts b/packages/nocodb/src/lib/meta/api/projectApis.ts index 177d70b931..75ca810f80 100644 --- a/packages/nocodb/src/lib/meta/api/projectApis.ts +++ b/packages/nocodb/src/lib/meta/api/projectApis.ts @@ -55,7 +55,11 @@ export async function projectUpdate( 'color', ]); - if (data?.title && project.title !== data.title && await Project.getByTitle(data.title)) { + if ( + data?.title && + project.title !== data.title && + (await Project.getByTitle(data.title)) + ) { NcError.badRequest('Project title already in use'); } @@ -114,6 +118,9 @@ async function projectCreate(req: Request, res) { }, ]; } else { + if (process.env.NC_CONNECT_TO_EXTERNAL_DB_DISABLED) { + NcError.badRequest('Connecting to external db is disabled'); + } projectBody.is_meta = false; } From df9e333a198148f8bb16a4885776e93726128e19 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Thu, 6 Oct 2022 12:25:46 +0530 Subject: [PATCH 003/125] chore(gui): lint Signed-off-by: Pranav C --- packages/nc-gui/components/smartsheet/sidebar/MenuTop.vue | 1 - packages/nc-gui/pages/index/index/index.vue | 4 ++-- packages/nc-gui/pages/signup/[[token]].vue | 5 ++++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/nc-gui/components/smartsheet/sidebar/MenuTop.vue b/packages/nc-gui/components/smartsheet/sidebar/MenuTop.vue index a537d0774c..58d4e94a54 100644 --- a/packages/nc-gui/components/smartsheet/sidebar/MenuTop.vue +++ b/packages/nc-gui/components/smartsheet/sidebar/MenuTop.vue @@ -17,7 +17,6 @@ import { useDialog, useI18n, useNuxtApp, - useRoute, useRouter, viewTypeAlias, watch, diff --git a/packages/nc-gui/pages/index/index/index.vue b/packages/nc-gui/pages/index/index/index.vue index ee105dd7ee..cd4c2a9bd3 100644 --- a/packages/nc-gui/pages/index/index/index.vue +++ b/packages/nc-gui/pages/index/index/index.vue @@ -14,9 +14,9 @@ import { ref, themeV2Colors, useApi, + useGlobal, useNuxtApp, useUIPermission, - useGlobal } from '#imports' definePageMeta({ @@ -33,7 +33,7 @@ const filterQuery = ref('') const projects = ref() -const { appInfo, } = $(useGlobal()) +const { appInfo } = $(useGlobal()) const loadProjects = async () => { const response = await api.project.list({}) diff --git a/packages/nc-gui/pages/signup/[[token]].vue b/packages/nc-gui/pages/signup/[[token]].vue index 0a58307856..e2729bf8e8 100644 --- a/packages/nc-gui/pages/signup/[[token]].vue +++ b/packages/nc-gui/pages/signup/[[token]].vue @@ -85,7 +85,10 @@ function resetError() {
- +

{{ $t('general.signUp') }} From 6c57ba6157fdf141401a499bd05e39b7a4de8941 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Thu, 6 Oct 2022 12:50:48 +0530 Subject: [PATCH 004/125] refactor(gui): remove unnecessary wrapping Signed-off-by: Pranav C --- packages/nc-gui/pages/index/index/index.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nc-gui/pages/index/index/index.vue b/packages/nc-gui/pages/index/index/index.vue index cd4c2a9bd3..022e06fa78 100644 --- a/packages/nc-gui/pages/index/index/index.vue +++ b/packages/nc-gui/pages/index/index/index.vue @@ -33,7 +33,7 @@ const filterQuery = ref('') const projects = ref() -const { appInfo } = $(useGlobal()) +const { appInfo } = useGlobal() const loadProjects = async () => { const response = await api.project.list({}) From 77d66b985c2447c4d41c4517f6e587bcc38f5c75 Mon Sep 17 00:00:00 2001 From: braks <78412429+bcakmakoglu@users.noreply.github.com> Date: Wed, 5 Oct 2022 16:03:26 +0200 Subject: [PATCH 005/125] fix(nc-gui): add google auth button to signin page --- packages/nc-gui/pages/signin.vue | 14 +++++++++++++- packages/nc-gui/pages/signup/[[token]].vue | 2 +- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/packages/nc-gui/pages/signin.vue b/packages/nc-gui/pages/signin.vue index d7bc09915c..1114b01d58 100644 --- a/packages/nc-gui/pages/signin.vue +++ b/packages/nc-gui/pages/signin.vue @@ -7,7 +7,7 @@ definePageMeta({ title: 'title.headLogin', }) -const { signIn: _signIn } = useGlobal() +const { signIn: _signIn, appInfo } = useGlobal() const { api, isLoading, error } = useApi({ useGlobalInstance: true }) @@ -119,6 +119,18 @@ function resetError() { + + + + + Sign In with Google + + +
{{ $t('msg.info.signUp.dontHaveAccount') }} {{ $t('general.signUp') }} diff --git a/packages/nc-gui/pages/signup/[[token]].vue b/packages/nc-gui/pages/signup/[[token]].vue index 01b8af6ac0..0494bc5175 100644 --- a/packages/nc-gui/pages/signup/[[token]].vue +++ b/packages/nc-gui/pages/signup/[[token]].vue @@ -132,7 +132,7 @@ function resetError() { From 11be968bd21871ba636ffddbd10bea6d3ad404c2 Mon Sep 17 00:00:00 2001 From: braks <78412429+bcakmakoglu@users.noreply.github.com> Date: Thu, 6 Oct 2022 10:31:49 +0200 Subject: [PATCH 006/125] chore(nc-gui): add en translation for signin with google --- packages/nc-gui/lang/en.json | 1 + packages/nc-gui/pages/signin.vue | 2 +- packages/nc-gui/pages/signup/[[token]].vue | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/nc-gui/lang/en.json b/packages/nc-gui/lang/en.json index 518421bfe2..fe935f5c62 100644 --- a/packages/nc-gui/lang/en.json +++ b/packages/nc-gui/lang/en.json @@ -292,6 +292,7 @@ "documentation": "Documentation", "subscribeNewsletter": "Subscribe to our weekly newsletter", "signUpWithGoogle": "Sign up with Google", + "signInWithGoogle": "Sign in with Google", "agreeToTos": "By signing up, you agree to the Terms of Service", "welcomeToNc": "Welcome to NocoDB!" }, diff --git a/packages/nc-gui/pages/signin.vue b/packages/nc-gui/pages/signin.vue index 1114b01d58..e20f5f9075 100644 --- a/packages/nc-gui/pages/signin.vue +++ b/packages/nc-gui/pages/signin.vue @@ -127,7 +127,7 @@ function resetError() { - Sign In with Google + {{ $t('labels.signInWithGoogle') }} diff --git a/packages/nc-gui/pages/signup/[[token]].vue b/packages/nc-gui/pages/signup/[[token]].vue index 0494bc5175..a9204c852d 100644 --- a/packages/nc-gui/pages/signup/[[token]].vue +++ b/packages/nc-gui/pages/signup/[[token]].vue @@ -138,7 +138,7 @@ function resetError() { - Sign up with Google + {{ $t('labels.signUpWithGoogle') }} From 1bb2c285ac5bbc94380f87f4aca930ece85edfa4 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Thu, 6 Oct 2022 13:17:45 +0530 Subject: [PATCH 007/125] feat(gui): scroll to the active cell on active cell change Signed-off-by: Pranav C --- .../nc-gui/components/smartsheet/Grid.vue | 311 +++++++++--------- 1 file changed, 164 insertions(+), 147 deletions(-) diff --git a/packages/nc-gui/components/smartsheet/Grid.vue b/packages/nc-gui/components/smartsheet/Grid.vue index 0a101e3946..3e773052f9 100644 --- a/packages/nc-gui/components/smartsheet/Grid.vue +++ b/packages/nc-gui/components/smartsheet/Grid.vue @@ -327,6 +327,22 @@ watch( }, { immediate: true }, ) + +const tbodyEl = ref() + +watch([() => selected.row, () => selected.col], ([row, col]) => { + if (row !== null && col !== null) { + // get active cell + const td = tbodyEl.value?.querySelectorAll('tr')[row]?.querySelectorAll('td')[col + 1] + if (!td) return + // scroll into the active cell + td.scrollIntoView({ + behavior: 'smooth', + block: 'end', + inline: 'end', + }) + } +})