[angular-16-irish-monitor | DONE | CHANGED ] Search pages (projects, organizations, datasources ) Custom Filter accept single or an array of Custom filters
This commit is contained in:
parent
62d4ab1a36
commit
1ff833ed8a
|
@ -49,8 +49,15 @@ import {properties} from "../../../environments/environment";
|
||||||
export class SearchDataProvidersComponent {
|
export class SearchDataProvidersComponent {
|
||||||
private errorCodes: ErrorCodes;
|
private errorCodes: ErrorCodes;
|
||||||
private errorMessages: ErrorMessagesComponent;
|
private errorMessages: ErrorMessagesComponent;
|
||||||
@Input() customFilter:SearchCustomFilter= null;
|
@Input() customFilters: SearchCustomFilter[] = null;
|
||||||
@Input() tableViewLink;
|
@Input()
|
||||||
|
set customFilter(customFilter: SearchCustomFilter | SearchCustomFilter[]) {
|
||||||
|
if(!Array.isArray(customFilter)) {
|
||||||
|
this.customFilters = [customFilter];
|
||||||
|
}else{
|
||||||
|
this.customFilters = customFilter;
|
||||||
|
}
|
||||||
|
} @Input() tableViewLink;
|
||||||
@Input() searchForm: SearchForm = {class: 'search-form', dark: true};
|
@Input() searchForm: SearchForm = {class: 'search-form', dark: true};
|
||||||
public results =[];
|
public results =[];
|
||||||
public filters =[];
|
public filters =[];
|
||||||
|
@ -143,7 +150,7 @@ export class SearchDataProvidersComponent {
|
||||||
this.searchPage.keywordFields = this.searchFields.DEPOSIT_DATASOURCE_KEYWORD_FIELDS;
|
this.searchPage.keywordFields = this.searchFields.DEPOSIT_DATASOURCE_KEYWORD_FIELDS;
|
||||||
this.searchPage.usedBy = "deposit";
|
this.searchPage.usedBy = "deposit";
|
||||||
}
|
}
|
||||||
this.searchPage.prepareSearchPage(this.fieldIds, this.selectedFields, this.refineFields, [], this.fieldIdsMap,this.customFilter,params, this.entityType);
|
this.searchPage.prepareSearchPage(this.fieldIds, this.selectedFields, this.refineFields, [], this.fieldIdsMap,this.customFilters,params, this.entityType);
|
||||||
if(refine) {
|
if(refine) {
|
||||||
this._getFilters(this.searchPage.getSearchAPIQueryForAdvancedSearhFields(params), this.searchUtils.page, 0, true, this.searchPage.getSearchAPIQueryForRefineFields(params, firstLoad));
|
this._getFilters(this.searchPage.getSearchAPIQueryForAdvancedSearhFields(params), this.searchUtils.page, 0, true, this.searchPage.getSearchAPIQueryForRefineFields(params, firstLoad));
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -61,8 +61,15 @@ export class SearchOrganizationsComponent {
|
||||||
public loadPaging: boolean = true;
|
public loadPaging: boolean = true;
|
||||||
public oldTotalResults: number = 0;
|
public oldTotalResults: number = 0;
|
||||||
public pagingLimit: number = 0;
|
public pagingLimit: number = 0;
|
||||||
@Input() customFilter:SearchCustomFilter= null;
|
@Input() customFilters: SearchCustomFilter[] = null;
|
||||||
public refineFields: string[] = this.searchFields.ORGANIZATION_REFINE_FIELDS;
|
@Input()
|
||||||
|
set customFilter(customFilter: SearchCustomFilter | SearchCustomFilter[]) {
|
||||||
|
if(!Array.isArray(customFilter)) {
|
||||||
|
this.customFilters = [customFilter];
|
||||||
|
}else{
|
||||||
|
this.customFilters = customFilter;
|
||||||
|
}
|
||||||
|
} public refineFields: string[] = this.searchFields.ORGANIZATION_REFINE_FIELDS;
|
||||||
@ViewChild(NewSearchPageComponent, { static: true }) searchPage: NewSearchPageComponent;
|
@ViewChild(NewSearchPageComponent, { static: true }) searchPage: NewSearchPageComponent;
|
||||||
@Input() simpleView: boolean = true;
|
@Input() simpleView: boolean = true;
|
||||||
@Input() simpleSearchLink: string = "";
|
@Input() simpleSearchLink: string = "";
|
||||||
|
@ -127,7 +134,7 @@ export class SearchOrganizationsComponent {
|
||||||
// this.searchPage.fieldIdsMap = this.fieldIdsMap;
|
// this.searchPage.fieldIdsMap = this.fieldIdsMap;
|
||||||
// this.searchPage.customFilter = this.customFilter;
|
// this.searchPage.customFilter = this.customFilter;
|
||||||
// this.searchPage.getSelectedFiltersFromUrl(params);
|
// this.searchPage.getSelectedFiltersFromUrl(params);
|
||||||
this.searchPage.prepareSearchPage(this.fieldIds, this.selectedFields, this.refineFields, [], this.fieldIdsMap,this.customFilter,params, "organization");
|
this.searchPage.prepareSearchPage(this.fieldIds, this.selectedFields, this.refineFields, [], this.fieldIdsMap,this.customFilters,params, "organization");
|
||||||
if(refine) {
|
if(refine) {
|
||||||
this._getFilters(this.searchPage.getSearchAPIQueryForAdvancedSearhFields(), this.searchUtils.page, 0, true, this.searchPage.getSearchAPIQueryForRefineFields(params, firstLoad));
|
this._getFilters(this.searchPage.getSearchAPIQueryForAdvancedSearhFields(), this.searchUtils.page, 0, true, this.searchPage.getSearchAPIQueryForRefineFields(params, firstLoad));
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -45,8 +45,15 @@ import {properties} from "../../../environments/environment";
|
||||||
export class SearchProjectsComponent {
|
export class SearchProjectsComponent {
|
||||||
private errorCodes: ErrorCodes;
|
private errorCodes: ErrorCodes;
|
||||||
private errorMessages: ErrorMessagesComponent;
|
private errorMessages: ErrorMessagesComponent;
|
||||||
@Input() customFilter: SearchCustomFilter = null;
|
@Input() customFilters: SearchCustomFilter[] = null;
|
||||||
@Input() searchForm: SearchForm = {class: 'search-form', dark: true};
|
@Input()
|
||||||
|
set customFilter(customFilter: SearchCustomFilter | SearchCustomFilter[]) {
|
||||||
|
if(!Array.isArray(customFilter)) {
|
||||||
|
this.customFilters = [customFilter];
|
||||||
|
}else{
|
||||||
|
this.customFilters = customFilter;
|
||||||
|
}
|
||||||
|
} @Input() searchForm: SearchForm = {class: 'search-form', dark: true};
|
||||||
public results = [];
|
public results = [];
|
||||||
public filters = [];
|
public filters = [];
|
||||||
public rangeFilters: RangeFilter[] = [];
|
public rangeFilters: RangeFilter[] = [];
|
||||||
|
@ -128,7 +135,7 @@ export class SearchProjectsComponent {
|
||||||
|
|
||||||
this.searchPage.fieldIds = this.fieldIds;
|
this.searchPage.fieldIds = this.fieldIds;
|
||||||
this.selectedFields = [];
|
this.selectedFields = [];
|
||||||
this.searchPage.prepareSearchPage(this.fieldIds, this.selectedFields, this.refineFields, this.rangeFields, this.fieldIdsMap, this.customFilter, params, "project");
|
this.searchPage.prepareSearchPage(this.fieldIds, this.selectedFields, this.refineFields, this.rangeFields, this.fieldIdsMap, this.customFilters, params, "project");
|
||||||
if (refine) {
|
if (refine) {
|
||||||
this._getFilters(this.searchPage.getSearchAPIQueryForAdvancedSearhFields(), this.searchUtils.page, 0, "", true, this.searchPage.getSearchAPIQueryForRangeFields(params) + this.searchPage.getSearchAPIQueryForRefineFields(params, firstLoad));
|
this._getFilters(this.searchPage.getSearchAPIQueryForAdvancedSearhFields(), this.searchUtils.page, 0, "", true, this.searchPage.getSearchAPIQueryForRangeFields(params) + this.searchPage.getSearchAPIQueryForRefineFields(params, firstLoad));
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue