Merge branch 'develop' of ssh://bitbucket.arbetsformedlingen.se:7999/tea/mina-sidor-fa-web into develop

This commit is contained in:
Daniel Appelgren
2021-10-08 16:10:37 +02:00
5 changed files with 47 additions and 21 deletions

View File

@@ -21,13 +21,21 @@
<dd>{{avrop.tjanst}}</dd> <dd>{{avrop.tjanst}}</dd>
<ng-container *ngIf="!isPeriodDate; else periodDateRef"> <ng-container *ngIf="!isPeriodDate; else periodDateRef">
<dt>Startdatum</dt> <dt>Startdatum</dt>
<dd>{{avrop.startDate | date:'longDate'}}</dd> <dd>
<digi-typography-time [afDateTime]="avrop.startDate"></digi-typography-time>
</dd>
<dt>Slutdatum</dt> <dt>Slutdatum</dt>
<dd>{{avrop.endDate | date:'longDate'}}</dd> <dd>
<digi-typography-time [afDateTime]="avrop.endDate"></digi-typography-time>
</dd>
</ng-container> </ng-container>
<ng-template #periodDateRef> <ng-template #periodDateRef>
<dt>Avser period</dt> <dt>Avser period</dt>
<dd>{{avrop.startDate | date:'longDate'}} - {{avrop.endDate | date:'longDate'}}</dd> <dd>
<digi-typography-time [afDateTime]="avrop.startDate"></digi-typography-time>
-
<digi-typography-time [afDateTime]="avrop.endDate"></digi-typography-time>
</dd>
</ng-template> </ng-template>
</dl> </dl>
</div> </div>

View File

@@ -18,21 +18,26 @@
</thead> </thead>
<tbody> <tbody>
<tr *ngFor="let handelse of deltagareHandelser;"> <tr *ngFor="let handelse of deltagareHandelser;">
<td class="deltagare-list-handelser__table-cell">{{handelse.receivedDate | date}}</td> <td class="deltagare-list-handelser__table-cell">
<td class="deltagare-list-handelser__table-cell" *ngIf="!handelse.isAvbrott; else isAvbrottCell"> <digi-typography-time [afDateTime]="getHandelseDate(handelse, 'receivedDate')"></digi-typography-time>
{{handelse.description}}</td> </td>
<td class="deltagare-list-handelser__table-cell"> <td class="deltagare-list-handelser__table-cell" *ngIf="!handelse.isAvbrott; else isAvbrottCell">
<ng-container *ngIf="handelse.effectDescription && handelse.effectDate"> {{handelse.description}}
{{handelse.effectDescription}}: {{handelse.effectDate | date }} </td>
</ng-container> <td class="deltagare-list-handelser__table-cell">
</td> <ng-container *ngIf="handelse.effectDescription && handelse.effectDate">
<ng-template #isAvbrottCell> {{handelse.effectDescription}}:
<td class="deltagare-list-handelser__avbrott-cell"> <digi-typography-time [afDateTime]="getHandelseDate(handelse)"></digi-typography-time>
<msfa-icon [icon]="iconType.WARNING" size="l"></msfa-icon> </ng-container>
{{handelse.description}}</td> </td>
</ng-template> <ng-template #isAvbrottCell>
</tr> <td class="deltagare-list-handelser__avbrott-cell">
<msfa-icon [icon]="iconType.WARNING" size="l"></msfa-icon>
{{handelse.description}}
</td>
</ng-template>
</tr>
</tbody> </tbody>

View File

@@ -16,7 +16,7 @@ export class DeltagareListHandelserDialogComponent implements OnInit {
iconType = IconType; iconType = IconType;
deltagareHandelser$: Observable<DeltagareHandelse[]>; deltagareHandelser$: Observable<DeltagareHandelse[]>;
constructor(private deltagareHandelserApiService: DeltagareHandelserApiService) {} constructor(private deltagareHandelserApiService: DeltagareHandelserApiService) { }
ngOnInit(): void { ngOnInit(): void {
if (this.deltagare) { if (this.deltagare) {
@@ -25,4 +25,8 @@ export class DeltagareListHandelserDialogComponent implements OnInit {
); );
} }
} }
getHandelseDate(handelse: DeltagareHandelse, handelseDate?: string): Date {
return handelseDate === 'receivedDate' ? new Date(handelse.receivedDate) : new Date(handelse.effectDate);
}
} }

View File

@@ -40,9 +40,14 @@
</th> </th>
<td>{{ singleDeltagare.tjanst }}</td> <td>{{ singleDeltagare.tjanst }}</td>
<td>{{ singleDeltagare.utforandeVerksamhet }}</td> <td>{{ singleDeltagare.utforandeVerksamhet }}</td>
<td>{{ singleDeltagare.startdatumAvrop | date }}</td>
<td> <td>
{{ singleDeltagare.slutdatumAvrop | date }} <digi-typography-time
[afDateTime]="getAvropDate(singleDeltagare, 'startdatumAvrop')"
></digi-typography-time>
</td>
<td>
<digi-typography-time [afDateTime]="getAvropDate(singleDeltagare)"></digi-typography-time>
<div class="deltagare-list__avbrott-alert" *ngIf="singleDeltagare.hasAvbrott"> <div class="deltagare-list__avbrott-alert" *ngIf="singleDeltagare.hasAvbrott">
<msfa-icon [icon]="iconType.WARNING" size="l"></msfa-icon> <msfa-icon [icon]="iconType.WARNING" size="l"></msfa-icon>
Avbrott Avbrott

View File

@@ -75,6 +75,10 @@ export class DeltagareListTableComponent {
return end < this.count ? end : this.count; return end < this.count ? end : this.count;
} }
getAvropDate(deltagare: DeltagareCompact, avropDate?: string): Date {
return avropDate === 'startdatumAvrop' ? new Date(deltagare.startdatumAvrop) : new Date(deltagare.slutdatumAvrop)
}
handleSort(key: keyof DeltagareCompact): void { handleSort(key: keyof DeltagareCompact): void {
this.sorted.emit(key); this.sorted.emit(key);
} }