Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Development: Update LTI components to use Angular 18 practices #9908

Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
85274d3
push branch
raffifasaro Nov 29, 2024
41aa1f8
Inject migration
raffifasaro Nov 29, 2024
56dae8c
Standalone migration
raffifasaro Nov 29, 2024
58809be
inject launch component
raffifasaro Nov 29, 2024
29249df
inject dynamic reg comp
raffifasaro Nov 29, 2024
71769f5
signal for course card
raffifasaro Nov 29, 2024
39333d6
Inject for lti13 comps
raffifasaro Nov 30, 2024
e751ddd
Inject for admin lti config
raffifasaro Nov 30, 2024
cfc30cc
Inject for course lti comps
raffifasaro Nov 30, 2024
ad4c74b
Overview lti comps
raffifasaro Nov 30, 2024
64eaf0d
Merge branch 'develop' into chore/performance/angular-18-signal-migra…
raffifasaro Dec 1, 2024
13bf094
fix input
raffifasaro Dec 1, 2024
161ec3c
Merge remote-tracking branch 'origin/chore/performance/angular-18-sig…
raffifasaro Dec 1, 2024
c752611
signals input course card fix
raffifasaro Dec 1, 2024
cb1a74c
Fix tests
raffifasaro Dec 3, 2024
4fc3c75
Fix tests 2
raffifasaro Dec 3, 2024
4fbc32f
Merge branch 'develop' into chore/performance/angular-18-signal-migra…
raffifasaro Dec 3, 2024
afd9091
Merge branch 'develop' into chore/performance/angular-18-signal-migra…
raffifasaro Dec 3, 2024
a6dc93a
Merge branch 'develop' into chore/performance/angular-18-signal-migra…
raffifasaro Dec 4, 2024
7166c78
Merge branch 'develop' into chore/performance/angular-18-signal-migra…
raffifasaro Dec 5, 2024
b65fa21
Fixes
raffifasaro Dec 5, 2024
9851a3b
Merge remote-tracking branch 'origin/chore/performance/angular-18-sig…
raffifasaro Dec 5, 2024
e5c8993
Standalone course lti components + fixes
raffifasaro Dec 5, 2024
0381c2c
test fixes
raffifasaro Dec 5, 2024
1cd64aa
fix input required
raffifasaro Dec 6, 2024
68d7843
Merge branch 'develop' into chore/performance/angular-18-signal-migra…
raffifasaro Dec 6, 2024
d407cb4
reverse input required
raffifasaro Dec 6, 2024
0c60da5
Merge remote-tracking branch 'origin/chore/performance/angular-18-sig…
raffifasaro Dec 6, 2024
24100e5
fixes
raffifasaro Dec 6, 2024
3c3d5c2
fix httpclientmodule
raffifasaro Dec 6, 2024
f61ab38
Merge branch 'develop' into chore/performance/angular-18-signal-migra…
raffifasaro Dec 7, 2024
e803712
Merge branch 'develop' into chore/performance/angular-18-signal-migra…
raffifasaro Dec 9, 2024
87cc902
Merge branch 'develop' into chore/performance/angular-18-signal-migra…
raffifasaro Dec 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/main/webapp/app/lti/lti-course-card.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,16 @@ import { Component, Input, OnChanges } from '@angular/core';
import { Course } from 'app/entities/course.model';
import { ARTEMIS_DEFAULT_COLOR } from 'app/app.constants';
import { CachingStrategy } from 'app/shared/image/secured-image.component';
import { RouterLink } from '@angular/router';
import { NgStyle } from '@angular/common';
import { ArtemisSharedModule } from 'app/shared/shared.module';

