Project

General

Profile

« Previous | Next » 

Revision 58874

[Trunk | Library]:
1. src/assets/common-assets/common/custom.css: Add 'font-display: swap;' in '@font-face' css rules - improve performance.
2. dataProvider.component.html & organizations.component.html & project.component.html & resultLanding.component.html: Add check if 'indexUpdateDate' is initialized.
3. dataProvider.component.ts & organization.component.ts & project.component.ts & resultLanding.component.ts:
Initialize 'indexUpdateDate' and tabs counts only if "typeof document !== 'undefined'" (javascript is enabled) - improve performance.
4. resultLanding.component.ts: Get "provenanceActionVocabulary" and "altMetrics" only if "typeof document !== 'undefined'" (javascript is enabled) - improve performance.
5. organization.component.ts: [Bug fix] Get 'indexUpdateDate' from service (not properties) if available.
6. project.component.ts: [Bug fix] Call 'getProjectInfo()' only once (was called twice).
7. project.service.ts: [Bug fix] Add check for rels.rel.to.class=="hasParticipant" (when not array).
8. metrics.component.ts: Get metrics if "typeof document !== 'undefined'" (javascript is enabled) | Show charts only if user clicked on metrics badge | Do not set "width" for <i-frame> elements.
9. iframe.component.ts: Add case when only height is sent as input.
10. searchDataProviders.component.ts & searchOrganizations.component.ts: [Bug fix] Set "firstLoad" to false after getting results (was asking refine filters in paging too).
11. search-tab.component.ts: [Bug fix]: In method "getEntityName()" add cases when 'entityType "project"' and 'entityType "dataprovider"' and fix case when 'entityType == "result"'.
12. navigationBar.component.ts: [Bug fix] Do not initialize navbar inside route.queryParams subscription - !!! check it carefully when deployed in all portals !!! .

View differences:

resultLanding.component.ts
116 116
    this.route.data
117 117
      .subscribe((data: { envSpecific: EnvProperties }) => {
118 118
        this.properties = data.envSpecific;
119
        this.indexInfoService.getLastIndexDate(this.properties).subscribe(lastIndexUpdate => {
120
          if (lastIndexUpdate) {
121
            this.indexUpdateDate = new Date(lastIndexUpdate);
122
          } else if (this.properties.lastIndexUpdate) {
123
            this.indexUpdateDate = new Date(this.properties.lastIndexUpdate);
124
          }
125
        });
119
        if (typeof document !== 'undefined') {
120
          this.indexInfoService.getLastIndexDate(this.properties).subscribe(lastIndexUpdate => {
121
            if (lastIndexUpdate) {
122
              this.indexUpdateDate = new Date(lastIndexUpdate);
123
            } else if (this.properties.lastIndexUpdate) {
124
              this.indexUpdateDate = new Date(this.properties.lastIndexUpdate);
125
            }
126
          });
127
        }
126 128
        //this.getDivContents();
127 129
        this.getPageContents();
128 130
        this.updateUrl(data.envSpecific.baseLink + this._router.url);
......
248 250
    this.showLoading = true;
249 251
    
250 252
    this.resultLandingInfo = null;
253

  
254
    if (typeof document !== 'undefined') {
255
      this._resultLaningService.getProvenanceActionVocabulary(this.properties).subscribe(
256
        provenanceActionVocabulary => {
257
          this.getResultLandingInfo(provenanceActionVocabulary);
258
        }, err => {
259
          this.getResultLandingInfo(null);
260
          this.handleError("Error getting provenance action vocabulary for " + this.type + " with id: " + this.id, err);
261
        }
262
      );
263
    } else {
264
      this.getResultLandingInfo(null);
265
    }
251 266
    
252
    this._resultLaningService.getProvenanceActionVocabulary(this.properties).subscribe(
253
      provenanceActionVocabulary => {
254
        this.getResultLandingInfo(provenanceActionVocabulary);
255
      }, err => {
256
        this.getResultLandingInfo(null);
257
        this.handleError("Error getting provenance action vocabulary for " + this.type + " with id: " + this.id, err);
258
      }
259
    );
260
    
261 267
  }
262 268
  
263 269
  private setActiveTab() {
......
325 331
          });
326 332
        }
327 333
        this.bioentitiesNum = bioentitiesNum;
328
        if (this.resultLandingInfo.identifiers != undefined && this.resultLandingInfo.identifiers.has('doi')) {
329
          this.doi = this.resultLandingInfo.identifiers.get('doi')[0];
330
          this.metricsService.hasAltMetrics(this.properties.altMetricsAPIURL, this.doi).subscribe(hasAltMetrics => {
331
            this.hasAltMetrics = hasAltMetrics;
332
          }, error => {
333
            this.hasAltMetrics = false;
334
          });
334
        if(typeof document !== 'undefined') {
335
          if (this.resultLandingInfo.identifiers != undefined && this.resultLandingInfo.identifiers.has('doi')) {
336
            this.doi = this.resultLandingInfo.identifiers.get('doi')[0];
337
            this.metricsService.hasAltMetrics(this.properties.altMetricsAPIURL, this.doi).subscribe(hasAltMetrics => {
338
              this.hasAltMetrics = hasAltMetrics;
339
            }, error => {
340
              this.hasAltMetrics = false;
341
            });
342
          }
335 343
        }
336 344
        this.showLoading = false;
337 345
        this.setActiveTab();

Also available in: Unified diff