diff --git a/egacy-peer-deps b/egacy-peer-deps new file mode 100644 index 0000000..1bbd89c --- /dev/null +++ b/egacy-peer-deps @@ -0,0 +1,95 @@ +[INFO] Scanning for projects... +[INFO] +[INFO] -----------------< org.gcube.isdashboard:isdashboard >------------------ +[INFO] Building Isdashboard 0.0.1-SNAPSHOT +[INFO] from pom.xml +[INFO] --------------------------------[ jar ]--------------------------------- +[INFO] +[INFO] >>> spring-boot:3.1.1:run (default-cli) > test-compile @ isdashboard >>> +[INFO] +[INFO] --- resources:3.3.1:copy-resources (default-resources) @ isdashboard --- +[INFO] Copying 4 resources from src/main/resources to target/classes +[INFO] Copying 5 resources from src/main/resources to target/classes +[INFO] +[INFO] --- resources:3.3.1:resources (default-resources) @ isdashboard --- +[INFO] Copying 4 resources from src/main/resources to target/classes +[INFO] Copying 5 resources from src/main/resources to target/classes +[INFO] +[INFO] --- enforcer:3.3.0:enforce (enforce-versions) @ isdashboard --- +[INFO] Rule 0: org.apache.maven.enforcer.rules.version.RequireMavenVersion passed +[INFO] Rule 1: org.apache.maven.enforcer.rules.version.RequireJavaVersion passed +[INFO] +[INFO] --- enforcer:3.3.0:enforce (enforce-dependencyConvergence) @ isdashboard --- +[INFO] Rule 0: org.apache.maven.enforcer.rules.dependency.DependencyConvergence passed +[INFO] +[INFO] --- properties:1.1.0:read-project-properties (default) @ isdashboard --- +[INFO] +[INFO] --- jacoco:0.8.10:prepare-agent (pre-unit-tests) @ isdashboard --- +[INFO] argLine set to -javaagent:/Users/mariateresaparatore/.m2/repository/org/jacoco/org.jacoco.agent/0.8.10/org.jacoco.agent-0.8.10-runtime.jar=destfile=/Users/mariateresaparatore/Documents/workspace-spring/isdashboard/target/jacoco.exec -Djava.security.egd=file:/dev/./urandom -Xmx1G +[INFO] +[INFO] --- spotless:2.37.0:apply (spotless) @ isdashboard --- +[INFO] Spotless.Java is keeping 45 files clean - 0 were changed to be clean, 0 were already clean, 45 were skipped because caching determined they were already clean +[INFO] +[INFO] --- checksum:1.11:files (create-pre-compiled-webapp-checksum) @ isdashboard --- +[INFO] +[INFO] --- antrun:3.1.0:run (eval-frontend-checksum) @ isdashboard --- +[INFO] Executing tasks +[INFO] Executed tasks +[INFO] +[INFO] --- frontend:1.13.4:install-node-and-npm (install-node-and-npm) @ isdashboard --- +[INFO] Node v18.16.1 is already installed. +[INFO] NPM 9.8.0 is already installed. +[INFO] +[INFO] --- frontend:1.13.4:npm (npm install) @ isdashboard --- +[INFO] Running 'npm install' in /Users/mariateresaparatore/Documents/workspace-spring/isdashboard +[INFO] npm ERR! code ERESOLVE +[INFO] npm ERR! ERESOLVE unable to resolve dependency tree +[INFO] npm ERR! +[INFO] npm ERR! While resolving: isdashboard@0.0.1-SNAPSHOT +[INFO] npm ERR! Found: @angular/core@16.1.4 +[INFO] npm ERR! node_modules/@angular/core +[INFO] npm ERR! @angular/core@"16.1.4" from the root project +[INFO] npm ERR! peer @angular/core@"^16.0.0 || ^17.0.0" from @angular/material-moment-adapter@16.1.4 +[INFO] npm ERR! node_modules/@angular/material-moment-adapter +[INFO] npm ERR! @angular/material-moment-adapter@"16.1.4" from the root project +[INFO] npm ERR! 1 more (@angular/material) +[INFO] npm ERR! +[INFO] npm ERR! Could not resolve dependency: +[INFO] npm ERR! peer @angular/core@"16.2.4" from @angular/animations@16.2.4 +[INFO] npm ERR! node_modules/@angular/animations +[INFO] npm ERR! @angular/animations@"^16.1.4" from the root project +[INFO] npm ERR! peer @angular/animations@"^16.0.0 || ^17.0.0" from @angular/material@16.1.4 +[INFO] npm ERR! node_modules/@angular/material +[INFO] npm ERR! @angular/material@"^16.1.4" from the root project +[INFO] npm ERR! 1 more (@angular/material-moment-adapter) +[INFO] npm ERR! +[INFO] npm ERR! Fix the upstream dependency conflict, or retry +[INFO] npm ERR! this command with --force or --legacy-peer-deps +[INFO] npm ERR! to accept an incorrect (and potentially broken) dependency resolution. +[INFO] npm ERR! +[INFO] npm ERR! +[INFO] npm ERR! For a full report see: +[INFO] npm ERR! /Users/mariateresaparatore/.npm/_logs/2023-09-13T08_30_20_929Z-eresolve-report.txt +[INFO] +[INFO] npm ERR! A complete log of this run can be found in: /Users/mariateresaparatore/.npm/_logs/2023-09-13T08_30_20_929Z-debug-0.log +[INFO] ------------------------------------------------------------------------ +[INFO] BUILD FAILURE +[INFO] ------------------------------------------------------------------------ +[INFO] Total time: 9.541 s +[INFO] Finished at: 2023-09-13T10:30:23+02:00 +[INFO] ------------------------------------------------------------------------ +[WARNING] +[WARNING] Plugin validation issues were detected in 2 plugin(s) +[WARNING] +[WARNING] * org.jacoco:jacoco-maven-plugin:0.8.10 +[WARNING] * org.apache.maven.plugins:maven-resources-plugin:3.3.1 +[WARNING] +[WARNING] For more or less details, use 'maven.plugin.validation' property with one of the values (case insensitive): [BRIEF, DEFAULT, VERBOSE] +[WARNING] +[ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.13.4:npm (npm install) on project isdashboard: Failed to run task: 'npm install' failed. org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1) -> [Help 1] +[ERROR] +[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. +[ERROR] Re-run Maven using the -X switch to enable full debug logging. +[ERROR] +[ERROR] For more information about the errors and possible solutions, please read the following articles: +[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException diff --git a/legacy-peer-deps b/legacy-peer-deps new file mode 100644 index 0000000..6dfc210 --- /dev/null +++ b/legacy-peer-deps @@ -0,0 +1,95 @@ +[INFO] Scanning for projects... +[INFO] +[INFO] -----------------< org.gcube.isdashboard:isdashboard >------------------ +[INFO] Building Isdashboard 0.0.1-SNAPSHOT +[INFO] from pom.xml +[INFO] --------------------------------[ jar ]--------------------------------- +[INFO] +[INFO] >>> spring-boot:3.1.1:run (default-cli) > test-compile @ isdashboard >>> +[INFO] +[INFO] --- resources:3.3.1:copy-resources (default-resources) @ isdashboard --- +[INFO] Copying 4 resources from src/main/resources to target/classes +[INFO] Copying 5 resources from src/main/resources to target/classes +[INFO] +[INFO] --- resources:3.3.1:resources (default-resources) @ isdashboard --- +[INFO] Copying 4 resources from src/main/resources to target/classes +[INFO] Copying 5 resources from src/main/resources to target/classes +[INFO] +[INFO] --- enforcer:3.3.0:enforce (enforce-versions) @ isdashboard --- +[INFO] Rule 0: org.apache.maven.enforcer.rules.version.RequireMavenVersion passed +[INFO] Rule 1: org.apache.maven.enforcer.rules.version.RequireJavaVersion passed +[INFO] +[INFO] --- enforcer:3.3.0:enforce (enforce-dependencyConvergence) @ isdashboard --- +[INFO] Rule 0: org.apache.maven.enforcer.rules.dependency.DependencyConvergence passed +[INFO] +[INFO] --- properties:1.1.0:read-project-properties (default) @ isdashboard --- +[INFO] +[INFO] --- jacoco:0.8.10:prepare-agent (pre-unit-tests) @ isdashboard --- +[INFO] argLine set to -javaagent:/Users/mariateresaparatore/.m2/repository/org/jacoco/org.jacoco.agent/0.8.10/org.jacoco.agent-0.8.10-runtime.jar=destfile=/Users/mariateresaparatore/Documents/workspace-spring/isdashboard/target/jacoco.exec -Djava.security.egd=file:/dev/./urandom -Xmx1G +[INFO] +[INFO] --- spotless:2.37.0:apply (spotless) @ isdashboard --- +[INFO] Spotless.Java is keeping 45 files clean - 0 were changed to be clean, 0 were already clean, 45 were skipped because caching determined they were already clean +[INFO] +[INFO] --- checksum:1.11:files (create-pre-compiled-webapp-checksum) @ isdashboard --- +[INFO] +[INFO] --- antrun:3.1.0:run (eval-frontend-checksum) @ isdashboard --- +[INFO] Executing tasks +[INFO] Executed tasks +[INFO] +[INFO] --- frontend:1.13.4:install-node-and-npm (install-node-and-npm) @ isdashboard --- +[INFO] Node v18.16.1 is already installed. +[INFO] NPM 9.8.0 is already installed. +[INFO] +[INFO] --- frontend:1.13.4:npm (npm install) @ isdashboard --- +[INFO] Running 'npm install' in /Users/mariateresaparatore/Documents/workspace-spring/isdashboard +[INFO] npm ERR! code ERESOLVE +[INFO] npm ERR! ERESOLVE unable to resolve dependency tree +[INFO] npm ERR! +[INFO] npm ERR! While resolving: isdashboard@0.0.1-SNAPSHOT +[INFO] npm ERR! Found: @angular/core@16.1.4 +[INFO] npm ERR! node_modules/@angular/core +[INFO] npm ERR! @angular/core@"16.1.4" from the root project +[INFO] npm ERR! peer @angular/core@"^16.0.0 || ^17.0.0" from @angular/material-moment-adapter@16.1.4 +[INFO] npm ERR! node_modules/@angular/material-moment-adapter +[INFO] npm ERR! @angular/material-moment-adapter@"16.1.4" from the root project +[INFO] npm ERR! 1 more (@angular/material) +[INFO] npm ERR! +[INFO] npm ERR! Could not resolve dependency: +[INFO] npm ERR! peer @angular/core@"16.2.4" from @angular/animations@16.2.4 +[INFO] npm ERR! node_modules/@angular/animations +[INFO] npm ERR! @angular/animations@"^16.1.4" from the root project +[INFO] npm ERR! peer @angular/animations@"^16.0.0 || ^17.0.0" from @angular/material@16.1.4 +[INFO] npm ERR! node_modules/@angular/material +[INFO] npm ERR! @angular/material@"^16.1.4" from the root project +[INFO] npm ERR! 1 more (@angular/material-moment-adapter) +[INFO] npm ERR! +[INFO] npm ERR! Fix the upstream dependency conflict, or retry +[INFO] npm ERR! this command with --force or --legacy-peer-deps +[INFO] npm ERR! to accept an incorrect (and potentially broken) dependency resolution. +[INFO] npm ERR! +[INFO] npm ERR! +[INFO] npm ERR! For a full report see: +[INFO] npm ERR! /Users/mariateresaparatore/.npm/_logs/2023-09-11T07_58_56_685Z-eresolve-report.txt +[INFO] +[INFO] npm ERR! A complete log of this run can be found in: /Users/mariateresaparatore/.npm/_logs/2023-09-11T07_58_56_685Z-debug-0.log +[INFO] ------------------------------------------------------------------------ +[INFO] BUILD FAILURE +[INFO] ------------------------------------------------------------------------ +[INFO] Total time: 7.200 s +[INFO] Finished at: 2023-09-11T09:58:58+02:00 +[INFO] ------------------------------------------------------------------------ +[WARNING] +[WARNING] Plugin validation issues were detected in 2 plugin(s) +[WARNING] +[WARNING] * org.jacoco:jacoco-maven-plugin:0.8.10 +[WARNING] * org.apache.maven.plugins:maven-resources-plugin:3.3.1 +[WARNING] +[WARNING] For more or less details, use 'maven.plugin.validation' property with one of the values (case insensitive): [BRIEF, DEFAULT, VERBOSE] +[WARNING] +[ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.13.4:npm (npm install) on project isdashboard: Failed to run task: 'npm install' failed. org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1) -> [Help 1] +[ERROR] +[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. +[ERROR] Re-run Maven using the -X switch to enable full debug logging. +[ERROR] +[ERROR] For more information about the errors and possible solutions, please read the following articles: +[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException diff --git a/src/main/webapp/app/app-routing.module.ts b/src/main/webapp/app/app-routing.module.ts index a7148c5..ebf5b52 100755 --- a/src/main/webapp/app/app-routing.module.ts +++ b/src/main/webapp/app/app-routing.module.ts @@ -12,6 +12,7 @@ import LoginComponent from './login/login.component'; import { UserRouteAccessService } from 'app/core/auth/user-route-access.service'; import { TabbedPageComponent } from './tabbed-page/tabbed-page.component'; import { TableScreenComponent } from './table-screen/table-screen.component'; +import { RscTreeComponent } from './rsc-tree/rsc-tree.component'; @NgModule({ imports: [ @@ -34,6 +35,11 @@ import { TableScreenComponent } from './table-screen/table-screen.component'; path: 'mat-table', component: TableScreenComponent, }, + { + //TEST + path: 'res-tree', + component: RscTreeComponent, + }, { path: '', diff --git a/src/main/webapp/app/rsc-tree/rsc-tree.component.html b/src/main/webapp/app/rsc-tree/rsc-tree.component.html index 8383108..30a93c0 100644 --- a/src/main/webapp/app/rsc-tree/rsc-tree.component.html +++ b/src/main/webapp/app/rsc-tree/rsc-tree.component.html @@ -1,4 +1,27 @@ -

Available contexts

+ +
+
+ + + + +
+ + + + Select a context + + + + +
+ diff --git a/src/main/webapp/app/rsc-tree/rsc-tree.component.scss b/src/main/webapp/app/rsc-tree/rsc-tree.component.scss index 1f6b699..5571f3c 100644 --- a/src/main/webapp/app/rsc-tree/rsc-tree.component.scss +++ b/src/main/webapp/app/rsc-tree/rsc-tree.component.scss @@ -21,7 +21,7 @@ * This padding sets alignment of the nested nodes. */ .example-tree .mat-nested-tree-node div[role='group'] { - padding-left: 30px; + padding-left: 25px; } /* @@ -30,5 +30,5 @@ * under the same parent. */ .example-tree div[role='group'] > .mat-tree-node { - padding-left: 30px; + padding-left: 25px; } diff --git a/src/main/webapp/app/rsc-tree/rsc-tree.component.ts b/src/main/webapp/app/rsc-tree/rsc-tree.component.ts index 8d9c94a..6b0fd6c 100644 --- a/src/main/webapp/app/rsc-tree/rsc-tree.component.ts +++ b/src/main/webapp/app/rsc-tree/rsc-tree.component.ts @@ -1,21 +1,29 @@ -import { Component, OnInit, Output, EventEmitter } from '@angular/core'; +import { Component, OnInit, Output, EventEmitter, AfterViewInit } from '@angular/core'; import { MatTreeNestedDataSource } from '@angular/material/tree'; import { NestedTreeControl } from '@angular/cdk/tree'; import { ResourcesLoaderService } from 'app/services/resources-loader.service'; import { IResource } from 'app/services/i-resource'; +import { ContextsLoaderService } from 'app/services/contexts-loader.service'; +import { IContextNode } from 'app/services/i-context-node'; @Component({ selector: 'jhi-rsc-tree', templateUrl: './rsc-tree.component.html', styleUrls: ['./rsc-tree.component.scss'], - providers: [ResourcesLoaderService], + providers: [ResourcesLoaderService, ContextsLoaderService], }) -export class RscTreeComponent implements OnInit { +export class RscTreeComponent implements OnInit, AfterViewInit { nestedTreeControl = new NestedTreeControl(node => node.children); nestedDataSource = new MatTreeNestedDataSource(); @Output() treeNode = new EventEmitter(); //emitting event to parent + allContexts: IContextNode[]; + rootName: string; - constructor(private myService: ResourcesLoaderService) {} + constructor(private resLoader: ResourcesLoaderService, private ctxLoader: ContextsLoaderService) { + // this.selected = "option2"; + this.allContexts = {} as IContextNode[]; + this.rootName = ''; + } hasNestedChild(_: number, node: IResource): boolean { if (node.children == null) { @@ -26,7 +34,15 @@ export class RscTreeComponent implements OnInit { } ngOnInit(): void { - this.myService.getResourcesByContext().subscribe(res => { + this.ctxLoader.getData().subscribe(res => { + this.allContexts = res; + this.rootName = this.allContexts[0].name; + }); + } + + ngAfterViewInit(): void { + //TODO: qui va passato il CONTEXT_ID alla get + this.resLoader.getResourcesByContext().subscribe(res => { this.nestedDataSource.data = res; }); } diff --git a/src/main/webapp/app/rsc-tree/rsc-tree.module.ts b/src/main/webapp/app/rsc-tree/rsc-tree.module.ts index a86ec01..b86b26b 100644 --- a/src/main/webapp/app/rsc-tree/rsc-tree.module.ts +++ b/src/main/webapp/app/rsc-tree/rsc-tree.module.ts @@ -1,8 +1,13 @@ import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatSelectModule } from '@angular/material/select'; +import { MatButtonModule } from '@angular/material/button'; +import { MatMenuModule } from '@angular/material/menu'; +import { MatIconModule } from '@angular/material/icon'; @NgModule({ declarations: [], - imports: [CommonModule], + imports: [CommonModule, MatFormFieldModule, MatSelectModule, MatButtonModule, MatMenuModule, MatIconModule], }) export class RscTreeModule {} diff --git a/src/main/webapp/app/services/i-resource.ts b/src/main/webapp/app/services/i-resource.ts index 8ced09f..72b7490 100644 --- a/src/main/webapp/app/services/i-resource.ts +++ b/src/main/webapp/app/services/i-resource.ts @@ -1,5 +1,6 @@ export interface IResource { name: string; id: string; + type: number; //TODO: codice da assegnare in constants per ogni tipo di risorsa children?: IResource[]; } diff --git a/src/main/webapp/app/services/resources-loader.service.ts b/src/main/webapp/app/services/resources-loader.service.ts index 6658223..981eecf 100644 --- a/src/main/webapp/app/services/resources-loader.service.ts +++ b/src/main/webapp/app/services/resources-loader.service.ts @@ -27,6 +27,6 @@ export class ResourcesLoaderService { //TODO: a regime questo metodo prende un parametro nella get getResourcesByContext(): Observable { //TODO: pipe per gestione errori - return this.http.get('http://http://localhost:3002/is/ctxresources'); + return this.http.get('http://localhost:3002/is/ctxresources'); } }