Project

General

Profile

« Previous | Next » 

Revision 50259

forms working;

View differences:

modules/uoa-repository-dashboard-gui/trunk/app/pages/sources/update-datasource-interface-form.component.ts
1 1
import { Component, Injector, Input } from '@angular/core';
2 2
import { MyGroup } from '../../shared/reusablecomponents/forms/my-group.interface';
3
import { baseUrlDesc, validationSetDesc, Description } from '../../domain/oa-description';
4 3
import { FormGroup, Validators } from '@angular/forms';
5 4

  
6 5
@Component ({
......
12 11
  successMessage: string;
13 12
  errorMessage: string;
14 13

  
15
  baseUrlDesc: Description = baseUrlDesc;
16
  validationSetDesc: Description = validationSetDesc;
14
  selectedValSet: string;
17 15

  
18 16
  readonly groupDefinition = {
19
    baseUrl: this._fb.group({}),
20
    validationSet: ['', Validators.required],
21
    compatibilityLevel: ''
22
  }
17
    baseUrl: ['', Validators.required],
18
    selectValidationSet: [''],
19
    customValidationSet: ['']
20
  };
23 21

  
24
  constructor(private injector: Injector) {
25
    super(injector);
26
  }
27 22

  
28 23
  ngOnInit(){
29
    this.generate();
24
    super.ngOnInit();
25
    console.log(this.group,this.parentGroup);
26
    // this.getMyControl('customValidationSet').disable();
30 27
  }
28

  
29

  
30
  chooseValSet(existingValSet: boolean) {
31
    // if(existingValSet) {
32
    //   this.getMyControl('selectValidationSet').enable();
33
    //   this.getMyControl('customValidationSet').disable();
34
    // }  else {
35
    //   this.getMyControl('selectValidationSet').disable();
36
    //   this.getMyControl('customValidationSet').enable();
37
    // }
38
  }
31 39
}
modules/uoa-repository-dashboard-gui/trunk/app/pages/sources/sources-register/sr-data.component.ts
1
import { Component, OnInit } from '@angular/core';
2

  
3
@Component ({
4
  selector: 'app-sr-data',
5
  templateUrl: 'sr-data.component.html'
6
})
7

  
8

  
9
export class SrDataComponent implements OnInit {
10
  constructor() {}
11

  
12
  ngOnInit() {}
13
}
modules/uoa-repository-dashboard-gui/trunk/app/pages/sources/sources-register/register-datasource-shareable.component.html
1
<div class="uk-grid uk-grid-stack">
2
  <div class="uk-width-expand@m uk-first-column">
3
    <div class="uk-margin-medium-bottom">
4
      <h1 class="uk-article-title">Register your datasource</h1>
5
    </div>
6
    <div class="wizard">
7
      <div class="wizardBreadcrumbs">
8
        <div class="steps clearfix">
9
          <div class="step active">
10
            <div>
11
              Select repository
12
              <span></span>
13
            </div>
14
          </div>
15
          <div class="step">
16
            <div>
17
              Enter Information
18
              <span></span>
19
            </div>
20
          </div>
21
          <div class="step">
22
            <div>
23
              Add Interfaces
24
              <span></span>
25
            </div>
26
          </div>
27
          <div class="step">
28
            <div>
29
              Finish
30
              <span></span>
31
            </div>
32
          </div>
33
        </div>
34
      </div>
35
      <div class="content">
36
        <div>
37
          <div>
38
            <div class="animated fadeInRight stepContent">
39
              <div class="uk-alert uk-alert-danger" *ngIf="alertMessage">
40
                {{ alertMessage }}
41
              </div>
42
              <div class="alert alert-info">
43
                Please make sure your repository is registered in
44
                <a target="_blank" href="{{ repoSourceUrl }}">
45
                  <i class="fa fa-external-link" style="margin-right:3px;"></i>
46
                  {{ mode }}
47
                </a>
48
                . <br>
49
                <b>Last Updated: </b>
50
                <!-- WHERE WILL THIS DATE COME FROM??? -->
51
                2017-12-11
52
              </div>
53
              <div>
54
                <div class="form-group">
55
                  <label class="control-label">Select repository's country</label>
56
                  <select class="form-control" (change) ="getReposInCountry($event.target.value)" >
57
                    <option value="" disabled>-- none selected --</option>
