Project

General

Profile

« Previous | Next » 

Revision 56936

[mergeResultLandingPages | Library]:
resultLanding.component: small bug fixes in names used & 'Other versions' removed from accordion and added as modal which opens with a note under the title.

View differences:

modules/uoa-services-library/branches/mergeResultLandingPages/ng-openaire-library/src/app/landingPages/resultLanding.component.html
16 16
          <div class="uk-width-2-3@m uk-width-1-1@s  uk-margin-bottom">
17 17
            <schema2jsonld *ngIf="resultLandingInfo.record" [data]=resultLandingInfo.record
18 18
                           [URL]="properties.baseLink+linkToLandingPage+id"></schema2jsonld>
19
            <showTitle [titleName]="resultLandingInfo.title"></showTitle>
19
            <showTitle [titleName]="resultLandingInfo.title" [classNames]="(properties.environment != 'production' && resultLandingInfo.deletedByInferenceIds) ? 'uk-margin-remove-bottom' : ''"></showTitle>
20
            <div *ngIf="properties.environment != 'production' && resultLandingInfo.deletedByInferenceIds"
21
                 class="uk-text-muted uk-text-small uk-margin-bottom" (click)="openDeletedByInference()">
22
              The following information is result of merging
23
              <a>Original sources ({{resultLandingInfo.deletedByInferenceIds.length}})</a>
24
            </div>
20 25
            <p class="uk-text-large" *ngIf="resultLandingInfo.subtitle">
21 26
              <span [innerHTML]="resultLandingInfo.subtitle"></span>
22 27
            </p>
......
356 361
                </div>
357 362
              </li>
358 363

  
359
              <li (click)="activeTab='Other Versions'"
360
                  *ngIf="properties.environment != 'production' && resultLandingInfo.deletedByInferenceIds">
361
                <a class="uk-accordion-title" href="#">
362
                  Other Versions
363
                  ({{resultLandingInfo.deletedByInferenceIds.length | number}})
364
                </a>
365
                <div *ngIf="activeTab=='Other Versions'" class="uk-accordion-content">
366
                  <deletedByInference *ngIf="type == 'publication'"
367
                                      [id]="id" [ids]="resultLandingInfo.deletedByInferenceIds" [type]="'publications'"></deletedByInference>
368
                  <deletedByInference *ngIf="type == 'dataset'"
369
                                      [id]="id" [ids]="resultLandingInfo.deletedByInferenceIds" [type]="'research data'"></deletedByInference>
370
                  <deletedByInference *ngIf="type == 'software'"
371
                                      [id]="id" [ids]="resultLandingInfo.deletedByInferenceIds" [type]="'software'"></deletedByInference>
372
                  <deletedByInference *ngIf="type == 'orp'"
373
                                      [id]="id" [ids]="resultLandingInfo.deletedByInferenceIds" [type]="'other research products'"></deletedByInference>
374
                </div>
375
              </li>
364
<!--              <li (click)="activeTab='Other Versions'"-->
365
<!--                  *ngIf="properties.environment != 'production' && resultLandingInfo.deletedByInferenceIds">-->
366
<!--                <a class="uk-accordion-title" href="#">-->
367
<!--                  Other Versions-->
368
<!--                  ({{resultLandingInfo.deletedByInferenceIds.length | number}})-->
369
<!--                </a>-->
370
<!--                <div *ngIf="activeTab=='Other Versions'" class="uk-accordion-content">-->
371
<!--                  <deletedByInference *ngIf="type == 'publication'"-->
372
<!--                                      [id]="id" [ids]="resultLandingInfo.deletedByInferenceIds" [type]="'publications'"></deletedByInference>-->
373
<!--                  <deletedByInference *ngIf="type == 'dataset'"-->
374
<!--                                      [id]="id" [ids]="resultLandingInfo.deletedByInferenceIds" [type]="'research data'"></deletedByInference>-->
375
<!--                  <deletedByInference *ngIf="type == 'software'"-->
376
<!--                                      [id]="id" [ids]="resultLandingInfo.deletedByInferenceIds" [type]="'software'"></deletedByInference>-->
377
<!--                  <deletedByInference *ngIf="type == 'orp'"-->
378
<!--                                      [id]="id" [ids]="resultLandingInfo.deletedByInferenceIds" [type]="'other research products'"></deletedByInference>-->
379
<!--                </div>-->
380
<!--              </li>-->
376 381
            </ul>
