Skip to content

Commit 95faf25

Browse files
Merge pull request #93 from kallewesterling/main
Fixing partner display
2 parents 38aefb0 + 5620706 commit 95faf25

1 file changed

Lines changed: 25 additions & 17 deletions

File tree

production/skilljar-theme-v2.1.js

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -59,17 +59,21 @@ const confettiDefaults = {
5959
// baseURL settings
6060

6161
let isInternal = false,
62-
isAdmin = false;
62+
isAdmin = false,
63+
isPartner = false,
64+
isOnlyPartner = false;
6365

6466
if (typeof skilljarUser !== "undefined") {
6567
isInternal = skilljarUser.email.includes("@chainguard.dev");
6668
isAdmin = skilljarUser.email === "kalle.westerling@chainguard.dev";
6769
}
6870

69-
const isPartner =
70-
typeof skilljarUserStudentGroups !== "undefined"
71-
? skilljarUserStudentGroups.map((d) => d.id).includes("1axsvmzhtbb95")
72-
: false;
71+
if (typeof skilljarUserStudentGroups !== "undefined") {
72+
isPartner = skilljarUserStudentGroups
73+
.map((d) => d.id)
74+
.includes("1axsvmzhtbb95");
75+
isOnlyPartner = isPartner && skilljarUserStudentGroups.length === 1;
76+
}
7377

7478
DOMAIN.current = isAdmin ? DOMAIN.stage : DOMAIN.prod;
7579

@@ -378,17 +382,19 @@ pathSections = {
378382
description:
379383
"A comprehensive learning path designed to provide partners with the foundational knowledge needed to effectively sell Chainguard's products and solutions.",
380384
},
381-
{
382-
isPath: true,
383-
isCourse: false,
384-
hasBadge: false,
385-
title: "Chainguard Advanced: Partner Sales Accelerator",
386-
slug: "path/chainguard-advanced-partner-sales-accelerator",
387-
icon: icons.burger,
388-
description:
389-
"An advanced learning path aimed at equipping partners with the skills and knowledge to accelerate their sales efforts for Chainguard's products and solutions.",
390-
},
391-
],
385+
isInternal
386+
? {
387+
isPath: true,
388+
isCourse: false,
389+
hasBadge: false,
390+
title: "Chainguard Advanced: Partner Sales Accelerator",
391+
slug: "path/chainguard-advanced-partner-sales-accelerator",
392+
icon: icons.burger,
393+
description:
394+
"An advanced learning path aimed at equipping partners with the skills and knowledge to accelerate their sales efforts for Chainguard's products and solutions.",
395+
}
396+
: undefined,
397+
].filter(Boolean),
392398
},
393399
],
394400
"chainguard-containers-onboarding-guide": [
@@ -1366,7 +1372,9 @@ function styleCatalog() {
13661372
} else if (page.isLanding) {
13671373
sectionName = "home";
13681374
} else {
1369-
console.warn("Could not determine catalog section name, defaulting to home");
1375+
console.warn(
1376+
"Could not determine catalog section name, defaulting to home"
1377+
);
13701378
sectionName = "home";
13711379
}
13721380

0 commit comments

Comments
 (0)