58
                    <option *ngFor="let country of countries" value="{{ country.name }}">{{ country.name }}</option>
59
                  </select>
60
                </div>
61
                <div class="form-group">
62
                  <label class="control-label">Start typing in the name of your repository to narrow down the view</label>
63
                  <input [(ngModel)]="searchBox" id="search" class="form-control" type="text" />
64
                </div>
65
              </div>
66
              <div *ngIf="hasSelectedCountry">
67
                <div>
68
                  <h2>OpenDOAR Repositories in {{ selectedCountry }}</h2>
69
                </div>
70
                <div style="text-align: center;" *ngIf="showSpinner">
71
                  <span class="loading">{{ loadingMessage }}</span><br>
72
                  <img src="/assets/imgs/loader-big.gif">
73
                </div>
74
                <div class="uk-alert uk-alert-warning" *ngIf="noRepositories">{{ noRepositories }}</div>
75
                <div class="repositoriesRadioButtonForm" *ngIf="countryRepos">
76
                  <div class="form-group"
77
                       *ngFor="let repo of countryRepos | repoFilter: searchBox">
78
                    <label class="uk-button uk-button-link" style="display: block; text-align: left;">
79
                      <input type="radio" value="{{ repo.id }}" name="repositories" (change)="onChooseRepository()" [disabled]="repo.registered">
80
                      <span>
81
                        {{ repo.officialName }}
82
                        <span class="uk-label uk-label-warning registeredLabel" *ngIf="repo.registered">Registered</span>
83
                        <a target="_blank" href="{{repo.websiteUrl }}">
84
                          <i class="fa fa-external-link externalLink"></i>
85
                        </a>
86
                      </span>
87
                    </label>
88
                  </div>
89
                </div>
90
              </div>
91
            </div>
92
          </div>
93
        </div>
94
      </div>
95
      <div class="wizardActions">
96
        <button class="btn btn-grey-light" type="button" (click)="goToNextStep()">
97
          Next
98
          <i class="fa fa-angle-double-right"></i>
99
        </button>
100
      </div>
101
    </div>
102
  </div>
103
  <div class="tm-sidebar uk-width-1-4@m">
104
    <div>
105
      <div class="uk-card uk-card-body uk-card-default sidemenu">
106
        <h3 class="el-title uk-h3 uk-heading-bullet">Info</h3>
107
        <p class="small">
108
          Use the form on the right to add your repository or journal in OpenAIRE. If you want to find more information about this process
109
          <!-- TARGET FILE MISSING! jsps/manuals/user-manual.pdf -->
110
          <a target="_blank" href="#">click here</a>
111
          .
112
        </p>
113
        <div class="alert alert-warning small">
114
          The official repository/journal administrator (his/her email address being retrieved from the OAI-PMH verb
115
          <b>Identify</b>
116
          ) will be contacted and informed about registration request. So please make sure that you are either this person or have access to the email address, or that you have notified them.
117
        </div>
118
        <p class="small">
119
          For any problems or questions please contact the
120
          <a class="external" target="_blank" href="https://www.openaire.eu/support/helpdesk" >
121
            OpenAIRE helpdesk
122
          </a>
123
          .
124
        </p>
125
      </div>
126
    </div>
127
  </div>
128
</div>
modules/uoa-repository-dashboard-gui/trunk/app/pages/sources/sources-register/sr-literature.component.html
1
<div class="uk-grid uk-grid-stack">
2
  <div class="uk-width-expand@m uk-first-column">
3
    <div class="uk-margin-medium-bottom">
4
      <h1 class="uk-article-title">Register your datasource</h1>
5
    </div>
6
    <div class="wizard">
7
      <div class="wizardBreadcrumbs">
8
        <div class="steps clearfix">
9
          <div class="step active">
10
            <div>
11
              Select repository
12
              <span></span>
13
            </div>
14
          </div>
15
          <div class="step">
16
            <div>
17
              Enter Information
18
              <span></span>
19
            </div>
20
          </div>
21
          <div class="step">
22
            <div>
23
              Add Interfaces
24
              <span></span>
25
            </div>
26
          </div>
27
          <div class="step">
28
            <div>
29
              Finish
30
              <span></span>
31
            </div>
32
          </div>
33
        </div>
34
      </div>
35
      <div class="content">
