All files / lib/libs/email/content/userRoles roleHelper.ts

93.33% Statements 14/15
75% Branches 3/4
100% Functions 2/2
100% Lines 13/13

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87      8x 8x 8x 8x 8x 8x 8x 8x     8x               1x 1x 1x     8x                                                                                                                        
import { UserRole } from "shared-types/events/legacy-user";
import { getApprovingRole, userRoleMap } from "shared-utils";
 
export enum userRoleType {
  defaultcmsuser = "defaultcmsuser",
  cmsroleapprover = "cmsroleapprover",
  cmsreviewer = "cmsreviewer",
  statesystemadmin = "statesystemadmin",
  systemadmin = "systemadmin",
  helpdesk = "helpdesk",
  statesubmitter = "statesubmitter",
}
 
export const statusMap = {
  pending: "pending",
  active: "granted",
  denied: "denied",
  revoked: "revoked",
};
 
export function getApprovingUserRoleLabel(role: userRoleType) {
  const approvingRole = getApprovingRole(role) as UserRole;
  Iif (!approvingRole) return undefined;
  return userRoleMap[approvingRole];
}
 
export const statesMap = {
  AL: "Alabama",
  KY: "Kentucky",
  OH: "Ohio",
  AK: "Alaska",
  LA: "Louisiana",
  OK: "Oklahoma",
  AZ: "Arizona",
  ME: "Maine",
  OR: "Oregon",
  AR: "Arkansas",
  MD: "Maryland",
  PA: "Pennsylvania",
  AS: "American Samoa",
  MA: "Massachusetts",
  PR: "Puerto Rico",
  CA: "California",
  MI: "Michigan",
  RI: "Rhode Island",
  CO: "Colorado",
  MN: "Minnesota",
  SC: "South Carolina",
  CT: "Connecticut",
  MS: "Mississippi",
  SD: "South Dakota",
  DE: "Delaware",
  MO: "Missouri",
  TN: "Tennessee",
  DC: "District of Columbia",
  MT: "Montana",
  TX: "Texas",
  FL: "Florida",
  NE: "Nebraska",
  TT: "Trust Territories",
  GA: "Georgia",
  NV: "Nevada",
  UT: "Utah",
  GU: "Guam",
  NH: "New Hampshire",
  VT: "Vermont",
  HI: "Hawaii",
  NJ: "New Jersey",
  VA: "Virginia",
  ID: "Idaho",
  NM: "New Mexico",
  VI: "Virgin Islands",
  IL: "Illinois",
  NY: "New York",
  WA: "Washington",
  IN: "Indiana",
  NC: "North Carolina",
  WV: "West Virginia",
  IA: "Iowa",
  ND: "North Dakota",
  WI: "Wisconsin",
  KS: "Kansas",
  MP: "Northern Mariana Islands",
  WY: "Wyoming",
  ZZ: "ZZ Test Data",
};