mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-5438] Demoshell fixes (#7148)
[ADF-5438] 'Clear' and 'Apply' are showed for the new 'Content Size' bubble [ADF-5437] Content size bubble filter shows a clear button [ADF-5436] Check list filter shows 'Clear All' when there's already the remove button
This commit is contained in:
@@ -189,7 +189,7 @@
|
||||
"expanded": true,
|
||||
"intervals": [
|
||||
{
|
||||
"label": "The Created",
|
||||
"label": "Created",
|
||||
"field": "cm:created",
|
||||
"sets": [
|
||||
{
|
||||
@@ -212,7 +212,7 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"label": "TheModified",
|
||||
"label": "Modified",
|
||||
"field": "cm:modified",
|
||||
"sets": [
|
||||
{
|
||||
@@ -459,7 +459,7 @@
|
||||
{
|
||||
"field": "creator",
|
||||
"mincount": 1,
|
||||
"label": "Field created",
|
||||
"label": "Folder created",
|
||||
"settings": {
|
||||
"allowUpdateOnChange": false,
|
||||
"hideDefaultAction": true
|
||||
|
@@ -18,7 +18,7 @@
|
||||
import { Component, OnDestroy, OnInit } from '@angular/core';
|
||||
import { ActivatedRoute, Params, Router } from '@angular/router';
|
||||
import { Pagination, ResultSetPaging } from '@alfresco/js-api';
|
||||
import { SearchForm, SearchQueryBuilderService } from '@alfresco/adf-content-services';
|
||||
import { SearchConfiguration, SearchForm, SearchQueryBuilderService } from '@alfresco/adf-content-services';
|
||||
import { SearchService, ShowHeaderMode, UserPreferencesService } from '@alfresco/adf-core';
|
||||
import { combineLatest, Subject } from 'rxjs';
|
||||
import { takeUntil } from 'rxjs/operators';
|
||||
@@ -50,6 +50,7 @@ export class SearchFilterChipsComponent implements OnInit, OnDestroy {
|
||||
combineLatest([this.route.params, this.queryBuilder.configUpdated])
|
||||
.pipe(takeUntil(this.onDestroy$))
|
||||
.subscribe(([params, searchConfig]) => {
|
||||
this.updateSearchSetting(searchConfig);
|
||||
this.searchedWord = params.hasOwnProperty(this.queryParamName) ? params[this.queryParamName] : null;
|
||||
const query = this.formatSearchQuery(this.searchedWord, searchConfig['app:fields']);
|
||||
if (query) {
|
||||
@@ -140,4 +141,28 @@ export class SearchFilterChipsComponent implements OnInit, OnDestroy {
|
||||
|
||||
return ['name', 'asc'];
|
||||
}
|
||||
|
||||
private updateSearchSetting(config: SearchConfiguration): void {
|
||||
if (config.facetQueries) {
|
||||
this.updateSetting(config.facetQueries);
|
||||
}
|
||||
|
||||
if (config.facetFields?.fields?.length) {
|
||||
config.facetFields.fields.forEach((field) => this.updateSetting(field));
|
||||
}
|
||||
|
||||
if (config.facetIntervals?.intervals?.length) {
|
||||
config.facetIntervals.intervals.forEach((field) => this.updateSetting(field));
|
||||
}
|
||||
|
||||
if (config.categories.length) {
|
||||
config.categories.forEach((field) => this.updateSetting(field.component));
|
||||
}
|
||||
}
|
||||
|
||||
private updateSetting(field) {
|
||||
field.settings = field.settings ?? {};
|
||||
field.settings.allowUpdateOnChange = false;
|
||||
field.settings.hideDefaultAction = true;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user