Merge branch 'angular-14' into explore-redesign

This commit is contained in:
Alex Martzios 2023-02-08 11:42:22 +02:00
commit 6551fc73d3
4 changed files with 31 additions and 12 deletions

View File

@ -1,18 +1,16 @@
<aside id="sidebar_main">
<div sidebar-content>
<div *ngIf="items.length > 0" class="menu_section uk-margin-large-top" style="min-height: 30vh">
<div *ngIf="items.length > 0" class="menu_section mobile uk-margin-large-top" style="min-height: 30vh">
<ul #nav class="uk-list uk-nav uk-nav-default uk-nav-parent-icon" uk-nav="duration: 400">
<ng-template ngFor [ngForOf]="items" let-item>
<li [class.uk-active]="isTheActiveMenuItem(item)"
[class.uk-parent]="item.items.length > 0">
<a [routerLink]="getItemRoute(item)" [title]="item.title"
[queryParams]="item.route?item.params:null" [queryParamsHandling]="item.route?queryParamsHandling:null">
<div class="uk-flex uk-flex-middle">
[queryParams]="item.route?item.params:null" [queryParamsHandling]="item.route?queryParamsHandling:null" class="uk-flex uk-flex-middle">
<div *ngIf="item.icon && (item.icon.svg || item.icon.name)" class="uk-width-auto">
<icon class="menu-icon" [customClass]="item.icon.class" [name]="item.icon.name" ratio="0.9" [svg]="item.icon.svg" [flex]="true"></icon>
</div>
<span [class.hide-on-close]="item.icon" class="uk-width-expand uk-text-truncate uk-margin-small-left">{{item.title}}</span>
</div>
<span [class.hide-on-close]="item.icon" class="uk-width-expand@l uk-text-truncate uk-margin-small-left">{{item.title}}</span>
</a>
<ul *ngIf="item.items?.length > 0 && (isBrowser || isTheActiveMenuItem(item))" class="uk-nav-sub">
<li *ngFor="let subItem of item.items"

View File

@ -13,4 +13,6 @@ export class SliderTabComponent {
public active: boolean = false;
@Input()
public disabled: boolean = false;
@Input()
public align: 'left' | 'right' = 'left';
}

View File

@ -27,13 +27,23 @@ declare var UIkit;
[attr.uk-tab]="type === 'static'?('connect:' + connect):null"
[ngClass]="'uk-flex-' + flexPosition">
<ng-container *ngIf="type === 'static'">
<li *ngFor="let tab of tabs.toArray()" class="uk-text-capitalize">
<li *ngFor="let tab of leftTabs" class="uk-text-capitalize">
<a>{{tab.title}}</a>
</li>
<li *ngFor="let tab of rightTabs; let i=index;"
[ngClass]="i === 0?'uk-flex-1 uk-flex uk-flex-right':''"
class="uk-text-capitalize">
<a>{{tab.title}}</a>
</li>
</ng-container>
<ng-container *ngIf="type === 'scrollable'">
<li *ngFor="let tab of tabs.toArray()" class="uk-text-capitalize" [class.uk-active]="tab.active">
<a routerLink="./" [fragment]="tab.id">{{tab.title}}</a>
<li *ngFor="let tab of leftTabs" class="uk-text-capitalize" [class.uk-active]="tab.active">
<a routerLink="./" [fragment]="tab.id" queryParamsHandling="merge">{{tab.title}}</a>
</li>
<li *ngFor="let tab of rightTabs; let i=index;" class="uk-text-capitalize"
[ngClass]="i === 0?'uk-flex-1 uk-flex uk-flex-right':''"
[class.uk-active]="tab.active">
<a routerLink="./" [fragment]="tab.id" queryParamsHandling="merge">{{tab.title}}</a>
</li>
</ng-container>
</ul>
@ -126,7 +136,7 @@ export class SliderTabsComponent implements AfterViewInit, OnDestroy {
let index = event.detail[0].index();
if (index !== this.activeIndex) {
this.activeIndex = index;
this.router.navigate(['./'], {relativeTo: this.route, fragment: this.connect.replace('#', '')});
this.router.navigate(['./'], {relativeTo: this.route, fragment: this.connect.replace('#', ''), queryParamsHandling: "merge"});
}
}));
}
@ -153,7 +163,8 @@ export class SliderTabsComponent implements AfterViewInit, OnDestroy {
this.router.navigate(['./'], {
fragment: entry.target.id,
relativeTo: this.route,
state: {disableScroll: true}
state: {disableScroll: true},
queryParamsHandling: 'merge'
});
}, 200);
}
@ -186,6 +197,14 @@ export class SliderTabsComponent implements AfterViewInit, OnDestroy {
this.cdr.detectChanges();
}
get leftTabs(): SliderTabComponent[] {
return this.tabs.toArray().filter(tab => tab.align === 'left');
}
get rightTabs(): SliderTabComponent[] {
return this.tabs.toArray().filter(tab => tab.align === 'right');
}
ngOnDestroy() {
this.subscriptions.forEach(subscription => {
if (subscription instanceof Subscription) {

View File

@ -107,14 +107,14 @@ export class ISVocabulariesService {
getLocalVocabularyFromService(vocabularyName: string, properties: EnvProperties): Observable<AutoCompleteValue[]> {
if(vocabularyName == "sdg"){
let url = properties.domain+"/assets/vocabulary/sdg.json";
let url = properties.domain+"/assets/common-assets/vocabulary/sdg.json";
return this.http.get((properties.useLongCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url)
//.map(res => <any> res.json())
.pipe(map(res => res['sdg']))
.pipe(map(res => this.parseSDGs(res)))
.pipe(catchError(this.handleError));
}else if( vocabularyName == "fos"){
let url = properties.domain+"/assets/vocabulary/fos.json";
let url = properties.domain+"/assets/common-assets/vocabulary/fos.json";
return this.http.get((properties.useLongCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url)
//.map(res => <any> res.json())
.pipe(map(res => res['fos']))