Project

General

Profile

« Previous | Next » 

Revision 62391

cleanup

View differences:

modules/uoa-repository-dashboard-gui/trunk/src/app/shared/reusablecomponents/sources-forms/datasource-create-form.component.ts
58 58
    softwarePlatform : ['', Validators.required],
59 59
    platformName : '',
60 60
    officialName : ['', Validators.required],
61
    issn : ['', [Validators.pattern('^(\\d{4}-\\d{3}[\\dxX])|([0-9]{7}[\\dxX]$)')] ],
62
    eissn : ['', Validators.pattern('^(\\d{4}-\\d{3}[\\dxX])|([0-9]{7}[\\dxX]$)') ],
63
    lissn : ['', Validators.pattern('^(\\d{4}-\\d{3}[\\dxX])|([0-9]{7}[\\dxX]$)') ],
61
    issn : ['', [Validators.pattern('^(\\d{4}-?\\d{3}[\\dxX])$')] ],
62
    eissn : ['', Validators.pattern('^(\\d{4}-?\\d{3}[\\dxX])$') ],
63
    lissn : ['', Validators.pattern('^(\\d{4}-?\\d{3}[\\dxX])$') ],
64 64
    repoDescription : ['', Validators.required],
65 65
    country : ['', Validators.required],
66 66
    longtitude : ['', [Validators.required, Validators.min(-180), Validators.max(180)] ],
......
111 111
    this.group = this.fb.group(this.groupDefinition);
112 112
    if (this.mode === 'journal') {
113 113
      this.group.get('issn').clearValidators();
114
      this.group.get('issn').setValidators([Validators.required, Validators.pattern('^(\\d{4}-\\d{3}[\\dxX])|([0-9]{7}[\\dxX]$)')]);
114
      this.group.get('issn').setValidators([Validators.required, Validators.pattern('^(\\d{4}-?\\d{3}[\\dxX])$')]);
115 115
    }
116 116
    this.getTypologies();
117 117
    this.getTimezones();
modules/uoa-repository-dashboard-gui/trunk/src/app/shared/reusablecomponents/sources-forms/datasource-update-form.component.html
249 249
    <button class="uk-button uk-button-primary updateRepoInfoButton" type="button" (click)="updateRepo()">Update Information</button>
250 250
  </div>
251 251
</form>
252
<pre>{{updateGroup.value|json}}</pre>
modules/uoa-repository-dashboard-gui/trunk/src/app/shared/reusablecomponents/sources-forms/datasource-update-form.component.ts
43 43
    softwarePlatform : '',
44 44
    platformName : '',
45 45
    officialName :  ['', Validators.required],
46
    issn : ['', [Validators.pattern('^(\\d{4}-\\d{3}[\\dxX])|([0-9]{7}[\\dxX]$)')] ],
47
    eissn : ['', Validators.pattern('^(\\d{4}-\\d{3}[\\dxX])|([0-9]{7}[\\dxX]$)') ],
48
    lissn : ['', Validators.pattern('^(\\d{4}-\\d{3}[\\dxX])|([0-9]{7}[\\dxX]$)') ],
46
    issn : ['', [Validators.pattern('^(\\d{4}-?\\d{3}[\\dxX])$')] ],
47
    eissn : ['', Validators.pattern('^(\\d{4}-?\\d{3}[\\dxX])$') ],
48
    lissn : ['', Validators.pattern('^(\\d{4}-?\\d{3}[\\dxX])$') ],
49 49
    repoDescription : ['', Validators.required],
50 50
    country : '',
51 51
    longtitude : '',
......
101 101

  
102 102
  setupUpdateForm() {
103 103
    if (this.selectedRepo) {
104
console.log(this.mode);
104

  
105 105
      this.updateGroup.setValue({
106 106
        softwarePlatform: this.selectedRepo.platform,
107 107
        platformName: '',
......
157 157
        let ssnToShow = this.selectedRepo.issn.slice(0, 4) + '-' + this.selectedRepo.issn.toString().slice(4);
158 158
        this.updateGroup.get('issn').setValue(ssnToShow);
159 159
        this.updateGroup.get('issn').clearValidators();
160
        this.updateGroup.get('issn').setValidators([Validators.required, Validators.pattern('^(\\d{4}-\\d{3}[\\dxX])|([0-9]{7}[\\dxX]$)')]);
160
        this.updateGroup.get('issn').setValidators([Validators.required, Validators.pattern('^(\\d{4}-?\\d{3}[\\dxX])$')]);
161 161

  
162 162
        if (this.selectedRepo.eissn.trim().length) {
163 163
          ssnToShow = this.selectedRepo.eissn.slice(0, 4) + '-' + this.selectedRepo.eissn.toString().slice(4);
......
179 179

  
180 180
  getDatasourceClasses() {
181 181
    // FIXME: Use eoscDatasourceType when we support the new model
182
    console.log('mode b4 getdatasourceclasses ', this.mode);
183 182

  
184 183
    let param = this.selectedRepo.collectedfrom.split('::')[1];
185 184
    if (this.selectedRepo.eoscDatasourceType === 'Journal archive') { param = 'journal'; }
......
219 218
          this.errorMessage = noServiceMessage;
220 219
          console.log(error);
221 220
        }, () => {
222
        console.log('gotCountries');
223 221
          this.getTypologies();
224 222
        });
225 223
  }
......
232 230
        console.log(error);
233 231
      },
234 232
      () => {
235
        console.log('gotTypologies');
236 233
        this.getTimezones();
237 234
      }
238 235
    );
......
246 243
        console.log(error);
247 244
      },
248 245
      () => {
249
        console.log('gotTimezones');
250 246
        this.loadingMessage = '';
251 247
        this.setupUpdateForm();
252 248
      }

Also available in: Unified diff