Revision 50977
Added by Myrto Koukouli about 6 years ago
sources-update-repo.component.ts | ||
---|---|---|
1 | 1 |
import { Component, OnInit, Type } from '@angular/core'; |
2 | 2 |
import { FormArray, FormBuilder, FormGroup } from '@angular/forms'; |
3 | 3 |
import { DatasourceInterfaceFormComponent } from './sources-forms/datasource-interface-form.component'; |
4 |
import { RepositoryInterface } from '../../domain/typeScriptClasses'; |
|
4 |
import { Repository, RepositoryInterface } from '../../domain/typeScriptClasses';
|
|
5 | 5 |
import { RepositoryService } from '../../services/repository.service'; |
6 | 6 |
import { ActivatedRoute } from '@angular/router'; |
7 | 7 |
import { |
8 | 8 |
Description, |
9 | 9 |
interfaceFormDesc, |
10 | 10 |
} from '../../domain/oa-description'; |
11 |
import { Subject } from 'rxjs/Subject'; |
|
12 | 11 |
|
13 | 12 |
|
14 | 13 |
|
... | ... | |
20 | 19 |
export class SourcesUpdateRepoComponent implements OnInit { |
21 | 20 |
|
22 | 21 |
repoId: string; |
22 |
repo: Repository; |
|
23 | 23 |
repoInterfaces: RepositoryInterface[] = []; |
24 | 24 |
loadInterfaces: boolean; |
25 | 25 |
|
26 | 26 |
group: FormGroup; |
27 | 27 |
interfaceFormDesc: Description = interfaceFormDesc; |
28 | 28 |
updateDatasourceInterfaces: Type<any> = DatasourceInterfaceFormComponent; |
29 |
exportedData: string[]; |
|
30 | 29 |
|
31 | 30 |
constructor ( |
32 | 31 |
private fb: FormBuilder, |
... | ... | |
58 | 57 |
); |
59 | 58 |
} |
60 | 59 |
|
61 |
getExportedData(data: string[]) {
|
|
62 |
this.exportedData = data;
|
|
60 |
getCurrentRepo(repo: Repository) {
|
|
61 |
this.repo = repo;
|
|
63 | 62 |
} |
64 | 63 |
|
65 |
loadInterfacesTab() { |
|
66 |
this.getRepoInterfaces(); |
|
67 |
/* console.log("PATCHING"); |
|
68 |
let patched = []; |
|
69 |
this.repoInterfaces.forEach(item => { |
|
70 |
patched.push({ |
|
71 |
baseUrl : item.baseUrl, |
|
72 |
selectValidationSet : item.accessSet, |
|
73 |
compatibilityLevel : item.desiredCompatibilityLevel |
|
74 |
}); |
|
75 |
}); |
|
76 |
this.group.patchValue(patched); |
|
77 |
console.log(`PATCHED: ${JSON.stringify(patched)}`);*/ |
|
78 |
} |
|
79 | 64 |
|
80 |
|
|
81 | 65 |
} |
Also available in: Unified diff
finalized sources register and update