Project

General

Profile

« Previous | Next » 

Revision 61424

Merging angular-upgrade branch

View differences:

sources-update-repo.component.ts
1
import { Component, OnInit, QueryList, ViewChild, ViewChildren } from '@angular/core';
2
import { FormBuilder, FormGroup } from '@angular/forms';
3
import { Repository, RepositoryInterface } from '../../../domain/typeScriptClasses';
4
import { RepositoryService } from '../../../services/repository.service';
5
import { ActivatedRoute, Router } from '@angular/router';
6
import { formInfoLoading, loadingRepoError } from '../../../domain/shared-messages';
7
import { DatasourceUpdateFormComponent } from '../../../shared/reusablecomponents/sources-forms/datasource-update-form.component';
8
import { ConfirmationDialogComponent } from '../../../shared/reusablecomponents/confirmation-dialog.component';
9
import { AuthenticationService } from '../../../services/authentication.service';
10
import { DatasourceNewInterfaceFormComponent } from '../../../shared/reusablecomponents/sources-forms/datasource-new-interface-form.component';
11
import { SharedService } from '../../../services/shared.service';
1
import {Component, OnInit, QueryList, ViewChild, ViewChildren} from '@angular/core';
2
import {FormBuilder, FormGroup} from '@angular/forms';
3
import {Repository, RepositoryInterface} from '../../../domain/typeScriptClasses';
4
import {RepositoryService} from '../../../services/repository.service';
5
import {ActivatedRoute, Router} from '@angular/router';
6
import {loadingRepoError} from '../../../domain/shared-messages';
7
import {DatasourceUpdateFormComponent} from '../../../shared/reusablecomponents/sources-forms/datasource-update-form.component';
8
import {ConfirmationDialogComponent} from '../../../shared/reusablecomponents/confirmation-dialog.component';
9
import {AuthenticationService} from '../../../services/authentication.service';
10
import {DatasourceNewInterfaceFormComponent} from '../../../shared/reusablecomponents/sources-forms/datasource-new-interface-form.component';
11
import {SharedService} from '../../../services/shared.service';
12 12

  
13
@Component ({
13
@Component({
14 14
  selector: 'sources-update-repo',
15 15
  templateUrl: 'sources-update-repo.component.html',
16 16
})
......
32 32
  dataForInterfaceComp: any[] = [];
33 33

  
34 34
  isModalShown: boolean;
35
  @ViewChild('updateLogoUrlModal')
35
  @ViewChild('updateLogoUrlModal', {static: true})
36 36
  public updateLogoUrlModal: ConfirmationDialogComponent;
37 37

  
38
  constructor ( private fb: FormBuilder,
39
                private repoService: RepositoryService,
40
                private authService: AuthenticationService,
41
                private route: ActivatedRoute,
42
                private sharedService: SharedService,
43
                private router: Router) { }
38
  constructor(private fb: FormBuilder,
39
              private repoService: RepositoryService,
40
              private authService: AuthenticationService,
41
              private route: ActivatedRoute,
42
              private sharedService: SharedService,
43
              private router: Router) {
44
  }
44 45

  
45
  @ViewChild('updateTermsForm')
46
  @ViewChild('updateTermsForm') updateTermsForm: DatasourceUpdateFormComponent;
46 47

  
47 48
  ngOnInit() {
48 49

  
49
    if(this.sharedService.getRepository()) {
50
    if (this.sharedService.getRepository()) {
50 51
      this.repo = this.sharedService.getRepository();
51 52
      this.logoURL = this.repo.logoUrl;
52 53
      this.getRepoInterfaces();
......
63 64
    );
64 65

  
65 66
    // this.readRepoId();
66
    let body = document.getElementsByTagName('body')[0];
67
    body.classList.remove("top_bar_active");   //remove the class
68
    body.classList.remove("page_heading_active");
69
    body.classList.remove("landing");
70
    body.classList.add("dashboard");
67
    const body = document.getElementsByTagName('body')[0];
68
    body.classList.remove('top_bar_active');   // remove the class
69
    body.classList.remove('page_heading_active');
70
    body.classList.remove('landing');
71
    body.classList.add('dashboard');
71 72
  }
72 73

  
73 74
  // readRepoId() {
......
100 101
    this.group = this.fb.group({});
101 102
    this.repoService.getRepositoryInterface(this.repo.id).subscribe(
102 103
      interfaces => {
103
        this.repoInterfaces = interfaces.sort( function(a, b) {
104
        this.repoInterfaces = interfaces.sort(function (a, b) {
104 105
          if (a.id < b.id) {
105 106
            return -1;
106 107
          } else if (a.id > b.id) {
......
130 131
      for (let i = 0; i < this.repoInterfaces.length; i++) {
131 132
        this.dataForInterfaceComp.push([
132 133
          false, i,
133
          { id: this.repo.id,
134
          {
135
            id: this.repo.id,
134 136
            datasourceType: this.repo.datasourceType,
135 137
            datasourceClass: this.repo.datasourceClass,
136 138
            registeredBy: this.repo.registeredBy
......
141 143
    } else {
142 144
      this.dataForInterfaceComp.push([
143 145
        false, 0,
144
        { id: this.repo.id,
146
        {
147
          id: this.repo.id,
145 148
          datasourceType: this.repo.datasourceType,
146 149
          datasourceClass: this.repo.datasourceClass,
147 150
          registeredBy: this.repo.registeredBy
......
152 155

  
153 156
  addInterfaceToList(intrf?: RepositoryInterface) {
154 157
    const curIndex = this.dataForInterfaceComp.length;
155
    const curRepoInfo = { id: this.repo.id, datasourceType: this.repo.datasourceType,
156
      datasourceClass: this.repo.datasourceClass, registeredBy: this.repo.registeredBy };
158
    const curRepoInfo = {
159
      id: this.repo.id, datasourceType: this.repo.datasourceType,
160
      datasourceClass: this.repo.datasourceClass, registeredBy: this.repo.registeredBy
161
    };
157 162
    if (intrf) {
158 163
      this.dataForInterfaceComp.push([false, curIndex, curRepoInfo, intrf]);
159 164
    } else {
......
193 198

  
194 199
  }
195 200

  
196
  getNewLogoUrl( event: any ) {
201
  getNewLogoUrl(event: any) {
197 202
    this.logoURL = event.target.value;
198 203

  
199 204
  }

Also available in: Unified diff