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: Upgrade to Angular 18 #8687

Merged
merged 61 commits into from
Jun 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
2c5fdfe
update dependencies
May 24, 2024
95e25e2
fix issues after upgrade
May 24, 2024
8f18637
remove unintended code
May 24, 2024
cf0760a
refactor styling for Angular 18
JohannesWt May 28, 2024
130c740
run prettier
JohannesWt May 28, 2024
646b12f
run prettier v2
JohannesWt May 28, 2024
11fe36b
Merge branch 'develop' into chore/angular18
JohannesWt May 28, 2024
8f013f8
remove spin attribute from fa-icons
JohannesWt May 28, 2024
4a55b5c
update node engines
JohannesWt May 28, 2024
f8940b6
remove async from tests
JohannesWt May 29, 2024
4cbc465
remove async from test
JohannesWt May 29, 2024
3dfb258
more updates
Jun 1, 2024
54ce912
Merge branch 'develop' into chore/angular18
Jun 1, 2024
6506da8
additional client updates
Jun 1, 2024
b68ed7f
cleanup
Jun 1, 2024
7404d11
Merge branch 'develop' into chore/angular18
krusche Jun 4, 2024
1db9aed
Merge branch 'develop' into chore/angular18
Jun 7, 2024
aed8e14
more updates
Jun 7, 2024
28528f3
Merge branch 'develop' into chore/angular18
JohannesWt Jun 9, 2024
ffc18d6
remove unused variable
JohannesWt Jun 9, 2024
ca57f99
run prettier
JohannesWt Jun 9, 2024
a1000b3
fix tracking issue in for and fa icon spin
JohannesWt Jun 9, 2024
6c7e378
fix multiple tests failed due to Angular error NG0956
JohannesWt Jun 9, 2024
5ff37ae
fix multiple tests failed due to Angular error NG0956
JohannesWt Jun 9, 2024
a8d982b
Fix tutorial group tests
florian-glombik Jun 10, 2024
0bda119
Fix tutorial group tests
florian-glombik Jun 10, 2024
2f0f600
fix Lti13-exercise-launch.component.spec.ts tests by mocking window.l…
BBesrour Jun 10, 2024
e8edae6
Revert "fix Lti13-exercise-launch.component.spec.ts tests by mocking …
BBesrour Jun 10, 2024
035a258
fix virtual-scroll tests
coolchock Jun 10, 2024
4616faf
Fix code editor instructor integration test
pzdr7 Jun 10, 2024
9da25f4
Fix orion test
pzdr7 Jun 10, 2024
37f6612
Fix location of html comment
pzdr7 Jun 10, 2024
6cf7eee
Fix tutorial group tests
florian-glombik Jun 11, 2024
c5b0efc
Fix lti13-exercise-launch.component.spec.ts tests
sarpsahinalp Jun 11, 2024
03a4501
Fix TypeError in lti13-exercise-launch.component.spec.ts
sarpsahinalp Jun 11, 2024
a7d4a9a
Fix lti13-exercise-launch.component.spec.ts problem with window.locat…
sarpsahinalp Jun 12, 2024
e73ee5c
Merge remote-tracking branch 'origin/chore/angular18' into chore/angu…
florian-glombik Jun 12, 2024
339c705
Fix team update dialog tests
florian-glombik Jun 12, 2024
e8a8d78
Tryfix tutor assessment container test with real async
pzdr7 Jun 12, 2024
56d94ae
Tryfix CodeEditorAce file change test
pzdr7 Jun 12, 2024
f1d5f56
Tryfix CodeEditorAce error test without waitForAsync; wait for onFile…
pzdr7 Jun 12, 2024
391f2f9
Add newFeedbackLines test again
pzdr7 Jun 12, 2024
4dad2ee
Remove timeout; wait for onFeedbackLoaded
pzdr7 Jun 12, 2024
b271491
Merge branch 'develop' into chore/angular18
Jun 15, 2024
5b8ba0b
more updates
Jun 15, 2024
cc66d69
migrate from v13 to v18 NgxWebstorage
JohannesWt Jun 18, 2024
ccbffeb
fix test order and remove deprecated httpClientModule
JohannesWt Jun 18, 2024
1e541e4
track index for answerPosts
JohannesWt Jun 18, 2024
1e8bd97
Merge branch 'develop' into chore/angular18
JohannesWt Jun 18, 2024
f608d8e
upgrade core module to using v18 ngxStorage
JohannesWt Jun 18, 2024
21cf9ad
remove comment
JohannesWt Jun 18, 2024
8066779
Fix duplicate metis exercise id
pzdr7 Jun 18, 2024
8486f55
Move to front: code editor assessment test
pzdr7 Jun 18, 2024
8b0b896
Tryfix code editor container integration; use onFileChanged instead o…
pzdr7 Jun 18, 2024
42f025c
Experimental: wait for numNewMessages instead of whenStable for iris …
pzdr7 Jun 18, 2024
78bac5d
Merge branch 'develop' into chore/angular18
pzdr7 Jun 18, 2024
acf1048
Revert "Experimental: wait for numNewMessages instead of whenStable f…
pzdr7 Jun 19, 2024
04a7a55
Experimental: remove waitForAsync from iris base chatbot test
pzdr7 Jun 19, 2024
9fbd38b
Experimental: remove waitForAsync from CodeEditorContainerIntegration…
pzdr7 Jun 19, 2024
a68d0c6
Merge branch 'develop' into chore/angular18
JohannesWt Jun 19, 2024
fca2e44
add more updates and fix warning
Jun 20, 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
3 changes: 2 additions & 1 deletion angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@
"index": "src/main/webapp/index.html",
"browser": "src/main/webapp/app/app.main.ts",
"polyfills": [
"src/main/webapp/app/polyfills.ts"
"src/main/webapp/app/polyfills.ts",
"@angular/localize/init"
],
"tsConfig": "tsconfig.json",
"inlineStyleLanguage": "scss",
Expand Down
4 changes: 2 additions & 2 deletions docs/dev/setup.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ following dependencies/tools on your machine:
2. `MySQL Database Server 8 <https://dev.mysql.com/downloads/mysql>`__, or `PostgreSQL <https://www.postgresql.org/>`_:
Artemis uses Hibernate to store entities in an SQL database and Liquibase to
automatically apply schema transformations when updating Artemis.
3. `Node.js <https://nodejs.org/en/download>`__: We use Node LTS (>=20.10.0 < 21) to compile
3. `Node.js <https://nodejs.org/en/download>`__: We use Node LTS (>=20.14.0 < 21) to compile
and run the client Angular application. Depending on your system, you
can install Node either from source or as a pre-packaged bundle.
4. `Npm <https://nodejs.org/en/download>`__: We use Npm (>=10.2.3) to
4. `Npm <https://nodejs.org/en/download>`__: We use Npm (>=10.7.0) to
manage client side dependencies. Npm is typically bundled with Node.js,
but can also be installed separately.
5. ( `Graphviz <https://www.graphviz.org/download/>`__: We use Graphviz to generate graphs within exercise task
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ rootProject.name=Artemis
profile=dev

# Build properties
node_version=20.10.0
npm_version=10.2.3
node_version=20.14.0
npm_version=10.7.0

# Dependency versions
jhipster_dependencies_version=8.5.0
Expand Down
4,909 changes: 2,544 additions & 2,365 deletions package-lock.json

Large diffs are not rendered by default.

127 changes: 71 additions & 56 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,36 +13,36 @@
"node_modules"
],
"dependencies": {
"@angular/animations": "17.3.9",
"@angular/cdk": "17.3.9",
"@angular/common": "17.3.9",
"@angular/compiler": "17.3.9",
"@angular/core": "17.3.9",
"@angular/forms": "17.3.9",
"@angular/localize": "17.3.9",
"@angular/material": "17.3.9",
"@angular/platform-browser-dynamic": "17.3.9",
"@angular/platform-browser": "17.3.9",
"@angular/router": "17.3.9",
"@angular/service-worker": "17.3.9",
"@angular/animations": "18.0.3",
"@angular/cdk": "18.0.4",
"@angular/common": "18.0.3",
"@angular/compiler": "18.0.3",
"@angular/core": "18.0.3",
"@angular/forms": "18.0.3",
"@angular/localize": "18.0.3",
"@angular/material": "18.0.4",
"@angular/platform-browser-dynamic": "18.0.3",
"@angular/platform-browser": "18.0.3",
"@angular/router": "18.0.3",
"@angular/service-worker": "18.0.3",
"@ctrl/ngx-emoji-mart": "9.2.0",
"@danielmoncada/angular-datetime-picker": "17.0.0",
"@fingerprintjs/fingerprintjs": "4.3.0",
"@fingerprintjs/fingerprintjs": "4.4.1",
"@flaviosantoro92/ngx-datatable": "1.0.2",
"@fortawesome/angular-fontawesome": "0.14.1",
"@fortawesome/angular-fontawesome": "0.15.0",
"@fortawesome/fontawesome-svg-core": "6.5.2",
"@fortawesome/free-regular-svg-icons": "6.5.2",
"@fortawesome/free-solid-svg-icons": "6.5.2",
"@ls1intum/apollon": "3.3.14",
"@ng-bootstrap/ng-bootstrap": "16.0.0",
"@ng-bootstrap/ng-bootstrap": "17.0.0",
"@ngx-translate/core": "15.0.0",
"@ngx-translate/http-loader": "8.0.0",
"@sentry/angular-ivy": "7.114.0",
"@sentry/tracing": "7.114.0",
"@swimlane/ngx-charts": "20.5.0",
"@swimlane/ngx-graph": "8.3.0",
"@vscode/codicons": "0.0.36",
"ace-builds": "1.33.2",
"ace-builds": "1.35.0",
"bootstrap": "5.3.3",
"brace": "0.11.1",
"compare-versions": "6.1.0",
Expand All @@ -51,7 +51,7 @@
"dayjs": "1.11.11",
"diff-match-patch-typescript": "1.0.8",
"fast-json-patch": "3.1.1",
"dompurify": "3.1.3",
"dompurify": "3.1.5",
"export-to-csv": "1.3.0",
"franc-min": "6.2.0",
"interactjs": "1.10.27",
Expand All @@ -60,11 +60,11 @@
"jszip": "3.10.1",
"lodash-es": "4.17.21",
"mobile-drag-drop": "3.0.0-rc.0",
"monaco-editor": "0.48.0",
"ngx-infinite-scroll": "17.0.0",
"ngx-webstorage": "13.0.1",
"monaco-editor": "0.50.0",
"ngx-infinite-scroll": "18.0.0",
"ngx-webstorage": "18.0.0",
"papaparse": "5.4.1",
"posthog-js": "1.131.4",
"posthog-js": "1.139.5",
"rxjs": "7.8.1",
"showdown": "2.1.0",
"showdown-highlight": "3.1.0",
Expand All @@ -74,70 +74,85 @@
"sockjs-client": "1.6.1",
"split.js": "1.6.5",
"ts-cacheable": "1.0.10",
"tslib": "2.6.2",
"uuid": "9.0.1",
"tslib": "2.6.3",
"uuid": "10.0.0",
"webstomp-client": "1.2.6",
"xlsx": "https://cdn.sheetjs.com/xlsx-0.20.2/xlsx-0.20.2.tgz",
"zone.js": "0.14.5"
"zone.js": "0.14.7"
},
"overrides": {
"@danielmoncada/angular-datetime-picker": {
"@angular/cdk": "^18.0.0",
"@angular/common": "^18.0.0",
"@angular/core": "^18.0.0"
},
"@sentry/angular-ivy": {
"@angular/cdk": "^18.0.0",
"@angular/common": "^18.0.0",
"@angular/core": "^18.0.0",
"@angular/localize": "^18.0.0",
"@angular/forms": "^18.0.0",
"@angular/router": "^18.0.0"
},
"@swimlane/ngx-graph": {
"@angular/animations": "^17.0.0",
"@angular/cdk": "^17.0.0",
"@angular/common": "^17.0.0",
"@angular/core": "^17.0.0",
"@angular/animations": "^18.0.0",
"@angular/cdk": "^18.0.0",
"@angular/common": "^18.0.0",
"@angular/core": "^18.0.0",
"d3-brush": "^3.0.0",
"d3-color": "^3.1.0",
"d3-interpolate": "^3.0.1",
"d3-selection": "^3.0.0",
"d3-transition": "^3.0.0"
},
"axios": "1.6.8",
"axios": "1.7.2",
"braces": "3.0.3",
"critters": "0.0.22",
"debug": "4.3.4",
"jsdom": "24.0.0",
"katex": "0.16.10",
"postcss": "8.4.38",
"semver": "7.6.0",
"semver": "7.6.2",
"showdown-katex": {
"showdown": "2.1.0"
},
"tough-cookie": "4.1.3",
"undici": "6.12.0",
"vite": "5.1.7",
"tough-cookie": "4.1.4",
"undici": "6.18.1",
"vite": "5.2.12",
"webpack-dev-middleware": "7.2.1",
"word-wrap": "1.2.5",
"ws": "8.17.1"
"ws": "8.17.1",
"yargs-parser": "21.1.1"
},
"devDependencies": {
"@angular-builders/jest": "17.0.3",
"@angular-devkit/build-angular": "17.3.7",
"@angular-eslint/builder": "17.4.1",
"@angular-eslint/eslint-plugin": "17.4.1",
"@angular-eslint/eslint-plugin-template": "17.4.1",
"@angular-eslint/schematics": "17.4.1",
"@angular-eslint/template-parser": "17.4.1",
"@angular/cli": "17.3.7",
"@angular/compiler-cli": "17.3.9",
"@angular/language-service": "17.3.9",
"@angular-builders/jest": "18.0.0",
"@angular-devkit/build-angular": "18.0.5",
"@angular-eslint/builder": "18.0.1",
"@angular-eslint/eslint-plugin": "18.0.1",
"@angular-eslint/eslint-plugin-template": "18.0.1",
"@angular-eslint/schematics": "18.0.1",
"@angular-eslint/template-parser": "18.0.1",
"@angular/cli": "18.0.5",
"@angular/compiler-cli": "18.0.3",
"@angular/language-service": "18.0.3",
"@sentry/types": "7.114.0",
"@types/crypto-js": "4.2.2",
"@types/d3-shape": "3.1.6",
"@types/dompurify": "3.0.5",
"@types/jest": "29.5.12",
"@types/lodash-es": "4.17.12",
"@types/node": "20.12.12",
"@types/node": "20.14.6",
"@types/papaparse": "5.3.14",
"@types/showdown": "2.0.6",
"@types/smoothscroll-polyfill": "0.3.4",
"@types/sockjs-client": "1.5.4",
"@types/uuid": "9.0.8",
"@typescript-eslint/eslint-plugin": "7.9.0",
"@typescript-eslint/parser": "7.9.0",
"@typescript-eslint/eslint-plugin": "7.13.1",
"@typescript-eslint/parser": "7.13.1",
"eslint": "8.57.0",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-deprecation": "2.0.0",
"eslint-plugin-jest": "28.5.0",
"eslint-plugin-deprecation": "3.0.0",
"eslint-plugin-jest": "28.6.0",
"eslint-plugin-jest-extended": "2.4.0",
"eslint-plugin-prettier": "5.1.3",
"folder-hash": "4.0.4",
Expand All @@ -148,17 +163,17 @@
"jest-extended": "4.0.2",
"jest-fail-on-console": "3.3.0",
"jest-junit": "16.0.0",
"jest-preset-angular": "14.0.4",
"lint-staged": "15.2.2",
"ng-mocks": "14.12.2",
"prettier": "3.2.5",
"sass": "1.77.1",
"ts-jest": "29.1.2",
"jest-preset-angular": "14.1.1",
"lint-staged": "15.2.7",
"ng-mocks": "14.13.0",
"prettier": "3.3.2",
"sass": "1.77.6",
"ts-jest": "29.1.5",
"typescript": "5.4.5",
"weak-napi": "2.0.2"
},
"engines": {
"node": ">=20.10.0"
"node": ">=20.14.0"
},
"scripts": {
"postinstall": "husky",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ <h3 class="top-container flex-wrap flex-lg-nowrap">
[ngbTooltip]="('artemisApp.assessment.button.control' | artemisTranslate) + ' + S'"
>
@if (saveBusy) {
<fa-icon [icon]="faSpinner" [spin]="true" />
<fa-icon [icon]="faSpinner" animation="spin" />
}
<fa-icon [icon]="faSave" />
<span jhiTranslate="entity.action.save"></span>
Expand All @@ -120,7 +120,7 @@ <h3 class="top-container flex-wrap flex-lg-nowrap">
[ngbTooltip]="('artemisApp.assessment.button.control' | artemisTranslate) + ' + Enter'"
>
@if (submitBusy) {
<fa-icon [icon]="faSpinner" [spin]="true" />
<fa-icon [icon]="faSpinner" animation="spin" />
}
<span jhiTranslate="entity.action.submit"></span>
</button>
Expand All @@ -131,7 +131,7 @@ <h3 class="top-container flex-wrap flex-lg-nowrap">
[disabled]="!(exercise?.isAtLeastInstructor || isAssessor) || saveBusy || submitBusy || cancelBusy"
>
@if (cancelBusy) {
<fa-icon [icon]="faSpinner" [spin]="true" />
<fa-icon [icon]="faSpinner" animation="spin" />
}
<span jhiTranslate="entity.action.cancel"></span>
</button>
Expand All @@ -145,15 +145,15 @@ <h3 class="top-container flex-wrap flex-lg-nowrap">
[ngbTooltip]="('artemisApp.assessment.button.control' | artemisTranslate) + ' + Enter'"
>
@if (submitBusy) {
<fa-icon [icon]="faSpinner" [spin]="true" />
<fa-icon [icon]="faSpinner" animation="spin" />
}
<span jhiTranslate="artemisApp.assessment.button.overrideAssessment"></span>
</button>
}
@if (result?.completionDate && exercise?.isAtLeastInstructor && (exercise!.type === ExerciseType.MODELING || exercise!.type === ExerciseType.TEXT)) {
<button class="btn m-1 btn-primary" id="useAsExampleSubmission" (click)="onUseAsExampleSolutionClicked()">
@if (submitBusy) {
<fa-icon [icon]="faSpinner" [spin]="true" />
<fa-icon [icon]="faSpinner" animation="spin" />
}
<span jhiTranslate="artemisApp.assessment.button.useAsExampleSubmission"></span>
</button>
Expand All @@ -170,7 +170,7 @@ <h3 class="top-container flex-wrap flex-lg-nowrap">
[ngbTooltip]="nextSubmissionShortcut"
>
@if (nextSubmissionBusy) {
<fa-icon [icon]="faSpinner" [spin]="true" />
<fa-icon [icon]="faSpinner" animation="spin" />
}
<span jhiTranslate="artemisApp.assessment.button.nextSubmission"></span>
</button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ <h2>
submission.participation!.id!,
'submissions',
submission.id!,
'assessment'
'assessment',
]"
class="btn btn-outline-secondary btn-sm mb-1"
>
Expand All @@ -70,7 +70,7 @@ <h2>
submission.participation!.exercise!.id!,
'submissions',
submission.id,
'assessment'
'assessment',
]"
class="btn btn-outline-secondary btn-sm mb-1"
>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { Location } from '@angular/common';
import { FileUploadAssessmentService } from 'app/exercises/file-upload/assess/file-upload-assessment.service';
import { TranslateService } from '@ngx-translate/core';
import { Submission, SubmissionExerciseType } from 'app/entities/submission.model';
Expand All @@ -21,8 +20,6 @@ import { combineLatest } from 'rxjs';
templateUrl: './assessment-locks.component.html',
})
export class AssessmentLocksComponent implements OnInit {
PROGRAMMING_EXERCISE = ExerciseType.PROGRAMMING;

readonly ExerciseType = ExerciseType;

course: Course;
Expand Down Expand Up @@ -51,7 +48,6 @@ export class AssessmentLocksComponent implements OnInit {
private fileUploadAssessmentService: FileUploadAssessmentService,
private programmingAssessmentService: ProgrammingAssessmentManualResultService,
translateService: TranslateService,
private location: Location,
private courseService: CourseManagementService,
private examManagementService: ExamManagementService,
) {
Expand Down
8 changes: 4 additions & 4 deletions src/main/webapp/app/core/core.module.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { APP_INITIALIZER, ErrorHandler, LOCALE_ID, NgModule } from '@angular/core';
import { DatePipe, registerLocaleData } from '@angular/common';
import { HTTP_INTERCEPTORS, HttpClient, HttpClientModule } from '@angular/common/http';
import { HTTP_INTERCEPTORS, HttpClient, provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
import { Title } from '@angular/platform-browser';
import { AuthExpiredInterceptor } from 'app/core/interceptor/auth-expired.interceptor';
import { ErrorHandlerInterceptor } from 'app/core/interceptor/errorhandler.interceptor';
import { NotificationInterceptor } from 'app/core/interceptor/notification.interceptor';
import { NgbDateAdapter, NgbDatepickerConfig, NgbTooltipConfig } from '@ng-bootstrap/ng-bootstrap';
import { NgxWebstorageModule, SessionStorageService } from 'ngx-webstorage';
import { SessionStorageService, provideNgxWebstorage, withLocalStorage, withNgxWebstorageConfig, withSessionStorage } from 'ngx-webstorage';
import locale from '@angular/common/locales/en';
import { MissingTranslationHandler, TranslateLoader, TranslateModule, TranslateService } from '@ngx-translate/core';
import { SentryErrorHandler } from 'app/core/sentry/sentry.error-handler';
Expand All @@ -23,8 +23,6 @@ import { Router } from '@angular/router';

@NgModule({
imports: [
HttpClientModule,
NgxWebstorageModule.forRoot({ prefix: 'jhi', separator: '-' }),
TranslateModule.forRoot({
loader: {
provide: TranslateLoader,
Expand All @@ -38,6 +36,8 @@ import { Router } from '@angular/router';
}),
],
providers: [
provideHttpClient(withInterceptorsFromDi()),
provideNgxWebstorage(withNgxWebstorageConfig({ prefix: 'jhi', separator: '-' }), withLocalStorage(), withSessionStorage()),
Title,
{
provide: LOCALE_ID,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ <h4 class="modal-title">
[disabled]="dataExportConfirmationForm.invalid || submitDisabled"
>
@if (submitDisabled) {
<span><fa-icon [icon]="faSpinner" [spin]="true" />&nbsp;</span>
<span><fa-icon [icon]="faSpinner" animation="spin" />&nbsp;</span>
}
<fa-icon [icon]="faCheck" />&nbsp;
<span [jhiTranslate]="'artemisApp.dataExport.request'"> Request</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ <h4>
</div>
@if (!exportReady) {
<span style="color: grey"
><fa-icon [icon]="faSpinner" [spin]="true" />&nbsp;<span jhitranslate="artemisApp.instructorDashboard.loadingStudents"
><fa-icon [icon]="faSpinner" animation="spin" />&nbsp;<span jhitranslate="artemisApp.instructorDashboard.loadingStudents"
>Loading the results of all students...</span
></span
>
Expand Down
Loading
Loading