Browse Source

fix(nc-gui): remove unwanted code

pull/8188/head
Ramesh Mane 8 months ago
parent
commit
2c121f15f4
  1. 29
      packages/nc-gui/components/smartsheet/toolbar/CreateGroupBy.vue
  2. 29
      packages/nc-gui/components/smartsheet/toolbar/CreateSort.vue
  3. 6
      packages/nc-gui/components/smartsheet/toolbar/FieldsMenu.vue

29
packages/nc-gui/components/smartsheet/toolbar/CreateGroupBy.vue

@ -12,12 +12,6 @@ const emits = defineEmits(['created'])
const { isParentOpen, columns } = toRefs(props)
const inputRef = ref()
const search = ref('')
const activeFieldIndex = ref(-1)
const activeView = inject(ActiveViewInj, ref())
const meta = inject(MetaInj, ref())
@ -58,33 +52,12 @@ const options = computed<ColumnType[]>(
)
}
})
.filter((c: ColumnType) => !groupBy.value.find((g) => g.column?.id === c.id))
.filter((c: ColumnType) => c.title?.toLowerCase().includes(search.value.toLowerCase())) ?? [],
.filter((c: ColumnType) => !groupBy.value.find((g) => g.column?.id === c.id)) ?? [],
)
const onClick = (column: ColumnType) => {
emits('created', column)
}
watch(
isParentOpen,
() => {
if (!isParentOpen.value) return
search.value = ''
setTimeout(() => {
inputRef.value?.focus()
}, 100)
},
{
immediate: true,
},
)
onMounted(() => {
search.value = ''
activeFieldIndex.value = -1
})
</script>
<template>

29
packages/nc-gui/components/smartsheet/toolbar/CreateSort.vue

@ -11,12 +11,6 @@ const emits = defineEmits(['created'])
const { isParentOpen } = toRefs(props)
const inputRef = ref()
const search = ref('')
const activeFieldIndex = ref(-1)
const activeView = inject(ActiveViewInj, ref())
const meta = inject(MetaInj, ref())
@ -55,33 +49,12 @@ const options = computed<ColumnType[]>(
/** ignore virtual fields which are system fields ( mm relation ) and qr code fields */
}
})
.filter((c: ColumnType) => !sorts.value.find((s) => s.fk_column_id === c.id))
.filter((c: ColumnType) => c.title?.toLowerCase().includes(search.value.toLowerCase())) ?? [],
.filter((c: ColumnType) => !sorts.value.find((s) => s.fk_column_id === c.id)) ?? [],
)
const onClick = (column: ColumnType) => {
emits('created', column)
}
watch(
isParentOpen,
() => {
if (!isParentOpen.value) return
search.value = ''
setTimeout(() => {
inputRef.value?.focus()
}, 100)
},
{
immediate: true,
},
)
onMounted(() => {
search.value = ''
activeFieldIndex.value = -1
})
</script>
<template>

6
packages/nc-gui/components/smartsheet/toolbar/FieldsMenu.vue

@ -350,7 +350,11 @@ useMenuCloseOnEsc(open)
</div>
<template #overlay>
<div class="pt-2 bg-white w-full min-w-72 max-w-80 rounded-lg nc-table-toolbar-menu" data-testid="nc-fields-menu" @click.stop>
<div
class="pt-2 bg-white w-full min-w-72 max-w-80 rounded-lg nc-table-toolbar-menu"
data-testid="nc-fields-menu"
@click.stop
>
<div
v-if="!filterQuery && !isPublic && (activeView?.type === ViewTypes.GALLERY || activeView?.type === ViewTypes.KANBAN)"
class="flex flex-col gap-y-2 px-2 mb-6"

Loading…
Cancel
Save