Merge pull request #34 in TEA/dafa-web-monorepo from feature/TV-271-participant-hide-show-ssn to develop

Squashed commit of the following:

commit aa442dd054833d8004f50250110c817db761494c
Author: Cecilia Varnava <cecilia.varnava@arbetsformedlingen.se>
Date:   Fri Jun 18 14:30:37 2021 +0200

    TV-271 add hide ssn component to participant page
This commit is contained in:
Cecilia Varnava
2021-07-02 13:03:28 +02:00
parent a11d1665da
commit 07ce7a4493
3 changed files with 25 additions and 2 deletions

View File

@@ -19,7 +19,13 @@
<dt>Namn</dt>
<dd *ngIf="detailedParticipantData.fullName; else emptyDD">{{ detailedParticipantData.fullName }}</dd>
<dt>Personnummer</dt>
<dd *ngIf="detailedParticipantData.ssn; else emptyDD">{{ detailedParticipantData.ssn }}</dd>
<dd *ngIf="detailedParticipantData.ssn; else emptyDD">
<dafa-hide-text
symbols="********-****"
[changingText]="detailedParticipantData.ssn"
ariaLabelType="personnummer"
></dafa-hide-text>
</dd>
</dl>
<h3>Särskilda behov</h3>

View File

@@ -6,6 +6,7 @@ import { BackLinkModule } from '@dafa-shared/components/back-link/back-link.modu
import { IconModule } from '@dafa-shared/components/icon/icon.module';
import { LayoutModule } from '@dafa-shared/components/layout/layout.module';
import { ParticipantCardComponent } from './participant-card.component';
import { HideTextModule } from '@dafa-shared/components/hide-text/hide-text.module';
@NgModule({
schemas: [CUSTOM_ELEMENTS_SCHEMA],
@@ -17,6 +18,7 @@ import { ParticipantCardComponent } from './participant-card.component';
DigiNgLinkInternalModule,
IconModule,
BackLinkModule,
HideTextModule,
],
exports: [ParticipantCardComponent],
})

View File

@@ -7,6 +7,7 @@ export interface Participant {
firstName: string;
lastName: string;
fullName: string;
ssn: string;
status: ParticipantStatus;
nextStep: string;
service: Service;
@@ -29,6 +30,7 @@ export interface ParticipantApiResponseData {
id: string;
firstName: string;
lastName: string;
ssn: string;
status: ParticipantStatus;
nextStep: string;
service: Service;
@@ -39,12 +41,25 @@ export interface ParticipantApiResponseData {
}
export function mapParticipantApiResponseToParticipant(data: ParticipantApiResponseData): Participant {
const { id, firstName, lastName, status, nextStep, service, errandNumber, startDate, endDate, handleBefore } = data;
const {
id,
firstName,
lastName,
ssn,
status,
nextStep,
service,
errandNumber,
startDate,
endDate,
handleBefore,
} = data;
return {
id,
firstName,
lastName,
fullName: `${firstName} ${lastName}`,
ssn,
status,
nextStep,
service,