36
        <div>
37
          <div>
38
            <div class="animated fadeInRight stepContent">
39
              <div class="uk-alert uk-alert-danger" *ngIf="alertMessage">
40
                {{ alertMessage }}
41
              </div>
42
              <div class="alert alert-info">
43
                Please make sure your repository is registered in
44
                <a target="_blank" href="http://www.opendoar.org">
45
                  <i class="fa fa-external-link" style="margin-right:3px;"></i>
46
                    OpenDOAR
47
                </a>
48
                . <br>
49
                <b>Last Updated: </b>
50
                <!-- WHERE WILL THIS DATE COME FROM??? -->
51
                2017-12-11
52
              </div>
53
              <div>
54
                <div class="form-group">
55
                  <label class="control-label">Select repository's country</label>
56
                  <select class="form-control" (change) ="getReposInCountry($event.target.value, 'opendoar')" >
57
                    <option value="" disabled>-- none selected --</option>
58
                    <option *ngFor="let country of countries" value="{{ country.name }}">{{ country.name }}</option>
59
                  </select>
60
                </div>
61
                <div class="form-group">
62
                  <label class="control-label">Start typing in the name of your repository to narrow down the view</label>
63
                  <input [(ngModel)]="searchBox" id="search" class="form-control" type="text" />
64
                </div>
65
              </div>
66
              <div *ngIf="hasSelectedCountry">
67
                <div>
68
                  <h2>OpenDOAR Repositories in {{ selectedCountry }}</h2>
69
                </div>
70
                <div style="text-align: center;" *ngIf="showSpinner">
71
                  <span class="loading">{{ loadingMessage }}</span><br>
72
                  <img src="/assets/imgs/loader-big.gif">
73
                </div>
74
                <div class="uk-alert uk-alert-warning" *ngIf="noRepositories">{{ noRepositories }}</div>
75
                <div class="repositoriesRadioButtonForm" *ngIf="countryRepos">
76
                  <div class="form-group"
77
                       *ngFor="let repo of countryRepos | repoFilter: searchBox">
78
                    <label class="uk-button uk-button-link" style="display: block; text-align: left;">
79
                      <input type="radio" value="{{ repo.id }}" name="repositories" (change)="onChooseRepository()" [disabled]="repo.registered">
80
                      <span>
81
                        {{ repo.officialName }}
82
                        <span class="uk-label uk-label-warning registeredLabel" *ngIf="repo.registered">Registered</span>
83
                        <a target="_blank" href="{{repo.websiteUrl }}">
84
                          <i class="fa fa-external-link externalLink"></i>
85
                        </a>
86
                      </span>
87
                    </label>
88
                  </div>
89
                </div>
90
              </div>
91
            </div>
92
          </div>
93
        </div>
94
      </div>
95
      <div class="wizardActions">
96
        <button class="btn btn-grey-light" type="button" (click)="goToNextStep()">
97
          Next
98
          <i class="fa fa-angle-double-right"></i>
99
        </button>
100
      </div>
101
    </div>
102
  </div>
103
  <div class="tm-sidebar uk-width-1-4@m">
104
    <div>
105
      <div class="uk-card uk-card-body uk-card-default sidemenu">
106
        <h3 class="el-title uk-h3 uk-heading-bullet">Info</h3>
107
        <p class="small">
108
          Use the form on the right to add your repository or journal in OpenAIRE. If you want to find more information about this process
109
          <!-- TARGET FILE MISSING! jsps/manuals/user-manual.pdf -->
110
          <a target="_blank" href="#">click here</a>
111
          .
112
        </p>
113
        <div class="alert alert-warning small">
114
          The official repository/journal administrator (his/her email address being retrieved from the OAI-PMH verb
115
          <b>Identify</b>
116
          ) will be contacted and informed about registration request. So please make sure that you are either this person or have access to the email address, or that you have notified them.
117
        </div>
118
        <p class="small">
119
          For any problems or questions please contact the
120
          <a class="external" target="_blank" href="https://www.openaire.eu/support/helpdesk" >
121
            OpenAIRE helpdesk
122
          </a>
123
          .
124
        </p>
125
      </div>
126
    </div>
127
  </div>
