Skip to content

Commit

Permalink
Reformat source with Prettier 3.0.3 #561
Browse files Browse the repository at this point in the history
  • Loading branch information
hupf committed Oct 25, 2023
1 parent 4d96034 commit a711afe
Show file tree
Hide file tree
Showing 198 changed files with 919 additions and 901 deletions.
14 changes: 7 additions & 7 deletions src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,31 @@ const routes: Routes = [
canActivate: [authGuard()],
loadChildren: () =>
import('./presence-control/presence-control.module').then(
(m) => m.PresenceControlModule
(m) => m.PresenceControlModule,
),
},
{
path: 'open-absences',
canActivate: [authGuard()],
loadChildren: () =>
import('./open-absences/open-absences.module').then(
(m) => m.OpenAbsencesModule
(m) => m.OpenAbsencesModule,
),
},
{
path: 'edit-absences',
canActivate: [authGuard()],
loadChildren: () =>
import('./edit-absences/edit-absences.module').then(
(m) => m.EditAbsencesModule
(m) => m.EditAbsencesModule,
),
},
{
path: 'evaluate-absences',
canActivate: [authGuard()],
loadChildren: () =>
import('./evaluate-absences/evaluate-absences.module').then(
(m) => m.EvaluateAbsencesModule
(m) => m.EvaluateAbsencesModule,
),
},
{
Expand All @@ -48,15 +48,15 @@ const routes: Routes = [
canActivate: [authGuard()],
loadChildren: () =>
import('./person-search/person-search.module').then(
(module) => module.PersonSearchModule
(module) => module.PersonSearchModule,
),
},
{
path: 'my-absences',
canActivate: [authGuard()],
loadChildren: () =>
import('./my-absences/my-absences.module').then(
(m) => m.MyAbsencesModule
(m) => m.MyAbsencesModule,
),
},
{
Expand All @@ -76,7 +76,7 @@ const routes: Routes = [
canActivate: [authGuard()],
loadChildren: () =>
import('./my-settings/my-settings.module').then(
(m) => m.MySettingsModule
(m) => m.MySettingsModule,
),
},
{ path: 'unauthenticated', component: UnauthenticatedComponent },
Expand Down
2 changes: 1 addition & 1 deletion src/app/app.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ describe('AppComponent', () => {
TestBed.configureTestingModule(
buildTestModuleMetadata({
declarations: [AppComponent],
})
}),
).compileComponents();
}));

Expand Down
6 changes: 3 additions & 3 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export class AppComponent {
i18n: I18nService,
private toastService: ToastService,
@Inject(SETTINGS) private settings: Settings,
@Inject(NAVIGATOR) private navigator: Navigator
@Inject(NAVIGATOR) private navigator: Navigator,
) {
this.router.initialNavigation();
i18n.initialize();
Expand All @@ -35,10 +35,10 @@ export class AppComponent {
console.error(String(error));
this.toastService.error(
'Please check the contents of the settings.js file (see Console output for more details).',
'Invalid Settings'
'Invalid Settings',
);
return EMPTY;
})
}),
)
.subscribe();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@ export class EditAbsencesEditComponent implements OnInit, OnDestroy {
absenceTypeIdErrors$ = getValidationErrors(
this.formGroup$,
this.submitted$,
'absenceTypeId'
'absenceTypeId',
);
incidentIdErrors$ = getValidationErrors(
this.formGroup$,
this.submitted$,
'incidentId'
'incidentId',
);

availableCategories = [
Expand All @@ -83,8 +83,8 @@ export class EditAbsencesEditComponent implements OnInit, OnDestroy {
map((halfDayActive) =>
halfDayActive
? this.availableCategories
: this.availableCategories.filter((c) => c !== Category.HalfDay)
)
: this.availableCategories.filter((c) => c !== Category.HalfDay),
),
);

private destroy$ = new Subject<void>();
Expand All @@ -99,7 +99,7 @@ export class EditAbsencesEditComponent implements OnInit, OnDestroy {
private dropDownItemsService: DropDownItemsRestService,
private presenceTypesService: PresenceTypesService,
private updateService: EditAbsencesUpdateService,
@Inject(SETTINGS) private settings: Settings
@Inject(SETTINGS) private settings: Settings,
) {}

ngOnInit(): void {
Expand Down Expand Up @@ -160,9 +160,9 @@ export class EditAbsencesEditComponent implements OnInit, OnDestroy {
],
absenceTypeId: [initialAbsenceTypeId, Validators.required],
incidentId: [{ value: null, disabled: true }, Validators.required],
})
}),
),
shareReplay(1)
shareReplay(1),
);
}

Expand All @@ -172,14 +172,14 @@ export class EditAbsencesEditComponent implements OnInit, OnDestroy {
map((absenceTypes) => {
const availableTypeIds = absenceTypes.map((t) => t.Id);
const selectedTypeIds = uniq(
this.state.selected.map((e) => e.TypeRef.Id)
this.state.selected.map((e) => e.TypeRef.Id),
);
return selectedTypeIds.length === 1 &&
selectedTypeIds[0] != null &&
availableTypeIds.includes(selectedTypeIds[0])
? selectedTypeIds[0]
: null;
})
}),
);
}

Expand Down Expand Up @@ -237,18 +237,18 @@ export class EditAbsencesEditComponent implements OnInit, OnDestroy {
category,
confirmationValue,
absenceTypeId,
incidentId
)
incidentId,
),
),
finalize(() => this.saving$.next(false))
finalize(() => this.saving$.next(false)),
)
.subscribe(this.onSaveSuccess.bind(this));
}

