[master]: 1. Change search-form class in advnanced search pages and implement hook in styles. 2. Add searchField.irish.ts and replace the default on in angular.json. 3. Replace Research Products with OpenAIREEntities.RESULTS (dynamic). 4. Update library and assets.

This commit is contained in:
Konstantinos Triantafyllou 2023-12-06 13:57:49 +02:00
parent 78a70b56bf
commit c64b1213ac
17 changed files with 116 additions and 57 deletions

View File

@ -35,6 +35,12 @@
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"fileReplacements": [
{
"replace": "src/app/openaireLibrary/utils/properties/searchFields.ts",
"with": "src/app/shared/searchFields.irish.ts"
}
],
"outputPath": "dist/irish-monitor/browser",
"index": "src/index.html",
"main": "src/main.ts",

View File

@ -10,6 +10,7 @@ import {LinksResolver} from "../search/links-resolver";
import {CustomFilterService} from "../shared/customFilter.service";
import {StakeholderBaseComponent} from "../openaireLibrary/monitor-admin/utils/stakeholder-base.component";
import {LayoutService} from "../openaireLibrary/dashboard/sharedComponents/sidebar/layout.service";
import {OpenaireEntities} from "../openaireLibrary/utils/properties/searchFields";
@Component({
selector: 'national',
@ -30,7 +31,7 @@ import {LayoutService} from "../openaireLibrary/dashboard/sharedComponents/sideb
<a [routerLink]="'/'">{{entities.stakeholder}}</a>
</li>
<li [class.uk-active]="isSearch">
<a [routerLink]="'/search/find/research-outcomes'">Browse Research Outputs</a>
<a [routerLink]="'/search/find/research-outcomes'">Browse {{openaireEntities.RESULTS}}</a>
</li>
</ul>
</div>
@ -51,6 +52,7 @@ export class NationalComponent extends StakeholderBaseComponent implements OnIni
stakeholder: Stakeholder;
loading: boolean = true;
isSearch: boolean = false;
openaireEntities = OpenaireEntities;
constructor(private stakeholderService: StakeholderService,
private layoutService: LayoutService,

@ -1 +1 @@
Subproject commit 0b90448e01f1d0a1f4b5eb2546d3b8437ccf21e7
Subproject commit 736546c0ebd31d75035f78e72b833982f9f9e205

View File

@ -10,6 +10,7 @@ import {CustomFilterService} from "../shared/customFilter.service";
import {LinksResolver} from "../search/links-resolver";
import {SearchCustomFilter} from "../openaireLibrary/searchPages/searchUtils/searchUtils.class";
import {LayoutService} from "../openaireLibrary/dashboard/sharedComponents/sidebar/layout.service";
import {OpenaireEntities} from "../openaireLibrary/utils/properties/searchFields";
@Component({
selector: 'repository',
@ -33,7 +34,7 @@ import {LayoutService} from "../openaireLibrary/dashboard/sharedComponents/sideb
</li>
<li [class.uk-active]="isSearch">
<a [routerLink]="['./', stakeholder.alias, 'search']" [relativeTo]="_route">
Browse Research Outputs
Browse {{openaireEntities.RESULTS}}
</a>
</li>
</ul>
@ -52,6 +53,7 @@ export class RepositoryComponent extends StakeholderBaseComponent implements OnI
alias: string;
isSearch: boolean = false;
loading: boolean = false;
openaireEntities = OpenaireEntities;
constructor(private stakeholderService: StakeholderService,
private layoutService: LayoutService,

View File

@ -10,6 +10,7 @@ import {LinksResolver} from "../search/links-resolver";
import {CustomFilterService} from "../shared/customFilter.service";
import {StakeholderBaseComponent} from "../openaireLibrary/monitor-admin/utils/stakeholder-base.component";
import {LayoutService} from "../openaireLibrary/dashboard/sharedComponents/sidebar/layout.service";
import {OpenaireEntities} from "../openaireLibrary/utils/properties/searchFields";
@Component({
selector: 'rfo',
@ -31,8 +32,7 @@ import {LayoutService} from "../openaireLibrary/dashboard/sharedComponents/sideb
(click)="isSearch = false">{{entities.stakeholder}}</a>
</li>
<li [class.uk-active]="isSearch">
<a [routerLink]="['./', stakeholder.alias, 'search']" [relativeTo]="_route">Browse
Research Outputs</a>
<a [routerLink]="['./', stakeholder.alias, 'search']" [relativeTo]="_route">Browse {{openaireEntities.RESULTS}}</a>
</li>
</ul>
</div>
@ -50,6 +50,7 @@ export class RfoComponent extends StakeholderBaseComponent implements OnInit {
alias: string;
isSearch: boolean = false;
loading: boolean = false;
openaireEntities = OpenaireEntities;
constructor(private stakeholderService: StakeholderService,
private layoutService: LayoutService,

View File

@ -10,6 +10,7 @@ import {LinksResolver} from "../search/links-resolver";
import {CustomFilterService} from "../shared/customFilter.service";
import {StakeholderBaseComponent} from "../openaireLibrary/monitor-admin/utils/stakeholder-base.component";
import {LayoutService} from "../openaireLibrary/dashboard/sharedComponents/sidebar/layout.service";
import {OpenaireEntities} from "../openaireLibrary/utils/properties/searchFields";
@Component({
selector: 'rpo',
@ -31,8 +32,7 @@ import {LayoutService} from "../openaireLibrary/dashboard/sharedComponents/sideb
(click)="isSearch = false">{{entities.stakeholder}}</a>
</li>
<li [class.uk-active]="isSearch">
<a [routerLink]="['./', stakeholder.alias, 'search']" [relativeTo]="_route">Browse
Research Outputs</a>
<a [routerLink]="['./', stakeholder.alias, 'search']" [relativeTo]="_route">Browse {{openaireEntities.RESULTS}}</a>
</li>
</ul>
</div>
@ -51,6 +51,7 @@ export class RpoComponent extends StakeholderBaseComponent implements OnInit {
alias: string;
isSearch: boolean = false;
loading: boolean = false;
openaireEntities = OpenaireEntities;
constructor(private stakeholderService: StakeholderService,
private _customFilterService: CustomFilterService,

View File

@ -11,7 +11,7 @@ import {CustomFilterService} from "../../../shared/customFilter.service";
[hasPrefix]="false"
[showBreadcrumb]="false"
[showSwitchSearchLink]="true"
[searchForm]="{dark: false, class: 'irish-advanced-search-form'}"
[searchForm]="{dark: false, class: 'search-form'}"
[openaireLink]="'https://'+(properties.environment != 'production'?'beta.':'')+'explore.openaire.eu/search/simple/projects'">
</search-dataproviders>
`

View File

@ -7,10 +7,8 @@ import {CustomFilterService} from "../../../shared/customFilter.service";
selector: 'monitor-advanced-search-organizations',
template: `
<search-organizations *ngIf="customFilters" [simpleView]="false" [showSwitchSearchLink]="true" [customFilters]="customFilters"
[hasPrefix]="false"
[showBreadcrumb]="false"
[showSwitchSearchLink]="true"
[searchForm]="{dark: false, class: 'irish-advanced-search-form'}"
[hasPrefix]="false" [showBreadcrumb]="false"
[searchForm]="{dark: false, class: 'search-form'}"
[openaireLink]="'https://'+(properties.environment != 'production'?'beta.':'')+'explore.openaire.eu/search/simple/projects'">
</search-organizations>
`

View File

@ -11,7 +11,7 @@ import {CustomFilterService} from "../../../shared/customFilter.service";
[hasPrefix]="false"
[showBreadcrumb]="false"
[showSwitchSearchLink]="true"
[searchForm]="{dark: false, class: 'irish-advanced-search-form'}"
[searchForm]="{dark: false, class: 'search-form'}"
[openaireLink]="'https://'+(properties.environment != 'production'?'beta.':'')+'explore.openaire.eu/search/simple/projects'"
>
</search-projects>

View File

@ -10,17 +10,11 @@ import {CustomFilterService} from "../../../shared/customFilter.service";
[customFilters]=customFilters [hasPrefix]="false"
[showBreadcrumb]="false"
[showSwitchSearchLink]="true"
[searchForm]="{dark: false, class: 'irish-advanced-search-form'}"
[searchForm]="{dark: false, class: 'search-form'}"
[openaireLink]="'https://'+(properties.environment != 'production'?'beta.':'')+'explore.openaire.eu/search/advanced/research-outcomes'"
></search-research-results>
`,styles:[`
.irish-advanced-search-form #searchForm{
margin-top:0px;
padding-top:0px;
}
`]
`
})
export class MonitorAdvancedSearchResearchResultsComponent extends SearchBaseComponent implements OnInit{
constructor(protected route: ActivatedRoute,

View File

@ -2,6 +2,7 @@ import {Component} from '@angular/core';
import {ActivatedRoute, Router} from "@angular/router";
import {CustomFilterService} from "../../../shared/customFilter.service";
import {SearchBaseComponent} from "../searchBaseComponent";
import {OpenaireEntities} from "../../../openaireLibrary/utils/properties/searchFields";
@Component({
selector: 'monitor-search-results',
@ -11,7 +12,7 @@ import {SearchBaseComponent} from "../searchBaseComponent";
<div class=" uk-flex uk-flex-right">
<a [routerLink]="properties.searchLinkToAdvancedResults" [queryParams]="parameters">Advanced search</a>
</div>
<div search-input [(value)]="keyword" [placeholder]="'Search research outputs'"
<div search-input [(value)]="keyword" [placeholder]="'Search ' + openaireEntities.RESULTS"
[searchInputClass]="'inner background'" (searchEmitter)="search()" class="uk-width-xlarge@l uk-width-large@m"></div>
</div>
</div>
@ -23,7 +24,8 @@ import {SearchBaseComponent} from "../searchBaseComponent";
[searchForm]="{dark: false, class: 'search-form'}"></search-research-results>
`,
})
export class MonitorSearchResearchResultsComponent extends SearchBaseComponent{
export class MonitorSearchResearchResultsComponent extends SearchBaseComponent {
openaireEntities = OpenaireEntities;
constructor(protected route: ActivatedRoute,
protected router: Router,

View File

@ -0,0 +1,63 @@
import {SearchFieldsBase} from "src/app/openaireLibrary/utils/properties/searchFields.base";
export class SearchFields extends SearchFieldsBase {
public static getParameterOrder(fieldId: string, params): number {
let fields = [];
let searchFields = new SearchFields();
if (searchFields.RESULT_REFINE_FIELDS.indexOf(fieldId) != -1) {
fields = searchFields.RESULT_REFINE_FIELDS;
} else if (searchFields.PROJECT_REFINE_FIELDS.indexOf(fieldId) != -1) {
fields = searchFields.PROJECT_REFINE_FIELDS
} else if (searchFields.ORGANIZATION_REFINE_FIELDS.indexOf(fieldId) != -1) {
fields = searchFields.ORGANIZATION_REFINE_FIELDS;
} else if (searchFields.DATASOURCE_REFINE_FIELDS.indexOf(fieldId) != -1) {
fields = searchFields.DATASOURCE_REFINE_FIELDS;
}
let index = fields.indexOf(fieldId);
let paramIndex = 0;
if (index != -1) {
for (let keyValue of params) {
if (fields.indexOf(keyValue[0]) > index) {
break;
}
paramIndex++
}
}
return paramIndex;
}
}
export enum OpenaireEntities {
RESULTS = "Research products",
PUBLICATIONS = "Publications",
DATASETS = "Research data",
SOFTWARE = "Research software",
OTHER = "Other research products",
PROJECTS = "Projects",
ORGANIZATIONS = "Organizations",
DATASOURCES = "Data sources",
SERVICES = "Services",
COMMUNITIES = "Research communities",
RESULT = "Research product",
PUBLICATION = "Publication",
DATASET = "Research data",
SOFTWARE_SINGULAR = "Research software",
OTHER_SINGULAR = "Other research product",
PROJECT = "Project",
ORGANIZATION = "Organization",
DATASOURCE = "Data source",
SERVICE = "Service",
COMMUNITY = "Research community",
RESULTS_FILE = "research-products",
PUBLICATIONS_FILE = "publications",
DATASETS_FILE = "research-data",
SOFTWARE_FILE = "research-software",
OTHER_FILE = "other-research-products",
PROJECTS_FILE = "projects",
ORGANIZATIONS_FILE = "organizations",
DATASOURCES_FILE = "data-sources",
SERVICES_FILE = "services",
}

@ -1 +1 @@
Subproject commit b68f375714b679743e586bb2fb4721e633e43fc1
Subproject commit 3bd0419facb2699e30b743b4a8ea2a2a9a8aa2bc

14
src/assets/common.less Normal file
View File

@ -0,0 +1,14 @@
@import "~src/assets/extend-theme/less/_import";
@import "~src/assets/common-assets/less/general";
@import "~src/assets/common-assets/less/landing";
@import "~src/assets/common-assets/less/dashboard";
@import "~src/assets/common-assets/less/indicators";
@general-search-form-background: none;
.hook-general-search-form() {
& #searchForm {
margin-top: 0 !important;
padding-top: 0 !important;
}
}

View File

@ -1,24 +1,14 @@
@general-search-form-background: none;
.country {
@import (multiple) "~src/assets/extend-theme/less/_import";
@import (multiple) "~src/assets/common-assets/less/general";
@import (multiple) "~src/assets/common-assets/less/landing";
@import (multiple) "~src/assets/common-assets/less/dashboard";
@import (multiple) "~src/assets/common-assets/less/indicators";
@import (multiple) "~src/assets/common";
@banner-mode: light;
@banner-background: @global-primary-gradient;
@primary-color: @primary-dark-color;
@secondary-color: @irish-global-primary-color;
@banner-mode: light;
@banner-background: @global-primary-gradient;
}
.funder {
@import (multiple) "~src/assets/extend-theme/less/_import";
@import (multiple) "~src/assets/common-assets/less/general";
@import (multiple) "~src/assets/common-assets/less/landing";
@import (multiple) "~src/assets/common-assets/less/dashboard";
@import (multiple) "~src/assets/common-assets/less/indicators";
@import (multiple) "~src/assets/common";
@primary-color: @funder-color;
@secondary-color: #9A4DDD;
@ -30,11 +20,7 @@
}
.organization {
@import (multiple) "~src/assets/extend-theme/less/_import";
@import (multiple) "~src/assets/common-assets/less/general";
@import (multiple) "~src/assets/common-assets/less/landing";
@import (multiple) "~src/assets/common-assets/less/dashboard";
@import (multiple) "~src/assets/common-assets/less/indicators";
@import (multiple) "~src/assets/common";
@primary-color: @organization-color;
@secondary-color: #EB4386;
@ -46,11 +32,7 @@
}
.datasource {
@import (multiple) "~src/assets/extend-theme/less/_import";
@import (multiple) "~src/assets/common-assets/less/general";
@import (multiple) "~src/assets/common-assets/less/landing";
@import (multiple) "~src/assets/common-assets/less/dashboard";
@import (multiple) "~src/assets/common-assets/less/indicators";
@import (multiple) "~src/assets/common";
@primary-color: @datasource-color;
@secondary-color: #CB4C99;
@ -62,11 +44,7 @@
}
.researcher {
@import (multiple) "~src/assets/extend-theme/less/_import";
@import (multiple) "~src/assets/common-assets/less/general";
@import (multiple) "~src/assets/common-assets/less/landing";
@import (multiple) "~src/assets/common-assets/less/dashboard";
@import (multiple) "~src/assets/common-assets/less/indicators";
@import (multiple) "~src/assets/common";
@primary-color: @researcher-color;
@secondary-color: #3086ED;

@ -1 +1 @@
Subproject commit b64262cb3bb5a5f326054771dcc03237b0957409
Subproject commit 074205f9dc1d40a26c6bf90dcc2fcd5ecf0733f3

View File

@ -1,9 +1,7 @@
/* You can add global styles to this file, and also import other style files */
/* Import Irish theme*/
@import "~src/assets/extend-theme/less/_import";
@import "~src/assets/common-assets/less/general";
@import "~src/assets/common";
@import "~src/assets/common-assets/less/user";
@import "~src/assets/common-assets/less/linking";
@import "~src/assets/common-assets/less/dashboard";
@import "~src/assets/common-assets/less/ckeditor";
@import "~src/assets/irish-monitor";