Project

General

Profile

« Previous | Next » 

Revision 51581

fixed checking if at least one interface was saved

View differences:

sr-aggregator.component.ts
5 5
import { Repository } from '../../../domain/typeScriptClasses';
6 6
import { DatasourceCreateFormComponent } from '../sources-forms/datasource-create-form.component';
7 7
import {ActivatedRoute, Params, Router} from "@angular/router";
8
import {MyArray} from "../../../shared/reusablecomponents/forms/my-array.interface";
9
import {noInterfacesSaved} from "../../../domain/shared-messages";
8 10

  
9 11
@Component ({
10 12
  selector: 'sr-aggregator',
......
12 14
})
13 15

  
14 16
export class SrAggregatorComponent implements OnInit {
17
  errorMessage: string;
18

  
15 19
  showForm: boolean;
16 20
  showInterfaces: boolean;
17 21
  showFinish: boolean;
......
30 34
  @ViewChild ('registerAggregator')
31 35
  registerAggregator: DatasourceCreateFormComponent;
32 36

  
37
  @ViewChild('interfaceFormArray')
38
  public interfaceFormArray: MyArray;
39

  
33 40
  group: FormGroup;
34 41
  interfaceFormDesc: Description = interfaceFormDesc;
35 42
  addDatasourceInterfaces: Type<any> = DatasourceInterfaceFormComponent;
......
48 55
    if (this.showForm) {
49 56
      this.registerAggregator.registerDatasource();
50 57
    } else if (this.showInterfaces) {
51
      this.setQueryParam('finish');
52
      this.showInterfaces = false;
53
      this.showFinish = true;
54
      this.step3 = 'active';
58
      if (this.interfaceFormArray.checkIfOneElementExists()) {
59
        this.setQueryParam('finish');
60
        this.showInterfaces = false;
61
        this.showFinish = true;
62
        this.step3 = 'active';
63
      } else {
64
        this.errorMessage = noInterfacesSaved;
65
      }
55 66
    }
56 67
  }
57 68

  

Also available in: Unified diff