Skip to content

Commit

Permalink
move SearchChips to kolibri-common & get languages from injectBaseSearch
Browse files Browse the repository at this point in the history
removes useLanguageses altogether as they are going unused
  • Loading branch information
nucleogenesis committed Oct 31, 2024
1 parent 82fe52b commit a48f10b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 66 deletions.
30 changes: 0 additions & 30 deletions kolibri/plugins/learn/assets/src/composables/useLanguages.js

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,23 @@
import flatMap from 'lodash/flatMap';
import commonCoreStrings from 'kolibri.coreVue.mixins.commonCoreStrings';
import { NoCategories } from 'kolibri.coreVue.vuex.constants';
import useChannels from '../composables/useChannels';
import useLanguages from '../composables/useLanguages';
import useChannels from 'kolibri-common/composables/useChannels';
import { injectBaseSearch } from 'kolibri-common/composables/useBaseSearch';
export default {
name: 'SearchChips',
mixins: [commonCoreStrings],
setup() {
const { languagesMap } = useLanguages();
const { availableLanguages } = injectBaseSearch();
const languagesMap = availableLanguages.value.reduce((map, lang) => {
map[lang.id] = map;
return map;
}, {});
const { channelsMap } = useChannels();
return { channelsMap, languagesMap };
return {
channelsMap,
languagesMap,
};
},
props: {
searchTerms: {
Expand Down
2 changes: 0 additions & 2 deletions packages/kolibri-common/composables/useBaseSearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import {
import useUser from 'kolibri.coreVue.composables.useUser';

import { deduplicateResources } from '../utils/contentNode';
import { setLanguages } from './useLanguages';

export const logging = logger.getLogger(__filename);

Expand Down Expand Up @@ -384,7 +383,6 @@ export default function useBaseSearch({
languagesList: labels.languages || [],
channelsList: labels.channels || [],
});
setLanguages(labels.languages || []);
})
.catch(err => logging.error('Failed to fetch search labels from remote', err))
.then(() => {
Expand Down
30 changes: 0 additions & 30 deletions packages/kolibri-common/composables/useLanguages.js

This file was deleted.

0 comments on commit a48f10b

Please sign in to comment.