Skip to content

Commit

Permalink
fix the PBA (#1248)
Browse files Browse the repository at this point in the history
* fix the PBA

* user?.roles

* address postcode fix

* organisation PBA pending
  • Loading branch information
udaydenduluri33 authored Jan 23, 2024
1 parent a7e30fa commit b248111
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,24 +54,21 @@
<dl class="govuk-summary-list">
<div class="govuk-summary-list__row">
<dt class="govuk-summary-list__key">PBA numbers</dt>
<dd *ngIf="organisationPaymentAccount?.length"
class="govuk-summary-list__value">
<dd class="govuk-summary-list__value">
<div *ngFor="let pba of organisationPaymentAccount">
{{pba.pbaNumber}}
</div>
<br/>
<div *ngFor="let pendingPBA of organisationPendingPaymentAccount">{{pendingPBA}} (Pending approval)</div>
</dd>
<dd *ngIf="showChangePbaNumberLink && organisationPaymentAccount?.length"
class="govuk-summary-list__actions">
<a class="govuk-link" href="javascript:void(0)"
id="change-pba-account-numbers__link"
routerLink="/organisation/update-pba-numbers">
Change<span class="govuk-visually-hidden">PBA numbers</span>
</a>
</dd>
<dd *ngIf="!organisationPaymentAccount?.length"
class="govuk-summary-list__value">
No PBA accounts registered
</dd>
<dd *ngIf="showChangePbaNumberLink"
class="govuk-summary-list__actions">
<a class="govuk-link" href="javascript:void(0)"
id="change-pba-account-numbers__link"
routerLink="/organisation/update-pba-numbers">
Change<span class="govuk-visually-hidden">PBA numbers</span>
</a>
</dd>
</div>
</dl>

Expand Down
4 changes: 2 additions & 2 deletions src/organisation/organisation.routing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const ROUTES: Routes = [
]
},
{
path: 'update-pba-numbers',
path: 'organisation/update-pba-numbers',
component: UpdatePbaNumbersComponent,
data: { role: 'pui-finance-manager' },
canActivate: [
Expand All @@ -30,7 +30,7 @@ export const ROUTES: Routes = [
]
},
{
path: 'update-pba-numbers-check',
path: 'organisation/update-pba-numbers-check',
component: UpdatePbaNumbersCheckComponent,
data: { role: 'pui-finance-manager' },
canActivate: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ export class RegisteredAddressComponent extends RegisterComponent implements OnI
return;
}
const givenAddress = this.formGroup.get('address').value;
givenAddress.postCode && givenAddress.postCode !== '' ? this.setFormGroup(givenAddress) : this.setFormGroup();
givenAddress && givenAddress.postCode && givenAddress.postCode !== '' ? this.setFormGroup(givenAddress) : this.setFormGroup();
}

private setFormGroup(givenAddress?: AddressModel) {
Expand Down
2 changes: 1 addition & 1 deletion src/user-profile/store/selectors/auth.selectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const getIsUserCaaAdmin = createSelector(

export const getIsUserPuiFinanceManager = createSelector(
getUser,
(user) => user.roles.indexOf('pui-finance-manager') !== -1
(user) => user?.roles ? user.roles.indexOf('pui-finance-manager') !== -1 : false
);

export const getUid = createSelector(
Expand Down

0 comments on commit b248111

Please sign in to comment.