Revision 59207
Added by Andreas Mantas about 3 years ago
modules/uoa-repository-dashboard-gui/branches/new-ui/src/app/pages/sources/sources-register/register-new-datasource.component.ts | ||
---|---|---|
22 | 22 |
repo: Repository = null; |
23 | 23 |
repoInterfaces: RepositoryInterface[] = []; |
24 | 24 |
interfacesToDelete: string[] = []; |
25 |
// comments: string; |
|
25 | 26 |
|
26 | 27 |
/* queryParams are used to follow the steps without refreshing the page |
27 | 28 |
* This was needed for Help Service [which sends back info according to the current router.url]. |
... | ... | |
41 | 42 |
@ViewChild ('registerDatasource') |
42 | 43 |
registerDatasource: DatasourceCreateFormComponent; |
43 | 44 |
|
45 |
@ViewChild ('interfaceComments') |
|
46 |
interfaceComments: DatasourceNewInterfaceFormComponent; |
|
47 |
|
|
44 | 48 |
@ViewChildren('interfacesArray') interfacesArray: QueryList<DatasourceNewInterfaceFormComponent>; |
45 | 49 |
dataForInterfaceComp: any[] = []; |
46 | 50 |
|
... | ... | |
237 | 241 |
from(this.repoInterfaces).pipe( |
238 | 242 |
concatMap(intrf => { |
239 | 243 |
if (intrf.id) { |
240 |
return this.repoService.updateInterface(this.repo.id, this.repo.registeredBy, intrf); |
|
244 |
const comments = this.interfaceComments.getComments(); |
|
245 |
return this.repoService.updateInterface(this.repo.id, this.repo.registeredBy, comments, intrf); |
|
241 | 246 |
} else { |
242 |
return this.repoService.addInterface(this.repo.datasourceType, this.repo.id, this.repo.registeredBy, intrf); |
|
247 |
const comments = this.interfaceComments.getComments(); |
|
248 |
return this.repoService.addInterface(this.repo.datasourceType, this.repo.id, this.repo.registeredBy, comments, intrf); |
|
243 | 249 |
} |
244 | 250 |
}) |
245 | 251 |
).subscribe( |
modules/uoa-repository-dashboard-gui/branches/new-ui/src/app/pages/sources/sources-register/register-existing-datasource.component.ts | ||
---|---|---|
34 | 34 |
repo: Repository; |
35 | 35 |
repoInterfaces: RepositoryInterface[] = []; |
36 | 36 |
interfacesToDelete: string[] = []; |
37 |
// comments: string; |
|
37 | 38 |
|
38 | 39 |
/* queryParams are used to follow the steps without refreshing the page |
39 | 40 |
* This was needed for Help Service [which sends back info according to the current router.url]. |
... | ... | |
56 | 57 |
@ViewChild ('registerDatasource') |
57 | 58 |
registerDatasource: DatasourceUpdateFormComponent; |
58 | 59 |
|
60 |
@ViewChild ('interfaceComments') |
|
61 |
interfaceComments: DatasourceNewInterfaceFormComponent; |
|
62 |
|
|
59 | 63 |
@ViewChildren('interfacesArray') interfacesArray: QueryList<DatasourceNewInterfaceFormComponent>; |
60 | 64 |
dataForInterfaceComp: any[] = []; |
61 | 65 |
|
... | ... | |
352 | 356 |
if (this.interfacesToDelete.some(id => id === intrf.id)) { |
353 | 357 |
req = this.repoService.deleteInterface(intrf.id, this.repo.registeredBy); |
354 | 358 |
} else { |
355 |
req = this.repoService.updateInterface(this.repo.id, this.repo.registeredBy, intrf); |
|
359 |
const comments = this.interfaceComments.getComments(); |
|
360 |
req = this.repoService.updateInterface(this.repo.id, this.repo.registeredBy, comments, intrf); |
|
356 | 361 |
} |
357 | 362 |
return req; |
358 | 363 |
} else { |
359 |
return this.repoService.addInterface(this.repo.datasourceType, this.repo.id, this.repo.registeredBy, intrf); |
|
364 |
const comments = this.interfaceComments.getComments(); |
|
365 |
return this.repoService.addInterface(this.repo.datasourceType, this.repo.id, this.repo.registeredBy, comments, intrf); |
|
360 | 366 |
} |
361 | 367 |
}) |
362 | 368 |
).subscribe( |
modules/uoa-repository-dashboard-gui/branches/new-ui/src/app/services/repository.service.ts | ||
---|---|---|
33 | 33 |
|
34 | 34 |
constructor(private httpClient: HttpClient) { } |
35 | 35 |
|
36 |
addInterface(datatype: string, repoId: string, registeredBy: string, newInterface: RepositoryInterface): Observable<RepositoryInterface> { |
|
37 |
const url = `${this.apiUrl}addInterface?datatype=${datatype}&repoId=${repoId}®isteredBy=${registeredBy}`; |
|
36 |
addInterface(datatype: string, repoId: string, registeredBy: string, comment: string, newInterface: RepositoryInterface): Observable<RepositoryInterface> {
|
|
37 |
const url = `${this.apiUrl}addInterface?datatype=${datatype}&repoId=${repoId}®isteredBy=${registeredBy}&comment=${comment}`;
|
|
38 | 38 |
console.log(`knocking on: ${url}`); |
39 | 39 |
console.log(`sending ${JSON.stringify(newInterface)}`); |
40 | 40 |
return this.httpClient.post<RepositoryInterface>(url, newInterface, headerOptions); |
41 | 41 |
} |
42 | 42 |
|
43 |
updateInterface(repoId: string, registeredBy: string, interfaceInfo: RepositoryInterface): Observable<RepositoryInterface> { |
|
44 |
const url = `${this.apiUrl}updateRepositoryInterface?repoId=${repoId}®isteredBy=${registeredBy}`; |
|
43 |
updateInterface(repoId: string, registeredBy: string, comment: string, interfaceInfo: RepositoryInterface): Observable<RepositoryInterface> {
|
|
44 |
const url = `${this.apiUrl}updateRepositoryInterface?repoId=${repoId}®isteredBy=${registeredBy}&comment=${comment}`;
|
|
45 | 45 |
console.log(`knocking on: ${url}`); |
46 | 46 |
console.log(`sending ${JSON.stringify(interfaceInfo)}`); |
47 | 47 |
return this.httpClient.post<RepositoryInterface>(url, interfaceInfo, headerOptions); |
modules/uoa-repository-dashboard-gui/branches/new-ui/src/app/shared/reusablecomponents/sources-forms/datasource-new-interface-form.component.html | ||
---|---|---|
139 | 139 |
<!--</div>--> |
140 | 140 |
|
141 | 141 |
<div class="uk-margin-medium-top"> |
142 |
<label class="" for="comments" title="{{ commentsDesc.desc }}">Comments</label>
|
|
143 |
<textarea id="comments" class="uk-textarea" rows="3" formControlName="comments"></textarea>
|
|
142 |
<label class="" for="comment" title="{{ commentDesc.desc }}">Comments</label>
|
|
143 |
<textarea id="comment" class="uk-textarea" rows="3" formControlName="comment"></textarea>
|
|
144 | 144 |
</div> |
145 | 145 |
|
146 | 146 |
</div> |
modules/uoa-repository-dashboard-gui/branches/new-ui/src/app/shared/reusablecomponents/sources-forms/datasource-new-interface-form.component.ts | ||
---|---|---|
1 | 1 |
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; |
2 | 2 |
import { FormBuilder, FormGroup, Validators } from '@angular/forms'; |
3 |
import { baseUrlDesc, compatibilityLevelDesc, customValSetDesc, Description, existingValSetDesc, commentsDesc } from '../../../domain/oa-description';
|
|
3 |
import { baseUrlDesc, compatibilityLevelDesc, customValSetDesc, Description, existingValSetDesc, commentDesc } from '../../../domain/oa-description'; |
|
4 | 4 |
import { InterfaceInformation, RepositoryInterface } from '../../../domain/typeScriptClasses'; |
5 | 5 |
import { ValidatorService } from '../../../services/validator.service'; |
6 | 6 |
import { RepositoryService } from '../../../services/repository.service'; |
... | ... | |
39 | 39 |
selectValidationSet: [''], |
40 | 40 |
customValidationSet: [''], |
41 | 41 |
compatibilityLevel: [''], |
42 |
comments: ['']
|
|
42 |
comment: [''] |
|
43 | 43 |
}; |
44 | 44 |
baseUrlDesc: Description = baseUrlDesc; |
45 | 45 |
existingValSetDesc: Description = existingValSetDesc; |
46 | 46 |
customValSetDesc: Description = customValSetDesc; |
47 | 47 |
compatibilityLevelDesc: Description = compatibilityLevelDesc; |
48 |
commentsDesc: Description = commentsDesc;
|
|
48 |
commentDesc: Description = commentDesc;
|
|
49 | 49 |
|
50 | 50 |
identifiedBaseUrl: boolean; |
51 | 51 |
showIdentifiedBaseUrl: boolean; |
... | ... | |
54 | 54 |
classCodes: string[] = []; |
55 | 55 |
compClasses: Map<string, string> = new Map<string, string>(); |
56 | 56 |
existingValSet: boolean; |
57 |
comments: string; |
|
57 | 58 |
interfaceInfo: InterfaceInformation; |
58 | 59 |
|
59 | 60 |
constructor(private fb: FormBuilder, |
... | ... | |
71 | 72 |
this.currentInterface = this.data[3]; |
72 | 73 |
this.repoInterfaceForm.get('baseUrl').setValue(this.currentInterface.baseUrl); |
73 | 74 |
this.repoInterfaceForm.get('compatibilityLevel').setValue(this.currentInterface.desiredCompatibilityLevel); |
74 |
this.repoInterfaceForm.get('comments').setValue(this.currentInterface.comments); |
|
75 | 75 |
} |
76 | 76 |
this.getInterfaceInfo(); |
77 | 77 |
this.getCompatibilityClasses(); |
... | ... | |
209 | 209 |
compLvl = this.existingCompLevel; |
210 | 210 |
} |
211 | 211 |
let comment = ''; |
212 |
if (this.repoInterfaceForm.get('comments').value) {
|
|
213 |
comment = this.repoInterfaceForm.get('comments').value;
|
|
212 |
if (this.repoInterfaceForm.get('comment').value) { |
|
213 |
comment = this.repoInterfaceForm.get('comment').value; |
|
214 | 214 |
} |
215 | 215 |
|
216 | 216 |
if (this.currentInterface) { |
... | ... | |
257 | 257 |
currentInterface.desiredCompatibilityLevel = compLvl; |
258 | 258 |
currentInterface.compliance = compLvl; |
259 | 259 |
currentInterface.typology = this.currentRepo.datasourceClass; |
260 |
currentInterface.comments = comment;
|
|
260 |
this.comments = comment;
|
|
261 | 261 |
|
262 | 262 |
if (!this.inRegister) { |
263 | 263 |
this.addInterface(currentInterface); |
... | ... | |
273 | 273 |
this.repoService.addInterface(this.currentRepo.datasourceType, |
274 | 274 |
this.currentRepo.id, |
275 | 275 |
this.currentRepo.registeredBy, |
276 |
this.comments, |
|
276 | 277 |
newInterface).subscribe( |
277 | 278 |
addedInterface => { |
278 | 279 |
console.log(`addInterface responded ${JSON.stringify(addedInterface)}`); |
... | ... | |
305 | 306 |
this.currentInterface.desiredCompatibilityLevel = compLvl; |
306 | 307 |
this.currentInterface.compliance = compLvl; |
307 | 308 |
this.currentInterface.typology = this.currentRepo.datasourceClass; |
308 |
this.currentInterface.comments = comment;
|
|
309 |
this.comments = comment; |
|
309 | 310 |
|
310 | 311 |
if (!this.inRegister) { |
311 | 312 |
this.updateInterface(); |
... | ... | |
320 | 321 |
this.loadingMessage = formSubmitting; |
321 | 322 |
this.repoService.updateInterface(this.currentRepo.id, |
322 | 323 |
this.currentRepo.registeredBy, |
324 |
this.comments, |
|
323 | 325 |
this.currentInterface).subscribe( |
324 | 326 |
response => { |
325 | 327 |
console.log(`updateRepository responded ${JSON.stringify(response)}`); |
... | ... | |
364 | 366 |
return this.interfaceToExport; |
365 | 367 |
} |
366 | 368 |
|
369 |
getComments() { |
|
370 |
return this.comments; |
|
371 |
} |
|
372 |
|
|
367 | 373 |
} |
modules/uoa-repository-dashboard-gui/branches/new-ui/src/app/domain/oa-description.ts | ||
---|---|---|
185 | 185 |
recommended: false |
186 | 186 |
}; |
187 | 187 |
|
188 |
export const commentsDesc = {
|
|
188 |
export const commentDesc = { |
|
189 | 189 |
desc: 'Add your comments regarding the interface.', |
190 | 190 |
label: 'Comments', |
191 | 191 |
mandatory: false, |
modules/uoa-repository-dashboard-gui/branches/new-ui/src/app/domain/typeScriptClasses.ts | ||
---|---|---|
226 | 226 |
removable: boolean; |
227 | 227 |
accessParams: { [index: string]: string }; |
228 | 228 |
extraFields: { [index: string]: string }; |
229 |
comments: string; |
|
230 | 229 |
} |
231 | 230 |
|
232 | 231 |
export class SearchCriteriaImpl implements SearchCriteria { |
Also available in: Unified diff
changes on interface-form comments