Project

General

Profile

« Previous | Next » 

Revision 58821

[Connect|Trunk]

Server.ts: allow iframes from d4science.org

index.html: clean up js files

View differences:

modules/uoa-connect-portal/trunk/src/app/community/community.component.html
9 9

  
10 10
<ng-template #tab_content
11 11
             let-resultType="resultType" let-fetch="fetch" let-searchLinkToAdvancedPage="searchLinkToAdvancedPage"
12
             let-params="params" let-type="type" let-typeName="typeName">
12
             let-params="params" let-type="type" let-typeName="typeName" let-showImpactFactors="showImpactFactors">
13 13
  <div class="uk-grid uk-margin-remove">
14 14
    <div class="uk-width-expand uk-padding">
15 15
      <search-tab [fetch]="fetch" [resultType]="resultType" [params]="params"
16
                  [searchLinkToAdvancedPage]="searchLinkToAdvancedPage" [properties]="properties">
16
                  [searchLinkToAdvancedPage]="searchLinkToAdvancedPage" [properties]="properties" [showImpactFactors]="showImpactFactors" >
17 17
      </search-tab>
18 18
    </div>
19 19

  
......
368 368
                                resultType: 'publication', fetch: fetchPublications,
369 369
                                searchLinkToAdvancedPage: properties.searchLinkToAdvancedResults,
370 370
                                params: getParamsForSearchLink('publications'),
371
                                type: 'publication', typeName: 'publication'}">
371
                                type: 'publication', typeName: 'publication', showImpactFactors:(community.communityId == 'elixir-gr')}">
372 372
              </ng-container>
373 373
            </ng-template>
374 374
            <ng-template #datasets_tab>
......
376 376
                                resultType: 'dataset', fetch: fetchDatasets,
377 377
                                searchLinkToAdvancedPage: properties.searchLinkToAdvancedResults,
378 378
                                params: getParamsForSearchLink('datasets'),
379
                                type: 'dataset', typeName: 'research data'}">
379
                                type: 'dataset', typeName: 'research data', showImpactFactors:(community.communityId == 'elixir-gr')}">
380 380
              </ng-container>
381 381
            </ng-template>
382 382
            <ng-template #software_tab>
......
384 384
                                  resultType: 'software', fetch: fetchSoftware,
385 385
                                  searchLinkToAdvancedPage: properties.searchLinkToAdvancedResults,
386 386
                                  params: getParamsForSearchLink('software'),
387
                                  type: 'software', typeName: 'software'}">
387
                                  type: 'software', typeName: 'software', showImpactFactors:(community.communityId == 'elixir-gr')}">
388 388
              </ng-container>
389 389
            </ng-template>
390 390
            <ng-template #other_tab>
......
392 392
                                  resultType: 'other', fetch: fetchOrps,
393 393
                                  searchLinkToAdvancedPage: properties.searchLinkToAdvancedResults,
394 394
                                  params: getParamsForSearchLink('other'),
395
                                  type: 'orp', typeName: 'other products'}">
395
                                  type: 'orp', typeName: 'other products', showImpactFactors:(community.communityId == 'elixir-gr')}">
396 396
              </ng-container>
397 397
            </ng-template>
398 398
            <ng-template #analytics_tab>
modules/uoa-connect-portal/trunk/src/app/landingPages/result/result.component.ts
5 5

  
6 6
@Component({
7 7
    selector: 'openaire-publication',
8
    template: `<result-landing type="result" [activeTab]="'References'" [piwikSiteId]="piwikSiteId" [communityId]="communityId"></result-landing>`,
8
    template: `<result-landing type="result" [piwikSiteId]="piwikSiteId" [communityId]="communityId"></result-landing>`,
9 9
 })
