diff --git a/monitor/browse-stakeholder/browse-stakeholder-base.component.ts b/monitor/browse-stakeholder/browse-stakeholder-base.component.ts index 3e50e18b..a0fd6112 100644 --- a/monitor/browse-stakeholder/browse-stakeholder-base.component.ts +++ b/monitor/browse-stakeholder/browse-stakeholder-base.component.ts @@ -17,7 +17,6 @@ export class BrowseStakeholderBaseComponent extends StakeholderBaseComponent filteredStakeholders: T[] = []; showLoading: boolean = true; isMobile: boolean = false; - gridView: boolean = true; sortOptions: Option[] = [ {value: 'alphAsc', label: 'Alphabetically Asc. (A-Z)'}, @@ -31,6 +30,7 @@ export class BrowseStakeholderBaseComponent extends StakeholderBaseComponent keywordControl: FormControl; hasPublications: boolean = true; hasOpenAccess: boolean = true; + id = 'results'; /* Services */ protected layoutService: LayoutService; @@ -101,7 +101,7 @@ export class BrowseStakeholderBaseComponent extends StakeholderBaseComponent updateCurrentPage($event) { this.currentPage = $event.value; - HelperFunctions.scrollToId('target'); + this._router.navigate([], {fragment: 'results', onSameUrlNavigation: 'reload'}); this.afterStakeholdersInitialized(); } diff --git a/monitor/entities/stakeholder.ts b/monitor/entities/stakeholder.ts index 31e74e8a..277e2388 100644 --- a/monitor/entities/stakeholder.ts +++ b/monitor/entities/stakeholder.ts @@ -264,7 +264,7 @@ export class IndicatorFilterUtils { "indi_pub_downloads":"indi_pub_downloads.result.year", "result_apc":"result_apc.result.year", "result_apc_affiliations":"result_apc_affiliations.result.year", - "result_country":"result_country.result.year", + "cross_country":"cross_country.year", "indi_impact_measures": "indi_impact_measures.result.year", "project": "project.start year" }, @@ -286,7 +286,7 @@ export class IndicatorFilterUtils { "indi_impact_measures":"indi_impact_measures.result.result_fos.lvl1", "result_apc":"result_apc.result.result_fos.lvl1", "result_apc_affiliations":"result_apc_affiliations.result.result_fos.lvl1", - "result_country":"result_country.result.result_fos.lvl1", + "cross_country":"cross_country.lvl1", "historical_snapshots_irish_fos":"historical_snapshots_irish_fos.lvl1" }, "foslvl2":{ @@ -297,7 +297,7 @@ export class IndicatorFilterUtils { "indi_impact_measures":"indi_impact_measures.result.result_fos.lvl2", "result_apc":"result_apc.result.result_fos.lvl2", "result_apc_affiliations":"result_apc_affiliations.result.result_fos.lvl2", - "result_country":"result_country.result.result_fos.lvl2", + "cross_country":"cross_country.lvl2", "historical_snapshots_irish_fos":"historical_snapshots_irish_fos.lvl2" }, "publicly-funded":{ @@ -307,7 +307,7 @@ export class IndicatorFilterUtils { "indi_impact_measures":"indi_impact_measures.result.indi_pub_publicly_funded.publicly_funded", "result_apc":"result_apc.result.indi_pub_publicly_funded.publicly_funded", "result_apc_affiliations":"result_apc_affiliations.result.indi_pub_publicly_funded.publicly_funded", - "result_country":"result_country.result.indi_pub_publicly_funded.publicly_funded" + "cross_country":"cross_country.publicly_funded" } } diff --git a/sharedComponents/input/input.component.ts b/sharedComponents/input/input.component.ts index 983486e8..8b26c2da 100644 --- a/sharedComponents/input/input.component.ts +++ b/sharedComponents/input/input.component.ts @@ -49,7 +49,8 @@ export interface Option { export interface Placeholder { label: string, - static?: boolean + static?: boolean, + tooltip?: string } export interface YearRange { @@ -80,50 +81,72 @@ declare var UIkit;
- +
+ [attr.uk-tooltip]="placeholderInfo.tooltip?('title: ' + placeholderInfo.tooltip + '; delay: 500; pos: bottom-left'): + ((tooltip && !focused && type !== 'chips' && type !== 'textarea' && (formControl.value || hint || placeholderInfo?.label))? + ('title: ' + (formControl.value ?getTooltip(formControl.value):(hint?hint:placeholderInfo?.label)) + '; delay: 500; pos: bottom-left'):null)"> - -
{{placeholderInfo.label}}
+ class="input placeholder uk-width-expand uk-text-truncate" + [class.uk-disabled]="formControl.disabled">{{ placeholderInfo.label }} +
{{getLabel(formControl.value)}}
+ class="input uk-width-expand uk-text-truncate" + [class.uk-disabled]="formControl.disabled">{{ getLabel(formControl.value) }} +
{{noValueSelected}}
+ class="input uk-width-expand uk-text-truncate" + [class.uk-disabled]="formControl.disabled">{{ noValueSelected }} +
{{getLabel(formControl.value)}}
+ class="input uk-width-expand uk-text-truncate" + [class.uk-disabled]="formControl.disabled">{{ getLabel(formControl.value) }} +
+ #searchInput class="input" [formControl]="searchControl" + [class.uk-text-truncate]="!focused">
{{placeholderInfo?.static ? placeholderInfo.label : getLabel(formAsControl.value)}}
+ class="input placeholder uk-text-truncate" + [class.uk-disabled]="formControl.disabled">{{ placeholderInfo?.static ? placeholderInfo.label : getLabel(formAsControl.value) }} +
{{getLabel(formAsControl.value)}}
+ class="input uk-text-truncate" + [class.uk-disabled]="formControl.disabled">{{ getLabel(formAsControl.value) }} +
-
{{noValueSelected}}
+
{{ noValueSelected }} +
{{getLabel(formControl.value)}}
+ class="input uk-text-truncate" + [class.uk-disabled]="formControl.disabled">{{ getLabel(formControl.value) }} +
- @@ -134,7 +157,7 @@ declare var UIkit; class="chip">
- {{getLabel(chip.value)}} + {{ getLabel(chip.value) }} @@ -148,32 +171,42 @@ declare var UIkit;
- + {{(formAsArray.length - visibleChips)}} more + + {{ (formAsArray.length - visibleChips) }} more
- +
-
- +
-
{{selectADate}}
-
{{formAsControl.getRawValue() | date: 'dd-MM-yyyy'}}
+
{{ selectADate }} +
+
{{ formAsControl.getRawValue() | date: 'dd-MM-yyyy' }} +
+ class="uk-margin-small-left icon"> - - @@ -193,28 +226,34 @@ declare var UIkit;
-
- +
+
- + - - -
- {{placeholderInfo.label}} + +
+ {{ placeholderInfo.label }}
@@ -230,7 +269,7 @@ declare var UIkit;
- {{errors?.error}} + {{ errors?.error }} Please provide a valid URL (e.g. https://example.com) @@ -320,7 +359,7 @@ export class InputComponent implements OnInit, OnDestroy, AfterViewInit, OnChang @Input() set placeholder(placeholder: string | Placeholder) { - if(this.type === 'year-range') { + if (this.type === 'year-range') { this.placeholderInfo = null; } else if (typeof placeholder === 'string') { this.placeholderInfo = {label: placeholder, static: false}; @@ -336,7 +375,7 @@ export class InputComponent implements OnInit, OnDestroy, AfterViewInit, OnChang @Input() set options(options: (Option | string | number) []) { this.optionsArray = options.map(option => { - if(option === null) { + if (option === null) { return { label: this.noValueSelected, value: '' @@ -537,20 +576,20 @@ export class InputComponent implements OnInit, OnDestroy, AfterViewInit, OnChang } get yearRangeActive(): boolean { - if(this.yearRange) { + if (this.yearRange) { return this.formAsGroup && (this.getFormByName(this.yearRange.from.control)?.value || this.getFormByName(this.yearRange.to.control)?.value); } return false; } get errors(): any { - if(this.formAsGroup) { + if (this.formAsGroup) { return (this.formAsGroup.errors - ?this.formAsGroup.errors:(this.getFormByName(this.yearRange.from.control).errors - ?this.getFormByName(this.yearRange.from.control).errors:this.getFormByName(this.yearRange.to.control).errors)); - } else if(this.formAsControl) { + ? this.formAsGroup.errors : (this.getFormByName(this.yearRange.from.control).errors + ? this.getFormByName(this.yearRange.from.control).errors : this.getFormByName(this.yearRange.to.control).errors)); + } else if (this.formAsControl) { return this.formAsControl.errors; - } else if(this.searchControl) { + } else if (this.searchControl) { return this.searchControl.errors; } else { return null; @@ -578,7 +617,7 @@ export class InputComponent implements OnInit, OnDestroy, AfterViewInit, OnChang if (this.focused) { this.open(true); setTimeout(() => { - if(this.searchInput) { + if (this.searchInput) { this.searchInput.nativeElement.focus(); this.searchInput.nativeElement.value = value; } @@ -590,12 +629,12 @@ export class InputComponent implements OnInit, OnDestroy, AfterViewInit, OnChang let validator = this.formControl.validator({} as AbstractControl); this.required = (validator && validator.required); } - if(this.type === 'date') { - this.selectedDate = this.formAsControl.getRawValue()?new Date(this.formAsControl.getRawValue()):null; + if (this.type === 'date') { + this.selectedDate = this.formAsControl.getRawValue() ? new Date(this.formAsControl.getRawValue()) : null; } this.subscriptions.push(this.formControl.valueChanges.subscribe(value => { if (this.formControl.enabled) { - if(this.type !== 'year-range') { + if (this.type !== 'year-range') { value = (value === '') ? null : value; if (this.type === 'logoURL') { this.secure = (!value || value.includes('https://')); @@ -613,7 +652,7 @@ export class InputComponent implements OnInit, OnDestroy, AfterViewInit, OnChang } } if (this.type === 'date') { - this.selectedDate = value?new Date(value):null; + this.selectedDate = value ? new Date(value) : null; } } if ((this.value && value && this.value !== value) || (!this.value && value) || this.value && !value) { @@ -621,7 +660,7 @@ export class InputComponent implements OnInit, OnDestroy, AfterViewInit, OnChang } } })); - if(this.formAsGroup) { + if (this.formAsGroup) { let fromControl = this.formAsGroup.get(this.yearRange.from.control); this.subscriptions.push(fromControl.valueChanges.subscribe(value => { let from = this.initValue[this.yearRange.from.control]; @@ -630,8 +669,8 @@ export class InputComponent implements OnInit, OnDestroy, AfterViewInit, OnChang } else { fromControl.markAsDirty(); } - if(fromControl.valid) { - if(this.activeIndex === 0 && value) { + if (fromControl.valid) { + if (this.activeIndex === 0 && value) { this.activeIndex = 1; this.input.get(this.activeIndex).nativeElement.focus(); } @@ -745,13 +784,13 @@ export class InputComponent implements OnInit, OnDestroy, AfterViewInit, OnChang } focus(value: boolean, event = null) { - if(!this.activeIndex) { + if (!this.activeIndex) { this.activeIndex = 0; } if (this.focused) { this.formControl.markAsTouched(); } - if(this.formControl.enabled) { + if (this.formControl.enabled) { this.focused = value; this.cdr.detectChanges(); if (this.focused) { @@ -791,7 +830,7 @@ export class InputComponent implements OnInit, OnDestroy, AfterViewInit, OnChang open(value: boolean) { this.opened = value && this.formControl.enabled; this.cdr.detectChanges(); - if(this.optionBox) { + if (this.optionBox) { if (this.opened) { this.selectedIndex = this.filteredOptions.findIndex(option => option.value === this.formControl.value); if (this.selectedIndex === -1 && this.type !== 'autocomplete_soft') { @@ -802,17 +841,17 @@ export class InputComponent implements OnInit, OnDestroy, AfterViewInit, OnChang UIkit.dropdown(this.optionBox.nativeElement).hide(); this.focused = false; } - } else if(this.calendarBox) { + } else if (this.calendarBox) { if (this.opened) { UIkit.dropdown(this.calendarBox.nativeElement).show(); } else { UIkit.dropdown(this.calendarBox.nativeElement).hide(); this.focused = false; } - } else if(this.mobileDropdown) { - if(this.opened) { + } else if (this.mobileDropdown) { + if (this.opened) { this.mobileDropdown.open(); - if(this.searchInput) { + if (this.searchInput) { this.searchInput.nativeElement.blur(); } } else { @@ -845,7 +884,7 @@ export class InputComponent implements OnInit, OnDestroy, AfterViewInit, OnChang this.searchControl.setValue(''); } } - if(this.mobileDropdown) { + if (this.mobileDropdown) { this.mobileDropdown.close(); } } diff --git a/sharedComponents/search-input/search-input.component.ts b/sharedComponents/search-input/search-input.component.ts index 63fc7d03..6026bc94 100644 --- a/sharedComponents/search-input/search-input.component.ts +++ b/sharedComponents/search-input/search-input.component.ts @@ -23,7 +23,7 @@ import {ClickEvent} from "../../utils/click/click-outside-or-esc.directive";
@@ -53,6 +53,7 @@ export class SearchInputComponent implements OnInit, AfterViewInit { @Output() valueChange = new EventEmitter(); @Input() options: string[] = []; @Input() placeholder: string; + @Input() tooltip: string; @Input() expandable: boolean = false; @Output() searchEmitter: EventEmitter = new EventEmitter(); @ViewChild('searchInput') searchInput: ElementRef; diff --git a/utils/entities/dataProviderInfo.ts b/utils/entities/dataProviderInfo.ts index 0757853f..a532260d 100644 --- a/utils/entities/dataProviderInfo.ts +++ b/utils/entities/dataProviderInfo.ts @@ -46,8 +46,11 @@ export class DataProviderInfo { // aggregationStatus: {"fundedContent": string, "indexRecords": string, "fulltexts": string, "lastUpdateDate": string}; aggregationStatus: { "fulltexts": string }; + /** @deprecated*/ tabs: { "name": string, "content": string }[]; + /** @deprecated*/ tabs2: string[] = []; + /** @deprecated*/ tabsInTypes = { "publicationsTab": new Set( ["aggregator::datarepository", @@ -196,11 +199,14 @@ export class DataProviderInfo { organizations: { "acronym": string, "name": string, "id": string }[] = []; //publications: any; //datasets: any; + /** @deprecated*/ statistics: any; //projects: any; + /** @deprecated*/ datasources: any; //relatedDatasources: Map; + // Search query relatedDatasources: { "id": string, "name": string, "count": number }[] = []; belongsTo: boolean = true; diff --git a/utils/entities/organizationInfo.ts b/utils/entities/organizationInfo.ts index 09d4ca09..7943db6e 100644 --- a/utils/entities/organizationInfo.ts +++ b/utils/entities/organizationInfo.ts @@ -21,8 +21,8 @@ export class OrganizationInfo { name: string; country: string; objIdentifier: string; - - + + /** @deprecated*/ //deprecated - search query projects: Map; //dataProviders: { name: string; url: string; type: string; websiteUrl: string; // organizations: {name: string; url: string}[]}[];