diff --git a/portal-2/src/app/claims/claimsByToken/claimsByToken.component.ts b/portal-2/src/app/claims/claimsByToken/claimsByToken.component.ts index be94aa01..e6dff275 100644 --- a/portal-2/src/app/claims/claimsByToken/claimsByToken.component.ts +++ b/portal-2/src/app/claims/claimsByToken/claimsByToken.component.ts @@ -49,7 +49,7 @@ import {RouterHelper} from '../../utils/routerHelper.class';
No pending claims found.
-
+
- @@ -107,18 +107,12 @@ import {RouterHelper} from '../../utils/routerHelper.class'; - - - - - - +
- +
-
-
+

Already Curated Claims

@@ -126,7 +120,7 @@ import {RouterHelper} from '../../utils/routerHelper.class';
No curated claims found.
-
+
{{_formatName(value)}}
({{value.number}})
-
  • - View more -
  • - - + + + + + ` }) diff --git a/portal-2/src/app/searchPages/searchUtils/searchFilter.component.ts b/portal-2/src/app/searchPages/searchUtils/searchFilter.component.ts index 71dac931..ffb5f2fe 100644 --- a/portal-2/src/app/searchPages/searchUtils/searchFilter.component.ts +++ b/portal-2/src/app/searchPages/searchUtils/searchFilter.component.ts @@ -2,11 +2,11 @@ import {Component, Input, Output, EventEmitter} from '@angular/core'; import {Observable} from 'rxjs/Observable'; import { Filter, Value} from './searchHelperClasses.class'; +import {Open} from '../../utils/modal/open.component'; @Component({ selector: 'search-filter', template: ` -
    ({{value.number}})
    -
    -
    + +
    +
    {{_formatName(value)}}
    ({{value.number}})
    + Show More
    - - ` }) @@ -43,6 +43,16 @@ export class SearchFilterComponent { public showAll:boolean = false; public _maxCharacters:number =28; + @Output() toggleModal = new EventEmitter(); + + @Output() modalChange = new EventEmitter(); + filterModalChange() { + console.info("Modal Changed"); + this.modalChange.emit({ + value: true + }); + //this.close(); + } constructor () { } @@ -71,7 +81,6 @@ export class SearchFilterComponent { this.filter.countSelectedValues--; // this.reorderFilterValues(); } - } getSelectedValues(filter):any{ var selected = []; @@ -121,4 +130,12 @@ export class SearchFilterComponent { // this.filter.values.splice(0, 0, selectedValue); // } // } + + + toggle() { + this.toggleModal.emit({ + value: this.filter + }); + } + } diff --git a/portal-2/src/app/searchPages/searchUtils/searchFilterModal.component.ts b/portal-2/src/app/searchPages/searchUtils/searchFilterModal.component.ts new file mode 100644 index 00000000..569ea774 --- /dev/null +++ b/portal-2/src/app/searchPages/searchUtils/searchFilterModal.component.ts @@ -0,0 +1,101 @@ +import {Component, ViewEncapsulation, ComponentRef, ElementRef, Input, EventEmitter, Output} from '@angular/core'; +// import { DynamicComponentLoader} from '@angular/core'; + +import {Open} from '../../utils/modal/open.component'; +import { Filter} from './searchHelperClasses.class'; + +@Component({ + selector: 'modal-search-filter', + template: ` + + + `, + encapsulation: ViewEncapsulation.None, +}) +/** + * API to an open search filter window. + */ +export class SearchFilterModalComponent{ + @Input() filter: Filter; + @Output() modalChange = new EventEmitter(); + + public isOpen:boolean=false; + + constructor( public _elementRef: ElementRef){} + + filterModalChange(selected:boolean) { + console.info("Modal Changed"); + this.filterChange(selected); + this.modalChange.emit({ + value: selected + }); + this.close(); + } + filterChange(selected:boolean){ + if(selected){ + this.filter.countSelectedValues++; + // this.reorderFilterValues(); + }else{ + this.filter.countSelectedValues--; + // this.reorderFilterValues(); + } + } + getSelectedValues(filter):any{ + var selected = []; + if(filter.countSelectedValues >0){ + for (var i=0; i < filter.values.length; i++){ + if(filter.values[i].selected){ + selected.push(filter.values[i]); + } + } + } + return selected; + + } + getNotSelectedValues(filter):any{ + var notSselected = []; + if(filter.countSelectedValues >0){ + for (var i=0; i < filter.values.length; i++){ + if(!filter.values[i].selected){ + notSselected.push(filter.values[i]); + } + } + }else { + notSselected = filter.values; + } + return notSselected; + } + + open() { + this.isOpen = true; + } + + close() { + this.isOpen = false; + } + +} diff --git a/portal-2/src/app/searchPages/searchUtils/searchPage.component.ts b/portal-2/src/app/searchPages/searchUtils/searchPage.component.ts index 95149b07..bd790fbb 100644 --- a/portal-2/src/app/searchPages/searchUtils/searchPage.component.ts +++ b/portal-2/src/app/searchPages/searchUtils/searchPage.component.ts @@ -8,6 +8,8 @@ import {SearchUtilsClass} from './searchUtils.class'; import {DOI, StringUtils} from '../../utils/string-utils.class'; import {ModalLoading} from '../../utils/modal/loading.component'; import { Meta} from '../../../angular2-meta'; +import{SearchFilterComponent} from './searchFilter.component'; +import {SearchFilterModalComponent} from './searchFilterModal.component'; @Component({ selector: 'search-page', @@ -37,7 +39,7 @@ import { Meta} from '../../../angular2-meta';
    - +
    @@ -66,6 +68,8 @@ import { Meta} from '../../../angular2-meta'; + + ` }) export class SearchPageComponent { @@ -94,6 +98,11 @@ export class SearchPageComponent { public urlParam: string; public parameterNames:string[] =[]; public parameterValues:string[] =[]; + + @ViewChild (SearchFilterModalComponent) searchFilterModal : SearchFilterModalComponent ; + public currentFilter: Filter; + + constructor (private location: Location , private _meta: Meta) { } @@ -107,6 +116,12 @@ export class SearchPageComponent { ngAfterViewChecked(){ } + + toggleModal($event) { + this.currentFilter = $event.value; + this.searchFilterModal.open(); + } + updateDescription(description:string){ this._meta.updateMeta("description", description); this._meta.updateMeta("og:description", description); @@ -443,6 +458,7 @@ export class SearchPageComponent { } filterChanged($event){ + console.info("filter Changed"); this.goTo(1); } keywordChanged($event) { diff --git a/portal-2/src/app/searchPages/searchUtils/searchPage.module.ts b/portal-2/src/app/searchPages/searchUtils/searchPage.module.ts index 93cd4f27..726d6565 100644 --- a/portal-2/src/app/searchPages/searchUtils/searchPage.module.ts +++ b/portal-2/src/app/searchPages/searchUtils/searchPage.module.ts @@ -7,18 +7,22 @@ import{SearchPageComponent} from './searchPage.component'; import{SearchFormModule} from './searchForm.module'; import{SearchResultsModule} from './searchResults.module'; import{SearchFilterComponent} from './searchFilter.component'; +import{SearchFilterModalComponent} from './searchFilterModal.component'; import{LoadingModalModule} from '../../utils/modal/loadingModal.module'; import {ReportsServiceModule} from '../../services/reportsService.module'; import{SearchPagingModule} from './searchPaging.module'; import {SearchDownloadModule} from './searchDownload.module'; +import {ModalModule} from '../../utils/modal/modal.module'; + @NgModule({ imports: [ - CommonModule, FormsModule,RouterModule, SearchFormModule, SearchResultsModule, LoadingModalModule, ReportsServiceModule, SearchPagingModule, SearchDownloadModule + CommonModule, FormsModule,RouterModule, SearchFormModule, SearchResultsModule, LoadingModalModule, ReportsServiceModule, SearchPagingModule, SearchDownloadModule, ModalModule ], declarations: [ SearchPageComponent, - SearchFilterComponent + SearchFilterComponent, + SearchFilterModalComponent , ], @@ -26,7 +30,7 @@ import {SearchDownloadModule} from './searchDownload.module'; ], exports: [ SearchPageComponent, -SearchFilterComponent + SearchFilterComponent ] }) export class SearchPageModule { } diff --git a/portal-2/src/index.html b/portal-2/src/index.html index f6c4d21d..ae44a4bf 100644 --- a/portal-2/src/index.html +++ b/portal-2/src/index.html @@ -142,7 +142,7 @@ } .custom-dataTable-content { - min-height: 1000px; + min-height: 600px; } .filterItem span {