Skip to content

Commit

Permalink
use clouds from ESP & deprecating clouds constant (#369)
Browse files Browse the repository at this point in the history
  • Loading branch information
qiyundai authored Feb 18, 2025
1 parent cd46aed commit 54b722b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
10 changes: 6 additions & 4 deletions ecc/blocks/series-details-component/controller.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { SUPPORTED_CLOUDS } from '../../constants/constants.js';
import { getClouds } from '../../scripts/esp-controller.js';
import { getUser, userHasAccessToBU } from '../../scripts/profile.js';
import { LIBS } from '../../scripts/scripts.js';

Expand Down Expand Up @@ -35,10 +36,11 @@ export default async function init(component, props) {
const seriesDescriptionEl = component.querySelector('#info-field-series-description');

const user = await getUser();
const filteredClouds = Object.entries(SUPPORTED_CLOUDS)
.filter(([, val]) => userHasAccessToBU(user, val.id));
filteredClouds.forEach(([, val]) => {
const opt = createTag('sp-menu-item', { value: val.id }, val.name);
const clouds = await getClouds(user);

const filteredClouds = clouds.filter(({ cloudType }) => userHasAccessToBU(user, cloudType));
filteredClouds.forEach(({ cloudType, cloudName }) => {
const opt = createTag('sp-menu-item', { value: cloudType }, cloudName);
cloudTypeEl.append(opt);
});

Expand Down
1 change: 0 additions & 1 deletion ecc/constants/constants.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
export const LINK_REGEX = '^https:\\/\\/[a-z0-9]+([\\-\\.]{1}[a-z0-9]+)*\\.[a-z]{2,63}(:[0-9]{1,5})?(\\/.*)?$';
export const ALLOWED_ACCOUNT_TYPES = ['type3', 'type2e'];
export const SUPPORTED_CLOUDS = [{ id: 'CreativeCloud', name: 'Creative Cloud' }, { id: 'ExperienceCloud', name: 'Experience Cloud' }];

0 comments on commit 54b722b

Please sign in to comment.