@Component({
selector: 'jhi-overview-lti-course-card',
templateUrl: './lti-course-card.component.html',
styleUrls: ['../overview/course-card.scss'],
standalone: true,
imports: [RouterLink, NgStyle, ArtemisSharedModule],
raffifasaro marked this conversation as resolved.
Show resolved Hide resolved
})
export class LtiCourseCardComponent implements OnChanges {
readonly ARTEMIS_DEFAULT_COLOR = ARTEMIS_DEFAULT_COLOR;
Expand Down
9 changes: 7 additions & 2 deletions src/main/webapp/app/lti/lti.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,13 @@ import { LtiCourseCardComponent } from 'app/lti/lti-course-card.component';
const LTI_LAUNCH_ROUTES = [...ltiLaunchState];

@NgModule({
imports: [RouterModule.forChild(LTI_LAUNCH_ROUTES), ArtemisCoreModule, ArtemisSharedModule, FormsModule, ArtemisSharedComponentModule, ArtemisSharedLibsModule],
declarations: [
imports: [
RouterModule.forChild(LTI_LAUNCH_ROUTES),
ArtemisCoreModule,
ArtemisSharedModule,
FormsModule,
ArtemisSharedComponentModule,
ArtemisSharedLibsModule,
Lti13ExerciseLaunchComponent,
Lti13DynamicRegistrationComponent,
Lti13DeepLinkingComponent,
Expand Down
8 changes: 8 additions & 0 deletions src/main/webapp/app/lti/lti13-deep-linking.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,18 @@ import { Course } from 'app/entities/course.model';
import { AlertService } from 'app/core/util/alert.service';
import { onError } from 'app/shared/util/global.utils';
import { SessionStorageService } from 'ngx-webstorage';
import { ArtemisSharedModule } from 'app/shared/shared.module';
import { TranslateDirective } from '../shared/language/translate.directive';
import { ArtemisSharedComponentModule } from '../shared/components/shared-component.module';
import { ArtemisSharedCommonModule } from '../shared/shared-common.module';
import { FaIconComponent } from '@fortawesome/angular-fontawesome';
import { FormsModule } from '@angular/forms';

@Component({
selector: 'jhi-deep-linking',
templateUrl: './lti13-deep-linking.component.html',
standalone: true,
imports: [ArtemisSharedModule, TranslateDirective, ArtemisSharedComponentModule, ArtemisSharedCommonModule, FaIconComponent, FormsModule],
})
export class Lti13DeepLinkingComponent implements OnInit {
courseId: number;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { HttpClient, HttpParams } from '@angular/common/http';
import { TranslateDirective } from '../shared/language/translate.directive';

@Component({
selector: 'jhi-dynamic-registration',
templateUrl: './lti13-dynamic-registration.component.html',
standalone: true,
imports: [TranslateDirective],
})
export class Lti13DynamicRegistrationComponent implements OnInit {
courseId: number;
Expand Down
3 changes: 3 additions & 0 deletions src/main/webapp/app/lti/lti13-exercise-launch.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { captureException } from '@sentry/angular';
import { SessionStorageService } from 'ngx-webstorage';
import { LtiService } from 'app/shared/service/lti.service';
import { Theme, ThemeService } from 'app/core/theme/theme.service';
import { TranslateDirective } from '../shared/language/translate.directive';

type LtiLaunchResponse = {
targetLinkUri: string;
Expand All @@ -16,6 +17,8 @@ type LtiLaunchResponse = {
@Component({
selector: 'jhi-lti-exercise-launch',
templateUrl: './lti13-exercise-launch.component.html',
standalone: true,
imports: [TranslateDirective],
raffifasaro marked this conversation as resolved.
Show resolved Hide resolved
})
export class Lti13ExerciseLaunchComponent implements OnInit {
isLaunching: boolean;
Expand Down
18 changes: 11 additions & 7 deletions src/main/webapp/app/lti/lti13-select-content.component.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,28 @@
import { Component, ElementRef, NgZone, OnInit, SecurityContext, ViewChild } from '@angular/core';
import { Component, ElementRef, NgZone, OnInit, SecurityContext, ViewChild, inject } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { DomSanitizer } from '@angular/platform-browser';
import { TranslateDirective } from '../shared/language/translate.directive';
import { FormsModule } from '@angular/forms';
import { ArtemisSharedPipesModule } from '../shared/pipes/shared-pipes.module';

/**
* Component responsible for sending deep linking content.
* It reads the necessary parameters from the route, sanitizes return URL,
* and automatically submits a form with the relevant data.
* According to LTI documentation auto submit form must be used.
*/

@Component({
selector: 'jhi-select-exercise',
templateUrl: './lti13-select-content.component.html',
standalone: true,
imports: [TranslateDirective, FormsModule, ArtemisSharedPipesModule],
})
export class Lti13SelectContentComponent implements OnInit {
private route = inject(ActivatedRoute);
private sanitizer = inject(DomSanitizer);
private zone = inject(NgZone);

jwt: string;
id: string;
actionLink: string;
Expand All @@ -21,12 +31,6 @@ export class Lti13SelectContentComponent implements OnInit {
@ViewChild('deepLinkingForm', { static: false })
deepLinkingForm?: ElementRef;

constructor(
private route: ActivatedRoute,
private sanitizer: DomSanitizer,
private zone: NgZone,
) {}

/**
* Initializes the component.
* - Retrieves query parameters from the route snapshot.
Expand Down
4 changes: 4 additions & 0 deletions src/main/webapp/app/lti/lti13-select-course.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@ import { CourseManagementService } from '../course/manage/course-management.serv
import { SessionStorageService } from 'ngx-webstorage';
import { OnlineCourseDtoModel } from 'app/lti/online-course-dto.model';
import { AlertService } from 'app/core/util/alert.service';
import { LtiCourseCardComponent } from './lti-course-card.component';
import { TranslateDirective } from '../shared/language/translate.directive';

@Component({
selector: 'jhi-lti-courses-overview',
templateUrl: './lti13-select-course.component.html',
standalone: true,
imports: [LtiCourseCardComponent, TranslateDirective],
})
export class LtiCoursesComponent implements OnInit {
public courses: OnlineCourseDtoModel[];
Expand Down
Loading