From 6c3d1c51273165ff350d78d89f5bc788c172d742 Mon Sep 17 00:00:00 2001 From: Alex Martzios Date: Wed, 4 May 2022 12:47:51 +0300 Subject: [PATCH] progress on organization landing - almost ready --- .../projects-in-modal.component.ts | 30 +- .../organization/organization.component.html | 656 ++++++++---------- .../organization/organization.component.ts | 27 +- .../organization/organization.module.ts | 10 +- 4 files changed, 337 insertions(+), 386 deletions(-) diff --git a/landingPages/landing-utils/projects-in-modal.component.ts b/landingPages/landing-utils/projects-in-modal.component.ts index 1be0379a..8d4ea3d4 100644 --- a/landingPages/landing-utils/projects-in-modal.component.ts +++ b/landingPages/landing-utils/projects-in-modal.component.ts @@ -9,17 +9,19 @@ import {StringUtils} from '../../utils/string-utils.class'; import {RouterHelper} from '../../utils/routerHelper.class'; import {EnvProperties} from '../../utils/properties/env-properties'; import {AlertModal} from "../../utils/modal/alert"; +import {OpenaireEntities} from '../../utils/properties/searchFields'; @Component({ selector: 'projectsInModal', template: ` -
-
Filter by Funder:
+
+
Filter by Funder:
  • @@ -28,21 +30,21 @@ import {AlertModal} from "../../utils/modal/alert";
    - - + + - - + +
    ` }) @@ -59,6 +61,8 @@ export class ProjectsInModalComponent { public errorCodes: ErrorCodes = new ErrorCodes(); private filterQuery: string = ""; + + public openaireEntities = OpenaireEntities; constructor(private route: ActivatedRoute, private _searchProjectsService: SearchProjectsService) { diff --git a/landingPages/organization/organization.component.html b/landingPages/organization/organization.component.html index bc1c4cac..ca76ea43 100644 --- a/landingPages/organization/organization.component.html +++ b/landingPages/organization/organization.component.html @@ -1,389 +1,303 @@ -
    -
    -
    -
    - - - - -
    -
    - - -
    - View all {{organizationInfo.deletedByInferenceIds.length}} - versions +
    +
    + +
    + +
    +
    + +
    +
    +
    +
    Actions
    +
    -
    - -
    - - - - - - -
    - - -
    -
    - - -
    - -
    -
    - -
    -
    - - -
    - -
    -
    - -
    -
    - - -
    - -
    -
    - -
    -
    - - -
    - -
    -
    - -
    -
    - - -
    - -
    -
    - -
    -
    - - -
    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    +
    + +
    + + +
    -
    - graph - Powered by OpenAIRE Research Graph - +
    + + + Powered by OpenAIRE Research Graph + + . Last update of records in OpenAIRE: {{indexUpdateDate | date: 'MMM dd, yyyy'}}
    - Any information missing or wrong? - Report an Issue + Anything wrong? + Report an Issue
    + +
    +
    -
    -
    - -
    -
    - + +
    + + + + + + + + + + View all {{organizationInfo.deletedByInferenceIds.length}} versions + + + + + + +
    + + + +
    + Country: {{organizationInfo.country}} +
    +
    +
    + +
    +
    + + + + + + + + + + + + + + + +
    +
    + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    +
    +
    +
    +
    + + +
    + + - - -
    - - -
    + + + - - - + + + - - -
    -
    -
    - - Select a funder to download report - - {{element.name}} - - - -
    - -
    -
    + + +
    +
    +
    +
      +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    +
    + No reports available +
    +
    +
    +
    +
    + + +
    +
    +
    +
    +
      +
    • + +
    • +
    • + +
    • +
    +
    +
    +
    - + diff --git a/landingPages/organization/organization.component.ts b/landingPages/organization/organization.component.ts index 6af678a2..d94fbf76 100644 --- a/landingPages/organization/organization.component.ts +++ b/landingPages/organization/organization.component.ts @@ -67,6 +67,7 @@ export class OrganizationComponent { @ViewChild('downloadReportModal') downloadReportModal; @ViewChild('downloadFunderReportModal') downloadFunderReportModal; + @ViewChild('addThisModal') addThisModal; @ViewChild(ModalLoading) loading: ModalLoading; // Alert box when CSV: Project Publications for a funder is requested @@ -91,6 +92,12 @@ export class OrganizationComponent { public funder: any = ""; private funderId: string; private funderCount: number; + + public offset: number; + public stickyHeader: boolean = false; + public graph_offset: number = 0; + @ViewChild("graph_and_feedback") graph_and_feedback; + subscriptions = []; innerReportSubscriptions = []; properties: EnvProperties; @@ -103,6 +110,7 @@ export class OrganizationComponent { public deleteByInferenceOpened: boolean = false; + constructor(private element: ElementRef, private _organizationService: OrganizationService, private _piwikService: PiwikService, @@ -161,11 +169,20 @@ export class OrganizationComponent { } this.csvParamsTail = '" and relorganizationid exact "' + this.organizationId + '" ))'; })); - this.downloadURLAPI = this.properties.csvAPIURL; //this.csvAffiliatedPublications = this.downloadURLAPI + "?format=csv&type=publications&fq=(((oaftype exact result) and (resulttypeid exact publication)) and (relorganizationid exact \"" + this.organizationId + "\"))"; this.csvProjectParamsHead = 'format=csv&type=projects&fq=((funder exact "'; //this.csvPublicationParamsHead = 'format=csv-special&type=publications&page=0&query=((((oaftype exact result) and (resulttypeid exact publication)) and (funderid exact '; + this.offset = Number.parseInt(getComputedStyle(document.documentElement).getPropertyValue('--navbar-height')); + } + + ngAfterContentChecked() { + if(this.graph_and_feedback && window) { + this.graph_offset = this.calcGraphOffset(); + } + } + calcGraphOffset() { + return window.innerHeight-this.graph_and_feedback.nativeElement.offsetHeight; } private getPageContents() { @@ -325,6 +342,7 @@ export class OrganizationComponent { } this.fetchProjects.getResultsForOrganizations(this.organizationId, "", 1, this.searchNumber, refineFields, this.properties); + // console.log(this.fetchProjects); this.showLoading = false; } }, @@ -631,6 +649,13 @@ export class OrganizationComponent { this.downloadFunderReportModal.cancel(); } + public openAddThisModal() { + this.addThisModal.cancelButton = false; + this.addThisModal.okButton = false; + this.addThisModal.alertTitle = "Share this organization in your social networks"; + this.addThisModal.open(); + } + public getParamsForSearchLink(type: string = "") { if(type) { return this.routerHelper.createQueryParams(['f0', 'fv0', 'type', 'qf', 'sortBy'], ['relorganizationid', this.organizationId, type, 'false', 'resultdateofacceptance,descending']); diff --git a/landingPages/organization/organization.module.ts b/landingPages/organization/organization.module.ts index 8d1f1225..e9dfc2d8 100644 --- a/landingPages/organization/organization.module.ts +++ b/landingPages/organization/organization.module.ts @@ -27,6 +27,11 @@ import {FeedbackModule} from "../feedback/feedback.module"; import {MatSelectModule} from "@angular/material/select"; import {TabsModule} from "../../utils/tabs/tabs.module"; import {SearchTabModule} from "../../utils/tabs/contents/search-tab.module"; +import {LoadingModule} from '../../utils/loading/loading.module'; +import {IconsModule} from '../../utils/icons/icons.module'; +import {InputModule} from '../../sharedComponents/input/input.module'; +import {IconsService} from '../../utils/icons/icons.service'; +import {graph} from "../../utils/icons/icons"; @NgModule({ @@ -45,7 +50,7 @@ import {SearchTabModule} from "../../utils/tabs/contents/search-tab.module"; Schema2jsonldModule, SEOServiceModule, HelperModule, OrganizationsDeletedByInferenceModule, LandingHeaderModule, FeedbackModule, MatSelectModule, - TabsModule, SearchTabModule + TabsModule, SearchTabModule, LoadingModule, IconsModule, InputModule ], declarations: [ OrganizationComponent, @@ -56,4 +61,7 @@ import {SearchTabModule} from "../../utils/tabs/contents/search-tab.module"; ] }) export class OrganizationModule { + constructor(private iconsService: IconsService) { + this.iconsService.registerIcons([graph]); + } }