377 382

  
378 383
          </div>
......
390 395
                                                                                fill="none" stroke="#000"
391 396
                                                                                stroke-width="1.1"></path></svg>
392 397
               </span>
393
               Link this {{type.toLowerCase()}} to...
398
                Link this <span *ngIf="type != 'orp'">{{title.toLowerCase()}}</span><span *ngIf="type == 'orp'">research product</span> to...
394 399
              </button>
395 400

  
396 401
              <div class="  uk-text-center uk-margin-expand uk-padding-small    uk-margin-auto  default-dropdown "
......
482 487
<!--              </li>-->
483 488
              <li>
484 489
                <div class=" sideInfoTitle  cite-this-button uk-width-1-1" type="button">
485
                  Cite this {{type.toLowerCase()}}
490
                  Cite this <span *ngIf="type != 'orp'">{{title.toLowerCase()}}</span><span *ngIf="type == 'orp'">research product</span>
486 491
                </div>
487 492
                <div class=" ">
488
                  <citeThis [result]="resultLandingInfo" [id]="id" [type]="type.toLowerCase()"></citeThis>
493
                  <citeThis [result]="resultLandingInfo" [id]="id" [type]="title.toLowerCase()"></citeThis>
489 494
                </div>
490 495
              </li>
491 496
            </ul>
......
500 505
  </div>
501 506
</div>
502 507

  
508
<modal-alert #AlertModalDeletedByInference>
509
  <deletedByInference *ngIf="type == 'publication'"
510
                      [id]="id" [ids]="resultLandingInfo.deletedByInferenceIds" [type]="'publications'"></deletedByInference>
511
  <deletedByInference *ngIf="type == 'dataset'"
512
                      [id]="id" [ids]="resultLandingInfo.deletedByInferenceIds" [type]="'research data'"></deletedByInference>
513
  <deletedByInference *ngIf="type == 'software'"
514
                      [id]="id" [ids]="resultLandingInfo.deletedByInferenceIds" [type]="'software'"></deletedByInference>
515
  <deletedByInference *ngIf="type == 'orp'"
516
                      [id]="id" [ids]="resultLandingInfo.deletedByInferenceIds" [type]="'other research products'"></deletedByInference>
517
</modal-alert>
503 518

  
modules/uoa-services-library/branches/mergeResultLandingPages/ng-openaire-library/src/app/landingPages/resultLanding.component.ts
1
import {Component, Input} from '@angular/core';
1
import {Component, Input, ViewChild} from '@angular/core';
2 2
import {ActivatedRoute, Router} from '@angular/router';
3 3
import {Meta, Title} from '@angular/platform-browser';
4 4

  
......
27 27
  // Active tab variable for responsiveness
28 28
  @Input() activeTab: string = "References";
29 29

  
30
  @ViewChild('AlertModalDeletedByInference') alertModalDeletedByInference;
31

  
30 32
  public resultLandingInfo: ResultLandingInfo;
31 33
  public id: string;
32 34
  public title: string;
......
382 384
    }
383 385
    return false;
384 386
  }
387

  
388
  openDeletedByInference() {
389
    this.alertModalDeletedByInference.cancelButton = false;
390
    this.alertModalDeletedByInference.okButton = false;
391
    this.alertModalDeletedByInference.alertTitle = "Original sources";
392
    //this.alertModalDeletedByInference.message = "There was an error in csv downloading. Please try again later.";
393
    //this.alertModalDeletedByInference.okButtonText = "OK";
394
    this.alertModalDeletedByInference.open();
395
  }
