diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c2d00a53..5961f1d7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -49,9 +49,8 @@ jobs: if: steps.playwright-cache.outputs.cache-hit != 'true' run: npx playwright install chromium --with-deps - # TODO FIXIT(#123): uncomment when eslint issues are fixed - # - name: Lint - # run: npm run lint + - name: Lint + run: npm run lint - name: Run tests run: npm run test:ci @@ -197,7 +196,7 @@ jobs: # ------------------------------------------------------------------ create-release: name: Create GitHub Release - needs: [ui-build-push, gateway-build-push, calculation-build-push] + needs: [ ui-build-push, gateway-build-push, calculation-build-push ] runs-on: ubuntu-latest permissions: contents: write diff --git a/.github/workflows/ui-ci.yml b/.github/workflows/ui-ci.yml index 7379eaeb..5baafba1 100644 --- a/.github/workflows/ui-ci.yml +++ b/.github/workflows/ui-ci.yml @@ -52,9 +52,8 @@ jobs: if: steps.playwright-cache.outputs.cache-hit != 'true' run: npx playwright install chromium --with-deps -# TODO FIXIT(#123): uncomment when eslint issues are fixed -# - name: Lint -# run: npm run lint + - name: Lint + run: npm run lint - name: Run Tests run: npm run test:ci diff --git a/ScriptBeeClient/.prettierrc.json b/ScriptBeeClient/.prettierrc.json index 1e10e04a..746b1b51 100644 --- a/ScriptBeeClient/.prettierrc.json +++ b/ScriptBeeClient/.prettierrc.json @@ -8,7 +8,7 @@ "trailingComma": "es5", "bracketSameLine": true, "printWidth": 160, - "endOfLine": "crlf", + "endOfLine": "auto", "overrides": [ { "files": "*.html", diff --git a/ScriptBeeClient/src/app/app.component.ts b/ScriptBeeClient/src/app/app.component.ts index fbcde80b..cb9b22aa 100644 --- a/ScriptBeeClient/src/app/app.component.ts +++ b/ScriptBeeClient/src/app/app.component.ts @@ -1,4 +1,4 @@ -import { Component } from '@angular/core'; +import { Component, inject } from '@angular/core'; import { RouterOutlet } from '@angular/router'; import { NavMenuComponent } from './components/nav-menu/nav-menu.component'; import { MatIconRegistry } from '@angular/material/icon'; @@ -11,7 +11,10 @@ import { DomSanitizer } from '@angular/platform-browser'; styleUrl: './app.component.scss', }) export class AppComponent { - constructor(matIconRegistry: MatIconRegistry, domSanitizer: DomSanitizer) { - matIconRegistry.addSvgIconSet(domSanitizer.bypassSecurityTrustResourceUrl('./assets/mdi.svg')); + private matIconRegistry = inject(MatIconRegistry); + private domSanitizer = inject(DomSanitizer); + + constructor() { + this.matIconRegistry.addSvgIconSet(this.domSanitizer.bypassSecurityTrustResourceUrl('./assets/mdi.svg')); } } diff --git a/ScriptBeeClient/src/app/components/dialogs/confirmation-dialog/confirmation-dialog.component.ts b/ScriptBeeClient/src/app/components/dialogs/confirmation-dialog/confirmation-dialog.component.ts index 9b1faef2..c4dc656a 100644 --- a/ScriptBeeClient/src/app/components/dialogs/confirmation-dialog/confirmation-dialog.component.ts +++ b/ScriptBeeClient/src/app/components/dialogs/confirmation-dialog/confirmation-dialog.component.ts @@ -1,4 +1,4 @@ -import { Component, Inject } from '@angular/core'; +import { Component, inject } from '@angular/core'; import { MAT_DIALOG_DATA, MatDialogModule, MatDialogRef } from '@angular/material/dialog'; import { MatButtonModule } from '@angular/material/button'; @@ -16,10 +16,8 @@ export interface ConfirmationDialogData { styleUrls: ['./confirmation-dialog.component.scss'], }) export class ConfirmationDialogComponent { - constructor( - public dialogRef: MatDialogRef, - @Inject(MAT_DIALOG_DATA) public data: ConfirmationDialogData - ) {} + public dialogRef = inject(MatDialogRef); + public data = inject(MAT_DIALOG_DATA); onCancel(): void { this.dialogRef.close(false); diff --git a/ScriptBeeClient/src/app/components/dialogs/instance-not-allocated-dialog/instance-not-allocated-dialog.component.ts b/ScriptBeeClient/src/app/components/dialogs/instance-not-allocated-dialog/instance-not-allocated-dialog.component.ts index 787646d4..c8ed57ef 100644 --- a/ScriptBeeClient/src/app/components/dialogs/instance-not-allocated-dialog/instance-not-allocated-dialog.component.ts +++ b/ScriptBeeClient/src/app/components/dialogs/instance-not-allocated-dialog/instance-not-allocated-dialog.component.ts @@ -1,4 +1,4 @@ -import { Component, Inject, signal } from '@angular/core'; +import { Component, inject, signal } from '@angular/core'; import { MAT_DIALOG_DATA, MatDialogActions, MatDialogContent, MatDialogRef, MatDialogTitle } from '@angular/material/dialog'; import { MatExpansionModule } from '@angular/material/expansion'; import { MatButtonModule } from '@angular/material/button'; @@ -21,12 +21,9 @@ export interface InstanceNotAllocatedDialogData { export class InstanceNotAllocatedDialog { isAllocateLoading = signal(false); - constructor( - @Inject(MAT_DIALOG_DATA) - public data: InstanceNotAllocatedDialogData, - public dialogRef: MatDialogRef, - private instanceService: InstanceService - ) {} + public data = inject(MAT_DIALOG_DATA); + public dialogRef = inject(MatDialogRef); + private instanceService = inject(InstanceService); onCloseClick(): void { this.dialogRef.close(); diff --git a/ScriptBeeClient/src/app/components/drag-and-drop-files/drag-and-drop-files.component.ts b/ScriptBeeClient/src/app/components/drag-and-drop-files/drag-and-drop-files.component.ts index ab763df9..fc473b59 100644 --- a/ScriptBeeClient/src/app/components/drag-and-drop-files/drag-and-drop-files.component.ts +++ b/ScriptBeeClient/src/app/components/drag-and-drop-files/drag-and-drop-files.component.ts @@ -14,7 +14,7 @@ export class DragAndDropFilesComponent { @ViewChild('modelFileInput') modelFileInput?: ElementRef; @Output() filesChange = new EventEmitter(); - isHovering: boolean = false; + isHovering = false; @Input() files: File[] = []; toggleHover(event: boolean) { diff --git a/ScriptBeeClient/src/app/components/lazy-file-tree/lazy-file-tree.component.html b/ScriptBeeClient/src/app/components/lazy-file-tree/lazy-file-tree.component.html index 63fd2349..b7762ff0 100644 --- a/ScriptBeeClient/src/app/components/lazy-file-tree/lazy-file-tree.component.html +++ b/ScriptBeeClient/src/app/components/lazy-file-tree/lazy-file-tree.component.html @@ -4,14 +4,14 @@ - +
description {{ node.name }} @if (enableDelete()) {
- + }
@@ -20,7 +20,7 @@
-
@@ -50,9 +50,9 @@ } @else if (node.state === 'error') { error Error loading folder - + } @else if (node.state === 'load-more') { - + }
diff --git a/ScriptBeeClient/src/app/components/lazy-file-tree/lazy-file-tree.component.ts b/ScriptBeeClient/src/app/components/lazy-file-tree/lazy-file-tree.component.ts index c6b6b55c..7c6f947e 100644 --- a/ScriptBeeClient/src/app/components/lazy-file-tree/lazy-file-tree.component.ts +++ b/ScriptBeeClient/src/app/components/lazy-file-tree/lazy-file-tree.component.ts @@ -27,11 +27,11 @@ export class LazyFileTreeComponent { data = input.required(); enableDelete = input(false); - onDelete = output(); - onClick = output(); - onExpand = output(); - onRetry = output(); - onLoadMore = output(); + delete = output(); + clickChange = output(); + expand = output(); + retry = output(); + loadMore = output(); childrenAccessor = input.required<(node: FileTreeNode) => FileTreeNode[] | Observable>(); diff --git a/ScriptBeeClient/src/app/components/script-parameters-list/script-parameter/script-parameter.component.ts b/ScriptBeeClient/src/app/components/script-parameters-list/script-parameter/script-parameter.component.ts index 7286ba68..c018d632 100644 --- a/ScriptBeeClient/src/app/components/script-parameters-list/script-parameter/script-parameter.component.ts +++ b/ScriptBeeClient/src/app/components/script-parameters-list/script-parameter/script-parameter.component.ts @@ -9,7 +9,7 @@ import { ErrorStateMatcher } from '@angular/material/core'; import { ScriptParameterValueComponent } from './script-parameter-value/script-parameter-value.component'; class ParameterNameErrorMatcher implements ErrorStateMatcher { - private isError: boolean = false; + private isError = false; setErrorState(isError: boolean) { this.isError = isError; diff --git a/ScriptBeeClient/src/app/components/script-parameters-list/script-parameters-list.component.ts b/ScriptBeeClient/src/app/components/script-parameters-list/script-parameters-list.component.ts index 100cb820..d2d9a9c9 100644 --- a/ScriptBeeClient/src/app/components/script-parameters-list/script-parameters-list.component.ts +++ b/ScriptBeeClient/src/app/components/script-parameters-list/script-parameters-list.component.ts @@ -67,8 +67,8 @@ export class ScriptParametersListComponent { private isParameterNameUnique(parameter: ScriptParameter, parameters: ScriptParameter[]): boolean { let numbersOfApparitions = 0; - for (let i = 0; i < parameters.length; i++) { - if (parameters[i].name === parameter.name) { + for (const item of parameters) { + if (item.name === parameter.name) { numbersOfApparitions++; } } diff --git a/ScriptBeeClient/src/app/components/selectable-tree/selectable-tree.component.html b/ScriptBeeClient/src/app/components/selectable-tree/selectable-tree.component.html index 9de42131..ea549548 100644 --- a/ScriptBeeClient/src/app/components/selectable-tree/selectable-tree.component.html +++ b/ScriptBeeClient/src/app/components/selectable-tree/selectable-tree.component.html @@ -1,6 +1,6 @@ - +
@if (fileIcon()) { @@ -11,7 +11,7 @@ @if (enableDelete()) {
- + }
@@ -35,7 +35,7 @@ @if (enableDelete()) {
- + } diff --git a/ScriptBeeClient/src/app/components/selectable-tree/selectable-tree.component.ts b/ScriptBeeClient/src/app/components/selectable-tree/selectable-tree.component.ts index 71f84aa4..e367ca07 100644 --- a/ScriptBeeClient/src/app/components/selectable-tree/selectable-tree.component.ts +++ b/ScriptBeeClient/src/app/components/selectable-tree/selectable-tree.component.ts @@ -20,8 +20,8 @@ export class SelectableTreeComponent { fileIcon = input(undefined); enableDelete = input(false); - onDelete = output(); - onClick = output(); + delete = output(); + clickChange = output(); childrenAccessor = (node: TreeNodeWithParent) => node.children ?? []; diff --git a/ScriptBeeClient/src/app/components/selectable-tree/tree-actions-menu/tree-actions-menu.component.html b/ScriptBeeClient/src/app/components/selectable-tree/tree-actions-menu/tree-actions-menu.component.html index c32c3e59..dd29527e 100644 --- a/ScriptBeeClient/src/app/components/selectable-tree/tree-actions-menu/tree-actions-menu.component.html +++ b/ScriptBeeClient/src/app/components/selectable-tree/tree-actions-menu/tree-actions-menu.component.html @@ -3,7 +3,7 @@ - diff --git a/ScriptBeeClient/src/app/components/selectable-tree/tree-actions-menu/tree-actions-menu.component.ts b/ScriptBeeClient/src/app/components/selectable-tree/tree-actions-menu/tree-actions-menu.component.ts index b8966f03..139fe097 100644 --- a/ScriptBeeClient/src/app/components/selectable-tree/tree-actions-menu/tree-actions-menu.component.ts +++ b/ScriptBeeClient/src/app/components/selectable-tree/tree-actions-menu/tree-actions-menu.component.ts @@ -13,5 +13,5 @@ import { ClickStopPropagation } from '../../../directives/click-stop-propagation styleUrls: ['./tree-actions-menu.component.scss'], }) export class TreeActionsMenuComponent { - onDelete = output(); + delete = output(); } diff --git a/ScriptBeeClient/src/app/directives/click-stop-propagation.ts b/ScriptBeeClient/src/app/directives/click-stop-propagation.ts index 7f350560..70a0abef 100644 --- a/ScriptBeeClient/src/app/directives/click-stop-propagation.ts +++ b/ScriptBeeClient/src/app/directives/click-stop-propagation.ts @@ -5,7 +5,7 @@ import { Directive, HostListener } from '@angular/core'; }) export class ClickStopPropagation { @HostListener('click', ['$event']) - public onClick(event: any): void { + public onClick(event: Event): void { event.stopPropagation(); } } diff --git a/ScriptBeeClient/src/app/directives/file-drop.directive.ts b/ScriptBeeClient/src/app/directives/file-drop.directive.ts index 907c1c6e..38314d4d 100644 --- a/ScriptBeeClient/src/app/directives/file-drop.directive.ts +++ b/ScriptBeeClient/src/app/directives/file-drop.directive.ts @@ -8,11 +8,11 @@ export class FileDropDirective { @Output() filesHovered = new EventEmitter(); @HostListener('drop', ['$event']) - onDrop($event: any) { + onDrop($event: DragEvent) { $event.preventDefault(); const transfer = $event.dataTransfer; - this.filesDropped.emit(transfer.files); + this.filesDropped.emit(transfer?.files); this.filesHovered.emit(false); } diff --git a/ScriptBeeClient/src/app/pages/projects/create-project/create-project.component.ts b/ScriptBeeClient/src/app/pages/projects/create-project/create-project.component.ts index 86240022..7b7a971e 100644 --- a/ScriptBeeClient/src/app/pages/projects/create-project/create-project.component.ts +++ b/ScriptBeeClient/src/app/pages/projects/create-project/create-project.component.ts @@ -1,4 +1,4 @@ -import { Component, signal, WritableSignal } from '@angular/core'; +import { Component, inject, signal, WritableSignal } from '@angular/core'; import { MatError, MatFormField, MatLabel } from '@angular/material/form-field'; import { MatInput } from '@angular/material/input'; import { FormControl, FormsModule, ReactiveFormsModule, Validators } from '@angular/forms'; @@ -23,10 +23,8 @@ export class CreateProjectPage { projectNameErrorMessage = signal(''); isCreateLoading = signal(false); - constructor( - private projectService: ProjectService, - private router: Router - ) {} + private projectService = inject(ProjectService); + private router = inject(Router); updateProjectIdErrorMessage() { this.updateErrorMessage(this.projectId, this.projectIdErrorMessage); diff --git a/ScriptBeeClient/src/app/pages/projects/project-details/analysis/analysis.component.html b/ScriptBeeClient/src/app/pages/projects/project-details/analysis/analysis.component.html index 4cfccff4..f8ba18a6 100644 --- a/ScriptBeeClient/src/app/pages/projects/project-details/analysis/analysis.component.html +++ b/ScriptBeeClient/src/app/pages/projects/project-details/analysis/analysis.component.html @@ -3,7 +3,7 @@ - + diff --git a/ScriptBeeClient/src/app/pages/projects/project-details/analysis/analysis.component.ts b/ScriptBeeClient/src/app/pages/projects/project-details/analysis/analysis.component.ts index d87ea502..dff2ffc1 100644 --- a/ScriptBeeClient/src/app/pages/projects/project-details/analysis/analysis.component.ts +++ b/ScriptBeeClient/src/app/pages/projects/project-details/analysis/analysis.component.ts @@ -1,4 +1,4 @@ -import { Component, computed, model, signal, viewChild } from '@angular/core'; +import { Component, computed, inject, model, signal, viewChild } from '@angular/core'; import { AngularSplitModule } from 'angular-split'; import { ScriptsContentComponent } from './scripts-content/scripts-content.component'; import { ScriptTreeComponent } from './script-tree/script-tree.component'; @@ -25,12 +25,12 @@ export class AnalysisComponent { projectId = computed(() => this.projectStateService.currentProjectId()); instanceId = computed(() => this.projectStateService.currentInstanceId()); - constructor( - private route: ActivatedRoute, - private router: Router, - private projectStateService: ProjectStateService - ) { - route.queryParamMap.pipe(takeUntilDestroyed()).subscribe((params) => { + private route = inject(ActivatedRoute); + private router = inject(Router); + private projectStateService = inject(ProjectStateService); + + constructor() { + this.route.queryParamMap.pipe(takeUntilDestroyed()).subscribe((params) => { this.selectedFileId.set(params.get('fileId')); }); } diff --git a/ScriptBeeClient/src/app/pages/projects/project-details/analysis/output/file-output/file-output.component.ts b/ScriptBeeClient/src/app/pages/projects/project-details/analysis/output/file-output/file-output.component.ts index 38c0237e..dcab4fc9 100644 --- a/ScriptBeeClient/src/app/pages/projects/project-details/analysis/output/file-output/file-output.component.ts +++ b/ScriptBeeClient/src/app/pages/projects/project-details/analysis/output/file-output/file-output.component.ts @@ -11,11 +11,12 @@ import { MatIcon } from '@angular/material/icon'; }) export class FileOutputComponent { files = input.required(); - // TODO FIXIT: update download with the new endpoints + // TODO FIXIT(#125): update download with the new endpoints // constructor(private outputFilesService: OutputFilesService) { // } // onDownloadFileButtonClick(file: AnalysisFile) { + console.log(file); // this.outputFilesService.downloadFile(file.fileId, file.fileName).subscribe((data) => { // FileOutputComponent.downloadFile(file.fileName, data); // }); diff --git a/ScriptBeeClient/src/app/pages/projects/project-details/analysis/script-tree/create-script-dialog/create-script-dialog-script-language/create-script-dialog-script-language.component.ts b/ScriptBeeClient/src/app/pages/projects/project-details/analysis/script-tree/create-script-dialog/create-script-dialog-script-language/create-script-dialog-script-language.component.ts index 99aab1d7..fd5be9b1 100644 --- a/ScriptBeeClient/src/app/pages/projects/project-details/analysis/script-tree/create-script-dialog/create-script-dialog-script-language/create-script-dialog-script-language.component.ts +++ b/ScriptBeeClient/src/app/pages/projects/project-details/analysis/script-tree/create-script-dialog/create-script-dialog-script-language/create-script-dialog-script-language.component.ts @@ -1,4 +1,4 @@ -import { Component, computed, input, model } from '@angular/core'; +import { Component, computed, inject, input, model } from '@angular/core'; import { MatExpansionModule } from '@angular/material/expansion'; import { MatFormField } from '@angular/material/form-field'; import { MatSelectModule } from '@angular/material/select'; @@ -26,5 +26,5 @@ export class CreateScriptDialogScriptLanguageComponent { }); availableScriptLanguagesResourceError = computed(() => convertError(this.availableScriptLanguagesResource.error())); - constructor(private projectStructureService: ProjectStructureService) {} + private projectStructureService = inject(ProjectStructureService); } diff --git a/ScriptBeeClient/src/app/pages/projects/project-details/analysis/script-tree/create-script-dialog/create-script-dialog.component.ts b/ScriptBeeClient/src/app/pages/projects/project-details/analysis/script-tree/create-script-dialog/create-script-dialog.component.ts index 5a489f2a..476f0904 100644 --- a/ScriptBeeClient/src/app/pages/projects/project-details/analysis/script-tree/create-script-dialog/create-script-dialog.component.ts +++ b/ScriptBeeClient/src/app/pages/projects/project-details/analysis/script-tree/create-script-dialog/create-script-dialog.component.ts @@ -1,4 +1,4 @@ -import { Component, computed, Inject, signal } from '@angular/core'; +import { Component, computed, inject, signal } from '@angular/core'; import { ScriptParameter } from '../../../../../../types/script-types'; import { MAT_DIALOG_DATA, MatDialogActions, MatDialogContent, MatDialogRef, MatDialogTitle } from '@angular/material/dialog'; import { MatExpansionModule } from '@angular/material/expansion'; @@ -45,11 +45,9 @@ export class CreateScriptDialogComponent { isOkDisabled = computed(() => !this.scriptPath() || !this.scriptLanguage() || this.hasParameterErrors() || this.isCreateLoading()); - constructor( - @Inject(MAT_DIALOG_DATA) public data: CreateScriptDialogData, - public dialogRef: MatDialogRef, - private projectStructureService: ProjectStructureService - ) {} + public data = inject(MAT_DIALOG_DATA); + public dialogRef = inject(MatDialogRef); + private projectStructureService = inject(ProjectStructureService); onParametersChange(parameters: ScriptParameter[]) { this.parameters.set(parameters); diff --git a/ScriptBeeClient/src/app/pages/projects/project-details/analysis/script-tree/script-tree.component.html b/ScriptBeeClient/src/app/pages/projects/project-details/analysis/script-tree/script-tree.component.html index db3636dc..3bc7e285 100644 --- a/ScriptBeeClient/src/app/pages/projects/project-details/analysis/script-tree/script-tree.component.html +++ b/ScriptBeeClient/src/app/pages/projects/project-details/analysis/script-tree/script-tree.component.html @@ -15,9 +15,9 @@ [data]="rootData()" [enableDelete]="true" [childrenAccessor]="childrenAccessor" - (onDelete)="onNodeDelete($event)" - (onClick)="onNodeClick($event)" - (onExpand)="onExpand($event)" - (onRetry)="onRetry($event)" - (onLoadMore)="onLoadMore($event)" /> + (delete)="onNodeDelete($event)" + (clickChange)="onNodeClick($event)" + (expand)="onExpand($event)" + (retry)="onRetry($event)" + (loadMore)="onLoadMore($event)" /> } diff --git a/ScriptBeeClient/src/app/pages/projects/project-details/analysis/script-tree/script-tree.component.ts b/ScriptBeeClient/src/app/pages/projects/project-details/analysis/script-tree/script-tree.component.ts index 89ee0a3d..ec49d444 100644 --- a/ScriptBeeClient/src/app/pages/projects/project-details/analysis/script-tree/script-tree.component.ts +++ b/ScriptBeeClient/src/app/pages/projects/project-details/analysis/script-tree/script-tree.component.ts @@ -30,7 +30,7 @@ interface FolderState { export class ScriptTreeComponent { projectId = input.required(); - onFileSelected = output(); + fileSelected = output(); isDeleteLoading = signal(false); @@ -53,10 +53,10 @@ export class ScriptTreeComponent { return null; }); - constructor( - private projectStructureService: ProjectStructureService, - private dialog: MatDialog - ) { + private projectStructureService = inject(ProjectStructureService); + private dialog = inject(MatDialog); + + constructor() { effect(() => { const pid = this.projectId(); if (pid && !this.folderStates().has(null)) { @@ -87,7 +87,7 @@ export class ScriptTreeComponent { onNodeClick(node: ProjectFileNode) { if (node.type === 'file') { - this.onFileSelected.emit(node); + this.fileSelected.emit(node); } } diff --git a/ScriptBeeClient/src/app/pages/projects/project-details/analysis/scripts-content/no-scripts/no-scripts.component.ts b/ScriptBeeClient/src/app/pages/projects/project-details/analysis/scripts-content/no-scripts/no-scripts.component.ts index 9588fd14..b16163f3 100644 --- a/ScriptBeeClient/src/app/pages/projects/project-details/analysis/scripts-content/no-scripts/no-scripts.component.ts +++ b/ScriptBeeClient/src/app/pages/projects/project-details/analysis/scripts-content/no-scripts/no-scripts.component.ts @@ -1,11 +1,11 @@ import { Component, OnInit } from '@angular/core'; import { MatMiniFabButton } from '@angular/material/button'; -type Action = { +interface Action { name: string; icon: string; color: string; -}; +} @Component({ selector: 'app-no-scripts', diff --git a/ScriptBeeClient/src/app/pages/projects/project-details/analysis/scripts-content/selected-script/edit-parameters-dialog/edit-parameters-dialog.component.ts b/ScriptBeeClient/src/app/pages/projects/project-details/analysis/scripts-content/selected-script/edit-parameters-dialog/edit-parameters-dialog.component.ts index be53b655..80e0f17f 100644 --- a/ScriptBeeClient/src/app/pages/projects/project-details/analysis/scripts-content/selected-script/edit-parameters-dialog/edit-parameters-dialog.component.ts +++ b/ScriptBeeClient/src/app/pages/projects/project-details/analysis/scripts-content/selected-script/edit-parameters-dialog/edit-parameters-dialog.component.ts @@ -1,4 +1,4 @@ -import { Component, computed, Inject, signal } from '@angular/core'; +import { Component, computed, inject, signal } from '@angular/core'; import { MAT_DIALOG_DATA, MatDialogActions, MatDialogContent, MatDialogRef, MatDialogTitle } from '@angular/material/dialog'; import { ScriptParameter } from '../../../../../../../types/script-types'; import { MatExpansionModule } from '@angular/material/expansion'; @@ -39,11 +39,9 @@ export class EditParametersDialogComponent { isUpdateDisabled = computed(() => this.hasParameterErrors() || this.isUpdateLoading()); - constructor( - public dialogRef: MatDialogRef, - @Inject(MAT_DIALOG_DATA) public data: EditParametersDialogData, - private projectStructureService: ProjectStructureService - ) {} + public dialogRef = inject(MatDialogRef); + public data = inject(MAT_DIALOG_DATA); + private projectStructureService = inject(ProjectStructureService); onParametersChange(parameters: ScriptParameter[]) { this.parameters.set(parameters); diff --git a/ScriptBeeClient/src/app/pages/projects/project-details/analysis/scripts-content/selected-script/run-script-loading/run-script-loading.component.ts b/ScriptBeeClient/src/app/pages/projects/project-details/analysis/scripts-content/selected-script/run-script-loading/run-script-loading.component.ts index 87574fb3..513fd77d 100644 --- a/ScriptBeeClient/src/app/pages/projects/project-details/analysis/scripts-content/selected-script/run-script-loading/run-script-loading.component.ts +++ b/ScriptBeeClient/src/app/pages/projects/project-details/analysis/scripts-content/selected-script/run-script-loading/run-script-loading.component.ts @@ -1,7 +1,7 @@ -import { Component, computed, effect, inject, input, OnInit, output } from '@angular/core'; +import { Component, computed, effect, inject, input, output } from '@angular/core'; import { AnalysisService } from '../../../../../../../services/analysis/analysis.service'; import { rxResource } from '@angular/core/rxjs-interop'; -import { interval, of, startWith, switchMap, takeWhile, tap } from 'rxjs'; +import { interval, of, startWith, switchMap, takeWhile } from 'rxjs'; import { MatProgressSpinner } from '@angular/material/progress-spinner'; @Component({ diff --git a/ScriptBeeClient/src/app/pages/projects/project-details/model/link-models/link-models.component.ts b/ScriptBeeClient/src/app/pages/projects/project-details/model/link-models/link-models.component.ts index 2a74124a..1aad7ed1 100644 --- a/ScriptBeeClient/src/app/pages/projects/project-details/model/link-models/link-models.component.ts +++ b/ScriptBeeClient/src/app/pages/projects/project-details/model/link-models/link-models.component.ts @@ -1,4 +1,4 @@ -import { Component, computed, input, signal } from '@angular/core'; +import { Component, computed, inject, input, signal } from '@angular/core'; import { CenteredSpinnerComponent } from '../../../../../components/centered-spinner/centered-spinner.component'; import { ErrorStateComponent } from '../../../../../components/error-state/error-state.component'; import { MatFormField, MatLabel } from '@angular/material/form-field'; @@ -33,7 +33,7 @@ export class LinkModelsComponent { isLinkLoading = signal(false); - constructor(private linkerService: LinkerService) {} + private linkerService = inject(LinkerService); onLinkButtonClick() { const linkerId = this.selectedLinkerId(); diff --git a/ScriptBeeClient/src/app/pages/projects/project-details/model/load-models/load-models.component.ts b/ScriptBeeClient/src/app/pages/projects/project-details/model/load-models/load-models.component.ts index f6fd5b84..dd2ddbcc 100644 --- a/ScriptBeeClient/src/app/pages/projects/project-details/model/load-models/load-models.component.ts +++ b/ScriptBeeClient/src/app/pages/projects/project-details/model/load-models/load-models.component.ts @@ -1,4 +1,4 @@ -import { Component, input, signal } from '@angular/core'; +import { Component, inject, input, signal } from '@angular/core'; import { TreeNode, TreeNodeWithParent } from '../../../../../types/tree-node'; import { MatButtonModule } from '@angular/material/button'; import { CheckableTreeComponent } from '../../../../../components/checkable-tree/checkable-tree.component'; @@ -20,7 +20,7 @@ export class LoadModelsComponent { checkedFiles = signal([]); isLoadModelsLoading = signal(false); - constructor(private loaderService: LoaderService) {} + private loaderService = inject(LoaderService); onUpdateCheckedFiles(checkedNodes: TreeNodeWithParent[]) { this.checkedFiles.set(checkedNodes.filter((node) => !!node.parent)); diff --git a/ScriptBeeClient/src/app/pages/projects/project-details/model/project-context/project-context.component.ts b/ScriptBeeClient/src/app/pages/projects/project-details/model/project-context/project-context.component.ts index e7d086bd..c4d23e86 100644 --- a/ScriptBeeClient/src/app/pages/projects/project-details/model/project-context/project-context.component.ts +++ b/ScriptBeeClient/src/app/pages/projects/project-details/model/project-context/project-context.component.ts @@ -1,4 +1,4 @@ -import { Component, computed, input, signal } from '@angular/core'; +import { Component, computed, inject, input, signal } from '@angular/core'; import { rxResource } from '@angular/core/rxjs-interop'; import { ProjectContextService } from '../../../../../services/projects/project-context.service'; import { CenteredSpinnerComponent } from '../../../../../components/centered-spinner/centered-spinner.component'; @@ -33,7 +33,7 @@ export class ProjectContextComponent { isClearContextLoading = signal(false); isReloadContextLoading = signal(false); - constructor(private projectContextService: ProjectContextService) {} + private projectContextService = inject(ProjectContextService); onReloadModelsClick() { this.isReloadContextLoading.set(true); diff --git a/ScriptBeeClient/src/app/pages/projects/project-details/model/upload-models/upload-models.component.ts b/ScriptBeeClient/src/app/pages/projects/project-details/model/upload-models/upload-models.component.ts index b9dfbfce..2702358d 100644 --- a/ScriptBeeClient/src/app/pages/projects/project-details/model/upload-models/upload-models.component.ts +++ b/ScriptBeeClient/src/app/pages/projects/project-details/model/upload-models/upload-models.component.ts @@ -1,4 +1,4 @@ -import { Component, computed, input, signal } from '@angular/core'; +import { Component, computed, inject, input, signal } from '@angular/core'; import { rxResource } from '@angular/core/rxjs-interop'; import { LoaderService } from '../../../../../services/loaders/loader.service'; import { CenteredSpinnerComponent } from '../../../../../components/centered-spinner/centered-spinner.component'; @@ -47,10 +47,8 @@ export class UploadModelsComponent { files: File[] = []; - constructor( - private loaderService: LoaderService, - private uploadService: UploadService - ) {} + private loaderService = inject(LoaderService); + private uploadService = inject(UploadService); onUploadFilesClick() { const loaderId = this.selectedLoaderId(); diff --git a/ScriptBeeClient/src/app/pages/projects/project-details/plugins/marketplace-dashboard/plugins-marketplace-dashboard.component.ts b/ScriptBeeClient/src/app/pages/projects/project-details/plugins/marketplace-dashboard/plugins-marketplace-dashboard.component.ts index c36e19cd..60397752 100644 --- a/ScriptBeeClient/src/app/pages/projects/project-details/plugins/marketplace-dashboard/plugins-marketplace-dashboard.component.ts +++ b/ScriptBeeClient/src/app/pages/projects/project-details/plugins/marketplace-dashboard/plugins-marketplace-dashboard.component.ts @@ -1,4 +1,4 @@ -import { Component, computed, signal } from '@angular/core'; +import { Component, computed, inject, signal } from '@angular/core'; import { ErrorStateComponent } from '../../../../../components/error-state/error-state.component'; import { LoadingProgressBarComponent } from '../../../../../components/loading-progress-bar/loading-progress-bar.component'; import { rxResource, takeUntilDestroyed } from '@angular/core/rxjs-interop'; @@ -13,7 +13,7 @@ import { FormsModule } from '@angular/forms'; import { PluginMarketplaceDashboardListComponent } from './list/plugin-marketplace-dashboard-list.component'; import { convertError } from '../../../../../utils/api'; import { InstalledPlugin } from '../../../../../types/marketplace-plugin'; -import { Observable, of } from 'rxjs'; +import { of } from 'rxjs'; @Component({ selector: 'app-plugins-marketplace-dashboard', @@ -88,11 +88,11 @@ export class PluginsMarketplaceDashboardComponent { }); }); - constructor( - route: ActivatedRoute, - private pluginsService: PluginService - ) { - let currentRoute: ActivatedRoute | null = route; + private route = inject(ActivatedRoute); + private pluginsService = inject(PluginService); + + constructor() { + let currentRoute: ActivatedRoute | null = this.route; while (currentRoute) { currentRoute.paramMap.pipe(takeUntilDestroyed()).subscribe((paramMap) => { if (paramMap.has('id') && !this.projectId()) { diff --git a/ScriptBeeClient/src/app/pages/projects/project-details/project-details-page.component.html b/ScriptBeeClient/src/app/pages/projects/project-details/project-details-page.component.html index 9552d67f..e03f3f19 100644 --- a/ScriptBeeClient/src/app/pages/projects/project-details/project-details-page.component.html +++ b/ScriptBeeClient/src/app/pages/projects/project-details/project-details-page.component.html @@ -1,6 +1,6 @@