+
+
+
+
Last update
Last update
diff --git a/sharedComponents/input/input.component.ts b/sharedComponents/input/input.component.ts
index bf6b2f09..1f25ab47 100644
--- a/sharedComponents/input/input.component.ts
+++ b/sharedComponents/input/input.component.ts
@@ -219,7 +219,7 @@ export class InputComponent implements OnInit, OnDestroy, AfterViewInit, OnChang
public searchControl: UntypedFormControl;
public activeElement: BehaviorSubject = new BehaviorSubject(null);
/** Use modifier's class(es) to change view of your Input */
- @Input() inputClass: string = 'inner';
+ @Input() inputClass: string = 'flat';
/** Icon on the input */
@Input() icon: string = null;
/** Chip options */
diff --git a/sharedComponents/navigationBar.component.html b/sharedComponents/navigationBar.component.html
index 9e42254f..611a4716 100644
--- a/sharedComponents/navigationBar.component.html
+++ b/sharedComponents/navigationBar.component.html
@@ -12,8 +12,8 @@
-
diff --git a/sharedComponents/navigationBar.component.ts b/sharedComponents/navigationBar.component.ts
index a24eb2d0..4f3cf8e4 100644
--- a/sharedComponents/navigationBar.component.ts
+++ b/sharedComponents/navigationBar.component.ts
@@ -8,6 +8,7 @@ import {Subscription} from 'rxjs';
import {HelpContentService} from '../services/help-content.service';
import {properties} from "../../../environments/environment";
import {LayoutService} from "../dashboard/sharedComponents/sidebar/layout.service";
+import {NotificationConfiguration} from "../notifications/notifications-sidebar/notifications-sidebar.component";
declare var UIkit;
@@ -48,6 +49,7 @@ export class NavigationBarComponent implements OnInit, OnDestroy, OnChanges {
@Input() searchRoute: string = '/search/find';
@Input() searchPlaceHolder: string = 'Search for research results';
@Input() showLogo: boolean = true;
+ @Input() notificationConfiguration: NotificationConfiguration;
replaceHeader: boolean = false;
public activeHeader: Header;
keyword: string = '';
diff --git a/sharedComponents/tabs/slider-tabs.component.ts b/sharedComponents/tabs/slider-tabs.component.ts
index 6c420987..59149387 100644
--- a/sharedComponents/tabs/slider-tabs.component.ts
+++ b/sharedComponents/tabs/slider-tabs.component.ts
@@ -27,21 +27,21 @@ declare var UIkit;
[attr.uk-switcher]="type === 'static'?('connect:' + connect):null"
[ngClass]="'uk-flex-' + flexPosition + ' ' + tabsClass">
-
+
{{tab.title}}
-
{{tab.title}}
-
+
{{tab.title}}
-
-
+
{{tab.title}}
-
{{tab.title}}
@@ -206,6 +206,7 @@ export class SliderTabsComponent implements AfterViewInit, OnDestroy {
public showActive(index) {
this.activeIndex = index;
+ this.activeEmitter.emit(this.tabs.get(this.activeIndex).id);
if(this.slider) {
this.slider.show(this.activeIndex);
}
diff --git a/utils/full-page-slider/full-page-slider.module.ts b/utils/full-page-slider/full-page-slider.module.ts
index 5931bef7..1dd8a466 100644
--- a/utils/full-page-slider/full-page-slider.module.ts
+++ b/utils/full-page-slider/full-page-slider.module.ts
@@ -4,16 +4,10 @@ import {FullPageSliderComponent} from "./full-page-slider.component";
import {SlideComponent} from "./slide.component";
import {BottomModule} from '../../sharedComponents/bottom.module';
import {IconsModule} from '../icons/icons.module';
-import {IconsService} from '../icons/icons.service';
-import {arrow_down, arrow_up} from '../icons/icons';
@NgModule({
imports: [CommonModule, BottomModule, IconsModule],
declarations: [FullPageSliderComponent, SlideComponent],
exports: [FullPageSliderComponent, SlideComponent],
})
-export class FullPageSliderModule {
- constructor(private iconsService: IconsService) {
- this.iconsService.registerIcons([arrow_up, arrow_down]);
- }
-}
+export class FullPageSliderModule {}
diff --git a/utils/modal/alert.ts b/utils/modal/alert.ts
index 8f7fada7..d43ab3f2 100644
--- a/utils/modal/alert.ts
+++ b/utils/modal/alert.ts
@@ -157,7 +157,7 @@ export class AlertModal implements OnInit, AfterViewInit, OnDestroy {
}
ngAfterViewInit() {
- if(this.element) {
+ if(this.element && typeof document !== "undefined") {
this.subscriptions.push(UIkit.util.on(document, 'hide', '#' + this.id, () => {
this.cancelOutput.emit(true);
}));
diff --git a/utils/number-utils.class.ts b/utils/number-utils.class.ts
index 61054a75..4e17cfb1 100644
--- a/utils/number-utils.class.ts
+++ b/utils/number-utils.class.ts
@@ -1,5 +1,5 @@
export enum Level {
- NONE,
+ ALL,
K,
M,
B
@@ -14,7 +14,8 @@ export interface NumberSize {
export class NumberUtils {
- public static roundNumber(num: number, level: Level = Level.NONE, decimal = 0): any {
+ public static roundNumber(num: number | string, level: Level = Level.ALL, decimal = 0): any {
+ num = Number.parseFloat(num.toString());
let roundNum: NumberSize;
let initialNum = num;
let variance = Math.pow(10, decimal);
@@ -30,11 +31,6 @@ export class NumberUtils {
num = num / 1000;
num = Math.round(num * variance) / variance;
roundNum = {number: num, size: "K", count: initialNum};
- } else if (num >= 100) {
- num = num / 100;
- num = Math.round(num * variance) / variance;
- num = num * 100;
- roundNum = {number: num, size: "", count: initialNum};
} else {
roundNum = {number: num, size: "", count: initialNum};
}
diff --git a/utils/pipes/number-round.pipe.ts b/utils/pipes/number-round.pipe.ts
index 62608761..b42a93aa 100644
--- a/utils/pipes/number-round.pipe.ts
+++ b/utils/pipes/number-round.pipe.ts
@@ -5,19 +5,24 @@ import {DecimalPipe} from "@angular/common";
@Pipe({name: 'numberRound'})
export class NumberRoundPipe implements PipeTransform {
decimalPipe: DecimalPipe = new DecimalPipe("en");
-
- constructor() {}
-
- transform(value: number, ...args: any[]): any {
- let level = Level.NONE;
+
+ constructor() {
+ }
+
+ /**
+ * Args: Level: 0 (default): ALL, 1: K, 2: M, 3:B
+ * Decimal: how many decimals should be shown (e.g 1 -> 62.1)
+ * */
+ transform(value: number | string, ...args: any[]): any {
+ let level = Level.ALL;
let decimal = 0;
- if(args[0]) {
+ if (args[0]) {
level = args[0];
}
- if(args[1]) {
+ if (args[1]) {
decimal = args[1];
}
let size: NumberSize = NumberUtils.roundNumber(value, level, decimal);
- return this.decimalPipe.transform(size.number) + (size.size?'' + size.size + '':'');
+ return this.decimalPipe.transform(size.number) + (size.size ? '' + size.size + '' : '');
}
}
diff --git a/utils/staticAutoComplete/ISVocabularies.service.ts b/utils/staticAutoComplete/ISVocabularies.service.ts
index 295ba7d6..e635b8ec 100644
--- a/utils/staticAutoComplete/ISVocabularies.service.ts
+++ b/utils/staticAutoComplete/ISVocabularies.service.ts
@@ -107,21 +107,28 @@ export class ISVocabulariesService {
getLocalVocabularyFromService(vocabularyName: string, properties: EnvProperties): Observable {
if(vocabularyName == "sdg"){
- let url = properties.domain+"/assets/common-assets/vocabulary/sdg.json";
- return this.http.get((properties.useLongCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url)
- //.map(res => res.json())
+ return this.getSDGs(properties)
.pipe(map(res => res['sdg']))
.pipe(map(res => this.parseSDGs(res)))
.pipe(catchError(this.handleError));
}else if( vocabularyName == "fos"){
- let url = properties.domain+"/assets/common-assets/vocabulary/fos.json";
- return this.http.get((properties.useLongCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url)
- //.map(res => res.json())
+ return this.getFos(properties)
.pipe(map(res => res['fos']))
.pipe(map(res => this.parseFOS(res)))
.pipe(catchError(this.handleError));
}
}
+
+
+ getFos(properties: EnvProperties): Observable {
+ let url = "/assets/common-assets/vocabulary/fos.json";
+ return this.http.get((properties.useLongCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url)
+ }
+
+ getSDGs(properties: EnvProperties): Observable {
+ let url = "/assets/common-assets/vocabulary/sdg.json";
+ return this.http.get((properties.useLongCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url)
+ }
parseSDGs(data: any): AutoCompleteValue[] {
var array: AutoCompleteValue[] = []
@@ -160,6 +167,7 @@ export class ISVocabulariesService {
}
return array;
}
+
parse(data: any, vocabularyName: string): AutoCompleteValue[] {
var array: AutoCompleteValue[] = []
for (var i = 0; i < data.length; i++) {
diff --git a/utils/string-utils.class.ts b/utils/string-utils.class.ts
index ced29bc7..61d45b48 100644
--- a/utils/string-utils.class.ts
+++ b/utils/string-utils.class.ts
@@ -261,9 +261,9 @@ export class Identifier {
export class StringUtils {
- public static urlRegex = 'https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|www\.' +
- '[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9]+\.[^\s]{2,}|www\.' +
- '[a-zA-Z0-9]+\.[^\s]{2,}';
+ public static urlRegex = 'https?:\\/\\/(?:www(2?)\\.|(?!www(2?)))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\\.[^\\s]{2,}|www(2?)\\.' +
+ '[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\\.[^\\s]{2,}|https?:\\/\\/(?:www(2?)\\.|(?!www(2?)))[a-zA-Z0-9]+\\.[^\\s]{2,}|www(2?)\\.' +
+ '[a-zA-Z0-9]+\\.[^\\s]{2,}';
public static routeRegex = '^[a-zA-Z0-9\/][a-zA-Z0-9\/-]*$';