[Connect|Trunk]

- SEO: initialize prev/next rel links
- use layout service (remove check for development)
- fix issue with private communities losing  the verify parameters

- fix hover on menu items that didn't get the portal colors




git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-connect-portal/trunk@61024 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
argiro.kokogiannaki 2021-05-19 11:17:13 +00:00
parent 94b39c0828
commit 2bce669d23
2 changed files with 18 additions and 16 deletions

View File

@ -20,10 +20,9 @@ import {LayoutService} from "./openaireLibrary/services/layout.service";
import {SmoothScroll} from "./openaireLibrary/utils/smooth-scroll";
import {Meta} from "@angular/platform-browser";
import {CommunityInfo} from "./openaireLibrary/connect/community/communityInfo";
import {SEOService} from "./openaireLibrary/sharedComponents/SEO/SEO.service";
@Component({
//changeDetection: ChangeDetectionStrategy.Default,
//encapsulation: ViewEncapsulation.Emulated,
selector: 'app-root',
styles: [`
`],
@ -103,7 +102,7 @@ export class AppComponent {
constructor(private route: ActivatedRoute, private propertiesService: EnvironmentSpecificService,
private _communitiesService: CommunitiesService, private smoothScroll: SmoothScroll,
private router: Router, private userManagementService: UserManagementService,
private configurationService: ConfigurationService, private _communityService: CommunityService, private _layoutService: LayoutService, private _meta: Meta) {
private configurationService: ConfigurationService, private _communityService: CommunityService, private _layoutService: LayoutService, private _meta: Meta, private seoService: SEOService) {
}
ngOnDestroy() {
@ -123,6 +122,8 @@ export class AppComponent {
if (this.properties.environment == "production" || this.properties.environment == "development") {
this.subscriptions.push(this.route.queryParams.subscribe(data => {
this._meta.updateTag({content: 'all', name: 'robots'});
this.seoService.removeLinkForPrevURL();
this.seoService.removeLinkForNextURL();
}));
}
this._communitiesService.updateCommunities(this.properties, this.properties.communitiesAPI);
@ -168,7 +169,7 @@ export class AppComponent {
this.configurationService.initCommunityInformation(this.properties, (communityId) ? communityId : this.properties.adminToolsPortalType);
}
initLayout(communityId){
if(!this.layout && this.properties.environment == "development") {
if(!this.layout) {
this._layoutService.getLayout(this.properties, communityId).subscribe(
layout => {
if (layout) {
@ -191,13 +192,6 @@ export class AppComponent {
if (!this.community || this.communityId !== communityId) {
this.subscriptions.push(this._communityService.getCommunity(communityId).subscribe(community => {
if (community) {
/* this.community = {
id: community.communityId,
name: (community.shortTitle) ? community.shortTitle : community.title,
logoUrl: (community.isUpload) ? (properties.utilsService + '/download/' + community.logoUrl) : (StringUtils.urlPrefix(community.logoUrl) + community.logoUrl),
description: community.description,
status: community.status
};*/
this.community = community;
}else{
this.community = null;
@ -240,7 +234,7 @@ export class AppComponent {
});
this.menuItems.push(
{
rootItem: new MenuItem("search", "Search", "", "/search/find", false, [], ["/search/find", "/search/find/publications", "/search/find/datasets", "/search/find/software", "/search/find/other", "/search/find/projects", "/search/find/dataproviders"], {}),
rootItem: new MenuItem("search", "Search", "", "/search/find", false, [], ["/search/find"], {}),
items: [
new MenuItem("", "Research outcomes", "", "/search/find/research-outcomes", false, [], ["/search/find/research-outcomes"], {}),
new MenuItem("", "Projects", "", "/search/find/projects/", false, ["project"], ["/search/find/projects"], {}),
@ -290,8 +284,8 @@ export class AppComponent {
this.initAdminToolCommunity(null);
this.buildConnectMenu(true);
if (this.community && this.community.status == "manager") {
if (!this.user && typeof location !== 'undefined') {
if(location.pathname.indexOf("user-info") == -1) {
if (!this.user ) {
if(typeof location !== 'undefined' && location.pathname.indexOf("user-info") == -1) {
this.router.navigate(['/user-info'], {
queryParams: {
"errorCode": LoginErrorCodes.NOT_LOGIN,
@ -300,7 +294,9 @@ export class AppComponent {
});
}
} else {
this.router.navigate(['/'], { queryParamsHandling: "merge" });
if(typeof location !== 'undefined' && location.pathname.indexOf("user-info") == -1) {
this.router.navigate(['/'], {queryParamsHandling: "merge"});
}
}
}else if (this.community && this.community.status == "hidden") {
this.router.navigate(['/error']);

View File

@ -78,14 +78,20 @@ a:not(.uk-button),
.uk-navbar-dropdown-nav>li>a:focus,
.uk-navbar-dropdown-nav>li>a:hover,
.uk-navbar-dropdown-nav>li>a:active,
.uk-navbar-nav>li>a:hover,
.uk-navbar-nav>li>a:focus,
.uk-navbar-nav>li>a:active,
.uk-navbar-nav>li:hover>a,
.uk-navbar-dropdown-nav>li.uk-active>a,
.uk-tab>.uk-active>a,
.uk-navbar-nav>li.uk-active>a,
.uk-navbar-container:not(.uk-navbar-transparent) .uk-navbar-nav>li.uk-active>a,
.uk-navbar-container:not(.uk-navbar-transparent) .uk-navbar-nav > li:hover > a,
.uk-navbar-container:not(.uk-navbar-transparent) .uk-navbar-nav > li:active > a,
.uk-navbar-container:not(.uk-navbar-transparent) .uk-navbar-nav > li:focus > a,
.uk-navbar-container:not(.uk-navbar-transparent) .uk-navbar-nav > li > a.uk-open,
.uk-navbar-nav > li > a.uk-open,
.uk-button-text
{
color: var(--portal-main-color) !important;