Project

General

Profile

1
import {Component, Input} from '@angular/core';
2
import {EnvProperties} from '../../../utils/properties/env-properties';
3
import {ClaimDBContext, ClaimDBProject, ClaimDBResult} from "../claimHelper.class";
4

    
5
//Usage Example "<claim-entity [entity]="" [type]="" > </claim-entity>"
6

    
7
//externalUrl
8
@Component({
9
  selector: 'claim-entity',
10
  template: `
11
    <div *ngIf="type == 'publication'" title="Publication">
12
      <div class="uk-text-muted">publication</div>
13
      <!-- <span class="uk-margin-small-right uk-icon"><svg width="20" height="20" viewBox="0 0 20 20"
14
                                                        xmlns="http://www.w3.org/2000/svg" ratio="1"><rect fill="none"
15
                                                                                                           stroke="#000"
16
                                                                                                           x="3.5"
17
                                                                                                           y="2.5"
18
                                                                                                           width="12"
19
                                                                                                           height="16"></rect><polyline
20
         fill="none" stroke="#000" points="5 0.5 17.5 0.5 17.5 17"></polyline></svg></span>-->
21
      <publication-title [entity]="entity" param="articleId"
22
                         path="/search/publication" [externalPortalUrl]=externalPortalUrl></publication-title>
23
    </div>
24
    <div *ngIf="type == 'dataset'" title="Dataset">
25
      <div class="uk-text-muted">research data</div>
26
      <!--<span class="uk-margin-small-right uk-icon"><svg width="20" height="20" viewBox="0 0 20 20"
27
                                                       xmlns="http://www.w3.org/2000/svg" ratio="1"><ellipse fill="none"
28
                                                                                                             stroke="#000"
29
                                                                                                             cx="10"
30
                                                                                                             cy="4.64"
31
                                                                                                             rx="7.5"
32
                                                                                                             ry="3.14"></ellipse><path
33
        fill="none" stroke="#000" d="M17.5,8.11 C17.5,9.85 14.14,11.25 10,11.25 C5.86,11.25 2.5,9.84 2.5,8.11"></path><path
34
        fill="none" stroke="#000"
35
        d="M17.5,11.25 C17.5,12.99 14.14,14.39 10,14.39 C5.86,14.39 2.5,12.98 2.5,11.25"></path><path fill="none"
36
                                                                                                      stroke="#000"
37
                                                                                                      d="M17.49,4.64 L17.5,14.36 C17.5,16.1 14.14,17.5 10,17.5 C5.86,17.5 2.5,16.09 2.5,14.36 L2.5,4.64"></path></svg></span>-->
38
      <publication-title [entity]="entity" param="datasetId"
39
                         path="/search/dataset" [externalPortalUrl]=externalPortalUrl></publication-title>
40
    </div>
41
    <div *ngIf="type == 'software'" title="Software">
42
      <div class="uk-text-muted">software</div>
43
      <!-- <span class="uk-margin-small-right uk-icon">
44
         <svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" ratio="1"> <circle
45
           fill="none" stroke="#000" cx="9.997" cy="10" r="3.31"></circle> <path fill="none" stroke="#000"
46
                                                                                 d="M18.488,12.285 L16.205,16.237 C15.322,15.496 14.185,15.281 13.303,15.791 C12.428,16.289 12.047,17.373 12.246,18.5 L7.735,18.5 C7.938,17.374 7.553,16.299 6.684,15.791 C5.801,15.27 4.655,15.492 3.773,16.237 L1.5,12.285 C2.573,11.871 3.317,10.999 3.317,9.991 C3.305,8.98 2.573,8.121 1.5,7.716 L3.765,3.784 C4.645,4.516 5.794,4.738 6.687,4.232 C7.555,3.722 7.939,2.637 7.735,1.5 L12.263,1.5 C12.072,2.637 12.441,3.71 13.314,4.22 C14.206,4.73 15.343,4.516 16.225,3.794 L18.487,7.714 C17.404,8.117 16.661,8.988 16.67,10.009 C16.672,11.018 17.415,11.88 18.488,12.285 L18.488,12.285 Z"></path></svg>
47
       </span>-->
48
      <publication-title [entity]="entity" param="softwareId"
49
                         path="/search/software" [externalPortalUrl]=externalPortalUrl></publication-title>
50
    </div>
51
    <div *ngIf="type == 'other'" title="Other reserch product">
52
      <div class="uk-text-muted">other</div>
53
      <!--<span class="uk-margin-small-right uk-icon">
54
        <svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"> <polygon fill="none"
55
                                                                                                     stroke="#000"
56
                                                                                                     points="2.5,5.7 10,1.3 17.5,5.7 17.5,14.3 10,18.7 2.5,14.3"></polygon> <circle
57
          fill="none" stroke="#000" cx="10" cy="10" r="3.5"></circle></svg>
58
      </span>-->
59
      <publication-title [entity]="entity" param="orpId"
60
                         path="/search/other" [externalPortalUrl]=externalPortalUrl></publication-title>
61
    </div>
62
    <div *ngIf="type == 'project'  " title="Project">
63
      <div class="uk-text-muted">project</div>
64
      <!--<span class="uk-margin-small-right uk-icon"><svg width="20" height="20" viewBox="0 0 20 20"
65
                                                       xmlns="http://www.w3.org/2000/svg" ratio="1"><rect x="5" y="2"
66
                                                                                                          width="10"
67
                                                                                                          height="1"></rect><rect
68
        x="3" y="4" width="14" height="1"></rect><rect fill="none" stroke="#000" x="1.5" y="6.5" width="17"
69
                                                       height="11"></rect></svg></span>-->
70
      <project-title [project]="entity" [searchLink]=properties.searchLinkToProject
71
                     [externalPortalUrl]=externalPortalUrl></project-title>
72
    </div>
73
    <div *ngIf="type == 'context'  " title="Concept">
74
      <div class="uk-text-muted">community</div>
75
      <!--<span class="uk-margin-small-right uk-icon"><svg width="20" height="20" viewBox="0 0 20 20"
76
                                                       xmlns="http://www.w3.org/2000/svg" ratio="1"><circle fill="none"
77
                                                                                                            stroke="#000"
78
                                                                                                            stroke-width="1.1"
79
                                                                                                            cx="7.7"
80
                                                                                                            cy="8.6"
81
                                                                                                            r="3.5"></circle><path
82
        fill="none" stroke="#000" stroke-width="1.1"
83
        d="M1,18.1 C1.7,14.6 4.4,12.1 7.6,12.1 C10.9,12.1 13.7,14.8 14.3,18.3"></path><path fill="none" stroke="#000"
84
                                                                                            stroke-width="1.1"
85
                                                                                            d="M11.4,4 C12.8,2.4 15.4,2.8 16.3,4.7 C17.2,6.6 15.7,8.9 13.6,8.9 C16.5,8.9 18.8,11.3 19.2,14.1"></path></svg></span>-->
86
      <span>{{entity.title}}</span>
87
    </div>
88
  `
89
})
90

    
91
export class ClaimEntityFormatter {
92
  @Input() entity: ClaimDBResult | ClaimDBContext | ClaimDBProject;
93
  @Input() type: string;
94
  @Input() properties: EnvProperties;
95
  @Input() externalPortalUrl: string = null;
96

    
97
  constructor() {
98
  }
99

    
100
  ngOnInit() {
101
  }
102

    
103

    
104
}
105

    
(1-1/4)