Project

General

Profile

« Previous | Next » 

Revision 58552

[Library|Trunk]

Search:

-Entities Selection: add check if route is enabled
-Delay in result types checkboxes to 2 s
-Use breadcrumb component
-add connect background
-remove space between names in showAuthors component
-Filters:
-message about top 100 always visible
-rename to view all
-change css for search input
-show 100 if results > 95
-view less under the 2nd list
-Search bar:
-select contains all avaliable entities not only search results
-

Landing pages:

-correct issue with pmid in landing
-correct issue with date in cite this
-Hide Addthis:
value in properties

View differences:

modules/uoa-services-library/trunk/ng-openaire-library/src/app/searchPages/searchUtils/entitiesSelection.component.ts
101 101
    if (this.properties) {
102 102
      // console.log(this.customFilter)
103 103
      this.config.getCommunityInformation(this.properties, (this.customFilter && this.customFilter.queryFieldName == "communityId") ? this.customFilter.valueId : this.properties.adminToolsCommunity).subscribe(data => {
104
        var showEntity = {};
105
        for (var i = 0; i < data['entities'].length; i++) {
104
        let showEntity = {};
105
        let showPage = {};
106
        for (let i = 0; i < data['entities'].length; i++) {
106 107

  
107 108
          showEntity["" + data['entities'][i]["pid"] + ""] = data['entities'][i]["isEnabled"];
108 109
        }
109
        this.showResearchOutcomes = showEntity["publication"] || showEntity["dataset"] || showEntity["software"] || showEntity["orp"];
110
        this.showPublications = showEntity["publication"];
111
        this.showDatasets = showEntity["dataset"];
112
        this.showSoftware = showEntity["software"];
113
        this.showOther = showEntity["orp"];
114
        this.showProjects = showEntity["project"];
115
        this.showOrganizations = showEntity["organization"];
116
        this.showDataProviders = showEntity["datasource"];
110
        for (let i = 0; i < data['pages'].length; i++) {
111
          showPage["" + data['pages'][i]["route"] + ""] = data['pages'][i]["isEnabled"];
112
        }
113
        this.showResearchOutcomes = showPage[this.properties.searchLinkToResults] && (showEntity["publication"] || showEntity["dataset"] || showEntity["software"] || showEntity["orp"]);
114
        this.showPublications =  showPage[this.properties.searchLinkToResults] && showEntity["publication"];
115
        this.showDatasets =  showPage[this.properties.searchLinkToResults] && showEntity["dataset"];
116
        this.showSoftware =  showPage[this.properties.searchLinkToResults] && showEntity["software"];
117
        this.showOther =  showPage[this.properties.searchLinkToResults] && showEntity["orp"];
118
        this.showProjects = showPage[this.properties.searchLinkToProjects] && showEntity["project"];
119
        this.showOrganizations = showPage[this.properties.searchLinkToOrganizations] && showEntity["organization"];
120
        this.showDataProviders = showPage[this.properties.searchLinkToDataProviders] && showEntity["datasource"];
117 121

  
118 122
        if (this.customFilter && this.customFilter.queryFieldName == "communityId") {
119 123
          this.showOrganizations = false;
modules/uoa-services-library/trunk/ng-openaire-library/src/app/searchPages/searchUtils/searchPageTableView.component.html
55 55
  </div>
56 56
</ng-template>
57 57

  
58
<div class="image-front-topbar  uk-section-default uk-position-relative" uk-scrollspy="{&quot;target&quot;:&quot;[uk-scrollspy-class]&quot;,&quot;cls&quot;:&quot;uk-animation-fade&quot;,&quot;delay&quot;:false}" tm-header-transparent="light">
58
<div *ngIf="!includeOnlyResultsAndFilter" class="image-front-topbar  uk-section-default uk-position-relative"
59
     uk-scrollspy="{&quot;target&quot;:&quot;[uk-scrollspy-class]&quot;,&quot;cls&quot;:&quot;uk-animation-fade&quot;,&quot;delay&quot;:false}" tm-header-transparent="light">
59 60
  <div style=" min-height: 350px;"  [class]="' uk-background-norepeat uk-background-cover uk-background-bottom-center uk-section uk-padding-remove-bottom uk-flex uk-flex-middle uk-background-fixed '+searchFormClass">
60 61
    <div class="uk-position-cover" style="/*background-color: rgba(255, 255, 255, 0.37);*/"></div>
61 62
    <div class="uk-container">
......
106 107
</div>
107 108
<schema2jsonld   *ngIf="url"  [URL]="url" type="search" [name]=pageTitle [searchAction]=false></schema2jsonld>
108 109

  
109
<div id="tm-main" class=" uk-section uk-padding-remove-top tm-middle"   >
110
<div id="tm-main" class=" uk-section uk-padding-remove-top tm-middle communityBackground"   >
110 111
  <div uk-grid>
111 112
    <div class="tm-main uk-width-1-1@s uk-width-1-1@m  uk-width-1-1@l uk-row-first ">
112

  
113
      <breadcrumbs *ngIf="showBreadcrumb" addClass="uk-margin-large-left uk-margin-remove-bottom uk-margin-small-top" [breadcrumbs]="breadcrumbs"></breadcrumbs>
113 114
      <div  class="uk-container  uk-container-large">
114 115
        <helper *ngIf="pageContents && pageContents['top'] && pageContents['top'].length > 0" [texts]="pageContents['top']"></helper>
115 116
        <div  class="uk-width-2-3@m  uk-width-2-3@l  uk-width-1-1@s">
......
141 142
        </div>
142 143

  
143 144
        <div  class="uk-grid uk-width-1-1 uk-margin-top">
144
          <div *ngIf="filters.length > 0" class="uk-width-1-4@m search-filters uk-visible@m ">
145
          <div *ngIf="filters.length > 0" class="uk-width-1-5@m search-filters uk-visible@m ">
145 146
            <ng-container *ngTemplateOutlet="filters_column; context: {}" class=""></ng-container>
146 147
          </div>
147 148

  
148 149
          <div class="uk-width-expand@m uk-width-1-1@s uk-first-column custom-dataTable-content" >
149
            <div *ngIf="openaireLink"> <a class="    uk-button uk-button-text"  [href]=openaireLink target="_blank"
150
            >Results in OpenAIRE</a></div>
150
            <div *ngIf="openaireLink && (searchUtils.totalResults > 0 || !disableForms )">
151
              <a class="uk-button uk-button-text" [href]=openaireLink target="_blank">Results in OpenAIRE</a>
152
            </div>
151 153
            <div *ngIf="searchUtils.totalResults > 0" class="uk-align-center uk-margin-remove-bottom ">
152 154
              <div class="uk-grid">
153 155
                <div class="uk-width-expand@m uk-grid uk-grid-medium uk-margin-small-bottom">
modules/uoa-services-library/trunk/ng-openaire-library/src/app/searchPages/searchUtils/searchFilter.component.html
56 56
          <a
57 57
             [class]="((isDisabled)?'uk-disabled uk-link-muted ':' portal-link ') + ' uk-margin-small-top'"
58 58
             [attr.uk-toggle]="'target: #toggle-'+filter.filterId" (click)="toggle()">
59
            <span *ngIf="!isOpen">+ View more</span>
60
            <span *ngIf="isOpen">- View less</span>
59
            <span *ngIf="!isOpen">+ View all</span>
60
<!--            <span *ngIf="isOpen">- View less</span>-->
61 61
          </a>
62 62

  
63 63
          <div hidden [id]="'toggle-'+filter.filterId" class="uk-text-small uk-margin-small-bottom">
64 64
            <div class="">
65
              <span *ngIf="filter.values.length >= 99">* only the Top 100 values are shown</span>
66
              <input   class="uk-input uk-margin-small-bottom uk-width-1-1  " name="filter-keyword"  placeholder="Search for {{filter.title}}" type="text" [(ngModel)]="keyword">
65
              <span class="uk-text-meta  uk-margin-small-left">Top 100 values are
66
                shown in the filters</span>
67
              <div class="uk-grid uk-margin-small-left uk-flex uk-flex-bottom">
68
              <input   class="uk-input uk-margin-small-top uk-form-small uk-width-2-3@m uk-width-3-5@s text-input-box "
69
                       name="filter-keyword"
70
                       placeholder="Search..." type="text" [(ngModel)]="keyword">
67 71

  
68
              <span *ngIf = "showResultCount === true" class="uk-flex-inline uk-flex-middle uk-width-5-6@m uk-width-1-1@s uk-align-right uk-margin-small-bottom">
72
              <span *ngIf = "showResultCount === true"
73
                    class="uk-width-1-3@m uk-width-2-5@s uk-padding-small uk-padding-remove-vertical uk-padding-remove-right">
69 74
                <span class="uk-width-1-4 uk-text-muted"> Sort by:</span>
70 75
                <select [(ngModel)]="sortBy"
71
                        class=" uk-width-expand uk-select uk-hidden@m"
76
                        class=" uk-width-expand uk-select uk-hidden@m uk-form-small"
72 77
                        id="form-horizontal-select" name="select_order">
73 78
                  <option  value="num">Results number</option>
74 79
                  <option  value="name">Name</option>
......
82 87
                </mat-select>
83 88
              </span>
84 89
            </div>
90
          </div>
85 91

  
86 92
            <div   class="uk-modal-body uk-overflow-auto uk-height-max-small uk-padding-remove
87 93
                      uk-margin-small-left uk-margin-small-right uk-margin-small-top uk-width-1-1">
......
129 135
              </ng-container>
130 136
            </div>
131 137
          </div>
132
<!--          <a [class]="(isDisabled)?'uk-disabled uk-link-muted ':' portal-link '"-->
133
<!--             [attr.uk-toggle]="'target: #toggle-'+filter.filterId" (click)="toggle()">-->
134
<!--            <span *ngIf="isOpen">- View less</span>-->
135
<!--          </a>-->
138
          <a [class]="(isDisabled)?'uk-disabled uk-link-muted ':' portal-link '"
139
             [attr.uk-toggle]="'target: #toggle-'+filter.filterId" (click)="toggle()">
140
            <span *ngIf="isOpen">- View less</span>
141
          </a>
136 142
        </div>
137 143
   </div>
138 144
  </div>
modules/uoa-services-library/trunk/ng-openaire-library/src/app/searchPages/searchUtils/newSearchPage.component.html
107 107

  
108 108

  
109 109

  
110
<div id="tm-main" class="   tm-middle">
110
<div id="tm-main" class="   tm-middle communityBackground">
111 111
  <div uk-grid>
112 112
    <div class="tm-main uk-width-1-1@s uk-width-1-1@m  uk-width-1-1@l uk-row-first ">
113
      <!--          TODO add breadcrumb here-->
114
      <div  *ngIf="showBreadcrumb" class=" uk-margin-large-left">Home > Search</div>
113
      <breadcrumbs *ngIf="showBreadcrumb" addClass="uk-margin-large-left uk-margin-remove-bottom uk-margin-small-top" [breadcrumbs]="breadcrumbs"></breadcrumbs>
115 114
      <div class="uk-container uk-container-large">
116 115
        <div>
117 116

  
......
359 358

  
360 359
            </div>
361 360
            <div class="uk-width-expand@m uk-with-1-1@s">
362
              <div *ngIf="openaireLink"> <a class="uk-margin-top   uk-button uk-button-text"
361
              <div *ngIf="openaireLink && (searchUtils.totalResults > 0 || !loadPaging )"> <a
362
                class="uk-margin-top   uk-button uk-button-text"
363 363
                                            [href]="openaireLink+this.routerHelper.createQueryParamsString(this.parameterNames, this.parameterValues)"
364 364
              target="_blank" >Results in OpenAIRE</a></div>
365 365
              <div  class="uk-align-center uk-margin-remove-bottom">
modules/uoa-services-library/trunk/ng-openaire-library/src/app/searchPages/searchUtils/newSearchPage.module.ts
25 25
import {SearchResultsInDepositModule} from "../../deposit/searchResultsInDeposit.module";
26 26
import {AdvancedSearchFormModule} from "./advancedSearchForm.module";
27 27
import {QuickSelectionsModule} from "./quick-selections.module";
28
import {BreadcrumbsModule} from "../../utils/breadcrumbs/breadcrumbs.module";
28 29

  
29 30
@NgModule({
30 31
  imports: [
......
33 34
    SearchPagingModule, SearchResultsPerPageModule, SearchSortingModule, SearchDownloadModule, ModalModule,
34 35
    SearchFilterModule, RangeFilterModule,
35 36
    PiwikServiceModule, HelperModule, Schema2jsonldModule, SEOServiceModule, SearchResultsModule,
36
    SearchResultsInDepositModule, AdvancedSearchFormModule, QuickSelectionsModule
37
    SearchResultsInDepositModule, AdvancedSearchFormModule, QuickSelectionsModule, BreadcrumbsModule
37 38
  ],
38 39
  declarations: [
39 40
    NewSearchPageComponent
modules/uoa-services-library/trunk/ng-openaire-library/src/app/searchPages/searchUtils/searchPageTableView.component.ts
18 18
import {PiwikService}                     from '../../utils/piwik/piwik.service';
19 19
import { SEOService } from '../../sharedComponents/SEO/SEO.service';
20 20
import {HelperService} from "../../utils/helper/helper.service";
21
import {Breadcrumb} from "../../utils/breadcrumbs/breadcrumbs.component";
21 22

  
22 23
@Component({
23 24
    selector: 'search-page-table',
......
77 78
  public pageContents = null;
78 79
  @Input() customFilter: SearchCustomFilter = null;
79 80
  @Input() enableEntitySelection: boolean = false;
81
  @Input() includeOnlyResultsAndFilter:boolean = false;
82
  @Input() showBreadcrumb:boolean = false;
83
  breadcrumbs:Breadcrumb[] = [];
84

  
80 85
  constructor (private route: ActivatedRoute,
81 86
               private router: Router,
82 87
               private location: Location,
......
110 115
        var description = "Openaire, search, repositories, open access, type, content provider, funder, project, " + this.type + "," +this.pageTitle;
111 116
        this.updateDescription(description);
112 117
        this.seoService.createLinkForCanonicalURL(this.properties.baseLink+this.router.url,false);
118
        this.breadcrumbs.push({name: 'home', route: '/'}, {name: this.pageTitle, route: this.router.url});
113 119

  
114 120

  
115 121
   }
modules/uoa-services-library/trunk/ng-openaire-library/src/app/searchPages/searchUtils/searchFilter.component.ts
32 32
    ngOnInit() {}
33 33

  
34 34
    public _formatTitle(title,length){
35
      return (((title+" ("+length+")").length >this._maxCharacters)?(title.substring(0,(this._maxCharacters - (" ("+length+")").length - ('...').length))+"..."):title+" ("+length+")")
35
      return (((title+" ("+length+")").length >this._maxCharacters)?(title.substring(0,(this._maxCharacters - (" ("+length+")").length - ('...').length))+"..."):title+" ("+(length>95?"100":length)+")")
36 36
    }
37 37
    public _formatName(value){
38 38
      //let maxLineLength = 24;
modules/uoa-services-library/trunk/ng-openaire-library/src/app/searchPages/searchUtils/newSearchPage.component.ts
18 18
import {RefineResultsUtils} from "../../services/servicesUtils/refineResults.class";
19 19
import {RangeFilter} from "../../utils/rangeFilter/rangeFilterHelperClasses.class";
20 20
import {ZenodoInformationClass} from "../../deposit/utils/zenodoInformation.class";
21
import {Breadcrumb} from "../../utils/breadcrumbs/breadcrumbs.component";
21 22

  
22 23
declare var UIkit: any;
23 24

  
......
92 93
  public divContents = null;
93 94
  public routerHelper: RouterHelper = new RouterHelper();
94 95
  public errorCodes: ErrorCodes = new ErrorCodes();
95

  
96
  breadcrumbs:Breadcrumb[] = [];
96 97
  url = null;
97 98

  
98 99
  @Input() entitiesSelection:boolean = true;
......
133 134

  
134 135
    this.searchUtils.baseUrl = "/" + this.searchUtils.baseUrl;
135 136
    this.seoService.createLinkForCanonicalURL(this.properties.baseLink + this.router.url, false);
137
    this.breadcrumbs.push({name: 'home', route: '/'});
138
    if(this.simpleView) {
139
      this.breadcrumbs.push( {name: "Search", route: this.simpleSearchLink});
140
    }else if(!this.simpleView && this.advancedSearchLink) {
141
      this.breadcrumbs.push({name: "Advanced Search", route: this.advancedSearchLink});
142
    }
136 143

  
137 144

  
138 145
  }
modules/uoa-services-library/trunk/ng-openaire-library/src/app/searchPages/searchUtils/quick-selections.component.ts
123 123
      });
124 124
    }
125 125
    this.resultTypesObs  = this.clicks.pipe(
126
      debounceTime(1000)
126
      debounceTime(2000)
127 127
    ).subscribe(e =>{this.actuallyChanged()} );
128 128

  
129 129
  }
modules/uoa-services-library/trunk/ng-openaire-library/src/app/searchPages/searchUtils/searchPageTableView.module.ts
26 26
import { SearchDataproviderMapModule } from './searchDataproviderMap.module';
27 27
import {AdvancedSearchFormModule} from "./advancedSearchForm.module";
28 28
import {EntitiesSelectionModule} from "./entitiesSelection.module";
29
import {BreadcrumbsModule} from "../../utils/breadcrumbs/breadcrumbs.module";
29 30

  
30 31

  
31 32
@NgModule({
......
33 34
    CommonModule, FormsModule, RouterModule, SearchFormModule, SearchResultsModule, LoadingModalModule,
34 35
    ReportsServiceModule, SearchPagingModule, SearchDownloadModule, ModalModule, PagingModule,
35 36
    DataTablesModule, SearchFilterModule, PiwikServiceModule, HelperModule, ErrorMessagesModule,
36
    Schema2jsonldModule, SEOServiceModule, SearchResultsPerPageModule, SearchDataproviderMapModule, AdvancedSearchFormModule, EntitiesSelectionModule
37
    Schema2jsonldModule, SEOServiceModule, SearchResultsPerPageModule, SearchDataproviderMapModule, AdvancedSearchFormModule, EntitiesSelectionModule, BreadcrumbsModule
37 38
  ],
38 39
  declarations: [
39 40
    SearchPageTableViewComponent
modules/uoa-services-library/trunk/ng-openaire-library/src/app/connect/connectHelper.ts
3 3
export class ConnectHelper {
4 4

  
5 5
  public static  getCommunityFromDomain(domain: string): string{
6
    // domain = "beta.egi.openaire.eu"; //for testing
6
    domain = "beta.ee.openaire.eu"; //for testing
7 7
    if (domain.indexOf('openaire.eu') === -1) {
8 8
      return null;
9 9
    }
modules/uoa-services-library/trunk/ng-openaire-library/src/app/landingPages/landing-utils/parsingFunctions.class.ts
454 454
    let identifiers = new Map<string, string[]>();
455 455
    
456 456
    if (pid.hasOwnProperty("classname") && pid['classname'] != "") {
457
      if (pid.classname == "doi" || pid.classname == "pmc" || pid.classname == "handle" || pid == "pmid") {
457
      if (pid.classname == "doi" || pid.classname == "pmc" || pid.classname == "handle" || pid.classname == "pmid") {
458 458
        if (!identifiers.has(pid.classname)) {
459 459
          identifiers.set(pid.classname, new Array<string>());
460 460
        }
......
463 463
      }
464 464
    } else {
465 465
      for (let i = 0; i < pid.length; i++) {
466
        if (pid[i].classname == "doi" || pid[i].classname == "pmc" || pid[i].classname == "handle" || pid == "pmid") {
466
        if (pid[i].classname == "doi" || pid[i].classname == "pmc" || pid[i].classname == "handle" || pid[i].classname == "pmid") {
467 467
          if (!identifiers.has(pid[i].classname)) {
468 468
            identifiers.set(pid[i].classname, new Array<string>());
469 469
          }
modules/uoa-services-library/trunk/ng-openaire-library/src/app/landingPages/landing-utils/citeThis/citeThis.component.ts
84 84
        }
85 85
        if(this.result.dateofacceptance  != undefined){
86 86
          citationData.issued = {};
87
          var date:string = (this.result.dateofacceptance)+""; // transform to string in case it is an integer
87
          var date:string = (this.result.dateofacceptance.getFullYear())+""; // transform to string in case it is an integer
88 88
          var dateArray:string[]  = (date && (date).indexOf('-') !== -1)?[date.split('-')[0]]:[date];
89 89
          if(dateArray.length < 3){
90 90
            // dateArray.push[1];
modules/uoa-services-library/trunk/ng-openaire-library/src/app/landingPages/result/resultLanding.component.html
498 498
                </div>
499 499
              </div>
500 500
              <!-- Share -->
501
              <div [class.uk-hidden]="!addThis" class="uk-margin-top">
501
              <div *ngIf="properties.showAddThis" [class.uk-hidden]="!addThis" class="uk-margin-top">
502 502
                <div class="sideInfoTitle uk-margin-small-bottom">Share - Bookmark</div>
503 503
                <addThis (event)="hideAddThis($event)"></addThis>
504 504
              </div>
modules/uoa-services-library/trunk/ng-openaire-library/src/app/utils/authors/showAuthors.component.ts
14 14
      <span *ngFor="let author of authors.slice(0,numberOfAuthors) let i=index">
15 15
          <span *ngIf="!author.orcid || (properties.environment == 'production') || !testBrowser"
16 16
                [class.uk-text-small]="small">
17
            {{author.fullName}}
17
            {{author.fullName + "; "}}
18 18
          </span>
19 19
          <a *ngIf="author.orcid && (properties.environment != 'production') && testBrowser">
20 20
            <img src="assets/common-assets/common/ORCIDiD_icon16x16.png" alt="">{{" "}}
21 21
            <span [class.uk-text-small]="small">
22
              {{author.fullName}}
22
              {{author.fullName + "; "}}
23 23
            </span>
24 24
          </a>
25 25
        <div *ngIf="author.orcid && (properties.environment != 'production')"
......
57 57
              </a>
58 58
            </div>
59 59
        </div>
60
        <span>;{{" "}}</span>
61 60
        </span>
62 61
      <span *ngIf="numberOfAuthors == authorsLimit && authors.length > authorsLimit">	... </span>
63 62
    </div>
modules/uoa-services-library/trunk/ng-openaire-library/src/app/utils/breadcrumbs/breadcrumbs.component.ts
8 8
@Component({
9 9
  selector: 'breadcrumbs',
10 10
  template: `
11
    <ul class="uk-breadcrumb" [class.uk-light]="light">
11
    <ul [class]="'uk-breadcrumb '+addClass" [class.uk-light]="light">
12 12
      <li *ngFor="let breadcrumb of breadcrumbs">
13 13
        <a class="uk-text-capitalize" *ngIf="breadcrumb.route" [routerLink]="breadcrumb.route">{{breadcrumb.name}}</a>
14 14
        <span class="uk-text-capitalize" *ngIf="!breadcrumb.route">{{breadcrumb.name}}</span>
......
19 19

  
20 20
  @Input() public light: boolean = false;
21 21
  @Input() public breadcrumbs: Breadcrumb[] = [];
22
}
22
  @Input() public addClass;
23
}
modules/uoa-services-library/trunk/ng-openaire-library/src/app/utils/properties/env-properties.ts
4 4
  domain: string;
5 5
  enablePiwikTrack: boolean;
6 6
  useCache: boolean;
7
  showAddThis: boolean;
7 8
  showContent: boolean;
8 9

  
9 10
  metricsAPIURL;
modules/uoa-services-library/trunk/ng-openaire-library/src/app/utils/result-preview/result-preview.component.html
6 6
    <span class="uk-width-expand uk-flex-right">
7 7
        <a *ngIf="result.websiteURL && promoteWebsiteURL" href="{{result.websiteURL}}" target="_blank" type="submit"
8 8
           class="uk-float-right uk-button portal-button uk-padding uk-padding-remove-vertical uk-margin-small-left">
9
          <span><span>Go to website</span><span uk-icon="arrow-right"></span></span>
9
          <span><span>Visit repository to deposit</span><span uk-icon="arrow-right"></span></span>
10 10
        </a>
11 11
    </span>
12 12
    <div class="uk-text-small">
......
267 267
</div>
268 268
<!-- Description -->
269 269
<div *ngIf="result.description" class="uk-margin-small-bottom multi-line-ellipsis lines-3">
270
  <p class="uk-text-small">
270
  <p class="uk-text-small uk-text-muted">
271 271
    {{result.description}}
272 272
  </p>
273 273
</div>
modules/uoa-services-library/trunk/ng-openaire-library/src/app/deposit/depositFirstPage.component.ts
69 69
                <div></div>
70 70
              </div>
71 71
              <div class="uk-width-1-2@m uk-width-1-1@s">
72
                <p class="uk-margin-auto-top uk-margin-remove-bottom uk-h5">
72
                <!--<p class="uk-margin-auto-top uk-margin-remove-bottom uk-h5">
73 73
                  Start by <span class="uk-text-bold">searching</span> repositories and journals
74
                </p>
75
                <div class="uk-margin">
76
                  <form class="uk-search uk-search-default uk-width-xlarge@l uk-width-medium@m uk-width-auto">
74
                </p>-->
75
                <div class="uk-padding uk-padding-remove-vertical">
76
                  <form class=" uk-grid uk-margin">
77 77
<!--                    <span uk-search-icon class="uk-icon"></span>-->
78
                    <button routerLinkActive="uk-link"
79
                       routerLink="{{depositRoute}}" [queryParams]="{keyword: keyword}"  class="uk-search-icon uk-icon" uk-search-icon>
80
                    </button>
81
                    <input class="uk-search-input uk-input" 
78
<!--                    <button routerLinkActive="uk-link"-->
79
<!--                       routerLink="{{depositRoute}}" [queryParams]="{keyword: keyword}"  class="uk-search-icon uk-icon" uk-search-icon>-->
80
<!--                    </button>-->
81
                    <input class="uk-search-input uk-input uk-width-expand uk-margin-small-right" 
82 82
                           type="search"  [(ngModel)]="keyword"  name="keyword"
83 83
                           placeholder="{{searchPlaceHolder}}">
84
                    <div class="uk-padding-remove-left">
85
                      <button routerLinkActive="uk-link" routerLink="{{depositRoute}}" [queryParams]="{keyword: keyword}" class="uk-button"> Search
86
                      </button>
87
                      <div class="uk-padding-small">
88
                        <a  [queryParams]="properties.environment!='development'?{}:routerHelper.createQueryParam('communityId',communityId)" routerLinkActive="router-link-active" [routerLink]="depositRoute"
89
                            type="submit" class=" ">
90
                          <span><span>Browse all </span><!--<span uk-icon="arrow-right"></span>--></span>
91
                        </a>
92
                      </div>
93
                    </div>
84 94
                  </form>
85 95
                </div>
86 96
                <div class="uk-width-1-6 uk-text-right">
......
100 110
                </div>
101 111
                  
102 112
                <div>
103
                  <a  [queryParams]="properties.environment!='development'?{}:routerHelper.createQueryParam('communityId',communityId)" routerLinkActive="router-link-active" [routerLink]="depositRoute" 
113
                  <!--<a  [queryParams]="properties.environment!='development'?{}:routerHelper.createQueryParam('communityId',communityId)" routerLinkActive="router-link-active" [routerLink]="depositRoute" 
104 114
                      type="submit" class="uk-button uk-button-large portal-button uk-padding uk-padding-remove-vertical">
105 115
                    <span><span>Browse all </span><span uk-icon="arrow-right"></span></span>
116
                  </a>-->
117
                  <a *ngIf="zenodoInformation.shareInZenodoUrl" type="submit"
118
                     [queryParams]="properties.environment!='development'?{}:routerHelper.createQueryParam('communityId',communityId)"
119
                     routerLinkActive="router-link-active" [routerLink]="zenodoInformation.shareInZenodoUrl"
120
                     class="uk-button portal-button uk-padding uk-padding-remove-vertical uk-margin-medium-top uk-margin-bottom">
121
                    <span><span> Use related zenodo communities</span><span uk-icon="arrow-right"></span></span>
106 122
                  </a>
123
                  <a *ngIf="!zenodoInformation.shareInZenodoUrl" target="_blank" href="{{zenodoInformation.url}}" type="submit"
124
                     [class]="'uk-button uk-padding uk-padding-remove-vertical uk-margin-medium-top uk-margin-bottom' +
125
                        ((communityId && communityId != 'openaire') ? ' portal-button' : ' uk-button-primary')">
126
                    <span><span>Deposit in Zenodo</span><span uk-icon="arrow-right"></span></span>
127
                  </a>
107 128
                </div>
108 129
              </div>
109 130
            </div>
modules/uoa-services-library/trunk/ng-openaire-library/src/app/sharedComponents/navigationBar.component.html
29 29
       <div   *ngIf="enableSearch && isEnabled([searchRoute], showPage)"
30 30
              class=" uk-width-large ">
31 31
         <search-bar  [searchPlaceHolder]="searchPlaceHolder"
32
                      [searchRoute]="searchRoute" [properties]="properties"></search-bar>
32
                      [searchRoute]="searchRoute" [properties]="properties" [communityId]="communityId"></search-bar>
33 33
       </div>
34 34
     </div>
35 35
      <div class="uk-navbar-center">
......
152 152
              <div   *ngIf="enableSearch && isEnabled([searchRoute], showPage)"
153 153
                     class="  uk-margin-left uk-width-xlarge ">
154 154
                  <search-bar  [searchPlaceHolder]="searchPlaceHolder"
155
                              [searchRoute]="searchRoute" [properties]="properties"></search-bar>
155
                              [searchRoute]="searchRoute" [properties]="properties" [communityId]="communityId"></search-bar>
156 156
              </div>
157 157
            </div>
158 158
            <div class="uk-navbar-left  uk-visible@m uk-hidden@l ">
......
172 172
              <div   *ngIf="enableSearch && isEnabled([searchRoute], showPage)"
173 173
                     class="uk-width-large  ">
174 174
                <search-bar  [searchPlaceHolder]="searchPlaceHolder"
175
                             [searchRoute]="searchRoute" [properties]="properties"></search-bar>
175
                             [searchRoute]="searchRoute" [properties]="properties" [communityId]="communityId" ></search-bar>
176 176
              </div>
177 177
            </div>
178 178

  
modules/uoa-services-library/trunk/ng-openaire-library/src/app/sharedComponents/searchBar/searchBar.component.ts
6 6
@Component({
7 7
  selector: 'search-bar',
8 8
  templateUrl: 'searchBar.component.html',
9
  styles:[`
10
  .mat-select-panel-wrap {
11
      z-index: 2001
12
  }
13
  `]
14 9

  
15 10
})
16 11
export class SearchBarComponent {
......
22 17
  keyword: string = "";
23 18
  entityType = "all";
24 19
  enableSearchbar:boolean = true;
25
  @Input() customFilter: SearchCustomFilter   = null;
20
  customFilter: SearchCustomFilter   = null;
21
  @Input() communityId;
22
  @Input() onlyresults:boolean=false;
26 23
  parameters = {};
24
  advancedSearchLink = null;
27 25
  constructor(private router: Router,
28 26
              private  route: ActivatedRoute ) {
29 27
  }
......
31 29
  ngOnInit() {
32 30

  
33 31
    // this.activeRouteEnabled = false;
32
    if(this.communityId){
33
      this.customFilter = new SearchCustomFilter("Community", "communityId", this.communityId, "");
34
    }
34 35
    this.route.queryParams.subscribe(params => {
35 36
      this.parameters = Object.assign({}, params);
36 37
      this.entityType = "all";
37
      if (params["type"] && params["type"].length > 0) {
38
        let types= params["type"].split(",");
39
        if(types.length == 1){
40
          if(types.indexOf("publications")!=-1 ){
38
      if(this.onlyresults) {
39
        if (params["type"] && params["type"].length > 0) {
40
          let types = params["type"].split(",");
41
          if (types.length == 1) {
42
            if (types.indexOf("publications") != -1) {
41 43
              this.entityType = "publications";
42
          }else if(types.indexOf("datasets")!=-1 ){
43
            this.entityType = "datasets";
44
          }else if(types.indexOf("software")!=-1 ){
45
            this.entityType = "software";
46
          }else if(types.indexOf("other")!=-1 ){
47
            this.entityType = "other";
44
            } else if (types.indexOf("datasets") != -1) {
45
              this.entityType = "datasets";
46
            } else if (types.indexOf("software") != -1) {
47
              this.entityType = "software";
48
            } else if (types.indexOf("other") != -1) {
49
              this.entityType = "other";
50
            }
48 51
          }
49 52
        }
53
      }else{
54
        let currentRoute= this.getCurrentRoute();
55
        if(currentRoute== this.properties.searchLinkToProjects){
56
          this.entityType = "project";
57
        }else if(currentRoute== this.properties.searchLinkToDataProviders){
58
          this.entityType = "dataprovider";
59
        }else if(currentRoute== this.properties.searchLinkToOrganizations){
60
          this.entityType = "organization";
61
        }else{
62
          this.entityType = "result";
63
        }
50 64
      }
51
      if(this.getCurrentRoute() == "/search/advanced/research-outcomes" ){
65
      if(this.getCurrentRoute() == this.properties.searchLinkToAdvancedResults){
52 66
        this.enableSearchbar =  false;
53 67
      }else{
54 68
        this.enableSearchbar = true;
55 69
      }
56
      // this.initialize();
70
      if(this.entityType == "result"){
71
        this.advancedSearchLink = this.properties.searchLinkToAdvancedResults;
72
      }else{
73
        this.advancedSearchLink = null;
74
      }
57 75
    });
58 76

  
59 77
  }
60 78

  
61
/*
62
  ngOnDestroy() {
63
    this.sub.unsubscribe();
64
  }
65

  
66
  initialize() {
67
    this.activeRouteEnabled = false;
68
    this.isAuthorized = Session.isClaimsCurator(this.user) || Session.isPortalAdministrator(this.user);
69
    /!*if (this.properties.adminToolsAPIURL && this.communityId) {
70
      this.config.getCommunityInformation(this.properties, this.communityId).subscribe(data => {
71
          for (var i = 0; i < data['entities'].length; i++) {
72

  
73
            this.showEntity["" + data['entities'][i]["pid"] + ""] = data['entities'][i]["isEnabled"];
74
          }
75
          for (var i = 0; i < data['pages'].length; i++) {
76
            this.showPage[data['pages'][i]["route"]] = data['pages'][i]["isEnabled"];
77

  
78
          }
79

  
80
        },
81
        error => {
82
          this.handleError("Error getting community information (e.g. pages,entities) for community with id: " + this.communityId, error);
83
        });
84
    }*!/
85

  
86
  }*/
87

  
88 79
  isEnabled(required, enabled) {
89 80
    if (!required) {
90 81
      return true;
......
96 87
    }
97 88
    return true;
98 89
  }
99

  
100

  
101

  
102
  private handleError(message: string, error) {
103
    console.error("NavigationBar (component): " + message, error);
104
  }
105

  
106 90
  getCurrentRoute() {
107 91
    return this.router.url.split('?')[0];
108 92
  }
109 93
  entityChanged($event){
110 94
    this.entityType = $event.entity;
111 95
    this.searchRoute = $event.simpleUrl;
112

  
113
    // this.selectedEntityAdvancedUrl = $event.advancedUrl;
114
// check if it is search  or not
115
    //no search page
116

  
96
    if(!this.onlyresults && this.entityType == "result") {
97
      this.parameters["qf"] = true;
98
    }
99
    if(this.entityType == "result"){
100
      this.advancedSearchLink = this.properties.searchLinkToAdvancedResults;
101
    }else{
102
      this.advancedSearchLink = null;
103
    }
117 104
  }
118 105
  keywordChanged(){
119
    // this.parameters = {};
106
    if(!this.onlyresults) {
107
      this.parameters = {};
108
    }
120 109
    if ( this.keyword.length > 0) {
121 110
      this.parameters["fv0"] = this.keyword;
122 111
      this.parameters["f0"] = "q";
......
124 113
      delete this.parameters['fv0'];
125 114
      delete this.parameters['f0'];
126 115
    }
127
    if(this.entityType != "all"){
116
    if(this.onlyresults && this.entityType != "all"){
128 117
      this.parameters["type"] = this.entityType;
129 118
    }else{
130 119
      delete this.parameters['type'];
......
133 122
    if(!this.parameters["qf"]) {
134 123
      this.parameters["qf"] = true;
135 124
    }
136
    console.log(this.parameters);
137 125
    this.router.navigate([this.searchRoute], {queryParams: this.parameters} );
138 126
  }
139 127
}
modules/uoa-services-library/trunk/ng-openaire-library/src/app/sharedComponents/searchBar/searchBar.component.html
8 8
                        [properties]="properties"
9 9
                        (selectionChange)=" entityChanged($event)"
10 10
                        [customFilter]="customFilter"
11
                        [onlyresults]="true" matPanelClass="navbarMatSelectPanelClass"
11
                        [onlyresults]="false" matPanelClass="navbarMatSelectPanelClass"
12 12
                        [onChangeNavigate]="false" ></entities-selection>
13 13

  
14 14
  </div>
......
29 29
  <button (click)="keywordChanged()" type="submit"
30 30
          class="uk-icon-button uk-icon  portal-button uk-padding-remove-left uk-margin-small-left uk-margin-small-top"><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" data-svg="search"><circle fill="none" stroke="#000" stroke-width="1.1" cx="9" cy="9" r="7"></circle><path fill="none" stroke="#000" stroke-width="1.1" d="M14,14 L18,18 L14,14 Z"></path></svg>
31 31
  </button>
32
  <a *ngIf="advancedSearchLink" class="portal-link  uk-margin-top uk-padding-remove-left uk-margin-small-left"
33
     routerLinkActive="router-link-active" [routerLink]="advancedSearchLink"> Advanced search</a>
32 34
</form>

Also available in: Unified diff