10 10
export class OpenaireResultComponent{
11 11
  piwikSiteId = null;
modules/uoa-connect-portal/trunk/src/app/searchEntries/results/results.component.ts
1
import {Component, Input} from '@angular/core';
2
import {CommunityInfo} from '../../openaireLibrary/connect/community/communityInfo';
3
import {EnvProperties} from "../../openaireLibrary/utils/properties/env-properties";
4
import {SearchResult} from "../../openaireLibrary/utils/entities/searchResult";
5

  
6
@Component({
7
    selector: 'results-comp',
8
    template: `      
9
    <div class="tab-header">Recent {{getEntityName(resultType, true, true)}}</div>
10
    <div *ngIf="!results && total != 0">
11
        <div *ngIf="showLoading" class="uk-animation-fade uk-width-1-1" role="alert"><span class="loading-gif uk-align-center"></span></div>
12
    </div>
13
    <div *ngIf="results != null && results.length > 0">
14
      <div class="uk-text-right">
15
        <div>
16
          <a class="el-content uk-button uk-button-text" [queryParams]="{type:getresultTypeLink(resultType, true), qf:false}" routerLinkActive="router-link-active" [routerLink]="properties.searchLinkToResults">
17
            View all {{getEntityName(resultType, true, true)}}
18
          </a>
19
        </div>
20
      </div>
21
    </div>
22
    <div *ngIf="results != null && results.length > 0 && !showLoading">
23
      <!--<div class="uk-margin-remove-vertical uk-grid-match uk-child-width-1-1 uk-child-width-1-1@m uk-child-width-1-1@l uk-child-width-1-1@xl uk-grid-small uk-grid uk-grid-stack" uk-grid="">
24
        <li *ngFor="let item of results; let i = index">
25
         <div class="uk-first-column">
26
            <div class="el-item uk-panel">
27
              <h6 class="el-title uk-margin uk-h6 uk-text-primary uk-margin-remove-adjacent uk-margin-remove-bottom">
28
                <div *ngIf=" community != null && community.communityId != null">
29
                    <a [queryParams]="getParamId(resultType,item.id)" routerLinkActive="router-link-active" [routerLink]="'/search/'+getresultTypeLink(resultType, false)" >
30
                    {{item.title}} </a>
31
                </div>
32
                 
33
              </h6>
34
                <div *ngIf="item.accessRights" class="el-content"><span class=" uk-label  label-{{item.accessRights}}">{{item.accessRights}}</span><br></div>
35
                <div>
36
                  <span *ngIf="item.authors != null">
37
                    <span class="el-meta uk-margin uk-text-meta" *ngFor='let author of item.authors; let i = index'>
38
                      <span *ngIf="i < 10">
39
                        <span>{{author}}<span *ngIf="i < (item.authors.length-1)">;</span></span>
40
                      </span>
41
                      <span *ngIf="i == 10">...</span>
42
                    </span>
43
                  </span>
44
                  <span *ngIf="item.year !=''" class="el-meta uk-text-meta"> ({{item.year}}) </span>
45
                </div>
46
                <div class="text-justify descriptionText"> {{item.description}} </div>
47
            </div>
48
         </div>
49
        </li>
50
      </div>-->
51
        <search-result  [results]="results"
52
                        [type]="resultType"  [properties] = properties class="communityRecentResults" [showImpactFactors]="(community.communityId == 'elixir-gr')" >
53
        </search-result>
54
    </div>
55
     <div *ngIf="results != null && results.length > 0">
56
       <div class="uk-text-right">
57
         <div>
58
           <a class="el-content uk-button uk-button-text" [queryParams]="{type:getresultTypeLink(resultType, true), qf:false}" routerLinkActive="router-link-active" [routerLink]="properties.searchLinkToResults">
59
             View all {{getEntityName(resultType, true, true)}}
60
           </a>
61
         </div>
62
       </div>
63
     </div>
64

  
65
    <div *ngIf="results != null && results.length == 0 || total == 0" class=" uk-alert uk-alert-primary"> No results available </div>
66

  
67
    `
68

  
69
})
70

  
71
export class ResultsComponent {
72

  
73
    @Input() public results : SearchResult[];
74
    @Input() public resultType: string;
75
    @Input() public params: any;
76
    @Input() public community: CommunityInfo;
77
    @Input() public total: any;
78
    @Input() showLoading: boolean = true;
79
    @Input() properties: EnvProperties;
80

  
81
    getresultTypeLink(type:string, plural:boolean){
82
        if((type == "publication" || type == "dataset") && plural){
83
            return type + "s";
84
        }
85
        return type;
86
    }
87

  
88
  public getEntityName(entityType: string, plural: boolean, full: boolean): string {
89
    if (entityType == "publication") {
90
      return "publication" + (plural ? "s" : "");
91
    } else if (entityType == "dataset") {
92
      return (full ? "research data" : ("dataset" + (plural ? "s" : "")));
93
    } else if (entityType == "software") {
94
      return "software";
95
    } else if (entityType == "other") {
96
      return (full ? ("other research product" + (plural ? "s" : "")) : "other");
97
    } else if (entityType == "result") {
98
      return (full ? ("research outcome" + (plural ? "s" : "")) : "result");
99
    }
100
  }
101
 /*   getParamId(type:string){
102
        let param ="";
103
        if(type == "publication"){
104
            param="article";
105
        }else if(type == "other"){
106
            param="other";
107
        }else{
108
            param=type;
109
        }
110
       return param+"Id";
111
    }*/
112
}
modules/uoa-connect-portal/trunk/src/assets/env-properties.json
11 11
  "statisticsFrameAPIURL":"https://beta.openaire.eu/stats/",
12 12
  "statisticsFrameNewAPIURL": "https://stats.madgik.di.uoa.gr/stats-api/",
13 13
  "useNewStatistisTool":true,
14
  "impactFactorsAPIURL" :"https://bip-api.imsi.athenarc.gr/paper/scores/batch/",
14 15
  "claimsAPIURL" : "http://dl170.madgik.di.uoa.gr:8180/dnet-claims-service-2.0.0-SNAPSHOT/rest/claimsService/",
15 16
   "searchAPIURLLAst"     : "https://beta.services.openaire.eu/search/v2/api/",
16 17
  "searchResourcesAPIURL"     : "https://beta.services.openaire.eu/search/v2/api/resources",
modules/uoa-connect-portal/trunk/src/index.html
1 1
<!DOCTYPE html>
2 2
<html lang="en-gb" dir="ltr" vocab="http://schema.org/">
3 3
   <head>
4
      <!--link href="http://demo.openaire.eu" rel="canonical" /-->
5 4
      <meta charset="utf-8">
6 5
      <meta http-equiv="X-UA-Compatible" content="IE=edge">
7 6
      <meta name="viewport" content="width=device-width, initial-scale=1">
8 7
      <base href="/" />
9 8
      <meta http-equiv="content-type" content="text/html; charset=utf-8" />
10 9
      <meta name="description" content="OpenAIRE Connect, Connect,Community Dashboard, communities, open access, research, projects "/>
10
      <meta name="google-site-verification" content="rZ-58gIX8IqzBte6Qv4J5yY9aSiDP15Dfc1Yr9yezqE" />
11 11

  
12

  
13 12
      <meta property="og:description" content="OpenAIRE Connect, Connect,Community Dashboard, communities, open access, research, projects"/>
14 13
      <meta property="og:title" content="OpenAIRE - Connect "/>
15 14

  
......
41 40
      <meta name="msapplication-TileColor" content="#ffffff">
42 41
      <meta name="msapplication-TileImage" content="/ms-icon-144x144.png">
43 42
      <meta name="theme-color" content="#ffffff">
44

  
45
      <!--title>OpenAIRE Connect</title-->
43
      <script  src="assets/common-assets/common/jquery.js"></script>
44
      <script  src="assets/common-assets/common/uikit.min.js?v=1"></script>
45
      <script src="assets/common-assets/common/uikit-icons.min.js?v=1"></script>
46
      <script href="https://cdn.ckeditor.com/4.5.11/full-all/ckeditor.js"></script>
46 47
      <script>
47
      window.onerror = function (errorMsg) {
48
        if(errorMsg !=null && (errorMsg.message && errorMsg.message.indexOf("uikit.js") != -1) || (errorMsg.url &&
49
            errorMsg.url.indexOf("uikit.js") != -1 )){
50
          console.log("********UIKIT Error ***********");
48
      $(document).ready(function(){
49
        console.log("Is ready - load uikit ***")
51 50
          $.getScript("assets/common-assets/common/uikit.min.js?v=1");
52 51
          $.getScript("assets/common-assets/common/uikit-icons.min.js?v=1");
53
}
52
      });
54 53

  
55
}
56 54
      </script>
57 55

  
58
       <script  src="assets/common-assets/common/jquery.js"></script>
59
       <script  src="assets/common-assets/citeproc.js"></script>
60
        <script  src="assets/common-assets/common/uikit.min.js?v=1"></script>
61
     <script src="assets/common-assets/common/uikit-icons.min.js?v=1"></script>
62
       <script src="https://cdn.ckeditor.com/4.5.11/full-all/ckeditor.js"></script>
63
<script>
64
$(document).ready(function(){
65
  console.log("Is ready - load uikit ***")
66
    $.getScript("assets/common-assets/common/uikit.min.js?v=1");
67
    $.getScript("assets/common-assets/common/uikit-icons.min.js?v=1");
68
});
69

  
70
</script>
71

  
72 56
      <link rel="stylesheet" href="assets/common-assets/common/theme.css?v=1">
73 57
      <link rel="stylesheet" href="assets/common-assets/common/custom.css?v=1">
74 58
      <link rel="stylesheet" href="assets/common-assets/library.css?v=4">
75 59
      <link rel="stylesheet" href="assets/connect-custom.css?v=7">
76
     <link id="customCss" rel="stylesheet" href="">
77
      <script src="assets/common-assets/clipboard.min.js"></script>
60
      <link id="customCss" rel="stylesheet" href="">
61
<!--      <script src="assets/common-assets/clipboard.min.js"></script>-->
78 62

  
79 63

  
80 64
 </head>
......
116 100
  }
