From 6633d7a1ff6fe3b6644a11538336715fe028e3f1 Mon Sep 17 00:00:00 2001 From: reenphygeorge Date: Fri, 1 Sep 2023 22:44:31 +0530 Subject: [PATCH 1/8] 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 2/8] 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 3/8] 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 4/8] 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 5/8] 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 @@