Skip to content

Commit

Permalink
Merge pull request #12161 from marcellamaki/dropdown-sort-order
Browse files Browse the repository at this point in the history
Align metadata dropdown order to the figma spec
  • Loading branch information
marcellamaki authored May 14, 2024
2 parents 32e1e94 + cd6f9d8 commit 3d44bd9
Showing 1 changed file with 25 additions and 6 deletions.
31 changes: 25 additions & 6 deletions kolibri/plugins/learn/assets/src/composables/useSearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,36 @@ function _generateResourcesNeeded(learnerNeeds) {
return resourcesNeeded;
}

const gradeLevelsShown = [
'BASIC_SKILLS',
'PRESCHOOL',
'LOWER_PRIMARY',
'UPPER_PRIMARY',
'LOWER_SECONDARY',
'UPPER_SECONDARY',
'TERTIARY',
'PROFESSIONAL',
'WORK_SKILLS',
];

function _generateGradeLevelsList(gradeLevels) {
return Object.keys(ContentLevels).filter(key => {
const value = ContentLevels[key];
return gradeLevels && gradeLevels.includes(value);
return gradeLevelsShown.filter(key => {
return gradeLevels && gradeLevels.includes(ContentLevels[key]);
});
}

const accessibilityLabelsShown = [
'SIGN_LANGUAGE',
'AUDIO_DESCRIPTION',
'TAGGED_PDF',
'ALT_TEXT',
'HIGH_CONTRAST',
'CAPTIONS_SUBTITLES',
];

function _generateAccessibilityOptionsList(accessibilityLabels) {
return Object.keys(AccessibilityCategories).filter(key => {
const value = AccessibilityCategories[key];
return accessibilityLabels && accessibilityLabels.includes(value);
return accessibilityLabelsShown.filter(key => {
return accessibilityLabels && accessibilityLabels.includes(AccessibilityCategories[key]);
});
}

Expand Down

0 comments on commit 3d44bd9

Please sign in to comment.