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:

organization.component.ts
21 21
import {Location} from "@angular/common";
22 22
import {FetchResearchResults} from "../../utils/fetchEntitiesClasses/fetchResearchResults.class";
23 23
import {FetchDataproviders} from "../../utils/fetchEntitiesClasses/fetchDataproviders.class";
24
import {IndexInfoService} from "../../utils/indexInfo.service";
24 25

  
25 26
@Component({
26 27
  selector: 'organization',
......
124 125
              private _router: Router,
125 126
              private helper: HelperService,
126 127
              private seoService: SEOService,
127
              private _location: Location) {
128
              private _location: Location,
129
              private indexInfoService: IndexInfoService) {
128 130
    this.fetchProjects = new FetchProjects(this._searchProjectsService);
129 131
    this.fetchDataproviders = new FetchDataproviders(this._searchDataprovidersService);
130 132
    this.fetchPublications = new FetchResearchResults(this._searchResearchResultsService);
......
137 139
    this.route.data
138 140
      .subscribe((data: { envSpecific: EnvProperties }) => {
139 141
        this.properties = data.envSpecific;
140
        if (this.properties.lastIndexUpdate) {
141
          this.indexUpdateDate = new Date(this.properties.lastIndexUpdate);
142
        if (typeof document !== 'undefined') {
143
          this.indexInfoService.getLastIndexDate(this.properties).subscribe(lastIndexUpdate => {
144
            if (lastIndexUpdate) {
145
              this.indexUpdateDate = new Date(lastIndexUpdate);
146
            } else if (this.properties.lastIndexUpdate) {
147
              this.indexUpdateDate = new Date(this.properties.lastIndexUpdate);
148
            }
149
          });
142 150
        }
143 151
        //this.getDivContents();
144 152
        this.getPageContents();
......
330 338
            this.piwiksub = this._piwikService.trackView(this.properties, this.organizationInfo.title.name, this.piwikSiteId).subscribe();
331 339
          }
332 340
          var refineFields: string [] = ["funder"];
333
          this.getTotalResearchResults();
334
          this.getTotalDataproviders();
341

  
342
          if (typeof document !== 'undefined') {
343
            this.getTotalResearchResults();
344
            this.getTotalDataproviders();
345
          }
346

  
335 347
          this.fetchProjects.getResultsForOrganizations(this.organizationId, "", 1, this.searchNumber, refineFields, this.properties);
336 348
          this.showLoading = false;
337 349
        }

Also available in: Unified diff