Skip to content

Commit f537d31

Browse files
committed
Merge branch 'stable'
2 parents a8b531e + 2b36121 commit f537d31

File tree

5 files changed

+63
-43
lines changed

5 files changed

+63
-43
lines changed

eform-client/cypress/e2e/plugins/time-planning-pn/b/dashboard-assert.spec.cy.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,7 @@ describe('Dashboard assert', () => {
509509
cy.get('#plannedBreakOfShift2').should('have.value', planTexts[i].plannedBreakOfShift2);
510510
cy.get('#plannedEndOfShift2').should('have.value', planTexts[i].plannedEndOfShift2);
511511
cy.get('#cancelButton').click();
512+
cy.wait(500);
512513
}
513514

514515
cy.get('#forwards').click();
@@ -693,6 +694,7 @@ describe('Dashboard assert', () => {
693694
cy.get('#plannedBreakOfShift2').should('include.value', updatePlanTexts[i].plannedBreakOfShift2);
694695
cy.get('#plannedEndOfShift2').should('include.value', updatePlanTexts[i].plannedEndOfShift2);
695696
cy.get('#cancelButton').click();
697+
cy.wait(500);
696698
}
697699

698700
cy.get('#forwards').click();

eform-client/src/app/plugins/modules/time-planning-pn/components/plannings/time-planning-actions/assigned-site/assigned-site-dialog.component.spec.ts

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ describe('AssignedSiteDialogComponent', () => {
178178
describe('Form Initialization', () => {
179179
it('should initialize form with correct structure', () => {
180180
component.ngOnInit();
181-
181+
182182
expect(component.assignedSiteForm).toBeDefined();
183183
expect(component.assignedSiteForm.get('useGoogleSheetAsDefault')).toBeDefined();
184184
expect(component.assignedSiteForm.get('useOnlyPlanHours')).toBeDefined();
@@ -189,17 +189,17 @@ describe('AssignedSiteDialogComponent', () => {
189189

190190
it('should populate form with data values', () => {
191191
component.ngOnInit();
192-
192+
193193
expect(component.assignedSiteForm.get('useGoogleSheetAsDefault')?.value).toBe(false);
194194
expect(component.assignedSiteForm.get('useOnlyPlanHours')?.value).toBe(false);
195195
});
196196

197197
it('should create shift forms for each day of the week', () => {
198198
component.ngOnInit();
199-
199+
200200
const days = ['monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sunday'];
201201
const firstShift = component.assignedSiteForm.get('firstShift');
202-
202+
203203
days.forEach(day => {
204204
expect(firstShift?.get(day)).toBeDefined();
205205
expect(firstShift?.get(day)?.get('start')).toBeDefined();
@@ -227,9 +227,9 @@ describe('AssignedSiteDialogComponent', () => {
227227
it('should copy break settings from global settings for monday', () => {
228228
// Reinitialize to get the new global settings
229229
component.ngOnInit();
230-
230+
231231
component.copyBreakSettings('monday');
232-
232+
233233
const mondayBreak = component.assignedSiteForm.get('autoBreakSettings')?.get('monday');
234234
expect(mondayBreak?.get('breakMinutesDivider')?.value).toBe('08:00');
235235
expect(mondayBreak?.get('breakMinutesPrDivider')?.value).toBe('00:30');
@@ -238,9 +238,9 @@ describe('AssignedSiteDialogComponent', () => {
238238

239239
it('should handle missing global settings gracefully', () => {
240240
component['globalAutoBreakSettings'] = null;
241-
241+
242242
component.copyBreakSettings('monday');
243-
243+
244244
// Should not throw error and should not modify values
245245
const mondayBreak = component.assignedSiteForm.get('autoBreakSettings')?.get('monday');
246246
expect(mondayBreak).toBeDefined();
@@ -250,39 +250,39 @@ describe('AssignedSiteDialogComponent', () => {
250250
describe('Data Change Detection', () => {
251251
it('should detect when data has changed', () => {
252252
component.ngOnInit();
253-
253+
254254
expect(component.hasDataChanged()).toBe(false);
255-
255+
256256
component.data.useGoogleSheetAsDefault = true;
257-
257+
258258
expect(component.hasDataChanged()).toBe(true);
259259
});
260260
});
261261

262262
describe('Time Field Update', () => {
263263
it('should set minutes correctly from time string', () => {
264264
component.ngOnInit();
265-
265+
266266
component.setMinutes('08:30', 'startMonday');
267-
267+
268268
expect(component.data['startMonday']).toBe(510); // 8*60 + 30
269269
});
270270

271271
it('should set minutes to 0 when empty value provided', () => {
272272
component.ngOnInit();
273273
component.data['startMonday'] = 480;
274-
274+
275275
component.setMinutes('', 'startMonday');
276-
276+
277277
expect(component.data['startMonday']).toBe(0);
278278
});
279279

280280
it('should handle different time formats', () => {
281281
component.ngOnInit();
282-
282+
283283
component.setMinutes('12:00', 'startMonday');
284284
expect(component.data['startMonday']).toBe(720); // 12*60
285-
285+
286286
component.setMinutes('00:30', 'endMonday');
287287
expect(component.data['endMonday']).toBe(30);
288288
});

eform-client/src/app/plugins/modules/time-planning-pn/components/plannings/time-plannings-table/time-plannings-table.component.html

Lines changed: 33 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,21 @@
1717
<ng-container *ngIf="row['avatarUrl'] === null">
1818
<div class="progress-circle" [style.--percentage]="row['percentageCompleted']">
1919
<div class="avatar" [style.background-image]="'url(https://www.gravatar.com/avatar/?d=retro&s=32)'"></div>
20+
<ng-container *ngIf="row['softwareVersionIsValid'] === false">
21+
<span [matTooltip]="'Needs update!' | translate " class="material-symbols-outlined">
22+
<mat-icon class="red-warning-avatar-icon">error</mat-icon>
23+
</span>
24+
</ng-container>
2025
</div>
2126
</ng-container>
2227
<ng-container *ngIf="row['avatarUrl'] !== null">
2328
<div class="progress-circle" [style.--percentage]="row['percentageCompleted']">
2429
<div class="avatar" [style.background-image]="'url(' + row['avatarUrl'] + ')'"></div>
30+
<ng-container *ngIf="row['softwareVersionIsValid'] === false">
31+
<span [matTooltip]="'Needs update!' | translate " class="material-symbols-outlined">
32+
<mat-icon class="red-warning-avatar-icon">error</mat-icon>
33+
</span>
34+
</ng-container>
2535
</div>
2636
</ng-container>
2737
<br>
@@ -57,11 +67,6 @@
5767
</span>
5868
</ng-container>
5969
{{row['softwareVersion']}}
60-
<div *ngIf="row['softwareVersionIsValid'] === false">
61-
<span [matTooltip]="'Needs update!' | translate " class="material-symbols-outlined">
62-
<mat-icon class="neutral-icon red-text">error</mat-icon>
63-
</span>
64-
</div>
6570
</div>
6671
</div>
6772
</div>
@@ -74,11 +79,21 @@
7479
<ng-container *ngIf="row['avatarUrl'] === null">
7580
<div class="progress-circle" [style.--percentage]="row['percentageCompleted']">
7681
<div class="avatar" [style.background-image]="'url(https://www.gravatar.com/avatar/?d=retro&s=32)'"></div>
82+
<ng-container *ngIf="row['softwareVersionIsValid'] === false">
83+
<span [matTooltip]="'Needs update!' | translate " class="material-symbols-outlined">
84+
<mat-icon class="red-warning-avatar-icon">error</mat-icon>
85+
</span>
86+
</ng-container>
7787
</div>
7888
</ng-container>
7989
<ng-container *ngIf="row['avatarUrl'] !== null">
8090
<div class="progress-circle" [style.--percentage]="row['percentageCompleted']">
8191
<div class="avatar" [style.background-image]="'url(' + row['avatarUrl'] + ')'"></div>
92+
<ng-container *ngIf="row['softwareVersionIsValid'] === false">
93+
<span [matTooltip]="'Needs update!' | translate " class="material-symbols-outlined">
94+
<mat-icon class="red-warning-avatar-icon">error</mat-icon>
95+
</span>
96+
</ng-container>
8297
</div>
8398
</ng-container>
8499
<br>
@@ -113,11 +128,6 @@
113128
</span>
114129
</ng-container>
115130
{{row['softwareVersion']}}
116-
<div *ngIf="row['softwareVersionIsValid'] === false">
117-
<span [matTooltip]="'Needs update!' | translate " class="material-symbols-outlined" >
118-
<mat-icon class="neutral-icon red-text">error</mat-icon>
119-
</span>
120-
</div>
121131
</div>
122132
</div>
123133
</div>
@@ -134,25 +144,31 @@
134144
<div class="plan-text" *ngIf="row.planningPrDayModels[col.field]?.plannedStartOfShift1 !== 0">
135145
<span class="{{ getCellTextColor(row, col.field) }}" id="firstShift{{index}}_{{col.field}}">
136146
<mat-icon class="neutral-icon" [matTooltip]="'Planned working hours' | translate ">calendar_month</mat-icon>
137-
{{ convertMinutesToTime(row.planningPrDayModels[col.field]?.plannedStartOfShift1) }} -
138-
{{ convertMinutesToTime(row.planningPrDayModels[col.field]?.plannedEndOfShift1) }} /
139-
{{ convertMinutesToTime(row.planningPrDayModels[col.field]?.plannedBreakOfShift1) }}
147+
<strong>
148+
{{ convertMinutesToTime(row.planningPrDayModels[col.field]?.plannedStartOfShift1) }} -
149+
{{ convertMinutesToTime(row.planningPrDayModels[col.field]?.plannedEndOfShift1) }} /
150+
{{ convertMinutesToTime(row.planningPrDayModels[col.field]?.plannedBreakOfShift1) }}
151+
</strong>
140152
</span>
141153
</div>
142154

143155
<div class="plan-text" *ngIf="row.planningPrDayModels[col.field]?.plannedStartOfShift1 === 0 && row.planningPrDayModels[col.field]?.plannedEndOfShift1 !== 0 ">
144156
<span class="{{ getCellTextColor(row, col.field) }}" id="firstShift{{index}}_{{col.field}}">
145157
<mat-icon class="neutral-icon" [matTooltip]="'Planned working hours' | translate ">calendar_month</mat-icon>
146-
{{ convertMinutesToTime(row.planningPrDayModels[col.field]?.plannedStartOfShift1) }} -
147-
{{ convertMinutesToTime(row.planningPrDayModels[col.field]?.plannedEndOfShift1) }} /
148-
{{ convertMinutesToTime(row.planningPrDayModels[col.field]?.plannedBreakOfShift1) }}
158+
<strong>
159+
{{ convertMinutesToTime(row.planningPrDayModels[col.field]?.plannedStartOfShift1) }} -
160+
{{ convertMinutesToTime(row.planningPrDayModels[col.field]?.plannedEndOfShift1) }} /
161+
{{ convertMinutesToTime(row.planningPrDayModels[col.field]?.plannedBreakOfShift1) }}
162+
</strong>
149163
</span>
150164
</div>
151165

152166
<div class="plan-text" *ngIf="row.planningPrDayModels[col.field]?.plannedStartOfShift1 === 0 && row.planningPrDayModels[col.field]?.plannedEndOfShift1 === 0 && row.planningPrDayModels[col.field]?.planHours !== 0">
153167
<span class="{{ getCellTextColor(row, col.field) }}" id="plannedHours{{index}}_{{col.field}}">
154168
<mat-icon class="neutral-icon" [matTooltip]="'Planned working hours' | translate ">calendar_month</mat-icon>
155-
{{ convertHoursToTime(row.planningPrDayModels[col.field]?.planHours) }}
169+
<strong>
170+
{{ convertHoursToTime(row.planningPrDayModels[col.field]?.planHours) }}
171+
</strong>
156172
</span>
157173
</div>
158174

eform-client/src/app/plugins/modules/time-planning-pn/components/plannings/time-plannings-table/time-plannings-table.component.scss

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
.comment {
1212
display: flex;
13+
max-width: 250px;
1314
}
1415

1516
.first-column {
@@ -21,17 +22,18 @@
2122
}
2223

2324
.time-dashboard table td {
24-
background-color: white;
25-
border-right: 1px solid #EBEFF2;
26-
border-bottom: 1px solid #EBEFF2;
27-
25+
background-color: var(--tp-td-bg);
26+
border-right: 1px solid var(--tp-border);
27+
border-bottom: 1px solid var(--tp-border);
28+
color: var(--tp-text);
2829
}
2930

3031
.time-dashboard table tr th {
31-
background-color: #f7f9fa !important;
32+
background-color: var(--tp-th-bg) !important;
3233
font-size: 14px;
3334
font-weight: 500;
34-
border-right: 1px solid #EBEFF2;
35-
border-top: 1px solid #EBEFF2;
36-
border-left: 1px solid #EBEFF2;
35+
border-right: 1px solid var(--tp-border);
36+
border-top: 1px solid var(--tp-border);
37+
border-left: 1px solid var(--tp-border);
38+
color: var(--tp-text);
3739
}

eform-client/src/app/plugins/modules/time-planning-pn/components/plannings/time-plannings-table/time-plannings-table.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ export class TimePlanningsTableComponent implements OnInit, OnChanges {
204204
// Case 1: Has planned hours
205205
if (planHours > 0) {
206206
if (workDayStarted) {
207-
return workDayEnded ? 'white-text' : 'red-text';
207+
return workDayEnded ? 'black-text' : 'red-text';
208208
} else {
209209
return isInOlderThanToday ? 'red-text' : 'black-text';
210210
}

0 commit comments

Comments
 (0)