Skip to content

Commit 9dbdc1c

Browse files
committed
Fix: type filter for Properties (property→properties mapping)
Replace naive singular+s pluralization with explicit type-to-filter lookup map for correct handling of property→properties, class→classes, individual→individuals, and ontology→ontologies.
1 parent c828eb8 commit 9dbdc1c

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

docs/public/browse/ontology-manager.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -766,11 +766,9 @@ class OntologyManager {
766766
const type = entityItem.querySelector('.entity-type').textContent;
767767

768768
const matchesSearch = !query || label.includes(query) || uri.includes(query);
769-
const typeLower = type.toLowerCase();
769+
const typeToFilter = { 'class': 'classes', 'property': 'properties', 'individual': 'individuals', 'ontology': 'ontologies' };
770770
const matchesFilter = this.currentFilter === 'all' ||
771-
typeLower === this.currentFilter ||
772-
typeLower + 's' === this.currentFilter ||
773-
typeLower + 'es' === this.currentFilter;
771+
(typeToFilter[type.toLowerCase()] || type.toLowerCase()) === this.currentFilter;
774772

775773
const isVisible = matchesSearch && matchesFilter;
776774
entityItem.style.display = isVisible ? 'flex' : 'none';

0 commit comments

Comments
 (0)