128
</div>
1
<register-datasource-shareable [mode]="'opendoar'" [repoSourceUrl]="'http://www.opendoar.org'"></register-datasource-shareable>
modules/uoa-repository-dashboard-gui/trunk/app/pages/sources/sources-register/register-datasource-shareable.component.ts
1
import { Component, Input, OnInit } from '@angular/core';
2
import { RepositoryService } from '../../../services/repository.service';
3
import {
4
  loadingReposMessage,
5
  noRepositoriesMessage,
6
  noRepositoryChosenMsg,
7
  noServiceMessage } from '../../../domain/shared-messages';
8
import { Country, Repository } from '../../../domain/typeScriptClasses';
9

  
10
@Component({
11
  selector: 'register-datasource-shareable',
12
  templateUrl: './register-datasource-shareable.component.html'
13
})
14

  
15
export class RegisterDatasourceShareableComponent implements OnInit {
16
  countries: Country[] = [];
17
  hasSelectedCountry: boolean;
18
  selectedCountry: string;
19
  countryRepos: Repository[] = [];
20
  noRepositories: string;
21
  hasSelectedRepo: boolean;
22
  alertMessage: string;
23
  showSpinner: boolean;
24
  loadingMessage: string = loadingReposMessage;
25

  
26
  @Input()
27
  mode: string;
28

  
29
  @Input()
30
  repoSourceUrl: string;
31

  
32
  constructor(private repoService:RepositoryService) {}
33

  
34
  ngOnInit() {
35
    this.getCountries();
36
    this.hasSelectedCountry = false;
37
    this.selectedCountry = '';
38

  
39
  }
40

  
41
  getCountries(){
42
    this.repoService.getCountries()
43
      .subscribe(
44
        countries => this.countries = countries.sort( function(a,b){
45
          if(a.name<b.name){
46
            return -1;
47
          } else if(a.name>b.name){
48
            return 1;
49
          } else {
50
            return 0;
51
          }
52
        } ),
53
        error => {
54
          this.alertMessage = noServiceMessage;
55
          console.log(error);
56
        });
57
  }
58

  
59
  getReposInCountry(country: string){
60
    console.log(`I got ${country} and ${this.mode}`);
61
    this.countryRepos = [];
62
    this.hasSelectedCountry = true;
63
    this.selectedCountry = country;
64
    this.showSpinner = true;
65
    this.repoService.getRepositoriesOfCountry(country,this.mode).subscribe(
66
      repos => this.countryRepos = repos,
67
      error => console.log(error),
68
      () => {
69
        if (!this.countryRepos.length) this.noRepositories = noRepositoriesMessage;
70
        this.showSpinner = false;
71
      }
72
    );
73
  }
74

  
75
  onChooseRepository(){
76
    this.hasSelectedRepo = true;
77
  }
78

  
79
  goToNextStep() {
80
    if(!this.hasSelectedRepo || this.noRepositories){
81
      this.alertMessage = noRepositoryChosenMsg;
82
    } else {
83
      //move to the next step
84
    }
85
  }
86

  
87
}
modules/uoa-repository-dashboard-gui/trunk/app/pages/sources/sources-register/sr-literature.component.ts
2 2
*  created by myrto on 12/12/2017
3 3
*/
4 4

  
5
import { Component, OnInit } from '@angular/core';
6
import { Country, Repository } from '../../../domain/typeScriptClasses';
7
import { RepositoryService } from '../../../services/repository.service';
8
import { Subject } from 'rxjs/Subject';
9
import {
10
  loadingReposMessage, noRepositoriesMessage, noRepositoryChosenMsg,
11
  noServiceMessage
12
} from '../../../domain/shared-messages';
13
/*
14
import { Observable } from 'rxjs/Observable';
15
import { debounceTime, distinctUntilChanged, switchMap } from 'rxjs/operators';
16
*/
5
import { Component, Input, OnInit } from '@angular/core';
17 6

  
18 7
@Component ({
19 8
  selector:'app-sr-literature',
......
21 10
})
22 11

  
23 12
export class SRLiteratureComponent implements OnInit {
24
  countries: Country[] = [];
25
  hasSelectedCountry: boolean;
26
  selectedCountry: string;
27
  countryRepos: Repository[] = [];
28
  noRepositories: string;
29
  hasSelectedRepo: boolean;
30
  alertMessage: string;
31
  showSpinner: boolean;
32
  loadingMessage: string = loadingReposMessage;
33
  private searchString = new Subject<string>();
34 13

  
35 14

  
36
  constructor(private repoService:RepositoryService) {}
15
  constructor() {}
37 16

  
38 17
  ngOnInit() {
39
    this.getCountries();
40
    this.hasSelectedCountry = false;
41
    this.selectedCountry = '';
42 18
  }
43 19

  
44
  getCountries(){
45
    this.repoService.getCountries()
46
      .subscribe(
47
        countries => this.countries = countries.sort( function(a,b){
48
          if(a.name<b.name){
49
            return -1;
50
          } else if(a.name>b.name){
51
            return 1;
52
          } else {
53
            return 0;
54
          }
55
        } ),
56
        error => {
57
          this.alertMessage = noServiceMessage;
58
          console.log(error);
59
        });
60
  }
61

  
62
  getReposInCountry(country: string, mode: string){
63
    console.log(`I got ${country} and ${mode}`);
64
    this.countryRepos = [];
65
    this.hasSelectedCountry = true;
66
    this.selectedCountry = country;
67
    this.showSpinner = true;
68
    this.repoService.getRepositoriesOfCountry(country,mode).subscribe(
69
      repos => this.countryRepos = repos,
70
      error => console.log(error),
71
      () => {
72
        if (!this.countryRepos.length) this.noRepositories = noRepositoriesMessage;
73
        this.showSpinner = false;
74
      }
75
    );
76
  }
77

  
78
  onChooseRepository(){
79
    this.hasSelectedRepo = true;
80
  }
81

  
82
  goToNextStep(){
83
    if(!this.hasSelectedRepo || this.noRepositories){
84
      this.alertMessage = noRepositoryChosenMsg;
85
    } else {
86
      //move to the next step
87
    }
88
  }
89

  
90
  refreshSearch(term: string): void {
91
    /*this.searchString.next(term);*/
92
    console.log(`read ${term}`);
93

  
94
  }
95
/*
96
  searchRepo(): void {
97
    this.searchString.pipe(
98
      debounceTime(500),
99
      distinctUntilChanged(),
100
      switchMap((term: string) => this.countryRepos.filter(
101
        repo => repo.officialName.includes(term)
102
      ) )
103
    );
104
  }*/
105

  
106 20
}
modules/uoa-repository-dashboard-gui/trunk/app/pages/sources/sources-register.component.html
26 26
        </div>
