From cb919a17e1a2fcf4917c6b370cfb58bfea07ea79 Mon Sep 17 00:00:00 2001 From: mertmit Date: Mon, 29 Aug 2022 17:50:43 +0300 Subject: [PATCH 1/9] fix: use theme primary for project color Signed-off-by: mertmit --- packages/nc-gui-v2/composables/useProject.ts | 1 + packages/nc-gui-v2/pages/index/index/[id].vue | 44 ------------------- .../nc-gui-v2/pages/index/index/index.vue | 5 +-- 3 files changed, 3 insertions(+), 47 deletions(-) diff --git a/packages/nc-gui-v2/composables/useProject.ts b/packages/nc-gui-v2/composables/useProject.ts index f9128e9186..6af3e9de92 100644 --- a/packages/nc-gui-v2/composables/useProject.ts +++ b/packages/nc-gui-v2/composables/useProject.ts @@ -103,6 +103,7 @@ export function useProject(projectId?: MaybeRef) { async function saveTheme(theme: Partial) { await updateProject({ + color: theme.primaryColor, meta: JSON.stringify({ ...projectMeta.value, theme, diff --git a/packages/nc-gui-v2/pages/index/index/[id].vue b/packages/nc-gui-v2/pages/index/index/[id].vue index 9e0857d8f0..3e4c977c3b 100644 --- a/packages/nc-gui-v2/pages/index/index/[id].vue +++ b/packages/nc-gui-v2/pages/index/index/[id].vue @@ -2,7 +2,6 @@ import type { Form } from 'ant-design-vue' import { message } from 'ant-design-vue' import type { ProjectType } from 'nocodb-sdk' -import tinycolor from 'tinycolor2' import { extractSdkResponseErrorMsg, navigateTo, @@ -38,11 +37,9 @@ const form = ref() const formState = reactive>({ title: '', - color: '#FFFFFF00', }) const renameProject = async () => { - formState.color = formState.color === '#FFFFFF00' ? '' : formState.color try { await updateProject(formState) @@ -55,7 +52,6 @@ const renameProject = async () => { // select and focus title field on load onMounted(async () => { formState.title = project.value.title as string - formState.color = project.value.color && tinycolor(project.value.color).isValid() ? project.value.color : '#FFFFFF00' await nextTick(() => { // todo: replace setTimeout and follow better approach setTimeout(() => { @@ -98,27 +94,6 @@ onMounted(async () => { -
- Project color: - - - - - - - - -
-