Skip to content

Commit

Permalink
- Hotfixed a problem where the Pausenregelung was not set if you used…
Browse files Browse the repository at this point in the history
… SISOSIGN before the update to v2.3.0
  • Loading branch information
moritzluedtke committed Jan 22, 2021
1 parent 6203058 commit 68c6a36
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sisosign",
"version": "2.3.0",
"version": "2.3.1",
"scripts": {
"ng": "ng",
"clean": "rimraf ./dist",
Expand Down
13 changes: 12 additions & 1 deletion src/app/components/main-calc/main-calc.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -396,13 +396,20 @@ export class MainCalcComponent implements OnInit {

public loadDefaultValuesFromLocalStorage(): boolean {
const pausenlaenge = localStorage.getItem(LocalStorageKeys.PAUSENLAENGE_KEY);
this.selectedPausenregelung = Pausenregelung[localStorage.getItem(LocalStorageKeys.PAUSENREGELUNG_KEY)];
const savedPausenregelung = Pausenregelung[localStorage.getItem(LocalStorageKeys.PAUSENREGELUNG_KEY)];
const taeglicheArbeitszeitString = localStorage.getItem(LocalStorageKeys.TAEGLICHE_ARBEITSZEIT_KEY);

this.loadJetztOptionActivatedByDefault();
this.loadWasWaereWennActivated();
this.loadEinstempelzeit();

if (savedPausenregelung === undefined) {
this.selectedPausenregelung = Pausenregelung.CLASSIC;
this.savePausenregelungToLocalStorage();
} else {
this.selectedPausenregelung = savedPausenregelung;
}

if (Util.isNotEmpty(pausenlaenge)
&& Util.isNotEmpty(taeglicheArbeitszeitString)) {
this.pauseInMinutes = Number(pausenlaenge);
Expand Down Expand Up @@ -450,6 +457,10 @@ export class MainCalcComponent implements OnInit {
localStorage.setItem(LocalStorageKeys.LAST_UPDATE_ON_EINSTEMPELZEIT_KEY, new Date().toISOString());
}

private savePausenregelungToLocalStorage() {
localStorage.setItem(LocalStorageKeys.PAUSENREGELUNG_KEY, String(this.selectedPausenregelung));
}

private updateRegelarbeitszeit(taeglicheArbeitszeitString: string) {
this.regelarbeitszeitNetto = TimeUtil.parseRawTime(taeglicheArbeitszeitString);
TimeUtil.addHoursAndMinutesTo(this.regelarbeitszeitNetto, 0, this.pauseInMinutes, this.regelarbeitszeitPlusMittagspause);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ <h2 style="margin-bottom: 28px; margin-top: 6px; font-size: 1.9em" fxLayoutAlign
style="font-size: 1.4em"
(change)="checkForIllegalArbeitszeitInput()"
placeholder="Tägliche Arbeitszeit (hh:mm)">
<mat-hint>6:00h bis 10h möglich</mat-hint>
<mat-hint>6:00h bis 9:59h möglich</mat-hint>
</mat-form-field>

<div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
import { LocalStorageKeys } from '../../global-constants/local-storage-keys.model';
import { Util } from '../../util/util.component';
import { TimeUtil } from '../../util/time-util.component';
import { Pausenregelung } from '../../model/pausenregelung.model';

@Component({
selector: 'app-settings-dialog',
Expand All @@ -28,7 +29,7 @@ export class SettingsDialogComponent implements OnInit {
this.taeglicheArbeitszeit = localStorage.getItem(LocalStorageKeys.TAEGLICHE_ARBEITSZEIT_KEY);
this.taeglicheArbeitszeitInput = this.taeglicheArbeitszeit;
this.pausenlaenge = localStorage.getItem(LocalStorageKeys.PAUSENLAENGE_KEY);
this.selectedPausenregelung = localStorage.getItem(LocalStorageKeys.PAUSENREGELUNG_KEY);
this.selectedPausenregelung = Pausenregelung[localStorage.getItem(LocalStorageKeys.PAUSENREGELUNG_KEY)];
this.isJetztOptionActivatedByDefault = JSON.parse(localStorage.getItem(LocalStorageKeys.JETZT_OPTION_ACTIVATED_BY_DEFAULT_KEY));
}

Expand Down

0 comments on commit 68c6a36

Please sign in to comment.