27 27
        <div class="uk-width-expand@m uk-width-1-2@s uk-grid-item-match">
28 28
          <div class="uk-margin uk-text-center uk-card uk-card-default uk-card-hover uk-scrollspy-inview uk-animation-slide-top-medium" uk-scrollspy-class="" data-id="" style="">
29
            <a class="el-link uk-position-cover uk-margin-remove-adjacent" href=""></a>
29
            <a routerLink="data" class="el-link uk-position-cover uk-margin-remove-adjacent" href=""></a>
30 30
            <div class="uk-card-media-top">
31 31
              <img class="el-image" src="assets/imgs/Data_repos_sqare.png" alt="" style="width:100%;">
32 32
            </div>
modules/uoa-repository-dashboard-gui/trunk/app/pages/sources/sources-update-repo.component.html
115 115
                    <a><i class="fa fa-save fa-lg" style=""></i></a>
116 116
                  </div>
117 117
                </div>
118
                <div>
119
                  <update-datasource-interface-form></update-datasource-interface-form>
118
                <form [formGroup]="group">
119
                  <!--<update-datasource-interface-form #datasourceForm [name]="'myname'" [parentGroup]="group"></update-datasource-interface-form>-->
120
                  <form-repeat [component]="updateDatasource" [parentGroup]="group" [description]="{label : 'ASd', desc : 'asdasd'}" [name]="'repeat'"></form-repeat>
120 121
                  <!-- SPACE FOR FORM GROUP -->
121
                </div>
122
                </form>
122 123
              </div>
123 124
              <div class="el-item uk-card uk-card-default uk-card-body uk-scrollspy-inview uk-animation-fade uk-width-1-2@m">
124 125
                <div class="interface-box new" style="text-align: center">
......
136 137
    <div>
137 138
      <div class="uk-card uk-card-body uk-card-default sidemenu">
138 139
        <h3 class="el-title uk-h3 uk-heading-bullet">Info / Help</h3>
