diff --git a/connect/affiliations/affiliation.service.ts b/connect/affiliations/affiliation.service.ts index bd65e472..bf08ed3e 100644 --- a/connect/affiliations/affiliation.service.ts +++ b/connect/affiliations/affiliation.service.ts @@ -3,25 +3,29 @@ import {HttpClient, HttpHeaders} from '@angular/common/http'; import {BehaviorSubject, Observable, Subscriber} from 'rxjs'; import {Affiliation} from '../../utils/entities/CuratorInfo'; import {properties} from "../../../../environments/environment"; +import {AdvancedAsyncSubject} from "../../utils/AdvancedAsyncSubject"; @Injectable() export class AffiliationService { private affiliationsSubject: BehaviorSubject = new BehaviorSubject([]); sub; + constructor(private http: HttpClient) { } + ngOnDestroy() { this.clearSubscriptions(); } - clearSubscriptions(){ + + clearSubscriptions() { if (this.sub instanceof Subscriber) { this.sub.unsubscribe(); } } + public initAffiliations(communityId: string): void { - let url = properties.communityAPI + communityId + "/organizations"; - this.sub = this.http.get((properties.useCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url).subscribe((affiliations) => { + this.sub = this.getAffiliations(communityId).subscribe((affiliations) => { this.affiliationsSubject.next(affiliations); }, error => { @@ -33,6 +37,11 @@ export class AffiliationService { return this.affiliationsSubject.asObservable(); } + public getAffiliations(communityId: string): Observable { + let url = properties.communityAPI + communityId + "/organizations"; + return this.http.get((properties.useCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url); + } + public updateAffiliation(url: string, affiliation: Affiliation) { let headers = new HttpHeaders({'Content-Type': 'application/json', 'accept': 'application/json'}); return this.http.post(url, JSON.stringify(affiliation), {headers: headers}); diff --git a/sharedComponents/input/input.component.ts b/sharedComponents/input/input.component.ts index 2c841b0f..0946cd93 100644 --- a/sharedComponents/input/input.component.ts +++ b/sharedComponents/input/input.component.ts @@ -70,14 +70,14 @@ declare var UIkit;
{{placeholderInfo.label}}
+ class="input uk-width-expand uk-text-truncate">{{placeholderInfo.label}}
{{getLabel(formControl.value)}}
+ class="input uk-width-expand uk-text-truncate">{{getLabel(formControl.value)}}
-
{{noValueSelected}}
+
{{noValueSelected}}
{{getLabel(formControl.value)}}
+ class="input uk-width-expand uk-text-truncate">{{getLabel(formControl.value)}}
diff --git a/utils/icons/icons-preview/icons-preview.component.ts b/utils/icons/icons-preview/icons-preview.component.ts index 7737b71e..deb26a9a 100644 --- a/utils/icons/icons-preview/icons-preview.component.ts +++ b/utils/icons/icons-preview/icons-preview.component.ts @@ -35,8 +35,24 @@ import {Component} from "@angular/core";
graph
- -
filters
+ +
orcid_add
+
+
+ +
orcid_bin
+
+
+ +
link
+
+
+ +
quotes
+
+
+ +
mining
diff --git a/utils/icons/icons-preview/icons-preview.module.ts b/utils/icons/icons-preview/icons-preview.module.ts index d07afe3c..5ce06c31 100644 --- a/utils/icons/icons-preview/icons-preview.module.ts +++ b/utils/icons/icons-preview/icons-preview.module.ts @@ -4,7 +4,19 @@ import {RouterModule} from "@angular/router"; import {IconsPreviewComponent} from "./icons-preview.component"; import {IconsService} from "../icons.service"; import {IconsModule} from "../icons.module"; -import {book, cog, database, earth, filters, graph, incognito, restricted} from "../icons"; +import { + book, + cog, + database, + earth, + filters, + graph, + incognito, link, mining, + orcid_add, + orcid_bin, + quotes, + restricted +} from "../icons"; @NgModule({ imports: [CommonModule, RouterModule.forChild([ @@ -15,6 +27,6 @@ import {book, cog, database, earth, filters, graph, incognito, restricted} from }) export class IconsPreviewModule { constructor(private iconsService: IconsService) { - this.iconsService.registerIcons([book, database, cog, earth, incognito, restricted, graph, filters]) + this.iconsService.registerIcons([book, database, cog, earth, incognito, restricted, graph, filters, orcid_add, orcid_bin, link, quotes, mining]) } } diff --git a/utils/icons/icons.component.ts b/utils/icons/icons.component.ts index e50dcda6..e44a1468 100644 --- a/utils/icons/icons.component.ts +++ b/utils/icons/icons.component.ts @@ -16,7 +16,7 @@ export interface StopRule { } /** - * By default this component uses Material Icons Library to render an icon with + * By default, this component uses Material Icons Library to render an icon with * a specific @name. For custom icons you should: * * - Add your icon in icons.ts and register it to Icon registry, by adding this to your component Module. @@ -47,8 +47,8 @@ export interface StopRule { selector: 'icon', template: ` - - {{iconName}} + + {{iconName}} {{visuallyHidden}} ` diff --git a/utils/icons/icons.ts b/utils/icons/icons.ts index cf839749..07e21dbd 100644 --- a/utils/icons/icons.ts +++ b/utils/icons/icons.ts @@ -213,9 +213,14 @@ export const link = { data: '' } -/** Add new icon under this line to be sure that it will be added on preview */ - export const quotes = { name: 'quotes', data: '' } + +export const mining = { + name: 'mining', + data: '' +} + +/** Add new icon under this line to be sure that it will be added on preview */ diff --git a/utils/modal/full-screen-modal/full-screen-modal.component.ts b/utils/modal/full-screen-modal/full-screen-modal.component.ts index b74d735c..42e0b3d8 100644 --- a/utils/modal/full-screen-modal/full-screen-modal.component.ts +++ b/utils/modal/full-screen-modal/full-screen-modal.component.ts @@ -120,7 +120,8 @@ export class FullScreenModalComponent implements AfterViewInit, OnDestroy { } ok() { - this.cancel(); + UIkit.modal(this.modal.nativeElement).hide(); + HelperFunctions.scroll(); this.okEmitter.emit(true); } } diff --git a/utils/pagingFormatterNoLoad.component.ts b/utils/pagingFormatterNoLoad.component.ts index 1e9b8f9f..77cd5793 100644 --- a/utils/pagingFormatterNoLoad.component.ts +++ b/utils/pagingFormatterNoLoad.component.ts @@ -1,5 +1,4 @@ import {Component, Input, Output, EventEmitter} from '@angular/core'; -import {ActivatedRoute} from '@angular/router'; import{EnvProperties} from './properties/env-properties'; import {properties} from "../../../environments/environment"; @@ -32,39 +31,21 @@ import {properties} from "../../../environments/environment"; export class pagingFormatterNoLoad { @Input() public currentPage: number = 1; @Input() public customClasses: string = 'uk-flex-center'; - // @Input() public navigateTo: string; @Input() public term: string=''; @Input() public size: number=10; @Input() public totalResults: number = 10; @Input() public limitPaging: boolean = false; - - // @Input() public params; - @Output() pageChange = new EventEmitter(); - - private limit: number; - properties:EnvProperties; + public properties:EnvProperties = properties; + private limit: number = this.properties.pagingLimit; @Input() public loading:boolean = false; - - constructor (private route: ActivatedRoute) { - } - - ngOnInit() { - //console.info("In paging -- CurrentPage:"+this.currentPage+" "+"total Pages = "+this.getTotalPages() +" Results num:"+this.totalResults); - - this.properties = properties; - this.limit = this.properties.pagingLimit; - - } + getTotalPages(){ let total: number = 0; - //let limit: number = 20;//OpenaireProperties.getPagingLimit(); - - var i= this.totalResults/this.size; - var integerI=parseInt(''+i); + let i= this.totalResults/this.size; + let integerI=parseInt(''+i); total = parseInt(''+((i==integerI)?i:i+1)); - if(this.limitPaging) { if((this.currentPage == this.limit) && (total > this.limit)) { total = this.limit; @@ -74,21 +55,21 @@ export class pagingFormatterNoLoad { } return total; } + onPrev(){ this.currentPage=this.currentPage-1; this.pageChange.emit({ - value: this.currentPage - }); - + value: this.currentPage + }); } - + onNext(){ - this.currentPage=this.currentPage+1; this.pageChange.emit({ - value: this.currentPage - }); + value: this.currentPage + }); } + onPage(pageNum: number){ if(!this.loading) { this.currentPage = pageNum;