Project

General

Profile

« Previous | Next » 

Revision 52373

Metrics: add short version option
Dataprovider Landing: change tabs to accordion, changes dataProviderInfo and tabs info to work better with accordion view

View differences:

modules/uoa-services-library/trunk/ng-openaire-library/src/app/landingPages/dataProvider/dataProvider.component.html
69 69
                  [_dataproviderService]="_dataproviderService">
70 70
            </tabs-->
71 71
            <div *ngIf="showTabs">
72
                <ul *ngIf="dataProviderInfo.tabs != undefined" class="uk-tab uk-visible@xl" uk-tab="connect: #tab-content">
72

  
73
                <!--ul *ngIf="dataProviderInfo.tabs != undefined" class="uk-tab uk-visible@xl" uk-tab="connect: #tab-content">
73 74
                    <li *ngFor="let tab of dataProviderInfo.tabs; let i=index" id="{{dataProviderInfo.tabs[i].content}}"
74 75
                        [class]="activeTab==tab.name?'uk-active':''">
75 76
                        <a
......
129 130
                                </span>
130 131
                        </a>
131 132
                    </li>
133
                </ul-->
134
                <ul class="custom-accordion" uk-accordion *ngIf="dataProviderInfo.tabs2 != undefined">
135

  
136
                    <li *ngIf="dataProviderInfo.tabs2.indexOf('Publications') != -1" (click)="search('publicationsTab', 1, 10); activeTab='Publications'">
137
                        <a class="uk-accordion-title" href="#">Publications
138
                          <span class="uk-badge uk-badge-notification">
139
                              {{fetchPublications.searchUtils.totalResults | number}}
140
                          </span>
141
                        </a>
142
                        <div class="uk-accordion-content">
143
                          <publicationsTab *ngIf="activeTab=='Publications'"
144
                                           [paramsForSearchLink]="paramsForSearchLink"
145
                                           [fetchPublications] = "fetchPublications" [(properties)]=properties>
146
                          </publicationsTab>
147
                        </div>
148
                    </li>
149
                    <li *ngIf="dataProviderInfo.tabs2.indexOf('Research Data') != -1" (click)="search('datasetsTab', 1, 10); activeTab='Research Data'">
150
                        <a class="uk-accordion-title" href="#">Research Data</a>
151
                        <div class="uk-accordion-content">
152
                          <p>
153
                            <datasetsTab *ngIf="activeTab=='Research Data'"
154
                            [paramsForSearchLink]="paramsForSearchLink"
155
                            [fetchDatasets]="fetchDatasets" [(properties)]=properties>
156
                          </datasetsTab>
157
                          </p>
158
                        </div>
159
                    </li>
160

  
161
                    <li *ngIf="dataProviderInfo.tabs2.indexOf('Software') != -1" (click)="search('softwareTab', 1, 10); activeTab='Software'">
162
                        <a class="uk-accordion-title" href="#">Software</a>
163
                        <div class="uk-accordion-content">
164
                          <softwareTab *ngIf="activeTab=='Software'"
165
                                       [paramsForSearchLink]="paramsForSearchLink"
166
                                       [fetchSoftware]="fetchSoftware" [(properties)]=properties>
167
                          </softwareTab>
168
                        </div>
169
                    </li>
170
                    <li *ngIf="dataProviderInfo.tabs2.indexOf('Projects') != -1" (click)="search('projectsTab', 1, 10); activeTab='Projects'">
171
                        <a class="uk-accordion-title" href="#">Projects</a>
172
                        <div class="uk-accordion-content">
173
                          <projectsTab *ngIf="activeTab=='Projects'"
174
                                       [paramsForSearchLink]="paramsForSearchLink"
175
                                       [fetchProjects]="fetchProjects" [(properties)]=properties>
176
                          </projectsTab>
177
                        </div>
178
                    </li>
