Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
802e296
Reapply "Refactor and enhance metadata handling in Submit and Metadat…
ErykKul Sep 16, 2025
2ecf728
refactor(metadata-selector): remove unused dialog and checkbox compon…
ErykKul Sep 16, 2025
69ff4a7
test(submit): add focused unit tests for submit flow, data categoriza…
ErykKul Sep 16, 2025
395a4f2
refactor(submit): remove unused metadata display section from submit …
ErykKul Sep 16, 2025
89668d9
refactor(metadata-selector, submit): streamline metadata handling and…
ErykKul Sep 16, 2025
365f3e7
fmt
ErykKul Sep 16, 2025
35ed84d
refactor(metadata-selector): update button labels for clarity and rem…
ErykKul Sep 16, 2025
718fb6c
refactor(metadata-selector): remove unused 'disabled' property and wa…
ErykKul Sep 16, 2025
e6f7034
refactor(submit): update submit button style for consistency
ErykKul Sep 16, 2025
9a985b9
Update src/app/submit/submit.component.ts
ErykKul Sep 16, 2025
25a9bbb
refactor(submit): improve subscription management and error handling
ErykKul Sep 16, 2025
d728a40
refactor(submit): simplify router navigation state handling
ErykKul Sep 16, 2025
6ecd40d
Update src/app/submit/submit.component.ts
ErykKul Sep 16, 2025
c2f2034
Update src/app/submit/submit.component.ts
ErykKul Sep 16, 2025
aed175a
Update src/app/metadata-selector/metadata-selector.component.ts
ErykKul Sep 16, 2025
459e4ce
Update src/app/metadata-selector/metadata-selector.component.ts
ErykKul Sep 16, 2025
b6eda88
fix(submit): enhance navigation state handling with fallback for rout…
ErykKul Sep 16, 2025
aa2f370
Update src/app/submit/submit.component.ts
ErykKul Sep 16, 2025
97ed826
Update src/app/metadata-selector/metadata-selector.component.ts
ErykKul Sep 16, 2025
cc6fbe4
Update src/app/metadata-selector/metadata-selector.component.ts
ErykKul Sep 16, 2025
b5541b0
Update src/app/metadata-selector/metadata-selector.component.ts
ErykKul Sep 16, 2025
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
18 changes: 10 additions & 8 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,14 @@
"base": "dist/datasync"
},
"index": "src/index.html",
"polyfills": [
"src/polyfills.ts"
],
"polyfills": ["src/polyfills.ts"],
"tsConfig": "tsconfig.app.json",
"inlineStyleLanguage": "scss",
"assets": ["src/favicon.ico", "src/assets"],
"styles": ["node_modules/bootstrap/dist/css/bootstrap.min.css", "src/styles.scss"],
"styles": [
"node_modules/bootstrap/dist/css/bootstrap.min.css",
"src/styles.scss"
],
"scripts": [
"node_modules/bootstrap/dist/js/bootstrap.bundle.min.js"
],
Expand Down Expand Up @@ -90,14 +91,15 @@
"builder": "@angular/build:karma",
"options": {
"main": "src/test.ts",
"polyfills": [
"src/polyfills.ts"
],
"polyfills": ["src/polyfills.ts"],
"tsConfig": "tsconfig.spec.json",
"karmaConfig": "karma.conf.js",
"inlineStyleLanguage": "scss",
"assets": ["src/favicon.ico", "src/assets"],
"styles": ["node_modules/bootstrap/dist/css/bootstrap.min.css", "src/styles.scss"],
"styles": [
"node_modules/bootstrap/dist/css/bootstrap.min.css",
"src/styles.scss"
],
"scripts": []
}
}
Expand Down
27 changes: 15 additions & 12 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,34 @@ export default [
{
rules: {
// TypeScript specific rules (without type information)
"@typescript-eslint/no-unused-vars": ["error", { "argsIgnorePattern": "^_" }],
"@typescript-eslint/no-unused-vars": [
"error",
{ argsIgnorePattern: "^_" },
],
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/prefer-for-of": "error",

// General code quality rules
"prefer-const": "error",
"no-var": "error",
"prefer-arrow-callback": "error",
"prefer-template": "error",
"no-console": ["warn", { "allow": ["warn", "error"] }],
"no-console": ["warn", { allow: ["warn", "error"] }],

// Angular specific patterns
"no-restricted-syntax": [
"error",
{
"selector": "CallExpression[callee.name='alert']",
"message": "Use proper notification system instead of alert()"
}
]
}
selector: "CallExpression[callee.name='alert']",
message: "Use proper notification system instead of alert()",
},
],
},
},
{
files: ["src/**/*.spec.ts"],
rules: {
"@typescript-eslint/no-explicit-any": "off"
}
}
"@typescript-eslint/no-explicit-any": "off",
},
},
];
2 changes: 1 addition & 1 deletion karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
module.exports = function (config) {
config.set({
basePath: "",
frameworks: ["jasmine"],
frameworks: ["jasmine"],
plugins: [
require("karma-jasmine"),
require("karma-chrome-launcher"),
Expand Down
5 changes: 4 additions & 1 deletion src/app/app.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import { TestBed } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing';
import { AppComponent } from './app.component';
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
import {
provideHttpClient,
withInterceptorsFromDi,
} from '@angular/common/http';
import { provideHttpClientTesting } from '@angular/common/http/testing';
import { PrimeNG } from 'primeng/config';

Expand Down
7 changes: 7 additions & 0 deletions src/app/app.routs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ export const routes: Routes = [
loadComponent: () =>
import('./submit/submit.component').then((m) => m.SubmitComponent),
},
{
path: 'metadata-selector',
loadComponent: () =>
import('./metadata-selector/metadata-selector.component').then(
(m) => m.MetadataSelectorComponent,
),
},
{
path: 'compute',
loadComponent: () =>
Expand Down
5 changes: 4 additions & 1 deletion src/app/compare/compare.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
import {
provideHttpClient,
withInterceptorsFromDi,
} from '@angular/common/http';
import { provideHttpClientTesting } from '@angular/common/http/testing';

import { CompareComponent } from './compare.component';
Expand Down
20 changes: 13 additions & 7 deletions src/app/compare/compare.component.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


// Author: Eryk Kulikowski @ KU Leuven (2023). Apache 2.0 License

import { Component, OnInit, OnDestroy, inject } from '@angular/core';
Expand Down Expand Up @@ -39,7 +37,7 @@ import { FilterItem, SubscriptionManager } from '../shared/types';
templateUrl: './compare.component.html',
styleUrls: ['./compare.component.scss'],
imports: [
CommonModule,
CommonModule,
ButtonDirective,
Ripple,
TreeTableModule,
Expand All @@ -49,12 +47,16 @@ import { FilterItem, SubscriptionManager } from '../shared/types';
DatafileComponent,
],
})
export class CompareComponent implements OnInit, OnDestroy, SubscriptionManager {
export class CompareComponent
implements OnInit, OnDestroy, SubscriptionManager
{
private readonly dataUpdatesService = inject(DataUpdatesService);
private readonly dataStateService = inject(DataStateService);
private readonly credentialsService = inject(CredentialsService);
private readonly router = inject(Router);
private readonly folderActionUpdateService = inject(FolderActionUpdateService);
private readonly folderActionUpdateService = inject(
FolderActionUpdateService,
);
private readonly pluginService = inject(PluginService);
private readonly utils = inject(UtilsService);

Expand Down Expand Up @@ -136,7 +138,7 @@ export class CompareComponent implements OnInit, OnDestroy, SubscriptionManager

ngOnDestroy(): void {
// Clean up all subscriptions
this.subscriptions.forEach(sub => sub.unsubscribe());
this.subscriptions.forEach((sub) => sub.unsubscribe());
this.subscriptions.clear();
}

Expand Down Expand Up @@ -317,7 +319,11 @@ export class CompareComponent implements OnInit, OnDestroy, SubscriptionManager

submit(): void {
this.dataStateService.updateState(this.data);
this.router.navigate(['/submit']);
if (this.isNewDataset()) {
this.router.navigate(['/metadata-selector']);
} else {
this.router.navigate(['/submit']);
}
}

// UI helpers
Expand Down
5 changes: 4 additions & 1 deletion src/app/compute/compute.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
import {
provideHttpClient,
withInterceptorsFromDi,
} from '@angular/common/http';
import { provideHttpClientTesting } from '@angular/common/http/testing';
import { RouterTestingModule } from '@angular/router/testing';

Expand Down
30 changes: 15 additions & 15 deletions src/app/compute/compute.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,7 @@ import { ExecutablefileComponent } from '../executablefile/executablefile.compon
import { AutosizeModule } from 'ngx-autosize';

// RxJS
import {
debounceTime,
firstValueFrom,
map,
Observable,
Subject,
} from 'rxjs';
import { debounceTime, firstValueFrom, map, Observable, Subject } from 'rxjs';

// Constants and types
import { APP_CONSTANTS } from '../shared/constants';
Expand All @@ -69,7 +63,9 @@ import { SubscriptionManager } from '../shared/types';
AutosizeModule,
],
})
export class ComputeComponent implements OnInit, OnDestroy, SubscriptionManager {
export class ComputeComponent
implements OnInit, OnDestroy, SubscriptionManager
{
private readonly dvObjectLookupService = inject(DvObjectLookupService);
private readonly pluginService = inject(PluginService);
dataService = inject(DataService);
Expand Down Expand Up @@ -145,23 +141,23 @@ export class ComputeComponent implements OnInit, OnDestroy, SubscriptionManager
(err) =>
(this.doiItems = [
{
label: `search failed: ${ err.message}`,
label: `search failed: ${err.message}`,
value: err.message,
},
]),
),
error: (err) =>
(this.doiItems = [
{ label: `search failed: ${ err.message}`, value: err.message },
{ label: `search failed: ${err.message}`, value: err.message },
]),
});
}

