Merge remote-tracking branch 'origin/master' into RED-9747
This commit is contained in:
commit
30c1f8628b
@ -6,7 +6,7 @@ import { MatIcon } from '@angular/material/icon';
|
||||
import { FilterService } from '@common-ui/filtering';
|
||||
import { CircleButtonComponent, IconButtonComponent, IconButtonTypes, IqserDialog } from '@iqser/common-ui';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { IComponentLogEntry } from '@red/domain';
|
||||
import { IComponentLogEntry, IComponentValue } from '@red/domain';
|
||||
import { RevertValueDialogComponent } from '../../dialogs/docu-mine/revert-value-dialog/revert-value-dialog.component';
|
||||
|
||||
@Component({
|
||||
@ -152,8 +152,15 @@ export class EditableStructuredComponentValueComponent implements OnInit {
|
||||
|
||||
#setWorkloadFilters() {
|
||||
this._filtersService.deactivateFilters({ primaryFiltersSlug: 'primaryFilters' });
|
||||
const filterSet = this.#setFilter(this.entryLabel);
|
||||
if (!filterSet) {
|
||||
const uniqueLabels = this.#getUniqueReferencesLabels(this.entry.componentValues);
|
||||
let setFilterCount = 0;
|
||||
for (const label of uniqueLabels) {
|
||||
const setFilter = this.#setFilter(label);
|
||||
if (setFilter) {
|
||||
setFilterCount++;
|
||||
}
|
||||
}
|
||||
if (!setFilterCount) {
|
||||
this.#setFilter('no-annotations-filter');
|
||||
}
|
||||
}
|
||||
@ -161,7 +168,7 @@ export class EditableStructuredComponentValueComponent implements OnInit {
|
||||
#setFilter(label: string) {
|
||||
const filterGroup = this._filtersService.getGroup('primaryFilters');
|
||||
for (const filter of filterGroup.filters) {
|
||||
const nestedFilter = filter.children.find(f => f.label === label);
|
||||
const nestedFilter = filter.children.find(f => f.label.toLowerCase() === label);
|
||||
if (nestedFilter) {
|
||||
this._filtersService.filterCheckboxClicked({ nestedFilter, filterGroup, primaryFiltersSlug: 'primaryFilters' });
|
||||
return true;
|
||||
@ -169,6 +176,17 @@ export class EditableStructuredComponentValueComponent implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
#getUniqueReferencesLabels(values: IComponentValue[]) {
|
||||
const labels: Set<string> = new Set();
|
||||
for (const value of values) {
|
||||
for (const reference of value.entityReferences) {
|
||||
const label = reference.type?.replace(/_/g, ' ')?.toLowerCase();
|
||||
labels.add(label);
|
||||
}
|
||||
}
|
||||
return labels;
|
||||
}
|
||||
|
||||
#updateTextAreaHeight() {
|
||||
setTimeout(() => {
|
||||
for (let i = 0; i < this.entry.componentValues.length; i++) {
|
||||
|
||||
@ -1 +1 @@
|
||||
Subproject commit 9df87dc218ea8090159059a7bad184aaaeba8854
|
||||
Subproject commit fb4b58a4968846e899f4e5aa33c75109302e4b4f
|
||||
Loading…
x
Reference in New Issue
Block a user