179
                    <li *ngIf="dataProviderInfo.tabs2.indexOf('Content Providers') != -1" (click)="search('datasourcesTab', 1, 10); activeTab='Content Providers'">
180
                        <a class="uk-accordion-title" href="#">Content Providers</a>
181
                        <div class="uk-accordion-content">
182
                          <datasourcesTab *ngIf="activeTab=='Content Providers'"
183
                                          [paramsForSearchLink]="paramsForSearchLink"
184
                                          [fetchDataproviders]="fetchDataproviders" [(properties)]=properties>
185
                          </datasourcesTab>
186
                        </div>
187
                    </li>
188
                    <li *ngIf="dataProviderInfo.tabs2.indexOf('Organizations') != -1" (click)="search('organizationsTab', 1, 10); activeTab='Organizations'">
189
                        <a class="uk-accordion-title" href="#">Organizations</a>
190
                        <div class="uk-accordion-content">
191
                          <organizationsTab *ngIf="activeTab=='Organizations'"
192
                                            [organizations]="dataProviderInfo.organizations">
193
                          </organizationsTab>
194
                        </div>
195
                    </li>
196
                    <li *ngIf="dataProviderInfo.tabs2.indexOf('Related Content Providers') != -1" (click)="search('relatedDatasourcesTab', 1, 10); activeTab='Related Content Providers'">
197
                        <a class="uk-accordion-title" href="#">Related Content Providers</a>
198
                        <div class="uk-accordion-content">
199
                          <relatedDatasourcesTab *ngIf="activeTab=='Related Content Providers'"
200
                              [dataproviderId]="datasourceId"
201
                              [results]="dataProviderInfo.relatedDatasources"
202
                              [loading]="loadingRelatedDatasources"
203
                              [fetchPublications]="fetchAggregatorsPublications"
204
                              [fetchDatasets]="fetchAggregatorsDatasets"  [(properties)]=properties>
205
                          </relatedDatasourcesTab>
206
                        </div>
207
                    </li>
208
                    <li *ngIf="dataProviderInfo.tabs2.indexOf('Statistics') != -1" (click)="search('statisticsTab', 1, 10); activeTab='Statistics'">
209
                        <a class="uk-accordion-title" href="#">Statistics</a>
210
                        <div class="uk-accordion-content">
211
                          <div *ngIf="activeTab=='Statistics' && statsClicked">
212

  
213
                            <errorMessages [status]="[fetchPublications.searchUtils.status, fetchDatasets.searchUtils.status]" [type]="'statistics'"></errorMessages>
214

  
215
                            <div *ngIf="(fetchPublications.searchUtils.totalResults != 0 || fetchDatasets.searchUtils.totalResults != 0)">
216
                              <p class="uk-text-bold">Latest Research Result Timeline</p>
217
                              <i-frame  [url]=docsTimelineUrl width="800" height="350"></i-frame>
218
                              <p class="uk-text-bold">Research Result Types</p>
219
                              <i-frame [url]=docsTypesUrl width="800" height="350"></i-frame>
220
                            </div>
221

  
222

  
223
                              <div *ngIf="fetchPublications.searchUtils.totalResults > 0 || (fetchDatasets.searchUtils.totalResults > 0)">
224

  
225
                                    <p class="uk-text-bold">Funders in Research Results of content provider</p>
226
                                    <i-frame  [url]=docsFunderUrl width="800" height="350"></i-frame>
227

  
228
                              </div>
229
                              <div *ngIf="fetchPublications.searchUtils.totalResults > 0 ">
230
                                  <p class="uk-text-bold">Projects with most Publications</p>
231
                                  <i-frame [url]=pubsProjectsUrl width="800" height="350"></i-frame>
232
                              </div>
233
                              <div *ngIf="(fetchDatasets.searchUtils.totalResults > 0)">
234
                                    <div>
235
                                        <p class="uk-text-bold">Projects with most Research Data</p>
