Skip to content

Commit fd0c0aa

Browse files
committed
Adding more constraints for setting workday.
1 parent a1b4dff commit fd0c0aa

3 files changed

Lines changed: 13 additions & 6 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: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
<input
3535
matInput
3636
[ngxTimepicker]="plannedPause1Picker"
37+
[disabled]="plannedStartOfShift1 === '00:00' || plannedEndOfShift1 === '00:00'"
3738
[format]="24"
3839
[(ngModel)]="plannedBreakOfShift1"
3940
readonly
@@ -49,6 +50,7 @@
4950
<input
5051
matInput
5152
[ngxTimepicker]="plannedPicker2"
53+
[disabled]="plannedStartOfShift1 === '00:00'"
5254
[format]="24"
5355
[(ngModel)]="plannedEndOfShift1"
5456
readonly
@@ -67,6 +69,7 @@
6769
<input
6870
matInput
6971
[ngxTimepicker]="plannedPicker3"
72+
[disabled]="plannedEndOfShift1 === '00:00'"
7073
readonly
7174
[format]="24"
7275
[(ngModel)]="plannedStartOfShift2"
@@ -82,6 +85,7 @@
8285
<mat-label>{{'Pause' | translate}}</mat-label>
8386
<input
8487
matInput
88+
[disabled]="plannedStartOfShift2 === '00:00' || plannedEndOfShift2 === '00:00'"
8589
[ngxTimepicker]="plannedPause2Picker"
8690
[format]="24"
8791
[(ngModel)]="plannedBreakOfShift2"
@@ -138,7 +142,7 @@
138142
<mat-label>{{'Pause' | translate}}</mat-label>
139143
<input
140144
matInput
141-
[disabled]="isInTheFuture"
145+
[disabled]="isInTheFuture || start1StartedAt === null && stop1StoppedAt === null"
142146
[ngxTimepicker]="pause1IdPicker"
143147
[format]="24"
144148
[(ngModel)]="pause1Id"
@@ -156,7 +160,7 @@
156160
<input
157161
matInput
158162
readonly
159-
[disabled]="isInTheFuture"
163+
[disabled]="isInTheFuture || start1StartedAt === null"
160164
[ngxTimepicker]="picker2"
161165
[format]="24"
162166
[(ngModel)]="stop1StoppedAt"
@@ -175,7 +179,7 @@
175179
<input
176180
matInput
177181
readonly
178-
[disabled]="isInTheFuture"
182+
[disabled]="isInTheFuture || stop1StoppedAt === null"
179183
[ngxTimepicker]="picker3"
180184
[format]="24"
181185
[(ngModel)]="start2StartedAt"
@@ -191,11 +195,12 @@
191195
<mat-label>{{'Pause' | translate}}</mat-label>
192196
<input
193197
matInput
194-
[disabled]="isInTheFuture"
198+
[disabled]="isInTheFuture || start2StartedAt === null && stop1StoppedAt === null"
195199
[ngxTimepicker]="pause2IdPicker"
196200
[format]="24"
197201
[(ngModel)]="pause2Id"
198202
readonly
203+
[min]="date"
199204
[value]="pause2Id"
200205
>
201206
<ngx-material-timepicker #pause2IdPicker
@@ -209,7 +214,7 @@
209214
<input
210215
matInput
211216
readonly
212-
[disabled]="isInTheFuture"
217+
[disabled]="isInTheFuture || start2StartedAt === null"
213218
[ngxTimepicker]="picker4"
214219
[format]="24"
215220
[(ngModel)]="stop2StoppedAt"

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ export class WorkdayEntityDialogComponent implements OnInit {
6666
stop2StoppedAt: string;
6767
pause2Id: string;
6868
isInTheFuture: boolean = false;
69+
date: any;
6970
@ViewChild('plannedColumnTemplate', { static: true }) plannedColumnTemplate!: TemplateRef<any>;
7071
@ViewChild('actualColumnTemplate', { static: true }) actualColumnTemplate!: TemplateRef<any>;
7172
constructor(
@@ -94,6 +95,7 @@ export class WorkdayEntityDialogComponent implements OnInit {
9495
this.stop2StoppedAt = this.datePipe.transform(this.data.stop2StoppedAt, 'HH:mm', 'UTC');
9596
this.pause2Id = this.convertMinutesToTime(this.data.pause2Id * 5);
9697
this.isInTheFuture = Date.parse(this.data.date) > Date.now();
98+
this.date = Date.parse(this.data.date);
9799
//this.tableHeaders = [];
98100

99101
this.tableHeaders = [

eform-client/src/app/plugins/modules/time-planning-pn/i18n/da.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ export const da = {
9090
'4th shift': '4. skift',
9191
'5th shift': '5. skift',
9292
'Flex balance to date': 'Flex saldo til dato',
93-
TimeOff: 'Fritid',
93+
TimeOff: 'Ferie fridag',
9494
Shift: 'Skift',
9595
Registered: 'Registreret',
9696
};

0 commit comments

Comments
 (0)