Project

General

Profile

« Previous | Next » 

Revision 62389

View differences:

register-existing-datasource.component.ts
164 164
  }
165 165

  
166 166
  addInterfaceToList(intrf?: RepositoryInterface) {
167

  
168
    console.log('clicked add interface to list');
169

  
170 167
    const curIndex = this.dataForInterfaceComp.length;
171
    const curRepoInfo = { id: this.repo.id, datasourceType: this.repo.datasourceType,
172
      datasourceClass: this.repo.datasourceClass, registeredBy: this.repo.registeredBy };
168
    const curRepoInfo = { id: this.repo.id, datasourceType: this.repo.eoscDatasourceType,
169
      datasourceClass: this.repo.eoscDatasourceType, registeredBy: this.repo.registeredby };
173 170
    if (intrf) {
174 171
      this.dataForInterfaceComp.push([true, curIndex, curRepoInfo, intrf]);
175 172
    } else {
......
185 182
    }
186 183
    tempArray.splice(i, 1);
187 184
    this.dataForInterfaceComp = tempArray;
188
    console.log(JSON.stringify(this.dataForInterfaceComp));
185
    // console.log(JSON.stringify(this.dataForInterfaceComp));
189 186
  }
190 187

  
191 188
  getInterfaces() {
......
224 221
        this.dataForInterfaceComp.push([
225 222
          true, i,
226 223
          { id: this.repo.id,
227
            datasourceType: this.repo.datasourceType,
228
            datasourceClass: this.repo.datasourceClass,
229
            registeredBy: this.repo.registeredBy
224
            datasourceType: this.repo.eoscDatasourceType,
225
            datasourceClass: this.repo.eoscDatasourceType,
226
            registeredBy: this.repo.registeredby
230 227
          },
231 228
          this.repoInterfaces[i]
232 229
        ]);
......
235 232
      this.dataForInterfaceComp.push([
236 233
        true, 0,
237 234
        { id: this.repo.id,
238
          datasourceType: this.repo.datasourceType,
239
          datasourceClass: this.repo.datasourceClass,
240
          registeredBy: this.repo.registeredBy
235
          datasourceType: this.repo.eoscDatasourceType,
236
          datasourceClass: this.repo.eoscDatasourceType,
237
          registeredBy: this.repo.registeredby
241 238
        }
242 239
      ]);
243 240
    }
......
299 296
            return 0;
300 297
          }
301 298
        });
302
        console.log(`the number of interfaces is ${this.repoInterfaces.length}`);
299
        // console.log(`the number of interfaces is ${this.repoInterfaces.length}`);
303 300
      },
304 301
      error => {
305 302
          console.log(error);
......
316 313
    );
317 314
  }
318 315

  
319
  //recheck if needed
316
  // recheck if needed
320 317
  getTerms(repo: Repository) {
321 318
    this.repo = repo;
322 319
  }
......
331 328
      this.loadingMessage = 'Saving changes';
332 329
      this.errorMessage = '';
333 330
      console.log('reg this.repo', this.repo);
334
      this.repoService.addRepository( this.repo.datasourceType, this.repo).subscribe(
331
      this.repoService.addRepository( this.repo.eoscDatasourceType, this.repo).subscribe( //this.repo.collectedfrom
335 332
        response => {
336
          console.log(`addRepository responded: ${response.id}, ${response.registeredBy}`);
333
          console.log(`addRepository responded: ${response.id}, ${response.registeredby}`);
337 334
          this.repo = response;
338 335
        },
339 336
        error => {
......
356 353
          if (intrf.id) {
357 354
            let req;
358 355
            if (this.interfacesToDelete.some(id => id === intrf.id)) {
359
              req = this.repoService.deleteInterface(intrf.id, this.repo.registeredBy);
356
              req = this.repoService.deleteInterface(intrf.id, this.repo.registeredby);
360 357
            } else {
361 358
              // console.log('comments', intrf.comments);
362
              req = this.repoService.updateInterface(this.repo.id, this.repo.registeredBy, intrf.comments, intrf);
359
              req = this.repoService.updateInterface(this.repo.id, this.repo.registeredby, intrf.comments, intrf);
363 360
            }
364 361
            return req;
365 362
          } else {
366 363
            // console.log('comments', intrf.comments);
367
            return this.repoService.addInterface(this.repo.datasourceType, this.repo.id, this.repo.registeredBy, intrf.comments, intrf);
364
            return this.repoService.addInterface(this.repo.eoscDatasourceType, this.repo.id, this.repo.registeredby, intrf.comments, intrf);
368 365
          }
369 366
        })
370 367
      ).subscribe(

Also available in: Unified diff