236
                                        <i-frame  [url]=dataProjectsUrl width="800" height="350"></i-frame>
237
                                    </div>
238
                              </div>
239
                            </div>
240
                        </div>
241
                    </li>
242

  
243

  
244

  
245
                    <li *ngIf="dataProviderInfo.tabs2.indexOf('Metrics') != -1" (click)="search('metricsTab', 1, 10); activeTab='Metrics'">
246
                        <a class="uk-accordion-title" href="#">Metrics</a>
247
                        <div class="uk-accordion-content">
248
                          <metrics *ngIf="activeTab=='Metrics'" [pageViews]="pageViews"
249
                              [id]="datasourceId" [entityType]="'datasources'" [entity]="'Content Provider'"
250
                              (metricsResults)="metricsResults($event)" [(properties)] = properties>
251
                          </metrics>
252
                          <i-frame *ngIf="activeTab=='Metrics' && metricsClicked && totalViews > 0"
253
                              [url]=viewsFrameUrl width="100%" height="250">
254
                          </i-frame>
255
                          <i-frame *ngIf="activeTab=='Metrics' && metricsClicked && totalDownloads > 0"
256
                              [url]=downloadsFrameUrl width="100%" height="250">
257
                          </i-frame>
258
                        </div>
259
                    </li>
260

  
132 261
                </ul>
262
                <!--div *ngIf="dataProviderInfo.tabs != undefined" class="uk-margin custom-tab-content">
133 263

  
134
                <!--ul *ngIf="dataProviderInfo.tabs != undefined" id="tab-content" class="uk-switcher uk-margin custom-tab-content"-->
135
                <div *ngIf="dataProviderInfo.tabs != undefined" class="uk-margin custom-tab-content">
136

  
137
                    <!--div class="uk-animation-fade" *ngFor="let tab of dataProviderInfo.tabs; let i=index"-->
138 264
                    <div class="uk-animation-fade">
139
                        <!--*ngIf="tab.content=='publicationsTab'"-->
140 265
                        <publicationsTab *ngIf="activeTab=='Publications'"
141 266
                                         [paramsForSearchLink]="paramsForSearchLink"
142 267
                                         [fetchPublications] = "fetchPublications" [(properties)]=properties>
143 268
                        </publicationsTab>
144
                        <!--*ngIf="tab.content=='datasetsTab'"-->
145 269
                        <datasetsTab *ngIf="activeTab=='Research Data'"
146 270
                                     [paramsForSearchLink]="paramsForSearchLink"
147 271
                                     [fetchDatasets]="fetchDatasets" [(properties)]=properties>
......
150 274
                                     [paramsForSearchLink]="paramsForSearchLink"
151 275
                                     [fetchSoftware]="fetchSoftware" [(properties)]=properties>
152 276
                        </softwareTab>
153
                        <!--*ngIf="  tab.content=='projectsTab'"-->
154 277
                        <projectsTab *ngIf="activeTab=='Projects'"
155 278
                                     [paramsForSearchLink]="paramsForSearchLink"
156 279
                                     [fetchProjects]="fetchProjects" [(properties)]=properties>
157 280
                        </projectsTab>
158
                        <!--*ngIf="  tab.content=='datasourcesTab'"-->
159 281
                        <datasourcesTab *ngIf="activeTab=='Content Providers'"
160 282
                                        [paramsForSearchLink]="paramsForSearchLink"
161 283
                                        [fetchDataproviders]="fetchDataproviders" [(properties)]=properties>
162 284
                        </datasourcesTab>
163
                        <!--*ngIf="  tab.content=='organizationsTab'"-->
164 285
                        <organizationsTab *ngIf="activeTab=='Organizations'"
165 286
                                          [organizations]="dataProviderInfo.organizations">
166 287
                        </organizationsTab>
167
                        <!--*ngIf="  tab.content=='relatedDatasourcesTab'"-->
