Skip to content

Commit

Permalink
Improve getPropertyName
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewwallacespeckle committed Jun 21, 2024
1 parent 7d0805a commit 21aaabd
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions packages/frontend-2/components/viewer/explorer/Filters.vue
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
refreshColorsIfSetOrActiveFilterIsNumeric()
"
>
{{ getPropertyName(filter.key) }}
{{ getPropertyName(filter) }}
</button>
</div>
<div v-if="itemCount < relevantFiltersSearched.length" class="mb-2">
Expand Down Expand Up @@ -184,7 +184,7 @@ const relevantFiltersSearched = computed(() => {
// eslint-disable-next-line vue/no-side-effects-in-computed-properties
itemCount.value = 30 // nasty, but yolo - reset max limit on search change
return relevantFilters.value.filter((f) => {
const userFriendlyName = getPropertyName(f.key).toLowerCase()
const userFriendlyName = getPropertyName(f).toLowerCase()
return (
f.key.toLowerCase().includes(searchLower) ||
userFriendlyName.includes(searchLower)
Expand All @@ -199,7 +199,7 @@ const relevantFiltersLimited = computed(() => {
.sort((a, b) => a.key.length - b.key.length)
})
const title = computed(() => getPropertyName(activeFilter.value?.key ?? ''))
const title = computed(() => getPropertyName(activeFilter.value))
const colors = computed(() => !!propertyFilter.isApplied.value)
Expand Down Expand Up @@ -239,7 +239,8 @@ const isRevitProperty = (key: string): boolean => {
return revitPropertyRegex.test(key)
}
const getPropertyName = (key: string): string => {
const getPropertyName = (property: PropertyInfo): string => {
const key = property.key
if (!key) return 'Loading'
if (key === 'level.name') return 'Level Name'
Expand Down

0 comments on commit 21aaabd

Please sign in to comment.