Project

General

Profile

« Previous | Next » 

Revision 62559

Added by John Balasis over 1 year ago

finaly after so much rage it works probaply...

View differences:

datasource-new-interface-form.component.ts
57 57
  existingCompLevel: string;
58 58
  classCodes: string[] = [];
59 59
  compClasses: Map<string, string> = new Map<string, string>();
60
  existingValSet: boolean;
61 60
  interfaceInfo: InterfaceInformation;
62 61

  
63 62
  constructor(private fb: FormBuilder,
......
196 195
    this.successMessage = '';
197 196
    if (this.formIsValid()) {
198 197
      const baseurl = this.repoInterfaceForm.get('baseurl').value;
199
      let valset = '';
200
      if (this.existingValSet) {
201
        valset = this.repoInterfaceForm.get('selectValidationSet').value;
202
      }
203
      let desiredCompLvl = '';
204
      if (this.repoInterfaceForm.get('compatibilityLevel').value) {
205
        // this.existingCompLevel = this.compClasses[this.repoInterfaceForm.get('compatibilityLevel').value];
206
        // console.log('this.existingCompLevel is', this.existingCompLevel);
207
        this.currentInterface.desiredCompatibilityLevel = this.repoInterfaceForm.get('desiredCompatibilityLevel').value;
208
        desiredCompLvl = this.repoInterfaceForm.get('desiredCompatibilityLevel').value;
209
      }
198
      const valset = this.repoInterfaceForm.get('selectValidationSet').value;
199
      const desiredCompLvl = this.repoInterfaceForm.get('desiredCompatibilityLevel').value;
210 200
      const compLvl = this.existingCompLevel;
211 201
      let comment = '';
212 202
      if (this.repoInterfaceForm.get('comment').value) {
......
231 221
      intrf = new RepositoryInterface();
232 222
    }
233 223
    intrf.baseurl = this.repoInterfaceForm.get('baseurl').value;
234
    this.updateValidationSet(intrf, this.repoInterfaceForm.get(this.existingValSet ? 'selectValidationSet' : 'customValidationSet').value);
224
    this.updateValidationSet(intrf, this.repoInterfaceForm.get('selectValidationSet').value);
235 225
    console.log(intrf);
236 226
    if (this.repoInterfaceForm.get('compatibilityLevel').value) {
237 227
      intrf.compatibilityOverride = this.repoInterfaceForm.get('compatibilityLevel').value;
......
266 256
    this.currentInterface.comments = comment;
267 257

  
268 258
    if (!this.inRegister) {
269
      this.addInterface(this.currentInterface);
259
      this.addInterface();
270 260
    } else {
271 261
      this.successMessage = 'The harvesting settings are valid!';
272 262
      console.log('SAVED !');
......
274 264
    }
275 265
  }
276 266

  
277
  addInterface(newInterface: RepositoryInterface) {
267
  addInterface() {
278 268
    this.loadingMessage = formSubmitting;
279 269
    this.repoService.addInterface(this.currentRepo.datasourceType, this.currentRepo.id,
280 270
                                  this.currentRepo.registeredBy, this.currentRepo.comments, this.currentInterface,
281 271
                                  this.repoInterfaceForm.get('desiredCompatibilityLevel').value).subscribe(
282 272
      addedInterface => {
283 273
        console.log(`addInterface responded ${JSON.stringify(addedInterface)}`);
284
        // this.currentInterface = addedInterface;
274
        this.currentInterface = addedInterface;
285 275
      },
286 276
      error => {
287 277
        console.log(error);
......
307 297
    this.updateValidationSet(this.currentInterface, valset);
308 298
    this.currentInterface.baseurl = baseurl;
309 299
    this.currentInterface.desiredCompatibilityLevel = desiredCompLvl;
300
    console.log(this.currentInterface.desiredCompatibilityLevel);
310 301
    this.currentInterface.compatibility = compLvl;
311 302
    this.currentInterface.typology = this.currentRepo.datasourceClass;
312 303
    this.currentInterface.comments = comment;

Also available in: Unified diff