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 c818862..05372b9 100644 --- a/src/main/webapp/app/rsc-tree/rsc-tree.component.html +++ b/src/main/webapp/app/rsc-tree/rsc-tree.component.html @@ -25,7 +25,7 @@ Context UUID - + 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 8bf14fe..434ecda 100644 --- a/src/main/webapp/app/rsc-tree/rsc-tree.component.ts +++ b/src/main/webapp/app/rsc-tree/rsc-tree.component.ts @@ -7,7 +7,7 @@ import { IResource } from 'app/services/i-resource'; import { ContextsLoaderService } from 'app/services/contexts-loader.service'; import { IContextNode } from 'app/services/i-context-node'; import { Observable, map, startWith } from 'rxjs'; -import { AbstractControl, FormBuilder, FormGroup, Validators } from '@angular/forms'; +import { AbstractControl, FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'; import { Clipboard } from '@angular/cdk/clipboard'; @Component({ @@ -96,15 +96,20 @@ export class RscTreeComponent implements OnInit { } } - copyUid(): void { - //const res = this.uidfield ? this.uidfield.value : ''; - const res = this.uidfield.value; - this.clipboard.copy(res); - alert(this.uidfield.value); + copyUid(val: any): void { + // const res = this.uidfield ? this.uidfield.value : ''; + //const res = this.uidfield.value; + //this.clipboard.copy(res); + if (val instanceof FormControl) { + this.clipboard.copy(val.getRawValue().id); + alert('copied!'); + } else { + this.clipboard.copy('invalid value'); + } } //TODO: modificare per gestire eventuali eventi sulla onselect assignUid(uid: string): void { - console.debug('------------UUID:.....' + uid); + // console.debug('------------UUID:.....' + uid); } } 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 ee128b2..d20cd07 100644 --- a/src/main/webapp/app/rsc-tree/rsc-tree.module.ts +++ b/src/main/webapp/app/rsc-tree/rsc-tree.module.ts @@ -25,6 +25,7 @@ import { ClipboardModule } from '@angular/cdk/clipboard'; MatAutocompleteModule, ReactiveFormsModule, TableScreenComponent, + ClipboardModule, ], }) export class RscTreeModule {}