diff --git a/monitor/entities/stakeholder.ts b/monitor/entities/stakeholder.ts index 60a52bdb..ccc2b812 100644 --- a/monitor/entities/stakeholder.ts +++ b/monitor/entities/stakeholder.ts @@ -1,5 +1,6 @@ import {SafeResourceUrl} from "@angular/platform-browser"; import {properties} from "../../../../environments/environment"; +import {Session, User} from "../../login/utils/helper.class"; export const ChartHelper = { prefix: "((__", @@ -49,6 +50,14 @@ export class Stakeholder { export class StakeholderInfo extends Stakeholder { isManager: boolean = false; isMember: boolean = false; + + public static toStakeholderInfo(stakeholders: (Stakeholder & StakeholderInfo)[], user: User): StakeholderInfo[] { + return stakeholders.map(stakeholder => { + stakeholder.isManager = Session.isPortalAdministrator(user) || Session.isMonitorCurator(user) || Session.isManager(stakeholder.type, stakeholder.alias, user); + stakeholder.isMember = Session.isMember(stakeholder.type, stakeholder.alias, user); + return stakeholder; + }) + } } export class Topic { diff --git a/monitor/how/how.component.ts b/monitor/how/how.component.ts index 1c8e44d8..174044e5 100644 --- a/monitor/how/how.component.ts +++ b/monitor/how/how.component.ts @@ -3,22 +3,22 @@ import {Component} from "@angular/core"; @Component({ selector: 'how', template: ` -
+
-
+
- Starting from existing
research-related data sources + Starting from existing
research-related data sources
-
+
-
+
@@ -28,37 +28,37 @@ import {Component} from "@angular/core";
-
+
- we perform Statistical Analysis and produce - Open Science Indicators + we perform Statistical
Analysis
and produce
+ Open Science Indicators
-
+
- furthermore Network
Analysis
producing - Collaboration Indicators + furthermore Network
Analysis
producing
+ Collaboration Indicators
-
+
- Often combine with external data + Often combine with external data
(patents, social, company) and - perform Impact Analysis to - produce Innovation Indicators + perform
Impact Analysis to + produce
Innovation Indicators
-
+
diff --git a/monitor/services/stakeholder.service.ts b/monitor/services/stakeholder.service.ts index f8cfc260..4cd082ff 100644 --- a/monitor/services/stakeholder.service.ts +++ b/monitor/services/stakeholder.service.ts @@ -79,7 +79,7 @@ export class StakeholderService { })); } - getMyStakeholders(url: string, type: string = null): Observable { + getMyStakeholders(url: string, type: string = null): Observable<(Stakeholder & StakeholderInfo)[]> { return this.http.get(url + '/my-stakeholder' + ((type) ? ('?type=' + type) : ''), CustomOptions.registryOptions()).pipe(map(stakeholders => { return this.formalize(this.checkIsUpload(stakeholders)); })); diff --git a/searchPages/searchUtils/advancedSearchForm.component.html b/searchPages/searchUtils/advancedSearchForm.component.html index c16c60c4..a973591a 100644 --- a/searchPages/searchUtils/advancedSearchForm.component.html +++ b/searchPages/searchUtils/advancedSearchForm.component.html @@ -140,11 +140,8 @@ (selectionChange)=" simpleEntityChanged($event)" [onChangeNavigate]="true" [customFilter]="customFilter">
-
- - + diff --git a/searchPages/searchUtils/newSearchPage.component.html b/searchPages/searchUtils/newSearchPage.component.html index c99117d5..6413b4c3 100644 --- a/searchPages/searchUtils/newSearchPage.component.html +++ b/searchPages/searchUtils/newSearchPage.component.html @@ -4,7 +4,7 @@ refineFields.indexOf(customFilter.queryFieldName) == -1) ||customFilter.isHiddenFilter)"> - + {{customFilter.valueName}} @@ -14,9 +14,9 @@ - + {{type.name}} - + @@ -29,9 +29,9 @@ - + {{filter.selectedFromAndToValues}} - + @@ -43,9 +43,9 @@ - + {{value.name}} - + @@ -73,7 +73,7 @@ No filters available Filters temporarily unavailable. Please try again later.
-
    +
    • -
      -
      +
      -
      +
      -
      +
      @@ -235,7 +234,7 @@ target="_blank"> OpenAIRE - Explore.
      -
      +
      {{searchUtils.totalResults|number}} {{type}}, page @@ -248,7 +247,7 @@ {{searchUtils.page | number}} of {{(totalPages(oldTotalResults)|number)}} -
      +
      diff --git a/searchPages/searchUtils/newSearchPage.component.ts b/searchPages/searchUtils/newSearchPage.component.ts index e82b7f66..f960c800 100644 --- a/searchPages/searchUtils/newSearchPage.component.ts +++ b/searchPages/searchUtils/newSearchPage.component.ts @@ -58,7 +58,7 @@ export class NewSearchPageComponent { @Input() customFilter: SearchCustomFilter; @Input() sort: boolean = true; @Input() sortedByChanged: string = ""; - @Input() searchFormClass: string = "searchForm"; + @Input() searchFormClass: string = "uk-background-muted"; //From simple: @Input() rangeFilters: RangeFilter[] = []; @Input() rangeFields: string[][] = []; diff --git a/searchPages/searchUtils/portal-search-result.component.html b/searchPages/searchUtils/portal-search-result.component.html index bdf7ea2c..42e99bc3 100644 --- a/searchPages/searchUtils/portal-search-result.component.html +++ b/searchPages/searchUtils/portal-search-result.component.html @@ -1,30 +1,33 @@ -
        +
        • -
          +
          Subscribed
          - - restricted + class="uk-position-top-right uk-margin-top uk-margin-right uk-flex uk-flex-column uk-flex-middle"> + + restricted
          - - private + class="uk-position-top-right uk-margin-top uk-margin-right uk-flex uk-flex-column uk-flex-middle"> + + private
          - - {{result.visibility.toLowerCase()}} + class="uk-position-top-right uk-margin-top uk-margin-right uk-flex uk-flex-column uk-flex-middle"> + + {{result.visibility.toLowerCase()}}
          - @@ -38,21 +41,25 @@
          -
          - Creation Date: - {{result.date | date:'dd-MM-yyyy'}} - {{result.creationDate | date:'dd-MM-yyyy'}} - +
          +
          + Creation Date: + {{result.date | date:'dd-MM-yyyy'}} + {{result.creationDate | date:'dd-MM-yyyy'}} +
          +
          Type: {{mapType(result.type)}} - - - Type: - {{mapType(result.type)}} - +
          @@ -92,6 +98,7 @@
          - +
          diff --git a/searchPages/searchUtils/portal-search-result.component.ts b/searchPages/searchUtils/portal-search-result.component.ts index 96d9ef0c..e6993534 100644 --- a/searchPages/searchUtils/portal-search-result.component.ts +++ b/searchPages/searchUtils/portal-search-result.component.ts @@ -22,7 +22,7 @@ export class PortalSearchResultComponent implements OnInit{ @Input() properties: EnvProperties; @ViewChild('AlertModal') modal; visibilityIcon: Map = new Map ([ - ["PRIVATE", 'lock'], + ["PRIVATE", 'incognito'], ["RESTRICTED", 'group'] ]); public urlParam: string; @@ -64,7 +64,7 @@ export class PortalSearchResultComponent implements OnInit{ return result.status === "all" || (result.status === "manager" && result.isManager); } else if(this.type === "stakeholder") { return result.visibility === "PUBLIC" || (result.visibility === "RESTRICTED" && (result.isManager || result.isMember)) || - (result.visibility === "PRIVATE" || result.isManager); + (result.visibility === "PRIVATE" && result.isManager); } } diff --git a/searchPages/searchUtils/portal-search-result.module.ts b/searchPages/searchUtils/portal-search-result.module.ts index f78e95c0..05cc15c2 100644 --- a/searchPages/searchUtils/portal-search-result.module.ts +++ b/searchPages/searchUtils/portal-search-result.module.ts @@ -1,18 +1,16 @@ -import { NgModule} from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { FormsModule } from '@angular/forms'; -import { RouterModule } from '@angular/router'; -import {ErrorMessagesModule} from '../../utils/errorMessages.module'; +import {NgModule} from '@angular/core'; +import {CommonModule} from '@angular/common'; +import {FormsModule} from '@angular/forms'; +import {RouterModule} from '@angular/router'; +import {ErrorMessagesModule} from '../../utils/errorMessages.module'; import {PortalSearchResultComponent} from "./portal-search-result.component"; import {AlertModalModule} from "../../utils/modal/alertModal.module"; import {ManageModule} from "../../utils/manage/manage.module"; import {IconsModule} from "../../utils/icons/icons.module"; import {UrlPrefixModule} from "../../utils/pipes/url-prefix.module"; import {IconsService} from "../../utils/icons/icons.service"; -import {group, lock} from "../../utils/icons/icons"; +import {incognito} from "../../utils/icons/icons"; import {LogoUrlPipeModule} from "../../utils/pipes/logoUrlPipe.module"; -// import {IconsService} from "../../utils/icons/icons.service"; -// import {group, lock} from "../../utils/icons/icons"; @NgModule({ imports: [ @@ -31,6 +29,6 @@ import {LogoUrlPipeModule} from "../../utils/pipes/logoUrlPipe.module"; }) export class PortalSearchResultModule { constructor(private iconsService: IconsService) { - this.iconsService.registerIcons([group, lock]) + this.iconsService.registerIcons([incognito]) } } diff --git a/searchPages/searchUtils/searchFilter.component.html b/searchPages/searchUtils/searchFilter.component.html index 73b3f769..b9ff8773 100644 --- a/searchPages/searchUtils/searchFilter.component.html +++ b/searchPages/searchUtils/searchFilter.component.html @@ -86,7 +86,7 @@ diff --git a/utils/HelperFunctions.class.ts b/utils/HelperFunctions.class.ts index fc2c1cb2..f7434446 100644 --- a/utils/HelperFunctions.class.ts +++ b/utils/HelperFunctions.class.ts @@ -11,13 +11,10 @@ export class HelperFunctions { public static scrollToId(elementId:string) { if (typeof document !== 'undefined' && document.getElementById(elementId)) { - document.getElementById(elementId).scrollIntoView(); + document.getElementById(elementId).scrollIntoView({behavior: "smooth"}); } } - public static isTiny(url: string) { - return (url.indexOf('tinyurl.com') !== -1); - } - + public static copy(obj: any): any { let copy; diff --git a/utils/breadcrumbs/breadcrumbs.component.ts b/utils/breadcrumbs/breadcrumbs.component.ts index 1fe16bbc..ad3bcd43 100644 --- a/utils/breadcrumbs/breadcrumbs.component.ts +++ b/utils/breadcrumbs/breadcrumbs.component.ts @@ -8,7 +8,7 @@ export interface Breadcrumb { @Component({ selector: 'breadcrumbs', template: ` -
            +
            • {{breadcrumb.name}} {{breadcrumb.name}} diff --git a/utils/icons/icons.component.ts b/utils/icons/icons.component.ts index 98956135..7ff57455 100644 --- a/utils/icons/icons.component.ts +++ b/utils/icons/icons.component.ts @@ -1,6 +1,11 @@ import {AfterViewInit, ChangeDetectorRef, Component, ElementRef, Input, OnInit, ViewChild} from "@angular/core"; import {IconsService} from "./icons.service"; +export interface StopRule { + class: string, + offset: number +} + /** * By default this component uses Material Icons Library to render an icon with * a specific @name. For custom icons you should: @@ -17,12 +22,23 @@ import {IconsService} from "./icons.service"; * * - Custom SVG Icon. Define a variable in your component with an SVG and give it as Input @svg. * + * In case of SVGs, there is an opportunity to add gradient color by define at least a start and end stop-color rules + * and an id to support them. This option is enabled by giving id as input in @gradient (Optional @degrees for gradient direction) + * + * e.g #gradient .start { + * stop-color: red; + * } + * + * e.g #gradient .end { + * stop-color: orange; + * } + * * */ @Component({ selector: 'icon', template: ` - - + + {{iconName}} {{visuallyHidden}} @@ -37,6 +53,8 @@ export class IconsComponent implements AfterViewInit { */ @Input() public svg; + @Input() + public defaultSize = false; /** * True if this icon should have display flex (Optional, Default: false) * @@ -61,6 +79,8 @@ export class IconsComponent implements AfterViewInit { public stroke; /** * Size of icon (Default: 1) + * + * Disabled if defaultSize = true * */ @Input() public ratio = 1; @@ -78,10 +98,22 @@ export class IconsComponent implements AfterViewInit { this.svg = this.iconsService.getIcon(iconName); } /** - * + * Set visually hidden name for accessibility * */ @Input() public visuallyHidden: string = null; + /** + * Gradient rules + * Available only for SVG! + * + * Define your css rules for stop-colors + * */ + @Input() + public gradient: string = null; + @Input() + public degrees: number = 0; + @Input() + public stopRules: StopRule[]= [{class: 'start', offset: 0}, {class: 'end', offset: 100}]; @ViewChild("icon") public icon: ElementRef; @@ -90,13 +122,19 @@ export class IconsComponent implements AfterViewInit { ngAfterViewInit() { if(this.svg) { - let svg = this.icon.nativeElement.getElementsByTagName('svg').item(0); - svg.setAttribute("width", (this.ratio*IconsComponent.DEFAULT_ICON_SIZE).toString()); - svg.setAttribute("height", (this.ratio*IconsComponent.DEFAULT_ICON_SIZE).toString()); - this.style = { - fill: this.fill, - stroke: this.stroke - }; + let svg: Element = this.icon.nativeElement.getElementsByTagName('svg').item(0); + if(!this.defaultSize) { + svg.setAttribute("width", (this.ratio * IconsComponent.DEFAULT_ICON_SIZE).toString()); + svg.setAttribute("height", (this.ratio * IconsComponent.DEFAULT_ICON_SIZE).toString()); + } + if(this.gradient) { + this.addGradient(svg); + } else { + this.style = { + fill: this.fill, + stroke: this.stroke + }; + } } else { this.style = { "font-size.px": this.ratio*IconsComponent.DEFAULT_ICON_SIZE @@ -104,4 +142,33 @@ export class IconsComponent implements AfterViewInit { } this.cdr.detectChanges(); } + + addGradient(svg: Element) { + if(svg.children.length > 0 && typeof document !== "undefined") { + let gradientDefinition = document.createElementNS('http://www.w3.org/2000/svg', 'linearGradient'); + gradientDefinition.setAttribute('id', this.gradient); + if(this.degrees !== 0) { + let angle = (this.degrees) * (Math.PI / 180); + gradientDefinition.setAttribute('x1', Math.round(50 + Math.sin(angle + Math.PI) * 50) + '%'); + gradientDefinition.setAttribute('y1', Math.round(50 + Math.cos(angle + Math.PI) * 50) + '%'); + gradientDefinition.setAttribute('x2', Math.round(50 + Math.sin(angle) * 50) + '%'); + gradientDefinition.setAttribute('y2', Math.round(50 + Math.cos(angle) * 50) + '%'); + } + for(let rule of this.stopRules) { + let item = document.createElementNS('http://www.w3.org/2000/svg','stop'); + item.setAttribute('class', rule.class); + item.setAttribute('offset', rule.offset + '%'); + gradientDefinition.appendChild(item); + } + let defs = document.createElementNS('http://www.w3.org/2000/svg','defs'); + defs.appendChild(gradientDefinition); + for(let i = 0; i < svg.children.length; i++) { + let item = svg.children.item(i); + if(!item.hasAttribute('fill')) { + item.setAttribute('fill', "url('#" + this.gradient + "')"); + } + } + svg.insertBefore(defs, svg.childNodes[0]); + } + } } diff --git a/utils/icons/icons.ts b/utils/icons/icons.ts index 617b0d80..68b434fa 100644 --- a/utils/icons/icons.ts +++ b/utils/icons/icons.ts @@ -148,3 +148,8 @@ export const print = { } /** Add new icon under this line to be sure that it will be added on preview */ + +export const incognito = { + name: 'incognito', + data: '' +} diff --git a/utils/section-scroll/section-scroll.component.ts b/utils/section-scroll/section-scroll.component.ts index ddfcbc26..64d40d9a 100644 --- a/utils/section-scroll/section-scroll.component.ts +++ b/utils/section-scroll/section-scroll.component.ts @@ -13,10 +13,10 @@ import {Component, HostListener, Input, OnInit, ViewEncapsulation} from "@angula @Component({ selector: 'section-scroll', template: ` -
              +
              -
              -
              +
              +