private onSaveSuccess(): void {
this.state.resetSelection();
this.toastService.success(
this.translate.instant('edit-absences.edit.save-success')
this.translate.instant('edit-absences.edit.save-success'),
);
this.navigateBack(true);
}
Expand All @@ -265,7 +265,7 @@ export class EditAbsencesEditComponent implements OnInit, OnDestroy {
}

private sortAbsenceConfirmationStates(
states: ReadonlyArray<DropDownItem>
states: ReadonlyArray<DropDownItem>,
): ReadonlyArray<DropDownItem> {
return states.slice().sort((a, b) => {
if (a.Key === this.settings.excusedAbsenceStateId) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ describe('EditAbsencesHeaderComponent', () => {
},
},
],
})
}),
).compileComponents();
}));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ describe('EditAbsencesListComponent', () => {
providers: [
{ provide: EditAbsencesStateService, useValue: stateServiceMock },
],
})
}),
).compileComponents();
}));

Expand All @@ -55,10 +55,10 @@ function buildPresenceControlEntry(): PresenceControlEntry {
5837_4508,
new Date('2019-08-12T14:35:00'),
new Date('2019-08-12T15:20:00'),
'2-1-Biologie-MNW-2019/20-22a'
'2-1-Biologie-MNW-2019/20-22a',
),
null,
null
null,
);

Object.defineProperty(presenceControlEntry, 'settings', {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export class EditAbsencesListComponent
public state: EditAbsencesStateService,
public selectionService: EditAbsencesSelectionService,
private scrollPosition: ScrollPositionService,
private route: ActivatedRoute
private route: ActivatedRoute,
) {}

ngOnInit(): void {
Expand All @@ -61,7 +61,7 @@ export class EditAbsencesListComponent
.pipe(
take(1),
map(({ reload }) => reload),
filter(isTruthy)
filter(isTruthy),
)
.subscribe(() => this.state.resetEntries());
}
Expand All @@ -78,7 +78,7 @@ export class EditAbsencesListComponent
this.state.entries$
.pipe(take(1))
.subscribe((entries) =>
this.selectionService.clear(checked ? entries : null)
this.selectionService.clear(checked ? entries : null),
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ describe('EditAbsencesComponent', () => {
EditAbsencesHeaderComponent,
EditAbsencesListComponent,
],
})
}),
).compileComponents();
}));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ import { buildTestModuleMetadata } from 'src/spec-helpers';
describe('EditAbsencesStateService', () => {
beforeEach(() =>
TestBed.configureTestingModule(
buildTestModuleMetadata({ providers: [EditAbsencesStateService] })
)
buildTestModuleMetadata({ providers: [EditAbsencesStateService] }),
),
);

it('should be created', () => {
const service: EditAbsencesStateService = TestBed.inject(
EditAbsencesStateService
EditAbsencesStateService,
);
expect(service).toBeTruthy();
});
Expand Down
16 changes: 8 additions & 8 deletions src/app/edit-absences/services/edit-absences-state.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export class EditAbsencesStateService
presenceTypes$ = this.loadPresenceTypes().pipe(shareReplay(1));
absenceConfirmationStates$ = this.loadAbsenceConfirmationStates().pipe(
map(sortDropDownItemsByValue),
shareReplay(1)
shareReplay(1),
);

presenceControlEntries$ = combineLatest([
Expand All @@ -64,14 +64,14 @@ export class EditAbsencesStateService
@Inject(SETTINGS) settings: Settings,
private lessonPresencesService: LessonPresencesRestService,
private presenceTypesService: PresenceTypesService,
private dropDownItemsService: DropDownItemsRestService
private dropDownItemsService: DropDownItemsRestService,
) {
super(location, loadingService, sortService, settings, '/edit-absences');

this.queryParamsString$
.pipe(takeUntil(this.destroy$))
.subscribe(
(returnparams) => (this.confirmBackLinkParams = { returnparams })
(returnparams) => (this.confirmBackLinkParams = { returnparams }),
);
}

Expand Down Expand Up @@ -106,22 +106,22 @@ export class EditAbsencesStateService
filterValue.dateTo ||
filterValue.presenceTypes ||
filterValue.confirmationStates ||
filterValue.incidentTypes
filterValue.incidentTypes,
);
}

protected loadEntries(
filterValue: EditAbsencesFilter,
_sorting: null,
offset: number
offset: number,
): Observable<Paginated<ReadonlyArray<LessonPresence>>> {
const params: Dict<string> = {
sort: 'StudentFullName.asc,LessonDateTimeFrom.asc',
};

return this.loadingService.load(
this.lessonPresencesService.getFilteredList(filterValue, offset, params),
PAGE_LOADING_CONTEXT
PAGE_LOADING_CONTEXT,
);
}

Expand All @@ -131,15 +131,15 @@ export class EditAbsencesStateService

private loadPresenceTypes(): Observable<ReadonlyArray<PresenceType>> {
return this.loadingService.load(
this.presenceTypesService.activePresenceTypes$
this.presenceTypesService.activePresenceTypes$,
);
}

private loadAbsenceConfirmationStates(): Observable<
ReadonlyArray<DropDownItem>
> {
return this.loadingService.load(
this.dropDownItemsService.getAbsenceConfirmationStates()
this.dropDownItemsService.getAbsenceConfirmationStates(),
);
}
}
Loading

0 comments on commit a711afe

Please sign in to comment.