From 0a27efe54367ee8ef4c62b810915912091271a5a Mon Sep 17 00:00:00 2001 From: braks <78412429+bcakmakoglu@users.noreply.github.com> Date: Wed, 27 Jul 2022 16:46:28 +0200 Subject: [PATCH 01/86] chore: shelve --- packages/nc-gui-v2/components.d.ts | 1 + .../components/smartsheet/Sidebar.vue | 44 ++++++++++--------- packages/nc-gui-v2/composables/useViews.ts | 17 ++++--- 3 files changed, 35 insertions(+), 27 deletions(-) diff --git a/packages/nc-gui-v2/components.d.ts b/packages/nc-gui-v2/components.d.ts index f5e940f2ba..ed57313599 100644 --- a/packages/nc-gui-v2/components.d.ts +++ b/packages/nc-gui-v2/components.d.ts @@ -38,6 +38,7 @@ declare module '@vue/runtime-core' { AMenuItemGroup: typeof import('ant-design-vue/es')['MenuItemGroup'] AModal: typeof import('ant-design-vue/es')['Modal'] APagination: typeof import('ant-design-vue/es')['Pagination'] + APopconfirm: typeof import('ant-design-vue/es')['Popconfirm'] ARow: typeof import('ant-design-vue/es')['Row'] ASelect: typeof import('ant-design-vue/es')['Select'] ASelectOption: typeof import('ant-design-vue/es')['SelectOption'] diff --git a/packages/nc-gui-v2/components/smartsheet/Sidebar.vue b/packages/nc-gui-v2/components/smartsheet/Sidebar.vue index 6b5c3d10d8..b97bf86063 100644 --- a/packages/nc-gui-v2/components/smartsheet/Sidebar.vue +++ b/packages/nc-gui-v2/components/smartsheet/Sidebar.vue @@ -1,42 +1,46 @@ @@ -277,5 +281,3 @@ const onViewCreate = (view) => { - - diff --git a/packages/nc-gui-v2/composables/useViews.ts b/packages/nc-gui-v2/composables/useViews.ts index b540b20794..577acf63aa 100644 --- a/packages/nc-gui-v2/composables/useViews.ts +++ b/packages/nc-gui-v2/composables/useViews.ts @@ -1,15 +1,20 @@ import type { FormType, GalleryType, GridType, KanbanType, TableType } from 'nocodb-sdk' -import type { Ref } from 'vue' +import type { MaybeRef } from '@vueuse/core' import { useNuxtApp } from '#app' -export default function (meta: Ref) { - const views = ref<(GridType | FormType | KanbanType | GalleryType)[]>() +export default function (meta: MaybeRef) { + let views = $ref<(GridType | FormType | KanbanType | GalleryType)[]>([]) const { $api } = useNuxtApp() const loadViews = async () => { - if (meta.value?.id) - views.value = (await $api.dbView.list(meta.value?.id)).list as (GridType | FormType | KanbanType | GalleryType)[] + const _meta = unref(meta) + + if (_meta && _meta.id) { + views = (await $api.dbView.list(_meta.id)).list as (GridType | FormType | KanbanType | GalleryType)[] + } } - return { views, loadViews } + watch(() => meta, loadViews, { immediate: true }) + + return { views: $$(views), loadViews } } From be826e3b84d6bd648bf96983b4e36b8b2383c5e2 Mon Sep 17 00:00:00 2001 From: braks <78412429+bcakmakoglu@users.noreply.github.com> Date: Tue, 26 Jul 2022 10:19:20 +0200 Subject: [PATCH 02/86] chore(gui-v2): update sheet alignment and padding --- packages/nc-gui-v2/pages/index/index.vue | 4 ++-- packages/nc-gui-v2/pages/nc/[projectId]/index.vue | 1 + packages/nc-gui-v2/pages/project/index.vue | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/nc-gui-v2/pages/index/index.vue b/packages/nc-gui-v2/pages/index/index.vue index 575ca831eb..116f3ce6c7 100644 --- a/packages/nc-gui-v2/pages/index/index.vue +++ b/packages/nc-gui-v2/pages/index/index.vue @@ -62,7 +62,7 @@ $state.sidebarOpen.value = false - + diff --git a/packages/nc-gui-v2/pages/nc/[projectId]/index.vue b/packages/nc-gui-v2/pages/nc/[projectId]/index.vue index d591dc85a3..7bbdff21e4 100644 --- a/packages/nc-gui-v2/pages/nc/[projectId]/index.vue +++ b/packages/nc-gui-v2/pages/nc/[projectId]/index.vue @@ -21,6 +21,7 @@ $state.sidebarOpen.value = true + diff --git a/packages/nc-gui-v2/pages/project/index.vue b/packages/nc-gui-v2/pages/project/index.vue index ea14b8a330..0433756fb7 100644 --- a/packages/nc-gui-v2/pages/project/index.vue +++ b/packages/nc-gui-v2/pages/project/index.vue @@ -8,6 +8,6 @@ From ac2e4e9e846adfc8ba53fdae4b6acc56aab0e71a Mon Sep 17 00:00:00 2001 From: braks <78412429+bcakmakoglu@users.noreply.github.com> Date: Tue, 26 Jul 2022 10:19:39 +0200 Subject: [PATCH 03/86] chore(gui-v2): fix active view type --- .../components/smartsheet/Sidebar.vue | 140 +----------------- packages/nc-gui-v2/context/index.ts | 4 +- 2 files changed, 10 insertions(+), 134 deletions(-) diff --git a/packages/nc-gui-v2/components/smartsheet/Sidebar.vue b/packages/nc-gui-v2/components/smartsheet/Sidebar.vue index b97bf86063..aef8234608 100644 --- a/packages/nc-gui-v2/components/smartsheet/Sidebar.vue +++ b/packages/nc-gui-v2/components/smartsheet/Sidebar.vue @@ -32,12 +32,12 @@ let viewCreateType = $ref() let viewCreateDlg = $ref(false) -const openCreateViewDlg = (type: ViewTypes) => { +function openCreateViewDlg(type: ViewTypes) { viewCreateDlg = true viewCreateType = type } -const onViewCreate = (view: GridType | FormType | KanbanType | GalleryType) => { +function onViewCreate(view: GridType | FormType | KanbanType | GalleryType) { views.value?.push(view) activeView.value = view viewCreateDlg = false @@ -45,35 +45,14 @@ const onViewCreate = (view: GridType | FormType | KanbanType | GalleryType) => { @@ -279,5 +155,5 @@ const onViewCreate = (view: GridType | FormType | KanbanType | GalleryType) => { - + diff --git a/packages/nc-gui-v2/context/index.ts b/packages/nc-gui-v2/context/index.ts index 9c7c0da7d0..7bd74a78f6 100644 --- a/packages/nc-gui-v2/context/index.ts +++ b/packages/nc-gui-v2/context/index.ts @@ -1,4 +1,4 @@ -import type { ColumnType, TableType, ViewType } from 'nocodb-sdk' +import type { ColumnType, FormType, GalleryType, GridType, KanbanType, TableType, ViewType } from 'nocodb-sdk' import type { ComputedRef, InjectionKey, Ref } from 'vue' import type { EventHook } from '@vueuse/core' import type { useViewData } from '#imports' @@ -14,7 +14,7 @@ export const IsFormInj: InjectionKey = Symbol('is-form-injection') export const IsGridInj: InjectionKey = Symbol('is-grid-injection') export const IsLockedInj: InjectionKey = Symbol('is-locked-injection') export const ValueInj: InjectionKey = Symbol('value-injection') -export const ActiveViewInj: InjectionKey> = Symbol('active-view-injection') +export const ActiveViewInj: InjectionKey> = Symbol('active-view-injection') export const ReadonlyInj: InjectionKey = Symbol('readonly-injection') export const ReloadViewDataHookInj: InjectionKey> = Symbol('reload-view-data-injection') export const FieldsInj: InjectionKey> = Symbol('fields-injection') From 3cb8e9e606a3a168f0c752f2f5286c25d5ea65c5 Mon Sep 17 00:00:00 2001 From: braks <78412429+bcakmakoglu@users.noreply.github.com> Date: Tue, 26 Jul 2022 10:56:30 +0200 Subject: [PATCH 04/86] refactor(gui-v2): change view create to ant design cmps --- .../nc-gui-v2/components/dlg/ViewCreate.vue | 116 ++++-------------- .../components/smartsheet/Sidebar.vue | 15 ++- 2 files changed, 36 insertions(+), 95 deletions(-) diff --git a/packages/nc-gui-v2/components/dlg/ViewCreate.vue b/packages/nc-gui-v2/components/dlg/ViewCreate.vue index d23dfb6c29..7b717c75bc 100644 --- a/packages/nc-gui-v2/components/dlg/ViewCreate.vue +++ b/packages/nc-gui-v2/components/dlg/ViewCreate.vue @@ -2,7 +2,7 @@ import { inject } from '@vue/runtime-core' import type { TableType } from 'nocodb-sdk' import { ViewTypes } from 'nocodb-sdk' -import type { Ref } from '#imports' +import type { Ref } from 'vue' import { ActiveViewInj, MetaInj, ViewListInj } from '~/context' import useViewCreate from '~/composables/useViewCreate' @@ -13,8 +13,13 @@ const emit = defineEmits(['update:modelValue', 'created']) const valid = ref(false) const viewList = inject(ViewListInj) + const activeView = inject(ActiveViewInj) +const inputEl = ref() + +const form = ref() + const dialogShow = computed({ get() { return modelValue @@ -38,8 +43,6 @@ const typeAlias = computed( }[type]), ) -const inputEl = ref() -const form = ref() watch( () => modelValue, (v) => { @@ -55,93 +58,28 @@ watch( }, ) -/* name: 'CreateViewDialog', - props: [ - 'value', - 'nodes', - 'table', - 'alias', - 'show_as', - 'viewsCount', - 'primaryValueColumn', - 'meta', - 'copyView', - 'viewsList', - 'selectedViewId', - ], - data: () => ({ - valid: false, - view_name: '', - loading: false, - queryParams: {}, - }), - computed: { - localState: { - get() { - return this.value; - }, - set(v) { - this.$emit('input', v); - }, - }, - typeAlias() { - return { - [ViewTypes.GRID]: 'grid', - [ViewTypes.GALLERY]: 'gallery', - [ViewTypes.FORM]: 'form', - [ViewTypes.KANBAN]: 'kanban', - }[this.show_as]; - }, - }, - mounted() { - try { - if (this.copyView && this.copyView.query_params) { - this.queryParams = { ...JSON.parse(this.copyView.query_params) }; - } - } catch (e) {} - this.view_name = `${this.alias || this.table}${this.viewsCount}`; - - this.$nextTick(() => { - const input = this.$refs.name.$el.querySelector('input'); - input.setSelectionRange(0, this.view_name.length); - input.focus(); - }); - }, */ +const onSubmit = () => { + const isValid = form.value.validate() + if (isValid) { + createView(view.type!) + emit('update:modelValue', false) + } +} - - diff --git a/packages/nc-gui-v2/components/smartsheet/Sidebar.vue b/packages/nc-gui-v2/components/smartsheet/Sidebar.vue index aef8234608..9a27d50b19 100644 --- a/packages/nc-gui-v2/components/smartsheet/Sidebar.vue +++ b/packages/nc-gui-v2/components/smartsheet/Sidebar.vue @@ -24,9 +24,11 @@ watch( { immediate: true }, ) -const toggleDrawer = $ref(false) +const toggleDrawer = ref(false) // todo: identify based on meta -const isView = $ref(false) +const isView = ref(false) + +const enableDummyFeat = ref(false) let viewCreateType = $ref() @@ -80,23 +82,24 @@ function onViewCreate(view: GridType | FormType | KanbanType | GalleryType) { {{ $t('msg.info.addView.grid') }} + From 1b5f505212699db885709f062cb985208a9699e1 Mon Sep 17 00:00:00 2001 From: braks <78412429+bcakmakoglu@users.noreply.github.com> Date: Tue, 26 Jul 2022 12:20:12 +0200 Subject: [PATCH 05/86] feat(gui-v2): add barrel file to utils and lib --- packages/nc-gui-v2/lib/index.ts | 3 +++ packages/nc-gui-v2/utils/generateName.ts | 9 +++++++++ packages/nc-gui-v2/utils/index.ts | 11 +++++++++++ packages/nc-gui-v2/utils/projectCreateUtils.ts | 9 --------- 4 files changed, 23 insertions(+), 9 deletions(-) create mode 100644 packages/nc-gui-v2/lib/index.ts create mode 100644 packages/nc-gui-v2/utils/generateName.ts create mode 100644 packages/nc-gui-v2/utils/index.ts diff --git a/packages/nc-gui-v2/lib/index.ts b/packages/nc-gui-v2/lib/index.ts new file mode 100644 index 0000000000..7aa0a91ba8 --- /dev/null +++ b/packages/nc-gui-v2/lib/index.ts @@ -0,0 +1,3 @@ +export * from './constants' +export * from './enums' +export * from './types' diff --git a/packages/nc-gui-v2/utils/generateName.ts b/packages/nc-gui-v2/utils/generateName.ts new file mode 100644 index 0000000000..8041e36c91 --- /dev/null +++ b/packages/nc-gui-v2/utils/generateName.ts @@ -0,0 +1,9 @@ +import { adjectives, animals, starWars, uniqueNamesGenerator } from 'unique-names-generator' + +export const generateUniqueName = () => { + return uniqueNamesGenerator({ + dictionaries: [[starWars], [adjectives, animals]][Math.floor(Math.random() * 2)], + }) + .toLowerCase() + .replace(/[ -]/g, '_') +} diff --git a/packages/nc-gui-v2/utils/index.ts b/packages/nc-gui-v2/utils/index.ts new file mode 100644 index 0000000000..382ee4c21a --- /dev/null +++ b/packages/nc-gui-v2/utils/index.ts @@ -0,0 +1,11 @@ +export * from './colorsUtils' +export * from './dateTimeUtils' +export * from './durationHelper' +export * from './errorUtils' +export * from './fileUtils' +export * from './filterUtils' +export * from './generateName' +export * from './projectCreateUtils' +export * from './urlUtils' +export * from './validation' +export * from './viewUtils' diff --git a/packages/nc-gui-v2/utils/projectCreateUtils.ts b/packages/nc-gui-v2/utils/projectCreateUtils.ts index 10e3cd3d74..685a9e9ae5 100644 --- a/packages/nc-gui-v2/utils/projectCreateUtils.ts +++ b/packages/nc-gui-v2/utils/projectCreateUtils.ts @@ -1,4 +1,3 @@ -import { adjectives, animals, starWars, uniqueNamesGenerator } from 'unique-names-generator' import { ClientType } from '~/lib/enums' export interface ProjectCreateForm { @@ -208,11 +207,3 @@ export const getDefaultConnectionConfig = (client: ClientType): ProjectCreateFor } export const sslUsage = ['No', 'Preferred', 'Required', 'Required-CA', 'Required-IDENTITY'] - -export const generateUniqueName = () => { - return uniqueNamesGenerator({ - dictionaries: [[starWars], [adjectives, animals]][Math.floor(Math.random() * 2)], - }) - .toLowerCase() - .replace(/[ -]/g, '_') -} From 82e8f7fae974426c727e7ad48685b21c751f332a Mon Sep 17 00:00:00 2001 From: braks <78412429+bcakmakoglu@users.noreply.github.com> Date: Tue, 26 Jul 2022 12:20:29 +0200 Subject: [PATCH 06/86] fix(gui-v2): shim API functions (swagger outdated) --- packages/nc-gui-v2/nuxt-shim.d.ts | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/packages/nc-gui-v2/nuxt-shim.d.ts b/packages/nc-gui-v2/nuxt-shim.d.ts index 765fcba0c5..a19bd0742f 100644 --- a/packages/nc-gui-v2/nuxt-shim.d.ts +++ b/packages/nc-gui-v2/nuxt-shim.d.ts @@ -1,13 +1,12 @@ +import type messages from '@intlify/vite-plugin-vue-i18n/messages' import type { RemovableRef } from '@vueuse/core' -import type { Api } from 'nocodb-sdk' +import type { Api, FormType, GalleryType, GridType, RequestParams } from 'nocodb-sdk' import type { I18n } from 'vue-i18n' -import type { GlobalState } from '~/lib/types' - -import type messages from '@intlify/vite-plugin-vue-i18n/messages' +import type { GlobalState } from './src/lib/types' declare module '#app/nuxt' { interface NuxtApp { - $api: Api; + $api: Api $tele: { emit: (event: string, data: any) => void } @@ -22,3 +21,12 @@ declare module '@vue/runtime-core' { i18n: I18n['global'] } } + +declare module 'nocodb-sdk' { + interface Api { + // todo: update swagger to accept correct data type + gridCreate: (tableId: string, data: GridType & { copy_from_id: string }, params?: RequestParams) => Promise + formCreate: (tableId: string, data: FormType, params?: RequestParams) => Promise + galleryCreate: (tableId: string, data: GalleryType, params?: RequestParams) => Promise + } +} From 66b85d443c3db3972142c757b374e2bb9f97ee55 Mon Sep 17 00:00:00 2001 From: braks <78412429+bcakmakoglu@users.noreply.github.com> Date: Tue, 26 Jul 2022 13:17:50 +0200 Subject: [PATCH 07/86] refactor(gui-v2): merge create view into `ViewCreate.vue` --- .../nc-gui-v2/components/dlg/ViewCreate.vue | 168 +++++++++++++----- .../components/smartsheet/Sidebar.vue | 6 +- .../nc-gui-v2/composables/useViewCreate.ts | 73 -------- packages/nc-gui-v2/context/index.ts | 2 +- .../pages/project/index/create-external.vue | 13 +- packages/nc-gui-v2/utils/generateName.ts | 13 ++ 6 files changed, 145 insertions(+), 130 deletions(-) delete mode 100644 packages/nc-gui-v2/composables/useViewCreate.ts diff --git a/packages/nc-gui-v2/components/dlg/ViewCreate.vue b/packages/nc-gui-v2/components/dlg/ViewCreate.vue index 7b717c75bc..0fa408bab0 100644 --- a/packages/nc-gui-v2/components/dlg/ViewCreate.vue +++ b/packages/nc-gui-v2/components/dlg/ViewCreate.vue @@ -1,37 +1,72 @@ diff --git a/packages/nc-gui-v2/components/smartsheet/Sidebar.vue b/packages/nc-gui-v2/components/smartsheet/Sidebar.vue index 9a27d50b19..2c19b07fad 100644 --- a/packages/nc-gui-v2/components/smartsheet/Sidebar.vue +++ b/packages/nc-gui-v2/components/smartsheet/Sidebar.vue @@ -1,9 +1,9 @@ From 0b07337c92a5b2c90f357922bd55c934aec842a1 Mon Sep 17 00:00:00 2001 From: braks <78412429+bcakmakoglu@users.noreply.github.com> Date: Wed, 27 Jul 2022 11:41:45 +0200 Subject: [PATCH 16/86] chore(gui-v2): return error and response in interceptor --- packages/nc-gui-v2/composables/useApi.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/nc-gui-v2/composables/useApi.ts b/packages/nc-gui-v2/composables/useApi.ts index 9a29cb9b41..b9d109fe22 100644 --- a/packages/nc-gui-v2/composables/useApi.ts +++ b/packages/nc-gui-v2/composables/useApi.ts @@ -42,6 +42,8 @@ export function useApi(_?: UseApiProps): UseApi error.value = requestError response.value = null isLoading.value = false + + return requestError }, ) @@ -51,11 +53,15 @@ export function useApi(_?: UseApiProps): UseApi // can't properly typecast response.value = apiResponse isLoading.value = false + + return apiResponse }, (apiError) => { errorHook.trigger(apiError) error.value = apiError isLoading.value = false + + return apiError }, ) From 4a3fb7a4a89c9fe91cc0435215d4a05aa041bd95 Mon Sep 17 00:00:00 2001 From: braks <78412429+bcakmakoglu@users.noreply.github.com> Date: Wed, 27 Jul 2022 11:46:22 +0200 Subject: [PATCH 17/86] chore(gui-v2): remove `.value` access on formValidator --- packages/nc-gui-v2/components/dlg/ViewCreate.vue | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/nc-gui-v2/components/dlg/ViewCreate.vue b/packages/nc-gui-v2/components/dlg/ViewCreate.vue index e913bb1fb1..af46d38545 100644 --- a/packages/nc-gui-v2/components/dlg/ViewCreate.vue +++ b/packages/nc-gui-v2/components/dlg/ViewCreate.vue @@ -96,9 +96,11 @@ function init() { } async function onSubmit() { - const isValid = await formValidator.value?.validate() + const isValid = await formValidator?.validateFields() - if (isValid && form.type) { + if (!isValid) return + + if (form.type) { const _meta = unref(meta) if (!_meta || !_meta.id) return From a2f79c5692a3f77f7a7377e180632f9bac11eea0 Mon Sep 17 00:00:00 2001 From: braks <78412429+bcakmakoglu@users.noreply.github.com> Date: Wed, 27 Jul 2022 12:33:18 +0200 Subject: [PATCH 18/86] chore(gui-v2): add missing `discourse` icon --- packages/nc-gui-v2/assets/img/discourse-icon.png | Bin 0 -> 1922 bytes packages/nc-gui-v2/components/general/Social.vue | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 packages/nc-gui-v2/assets/img/discourse-icon.png diff --git a/packages/nc-gui-v2/assets/img/discourse-icon.png b/packages/nc-gui-v2/assets/img/discourse-icon.png new file mode 100644 index 0000000000000000000000000000000000000000..cec51f759a5b66692e1f7fba568fbbffa3714361 GIT binary patch literal 1922 zcmV-|2YvX7P);mjz}I zc2`Y|zvLVK*qQl#KfihNesA8uFt5j}HGEMCsM)A|R57QOsD-ExQQIl0Op;WSfGO5%Y2mX?(86oe92~?Sj0-ZB!f4*h!xJZ_C6wN`2fa!d|0~|FkMK#lf zygj{aPCQ%{2@91PSdH3>+K9?UO~Bv!Isjq@afWd)Lv5oA&;zDX^RIjqDqE$2GvQij z3yZR-OW{$l5@80ZBYSlxWKvT&t?jM(F?6CxDC(e;$2Y+UG}F+{Xe$~$snx=9W6Yb zrh)cZT4-N24D=Oap?!B6v{xm8ZsP}VHY1LOyN%~jsM!la8IQXQ7f=Fw0J7)=PY(~? z3ywnbH#y^XQO5>r;Mw#@XrDhA^oM4G?p7h_A8qI%-NRyNxtIq^m&jzB;IZa zvrtO4Wu6HCrh}DzLVH|j0IJ!{{K+_6@eB>M54h$<<4C;^bAhO>8 zn*gD~Ax40Uwg5&mY`%Brz0h)Hq$zA@YiY9=#>HiTs<0*#1bdP|Q2i%_4qC%SZWZ9Cc)SA#GF%Gqoy-ErXXM!`D~fv!kiw-=D$ewWXSvk; zQ%ndHLT=SbEP(&~O%8>SRe-)+8F3w@s~qoAfD4!M*oRnDWe6d^1!cA#;;dc+kXEP+ zVRSC>P0(X;<|=@q!&xkVv@C@Sq2&&xQJVm>xLWAg5ZuU4FK|r;y0;#*wNqFC_u^$N zKyY#v|3)TaH!^xR2;>7Ovjs3lZ2&kGuYreku6YhVub1d|_zQ+yi$)3qhnXkXN1Qc~? zhR~@=#&Y^A*1WjtDrhv?9&=I$kTc(8$-LbFO!EOH}*1TYE5=hIpvF4eBPat&66y7<_dZ@`x1LTj0hDTTeH#FvA`kMoz z4rhS-ffUvd$)kEAj5{&|7W_B|3QuH1-tl=b?c{7wAD(JDh9s#-#uYzmFpmn%T){gZ zb+$S4=NUs++&O@l=z*a6C>4Ab=VIR84${p#SjkFDLAGfVrovA_T$$9xtWj*Zl%}%B zQnq2u*FJ-Q*+sl_QRWdC+A7pgjXjdahx9mlz zwX9*umKqS$w01d0xVsfX5@+*X+tAoDg-)R@^9})Ym+GzeAaG^@n+na1c9&@9U*Mlz zVznbdZ5_^h14{Tp0J^}$CV*mUF8D2~0H53)Y<(loSO#GUiJ*qvyU27s8OllP&@sF z0Z`YO8dXwBmydkEq26}HcozUaA79hwQI`lqgWja*WrXT^uD4^Z%c#kWot locale.value.startsWith('zh')) .discourse { height: 22px; width: 22px; - background-image: url('~/assets/img/discourse-icon.png'); + background-image: url('assets/img/discourse-icon.png'); background-size: contain; background-repeat: no-repeat; } From c6a80f20f0a9cf4c9c16810e0f1b0fbfa3338018 Mon Sep 17 00:00:00 2001 From: braks <78412429+bcakmakoglu@users.noreply.github.com> Date: Wed, 27 Jul 2022 12:33:37 +0200 Subject: [PATCH 19/86] refactor(gui-v2): reduce header height to 56px --- packages/nc-gui-v2/assets/style-v2.scss | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/nc-gui-v2/assets/style-v2.scss b/packages/nc-gui-v2/assets/style-v2.scss index 410781cf29..aeb9381a21 100644 --- a/packages/nc-gui-v2/assets/style-v2.scss +++ b/packages/nc-gui-v2/assets/style-v2.scss @@ -1,3 +1,11 @@ +:root { + --header-height: 56px; +} + +.ant-layout-header { + height: var(--header-height) !important; +} + html, body, #__nuxt, @@ -57,10 +65,6 @@ h1, h2, h3, h4, h5, h6, p, label, button, textarea, select { @apply color-transition; } -:root { - --header-height: 64px; -} - html { overflow-y: auto !important; } From 0dd73e7535da668625976377be72f4121805e78d Mon Sep 17 00:00:00 2001 From: braks <78412429+bcakmakoglu@users.noreply.github.com> Date: Wed, 27 Jul 2022 12:34:04 +0200 Subject: [PATCH 20/86] refactor(gui-v2): reduce toolbar height to header height --- .../nc-gui-v2/components/smartsheet/Toolbar.vue | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/packages/nc-gui-v2/components/smartsheet/Toolbar.vue b/packages/nc-gui-v2/components/smartsheet/Toolbar.vue index 1661bffa08..81e675763c 100644 --- a/packages/nc-gui-v2/components/smartsheet/Toolbar.vue +++ b/packages/nc-gui-v2/components/smartsheet/Toolbar.vue @@ -1,22 +1,37 @@ From 84b3236cdbffc7066e799e4785fd414d4c46c479 Mon Sep 17 00:00:00 2001 From: braks <78412429+bcakmakoglu@users.noreply.github.com> Date: Wed, 27 Jul 2022 12:35:01 +0200 Subject: [PATCH 21/86] feat(gui-v2): add delete and copy icons --- .../components/smartsheet/Sidebar.vue | 58 ++++++++++++++----- 1 file changed, 45 insertions(+), 13 deletions(-) diff --git a/packages/nc-gui-v2/components/smartsheet/Sidebar.vue b/packages/nc-gui-v2/components/smartsheet/Sidebar.vue index 98656cbcac..73b35ecc0e 100644 --- a/packages/nc-gui-v2/components/smartsheet/Sidebar.vue +++ b/packages/nc-gui-v2/components/smartsheet/Sidebar.vue @@ -5,6 +5,8 @@ import { inject, provide, ref, useTabs, useViews, watch } from '#imports' import { ActiveViewInj, MetaInj, ViewListInj } from '~/context' import { viewIcons } from '~/utils' import MdiPlusIcon from '~icons/mdi/plus' +import MdiTrashCan from '~icons/mdi/trash-can' +import MdiContentCopy from '~icons/mdi/content-copy' const meta = inject(MetaInj, ref()) @@ -16,7 +18,6 @@ const { views } = useViews(meta) provide(ViewListInj, views) -// todo decide based on route param watch( views, (nextViews) => { @@ -28,7 +29,7 @@ watch( ) const toggleDrawer = ref(false) -// todo: identify based on meta + const isView = ref(false) const enableDummyFeat = ref(false) @@ -77,28 +78,48 @@ function changeView(view: { id: string; alias?: string; title?: string; type: Vi
-

{{ $t('objects.views') }}

- -
+

{{ $t('objects.views') }}

+ +
{{ view.alias || view.title }}
+ +
+ +
+ + + + + + + + + +
- + -

+

{{ $t('activity.createView') }}

- + -
+
{{ $t('objects.viewType.grid') }}
@@ -110,13 +131,13 @@ function changeView(view: { id: string; alias?: string; title?: string; type: Vi - + -
+
{{ $t('objects.viewType.gallery') }}
@@ -128,13 +149,18 @@ function changeView(view: { id: string; alias?: string; title?: string; type: Vi - + -
+
{{ $t('objects.viewType.form') }}
@@ -152,3 +178,9 @@ function changeView(view: { id: string; alias?: string; title?: string; type: Vi + + From 38f3a34673634484d81e7d1a91cd1cc52bfda70e Mon Sep 17 00:00:00 2001 From: braks <78412429+bcakmakoglu@users.noreply.github.com> Date: Wed, 27 Jul 2022 14:09:30 +0200 Subject: [PATCH 22/86] feat(gui-v2): edit view name on dblclick --- .../components/smartsheet/Sidebar.vue | 95 +++++++++++++++++-- 1 file changed, 86 insertions(+), 9 deletions(-) diff --git a/packages/nc-gui-v2/components/smartsheet/Sidebar.vue b/packages/nc-gui-v2/components/smartsheet/Sidebar.vue index 73b35ecc0e..c16bedaf31 100644 --- a/packages/nc-gui-v2/components/smartsheet/Sidebar.vue +++ b/packages/nc-gui-v2/components/smartsheet/Sidebar.vue @@ -1,7 +1,7 @@ From e052aa19072db78b6b8fce2c20f6c3423e8de53f Mon Sep 17 00:00:00 2001 From: braks <78412429+bcakmakoglu@users.noreply.github.com> Date: Wed, 27 Jul 2022 14:42:38 +0200 Subject: [PATCH 23/86] feat(gui-v2): properly cancel input --- .../components/smartsheet/Sidebar.vue | 89 ++++++++++++++----- 1 file changed, 66 insertions(+), 23 deletions(-) diff --git a/packages/nc-gui-v2/components/smartsheet/Sidebar.vue b/packages/nc-gui-v2/components/smartsheet/Sidebar.vue index c16bedaf31..a37282aa62 100644 --- a/packages/nc-gui-v2/components/smartsheet/Sidebar.vue +++ b/packages/nc-gui-v2/components/smartsheet/Sidebar.vue @@ -1,9 +1,10 @@ -
@@ -251,7 +324,7 @@ function onStopEdit() {

{{ $t('activity.createView') }}

- +