139
        <p class="small">
140
          Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
141
        </p>
140
        <!--<p class="small">-->
141
          <!--Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.-->
142

  
143
        <!--</p>-->
144
        <pre>{{group.value | json}}</pre>
142 145
      </div>
143 146
    </div>
144 147
  </div>
modules/uoa-repository-dashboard-gui/trunk/app/pages/sources/sources-update-repo.component.ts
1
import { Component, OnInit } from '@angular/core';
1
import { Component, OnInit, Type, ViewChild } from '@angular/core';
2
import { FormBuilder, FormGroup } from '@angular/forms';
3
import { UpdateDatasourceInterfaceFormComponent } from './update-datasource-interface-form.component';
2 4

  
3 5
@Component ({
4 6
  selector: 'sources-update-repo',
......
7 9

  
8 10
export class SourcesUpdateRepoComponent implements OnInit {
9 11
  interfaceForm: boolean;
12
  group: FormGroup;
13
  updateDatasource : Type<any> = UpdateDatasourceInterfaceFormComponent;
10 14

  
11
  constructor() {}
15
  constructor(private fb: FormBuilder) {
16
    this.group = fb.group({});
17
  }
12 18

  
19
  // @ViewChild('datasourceForm')
20
  // datasourceForm : UpdateDatasourceInterfaceFormComponent;
21

  
13 22
  ngOnInit() {
14 23
    this.interfaceForm = false;
24
    // console.log("DATASOURCE",this.datasourceForm);
15 25
  }
16 26

  
17 27
  showInterfaceFormToggle(){
modules/uoa-repository-dashboard-gui/trunk/app/pages/sources/sources.module.ts
15 15
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
16 16
import { RepoFilter } from './sourcesPipes';
17 17
import { UpdateDatasourceInterfaceFormComponent } from './update-datasource-interface-form.component';
18
import { SrDataComponent } from './sources-register/sr-data.component';
19
import { RegisterDatasourceShareableComponent } from './sources-register/register-datasource-shareable.component';
18 20

  
19 21
@NgModule ({
20 22
  imports: [
......
25 27
    SourcesRouting,
26 28
    ReusableComponentsModule
27 29
  ],
30
  entryComponents : [
31
    UpdateDatasourceInterfaceFormComponent
32
  ],
28 33
  declarations: [
29 34
    SourcesComponent,
30 35
    SourcesRegisterComponent,
31 36
    SourcesUpdateComponent,
32 37
    SRLiteratureComponent,
38
    SrDataComponent,
33 39
    SourcesUpdateRepoComponent,
34 40
    UpdateDatasourceInterfaceFormComponent,
35
    RepoFilter
41
    RepoFilter,
42
    RegisterDatasourceShareableComponent
36 43
  ]
37 44
})
38 45

  
modules/uoa-repository-dashboard-gui/trunk/app/pages/sources/update-datasource-interface-form.component.html
1
    <div [formGroup]="parentGroup">
1
<div class="el-item uk-card uk-card-default uk-card-body uk-scrollspy-inview uk-animation-fade uk-width-1-1@m">
2
  <div [formGroup]="group">
3

  
2 4
      <div *ngIf="successMessage" class="uk-alert uk-alert-success" style="display:none;" aria-hidden="true"></div>
3 5
      <div *ngIf="errorMessage" class="uk-alert uk-alert-danger" style="display:none;" aria-hidden="true"></div>
4 6

  
......
11 13
        <label class="uk-form-controls-text control-label">Validation Set</label>
12 14
        <div>
13 15
          <label class="uk-button uk-button-link validationSetRadio disabled">
14
            <input name="validationSet" value="select" formControlName="validationSet" type="radio" class="uk-radio">
16
            <input value="select" name="validationSet" type="radio" class="uk-radio" (change)="chooseValSet(true)">
15 17
            <span>choose existing</span>
16 18
          </label>
17
          <select name="selectedValidationSet" class="uk-select" disabled="">
18
            <option value="noneSelected">-- none selected --</option>
19
          </select>
19
          <div class="uk-margin">
20
            <select formControlName="selectValidationSet" class="uk-select">
21
              <option value="noneSelected">-- none selected --</option>
22
            </select>
23
          </div>
20 24
          <label class="uk-button uk-button-link validationSetRadio disabled">
21
            <input name="validationSet" value="custom" formControlname="validationSet" type="radio" class="uk-radio">
25
            <input value="custom" name="validationSet" type="radio" class="uk-radio" (change)="chooseValSet(false)">
22 26
            <span>or a custom one</span>
23 27
          </label>
24
          <input class="uk-input" disabled="" type="text">
28
          <div class="uk-margin">
29
            <input formControlName="customValidationSet" class="uk-input" type="text">
30
          </div>
25 31
        </div>
26 32
      </div>
27 33
      <div class="uk-fieldset">
......
37 43
        </label>
38 44
      </div>
39 45
    </div>
46
</div>
modules/uoa-repository-dashboard-gui/trunk/app/pages/sources/sources.routing.ts
10 10
import { AuthGuardService } from '../../services/auth-guard.service';
11 11
import { SRLiteratureComponent } from './sources-register/sr-literature.component';
12 12
import { SourcesUpdateRepoComponent } from './sources-update-repo.component';
13
import { SrDataComponent } from './sources-register/sr-data.component';
13 14

  
14 15
const sourcesRoutes: Routes = [
15 16
  {
......
34 35
            path: 'literature',
35 36
            component: SRLiteratureComponent
36 37
          },
38
          {
39
            path: 'data',
40
            component: SrDataComponent
41
          }
37 42
        ]
38 43
      },
39 44
      {
modules/uoa-repository-dashboard-gui/trunk/app/shared/reusablecomponents/forms/my-group.interface.ts
9 9
  OnInit,
10 10
  SimpleChanges
11 11
} from "@angular/core";
12

  
12
import { Description } from '../../../domain/oa-description';
13 13
import { Subject } from "rxjs/Subject";
14
import { Description } from '../../../domain/oa-description';
15 14

  
16 15
/**
17 16
 * Created by stefanos on 15/5/2017.
18 17
 */
19 18

  
20

  
21 19
@Component({
22 20
  template:``
23 21
})
......
51 49
      if(typeof _ != 'undefined') {
52 50
        setTimeout( () => {
53 51
          (this.group as FormGroup).patchValue(_);
54
        },1000)exit;
52
        },1000);
55 53
      }
56 54
    });