168 288
                        <relatedDatasourcesTab *ngIf="activeTab=='Related Content Providers'"
169 289
                            [dataproviderId]="datasourceId"
170 290
                            [results]="dataProviderInfo.relatedDatasources"
171 291
                            [loading]="loadingRelatedDatasources"
172 292
                            [fetchPublications]="fetchAggregatorsPublications"
173 293
                            [fetchDatasets]="fetchAggregatorsDatasets"  [(properties)]=properties>
174
                            <!--[type]="relatedDataprovidersResultsType"-->
175 294
                        </relatedDatasourcesTab>
176 295

  
177
                        <!-- *ngIf="  tab.content=='statisticsTab' && statsClicked"-->
178 296
                        <div *ngIf="activeTab=='Statistics' && statsClicked">
179
                          <!--div *ngIf="fetchPublications.searchUtils.totalResults == 0 && fetchDatasets.searchUtils.totalResults == 0" class = "uk-alert  uk-alert-primary">
180
                              No statistics available
181
                          </div-->
182
                          <!--div *ngIf="fetchPublications.searchUtils.status == errorCodes.NONE && fetchDatasets.searchUtils.status == errorCodes.NONE"
183
                                class="uk-alert uk-alert-primary uk-animation-fade" role="alert">No statistics available</div>
184
                          <div *ngIf="fetchPublications.searchUtils.status == errorCodes.ERROR || fetchDatasets.searchUtils.status == errorCodes.ERROR"
185
                                class="uk-alert uk-alert-warning uk-animation-fade" role="alert">An Error Occured</div>
186
                          <div *ngIf="fetchPublications.searchUtils.status == errorCodes.NOT_AVAILABLE || fetchDatasets.searchUtils.status == errorCodes.NOT_AVAILABLE"
187
                                class="uk-alert uk-alert-danger uk-animation-fade" role="alert">Service not available</div>
188
                          <div *ngIf="fetchPublications.searchUtils.status == errorCodes.LOADING || fetchDatasets.searchUtils.status == errorCodes.LOADING"
189
                                class="uk-animation-fade uk-margin-large-top  uk-width-1-1" role="alert"><img class="loading-gif  uk-align-center" ></div-->
190 297

  
191 298
                          <errorMessages [status]="[fetchPublications.searchUtils.status, fetchDatasets.searchUtils.status]" [type]="'statistics'"></errorMessages>
192 299

  
......
215 322
                                  </div>
216 323
                            </div>
217 324
                          </div>
218
                        </div>
219 325

  
220
                        <!--*ngIf="  tab.content=='metricsTab'"-->
221
                        <!--[name]="dataProviderInfo.title['name']"-->
326

  
222 327
                        <metrics *ngIf="activeTab=='Metrics'" [pageViews]="pageViews"
223 328
                            [id]="datasourceId" [entityType]="'datasources'" [entity]="'Content Provider'"
224 329
                            (metricsResults)="metricsResults($event)" [(properties)] = properties>
......
229 334
                        <i-frame *ngIf="activeTab=='Metrics' && metricsClicked && totalDownloads > 0"
230 335
                            [url]=downloadsFrameUrl width="100%" height="250">
231 336
                        </i-frame>
232
                    </div>
233
                <!--/ul-->
337
                      </div>
338

  
339
                    </div-->
234 340
                </div>
235 341

  
236 342
        </div>
......
239 345
            <div>
240 346
              Share - Bookmark<addThis ></addThis>
241 347
            </div>
348
            <metrics  [pageViews]="pageViews" shortView=true
349
            [id]="datasourceId" [entityType]="'datasources'" [entity]="'Content Provider'"
350
            (metricsResults)="metricsResults($event)" [(properties)] = properties>
351
          </metrics>
242 352
          </div>
243 353
        </div>
244 354
      </div>
245 355
    </div>
356

  
246 357
  </div>
247 358
  </div>
