Revision 59207
Added by Andreas Mantas over 3 years ago
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 |
} |
Also available in: Unified diff
changes on interface-form comments