[master]: Fix links to search pages

This commit is contained in:
Konstantinos Triantafyllou 2024-04-18 12:02:41 +03:00
parent a834890ddb
commit 69550193c3
6 changed files with 8 additions and 12 deletions

View File

@ -218,5 +218,6 @@ export class RepositoryComponent extends StakeholderBaseComponent implements OnI
super.ngOnDestroy(); super.ngOnDestroy();
this.layoutService.setRootClass(null); this.layoutService.setRootClass(null);
this.setProperties(Irish.irishAdminToolsCommunity, Irish.irishAdminToolsPortalType, this.configurationService); this.setProperties(Irish.irishAdminToolsCommunity, Irish.irishAdminToolsPortalType, this.configurationService);
LinksResolver.resetProperties();
} }
} }

View File

@ -133,8 +133,6 @@ export class ResearcherComponent extends ResearcherBaseComponent implements OnI
LinksResolver.resetProperties(); LinksResolver.resetProperties();
LinksResolver.setSearchAndResultLanding("researcher/" + this.authorId); LinksResolver.setSearchAndResultLanding("researcher/" + this.authorId);
this.setMetadata(); this.setMetadata();
}, },
error: () => { error: () => {
this._router.navigate([properties.errorLink]); this._router.navigate([properties.errorLink]);
@ -178,6 +176,7 @@ export class ResearcherComponent extends ResearcherBaseComponent implements OnI
ngOnDestroy() { ngOnDestroy() {
super.ngOnDestroy(); super.ngOnDestroy();
this.layoutService.setRootClass(null); this.layoutService.setRootClass(null);
LinksResolver.resetProperties();
} }
getPercentage(){ getPercentage(){

View File

@ -146,6 +146,7 @@ export class RfoComponent extends StakeholderBaseComponent implements OnInit {
super.ngOnDestroy(); super.ngOnDestroy();
this.layoutService.setRootClass(null); this.layoutService.setRootClass(null);
this.setProperties(Irish.irishAdminToolsCommunity, Irish.irishAdminToolsPortalType, this.configurationService); this.setProperties(Irish.irishAdminToolsCommunity, Irish.irishAdminToolsPortalType, this.configurationService);
LinksResolver.resetProperties();
} }
get isManager() { get isManager() {

View File

@ -147,6 +147,7 @@ export class RpoComponent extends StakeholderBaseComponent implements OnInit {
super.ngOnDestroy(); super.ngOnDestroy();
this.layoutService.setRootClass(null); this.layoutService.setRootClass(null);
this.setProperties(Irish.irishAdminToolsCommunity, Irish.irishAdminToolsPortalType, this.configurationService); this.setProperties(Irish.irishAdminToolsCommunity, Irish.irishAdminToolsPortalType, this.configurationService);
LinksResolver.resetProperties();
} }
get isManager() { get isManager() {

View File

@ -58,17 +58,12 @@ export class LinksResolver {
errorLink: properties.errorLink errorLink: properties.errorLink
}; };
public static setDefaultProperties(alias: string) {
Object.keys(this.default).forEach(field => {
this.default[field] = "/" + alias + (<string>this.default[field]);
});
}
public static setProperties(alias: string) { public static setProperties(alias: string) {
Object.keys(this.default).forEach(field => { Object.keys(this.default).forEach(field => {
properties[field] = "/" + alias + (<string>this.default[field]); properties[field] = "/" + alias + (<string>this.default[field]);
}); });
} }
public static setSearchAndResultLanding(alias: string) { public static setSearchAndResultLanding(alias: string) {
properties.searchLinkToResult= "/" + alias + this.default.searchLinkToResult; properties.searchLinkToResult= "/" + alias + this.default.searchLinkToResult;
properties.searchLinkToPublication= "/" + alias + this.default.searchLinkToPublication; properties.searchLinkToPublication= "/" + alias + this.default.searchLinkToPublication;
@ -82,9 +77,8 @@ export class LinksResolver {
properties.searchLinkToAdvancedOrps= "/" + alias + this.default.searchLinkToAdvancedOrps; properties.searchLinkToAdvancedOrps= "/" + alias + this.default.searchLinkToAdvancedOrps;
} }
public static resetProperties() { public static resetProperties() {
Object.keys(this.default).forEach(field => { this.setProperties('national/');
properties[field] = this.default[field];
});
} }
} }

View File

@ -13,7 +13,7 @@ export class Irish {
public portal: Portal = Portal.getMockCommunityInfo("noami", "Noami",['service'],['/search/advanced/services', '/search/find/services']); public portal: Portal = Portal.getMockCommunityInfo("noami", "Noami",['service'],['/search/advanced/services', '/search/find/services']);
constructor() { constructor() {
LinksResolver.setDefaultProperties('national/'); LinksResolver.resetProperties();
StakeholderConfiguration.ROLES.manager = 'primary dashboard manager'; StakeholderConfiguration.ROLES.manager = 'primary dashboard manager';
StakeholderConfiguration.ROLES.member = 'manager'; StakeholderConfiguration.ROLES.member = 'manager';