248 359
</div>
modules/uoa-services-library/trunk/ng-openaire-library/src/app/landingPages/dataProvider/dataProvider.service.ts
93 93
            if(this.dataProviderInfo.tabs == undefined) {
94 94
                this.dataProviderInfo.tabs = new Array<{"name": string, "content": string}>();
95 95
            }
96

  
96
            this.dataProviderInfo.tabs = [];
97 97
            if(this.dataProviderInfo.tabsInTypes.publicationsTab.has(data[1].classid)) {
98 98
                this.dataProviderInfo.tabs.push({"name": "Publications", "content": "publicationsTab"});
99
                this.dataProviderInfo.tabs2.push("Publications");
99 100
            }
100 101
            if(this.dataProviderInfo.tabsInTypes.datasetsTab.has(data[1].classid)) {
101 102
                this.dataProviderInfo.tabs.push({"name": "Research Data", "content": "datasetsTab"});
103
                this.dataProviderInfo.tabs2.push("Research Data");
102 104
            }
103 105

  
104 106
            if(this.dataProviderInfo.tabsInTypes.projectsTab.has(data[1].classid)) {
105 107
                this.dataProviderInfo.tabs.push({"name": "Projects", "content": "projectsTab"});
108
                this.dataProviderInfo.tabs2.push("Projects");
106 109
            }
107 110
            if(this.dataProviderInfo.tabsInTypes.datasourcesTab.has(data[1].classid)) {
108 111
                this.dataProviderInfo.tabs.push({"name": "Content Providers", "content": "datasourcesTab"});
112
                this.dataProviderInfo.tabs2.push("Content Providers");
109 113
            }
110 114
            this.dataProviderInfo.tabs.push({"name": "Organizations", "content": "organizationsTab"});
115
            this.dataProviderInfo.tabs2.push("Organizations");
111 116

  
112 117
            if(this.dataProviderInfo.tabsInTypes.relatedDatasourcesTab.has(data[1].classid)) {
113 118
                this.dataProviderInfo.tabs.push({"name": "Related Content Providers", "content": "relatedDatasourcesTab"});
119
                this.dataProviderInfo.tabs2.push("Related Content Providers");
114 120
            }
115 121

  
116 122
            if(this.dataProviderInfo.tabsInTypes.statisticsTab.has(data[1].classid)) {
117 123
                this.dataProviderInfo.tabs.push({"name": "Statistics", "content": "statisticsTab"});
124
                this.dataProviderInfo.tabs2.push("Statistics");
118 125
            }
119 126

  
120 127
            if(this.dataProviderInfo.tabsInTypes.softwareTab.has(data[1].classid)) {
121 128
                this.dataProviderInfo.tabs.push({"name": "Software", "content": "softwareTab"});
129
                this.dataProviderInfo.tabs2.push("Software");
122 130
            }
123 131

  
124 132
            /*if(this.dataProviderInfo.tabsInTypes.otherTab.has(data[1].classid)) {
......
126 134
            }*/
127 135

  
128 136
            this.dataProviderInfo.tabs.push({"name": "Metrics", "content": "metricsTab"});
137
            this.dataProviderInfo.tabs2.push("Metrics");