117 101

  
118 102
</script>
119
<!-- Go to www.addthis.com/dashboard to customize your tools -->
120
<!-- to update addThis: https://s7.addthis.com/js/300/addthis_widget.js#pubid=ra-559d24521cd8c080-->
121
<!--<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-559d24521cd8c080"></script>-->
122 103
   </body>
123 104
</html>
modules/uoa-connect-portal/trunk/server.ts
66 66
app.set('views', join(DIST_FOLDER, 'browser'));
67 67
// Allow frames from specific domains
68 68
app.use(function (req, res, next) {
69
  var XFRAME_WHITELIST = [ 'http://scoobydoo.di.uoa.gr/frames.html', 'http://scoobydoo.di.uoa.gr:5000/customize-layout', 'https://beta.admin.connect.openaire.eu/customize-layout','https://admin.connect.openaire.eu/customize-layout'  ];
69
  var XFRAME_WHITELIST = [ 'http://scoobydoo.di.uoa.gr:5000/customize-layout', 'https://beta.admin.connect.openaire.eu/customize-layout','https://admin.connect.openaire.eu/customize-layout'  ];
70 70
  let referer:string;
71 71
  if(req.headers.referer){
72 72
    referer = isArray(req.headers.referer)?req.headers.referer[0]:req.headers.referer;
73 73
    referer = referer.split("?")[0];
74 74
  }
75
  if (  referer &&  XFRAME_WHITELIST.indexOf(referer) != -1 ) {
75
  if (  referer &&  (XFRAME_WHITELIST.indexOf(referer) != -1  || referer.indexOf(".d4science.org") != -1)) {
76 76
    // res.header('X-FRAME-OPTIONS', 'allow from ' +req.headers.referer);
77 77
  }else {
78 78
    res.header('X-FRAME-OPTIONS', 'SAMEORIGIN');

Also available in: Unified diff