Skip to content

Commit

Permalink
folder mapping for demo
Browse files Browse the repository at this point in the history
  • Loading branch information
Axelcureno committed Dec 10, 2024
1 parent 8785768 commit 38efa01
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions studio/src/mas-folder-picker.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,18 @@ export class MasFolderPicker extends LitElement {
handleTopFolders(event) {
const { topFolders } = event.detail;

this.options = topFolders.map((folder) => ({
value: folder.toLowerCase(),
label: folder.toUpperCase(),
}));
const folderMapping = {
acom: 'Adobe.com',
nala: 'CCD',
'adobe-home': 'Adobe Home',
};

this.options = topFolders
.map((folder) => ({
value: folder.toLowerCase(),
label: folderMapping[folder.toLowerCase()] || null,
}))
.filter((option) => option.label !== null);

if (this.options.length > 0) {
const urlParams = new URLSearchParams(window.location.search);
Expand All @@ -129,6 +137,7 @@ export class MasFolderPicker extends LitElement {
(option) => option.value === pathParam.toLowerCase(),
);
}

if (matchedOption) {
this.value = matchedOption.value;
this.label = matchedOption.label;
Expand Down

0 comments on commit 38efa01

Please sign in to comment.