57 55
  }
......
119 117
@Component({
120 118
  selector : 'form-inline',
121 119
  template : `
122
  <ng-template #descTemplate>{{description.desc}}</ng-template>
123
  <div class="uk-grid uk-form-horizontal">
120
    <ng-template #descTemplate>{{description.desc}}</ng-template>
121
    <div class="uk-grid uk-form-horizontal">
124 122
      <!--<label class="uk-width-1-5 uk-form-label" *ngIf="description.label!=null" [ngClass]="{'required' : description.mandatory==true}">-->
125 123
      <label class="uk-width-1-5" *ngIf="description.label!=null" [ngClass]="{'required' : description.mandatory==true}">
126
          <!--<span *ngIf="description.mandatory==true && !valid"><i class="fa fa-star" style="color : red"></i></span>-->
127
          <!--<span *ngIf="description.recommended==true"><i class="fa fa-star" style="color : green"></i></span>-->
128
          {{description.label}}
129
          <span *ngIf="params==='tooltip'"><i class="fa fa-info-circle" [tooltip]="descTemplate" container="body"></i></span>
124
        <!--<span *ngIf="description.mandatory==true && !valid"><i class="fa fa-star" style="color : red"></i></span>-->
125
        <!--<span *ngIf="description.recommended==true"><i class="fa fa-star" style="color : green"></i></span>-->
126
        {{description.label}}
127
        <!--<span *ngIf="params==='tooltip'"><i class="fa fa-info-circle" container="body"></i></span> uk-tooltip="{{descTemplate}}"-->
130 128
      </label>
131 129
      <!--<div class="uk-width-expand@m uk-form-controls" [ngClass]="{'has-error': !valid}">-->
132 130
      <div class="uk-width-expand\@m" [ngClass]="{'has-error': !valid}">
133
          <ng-content></ng-content>
134
          <div *ngIf="params==='inline'">
135
              <i><small>{{description.desc}}</small></i>
136
          </div>
131
        <ng-content></ng-content>
132
        <div *ngIf="params==='inline'">
133
          <i><small>{{description.desc}}</small></i>
134
        </div>
137 135
      </div>
138
  </div>
136
    </div>
139 137
  `
138

  
140 139
})
141 140
export class InlineFormWrapper implements OnChanges {
142 141

  
143
  @Input() public description : Description = null;
142
  @Input() public description: Description = null;
144 143

  
145
  @Input() public params : string = 'inline';
144
  @Input() public params: string = 'inline';
146 145

  
147
  @Input() public width : number = 9;
146
  @Input() public width: number = 9;
148 147

  
149
  @Input() public valid : boolean = true;
148
  @Input() public valid: boolean = true;
150 149

  
151 150
  ngOnChanges(changes: SimpleChanges): void {
152 151
    if (changes && changes.valid)
153 152
      this.valid = <boolean>changes.valid.currentValue;
154 153
  }
155

  
156 154
}
modules/uoa-repository-dashboard-gui/trunk/app/shared/reusablecomponents/forms/my-array.interface.ts
25 25
            Add New {{description.label}}</a>
