Project

General

Profile

« Previous | Next » 

Revision 62103

merged branch cris-registration (r62082:HEAD)

View differences:

datasource-update-form.component.ts
8 8
         longtitudeDesc, latitudeDesc, websiteUrlDesc, institutionNameDesc, englishNameDesc, logoUrlDesc, timezoneDesc,
9 9
         datasourceTypeDesc, adminEmailDesc, lissnDesc, eissnDesc, issnDesc } from '../../../domain/oa-description';
10 10
import { AuthenticationService } from '../../../services/authentication.service';
11
import {SharedService} from "../../../services/shared.service";
11
import {SharedService} from '../../../services/shared.service';
12 12

  
13 13
@Component ({
14 14
  selector: 'datasource-update-form',
......
32 32

  
33 33
  @Input() selectedRepo: Repository;
34 34

  
35
  @Input() mode: string;
36

  
35 37
  @Input() showButton: boolean;
36 38

  
37 39
  repoId: string;
......
99 101

  
100 102
  setupUpdateForm() {
101 103
    if (this.selectedRepo) {
102
      console.log(`my datasource type is: ${this.selectedRepo.datasourceType}`);
104
      console.log(`mode is: ${this.mode}`);
103 105

  
104 106
      this.updateGroup.setValue({
105 107
        softwarePlatform: this.selectedRepo.typology,
......
126 128
        this.updateGroup.get('platformName').setValue(this.selectedRepo.typology);
127 129
      }
128 130

  
129
      if ((this.selectedRepo.datasourceType === 'opendoar') ||
130
        (this.selectedRepo.datasourceType === 're3data')) {
131
      // FIXME: Use eoscDatasourceType when we support the new model
132
      if ((this.mode === 'opendoar') || (this.mode === 're3data')) {
131 133

  
132
        // this.updateGroup.get('officialName').disable();
133 134
        this.updateGroup.get('country').disable();
134
        // this.updateGroup.get('longtitude').disable();
135
        // this.updateGroup.get('latitude').disable();
136
        // this.updateGroup.get('websiteUrl').disable();
137
        // this.updateGroup.get('institutionName').disable();
135
      }
138 136

  
137
      // FIXME: Use eoscDatasourceType when we support the new model
138
      if (this.mode === 'cris') {
139

  
140
        this.longtitudeDesc.mandatory = false;
141
        this.latitudeDesc.mandatory = false;
142
        this.datasourceTypeDesc.label = 'CRIS scope/type';
139 143
      }
140 144

  
141
      if (this.selectedRepo.datasourceType === 'journal') {
145
      // FIXME: Use eoscDatasourceType when we support the new model
146
      if (this.mode === 'journal') {
142 147

  
143 148
        let ssnToShow = this.selectedRepo.issn.slice(0, 4) + '-' + this.selectedRepo.issn.toString().slice(4);
144 149
        this.updateGroup.get('issn').setValue(ssnToShow);
......
160 165
        this.updateGroup.get('eissn').disable();
161 166
        this.updateGroup.get('lissn').disable();*/
162 167
      }
163
      /*this.getDatasourceClasses();*/
164 168
    }
165 169
  }
166 170

  
167 171
  getDatasourceClasses() {
168
    this.repoService.getDatasourceClasses(this.selectedRepo.datasourceType).subscribe(
172
    // FIXME: Use eoscDatasourceType when we support the new model
173
    this.repoService.getDatasourceClasses(this.mode).subscribe(
169 174
      classes => this.datasourceClasses = classes,
170 175
      error => {
171 176
        this.loadingMessage = '';
......
266 271
              } else {
267 272
                this.successMessage = formSuccessUpdatedRepo;
268 273
              }
269
              //fixme is this the place to update the subject??
274
              // fixme is this the place to update the subject??
270 275
              this.sharedService.setRepository(this.selectedRepo);
271 276
            }
272 277
          );

Also available in: Unified diff