Skip to content

Commit

Permalink
Add teacher full name to edit absences params #530
Browse files Browse the repository at this point in the history
  • Loading branch information
caebr authored Jul 27, 2023
1 parent b159941 commit 8b55d19
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ describe('DashboardActionsComponent', () => {
provide: StorageService,
useValue: {
getPayload(): any {
return { id_person: '123' };
return { id_person: '123', fullName: 'Stolz Zuzana' };
},
getListOfUnconfirmed() {
return of([
Expand Down Expand Up @@ -137,9 +137,6 @@ describe('DashboardActionsComponent', () => {
expect(element.textContent).toContain(
'dashboard.actions.presence-control'
);
expect(element.textContent).toContain(
'dashboard.actions.presence-control'
);
expect(element.textContent).toContain('dashboard.actions.edit-absences0');
expect(element.textContent).toContain('dashboard.actions.open-absences1');
expect(element.textContent).not.toContain('dashboard.actions.tests');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Component, Inject } from '@angular/core';
import { Settings, SETTINGS } from '../../../settings';
import { Params } from '@angular/router';
import { DashboardService } from '../../services/dashboard.service';
import { StorageService } from '../../../shared/services/storage.service';

@Component({
selector: 'erz-dashboard-actions',
Expand All @@ -11,11 +12,15 @@ import { DashboardService } from '../../services/dashboard.service';
export class DashboardActionsComponent {
constructor(
public dashboardService: DashboardService,
private storageService: StorageService,
@Inject(SETTINGS) public settings: Settings
) {}

get editAbsencesParams(): Params {
return { confirmationStates: this.settings.checkableAbsenceStateId };
return {
confirmationStates: this.settings.checkableAbsenceStateId,
teacher: this.storageService.getPayload()?.fullname,
};
}

get substitutionsAdminLink(): string {
Expand Down

0 comments on commit 8b55d19

Please sign in to comment.