[angular-16-irish-monitor | WIP | CHANGED]: Changed checks for irish portal (use properties.dashboard - properties.adminToolsPortalType will be "country")

1. env-properties.ts: Added in Dashboard "irish" type and changed "irish" to "country" in PortalType.
2. connectHelper.ts & resultLanding.service.ts & manageStakeholders.component.html & indicators.component.ts & orcid-work.component.ts & entitiesSelection.component.ts & result-preview.component.ts: Updated check to properties.dashboard != "irish".
3. portalHelper.ts: Added "country" option in portalTypes.
This commit is contained in:
Konstantina Galouni 2024-01-09 11:33:46 +02:00
parent 070ae45480
commit c202b7671b
9 changed files with 12 additions and 11 deletions

View File

@ -6,7 +6,7 @@ import {CommunityInfo} from "./community/communityInfo";
export class ConnectHelper {
public static getCommunityFromDomain(domain: string): string{
if(properties.adminToolsPortalType === 'irish') {
if(properties.dashboard === 'irish') {
return properties.adminToolsCommunity;
}
if(properties.environment == "development" &&

View File

@ -12,6 +12,7 @@ export class PortalUtils {
{value: 'ri', label: StakeholderConfiguration.ENTITIES.ri + ' ' + StakeholderConfiguration.ENTITIES.stakeholder},
{value: 'organization', label: StakeholderConfiguration.ENTITIES.organization + ' ' + StakeholderConfiguration.ENTITIES.stakeholder},
{value: 'project', label: StakeholderConfiguration.ENTITIES.project + ' ' + StakeholderConfiguration.ENTITIES.stakeholder},
{value: 'country', label: StakeholderConfiguration.ENTITIES.country + ' ' + StakeholderConfiguration.ENTITIES.stakeholder},
];
}

View File

@ -338,7 +338,7 @@ export class ResultLandingService {
if (this.resultLandingInfo.fos) {
this.resultLandingInfo.fos.sort((a, b) => a.id.localeCompare(b.id));
}
if(properties.adminToolsPortalType != "irish") {
if(properties.dashboard != "irish") {
this.resultLandingInfo.sdg = subjectResults[4];
if (this.resultLandingInfo.sdg) {
this.resultLandingInfo.sdg.sort((a, b) => {

View File

@ -11,8 +11,8 @@
</div>
<div actions>
<div class="uk-section-xsmall">
<div class="uk-flex uk-flex-center uk-flex-wrap uk-flex-middle" [ngClass]="properties.adminToolsPortalType == 'irish' ? 'uk-flex-between@m' : 'uk-flex-right@m'">
<div *ngIf="properties.adminToolsPortalType == 'irish'" class="uk-width-medium uk-margin-small-bottom">
<div class="uk-flex uk-flex-center uk-flex-wrap uk-flex-middle" [ngClass]="properties.dashboard == 'irish' ? 'uk-flex-between@m' : 'uk-flex-right@m'">
<div *ngIf="properties.dashboard == 'irish'" class="uk-width-medium uk-margin-small-bottom">
<div input type="select" placeholder="Type"
[options]="typeOptions" [formInput]="filters.get('type')">
</div>

View File

@ -1199,7 +1199,7 @@ export class IndicatorsComponent extends IndicatorStakeholderBaseComponent imple
}
private checkForSchemaEnhancements(url: string) {
this.showCheckForSchemaEnhancements = this.isAdministrator && url && !this.properties.useOldStatisticsSchema && this.indicatorUtils.checkForSchemaEnhancements(url) && this.properties.adminToolsPortalType != 'irish';
this.showCheckForSchemaEnhancements = this.isAdministrator && url && !this.properties.useOldStatisticsSchema && this.indicatorUtils.checkForSchemaEnhancements(url) && this.properties.dashboard != 'irish';
}
migrateFromOldImportJsonFile(charts) {

View File

@ -403,7 +403,7 @@ export class OrcidWorkComponent {
}, error => {
this.isLoggedIn = false;
}));
if(properties.adminToolsPortalType == 'irish'){
if(properties.dashboard == 'irish'){
this.subscriptions.push(this._userProfileService.getUserProfile().subscribe(userProfile => {
this.hasConsent = userProfile.consent;
}, error =>{
@ -531,7 +531,7 @@ export class OrcidWorkComponent {
}
});
} else {
if(properties.adminToolsPortalType == 'irish' && !this.hasConsent){
if(properties.dashboard == 'irish' && !this.hasConsent){
this._router.navigate(['/consent'], {
queryParams: {
"errorCode": LoginErrorCodes.NOT_VALID,

View File

@ -107,7 +107,7 @@ export class EntitiesSelectionComponent {
} else if ((this.customFilter && this.customFilter.queryFieldName == "community") ||
(this.customFilter && (this.customFilter.queryFieldName == "relfunder" || this.customFilter.queryFieldName == "funder")) ||
(this.customFilter && this.customFilter.queryFieldName == "relorganizationid")
|| this.properties.adminToolsPortalType == "irish") {
|| this.properties.dashboard == "irish") {
this.entities.push({label: OpenaireEntities.RESULTS, value: 'result'});
this.entities.push({label: OpenaireEntities.PROJECTS, value: 'project'});
this.entities.push({label: OpenaireEntities.ORGANIZATIONS, value: 'organization'});

View File

@ -1,6 +1,6 @@
export type Environment = "development" | "test" | "beta" | "production";
export type Dashboard = "explore" | "connect" | "monitor" | "aggregator" | "eosc" | "developers" | "faircore4eosc";
export type PortalType = "explore" | "connect" | "community" | "monitor" | "funder" | "ri" | "project" | "organization" | "aggregator" | "eosc" | "faircore4eosc" | "irish";
export type Dashboard = "explore" | "connect" | "monitor" | "aggregator" | "eosc" | "developers" | "faircore4eosc" | "irish";
export type PortalType = "explore" | "connect" | "community" | "monitor" | "funder" | "ri" | "project" | "organization" | "aggregator" | "eosc" | "faircore4eosc" | "country";
export interface EnvProperties {
environment?: Environment;

View File

@ -126,7 +126,7 @@ export class ResultPreviewComponent implements OnInit, OnChanges {
this.linking = true;
this.share = true;
this.cite = true;
this.orcid = (this.properties.adminToolsPortalType == 'explore' || this.properties.adminToolsPortalType == 'community' || this.properties.adminToolsPortalType == 'aggregator' || this.properties.adminToolsPortalType == 'irish') &&
this.orcid = (this.properties.adminToolsPortalType == 'explore' || this.properties.adminToolsPortalType == 'community' || this.properties.adminToolsPortalType == 'aggregator' || this.properties.dashboard == 'irish') &&
this.showOrcid && this.result.identifiers && this.result.identifiers.size > 0;
}