Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 3 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/ui-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion ScriptBeeClient/.prettierrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"trailingComma": "es5",
"bracketSameLine": true,
"printWidth": 160,
"endOfLine": "crlf",
"endOfLine": "auto",
"overrides": [
{
"files": "*.html",
Expand Down
9 changes: 6 additions & 3 deletions ScriptBeeClient/src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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'));
}
}
Original file line number Diff line number Diff line change
@@ -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';

Expand All @@ -16,10 +16,8 @@ export interface ConfirmationDialogData {
styleUrls: ['./confirmation-dialog.component.scss'],
})
export class ConfirmationDialogComponent {
constructor(
public dialogRef: MatDialogRef<ConfirmationDialogComponent>,
@Inject(MAT_DIALOG_DATA) public data: ConfirmationDialogData
) {}
public dialogRef = inject(MatDialogRef<ConfirmationDialogComponent>);
public data = inject<ConfirmationDialogData>(MAT_DIALOG_DATA);

onCancel(): void {
this.dialogRef.close(false);
Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -21,12 +21,9 @@ export interface InstanceNotAllocatedDialogData {
export class InstanceNotAllocatedDialog {
isAllocateLoading = signal(false);

constructor(
@Inject(MAT_DIALOG_DATA)
public data: InstanceNotAllocatedDialogData,
public dialogRef: MatDialogRef<InstanceNotAllocatedDialog>,
private instanceService: InstanceService
) {}
public data = inject<InstanceNotAllocatedDialogData>(MAT_DIALOG_DATA);
public dialogRef = inject(MatDialogRef<InstanceNotAllocatedDialog>);
private instanceService = inject(InstanceService);

onCloseClick(): void {
this.dialogRef.close();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export class DragAndDropFilesComponent {
@ViewChild('modelFileInput') modelFileInput?: ElementRef;
@Output() filesChange = new EventEmitter<File[]>();

isHovering: boolean = false;
isHovering = false;
@Input() files: File[] = [];

toggleHover(event: boolean) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@

<mat-tree #tree [dataSource]="data()" [childrenAccessor]="childrenAccessor()" [trackBy]="trackByFn" class="non-selectable-tree">
<!-- Leaf node -->
<mat-nested-tree-node *matTreeNodeDef="let node" matTreeNodeToggle matTreeNodePadding (click)="onClick.emit(node)">
<mat-nested-tree-node *matTreeNodeDef="let node" matTreeNodeToggle matTreeNodePadding (click)="clickChange.emit(node)">
<div class="leaf-node">
<span class="node-with-icon">
<mat-icon>description</mat-icon>
{{ node.name }}
@if (enableDelete()) {
<div class="flex-spacer"></div>
<app-tree-actions-menu (onDelete)="onDelete.emit(node)" />
<app-tree-actions-menu (delete)="delete.emit(node)" />
}
</span>
</div>
Expand All @@ -20,7 +20,7 @@
<!-- Parent node (Folder) -->
<mat-nested-tree-node *matTreeNodeDef="let node; when: hasChild" matTreeNodePadding>
<div class="mat-tree-node">
<button mat-icon-button matTreeNodeToggle [attr.aria-label]="'Toggle ' + node.name" (click)="onExpand.emit(node)">
<button mat-icon-button matTreeNodeToggle [attr.aria-label]="'Toggle ' + node.name" (click)="expand.emit(node)">
<mat-icon class="mat-icon-rtl-mirror">
{{ tree.isExpanded(node) ? 'expand_more' : 'chevron_right' }}
</mat-icon>
Expand All @@ -31,7 +31,7 @@
{{ node.name }}
@if (enableDelete()) {
<div class="flex-spacer"></div>
<app-tree-actions-menu (onDelete)="onDelete.emit(node)" />
<app-tree-actions-menu (delete)="delete.emit(node)" />
}
</span>
</div>
Expand All @@ -50,9 +50,9 @@
} @else if (node.state === 'error') {
<mat-icon color="warn">error</mat-icon>
<span style="margin-left: 8px; color: var(--sys-error)">Error loading folder</span>
<button mat-button color="primary" (click)="onRetry.emit(node.parentId)" style="margin-left: 8px">Retry</button>
<button mat-button color="primary" (click)="retry.emit(node.parentId)" style="margin-left: 8px">Retry</button>
} @else if (node.state === 'load-more') {
<button mat-button color="primary" (click)="onLoadMore.emit(node.parentId)">Load More</button>
<button mat-button color="primary" (click)="loadMore.emit(node.parentId)">Load More</button>
}
</div>
</mat-nested-tree-node>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ export class LazyFileTreeComponent {
data = input.required<FileTreeNode[]>();
enableDelete = input<boolean>(false);

onDelete = output<ProjectFileNode>();
onClick = output<ProjectFileNode>();
onExpand = output<ProjectFileNode>();
onRetry = output<string | null>();
onLoadMore = output<string | null>();
delete = output<ProjectFileNode>();
clickChange = output<ProjectFileNode>();
expand = output<ProjectFileNode>();
retry = output<string | null>();
loadMore = output<string | null>();

childrenAccessor = input.required<(node: FileTreeNode) => FileTreeNode[] | Observable<FileTreeNode[]>>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<mat-tree #tree [dataSource]="data()" [childrenAccessor]="childrenAccessor" class="non-selectable-tree">
<!-- Leaf node -->
<mat-nested-tree-node *matTreeNodeDef="let node" matTreeNodeToggle matTreeNodePadding (click)="onClick.emit(node)">
<mat-nested-tree-node *matTreeNodeDef="let node" matTreeNodeToggle matTreeNodePadding (click)="clickChange.emit(node)">
<div class="leaf-node">
<span class="node-with-icon">
@if (fileIcon()) {
Expand All @@ -11,7 +11,7 @@

@if (enableDelete()) {
<div class="flex-spacer"></div>
<app-tree-actions-menu (onDelete)="onDelete.emit(node)" />
<app-tree-actions-menu (delete)="delete.emit(node)" />
}
</span>
</div>
Expand All @@ -35,7 +35,7 @@

@if (enableDelete()) {
<div class="flex-spacer"></div>
<app-tree-actions-menu (onDelete)="onDelete.emit(node)" />
<app-tree-actions-menu (delete)="delete.emit(node)" />
}
</span>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ export class SelectableTreeComponent {
fileIcon = input<string | undefined>(undefined);
enableDelete = input<boolean>(false);

onDelete = output<TreeNode>();
onClick = output<TreeNode>();
delete = output<TreeNode>();
clickChange = output<TreeNode>();

childrenAccessor = (node: TreeNodeWithParent) => node.children ?? [];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
</button>

<mat-menu #menu="matMenu">
<button mat-menu-item (click)="onDelete.emit()">
<button mat-menu-item (click)="delete.emit()">
<mat-icon>delete</mat-icon>
<span>Delete</span>
</button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ import { ClickStopPropagation } from '../../../directives/click-stop-propagation
styleUrls: ['./tree-actions-menu.component.scss'],
})
export class TreeActionsMenuComponent {
onDelete = output();
delete = output();
}
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
4 changes: 2 additions & 2 deletions ScriptBeeClient/src/app/directives/file-drop.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ export class FileDropDirective {
@Output() filesHovered = new EventEmitter<boolean>();

@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);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<as-split-area size="65">
<as-split direction="horizontal">
<as-split-area size="25">
<app-script-tree [projectId]="projectId()!" (onFileSelected)="onFileSelected($event)" />
<app-script-tree [projectId]="projectId()!" (fileSelected)="onFileSelected($event)" />
</as-split-area>

<as-split-area size="75">
Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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'));
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ import { MatIcon } from '@angular/material/icon';
})
export class FileOutputComponent {
files = input.required<AnalysisFile[]>();
// 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);
// });
Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -26,5 +26,5 @@ export class CreateScriptDialogScriptLanguageComponent {
});
availableScriptLanguagesResourceError = computed(() => convertError(this.availableScriptLanguagesResource.error()));

constructor(private projectStructureService: ProjectStructureService) {}
private projectStructureService = inject(ProjectStructureService);
}
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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<CreateScriptDialogComponent>,
private projectStructureService: ProjectStructureService
) {}
public data = inject<CreateScriptDialogData>(MAT_DIALOG_DATA);
public dialogRef = inject(MatDialogRef<CreateScriptDialogComponent>);
private projectStructureService = inject(ProjectStructureService);

onParametersChange(parameters: ScriptParameter[]) {
this.parameters.set(parameters);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)" />
}
Loading