diff --git a/claims/claim-utils/claimContextSearchForm.component.html b/claims/claim-utils/claimContextSearchForm.component.html index e8430153..892164dc 100644 --- a/claims/claim-utils/claimContextSearchForm.component.html +++ b/claims/claim-utils/claimContextSearchForm.component.html @@ -2,39 +2,22 @@
- -
-
-
- - - - - - -
+
+ +
+
+
-
@@ -185,8 +168,7 @@ - +

- - - -
- -
diff --git a/claims/claim-utils/claimContextSearchForm.component.ts b/claims/claim-utils/claimContextSearchForm.component.ts index 9584455c..620879e8 100644 --- a/claims/claim-utils/claimContextSearchForm.component.ts +++ b/claims/claim-utils/claimContextSearchForm.component.ts @@ -1,11 +1,12 @@ import {Component, Input} from '@angular/core'; import {Router} from '@angular/router'; import {ContextsService} from './service/contexts.service'; -import {ClaimEntity} from './claimHelper.class'; +import {ClaimEntity, ShowOptions} from './claimHelper.class'; import {Session} from '../../login/utils/helper.class'; import {LoginErrorCodes} from '../../login/utils/guardHelper.class'; import {EnvProperties} from '../../utils/properties/env-properties'; import {Subscriber} from "rxjs"; +import {OpenaireEntities} from "../../utils/properties/searchFields"; declare var UIkit: any; @@ -21,7 +22,7 @@ export class ClaimContextSearchFormComponent { @Input() communityId: string = null; @Input() public inlineClaim: boolean = false; @Input() basketLimit; - @Input() showOptions; + @Input() showOptions:ShowOptions; public selectedCommunityId: string = "0"; public selectedCategoryId: string = "0"; @@ -39,10 +40,12 @@ export class ClaimContextSearchFormComponent { public loading: boolean = false; public error: boolean = false; @Input() localStoragePrefix: string = ""; - + openaireEntities = OpenaireEntities; + entitiesSelectOptions; keyword = ""; subscriptions = []; ngOnInit() { + this.entitiesSelectOptions = this.showOptions.selectOptions; this.getCommunities(); } ngOnDestroy() { diff --git a/claims/claim-utils/claimContextSearchForm.module.ts b/claims/claim-utils/claimContextSearchForm.module.ts index 8d9c390a..2b32cd17 100644 --- a/claims/claim-utils/claimContextSearchForm.module.ts +++ b/claims/claim-utils/claimContextSearchForm.module.ts @@ -6,12 +6,14 @@ import { ClaimContextSearchFormComponent } from './claimContextSearchForm.compon import { RouterModule } from '@angular/router'; import {HelperModule} from '../../utils/helper/helper.module'; import {ClaimProjectsSearchFormModule} from "./claimProjectSearchForm.module"; +import {AdvancedSearchInputModule} from "../../sharedComponents/advanced-search-input/advanced-search-input.module"; +import {InputModule} from "../../sharedComponents/input/input.module"; @NgModule({ imports: [ SharedModule, RouterModule, StaticAutocompleteModule, - HelperModule, ClaimProjectsSearchFormModule + HelperModule, ClaimProjectsSearchFormModule, AdvancedSearchInputModule, InputModule ], declarations: [ diff --git a/claims/claim-utils/claimHelper.class.ts b/claims/claim-utils/claimHelper.class.ts index bc72ecee..8ee3fe6a 100644 --- a/claims/claim-utils/claimHelper.class.ts +++ b/claims/claim-utils/claimHelper.class.ts @@ -1,5 +1,6 @@ //Classes used in linking / inlinelinking when selecting an entity import {HelperFunctions} from "../../utils/HelperFunctions.class"; +import {OpenaireEntities} from "../../utils/properties/searchFields"; export class ClaimResult { public source: string; @@ -144,7 +145,7 @@ export class ShowOptions { linkToEntities: string[]; // show linkToEntities /values: result, project, context basketShowSources: boolean = true; basketShowLinksTo: boolean = false; - + selectOptions= []; constructor() { this.show = "source"; this.linkTo = "project"; @@ -174,5 +175,17 @@ export class ShowOptions { } - + initSelectOptions(){ + let options =[]; + if(this.linkToEntities.indexOf('result')!=-1){ + options.push({value: 'result',label: OpenaireEntities.RESULTS}) + } + if(this.linkToEntities.indexOf('project')!=-1){ + options.push({value: 'project',label: OpenaireEntities.PROJECTS}) + } + if(this.linkToEntities.indexOf('context')!=-1){ + options.push({value: 'context',label: OpenaireEntities.COMMUNITIES}) + } + this.selectOptions = options; + } } diff --git a/claims/claim-utils/claimProjectSearchForm.component.html b/claims/claim-utils/claimProjectSearchForm.component.html index d3fdcaa5..8cce8ca6 100644 --- a/claims/claim-utils/claimProjectSearchForm.component.html +++ b/claims/claim-utils/claimProjectSearchForm.component.html @@ -1,23 +1,13 @@ -
- - -
- - - -
- - - - -
+
+ +
+
+
+
No project results yet...
Start - searching for projects to add them in the Basket + searching for {{openaireEntities.PROJECTS.toLowerCase()}} to add them in the Basket
@@ -125,25 +115,10 @@ role="alert">
-
-
-
-
- {{openaireResultsNum|number}} - projects, page - {{openaireResultsPage | number}} - of - {{(totalPages(openaireResultsNum)|number)}} -
-
- + -
-
-
diff --git a/claims/claim-utils/claimProjectSearchForm.component.ts b/claims/claim-utils/claimProjectSearchForm.component.ts index 42a56e55..bd2678f8 100644 --- a/claims/claim-utils/claimProjectSearchForm.component.ts +++ b/claims/claim-utils/claimProjectSearchForm.component.ts @@ -7,7 +7,7 @@ import {ErrorCodes} from '../../utils/properties/errorCodes'; import {StringUtils} from "../../utils/string-utils.class"; import {Filter, Value} from "../../searchPages/searchUtils/searchHelperClasses.class"; import {RangeFilter} from "../../utils/rangeFilter/rangeFilterHelperClasses.class"; -import {SearchFields} from "../../utils/properties/searchFields"; +import {OpenaireEntities, SearchFields} from "../../utils/properties/searchFields"; import {NewSearchPageComponent} from "../../searchPages/searchUtils/newSearchPage.component"; import {Subscriber} from "rxjs"; @@ -20,20 +20,10 @@ declare var UIkit:any; }) export class ClaimProjectsSearchFormComponent { - ngOnInit() { - // this.getFunders(); - // this.search(this.page, this.size); - } - // @ViewChild (ModalLoading) loading : ModalLoading ; - - // @Input() public inline: boolean = false ; // for claimed started from landing pages public query = ''; @Input() public selectedProjects:ClaimEntity[]=[] ; public elementRef; - // public funders:string[]; - // public selectedFunderId:string ="0"; - // selectedFunderName:string ="Select funder:"; @Output() projectSelected = new EventEmitter(); @Input() public properties:EnvProperties; @Input() public inlineClaim:boolean=false; @@ -53,23 +43,20 @@ export class ClaimProjectsSearchFormComponent { keyword:string = ''; showResults = false; - // public openaireRefineFields: string[] = ["relfunder", "relproject", "resultbestaccessright", "instancetypename", "resultlanguagename", "community"]; - // public openaireRefineFieldsQuery: string = "&refine=true&fields=funder&fields=projectstartyear&fields=projectendyear&fields=projectecsc39"; public refineFields: string[] = ["funder"]; public refineFieldsQuery: string = "&refine=true&fields=funder"; filters = []; prevFilters = []; - // startYear = ""; - // endYear = ""; public rangeFilters: RangeFilter[] = []; public searchFields: SearchFields = new SearchFields(); public rangeFields:string[][] = this.searchFields.PROJECT_RANGE_FIELDS; + openaireEntities = OpenaireEntities; + sub; constructor(private _service: ProjectService, private _projectService: SearchProjectsService, myElement: ElementRef) { this.elementRef = myElement; this.rangeFilters = RangeFilter.parse(this.rangeFields,"project"); } - sub; ngOnDestroy() { if (this.sub instanceof Subscriber) { this.sub.unsubscribe(); diff --git a/claims/claim-utils/claimProjectSearchForm.module.ts b/claims/claim-utils/claimProjectSearchForm.module.ts index 4ce1326e..a574c10d 100644 --- a/claims/claim-utils/claimProjectSearchForm.module.ts +++ b/claims/claim-utils/claimProjectSearchForm.module.ts @@ -18,13 +18,15 @@ import {SearchFilterModule} from '../../searchPages/searchUtils/searchFilter.mod import {RangeFilterModule} from "../../utils/rangeFilter/rangeFilter.module"; import {ClaimEntitiesSelectionComponent} from "./claimEntitiesSelection.component"; import {MatSelectModule} from "@angular/material/select"; +import {AdvancedSearchInputModule} from "../../sharedComponents/advanced-search-input/advanced-search-input.module"; +import {InputModule} from "../../sharedComponents/input/input.module"; @NgModule({ imports: [ SharedModule, CommonModule, // LoadingModalModule, ProjectServiceModule, ProjectsServiceModule, EntitiesAutocompleteModule, HelperModule, - PagingModule, SearchFilterModule, ClaimResultsModule, RangeFilterModule, MatSelectModule + PagingModule, SearchFilterModule, ClaimResultsModule, RangeFilterModule, MatSelectModule, AdvancedSearchInputModule, InputModule ], providers:[ ], diff --git a/claims/claim-utils/claimResultSearchForm.component.html b/claims/claim-utils/claimResultSearchForm.component.html index d911461d..de94aae9 100644 --- a/claims/claim-utils/claimResultSearchForm.component.html +++ b/claims/claim-utils/claimResultSearchForm.component.html @@ -1,26 +1,15 @@ -
- +
+ +
+
+
+
+
+
+
-
- - - -
- - - - - - -
No sources yet...
Use the searchbar and find linking sources. @@ -55,25 +44,7 @@
- -
- + +
@@ -94,55 +67,7 @@
- @@ -195,8 +120,8 @@ role="alert">Loading...
-
- +
@@ -245,9 +170,9 @@
No results found
+ class="uk uk-flex uk-flex-center"> - @@ -273,8 +198,8 @@
-
- +
diff --git a/claims/claim-utils/claimResultSearchForm.component.ts b/claims/claim-utils/claimResultSearchForm.component.ts index 45d4922c..fa31b7a2 100644 --- a/claims/claim-utils/claimResultSearchForm.component.ts +++ b/claims/claim-utils/claimResultSearchForm.component.ts @@ -11,7 +11,7 @@ import {Filter, Value} from "../../searchPages/searchUtils/searchHelperClasses.c import {forkJoin, Observable, Subscriber} from 'rxjs'; import {NewSearchPageComponent} from "../../searchPages/searchUtils/newSearchPage.component"; import {RangeFilter} from "../../utils/rangeFilter/rangeFilterHelperClasses.class"; -import {SearchFields} from "../../utils/properties/searchFields"; +import {OpenaireEntities, SearchFields} from "../../utils/properties/searchFields"; @Component({ selector: 'claim-result-search-form', templateUrl: 'claimResultSearchForm.component.html', @@ -30,7 +30,7 @@ export class ClaimResultSearchFormComponent { @Input() localStoragePrefix: string = ""; @Input() basketLimit; @Input() showOptions; - + openaireEntities = OpenaireEntities; public errorCodes: ErrorCodes = new ErrorCodes(); dataciteResults: ClaimEntity[] = []; diff --git a/claims/claim-utils/claimResultSearchForm.module.ts b/claims/claim-utils/claimResultSearchForm.module.ts index 34f19c5f..1b658113 100644 --- a/claims/claim-utils/claimResultSearchForm.module.ts +++ b/claims/claim-utils/claimResultSearchForm.module.ts @@ -18,10 +18,13 @@ import {SearchFilterModule} from '../../searchPages/searchUtils/searchFilter.mod import {QuickSelectionsModule} from "../../searchPages/searchUtils/quick-selections.module"; import {RangeFilterModule} from "../../utils/rangeFilter/rangeFilter.module"; import {ClaimProjectsSearchFormModule} from "./claimProjectSearchForm.module"; +import {AdvancedSearchInputModule} from "../../sharedComponents/advanced-search-input/advanced-search-input.module"; +import {InputModule} from "../../sharedComponents/input/input.module"; +import {SearchInputModule} from "../../sharedComponents/search-input/search-input.module"; @NgModule({ imports: [SharedModule, CommonModule, SearchResearchResultsServiceModule, PagingModule, SearchCrossrefServiceModule, - SearchDataciteServiceModule, HelperModule, SearchFilterModule, ClaimResultsModule, MatSelectModule, QuickSelectionsModule, RangeFilterModule, ClaimProjectsSearchFormModule], + SearchDataciteServiceModule, HelperModule, SearchFilterModule, ClaimResultsModule, MatSelectModule, QuickSelectionsModule, RangeFilterModule, ClaimProjectsSearchFormModule, AdvancedSearchInputModule, InputModule, SearchInputModule], providers:[ SearchOrcidService ], diff --git a/claims/linking/linkingGeneric.component.ts b/claims/linking/linkingGeneric.component.ts index 5e736303..636c9f96 100644 --- a/claims/linking/linkingGeneric.component.ts +++ b/claims/linking/linkingGeneric.component.ts @@ -60,6 +60,7 @@ export class LinkingGenericComponent { this.breadcrumbs.push({name: "Link", route: null}); } this.showOptions.show = 'source'; + this.showOptions.initSelectOptions(); if(this.inlineEntity){ this.showOptions.showLinkTo(); // this.showOptions.basketShowLinksTo = true;