Skip to content

Commit a082c53

Browse files
committed
Merge branch 'stable'
2 parents 08f8e4d + 7c00de6 commit a082c53

File tree

5 files changed

+32
-10
lines changed

5 files changed

+32
-10
lines changed

eFormAPI/Plugins/TimePlanning.Pn/TimePlanning.Pn/Services/TimePlanningSettingService/TimeSettingService.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -356,10 +356,11 @@ planRegistrationForToday is
356356
var currentUserAsync = await userService.GetCurrentUserAsync();
357357
var currentUser = baseDbContext.Users
358358
.Single(x => x.Id == currentUserAsync.Id);
359-
var fullName = currentUser.FirstName.Trim() + " " + currentUser.LastName.Trim();
360-
var sdkSite = await sdkContext.Sites
359+
var worker = await sdkContext.Workers
360+
.Include(x => x.SiteWorkers)
361+
.ThenInclude(x => x.Site)
361362
.Where(x => x.WorkflowState != Constants.WorkflowStates.Removed)
362-
.FirstOrDefaultAsync(x => x.Name.Replace(" ", "") == fullName.Replace(" ", ""));
363+
.FirstOrDefaultAsync(x => x.Email == currentUser.Email);
363364

364365
if (sdkSite == null)
365366
{

eform-client/cypress/e2e/plugins/time-planning-pn/h/dashboard-edit-a.spec.cy.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ describe('Dashboard edit values', () => {
3535
});
3636

3737
it('should accepts decimal values with comma', () => {
38-
cy.get('#paidOutFlex').should('have.value', '12');
39-
cy.get('#paidOutFlex').clear().type('12');
38+
cy.get('#paidOutFlex').should('have.value', '1.2');
39+
cy.get('#paidOutFlex').clear().type('1,2');
4040
});
4141

4242
it('should accepts whole numbers', () => {
43-
cy.get('#paidOutFlex').should('have.value', '12');
43+
cy.get('#paidOutFlex').should('have.value', '1.2');
4444
cy.get('#paidOutFlex').clear().type('0');
4545
});
4646

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1324,8 +1324,12 @@ export class WorkdayEntityDialogComponent implements OnInit {
13241324
plannedTimeInMinutes += this.getPlannedShiftMinutes(start, end, brk);
13251325
}
13261326

1327-
m.planHours = plannedTimeInMinutes / 60;
1328-
this.workdayForm.get('planHours')?.setValue(m.planHours, {emitEvent: false});
1327+
if (plannedTimeInMinutes !== 0) {
1328+
m.planHours = plannedTimeInMinutes / 60;
1329+
this.workdayForm.get('planHours')?.setValue(m.planHours, {emitEvent: false});
1330+
}
1331+
// m.planHours = plannedTimeInMinutes / 60;
1332+
// this.workdayForm.get('planHours')?.setValue(m.planHours, {emitEvent: false});
13291333

13301334
// Summer actual
13311335
let actualTimeInMinutes = 0;

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

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,18 @@ <h4 class="mat-card-title">Google sheet information</h4>
1717
<input matInput placeholder="Google sheet id" [(ngModel)]="settingsModel.googleSheetId">
1818
</mat-form-field>
1919
</div>
20-
20+
<div class="mt-2" *ngIf="settingsModel.googleSheetId">
21+
<a
22+
id="openGoogleSheetLink"
23+
mat-raised-button
24+
color="primary"
25+
[href]="'https://docs.google.com/spreadsheets/d/' + settingsModel.googleSheetId + '/edit'"
26+
target="_blank"
27+
rel="noopener noreferrer"
28+
>
29+
{{ 'Open Google Sheet' | translate }}
30+
</a>
31+
</div>
2132
</div>
2233
<br>
2334
<div class="row">

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import {Component, OnDestroy, OnInit} from '@angular/core';
22
import {Subscription} from 'rxjs';
33
import {TimePlanningPnSettingsService} from '../../../services';
44
import {TimePlanningSettingsModel} from '../../../models';
5+
import {selectCurrentUserIsFirstUser} from 'src/app/state';
6+
import {Store} from '@ngrx/store';
57

68
@Component({
79
selector: 'app-time-planning-settings',
@@ -13,8 +15,12 @@ export class TimePlanningSettingsComponent implements OnInit, OnDestroy {
1315
getSettings$: Subscription;
1416
settingsModel: TimePlanningSettingsModel = new TimePlanningSettingsModel();
1517
previousData: TimePlanningSettingsModel = new TimePlanningSettingsModel();
18+
public selectCurrentUserIsFirstUser$ = this.store.select(selectCurrentUserIsFirstUser);
1619

17-
constructor(private timePlanningPnSettingsService: TimePlanningPnSettingsService) {
20+
constructor(
21+
private timePlanningPnSettingsService: TimePlanningPnSettingsService,
22+
private store: Store
23+
) {
1824
this.previousData = {...this.settingsModel};
1925
}
2026
ngOnInit() {

0 commit comments

Comments
 (0)