Project

General

Profile

« Previous | Next » 

Revision 62388

refactor. fix getDatasourceClasses and corresponding dropdown. fix issn fields

View differences:

modules/uoa-repository-dashboard-gui/branches/new-datasource-mode/src/app/domain/typeScriptClasses.ts
118 118

  
119 119
export class Repository extends DatasourceDetails implements IsSerializable {
120 120
  timezone: number;
121
  datasourceType: string;
122 121
  interfaces: RepositoryInterface[];
123 122
  piwikInfo: PiwikInfo;
124 123
  environments: string[];
125 124
  namespacePrefix: string;
126
  officialName: string;
127
  registeredBy: string;
128
  englishName: string;
129
  collectedFrom: string;
130 125
  dateOfValidation: Date;
131 126
  dateOfCollection: Date;
132 127
  dataCollectionTypes: DataCollectionType[];
133
  websiteUrl: string;
134
  logoUrl: string;
135
  contactEmail: string;
136 128
}
137 129

  
138 130
export class RepositorySnippet {
modules/uoa-repository-dashboard-gui/branches/new-datasource-mode/src/app/pages/repository/aggregationhistory/compatibility-monitor-fullHistory-repo.component.ts
30 30

  
31 31
    if(this.sharedService.getRepository()) {
32 32
      this.repo = this.sharedService.getRepository();
33
      this.repoName = this.repo.officialName;
33
      this.repoName = this.repo.officialname;
34 34
      this.getAllAggregationHistory();
35 35
    }
36 36

  
......
38 38
      r => {
39 39
        this.repo = r;
40 40
        if (this.repo) {
41
          this.repoName = this.repo.officialName;
41
          this.repoName = this.repo.officialname;
42 42
          this.getAllAggregationHistory();
43 43
        }
44 44
      }
modules/uoa-repository-dashboard-gui/branches/new-datasource-mode/src/app/pages/repository/aggregationhistory/compatibility-monitor-repo.component.ts
29 29

  
30 30
    if(this.sharedService.getRepository()) {
31 31
      this.repo = this.sharedService.getRepository();
32
      this.repoName = this.repo.officialName;
32
      this.repoName = this.repo.officialname;
33 33
      this.getLatestAggregationHistory();
34 34
    }
35 35

  
......
37 37
      r => {
38 38
        this.repo = r;
39 39
        if (this.repo) {
40
          this.repoName = this.repo.officialName;
40
          this.repoName = this.repo.officialname;
41 41
          this.getLatestAggregationHistory();
42 42
        }
43 43
      }
modules/uoa-repository-dashboard-gui/branches/new-datasource-mode/src/app/pages/repository/dashboard/dashboard.component.html
373 373
            <div *ngIf="!brokerSummary || !brokerSummary.userSubs">No notifications were found</div>
374 374
            <div *ngIf="brokerSummary && brokerSummary.userSubs">
375 375
              <ul class="md-list md-list-addon gmap_list">
376
                <li *ngFor="let sub of brokerSummary.userSubs[repository.officialName]">
376
                <li *ngFor="let sub of brokerSummary.userSubs[repository.officialname]">
377 377
                  <div class="md-list-addon-element">
378 378
                    <span>{{ sub.count | number }}</span>
379 379
                    <!--<img class="md-user-image md-list-addon-avatar" src="assets/img/avatars/avatar_01_tn.png" alt="">-->
modules/uoa-repository-dashboard-gui/branches/new-datasource-mode/src/app/pages/repository/dashboard/dashboard.component.ts
283 283
  }
