Skip to content

Commit f4160d2

Browse files
committed
Improving the desing, so we don't have information shown, when we look at the future and it has no relervance.
1 parent 6dc3322 commit f4160d2

2 files changed

Lines changed: 22 additions & 11 deletions

File tree

eform-client/src/app/plugins/modules/time-planning-pn/components/plannings/time-planning-actions/workday-entity/workday-entity-dialog.component.html

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@
185185
</ng-template>
186186

187187
<ng-template #actualColumnTemplate let-row let-col="colDef">
188-
<ng-container *ngIf="row['shiftId'] === '1'">
188+
<ng-container *ngIf="row['shiftId'] === '1' && !isInTheFuture">
189189
<div class="flex-row">
190190
<mat-form-field>
191191
<mat-label>{{'Start' | translate}}</mat-label>
@@ -267,7 +267,7 @@
267267
</button>
268268
</div>
269269
</ng-container>
270-
<ng-container *ngIf="row['shiftId'] === '2'">
270+
<ng-container *ngIf="row['shiftId'] === '2' && !isInTheFuture">
271271
<div class="flex-row">
272272
<mat-form-field>
273273
<mat-label>{{'Start' | translate}}</mat-label>
@@ -350,7 +350,7 @@
350350
</ng-template>
351351

352352
<br>
353-
<mat-form-field class="pr-2">
353+
<mat-form-field class="pr-2" *ngIf="!isInTheFuture">
354354
<mat-label>{{ 'Flex balance at start of day' | translate }}</mat-label>
355355
<input
356356
type="text"
@@ -359,7 +359,7 @@
359359
name="flexToDate"
360360
readonly="readonly"
361361
disabled
362-
[value]="data.planningPrDayModels.sumFlexStart.toFixed(2)"
362+
[value]="convertHoursToTime(data.planningPrDayModels.sumFlexStart)"
363363
>
364364
</mat-form-field>
365365
<br><mat-form-field class="pr-2">
@@ -375,7 +375,7 @@
375375
>
376376
</mat-form-field>
377377
<br>
378-
<mat-form-field class="pr-2">
378+
<mat-form-field class="pr-2" *ngIf="!isInTheFuture">
379379
<mat-label>{{ 'NettoHours' | translate }}</mat-label>
380380
<input
381381
type="text"
@@ -388,7 +388,7 @@
388388
>
389389
</mat-form-field>
390390
<br>
391-
<mat-form-field class="pr-2">
391+
<mat-form-field class="pr-2" *ngIf="!isInTheFuture">
392392
<mat-label>{{ 'Flex' | translate }}</mat-label>
393393
<input
394394
type="text"
@@ -401,7 +401,7 @@
401401
>
402402
</mat-form-field>
403403
<br>
404-
<mat-form-field class="pr-2">
404+
<mat-form-field class="pr-2" *ngIf="!isInTheFuture">
405405
<mat-label>{{ 'PaidOutFlex' | translate }}</mat-label>
406406
<input
407407
type="number"
@@ -413,7 +413,7 @@
413413
>
414414
</mat-form-field>
415415
<br>
416-
<mat-form-field class="pr-2">
416+
<mat-form-field class="pr-2" *ngIf="!isInTheFuture">
417417
<mat-label>{{ 'SumFlex' | translate }}</mat-label>
418418
<input
419419
type="text"
@@ -422,7 +422,7 @@
422422
name="flexIncludingToday"
423423
readonly="readonly"
424424
disabled
425-
[value]="data.planningPrDayModels.sumFlexEnd.toFixed(2)"
425+
[value]="convertHoursToTime(data.planningPrDayModels.sumFlexEnd)"
426426
>
427427
</mat-form-field>
428428
<br>

eform-client/src/app/plugins/modules/time-planning-pn/components/plannings/time-planning-actions/workday-entity/workday-entity-dialog.component.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,18 @@ export class WorkdayEntityDialogComponent implements OnInit {
114114
field: 'actualStart',
115115
sortable: false,
116116
},
117-
]: [
117+
]: this.isInTheFuture ? [
118+
{
119+
header: this.translateService.stream('Shift'), field: 'shift',
120+
pinned: 'left'
121+
},
122+
{
123+
cellTemplate: this.plannedColumnTemplate,
124+
header: this.translateService.stream('Planned'),
125+
field: 'plannedStart',
126+
sortable: false,
127+
},
128+
] : [
118129
{
119130
header: this.translateService.stream('Shift'), field: 'shift',
120131
pinned: 'left'
@@ -308,7 +319,7 @@ export class WorkdayEntityDialogComponent implements OnInit {
308319
if (hours < 0) {
309320
hours = Math.abs(hours);
310321
}
311-
const totalMinutes = Math.floor(hours * 60)
322+
const totalMinutes = Math.round(hours * 60)
312323
const hrs = Math.floor(totalMinutes / 60);
313324
let mins = totalMinutes % 60;
314325
if (isNegative) {

0 commit comments

Comments
 (0)