@codecademy/brand 1.20.0-alpha.f4193dadb8.0 → 1.21.0-alpha.cf644848bb.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -37,4 +37,4 @@ export const popularContent = [{
|
|
|
37
37
|
type: ContentType.DOC,
|
|
38
38
|
slug: 'html/concepts/elements'
|
|
39
39
|
}];
|
|
40
|
-
export const ALLOWED_HOSTS = ['
|
|
40
|
+
export const ALLOWED_HOSTS = ['skillsoft.com', 'percipio.com', 'localhost', 'codecademy.com'];
|
|
@@ -16,7 +16,12 @@ export function safelyRedirect(url) {
|
|
|
16
16
|
}
|
|
17
17
|
function hasAllowedHost(url) {
|
|
18
18
|
const parsedUrl = new URL(url);
|
|
19
|
-
|
|
19
|
+
const {
|
|
20
|
+
hostname
|
|
21
|
+
} = parsedUrl;
|
|
22
|
+
return ALLOWED_HOSTS.some(host =>
|
|
23
|
+
// Exact match or exact subdomain match (e.g. sub.codecademy.com)
|
|
24
|
+
hostname === host || hostname.endsWith(`.${host}`));
|
|
20
25
|
}
|
|
21
26
|
|
|
22
27
|
// when a url is relative, the URL constructor will throw a TypeError;
|
|
@@ -220,7 +220,7 @@ const profileBusinessAccount = {
|
|
|
220
220
|
icon: PieLineGraphIcon,
|
|
221
221
|
href: '/business/plans',
|
|
222
222
|
trackingTarget: 'avatar_business',
|
|
223
|
-
text: '
|
|
223
|
+
text: 'Admin Dashboard',
|
|
224
224
|
type: 'link'
|
|
225
225
|
};
|
|
226
226
|
const profileHelpCenter = {
|
|
@@ -300,11 +300,12 @@ export const proProfile = user => {
|
|
|
300
300
|
topSection.push(profileAccount);
|
|
301
301
|
}
|
|
302
302
|
topSection.push(profileMyHome);
|
|
303
|
-
if ((user?.isAccountManager || user?.isBusinessAdmin) && !user?.hideBusinessAccount) {
|
|
304
|
-
topSection.push(profileBusinessAccount);
|
|
305
|
-
}
|
|
306
303
|
topSection.push(profileHelpCenter);
|
|
307
304
|
topSection.push(profileFeedback);
|
|
305
|
+
const teamsAdminSection = [];
|
|
306
|
+
if ((user?.isAccountManager || user?.isBusinessAdmin) && !user?.hideBusinessAccount) {
|
|
307
|
+
teamsAdminSection.push(profileBusinessAccount);
|
|
308
|
+
}
|
|
308
309
|
const middleSection = [];
|
|
309
310
|
if (user.isAdmin) {
|
|
310
311
|
middleSection.push(profileAdmin);
|
|
@@ -316,7 +317,7 @@ export const proProfile = user => {
|
|
|
316
317
|
middleSection.push(profileReportBug);
|
|
317
318
|
}
|
|
318
319
|
const bottomSection = [profileLogOut];
|
|
319
|
-
const popover = [topSection, middleSection, bottomSection];
|
|
320
|
+
const popover = [topSection, teamsAdminSection, middleSection, bottomSection];
|
|
320
321
|
return {
|
|
321
322
|
avatar: user.avatar,
|
|
322
323
|
userDisplayName: user.displayName,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codecademy/brand",
|
|
3
3
|
"description": "Brand component library for Codecademy",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.21.0-alpha.cf644848bb.0",
|
|
5
5
|
"author": "Codecademy Engineering <dev@codecademy.com>",
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"@emotion/is-prop-valid": "^1.2.1",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"@codecademy/gamut-illustrations": "*",
|
|
32
32
|
"@codecademy/gamut-patterns": "*",
|
|
33
33
|
"@codecademy/gamut-styles": "*",
|
|
34
|
-
"@codecademy/tracking": "1.1.
|
|
34
|
+
"@codecademy/tracking": "1.1.2",
|
|
35
35
|
"@codecademy/variance": "*",
|
|
36
36
|
"@emotion/react": "^11.4.0",
|
|
37
37
|
"@emotion/styled": "^11.3.0",
|