Skip to content

Commit

Permalink
fix/person-roles (#224)
Browse files Browse the repository at this point in the history
* Localize supervisor role

* Redefine term roles
  • Loading branch information
tohuynh committed May 28, 2022
1 parent 98ed482 commit 850a017
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/assets/LocalizedStrings.tsx
Expand Up @@ -95,6 +95,7 @@ export interface MasterStringsList extends LocalizedStringsMethods {
member: string;
council_president: string;
vice_chair: string;
supervisor: string;
active: string;
inactive: string;
latest_vote: string;
Expand Down
1 change: 1 addition & 0 deletions src/assets/strings/de.ts
Expand Up @@ -84,6 +84,7 @@ const de = {
member: "Mitglied",
council_president: "Präsident des Rates",
vice_chair: "Stellvertretender Vorsitzender",
supervisor: "Supervisor/in",
active: "aktiv",
inactive: "inaktiv",
latest_vote: "Letzte Abstimmung",
Expand Down
1 change: 1 addition & 0 deletions src/assets/strings/en.ts
Expand Up @@ -83,6 +83,7 @@ const en = {
member: "Member",
council_president: "Council President",
vice_chair: "Vice Chair",
supervisor: "Supervisor",
active: "active",
inactive: "inactive",
latest_vote: "Latest Vote",
Expand Down
1 change: 1 addition & 0 deletions src/assets/strings/es.ts
Expand Up @@ -83,6 +83,7 @@ const es = {
member: "Miembro",
council_president: "Presidente/a del Consejo",
vice_chair: "Vicepresidente/a",
supervisor: "Supervisor/a",
active: "activo/a",
inactive: "inactivo/a",
latest_vote: "Último Voto",
Expand Down
6 changes: 3 additions & 3 deletions src/models/util/RoleUtilities.ts
Expand Up @@ -104,14 +104,14 @@ function partitionNonTermRoles(
roles: Role[],
termRoles: Role[]
): [Record<string, Role[][]>, Role[]] {
const nonTermRoles = roles.filter(
(role) => ![ROLE_TITLE.COUNCILMEMBER, ROLE_TITLE.COUNCILPRESIDENT].includes(role.title)
);
const nonTermRoles = roles.filter((role) => role.title !== ROLE_TITLE.COUNCILMEMBER);

// sort by `nonTermRoleTitles`
const nonTermRoleTitles = [
ROLE_TITLE.COUNCILPRESIDENT,
ROLE_TITLE.CHAIR,
ROLE_TITLE.VICE_CHAIR,
ROLE_TITLE.SUPERVISOR,
ROLE_TITLE.MEMBER,
ROLE_TITLE.ALTERNATE,
];
Expand Down
2 changes: 1 addition & 1 deletion src/networking/RoleService.ts
Expand Up @@ -53,7 +53,7 @@ export default class RoleService extends ModelService {
WHERE_OPERATOR.eq,
doc(NetworkService.getDb(), COLLECTION_NAME.Person, personId)
),
where("title", WHERE_OPERATOR.in, [ROLE_TITLE.COUNCILMEMBER, ROLE_TITLE.COUNCILPRESIDENT]),
where("title", WHERE_OPERATOR.eq, ROLE_TITLE.COUNCILMEMBER),
orderBy("start_datetime", ORDER_DIRECTION.desc),
],
new PopulationOptions([populateSeatRef])
Expand Down

0 comments on commit 850a017

Please sign in to comment.