@alfresco/adf-content-services 8.4.0-19028083108 → 8.4.0-19060916420

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4672,10 +4672,6 @@ class SearchHeaderQueryBuilderService extends BaseQueryBuilderService {
4672
4672
  }
4673
4673
  return foundCategory;
4674
4674
  }
4675
- getOperatorForFilterId(id) {
4676
- const foundCategory = this.categories?.find((category) => category.id === id);
4677
- return foundCategory?.component?.settings?.operator;
4678
- }
4679
4675
  setCurrentRootFolderId(currentFolderId) {
4680
4676
  const alreadyAddedFilter = this.filterQueries.find((filterQueries) => filterQueries.query.includes(currentFolderId));
4681
4677
  if (alreadyAddedFilter !== undefined) {
@@ -4771,8 +4767,6 @@ class SearchTextComponent {
4771
4767
  }
4772
4768
  reset(updateContext = true) {
4773
4769
  this.value = '';
4774
- this.context.filterRawParams[this.id] = undefined;
4775
- this.context.queryFragments[this.id] = '';
4776
4770
  this.updateQuery(null, updateContext);
4777
4771
  }
4778
4772
  onChangedHandler(event) {
@@ -4783,9 +4777,7 @@ class SearchTextComponent {
4783
4777
  }
4784
4778
  }
4785
4779
  updateQuery(value, updateContext = true) {
4786
- if (value !== null) {
4787
- this.context.filterRawParams[this.id] = value;
4788
- }
4780
+ this.context.filterRawParams[this.id] = value;
4789
4781
  this.displayValue$.next(value);
4790
4782
  if (this.context && this.settings && this.settings.field) {
4791
4783
  this.context.queryFragments[this.id] = value ? `${this.settings.field}:'${this.getSearchPrefix()}${value}${this.getSearchSuffix()}'` : '';
@@ -5413,7 +5405,8 @@ class SearchCheckListComponent {
5413
5405
  }
5414
5406
  }
5415
5407
  this.context.populateFilters
5416
- .pipe(map((filtersQueries) => filtersQueries[this.id]), filter((filterQuery) => filterQuery !== undefined), takeUntilDestroyed(this.destroyRef))
5408
+ .asObservable()
5409
+ .pipe(map((filtersQueries) => filtersQueries[this.id]), takeUntilDestroyed(this.destroyRef))
5417
5410
  .subscribe((filterQuery) => {
5418
5411
  if (filterQuery) {
5419
5412
  filterQuery.forEach((value) => {
@@ -5480,8 +5473,8 @@ class SearchCheckListComponent {
5480
5473
  return this.getCheckedValues();
5481
5474
  }
5482
5475
  setValue(value) {
5483
- this.options.items.forEach((item) => (item.checked = value.includes(item.value)));
5484
- this.isActive = true;
5476
+ this.options.items.filter((item) => value.includes(item.value)).forEach((item) => (item.checked = true));
5477
+ this.submitValues();
5485
5478
  }
5486
5479
  getCheckedValues() {
5487
5480
  return this.options.items.filter((option) => option.checked).map((option) => option.value);
@@ -8068,7 +8061,7 @@ class SearchFilterContainerComponent {
8068
8061
  }
8069
8062
  ngOnInit() {
8070
8063
  this.category = this.searchFilterQueryBuilder.getCategoryForColumn(this.col.key);
8071
- this.initialValue = this.value?.[this.category?.id];
8064
+ this.initialValue = this.value?.[this.col.key] ? this.value[this.col.key] : undefined;
8072
8065
  }
8073
8066
  onKeyPressed(event, menuTrigger) {
8074
8067
  if (event.key === 'Enter' && this.widgetContainer.selector !== 'check-list') {
@@ -8078,7 +8071,7 @@ class SearchFilterContainerComponent {
8078
8071
  }
8079
8072
  onApply() {
8080
8073
  if (this.widgetContainer.hasValueSelected()) {
8081
- this.searchFilterQueryBuilder.setActiveFilter(this.category.id, this.widgetContainer.getCurrentValue());
8074
+ this.searchFilterQueryBuilder.setActiveFilter(this.category.columnKey, this.widgetContainer.getCurrentValue());
8082
8075
  this.filterChange.emit();
8083
8076
  this.widgetContainer.applyInnerWidget();
8084
8077
  }
@@ -8092,7 +8085,7 @@ class SearchFilterContainerComponent {
8092
8085
  }
8093
8086
  resetSearchFilter() {
8094
8087
  this.widgetContainer.resetInnerWidget();
8095
- this.searchFilterQueryBuilder.removeActiveFilter(this.category.id);
8088
+ this.searchFilterQueryBuilder.removeActiveFilter(this.category.columnKey);
8096
8089
  this.filterChange.emit();
8097
8090
  }
8098
8091
  getTooltipTranslation(columnTitle) {
@@ -8102,7 +8095,7 @@ class SearchFilterContainerComponent {
8102
8095
  return this.translationService.instant('SEARCH.SEARCH_HEADER.FILTER_BY', { category: this.translationService.instant(columnTitle) });
8103
8096
  }
8104
8097
  isActive() {
8105
- return this.searchFilterQueryBuilder.getActiveFilters().findIndex((f) => f.key === this.category.id) > -1;
8098
+ return this.searchFilterQueryBuilder.getActiveFilters().findIndex((f) => f.key === this.category.columnKey) > -1;
8106
8099
  }
8107
8100
  onMenuOpen() {
8108
8101
  if (this.filterContainer && !this.focusTrap) {
@@ -8216,17 +8209,12 @@ class FilterHeaderComponent {
8216
8209
  }
8217
8210
  }
8218
8211
  initSearchHeader(currentFolderId) {
8212
+ this.searchFilterQueryBuilder.setCurrentRootFolderId(currentFolderId);
8219
8213
  if (this.value) {
8220
- Object.keys(this.value).forEach((key) => {
8221
- this.searchFilterQueryBuilder.setActiveFilter(key, this.value[key]);
8222
- const operator = this.searchFilterQueryBuilder.getOperatorForFilterId(key) || 'OR';
8223
- this.searchFilterQueryBuilder.filterRawParams[key] = this.value[key];
8224
- this.searchFilterQueryBuilder.queryFragments[key] = Array.isArray(this.value[key])
8225
- ? this.value[key].join(` ${operator} `)
8226
- : this.value[key];
8214
+ Object.keys(this.value).forEach((columnKey) => {
8215
+ this.searchFilterQueryBuilder.setActiveFilter(columnKey, this.value[columnKey]);
8227
8216
  });
8228
8217
  }
8229
- this.searchFilterQueryBuilder.setCurrentRootFolderId(currentFolderId);
8230
8218
  }
8231
8219
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: FilterHeaderComponent, deps: [{ token: ADF_DOCUMENT_PARENT_COMPONENT }, { token: SearchHeaderQueryBuilderService }], target: i0.ɵɵFactoryTarget.Component }); }
8232
8220
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.6", type: FilterHeaderComponent, isStandalone: true, selector: "adf-filter-header", inputs: { value: "value", currentFolderId: "currentFolderId" }, outputs: { filterSelection: "filterSelection" }, usesOnChanges: true, ngImport: i0, template: "<div *ngIf=\"isFilterServiceActive\">\n <adf-header-filter-template>\n <ng-template let-col>\n <adf-search-filter-container [col]=\"col\"\n [value]=\"value\"\n (filterChange)=\"onFilterSelectionChange()\" />\n </ng-template>\n </adf-header-filter-template>\n</div>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: HeaderFilterTemplateDirective, selector: "adf-header-filter-template" }, { kind: "component", type: SearchFilterContainerComponent, selector: "adf-search-filter-container", inputs: ["col", "value"], outputs: ["filterChange"] }] }); }
@@ -8565,7 +8553,7 @@ class DocumentListComponent extends DataTableSchema {
8565
8553
  }
8566
8554
  }
8567
8555
  if (this.currentFolderId && changes['currentFolderId']?.currentValue !== changes['currentFolderId']?.previousValue) {
8568
- !this.filterValue && this.loadFolder();
8556
+ this.loadFolder();
8569
8557
  }
8570
8558
  if (this.data) {
8571
8559
  if (changes.node?.currentValue) {
@@ -8753,6 +8741,7 @@ class DocumentListComponent extends DataTableSchema {
8753
8741
  this.preserveExistingSelection();
8754
8742
  }
8755
8743
  this.onPreselectNodes();
8744
+ this.setLoadingState(false);
8756
8745
  this.onDataReady(nodePaging);
8757
8746
  }
8758
8747
  }
@@ -8927,7 +8916,6 @@ class DocumentListComponent extends DataTableSchema {
8927
8916
  onDataReady(nodePaging) {
8928
8917
  this.ready.emit(nodePaging);
8929
8918
  this.pagination.next(nodePaging.list.pagination);
8930
- this.setLoadingState(false);
8931
8919
  }
8932
8920
  updatePagination(requestPaginationModel) {
8933
8921
  this._pagination.maxItems = requestPaginationModel.maxItems;