ngOnDestroy(): void {
// Clean up all subscriptions
this.subscriptions.forEach(sub => sub.unsubscribe());
this.subscriptions.forEach((sub) => sub.unsubscribe());
this.subscriptions.clear();

// Clean up existing observable subscriptions
this.datasetSearchResultsSubscription?.unsubscribe();
}
Expand Down Expand Up @@ -234,7 +230,7 @@ export class ComputeComponent implements OnInit, OnDestroy, SubscriptionManager
return;
}
this.doiItems = [
{ label: `searching "${ searchTerm }"...`, value: searchTerm },
{ label: `searching "${searchTerm}"...`, value: searchTerm },
];
this.datasetSearchSubject.next(searchTerm);
}
Expand Down Expand Up @@ -267,7 +263,9 @@ export class ComputeComponent implements OnInit, OnDestroy, SubscriptionManager
},
error: (err) => {
subscription.unsubscribe();
this.notificationService.showError(`Getting executable files failed: ${err.error}`);
this.notificationService.showError(
`Getting executable files failed: ${err.error}`,
);
},
});
}
Expand Down Expand Up @@ -338,7 +336,9 @@ export class ComputeComponent implements OnInit, OnDestroy, SubscriptionManager
error: (err) => {
subscription.unsubscribe();
this.loading = false;
this.notificationService.showError(`Getting computation results failed: ${err.error}`);
this.notificationService.showError(
`Getting computation results failed: ${err.error}`,
);
},
});
}
Expand Down
5 changes: 4 additions & 1 deletion src/app/connect/connect.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
import {
provideHttpClient,
withInterceptorsFromDi,
} from '@angular/common/http';
import { provideHttpClientTesting } from '@angular/common/http/testing';
import { RouterTestingModule } from '@angular/router/testing';
import { provideNoopAnimations } from '@angular/platform-browser/animations';
Expand Down
Loading