Skip to content

Commit

Permalink
refactor backlink loading
Browse files Browse the repository at this point in the history
  • Loading branch information
Ramon Spahr committed May 25, 2021
1 parent 7414391 commit fdd0b67
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { ChangeDetectionStrategy, Component, OnInit } from '@angular/core';
import { EditAbsencesStateService } from '../../services/edit-absences-state.service';
import { CONFIRM_ABSENCES_SERVICE } from 'src/app/shared/tokens/confirm-absences-service';
import { STUDENT_PROFILE_BACKLINK } from 'src/app/shared/tokens/student-profile-backlink';

@Component({
selector: 'erz-edit-absences',
Expand All @@ -12,6 +13,7 @@ import { CONFIRM_ABSENCES_SERVICE } from 'src/app/shared/tokens/confirm-absences
provide: CONFIRM_ABSENCES_SERVICE,
useExisting: EditAbsencesStateService,
},
{ provide: STUDENT_PROFILE_BACKLINK, useValue: '/edit-absences' },
],
changeDetection: ChangeDetectionStrategy.OnPush,
})
Expand Down
4 changes: 0 additions & 4 deletions src/app/edit-absences/edit-absences.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { EditAbsencesComponent } from './components/edit-absences/edit-absences.
import { EditAbsencesHeaderComponent } from './components/edit-absences-header/edit-absences-header.component';
import { EditAbsencesListComponent } from './components/edit-absences-list/edit-absences-list.component';
import { EditAbsencesEditComponent } from './components/edit-absences-edit/edit-absences-edit.component';
import { STUDENT_PROFILE_BACKLINK } from '../shared/tokens/student-profile-backlink';

@NgModule({
declarations: [
Expand All @@ -15,9 +14,6 @@ import { STUDENT_PROFILE_BACKLINK } from '../shared/tokens/student-profile-backl
EditAbsencesListComponent,
EditAbsencesEditComponent,
],
providers: [
{ provide: STUDENT_PROFILE_BACKLINK, useValue: '/edit-absences' },
],
imports: [SharedModule, EditAbsencesRoutingModule],
})
export class EditAbsencesModule {}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Component, OnInit, ChangeDetectionStrategy } from '@angular/core';

import { EvaluateAbsencesStateService } from '../../services/evaluate-absences-state.service';
import { CONFIRM_ABSENCES_SERVICE } from 'src/app/shared/tokens/confirm-absences-service';
import { STUDENT_PROFILE_BACKLINK } from 'src/app/shared/tokens/student-profile-backlink';

@Component({
selector: 'erz-evaluate-absences',
Expand All @@ -14,6 +15,7 @@ import { CONFIRM_ABSENCES_SERVICE } from 'src/app/shared/tokens/confirm-absences
provide: CONFIRM_ABSENCES_SERVICE,
useExisting: EvaluateAbsencesStateService,
},
{ provide: STUDENT_PROFILE_BACKLINK, useValue: '/evaluate-absences' },
],
})
export class EvaluateAbsencesComponent implements OnInit {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { takeUntil } from 'rxjs/operators';
import { PresenceControlStateService } from '../../services/presence-control-state.service';
import { LessonPresencesUpdateService } from 'src/app/shared/services/lesson-presences-update.service';
import { CONFIRM_ABSENCES_SERVICE } from 'src/app/shared/tokens/confirm-absences-service';
import { STUDENT_PROFILE_BACKLINK } from 'src/app/shared/tokens/student-profile-backlink';

@Component({
selector: 'erz-presence-control',
Expand All @@ -21,6 +22,7 @@ import { CONFIRM_ABSENCES_SERVICE } from 'src/app/shared/tokens/confirm-absences
provide: CONFIRM_ABSENCES_SERVICE,
useExisting: PresenceControlStateService,
},
{ provide: STUDENT_PROFILE_BACKLINK, useValue: '/presence-control' },
],
changeDetection: ChangeDetectionStrategy.OnPush,
})
Expand Down
1 change: 0 additions & 1 deletion src/app/presence-control/presence-control.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { PresenceControlHeaderComponent } from './components/presence-control-he
import { PresenceControlListComponent } from './components/presence-control-list/presence-control-list.component';
import { PresenceControlEntryComponent } from './components/presence-control-entry/presence-control-entry.component';
import { PresenceControlDialogComponent } from './components/presence-control-dialog/presence-control-dialog.component';
import { STUDENT_PROFILE_BACKLINK } from '../shared/tokens/student-profile-backlink';
import { PresenceControlIncidentComponent } from './components/presence-control-incident/presence-control-incident.component';

@NgModule({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,7 @@ import { ConfirmAbsencesSelectionService } from '../../services/confirm-absences
selector: 'erz-student-profile',
templateUrl: './student-profile.component.html',
styleUrls: ['./student-profile.component.scss'],
providers: [
StudentProfileAbsencesService,
{ provide: STUDENT_PROFILE_BACKLINK, useValue: '/presence-control' },
],
providers: [StudentProfileAbsencesService],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class StudentProfileComponent implements OnInit, OnDestroy {
Expand Down

0 comments on commit fdd0b67

Please sign in to comment.