284 284

  
285 285
  getCorrectName() {
286
    const temp = this.repository.officialName.split('|');
286
    const temp = this.repository.officialname.split('|');
287 287
    let correctName = temp[0];
288 288
    let repoName = temp[0];
289 289
    for (let i = 1; i < temp.length; i++) {
modules/uoa-repository-dashboard-gui/branches/new-datasource-mode/src/app/pages/repository/events/content-events-of-repo-eventslist.component.ts
74 74

  
75 75

  
76 76
    if(this.sharedService.getRepository()) {
77
      this.repoName = this.sharedService.getRepository().officialName;
77
      this.repoName = this.sharedService.getRepository().officialname;
78 78
      this.initQuery();
79 79
      this.initForm();
80 80
      this.currentPage = 0; /* DELETE WHEN ADVANCED SHOW EVENTS IS FIXED AND SENDS CORRECT VALUE FOR CURRENT PAGE */
......
84 84
    this.sharedService.repository$.subscribe(
85 85
      r => {
86 86
        if (r) {
87
          this.repoName = r.officialName;
87
          this.repoName = r.officialname;
88 88
          this.initQuery();
89 89
          this.initForm();
90 90
          this.currentPage = 0; /* DELETE WHEN ADVANCED SHOW EVENTS IS FIXED AND SENDS CORRECT VALUE FOR CURRENT PAGE */
modules/uoa-repository-dashboard-gui/branches/new-datasource-mode/src/app/pages/repository/events/content-events-of-repository.component.ts
34 34
  ngOnInit() {
35 35

  
36 36
    if(this.sharedService.getRepository()) {
37
      this.repoName = this.sharedService.getRepository().officialName;
37
      this.repoName = this.sharedService.getRepository().officialname;
38 38
      this.getCorrectName();
39 39
      this.getTopics();
40 40
    }
......
42 42
    this.sharedService.repository$.subscribe(
43 43
      r => {
44 44
        if (r) {
45
          this.repoName = r.officialName;
45
          this.repoName = r.officialname;
46 46
          this.getCorrectName();
47 47
          this.getTopics();
48 48
        }
modules/uoa-repository-dashboard-gui/branches/new-datasource-mode/src/app/pages/repository/metrics/metrics-enable.component.html
1 1
<div id="page_content_inner">
2 2
  <!--<h2 class="heading_b uk-margin-bottom">Metrics for repository....</h2>-->
3
  <h2 *ngIf="repo" class="heading_b uk-margin-bottom">Metrics for {{repo.officialName}}</h2>
3
  <h2 *ngIf="repo" class="heading_b uk-margin-bottom">Metrics for {{repo.officialname}}</h2>
4 4

  
5 5
  <!-- TOP HELP CONTENT -->
6 6
  <help-content #topHelperContent [position]="'top'"
modules/uoa-repository-dashboard-gui/branches/new-datasource-mode/src/app/pages/repository/metrics/metrics-enable.component.ts
115 115
      const piwik: PiwikInfo = {
116 116
        repositoryId: this.repo.id,
117 117
        openaireId: this.oaId,
118
        repositoryName: this.repo.officialName,
118
        repositoryName: this.repo.officialname,
119 119
        country: this.getCountryName(this.repo.organizations[0].country),
120 120
        siteId: '',
121 121
        authenticationToken: this.authenticationToken,
......
127 127
        comment: ''
128 128
      };
129 129

  
130
      this.piwikService.enableMetricsForRepository(this.repo.officialName, this.repo.websiteUrl, piwik).subscribe(
130
      this.piwikService.enableMetricsForRepository(this.repo.officialname, this.repo.websiteurl, piwik).subscribe(
131 131
        response => {
132 132
          console.log(`enableMetrics answered: ${response}`);
133 133
          this.successMessage = enabledMetricsSuccess;
modules/uoa-repository-dashboard-gui/branches/new-datasource-mode/src/app/pages/repository/metrics/metrics-usagestats-report.component.ts
68 68
    if (this.repo.issn && this.repo.issn !== 'null') {
69 69
      this.shownRepoId = this.repo.issn.slice(0, 4) + '-' + this.repo.issn.toString().slice(4);
70 70
    }
71
    this.title = `${this.chosen_report} report for ${this.repo.officialName}`;
71
    this.title = `${this.chosen_report} report for ${this.repo.officialname}`;
72 72
  }
73 73

  
74 74
  getParams() {
modules/uoa-repository-dashboard-gui/branches/new-datasource-mode/src/app/pages/repository/metrics/metrics-usagestats.component.html
89 89
              </div>
90 90
            </div>
91 91
          </div>
92
          <div *ngIf="repo.datasourceType === 'journal'" class="uk-width-1-3@m">
92
          <div *ngIf="repo.eoscDatasourceType === 'journal'" class="uk-width-1-3@m">
93 93
            <div class="uk-margin uk-text-center md-card md-card-default md-card-hover uk-scrollspy-inview uk-animation-slide-top-medium" uk-scrollspy-class="" data-id="" style="">
94 94
              <a [routerLink]="['JR1']" class="el-link uk-position-cover uk-margin-remove-adjacent"></a>
95 95
              <div class="uk-card-media-top">
modules/uoa-repository-dashboard-gui/branches/new-datasource-mode/src/app/pages/repository/metrics/metrics-usagestats.component.ts
27 27

  
28 28
    if(this.sharedService.getRepository()) {
29 29
      this.repo = this.sharedService.getRepository();
30
      this.title = this.title + ' for ' + this.repo.officialName;
30
      this.title = this.title + ' for ' + this.repo.officialname;
31 31
    }
32 32

  
33 33
    this.sharedService.repository$.subscribe(
34 34
      r => {
35 35
        this.repo = r;
36
        this.title = this.title + ' for ' + this.repo.officialName;
36
        this.title = this.title + ' for ' + this.repo.officialname;
37 37
      }
38 38
    );
39 39

  
modules/uoa-repository-dashboard-gui/branches/new-datasource-mode/src/app/pages/repository/repository.component.html
15 15
      <div class="uk-margin-medium-left uk-margin-medium-right">
16 16
        <div class="uk-padding-small">
17 17
          <h3 *ngIf="repository" class="heading_b">
18
            <img *ngIf="!repository.logoUrl" src="../../../assets/imgs/yourLogoHere.jpg" style="margin-right: 15px; margin-top:-8px" width="60">
19
            <img *ngIf="repository.logoUrl" src="{{ repository.logoUrl }}" style="margin-right: 15px; margin-top:-8px" width="60">
20
            {{ repository.officialName }}
18
            <img *ngIf="!repository.logourl" src="../../../assets/imgs/yourLogoHere.jpg" style="margin-right: 15px; margin-top:-8px" width="60">
19
            <img *ngIf="repository.logourl" src="{{ repository.logourl }}" style="margin-right: 15px; margin-top:-8px" width="60">
20
            {{ repository.officialname }}
21 21
          </h3>
22 22
        </div>
23 23

  
modules/uoa-repository-dashboard-gui/branches/new-datasource-mode/src/app/pages/repository/update/sources-update-repo.component.ts
61 61
      } else if (this.repo.id.includes('aggregator')) {
62 62
        this.mode = 'aggregator';
63 63
      }
64
      this.logoURL = this.repo.logoUrl;
64
      this.logoURL = this.repo.logourl;
65 65
      this.getRepoInterfaces();
66 66
    }
67 67

  
......
69 69
      r => {
70 70
        this.repo = r;
71 71
        if (this.repo) {
72
          this.logoURL = this.repo.logoUrl;
72
          this.logoURL = this.repo.logourl;
73 73
          this.getRepoInterfaces();
74 74
        }
75 75
      }
......
145 145
          false, i,
146 146
          {
147 147
            id: this.repo.id,
148
            datasourceType: this.repo.datasourceType,
148
            datasourceType: this.repo.eoscDatasourceType,
149 149
            datasourceClass: this.repo.eoscDatasourceType,
150
            registeredBy: this.repo.registeredBy
150
            registeredBy: this.repo.registeredby
151 151
          },
152 152
          this.repoInterfaces[i]
153 153
        ]);
......
157 157
        false, 0,
158 158
        {
159 159
          id: this.repo.id,
160
          datasourceType: this.repo.datasourceType,
160
          datasourceType: this.repo.eoscDatasourceType,
161 161
          datasourceClass: this.repo.eoscDatasourceType,
162
          registeredBy: this.repo.registeredBy
162
          registeredBy: this.repo.registeredby
163 163
        }
164 164
      ]);
165 165
    }
......
168 168
  addInterfaceToList(intrf?: RepositoryInterface) {
169 169
    const curIndex = this.dataForInterfaceComp.length;
170 170
    const curRepoInfo = {
171
      id: this.repo.id, datasourceType: this.repo.datasourceType,
172
      datasourceClass: this.repo.eoscDatasourceType, registeredBy: this.repo.registeredBy
171
      id: this.repo.id, datasourceType: this.repo.eoscDatasourceType,
172
      datasourceClass: this.repo.eoscDatasourceType, registeredBy: this.repo.registeredby
173 173
    };
174 174
    if (intrf) {
175 175
      this.dataForInterfaceComp.push([false, curIndex, curRepoInfo, intrf]);
......
204 204
  }
205 205

  
206 206
  updatedLogoUrl(event: any) {
207
    this.repo.logoUrl = this.logoURL;
207
    this.repo.logourl = this.logoURL;
208 208
    this.datasourceUpdateForm.updateGroup.get('logoUrl').setValue(this.logoURL);
209 209
    this.datasourceUpdateForm.updateRepo();
210 210

  
modules/uoa-repository-dashboard-gui/branches/new-datasource-mode/src/app/pages/sources/sources-register/register-existing-datasource.component.ts
165 165

  
166 166
  addInterfaceToList(intrf?: RepositoryInterface) {
167 167
    const curIndex = this.dataForInterfaceComp.length;
168
    const curRepoInfo = { id: this.repo.id, datasourceType: this.repo.datasourceType,
169
      datasourceClass: this.repo.eoscDatasourceType, registeredBy: this.repo.registeredBy };
168
    const curRepoInfo = { id: this.repo.id, datasourceType: this.repo.eoscDatasourceType,
169
      datasourceClass: this.repo.eoscDatasourceType, registeredBy: this.repo.registeredby };
170 170
    if (intrf) {
171 171
      this.dataForInterfaceComp.push([true, curIndex, curRepoInfo, intrf]);
172 172
    } else {
......
221 221
        this.dataForInterfaceComp.push([
222 222
          true, i,
223 223
          { id: this.repo.id,
224
            datasourceType: this.repo.datasourceType,
224
            datasourceType: this.repo.eoscDatasourceType,
225 225
            datasourceClass: this.repo.eoscDatasourceType,
226
            registeredBy: this.repo.registeredBy
226
            registeredBy: this.repo.registeredby
227 227
          },
228 228
          this.repoInterfaces[i]
229 229
        ]);
......
232 232
      this.dataForInterfaceComp.push([
233 233
        true, 0,
234 234
        { id: this.repo.id,
235
          datasourceType: this.repo.datasourceType,
235
          datasourceType: this.repo.eoscDatasourceType,
236 236
          datasourceClass: this.repo.eoscDatasourceType,
237
          registeredBy: this.repo.registeredBy
237
          registeredBy: this.repo.registeredby
238 238
        }
239 239
      ]);
240 240
    }
......
328 328
      this.loadingMessage = 'Saving changes';
329 329
      this.errorMessage = '';
330 330
      console.log('reg this.repo', this.repo);
331
      this.repoService.addRepository( this.repo.datasourceType, this.repo).subscribe( //this.repo.collectedFrom
331
      this.repoService.addRepository( this.repo.eoscDatasourceType, this.repo).subscribe( //this.repo.collectedfrom
332 332
        response => {
333
          console.log(`addRepository responded: ${response.id}, ${response.registeredBy}`);
333
          console.log(`addRepository responded: ${response.id}, ${response.registeredby}`);
334 334
          this.repo = response;
335 335
        },
336 336
        error => {
......
353 353
          if (intrf.id) {
354 354
            let req;
355 355
            if (this.interfacesToDelete.some(id => id === intrf.id)) {
356
              req = this.repoService.deleteInterface(intrf.id, this.repo.registeredBy);
356
              req = this.repoService.deleteInterface(intrf.id, this.repo.registeredby);
357 357
            } else {
358 358
              // console.log('comments', intrf.comments);
359
              req = this.repoService.updateInterface(this.repo.id, this.repo.registeredBy, intrf.comments, intrf);
359
              req = this.repoService.updateInterface(this.repo.id, this.repo.registeredby, intrf.comments, intrf);
360 360
            }
361 361
            return req;
362 362
          } else {
363 363
            // console.log('comments', intrf.comments);
364
            return this.repoService.addInterface(this.repo.datasourceType, this.repo.id, this.repo.registeredBy, intrf.comments, intrf);
364
            return this.repoService.addInterface(this.repo.eoscDatasourceType, this.repo.id, this.repo.registeredby, intrf.comments, intrf);
365 365
          }
366 366
        })
367 367
      ).subscribe(
modules/uoa-repository-dashboard-gui/branches/new-datasource-mode/src/app/pages/sources/sources-register/register-new-datasource.component.ts
137 137

  
138 138
  addInterfaceToList(intrf?: RepositoryInterface) {
139 139
    const curIndex = this.dataForInterfaceComp.length;
140
    const curRepoInfo = { id: this.repo.id, datasourceType: this.repo.datasourceType,
141
      datasourceClass: this.repo.eoscDatasourceType, registeredBy: this.repo.registeredBy };
140
    const curRepoInfo = { id: this.repo.id, datasourceType: this.repo.eoscDatasourceType,
141
      datasourceClass: this.repo.eoscDatasourceType, registeredBy: this.repo.registeredby };
142 142
    if (intrf) {
143 143
      this.dataForInterfaceComp.push([true, curIndex, curRepoInfo, intrf]);
144 144
    } else {
......
180 180
        this.dataForInterfaceComp.push([
181 181
          true, i,
182 182
          { id: this.repo.id,
183
            datasourceType: this.repo.datasourceType,
183
            datasourceType: this.repo.eoscDatasourceType,
184 184
            datasourceClass: this.repo.eoscDatasourceType,
185
            registeredBy: this.repo.registeredBy
185
            registeredBy: this.repo.registeredby
186 186
          },
187 187
          this.repoInterfaces[i]
188 188
        ]);
......
191 191
      this.dataForInterfaceComp.push([
192 192
        true, 0,
193 193
        { id: this.repo.id,
194
          datasourceType: this.repo.datasourceType,
194
          datasourceType: this.repo.eoscDatasourceType,
195 195
          datasourceClass: this.repo.eoscDatasourceType,
196
          registeredBy: this.repo.registeredBy
196
          registeredBy: this.repo.registeredby
197 197
        }
198 198
      ]);
199 199
    }
......
223 223
      this.loadingMessage = 'Saving changes';
224 224
      this.errorMessage = '';
225 225
      console.log('add this.repo', this.repo);
226
      this.repoService.addRepository(this.repo.datasourceType, this.repo).subscribe(
226
      this.repoService.addRepository(this.repo.eoscDatasourceType, this.repo).subscribe(
227 227
        response => {
228
          console.log(`addRepository responded: ${response.id}, ${response.registeredBy}`);
228
          console.log(`addRepository responded: ${response.id}, ${response.registeredby}`);
229 229
          this.repo = response;
230 230
        },
231 231
        error => {
......
246 246
        concatMap(intrf => {
247 247
          if (intrf.id) {
248 248
            // console.log('comments', intrf.comments);
249
            return this.repoService.updateInterface(this.repo.id, this.repo.registeredBy, intrf.comments, intrf);
249
            return this.repoService.updateInterface(this.repo.id, this.repo.registeredby, intrf.comments, intrf);
250 250
          } else {
251 251
            // console.log('comments', intrf.comments);
252
            return this.repoService.addInterface(this.repo.datasourceType, this.repo.id, this.repo.registeredBy, intrf.comments, intrf);
252
            return this.repoService.addInterface(this.repo.eoscDatasourceType, this.repo.id, this.repo.registeredby, intrf.comments, intrf);
253 253
          }
254 254
        })
255 255
      ).subscribe(
modules/uoa-repository-dashboard-gui/branches/new-datasource-mode/src/app/services/repository.service.ts
47 47

  
48 48
  updateInterface(repoId: string, registeredBy: string, comment: string, interfaceInfo: RepositoryInterface): Observable<RepositoryInterface> {
49 49
    let url;
50
    console.log(comment);
50 51
    if (comment == null || comment === '') {
51 52
      url = `${this.apiUrl}updateRepositoryInterface?repoId=${repoId}&registeredBy=${registeredBy}`;
52 53
    } else {
......
161 162
    return this.httpClient.get<Map<string, string>>(url, headerOptions);
162 163
  }
163 164

  
164
  getDatasourceClasses(mode: string): Observable<Map<string, string>> {
165
  getDatasourceClasses(mode: string): Observable<Object> {
165 166
    const url = `${this.apiUrl}getDatasourceClasses/${mode}`;
166 167
    console.log(`knocking on: ${url}`);
167 168
    return this.httpClient.get<Map<string, string>>(url, headerOptions);
modules/uoa-repository-dashboard-gui/branches/new-datasource-mode/src/app/shared/reusablecomponents/sources-forms/datasource-create-form.component.html
57 57
          <form-inline [description]="issnDesc" [valid]="group.get('issn').valid">
58 58
            <span *ngIf="group.get('issn').invalid && group.get('issn').touched && group.get('issn').dirty"
59 59
                  class="help-block inline uk-text-danger"
60
                  style="margin-top: 0px; margin-bottom: 0px; padding-left: 10px;">Issn needs to be of the form: "1111-1111" or "1111-111X"</span>
60
                  style="margin-top: 0px; margin-bottom: 0px; padding-left: 10px;">Issn needs to be of the form: "1111-1111" or "1111-111X" or "11111111" or "1111111X"</span>
61 61
            <input formControlName="issn" class="md-input" type="text"
62 62
                   (focus)="group.get('issn').markAsUntouched()" (blur)="group.get('issn').updateValueAndValidity()">
63 63
          </form-inline>
......
71 71
          <form-inline [description]="eissnDesc" [valid]="group.get('eissn').valid">
72 72
            <span *ngIf="group.get('eissn').invalid && group.get('eissn').touched && group.get('eissn').dirty"
73 73
                  class="help-block inline uk-text-danger"
74
                  style="margin-top: 0px; margin-bottom: 0px; padding-left: 10px;">Eissn needs to be of the form: "1111-1111" or "1111-111X"</span>
74
                  style="margin-top: 0px; margin-bottom: 0px; padding-left: 10px;">Eissn needs to be of the form: "1111-1111" or "1111-111X" or "11111111" or "1111111X"</span>
75 75
            <input formControlName="eissn" class="md-input" type="text"
76 76
                   (focus)="group.get('eissn').markAsUntouched()" (blur)="group.get('eissn').updateValueAndValidity()">
77 77
          </form-inline>
......
85 85
          <form-inline [description]="lissnDesc" [valid]="group.get('lissn').valid">
86 86
            <span *ngIf="group.get('lissn').invalid && group.get('lissn').touched && group.get('lissn').dirty"
87 87
                  class="help-block inline uk-text-danger"
88
                  style="margin-top: 0px; margin-bottom: 0px; padding-left: 10px;">Lissn needs to be of the form: "1111-1111" or "1111-111X"</span>
88
                  style="margin-top: 0px; margin-bottom: 0px; padding-left: 10px;">Lissn needs to be of the form: "1111-1111" or "1111-111X" or "11111111" or "1111111X"</span>
89 89
            <input formControlName="lissn" class="md-input" type="text"
90 90
                   (focus)="group.get('lissn').markAsUntouched()" (blur)="group.get('lissn').updateValueAndValidity()">
91 91
          </form-inline>
......
277 277
        <form-inline [description]="datasourceTypeDesc" [valid]="group.get('datasourceType').valid">
278 278
          <select formControlName="datasourceType" class="md-input">
279 279
            <option value="">-- none selected --</option>
280
            <option *ngFor="let key of classCodes" value="{{key}}">{{ datasourceClasses[key] }}</option>
280
            <option *ngFor="let key of classCodes" value="{{key}}">{{ datasourceClasses.get(key) }}</option>
281 281
          </select>
282 282
        </form-inline>
283 283
      </div>
modules/uoa-repository-dashboard-gui/branches/new-datasource-mode/src/app/shared/reusablecomponents/sources-forms/datasource-create-form.component.ts
41 41
  countries: Country[] = [];
42 42
  datasourceClasses: Map<string, string> = new Map<string, string>();
43 43
  classCodes: string[] = [];
44
  // classCodes: string[] = [];
44 45

  
45 46
  @Input() mode: string;
46 47

  
......
57 58
    softwarePlatform : ['', Validators.required],
58 59
    platformName : '',
59 60
    officialName : ['', Validators.required],
60
    issn : ['', [Validators.pattern('^\\d{4}-\\d{3}[\\dxX]$')] ],
61
    eissn : ['', Validators.pattern('^\\d{4}-\\d{3}[\\dxX]$') ],
62
    lissn : ['', Validators.pattern('^\\d{4}-\\d{3}[\\dxX]$') ],
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]$)') ],
63 64
    repoDescription : ['', Validators.required],
64 65
    country : ['', Validators.required],
65 66
    longtitude : ['', [Validators.required, Validators.min(-180), Validators.max(180)] ],
......
110 111
    this.group = this.fb.group(this.groupDefinition);
111 112
    if (this.mode === 'journal') {
112 113
      this.group.get('issn').clearValidators();
113
      this.group.get('issn').setValidators([Validators.required, Validators.pattern('^\\d{4}-\\d{3}[\\dxX]$')]);
114
      this.group.get('issn').setValidators([Validators.required, Validators.pattern('^(\\d{4}-\\d{3}[\\dxX])|([0-9]{7}[\\dxX]$)')]);
114 115
    }
115 116
    this.getTypologies();
116 117
    this.getTimezones();
......
124 125

  
125 126
  setupForm() {
126 127
    if (this.selectedRepo) {
127
      console.log(`my datasource type is: ${this.selectedRepo.datasourceType}`);
128
      console.log(`my datasource type is: ${this?.selectedRepo?.eoscDatasourceType}`);
128 129

  
129 130
      this.group.setValue({
130
        softwarePlatform: this.selectedRepo.typology,
131
        softwarePlatform: this.selectedRepo.platform,
131 132
        platformName: '',
132
        officialName: this.selectedRepo.officialName,
133
        officialName: this.selectedRepo.officialname,
133 134
        issn: '',
134 135
        eissn: '',
135 136
        lissn: '',
......
137 138
        country: this.selectedRepo.organizations[0].country, // countryCode
138 139
        longtitude: this.selectedRepo.longitude,
139 140
        latitude: this.selectedRepo.latitude,
140
        websiteUrl: this.selectedRepo.websiteUrl,
141
        websiteUrl: this.selectedRepo.websiteurl,
141 142
        institutionName: this.selectedRepo.organizations[0].legalname,
142
        englishName: this.selectedRepo.englishName,
143
        logoUrl: this.selectedRepo.logoUrl,
143
        englishName: this.selectedRepo.englishname,
144
        logoUrl: this.selectedRepo.logourl,
144 145
        timezone: this.selectedRepo.timezone,
145
        datasourceType: this.selectedRepo.eoscDatasourceType,
146
        adminEmail: this.selectedRepo.contactEmail
146
        datasourceType: this.selectedRepo.eoscDatasourceType, // TODO: still needed?
147
        adminEmail: this.selectedRepo.contactemail
147 148
      });
148 149

  
149
      if (this.selectedRepo.datasourceType === 'journal') {
150
      if (this.selectedRepo.eoscDatasourceType === 'Journal archive') {
150 151

  
151 152
        let ssnToShow = this.selectedRepo.issn.slice(0, 4) + '-' + this.selectedRepo.issn.toString().slice(4);
152 153
        this.group.get('issn').setValue(ssnToShow);
......
185 186

  
186 187
  getDatasourceClasses() {
187 188
    this.repoService.getDatasourceClasses(this.mode).subscribe(
188
      classes => this.datasourceClasses = classes,
189
      classes => {
190
        for (const [key, value] of Object.entries(classes)) {
191
          this.datasourceClasses.set(key, value);
192
        }
193
      },
189 194
      error => {
190 195
        this.errorMessage = noServiceMessage;
191 196
        console.log(error);
192 197
      },
193 198
      () => {
194
        for (const key of Object.keys(this.datasourceClasses)) {
195
          this.classCodes.push(key);
196
        }
199
        this.classCodes = Array.from(this.datasourceClasses.keys());
197 200
      }
198 201
    );
199 202
  }
......
228 231

  
229 232
  createNewRepository(): Repository {
230 233
    const newRepo = new Repository();
231
    newRepo.officialName = this.group.get('officialName').value.toString();
232
    newRepo.englishName = this.group.get('englishName').value.toString();
233
    newRepo.websiteUrl = this.group.get('websiteUrl').value;
234
    newRepo.logoUrl = this.group.get('logoUrl').value;
235
    newRepo.contactEmail = this.group.get('adminEmail').value;
234
    newRepo.officialname = this.group.get('officialName').value.toString();
235
    newRepo.englishname = this.group.get('englishName').value.toString();
236
    newRepo.websiteurl = this.group.get('websiteUrl').value;
237
    newRepo.logourl = this.group.get('logoUrl').value;
238
    newRepo.contactemail = this.group.get('adminEmail').value;
236 239
    newRepo.organizations.push({
237 240
      legalshortname: null,
238 241
      legalname: this.group.get('institutionName').value.toString(),
......
243 246
    newRepo.latitude = this.group.get('latitude').value;
244 247
    newRepo.longitude = this.group.get('longtitude').value;
245 248
    newRepo.timezone = this.group.get('timezone').value;
246
    newRepo.eoscDatasourceType = this.group.get('datasourceType').value;
247
    if (this.group.get('softwarePlatform').value ) {
248
      newRepo.typology = this.group.get('softwarePlatform').value;
249
    if (this.group.get('softwarePlatform').value !== '') {
250
      console.log('1//', this.group.get('softwarePlatform').value);
251
      newRepo.platform = this.group.get('softwarePlatform').value;
249 252
    } else if (this.group.get('platformName').value) {
250
      newRepo.typology = this.group.get('platformName').value;
253
      newRepo.platform = this.group.get('platformName').value;
254
      console.log('2//', this.group.get('platformName').value);
251 255
    }
252
    // newRepo.typology = this.group.get('softwarePlatform').value;
256
    newRepo.typology = this.group.get('datasourceType').value;
257
    // newRepo.eoscDatasourceType = this.datasourceClasses.get(this.group.get('datasourceType').value);
258
    // console.warn(newRepo.eoscDatasourceType);
253 259
    newRepo.description = this.group.get('repoDescription').value.toString();
254 260
    newRepo.issn = '';
255 261
    newRepo.eissn = '';
......
271 277
      }
272 278
    }
273 279

  
274
    newRepo.registeredBy = this.authService.getUserEmail();
280
    newRepo.registeredby = this.authService.getUserEmail();
275 281

  
276 282
    /* THE BELOW FIELDS ARE NOT SET IN GWT CODE*/
277
    newRepo.datasourceType = this.mode;
283
    newRepo.eoscDatasourceType = this.mode; // TODO: delete this?
284
    console.warn(newRepo.eoscDatasourceType);
278 285
    newRepo.managed = true;
279 286

  
280 287
    const now = new Date(Date.now());
modules/uoa-repository-dashboard-gui/branches/new-datasource-mode/src/app/shared/reusablecomponents/sources-forms/datasource-update-form.component.html
12 12
      Basic information
13 13
    </h4>
14 14
  </div>
15
  <div *ngIf="selectedRepo.collectedFrom.split('openaire____::')[1] === 'opendoar'" class="uk-alert uk-alert-info">
15
  <div *ngIf="selectedRepo.collectedfrom.split('openaire____::')[1] === 'opendoar'" class="uk-alert uk-alert-info">
16 16
    The following fields are completed by OpenDOAR.<br>
17 17
    If you want to edit them, you can do it by using this
18 18
    <a target="_blank" href="{{ 'http://v2.sherpa.ac.uk/id/repository/' + repoId }}">OpenDOAR link</a>.
19 19
  </div>
20
  <div *ngIf="selectedRepo.collectedFrom.split('openaire____::')[1] === 're3data'" class="uk-alert uk-alert-info">
20
  <div *ngIf="selectedRepo.collectedfrom.split('openaire____::')[1] === 're3data'" class="uk-alert uk-alert-info">
21 21
    The following fields are completed by Re3data.<br>
22 22
    If you want to edit them, you can do it by using this
23 23
    <a target="_blank" href="{{ 'http://service.re3data.org/repository/' + repoId }}">Re3data link</a>.
24 24
  </div>
25
  <div *ngIf="selectedRepo.collectedFrom.split('openaire____::')[1] === 'fairsharing'" class="uk-alert uk-alert-info">
25
  <div *ngIf="selectedRepo.collectedfrom.split('openaire____::')[1] === 'fairsharing'" class="uk-alert uk-alert-info">
26 26
    The following fields are completed by FAIRsharing.<br>
27 27
    If you want to edit them, you can do it by using this
28
    <a target="_blank" href="{{ 'https://fairsharing.org/search?q=' + selectedRepo.officialName }}">FAIRsharing link</a>.
28
    <a target="_blank" href="{{ 'https://fairsharing.org/search?q=' + selectedRepo.officialname }}">FAIRsharing link</a>.
29 29
  </div>
30 30

  
31 31
  <div data-dynamic-fields="d_field_wizard" class="uk-grid" data-uk-grid-margin="" dynamic-fields-counter="0">
......
64 64
    </div>
65 65
  </div>
66 66

  
67
  <div *ngIf="selectedRepo.datasourceType == 'journal'">
67
  <div *ngIf="selectedRepo.eoscDatasourceType == 'Journal archive'">
68 68
    <div data-dynamic-fields="d_field_wizard" class="uk-grid" data-uk-grid-margin="" dynamic-fields-counter="0">
69 69
      <div class="uk-width-medium-1-1 parsley-row form_section uk-row-first">
70
        <div class="md-input-wrapper {{ (updateGroup.get('issn') != null) ? 'md-input-filled' : '' }}">
70
        <div class="md-input-wrapper {{ (updateGroup.get('issn') != null) ? 'md-input-filled' : '1234-5678' }}">
71 71
          <form-inline [description]="issnDesc" [valid]="updateGroup.get('issn').valid">
72 72
            <span *ngIf="updateGroup.get('issn').invalid && updateGroup.get('issn').touched && updateGroup.get('issn').dirty"
73 73
                  class="help-block inline uk-text-danger"
74
                  style="margin-top: 0px; margin-bottom: 0px; padding-left: 10px;">Issn needs to be of the form: "1111-1111" or "1111-111X"</span>
74
                  style="margin-top: 0px; margin-bottom: 0px; padding-left: 10px;">Issn needs to be of the form: "1111-1111" or "1111-111X" or "11111111" or "1111111X"</span>
75 75
            <input formControlName="issn" class="md-input" type="text"
76 76
                   (focus)="updateGroup.get('issn').markAsUntouched()" (blur)="updateGroup.get('issn').updateValueAndValidity()">
77 77
          </form-inline>
......
85 85
          <form-inline [description]="eissnDesc" [valid]="updateGroup.get('eissn').valid">
86 86
            <span *ngIf="updateGroup.get('eissn').invalid && updateGroup.get('eissn').touched && updateGroup.get('eissn').dirty"
87 87
                  class="help-block inline uk-text-danger"
88
                  style="margin-top: 0px; margin-bottom: 0px; padding-left: 10px;">Eissn needs to be of the form: "1111-1111" or "1111-111X"</span>
88
                  style="margin-top: 0px; margin-bottom: 0px; padding-left: 10px;">Eissn needs to be of the form: "1111-1111" or "1111-111X" or "11111111" or "1111111X"</span>
89 89
            <input formControlName="eissn" class="md-input" type="text"
90 90
                   (focus)="updateGroup.get('eissn').markAsUntouched()" (blur)="updateGroup.get('eissn').updateValueAndValidity()">
91 91
          </form-inline>
......
99 99
          <form-inline [description]="lissnDesc" [valid]="updateGroup.get('lissn').valid">
100 100
            <span *ngIf="updateGroup.get('lissn').invalid && updateGroup.get('lissn').touched && updateGroup.get('lissn').dirty"
101 101
                  class="help-block inline uk-text-danger"
102
                  style="margin-top: 0px; margin-bottom: 0px; padding-left: 10px;">Lissn needs to be of the form: "1111-1111" or "1111-111X"</span>
102
                  style="margin-top: 0px; margin-bottom: 0px; padding-left: 10px;">Lissn needs to be of the form: "1111-1111" or "1111-111X" or "11111111" or "1111111X"</span>
103 103
            <input formControlName="lissn" class="md-input" type="text"
104 104
                   (focus)="updateGroup.get('lissn').markAsUntouched()" (blur)="updateGroup.get('lissn').updateValueAndValidity()">
105 105
          </form-inline>
......
222 222
        <form-inline [description]="datasourceTypeDesc" [valid]="updateGroup.get('datasourceType').valid">
223 223
          <select formControlName="datasourceType" class="md-input">
224 224
            <option value="">-- none selected --</option>
225
            <option *ngFor="let key of classCodes" value="{{key}}">{{ datasourceClasses[key] }}</option>
225
            <option *ngFor="let key of classCodes" value="{{key}}">{{ datasourceClasses.get(key) }}</option>
226 226
          </select>
227 227
        </form-inline>
228 228
      </div>
......
249 249
    <button class="uk-button uk-button-primary updateRepoInfoButton" type="button" (click)="updateRepo()">Update Information</button>
250 250
  </div>
251 251
</form>
252

  
252
<pre>{{updateGroup.value|json}}</pre>
modules/uoa-repository-dashboard-gui/branches/new-datasource-mode/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]$')] ],
47
    eissn : ['', Validators.pattern('^\\d{4}-\\d{3}[\\dxX]$') ],
48
    lissn : ['', Validators.pattern('^\\d{4}-\\d{3}[\\dxX]$') ],
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]$)') ],
49 49
    repoDescription : ['', Validators.required],
50 50
    country : '',
51 51
    longtitude : '',
......
101 101

  
102 102
  setupUpdateForm() {
103 103
    if (this.selectedRepo) {
104

  
104
console.log(this.mode);
105 105
      this.updateGroup.setValue({
106
        softwarePlatform: this.selectedRepo.typology,
106
        softwarePlatform: this.selectedRepo.platform,
107 107
        platformName: '',
108
        officialName: this.selectedRepo.officialName,
108
        officialName: this.selectedRepo.officialname,
109 109
        issn: '',
110 110
        eissn: '',
111 111
        lissn: '',
......
113 113
        country: this.selectedRepo.organizations[0].country, // countryCode
114 114
        longtitude: this.selectedRepo.longitude,
115 115
        latitude: this.selectedRepo.latitude,
116
        websiteUrl: this.selectedRepo.websiteUrl,
116
        websiteUrl: this.selectedRepo.websiteurl,
117 117
        institutionName: this.selectedRepo.organizations[0].legalname,
118
        englishName: this.selectedRepo.englishName,
119
        logoUrl: this.selectedRepo.logoUrl,
118
        englishName: this.selectedRepo.englishname,
119
        logoUrl: this.selectedRepo.logourl,
120 120
        timezone: this.selectedRepo.timezone,
121
        datasourceType: this.selectedRepo.eoscDatasourceType,
122
        adminEmail: this.selectedRepo.contactEmail
121
        datasourceType: this.selectedRepo.typology, // TODO: rename to typology?
122
        adminEmail: this.selectedRepo.contactemail
123 123
      });
124 124

  
125
      if ( this.selectedRepo.typology === '' || !this.typologies.some(x => x.value === this.selectedRepo.typology) ) {
125
      if ( this.selectedRepo.platform === '' || !this.typologies.some(x => x.value === this.selectedRepo.platform) ) {
126 126
        this.updateGroup.get('softwarePlatform').setValue('');
127
        this.updateGroup.get('platformName').setValue(this.selectedRepo.typology);
127
        this.updateGroup.get('platformName').setValue(this.selectedRepo.platform);
128 128
      }
129 129

  
130
      if (this.selectedRepo.eoscDatasourceType === 'Journal archive') {
131
        console.log('inside journal');
132
        this.updateGroup.get('issn').setValue(this.selectedRepo.issn);
133
        this.updateGroup.get('eissn').setValue(this.selectedRepo.eissn);
134
        this.updateGroup.get('lissn').setValue(this.selectedRepo.lissn);
135
      }
136

  
130 137
      // FIXME: Use eoscDatasourceType when we support the new model
131 138
      if ((this.mode === 'opendoar') || (this.mode === 're3data')) {
132 139

  
......
150 157
        let ssnToShow = this.selectedRepo.issn.slice(0, 4) + '-' + this.selectedRepo.issn.toString().slice(4);
151 158
        this.updateGroup.get('issn').setValue(ssnToShow);
152 159
        this.updateGroup.get('issn').clearValidators();
153
        this.updateGroup.get('issn').setValidators([Validators.required, Validators.pattern('^\\d{4}-\\d{3}[\\dxX]$')]);
160
        this.updateGroup.get('issn').setValidators([Validators.required, Validators.pattern('^(\\d{4}-\\d{3}[\\dxX])|([0-9]{7}[\\dxX]$)')]);
154 161

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

  
173 180
  getDatasourceClasses() {
174 181
    // FIXME: Use eoscDatasourceType when we support the new model
175
    this.repoService.getDatasourceClasses(this.selectedRepo.collectedFrom.split('::')[1]).subscribe(
176
      classes => this.datasourceClasses = classes,
182
    console.log('mode b4 getdatasourceclasses ', this.mode);
183

  
184
    let param = this.selectedRepo.collectedfrom.split('::')[1];
185
    if (this.selectedRepo.eoscDatasourceType === 'Journal archive') { param = 'journal'; }
186
    if (this.selectedRepo.eoscDatasourceType === 'Aggregator') { param = 'aggregator'; }
187

  
188
    this.repoService.getDatasourceClasses(param).subscribe(
189
      classes => {
190
        for (const [key, value] of Object.entries(classes)) {
191
          this.datasourceClasses.set(key, value);
192
        }},
177 193
      error => {
178 194
        this.loadingMessage = '';
179 195
        this.errorMessage = noServiceMessage;
180 196
        console.log(error);
181 197
      },
182 198
      () => {
183
        for (const key of Object.keys(this.datasourceClasses)) {
184
          this.classCodes.push(key);
185
        }
199
        console.log('gotDatasourceClasses');
200
        this.classCodes = Array.from(this.datasourceClasses.keys());
186 201
        this.getCountries();
187 202
      }
188 203
    );
189 204
  }
190 205

  
191 206
  getCountries() {
192
    this.repoService.getCountries()
193
      .subscribe(
207
    this.repoService.getCountries().subscribe(
194 208
        countries => this.countries = countries.sort( function(a, b) {
195 209
          if (a.name < b.name) {
196 210
            return -1;
......
205 219
          this.errorMessage = noServiceMessage;
206 220
          console.log(error);
207 221
        }, () => {
222
        console.log('gotCountries');
208 223
          this.getTypologies();
209 224
        });
210 225
  }
......
217 232
        console.log(error);
218 233
      },
219 234
      () => {
235
        console.log('gotTypologies');
220 236
        this.getTimezones();
221 237
      }
222 238
    );
......
230 246
        console.log(error);
231 247
      },
232 248
      () => {
249
        console.log('gotTimezones');
233 250
        this.loadingMessage = '';
234 251
        this.setupUpdateForm();
235 252
      }
......
243 260
    window.scroll(1, 1);
244 261

  
245 262
    if (this.updateGroup.valid) {
246
      if ( this.selectedRepo.datasourceType !== 'journal' || this.updateGroup.get('issn').value ) {
263
      if ( this.selectedRepo.eoscDatasourceType !== 'journal' || this.updateGroup.get('issn').value ) {
247 264
        this.refreshSelectedRepo();
248 265

  
249 266
        /*
......
288 305

  
289 306
  refreshSelectedRepo() {
290 307
    if (this.updateGroup.get('softwarePlatform').value ) {
291
      this.selectedRepo.typology = this.updateGroup.get('softwarePlatform').value;
308
      this.selectedRepo.platform = this.updateGroup.get('softwarePlatform').value;
292 309
    } else if (this.updateGroup.get('platformName').value) {
293
      this.selectedRepo.typology = this.updateGroup.get('platformName').value;
310
      this.selectedRepo.platform = this.updateGroup.get('platformName').value;
294 311
    }
295
    this.selectedRepo.officialName = this.updateGroup.get('officialName').value.toString();
312
    this.selectedRepo.typology = this.updateGroup.get('datasourceType').value;
313
    console.log('typology ', this.selectedRepo.typology);
314
    console.log(this.datasourceClasses);
315
    console.log(this.updateGroup.get('datasourceType').value);
316
    // this.selectedRepo.eoscDatasourceType = this.datasourceClasses.get(this.updateGroup.get('datasourceType').value);
317
    // console.warn(this.selectedRepo.eoscDatasourceType);
318
    this.selectedRepo.officialname = this.updateGroup.get('officialName').value.toString();
296 319
    this.selectedRepo.description = this.updateGroup.get('repoDescription').value.toString();
297 320
    this.selectedRepo.organizations[0].country = this.updateGroup.get('country').value; // countryCode
298 321
    this.selectedRepo.longitude = this.updateGroup.get('longtitude').value;
299 322
    this.selectedRepo.latitude = this.updateGroup.get('latitude').value;
300
    this.selectedRepo.websiteUrl = this.updateGroup.get('websiteUrl').value;
323
    this.selectedRepo.websiteurl = this.updateGroup.get('websiteUrl').value;
301 324
    this.selectedRepo.organizations[0].legalname = this.updateGroup.get('institutionName').value.toString();
302
    this.selectedRepo.englishName = this.updateGroup.get('englishName').value.toString();
303
    this.selectedRepo.logoUrl = this.updateGroup.get('logoUrl').value;
325
    this.selectedRepo.englishname = this.updateGroup.get('englishName').value.toString();
326
    this.selectedRepo.logourl = this.updateGroup.get('logoUrl').value;
304 327
    this.selectedRepo.timezone = this.updateGroup.get('timezone').value;
305
    this.selectedRepo.eoscDatasourceType = this.updateGroup.get('datasourceType').value;
306
    this.selectedRepo.contactEmail = this.updateGroup.get('adminEmail').value;
307
    if (this.selectedRepo.datasourceType === 'journal') {
328
    this.selectedRepo.contactemail = this.updateGroup.get('adminEmail').value;
329
    if (this.selectedRepo.eoscDatasourceType === 'journal') {
308 330
      let ssnParts = this.updateGroup.get('issn').value.split('-');
309 331
      let correctSSN = ssnParts[0] + ssnParts[1];
310 332
      this.selectedRepo.issn = correctSSN;
......
320 342
      }
321 343
    }
322 344
    if (!this.showButton) { // on register
323
      this.selectedRepo.registeredBy = this.authService.getUserEmail();
345
      this.selectedRepo.registeredby = this.authService.getUserEmail();
324 346
      this.selectedRepo.managed = true;
325 347
      const now = new Date(Date.now());
326 348
      this.selectedRepo.consentTermsOfUseDate = now;
modules/uoa-repository-dashboard-gui/branches/new-datasource-mode/src/app/shared/sidemenu/sidemenu.component.html
113 113
        </a>
114 114
        <ul [ngClass]="{'uk-display-block': visibleAdminRepo}">
115 115
          <li class="act_item">
116
            <a *ngIf="adminRepository?.officialName && adminRepository.officialName.length>30" [routerLink]="['/repositoryAdmin/' + adminRepository.id]">{{adminRepository.officialName.substr(0,30)}}...</a>
117
            <a *ngIf="adminRepository?.officialName && adminRepository.officialName.length<=30" [routerLink]="['/repositoryAdmin/' + adminRepository.id]">{{adminRepository.officialName}}</a>
116
            <a *ngIf="adminRepository?.officialname && adminRepository.officialname.length>30" [routerLink]="['/repositoryAdmin/' + adminRepository.id]">{{adminRepository.officialname.substr(0,30)}}...</a>
117
            <a *ngIf="adminRepository?.officialname && adminRepository.officialname.length<=30" [routerLink]="['/repositoryAdmin/' + adminRepository.id]">{{adminRepository.officialname}}</a>
118 118
          </li>
119 119
        </ul>
120 120
      </li>

Also available in: Unified diff