Skip to content

Commit

Permalink
Merge pull request #1623 from elwinschmitz/4340-phoneNumbers
Browse files Browse the repository at this point in the history
AB#4340 Show phone-numbers for PM in more phases
  • Loading branch information
elwinschmitz authored Dec 3, 2020
2 parents 96bffcf + 56b8a1a commit 05a29af
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 23 deletions.
2 changes: 2 additions & 0 deletions interfaces/HO-Portal/src/app/models/person.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export class Person {
status: PaStatus;
fsp?: string;
vnumber?: string;
whatsappPhoneNumber?: string;
}

// Model for display (in table)
Expand All @@ -38,6 +39,7 @@ export class PersonRow {
phoneNumber?: string | null;
fsp?: string | null;
vnumber?: string | null;
whatsappPhoneNumber?: string | null;
}

export enum PaStatus {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,16 +104,26 @@ <h2>{{ 'page.program.program-people-affected.section-title'|translate }}</h2>
[cellClass]="column.cellClass"
></ngx-datatable-column>

<ngx-datatable-column
*ngIf="hasVoucherSupport(allPeopleAffected[0]?.fsp) && [phaseEnum.registrationValidation, phaseEnum.inclusion, phaseEnum.reviewInclusion, phaseEnum.payment].includes(thisPhase) && userRole === userEnum.ProgramManager"
prop="whatsappPhoneNumber"
[name]="'page.program.program-people-affected.column.whatsappPhoneNumber'|translate"
minWidth="130"
[draggable]="columnDefaults.draggable"
[resizeable]="columnDefaults.resizeable"
[sortable]="columnDefaults.sortable"
[headerClass]="columnDefaults.headerClass"
></ngx-datatable-column>
<ngx-datatable-column
*ngIf="allPeopleAffected[0]?.vnumber && [phaseEnum.reviewInclusion, phaseEnum.payment].includes(thisPhase) && userRole === userEnum.ProgramManager"
prop="vnumber"
[name]="'page.program.program-people-affected.column.vnumber'|translate"
minWidth="100"
draggable="false"
resizeable="false"
sortable="true"
>
</ngx-datatable-column>
[draggable]="columnDefaults.draggable"
[resizeable]="columnDefaults.resizeable"
[sortable]="columnDefaults.sortable"
[headerClass]="columnDefaults.headerClass"
></ngx-datatable-column>

<ngx-datatable-column
*ngFor="let column of paymentColumns"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export class ProgramPeopleAffectedComponent implements OnInit {
private locale: string;
private dateFormat = 'yyyy-MM-dd, HH:mm';

public columnDefaults: any;
public columns: any[] = [];
private columnsAvailable: any[] = [];
private paymentColumnTemplate: any = {};
Expand Down Expand Up @@ -143,7 +144,7 @@ export class ProgramPeopleAffectedComponent implements OnInit {
),
};

const columnDefaults = {
this.columnDefaults = {
draggable: false,
resizeable: false,
sortable: true,
Expand All @@ -158,7 +159,6 @@ export class ProgramPeopleAffectedComponent implements OnInit {
headerClass: 'ion-text-wrap ion-align-self-end',
};
const columnDateTimeWidth = 142;
const columnDateWidth = 100;
const columnScoreWidth = 90;
const columnPhoneNumberWidth = 130;

Expand All @@ -168,15 +168,15 @@ export class ProgramPeopleAffectedComponent implements OnInit {
name: this.translate.instant(
'page.program.program-people-affected.column.person',
),
...columnDefaults,
...this.columnDefaults,
width: 85,
},
{
prop: 'name',
name: this.translate.instant(
'page.program.program-people-affected.column.name',
),
...columnDefaults,
...this.columnDefaults,
phases: [ProgramPhase.reviewInclusion, ProgramPhase.payment],
roles: [UserRole.ProgramManager],
},
Expand All @@ -185,8 +185,13 @@ export class ProgramPeopleAffectedComponent implements OnInit {
name: this.translate.instant(
'page.program.program-people-affected.column.phone-number',
),
...columnDefaults,
phases: [ProgramPhase.reviewInclusion, ProgramPhase.payment],
...this.columnDefaults,
phases: [
ProgramPhase.registrationValidation,
ProgramPhase.inclusion,
ProgramPhase.reviewInclusion,
ProgramPhase.payment,
],
roles: [UserRole.ProgramManager],
minWidth: columnPhoneNumberWidth,
},
Expand All @@ -195,15 +200,15 @@ export class ProgramPeopleAffectedComponent implements OnInit {
name: this.translate.instant(
'page.program.program-people-affected.column.status',
),
...columnDefaults,
...this.columnDefaults,
width: 90,
},
{
prop: 'digitalIdCreated',
name: this.translate.instant(
'page.program.program-people-affected.column.digital-id-created',
),
...columnDefaults,
...this.columnDefaults,
phases: [ProgramPhase.registrationValidation],
width: columnDateTimeWidth,
},
Expand All @@ -212,7 +217,7 @@ export class ProgramPeopleAffectedComponent implements OnInit {
name: this.translate.instant(
'page.program.program-people-affected.column.vulnerability-assessment-completed',
),
...columnDefaults,
...this.columnDefaults,
phases: [ProgramPhase.registrationValidation],
width: columnDateTimeWidth,
},
Expand All @@ -221,7 +226,7 @@ export class ProgramPeopleAffectedComponent implements OnInit {
name: this.translate.instant(
'page.program.program-people-affected.column.temp-score',
),
...columnDefaults,
...this.columnDefaults,
phases: [ProgramPhase.registrationValidation, ProgramPhase.inclusion],
showIfNoValidation: false,
width: columnScoreWidth,
Expand All @@ -231,7 +236,7 @@ export class ProgramPeopleAffectedComponent implements OnInit {
name: this.translate.instant(
'page.program.program-people-affected.column.selected-for-validation',
),
...columnDefaults,
...this.columnDefaults,
phases: [ProgramPhase.registrationValidation],
showIfNoValidation: false,
width: columnDateTimeWidth,
Expand All @@ -241,7 +246,7 @@ export class ProgramPeopleAffectedComponent implements OnInit {
name: this.translate.instant(
'page.program.program-people-affected.column.vulnerability-assessment-validated',
),
...columnDefaults,
...this.columnDefaults,
phases: [ProgramPhase.registrationValidation],
showIfNoValidation: false,
width: columnDateTimeWidth,
Expand All @@ -251,7 +256,7 @@ export class ProgramPeopleAffectedComponent implements OnInit {
name: this.translate.instant(
'page.program.program-people-affected.column.final-score',
),
...columnDefaults,
...this.columnDefaults,
phases: [ProgramPhase.registrationValidation, ProgramPhase.inclusion],
width: columnScoreWidth,
},
Expand All @@ -260,7 +265,7 @@ export class ProgramPeopleAffectedComponent implements OnInit {
name: this.translate.instant(
'page.program.program-people-affected.column.included',
),
...columnDefaults,
...this.columnDefaults,
phases: [
ProgramPhase.inclusion,
ProgramPhase.reviewInclusion,
Expand All @@ -273,7 +278,7 @@ export class ProgramPeopleAffectedComponent implements OnInit {
name: this.translate.instant(
'page.program.program-people-affected.column.notified-of-inclusion',
),
...columnDefaults,
...this.columnDefaults,
phases: [ProgramPhase.reviewInclusion, ProgramPhase.payment],
width: columnDateTimeWidth,
},
Expand All @@ -282,7 +287,7 @@ export class ProgramPeopleAffectedComponent implements OnInit {
name: this.translate.instant(
'page.program.program-people-affected.column.rejected',
),
...columnDefaults,
...this.columnDefaults,
phases: [ProgramPhase.reviewInclusion, ProgramPhase.payment],
width: columnDateTimeWidth,
},
Expand All @@ -291,7 +296,7 @@ export class ProgramPeopleAffectedComponent implements OnInit {
name: this.translate.instant(
'page.program.program-people-affected.column.fsp',
),
...columnDefaults,
...this.columnDefaults,
phases: [ProgramPhase.reviewInclusion, ProgramPhase.payment],
width: 150,
},
Expand All @@ -302,7 +307,7 @@ export class ProgramPeopleAffectedComponent implements OnInit {
'page.program.program-people-affected.column.payment',
),
installmentIndex: 0,
...columnDefaults,
...this.columnDefaults,
phases: [ProgramPhase.payment],
width: columnDateTimeWidth,
};
Expand Down Expand Up @@ -470,6 +475,7 @@ export class ProgramPeopleAffectedComponent implements OnInit {
: null,
name: person.name,
phoneNumber: formatPhoneNumber(person.phoneNumber),
whatsappPhoneNumber: formatPhoneNumber(person.whatsappPhoneNumber),
vnumber: person.vnumber,
fsp: person.fsp,
};
Expand Down
1 change: 1 addition & 0 deletions interfaces/HO-Portal/src/assets/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@
"phone-number": "Phonenumber",
"payment": "Payment #",
"vnumber": "V-number",
"whatsappPhoneNumber": "WhatsApp nr.",
"fsp": "Financial Service Provider"
},
"status": {
Expand Down

0 comments on commit 05a29af

Please sign in to comment.