From 6633d7a1ff6fe3b6644a11538336715fe028e3f1 Mon Sep 17 00:00:00 2001 From: reenphygeorge Date: Fri, 1 Sep 2023 22:44:31 +0530 Subject: [PATCH 01/19] fix(nc-gui): column search reset --- .../nc-gui/components/smartsheet/toolbar/SearchData.vue | 8 -------- 1 file changed, 8 deletions(-) diff --git a/packages/nc-gui/components/smartsheet/toolbar/SearchData.vue b/packages/nc-gui/components/smartsheet/toolbar/SearchData.vue index 3f08cb6af7..817a071100 100644 --- a/packages/nc-gui/components/smartsheet/toolbar/SearchData.vue +++ b/packages/nc-gui/components/smartsheet/toolbar/SearchData.vue @@ -58,14 +58,6 @@ const displayColumnLabel = computed(() => { return columns.value?.find((column) => column.primaryValue)?.label }) -watch( - () => (meta.value as TableType)?.columns, - () => { - if (columns.value && search.value) search.value.field = columns.value.find((column) => column.primaryValue)?.value - }, - { immediate: true }, -) - watchDebounced( () => search.value.query, () => { From 612ea415495f9c50130cafad185c098900736aa3 Mon Sep 17 00:00:00 2001 From: reenphygeorge Date: Fri, 1 Sep 2023 22:49:32 +0530 Subject: [PATCH 02/19] feat(nc-gui): reload data trigger on field change --- .../nc-gui/components/smartsheet/toolbar/SearchData.vue | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/nc-gui/components/smartsheet/toolbar/SearchData.vue b/packages/nc-gui/components/smartsheet/toolbar/SearchData.vue index 817a071100..fd2b91ac8b 100644 --- a/packages/nc-gui/components/smartsheet/toolbar/SearchData.vue +++ b/packages/nc-gui/components/smartsheet/toolbar/SearchData.vue @@ -58,6 +58,13 @@ const displayColumnLabel = computed(() => { return columns.value?.find((column) => column.primaryValue)?.label }) +watch( + () => search.value.field, + () => { + onPressEnter() + } +) + watchDebounced( () => search.value.query, () => { From 6a5c304f6a32c738bf43da1dff64636b7e9dca69 Mon Sep 17 00:00:00 2001 From: reenphygeorge Date: Sat, 2 Sep 2023 13:01:45 +0530 Subject: [PATCH 03/19] feat(nc-gui): added badge to view selected search field --- .../smartsheet/toolbar/SearchData.vue | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/packages/nc-gui/components/smartsheet/toolbar/SearchData.vue b/packages/nc-gui/components/smartsheet/toolbar/SearchData.vue index fd2b91ac8b..68f094a17a 100644 --- a/packages/nc-gui/components/smartsheet/toolbar/SearchData.vue +++ b/packages/nc-gui/components/smartsheet/toolbar/SearchData.vue @@ -55,12 +55,17 @@ function onPressEnter() { } const displayColumnLabel = computed(() => { - return columns.value?.find((column) => column.primaryValue)?.label + const columnLabel = search.value.field.length === 0?columns.value?.find(column => column.primaryValue)?.label: + columns.value?.find(column => column.value === search.value.field)?.label + return (columnLabel && columnLabel.length > 10) + ? columnLabel.slice(0, 10) + '...' + : columnLabel; }) watch( () => search.value.field, () => { + console.log(columns.value) onPressEnter() } ) @@ -89,7 +94,12 @@ watchDebounced( @click="isDropdownOpen = !isDropdownOpen" > - + +

+ in {{ displayColumnLabel }} +

+
- From ceabea6d23401017a66eb1bb95d16494d1a0e119 Mon Sep 17 00:00:00 2001 From: reenphygeorge Date: Sat, 2 Sep 2023 17:33:22 +0530 Subject: [PATCH 04/19] feat(nc-gui): updated badge ui --- packages/nc-gui/components/nc/Badge.vue | 2 +- .../components/smartsheet/toolbar/SearchData.vue | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/nc-gui/components/nc/Badge.vue b/packages/nc-gui/components/nc/Badge.vue index 81a7c12352..88c04ec6c2 100644 --- a/packages/nc-gui/components/nc/Badge.vue +++ b/packages/nc-gui/components/nc/Badge.vue @@ -28,6 +28,6 @@ const props = defineProps<{ diff --git a/packages/nc-gui/components/smartsheet/toolbar/SearchData.vue b/packages/nc-gui/components/smartsheet/toolbar/SearchData.vue index 68f094a17a..4ec40217fa 100644 --- a/packages/nc-gui/components/smartsheet/toolbar/SearchData.vue +++ b/packages/nc-gui/components/smartsheet/toolbar/SearchData.vue @@ -93,13 +93,13 @@ watchDebounced( :class="{ '!bg-gray-50 ': isDropdownOpen }" @click="isDropdownOpen = !isDropdownOpen" > - - -

- in {{ displayColumnLabel }} -

-
+ + +

+ in '{{ displayColumnLabel }}' +

+
Date: Sat, 2 Sep 2023 18:02:15 +0530 Subject: [PATCH 05/19] fix(nc-gui): removed unwanted logs --- packages/nc-gui/components/nc/Badge.vue | 1 - .../smartsheet/toolbar/SearchData.vue | 18 +++++++++--------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/packages/nc-gui/components/nc/Badge.vue b/packages/nc-gui/components/nc/Badge.vue index 88c04ec6c2..bc5b60bbc3 100644 --- a/packages/nc-gui/components/nc/Badge.vue +++ b/packages/nc-gui/components/nc/Badge.vue @@ -1,5 +1,4 @@ @@ -652,7 +662,7 @@ const DlgProjectDuplicateOnOk = async (jobData: { id: string; project_id: string :key="`sortable-${base.id}-${base.id && base.id in keys ? keys[base.id] : '0'}`" :nc-base="base.id" > - + @@ -726,7 +736,7 @@ const DlgProjectDuplicateOnOk = async (jobData: { id: string; project_id: string } :deep(.ant-collapse-header) { - @apply !mx-0 !pl-8.75 !pr-1 !py-0.75 hover:bg-gray-100 !rounded-md; + @apply !mx-0 !pl-8.75 !pr-1 !py-0.75 hover:bg-gray-200 !rounded-md; } :deep(.ant-collapse-header:hover .nc-sidebar-base-node-btns) { diff --git a/packages/nc-gui/components/dashboard/TreeViewNew/ProjectWrapper.vue b/packages/nc-gui/components/dashboard/TreeView/ProjectWrapper.vue similarity index 100% rename from packages/nc-gui/components/dashboard/TreeViewNew/ProjectWrapper.vue rename to packages/nc-gui/components/dashboard/TreeView/ProjectWrapper.vue diff --git a/packages/nc-gui/components/dashboard/TreeViewNew/TableList.vue b/packages/nc-gui/components/dashboard/TreeView/TableList.vue similarity index 100% rename from packages/nc-gui/components/dashboard/TreeViewNew/TableList.vue rename to packages/nc-gui/components/dashboard/TreeView/TableList.vue diff --git a/packages/nc-gui/components/dashboard/TreeViewNew/TableNode.vue b/packages/nc-gui/components/dashboard/TreeView/TableNode.vue similarity index 94% rename from packages/nc-gui/components/dashboard/TreeViewNew/TableNode.vue rename to packages/nc-gui/components/dashboard/TreeView/TableNode.vue index 4a6b9b6ce2..5acaea2887 100644 --- a/packages/nc-gui/components/dashboard/TreeViewNew/TableNode.vue +++ b/packages/nc-gui/components/dashboard/TreeView/TableNode.vue @@ -68,8 +68,11 @@ const setIcon = async (icon: string, table: TableType) => { // Todo: temp const { isSharedBase } = useProject() - // const isMultiBase = computed(() => project.bases && project.bases.length > 1) + +const canUserEditEmote = computed(() => { + return isUIAllowed('tableIconCustomisation', false, projectRole?.value) +})