385 396
}
modules/uoa-services-library/branches/mergeResultLandingPages/ng-openaire-library/src/app/landingPages/resultLanding.module.ts
23 23
import {ShowAuthorsModule}        from "../utils/authors/showAuthors.module";
24 24
import {HelperModule} from "../utils/helper/helper.module";
25 25
import {ResultLandingUtilsModule} from "./landing-utils/resultLandingUtils.module";
26
import {AlertModalModule} from "../utils/modal/alertModal.module";
26 27

  
27 28
@NgModule({
28 29
  imports: [
29 30
    CommonModule, FormsModule, LandingModule, SharedModule, RouterModule,
30 31
    CiteThisModule, PagingModule, IFrameModule,
31 32
    MetricsModule, AltMetricsModule, ConfigurationServiceModule, Schema2jsonldModule, SEOServiceModule,
32
    DeletedByInferenceModule, ShowAuthorsModule, HelperModule, ResultLandingUtilsModule
33
    DeletedByInferenceModule, ShowAuthorsModule, HelperModule, ResultLandingUtilsModule, AlertModalModule
33 34
  ],
34 35
  declarations: [
35 36
    ResultLandingComponent
modules/uoa-services-library/branches/mergeResultLandingPages/ng-openaire-library/src/app/landingPages/landing-utils/showTitle.component.ts
4 4
@Component({
5 5
    selector: 'showTitle',
6 6
    template: `
7
        <h2 *ngIf="title != undefined" class="landingTitle">
8
            <span   *ngIf="title['url'] != undefined && title['url'] != null && title['url'] != ''"
9
                    class="custom-external">
10

  
11
                <a *ngIf="title['name'] != undefined && title['name'] != ''"
12
                    href="{{title['url']}}" target="_blank"
13
                    [innerHTML]="title['name']">
14
                </a>
15
                <a *ngIf="title['name'] == undefined || title['name'] == ''"
16
                    href="{{title['url']}}" target="_blank">
17
                    [no title available]
18
                </a>
19
            </span>
20
            <span *ngIf="(title['name'] != undefined && title['name'] != '') &&
21
                    (title['url'] == undefined || title['url'] == null || title['url'] == '')"
22
                    [innerHTML]="title['name']">
23
            </span>
24
            <span *ngIf="(title['name'] == undefined || title['name'] == '') &&
25
                    (title['url'] == undefined || title['url'] == null || title['url'] == '')"
26
                     >
27
                [no title available]
28
            </span>
7
        <h2 [class]="classNames">
8
          <div *ngIf="title != undefined" class="landingTitle">
9
              <span   *ngIf="title['url'] != undefined && title['url'] != null && title['url'] != ''"
10
                      class="custom-external">
11
  
12
                  <a *ngIf="title['name'] != undefined && title['name'] != ''"
13
                      href="{{title['url']}}" target="_blank"
14
                      [innerHTML]="title['name']">
15
                  </a>
16
                  <a *ngIf="title['name'] == undefined || title['name'] == ''"
17
                      href="{{title['url']}}" target="_blank">
18
                      [no title available]
19
                  </a>
20
              </span>
21
              <span *ngIf="(title['name'] != undefined && title['name'] != '') &&
22
                      (title['url'] == undefined || title['url'] == null || title['url'] == '')"
23
                      [innerHTML]="title['name']">
24
              </span>
25
              <span *ngIf="(title['name'] == undefined || title['name'] == '') &&
26
                      (title['url'] == undefined || title['url'] == null || title['url'] == '')"
27
                       >
28
                  [no title available]
29
              </span>
30
          </div>
31
          <div *ngIf="titleName">
32
            <span [innerHTML]="titleName"></span>
33
          </div>
34
          <div *ngIf="!titleName && !title">
35
            <span>[no title available]</span>
36
          </div>
29 37
        </h2>
30
        <h2 *ngIf="titleName">
31
          <span [innerHTML]="titleName"></span>
32
        </h2>
33
        <h2 *ngIf="!titleName && !title">
34
          <span>[no title available]</span>
35
        </h2>
36 38
    `
37 39

  
38 40
    })
......
41 43
  @Input() titleName: string;
42 44
  @Input() title: { [key: string]: string };
43 45
  @Input() iconClass:string;
46
  @Input() classNames: string = "";
44 47

  
45 48
  sub: any;
46 49

  

Also available in: Unified diff