Browse Source

fix: undefined in search

pull/6340/head
DarkPhoenix2704 1 year ago
parent
commit
e42e7ad9bd
  1. 4
      packages/nc-gui/assets/nc-icons/lock.svg
  2. 2
      packages/nc-gui/components/smartsheet/toolbar/FieldsMenu.vue
  3. 5
      packages/nc-gui/components/smartsheet/toolbar/LockType.vue
  4. 6
      packages/nc-gui/components/smartsheet/toolbar/SearchData.vue

4
packages/nc-gui/assets/nc-icons/lock.svg

@ -0,0 +1,4 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M12.6667 7.33337H3.33333C2.59695 7.33337 2 7.93033 2 8.66671V13.3334C2 14.0698 2.59695 14.6667 3.33333 14.6667H12.6667C13.403 14.6667 14 14.0698 14 13.3334V8.66671C14 7.93033 13.403 7.33337 12.6667 7.33337Z" stroke="#4A5268" stroke-width="1.33333" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M4.66667 7.33337V4.66671C4.66667 3.78265 5.01786 2.93481 5.64298 2.30968C6.2681 1.68456 7.11595 1.33337 8 1.33337C8.88406 1.33337 9.73191 1.68456 10.357 2.30968C10.9821 2.93481 11.3333 3.78265 11.3333 4.66671V7.33337" stroke="#4A5268" stroke-width="1.33333" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 725 B

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

@ -341,7 +341,7 @@ useMenuCloseOnEsc(open)
<div class="pt-0.25 w-full bg-gray-50"></div> <div class="pt-0.25 w-full bg-gray-50"></div>
</div> </div>
<div class="flex flex-col py-1 nc-scrollbar-md max-h-[45vh] pr-5"> <div class="flex flex-col py-1 nc-scrollbar-md max-h-[47.5vh] pr-5">
<div class="nc-fields-list"> <div class="nc-fields-list">
<div <div
v-if="!fields?.filter((el) => el.title.toLowerCase().includes(filterQuery.toLowerCase())).length" v-if="!fields?.filter((el) => el.title.toLowerCase().includes(filterQuery.toLowerCase())).length"

5
packages/nc-gui/components/smartsheet/toolbar/LockType.vue

@ -1,6 +1,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { ActiveViewInj, LockType, iconMap, inject } from '#imports' import { ActiveViewInj, LockType, iconMap, inject } from '#imports'
import UsersIcon from '~icons/nc-icons/users' import UsersIcon from '~icons/nc-icons/users'
import LockIcon from '~icons/nc-icons/lock'
const { type, hideTick } = defineProps<{ hideTick?: boolean; type: LockType }>() const { type, hideTick } = defineProps<{ hideTick?: boolean; type: LockType }>()
@ -19,7 +20,7 @@ const types = {
}, },
[LockType.Locked]: { [LockType.Locked]: {
title: 'title.lockedView', title: 'title.lockedView',
icon: iconMap.lock, icon: LockIcon,
subtitle: 'msg.info.lockedView', subtitle: 'msg.info.lockedView',
}, },
} }
@ -34,7 +35,7 @@ const selectedView = inject(ActiveViewInj)
<component :is="types[type].icon" class="text-gray-800 !w-4 !h-4" /> <component :is="types[type].icon" class="text-gray-800 !w-4 !h-4" />
<div class="flex flex-col"> <div class="flex flex-col">
{{ $t(types[type].title) }} {{ $t(types[type].title) }}
<div v-if="!hideTick" class="nc-subtitle max-w-108 text-sm text-gray-600 whitespace-normal"> <div v-if="!hideTick" class="nc-subtitle max-w-120 text-sm text-gray-500 whitespace-normal">
{{ $t(types[type].subtitle) }} {{ $t(types[type].subtitle) }}
</div> </div>
</div> </div>

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

@ -80,6 +80,12 @@ watchDebounced(
maxWait: 600, maxWait: 600,
}, },
) )
watch(columns, () => {
if (columns.value?.length) {
search.value.field = columns.value[0].value as string
}
})
</script> </script>
<template> <template>

Loading…
Cancel
Save