From cd01d875217116a20c198e73f41c4a1a6bf114ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Kilchenmann?= Date: Wed, 12 Jan 2022 20:38:29 +0100 Subject: [PATCH] fix(advanced search): update comparison operators in case of rich text (DEV-326) (#633) --- .../specify-property-value.component.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/app/workspace/search/advanced-search/resource-and-property-selection/search-select-property/specify-property-value/specify-property-value.component.ts b/src/app/workspace/search/advanced-search/resource-and-property-selection/search-select-property/specify-property-value/specify-property-value.component.ts index 60ed4cc4ce..61e700fab7 100644 --- a/src/app/workspace/search/advanced-search/resource-and-property-selection/search-select-property/specify-property-value/specify-property-value.component.ts +++ b/src/app/workspace/search/advanced-search/resource-and-property-selection/search-select-property/specify-property-value/specify-property-value.component.ts @@ -1,6 +1,7 @@ -import { AfterViewChecked, AfterViewInit, Component, Inject, Input, OnChanges, OnDestroy, ViewChild } from '@angular/core'; -import { Constants, ResourcePropertyDefinition } from '@dasch-swiss/dsp-js'; +import { Component, Inject, Input, OnChanges, OnDestroy, ViewChild } from '@angular/core'; import { FormBuilder, FormGroup, Validators } from '@angular/forms'; +import { Constants, ResourcePropertyDefinition } from '@dasch-swiss/dsp-js'; +import { Subscription } from 'rxjs'; import { ComparisonOperator, ComparisonOperatorAndValue, Equals, @@ -13,7 +14,6 @@ import { Match, NotEquals, PropertyValue, Value } from './operator'; -import { Subscription } from 'rxjs'; // https://stackoverflow.com/questions/45661010/dynamic-nested-reactive-form-expressionchangedafterithasbeencheckederror const resolvedPromise = Promise.resolve(null); @@ -118,7 +118,11 @@ export class SpecifyPropertyValueComponent implements OnChanges, OnDestroy { switch (this.propertyValueType) { case Constants.TextValue: - this.comparisonOperators = [new Like(), new Match(), new Equals(), new NotEquals(), new Exists()]; + if (this._property.guiElement === Constants.SalsahGui + Constants.HashDelimiter + 'Richtext') { + this.comparisonOperators = [new Like(), new Match(), new Exists()]; + } else { + this.comparisonOperators = [new Like(), new Match(), new Equals(), new NotEquals(), new Exists()]; + } break; case Constants.BooleanValue: