Revision 60937
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 | ||
---|---|---|
241 | 241 |
from(this.repoInterfaces).pipe( |
242 | 242 |
concatMap(intrf => { |
243 | 243 |
if (intrf.id) { |
244 |
const comments = this.interfaceComments.getComments();
|
|
245 |
return this.repoService.updateInterface(this.repo.id, this.repo.registeredBy, comments, intrf); |
|
244 |
// console.log('comments', intrf.comments);
|
|
245 |
return this.repoService.updateInterface(this.repo.id, this.repo.registeredBy, intrf.comments, intrf);
|
|
246 | 246 |
} else { |
247 |
const comments = this.interfaceComments.getComments();
|
|
248 |
return this.repoService.addInterface(this.repo.datasourceType, this.repo.id, this.repo.registeredBy, comments, intrf); |
|
247 |
// console.log('comments', intrf.comments);
|
|
248 |
return this.repoService.addInterface(this.repo.datasourceType, this.repo.id, this.repo.registeredBy, intrf.comments, intrf);
|
|
249 | 249 |
} |
250 | 250 |
}) |
251 | 251 |
).subscribe( |
modules/uoa-repository-dashboard-gui/branches/new-ui/src/app/pages/sources/sources-register/register-existing-datasource.component.ts | ||
---|---|---|
356 | 356 |
if (this.interfacesToDelete.some(id => id === intrf.id)) { |
357 | 357 |
req = this.repoService.deleteInterface(intrf.id, this.repo.registeredBy); |
358 | 358 |
} else { |
359 |
const comments = this.interfaceComments.getComments();
|
|
360 |
req = this.repoService.updateInterface(this.repo.id, this.repo.registeredBy, comments, intrf); |
|
359 |
// console.log('comments', intrf.comments);
|
|
360 |
req = this.repoService.updateInterface(this.repo.id, this.repo.registeredBy, intrf.comments, intrf);
|
|
361 | 361 |
} |
362 | 362 |
return req; |
363 | 363 |
} else { |
364 |
const comments = this.interfaceComments.getComments();
|
|
365 |
return this.repoService.addInterface(this.repo.datasourceType, this.repo.id, this.repo.registeredBy, comments, intrf); |
|
364 |
// console.log('comments', intrf.comments);
|
|
365 |
return this.repoService.addInterface(this.repo.datasourceType, this.repo.id, this.repo.registeredBy, intrf.comments, intrf);
|
|
366 | 366 |
} |
367 | 367 |
}) |
368 | 368 |
).subscribe( |
modules/uoa-repository-dashboard-gui/branches/new-ui/src/app/services/repository.service.ts | ||
---|---|---|
34 | 34 |
constructor(private httpClient: HttpClient) { } |
35 | 35 |
|
36 | 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}`; |
|
37 |
let url; |
|
38 |
if (comment == null || comment === '') { |
|
39 |
url = `${this.apiUrl}addInterface?datatype=${datatype}&repoId=${repoId}®isteredBy=${registeredBy}`; |
|
40 |
} else { |
|
41 |
url = `${this.apiUrl}addInterface?datatype=${datatype}&repoId=${repoId}®isteredBy=${registeredBy}&comment=${comment}`; |
|
42 |
} |
|
38 | 43 |
console.log(`knocking on: ${url}`); |
39 | 44 |
console.log(`sending ${JSON.stringify(newInterface)}`); |
40 | 45 |
return this.httpClient.post<RepositoryInterface>(url, newInterface, headerOptions); |
41 | 46 |
} |
42 | 47 |
|
43 | 48 |
updateInterface(repoId: string, registeredBy: string, comment: string, interfaceInfo: RepositoryInterface): Observable<RepositoryInterface> { |
44 |
const url = `${this.apiUrl}updateRepositoryInterface?repoId=${repoId}®isteredBy=${registeredBy}&comment=${comment}`; |
|
49 |
let url; |
|
50 |
if (comment == null || comment === '') { |
|
51 |
url = `${this.apiUrl}updateRepositoryInterface?repoId=${repoId}®isteredBy=${registeredBy}`; |
|
52 |
} else { |
|
53 |
url = `${this.apiUrl}updateRepositoryInterface?repoId=${repoId}®isteredBy=${registeredBy}&comment=${comment}`; |
|
54 |
} |
|
45 | 55 |
console.log(`knocking on: ${url}`); |
46 | 56 |
console.log(`sending ${JSON.stringify(interfaceInfo)}`); |
47 | 57 |
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 | ||
---|---|---|
140 | 140 |
|
141 | 141 |
<div class="uk-margin-medium-top"> |
142 | 142 |
<label class="" for="comment" title="{{ commentDesc.desc }}">Comments (What else do we need to know?)</label> |
143 |
<textarea id="comment" class="uk-textarea" rows="3" formControlName="comment"></textarea> |
|
143 |
<textarea id="comment" class="uk-textarea" rows="3" formControlName="comment" (blur)="checkIfValid()"></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 | ||
---|---|---|
12 | 12 |
datasourceType: string; |
13 | 13 |
datasourceClass: string; |
14 | 14 |
registeredBy: string; |
15 |
comments: string; |
|
15 | 16 |
} |
16 | 17 |
|
17 | 18 |
@Component({ |
... | ... | |
54 | 55 |
classCodes: string[] = []; |
55 | 56 |
compClasses: Map<string, string> = new Map<string, string>(); |
56 | 57 |
existingValSet: boolean; |
57 |
comments: string; |
|
58 | 58 |
interfaceInfo: InterfaceInformation; |
59 | 59 |
|
60 | 60 |
constructor(private fb: FormBuilder, |
... | ... | |
258 | 258 |
currentInterface.desiredCompatibilityLevel = compLvl; |
259 | 259 |
currentInterface.compliance = compLvl; |
260 | 260 |
currentInterface.typology = this.currentRepo.datasourceClass; |
261 |
this.comments = comment;
|
|
261 |
currentInterface.comments = comment;
|
|
262 | 262 |
|
263 | 263 |
if (!this.inRegister) { |
264 | 264 |
this.addInterface(currentInterface); |
... | ... | |
274 | 274 |
this.repoService.addInterface(this.currentRepo.datasourceType, |
275 | 275 |
this.currentRepo.id, |
276 | 276 |
this.currentRepo.registeredBy, |
277 |
this.comments, |
|
277 |
this.currentRepo.comments,
|
|
278 | 278 |
newInterface).subscribe( |
279 | 279 |
addedInterface => { |
280 | 280 |
console.log(`addInterface responded ${JSON.stringify(addedInterface)}`); |
... | ... | |
307 | 307 |
this.currentInterface.desiredCompatibilityLevel = compLvl; |
308 | 308 |
this.currentInterface.compliance = compLvl; |
309 | 309 |
this.currentInterface.typology = this.currentRepo.datasourceClass; |
310 |
this.comments = comment; |
|
310 |
this.currentInterface.comments = comment;
|
|
311 | 311 |
|
312 | 312 |
if (!this.inRegister) { |
313 | 313 |
this.updateInterface(); |
... | ... | |
322 | 322 |
this.loadingMessage = formSubmitting; |
323 | 323 |
this.repoService.updateInterface(this.currentRepo.id, |
324 | 324 |
this.currentRepo.registeredBy, |
325 |
this.comments, |
|
325 |
this.currentRepo.comments,
|
|
326 | 326 |
this.currentInterface).subscribe( |
327 | 327 |
response => { |
328 | 328 |
console.log(`updateRepository responded ${JSON.stringify(response)}`); |
... | ... | |
367 | 367 |
return this.interfaceToExport; |
368 | 368 |
} |
369 | 369 |
|
370 |
getComments() { |
|
371 |
return this.comments; |
|
372 |
} |
|
373 |
|
|
374 | 370 |
} |
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; |
|
229 | 230 |
} |
230 | 231 |
|
231 | 232 |
export class SearchCriteriaImpl implements SearchCriteria { |
Also available in: Unified diff
fixed comments bug on interfaces