From 5eb1dd2ec10623418ac6d7704a7acc159ee2611a Mon Sep 17 00:00:00 2001 From: rusikv Date: Thu, 26 Sep 2024 18:04:12 +0300 Subject: [PATCH] UI: disabled "Named entity expected" for html editor --- ui-ngx/src/app/shared/components/html.component.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/ui-ngx/src/app/shared/components/html.component.ts b/ui-ngx/src/app/shared/components/html.component.ts index da7e1fde9b..68270f7ac4 100644 --- a/ui-ngx/src/app/shared/components/html.component.ts +++ b/ui-ngx/src/app/shared/components/html.component.ts @@ -126,7 +126,17 @@ export class HtmlComponent implements OnInit, OnDestroy, ControlValueAccessor, V }); // @ts-ignore this.htmlEditor.session.on('changeAnnotation', () => { - const annotations = this.htmlEditor.session.getAnnotations(); + const annotations = this.htmlEditor.session.getAnnotations() || []; + const length = annotations.length; + let i = length; + while (i--) { + if(annotations[i].text.includes('Named entity expected')) { + annotations.splice(i, 1); + } + } + if (length > annotations.length) { + this.htmlEditor.session.setAnnotations(annotations); + } const hasErrors = annotations.filter(annotation => annotation.type === 'error').length > 0; if (this.hasErrors !== hasErrors) { this.hasErrors = hasErrors;