26 26
    </div>
27 27
</div>
28
`,
29
  styleUrls : ['']
28
`
30 29

  
31 30
})
32 31
export class MyArray extends MyGroup {
......
130 129
            <i class="fa fa-plus" aria-hidden="true"></i> Add {{description.label}}
131 130
        </a>
132 131
    </form-inline>
133
    `,
134
  styleUrls : ['']
132
    `
135 133

  
136 134
})
137 135
export class MyArrayInline extends MyArray {
......
160 158
        </div>
161 159
        <ng-template my-form></ng-template>
162 160
    </div>
163
`,
164
  styleUrls : ['']
161
`
165 162

  
166 163
})
167 164
export class MyArrayWrapper extends MyWrapper{
......
177 174
    <a *ngIf="canDelete" class="remove-element uk-width-1-6" (click)="remove()"><i
178 175
            class="fa fa-times" aria-hidden="true"></i></a>
179 176
</div>
180
`,
181
  styleUrls : ['']
177
`
182 178

  
183 179
})
184 180
export class MyInlineArrayWrapper extends MyWrapper {
modules/uoa-repository-dashboard-gui/trunk/app/shared/reusablecomponents/reusable-components.module.ts
13 13
import { HelpContentService } from "../../services/help-content.service";
14 14
import { RepositoryTilesComponent } from './repository-tiles.component';
15 15
import { ConfirmationDialogComponent } from './confirmation-dialog.component';
16
import { MyGroup } from './forms/my-group.interface';
16
import { InlineFormWrapper, MyGroup } from './forms/my-group.interface';
17 17
import { MyArray, MyArrayInline, MyArrayWrapper, MyInlineArrayWrapper } from './forms/my-array.interface';
18
import { MyChoice, MyChoiceComponents, MyChoiceWrapper } from './forms/my-choice.interface';
19 18
import { MyFormDirective } from './forms/my-form.directive';
20 19

  
20
const myGroups = [
21
  MyGroup,
22
  MyArray,
23
  MyArrayWrapper,
24
  MyArrayInline,
25
  MyFormDirective,
26
  MyInlineArrayWrapper,
27
  InlineFormWrapper
28
];
21 29

  
22 30
@NgModule({
23 31
  imports: [
......
30 38
    HttpModule,
31 39
    JsonpModule
32 40
  ],
41
  entryComponents : [
42
    MyArrayWrapper
43
  ],
33 44
  declarations: [
34 45
    ReadMoreComponent,
35 46
    HelpContentComponent,
36 47
    AsideHelpContentComponent,
37 48
    ConfirmationDialogComponent,
38 49
    RepositoryTilesComponent,
39
    MyGroup,
50
    ...myGroups
40 51
/*
41
    MyInlineArrayWrapper,
42
    MyArrayWrapper,
43
    MyArray,
44
    MyArrayInline,
45 52
    MyChoiceWrapper,
46 53
    MyChoice,
47 54
    MyChoiceComponents,
48
    MyFormDirective
49 55
*/
50 56
  ],
51 57
  exports: [
......
54 60
    AsideHelpContentComponent,
55 61
    ConfirmationDialogComponent,
56 62
    RepositoryTilesComponent,
57
    MyGroup,
63
    ...myGroups
58 64
  ],
59 65
  providers: [
60 66
    HelpContentService

Also available in: Unified diff