Skip to content

Commit

Permalink
Merge pull request #99 from EyeSeeTea/feature/csy-redirect
Browse files Browse the repository at this point in the history
Feature/csy redirect
  • Loading branch information
MiquelAdell authored May 27, 2024
2 parents 97bc4d5 + 4477c8b commit c1a3691
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "est-landing-page",
"description": "EyeSeeTea Landing Page for WHO",
"version": "0.5.11",
"version": "0.5.12",
"license": "GPL-3.0",
"author": "EyeSeeTea team",
"homepage": ".",
Expand Down
9 changes: 7 additions & 2 deletions src/data/logic/redirection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ const AMR_EGASP_VISUALIZER = "M2jd9QXVWou";
const AMR_AMC_ADMIN = "sVbZXz6W0oQ";
const AMR_EGASP_ADMIN = "txu7PyLyeld";

const CSY_USERS = "y4eVE0uT9yz";

const AMR_COUNTRY_GROUPS = [
AMR_AMC_DATA_CAPTURE,
AMR_AMC_VISUALIZER,
Expand Down Expand Up @@ -326,9 +328,12 @@ export const handleRedirection = async (
const isGLASSCountryUser = shouldRedirect(userGroupIds, AMR_COUNTRY_GROUPS);
const isGLASSAdmin = shouldRedirect(userGroupIds, [AMR_AMC_ADMIN, AMR_AMR_ADMIN, AMR_EGASP_ADMIN]);

const isCSYUser = shouldRedirect(userGroupIds, [CSY_USERS]);

const redirectToNHWAAdmin = !isAdminUserGroup && (isNHWAAdmin || (isNHWAGlobalTeam && isNHWADataManager));

const redirectToHomePage = isMALRegionalUser || (isAMRAMRUser && !isAMRUser) || (isAMRUser && !isAMRAMRUser);
const redirectToHomePage =
isMALRegionalUser || (isAMRAMRUser && !isAMRUser) || (isAMRUser && !isAMRAMRUser) || isCSYUser;

const redirectToGLASS = !isGLASSAdmin && isGLASSCountryUser;

Expand All @@ -345,7 +350,7 @@ export const handleRedirection = async (
);
const username = user.name;

if (configurations.length > 0 || isMALRegionalUser || isGLASSCountryUser) {
if (configurations.length > 0 || isMALRegionalUser || isGLASSCountryUser || isCSYUser) {
return {
username,
userGroupIds,
Expand Down

0 comments on commit c1a3691

Please sign in to comment.