Project

General

Profile

« Previous | Next » 

Revision 59037

[Library|Trunk]

Result Landing: Fix issue reading the parameter id when the type changes. Read it based on the param name instead of the type.

View differences:

resultLanding.component.ts
131 131
    this.updateUrl(this.properties.baseLink + this._router.url);
132 132
    this.sub = this.route.queryParams.subscribe(data => {
133 133
      this.resultLandingInfo = null;
134
      if (this.type == "publication") {
134
      if (data['articleId']) {
135
        this.type = "publication";
135 136
        this.updateTitle("Publication");
136 137
        this.linkToLandingPage = this.properties.searchLinkToPublication;
137 138
        this.linkToSearchPage = this.properties.searchLinkToPublications;
138 139
        this.id = data['articleId'];
139 140
        this.title = "Publication";
140
      } else if (this.type == "dataset") {
141
      } else if (data['datasetId']) {
141 142
        this.updateTitle("Dataset");
143
        this.type = "dataset";
142 144
        this.linkToLandingPage = this.properties.searchLinkToDataset;
143 145
        this.linkToSearchPage = this.properties.searchLinkToDatasets;
144 146
        this.id = data['datasetId'];
145 147
        this.title = "Research Data";
146
      } else if (this.type == "software") {
148
      } else if (data['softwareId']) {
147 149
        this.updateTitle("Software");
150
        this.type = "software";
148 151
        this.linkToLandingPage = this.properties.searchLinkToSoftware;
149 152
        this.linkToSearchPage = this.properties.searchLinkToSoftwareLanding;
150 153
        this.id = data['softwareId'];
151 154
        this.title = "Software";
152
      } else if (this.type == "orp") {
155
      } else if (data['orpId']) {
156
        this.type = "orp";
153 157
        this.updateTitle("Other Research Product");
154 158
        this.linkToLandingPage = this.properties.searchLinkToOrp;
155 159
        this.linkToSearchPage = this.properties.searchLinkToOrps;
156 160
        this.id = data['orpId'];
157 161
        this.title = "Other Research Product";
158
      } else if (this.type == "result") {
162
      } else if (data["id"]) {
159 163
        this.id = data["id"];
160 164
        this.updateTitle("Research Result");
161 165
        this.linkToLandingPage = this.properties.searchLinkToOrp;
......
165 169
      this.updateDescription("");
166 170
      
167 171
      this.metricsClicked = false;
168
      
172

  
169 173
      if (this.id && StringUtils.isOpenAIREID(this.id)) {
170 174
        this.getProvenanceVocabularyAndResultLandingInfo();
171 175
      } else {
......
512 516
  updateUrlWithType() {
513 517
    this.type = this.resultLandingInfo.resultType;
514 518
    if (this.type == "publication") {
515
      this._location.go("test");
516 519
      this.linkToLandingPage = this.properties.searchLinkToPublication;
517 520
      this.linkToSearchPage = this.properties.searchLinkToPublications;
518 521
    } else if (this.type == "dataset") {

Also available in: Unified diff