diff --git a/scripts/apps/vocabularies/controllers/VocabularyConfigController.ts b/scripts/apps/vocabularies/controllers/VocabularyConfigController.ts index d59e3b6535..13bd30faaf 100644 --- a/scripts/apps/vocabularies/controllers/VocabularyConfigController.ts +++ b/scripts/apps/vocabularies/controllers/VocabularyConfigController.ts @@ -1,5 +1,5 @@ import {DEFAULT_SCHEMA, getVocabularySelectionTypes, getMediaTypeKeys, getMediaTypes} from '../constants'; -import {IVocabulary, IVocabularyItem, IVocabularyTag} from 'superdesk-api'; +import {IVocabulary, IVocabularyTag} from 'superdesk-api'; import {IDirectiveScope} from 'types/Angular/DirectiveScope'; import {remove, reduce} from 'lodash'; import {gettext, downloadFile} from 'core/utils'; @@ -11,13 +11,11 @@ function getOther() { } export interface IScope extends IDirectiveScope { - filterVocabulary(vocabulary: IVocabulary): boolean; vocabularies: Array; vocabulary: any; tags: IVocabulary['tags']; loading: boolean; mediaTypes: object; - searchString: string; openVocabulary(vocabulary: IVocabulary): void; downloadVocabulary(vocabulary: IVocabulary): void; uploadConfig(): void; @@ -142,22 +140,6 @@ export function VocabularyConfigController($scope: IScope, $route, $routeParams, $scope.existsVocabulariesForTag = (currentTag: IVocabularyTag, tab: string) => ($scope.vocabularies || []).some((vocabulary) => checkTag(vocabulary, currentTag, tab)); - /** - * Checks if a vocabulary's display_name matches the search - * query or if it matches a translation of that vocabulary. - */ - $scope.filterVocabulary = function(vocabulary: IVocabulary): boolean { - const translationMach = Object.values(vocabulary?.translations?.display_name ?? {}) - .find((translation: string) => translation.toLowerCase().indexOf($scope.searchString) !== -1); - const displayNameMatch = vocabulary.display_name.toLowerCase().indexOf($scope.searchString) !== -1; - - if (($scope.searchString?.length ?? 0) > 0 || displayNameMatch || translationMach != null) { - return true; - } else { - return false; - } - }; - /** * Don't show OTHER tag if it is the only tag available for current tab */ diff --git a/scripts/apps/vocabularies/views/vocabulary-config.html b/scripts/apps/vocabularies/views/vocabulary-config.html index 2a63e91666..e946abf38e 100644 --- a/scripts/apps/vocabularies/views/vocabulary-config.html +++ b/scripts/apps/vocabularies/views/vocabulary-config.html @@ -1,6 +1,6 @@
- + - +