129 138

  
130 139
            if(this.dataProviderInfo.resultTypes.collectedFrom.has(data[1].classid)) {
131 140
                this.dataProviderInfo.resultsBy = "collectedFrom";
modules/uoa-services-library/trunk/ng-openaire-library/src/app/landingPages/landing-utils/metrics.component.ts
9 9
@Component({
10 10
    selector: 'metrics',
11 11
    template: `
12
    <div *ngIf="!shortView">
12 13
    <errorMessages [status]="[status]" [type]="'metrics'"></errorMessages>
13 14
    <div *ngIf="metrics != undefined" class="uk-child-width-1-3@m uk-grid-small uk-grid-match uk-grid" uk-grid="">
14 15
        <div *ngIf="entityType == 'projects'" class="uk-width-1-1 uk-text-center uk-text-meta uk-margin">Project metrics are derived from aggregating individual research results metrics.</div>
......
71 72
            </tr>
72 73
        </tbody>
73 74
    </table>
75
    </div>
76
    <div *ngIf="shortView">
77
      <dl *ngIf="metrics" class="uk-description-list-line">
78
        <dt class="title">Other Metrics</dt>
79
        <dd class="line" >
80
          {{metrics.pageViews | number}} views in OpenAIRE
81
        </dd>
82
        <dd class="line">
83
           {{metrics.totalViews | number}}
84
          <span *ngIf="metrics.totalViews > 0 && metrics.totalOpenaireViews > 0">
85
          ( {{metrics.totalOpenaireViews | number}} from OpenAIRE )
86
          </span>
87
          views in local repository
88
        </dd>
89
        <dd class="line">
90
          {{metrics.totalDownloads | number}}
91
          <span *ngIf="metrics.totalDownloads > 0 && metrics.totalOpenaireDownloads > 0">
92
          ( {{metrics.totalOpenaireDownloads | number}} from OpenAIRE )
93
          </span> downloads in local repository
94
        </dd>
95
      </dl>
96
    </div>
74 97
    `
75 98
    })
76 99

  
......
82 105
    //@Input() name: string = "";
83 106
    @Input() pageViews: number = 0;
84 107
    @Input() properties:EnvProperties;
108
    @Input() shortView:boolean = false;
85 109

  
86 110
    public metrics: Metrics;
87 111
    public errorCodes:ErrorCodes;
......
113 137
         data => {
114 138
             this.metrics = data;
115 139
             this.status = this.errorCodes.DONE;
116

  
117 140
             this.metricsResults.emit({
118 141
                 totalViews: this.metrics.totalViews,
119 142
                 totalDownloads: this.metrics.totalDownloads,
modules/uoa-services-library/trunk/ng-openaire-library/src/app/utils/entities/dataProviderInfo.ts
13 13
    aggregationStatus: {"fundedContent": string, "indexRecords": string}; //collected from datasource api
14 14

  
15 15
    tabs: {"name": string, "content": string}[];
16
    tabs2: string[] =[];
16 17
    tabsInTypes = {
17 18
        "publicationsTab": new Set<string>(
18 19
                        [   "aggregator::pubsrepository::institutional",
modules/uoa-services-library/trunk/ng-openaire-library/src/assets/library.css
188 188
text-overflow: ellipsis;
189 189
/*min-width: 81px;*/
190 190
}
191
.filterItem{
192
  margin-bottom: 5px !important;
193
}
191 194

  
192 195
.browseFilters{
193 196
overflow-y: auto;
......
600 603
.citation-accordion .uk-accordion-title {
601 604
  font-family: Raleway;
602 605
}
606

  
607
.textOverflowEllipsis {
608
overflow: hidden;
609
text-overflow: ellipsis;
610
white-space: nowrap;
611
}
612

  
613
.custom-accordion .uk-accordion-title{
614
    text-align: left;
615
    background: #f8f8ff;
616
    padding: 4px;
617
    color: #3055ba !important;
618
    font-size: 14px;
619
    text-transform: initial !important;
620
    font-weight: inherit !important;
621
    /*border-top: gray solid 1px;*/
622

  
623
}
624

  
625
.custom-accordion  .uk-accordion-title::after {
626
    float: none;;
627
    padding: 12px;
628
}
629

  
630
.custom-accordion{
631
  /*border: gray solid 1px;*/
632
  border-top: 0px;
633
}
634

  
635
.custom-accordion .uk-accordion-content{
636
  /*margin:12px;*/
637
  margin: 5px;
638
  border: gray 2px;
639
  border-style: dashed;
640
  padding: 12px;
641
}

Also available in: Unified diff