Skip to content

Commit

Permalink
Inject for admin lti config
Browse files Browse the repository at this point in the history
  • Loading branch information
raffifasaro committed Nov 30, 2024
1 parent 39333d6 commit e751ddd
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 19 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { AlertService } from 'app/core/util/alert.service';
import { Component, OnInit } from '@angular/core';
import { Component, OnInit, inject } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { finalize } from 'rxjs';
import { FormControl, FormGroup } from '@angular/forms';
Expand All @@ -12,6 +12,11 @@ import { LtiConfigurationService } from 'app/admin/lti-configuration/lti-configu
templateUrl: './edit-lti-configuration.component.html',
})
export class EditLtiConfigurationComponent implements OnInit {
private route = inject(ActivatedRoute);
private ltiConfigurationService = inject(LtiConfigurationService);
private router = inject(Router);
private alertService = inject(AlertService);

platform: LtiPlatformConfiguration;
platformConfigurationForm: FormGroup;

Expand All @@ -22,13 +27,6 @@ export class EditLtiConfigurationComponent implements OnInit {
faSave = faSave;
faPlus = faPlus;

constructor(
private route: ActivatedRoute,
private ltiConfigurationService: LtiConfigurationService,
private router: Router,
private alertService: AlertService,
) {}

/**
* Gets the configuration for the course encoded in the route and prepares the form
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component, OnInit } from '@angular/core';
import { Component, OnInit, inject } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { Course } from 'app/entities/course.model';
import { faExclamationTriangle, faPencilAlt, faPlus, faSort, faTrash, faWrench } from '@fortawesome/free-solid-svg-icons';
Expand All @@ -17,6 +17,12 @@ import { combineLatest } from 'rxjs';
templateUrl: './lti-configuration.component.html',
})
export class LtiConfigurationComponent implements OnInit {
private router = inject(Router);
private ltiConfigurationService = inject(LtiConfigurationService);
private sortService = inject(SortService);
private alertService = inject(AlertService);
private activatedRoute = inject(ActivatedRoute);

course: Course;
platforms: LtiPlatformConfiguration[];
ascending!: boolean;
Expand All @@ -40,14 +46,6 @@ export class LtiConfigurationComponent implements OnInit {
private dialogErrorSource = new Subject<string>();
dialogError$ = this.dialogErrorSource.asObservable();

constructor(
private router: Router,
private ltiConfigurationService: LtiConfigurationService,
private sortService: SortService,
private alertService: AlertService,
private activatedRoute: ActivatedRoute,
) {}

/**
* Gets the configuration for the course encoded in the route and fetches the exercises
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { Injectable } from '@angular/core';
import { Injectable, inject } from '@angular/core';
import { HttpClient, HttpParams, HttpResponse } from '@angular/common/http';
import { Observable } from 'rxjs';
import { LtiPlatformConfiguration } from 'app/admin/lti-configuration/lti-configuration.model';
import { createRequestOption } from 'app/shared/util/request.util';

@Injectable({ providedIn: 'root' })
export class LtiConfigurationService {
constructor(private http: HttpClient) {}
private http = inject(HttpClient);

/**
* Sends a GET request to retrieve all lti platform configurations
Expand Down

0 comments on commit e751ddd

Please sign in to comment.