fixed highlight bug
This commit is contained in:
		
							parent
							
								
									353459aa90
								
							
						
					
					
						commit
						25f5027135
					
				@ -139,7 +139,7 @@ export class CalculatedFieldTestArgumentsComponent extends PageComponent impleme
 | 
			
		||||
  private getValue(): CalculatedFieldEventArguments {
 | 
			
		||||
    return this.argumentsFormArray.getRawValue().reduce((acc, rowItem) => {
 | 
			
		||||
      const { argumentName, rollingJson = {}, ...value } = rowItem;
 | 
			
		||||
      acc[argumentName] = { ...rollingJson, ...value};
 | 
			
		||||
      acc[argumentName] = { ...rollingJson, ...value };
 | 
			
		||||
      return acc;
 | 
			
		||||
    }, {});
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
@ -31,7 +31,12 @@ import {
 | 
			
		||||
} from '@home/components/widget/lib/scada/scada-symbol.models';
 | 
			
		||||
import { TbEditorCompletion, TbEditorCompletions } from '@shared/models/ace/completion.models';
 | 
			
		||||
import { CustomTranslatePipe } from '@shared/pipe/custom-translate.pipe';
 | 
			
		||||
import { AceHighlightRule, AceHighlightRules } from '@shared/models/ace/ace.models';
 | 
			
		||||
import {
 | 
			
		||||
  AceHighlightRule,
 | 
			
		||||
  AceHighlightRules,
 | 
			
		||||
  dotOperatorHighlightRule,
 | 
			
		||||
  endGroupHighlightRule
 | 
			
		||||
} from '@shared/models/ace/ace.models';
 | 
			
		||||
import { HelpLinks, ValueType } from '@shared/models/constants';
 | 
			
		||||
import { formPropertyCompletions } from '@shared/models/dynamic-form.models';
 | 
			
		||||
import ITooltipsterInstance = JQueryTooltipster.ITooltipsterInstance;
 | 
			
		||||
@ -921,17 +926,6 @@ export class ScadaSymbolElement {
 | 
			
		||||
 | 
			
		||||
const identifierRe = /[a-zA-Z$_\u00a1-\uffff][a-zA-Z\d$_\u00a1-\uffff]*/;
 | 
			
		||||
 | 
			
		||||
const dotOperatorHighlightRule: AceHighlightRule = {
 | 
			
		||||
  token: 'punctuation.operator',
 | 
			
		||||
  regex: /[.](?![.])/,
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
const endGroupHighlightRule: AceHighlightRule = {
 | 
			
		||||
  regex: '',
 | 
			
		||||
  token: 'empty',
 | 
			
		||||
  next: 'no_regex'
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
const scadaSymbolCtxObjectHighlightRule: AceHighlightRule = {
 | 
			
		||||
  token: 'tb.scada-symbol-ctx',
 | 
			
		||||
  regex: /\bctx\b/,
 | 
			
		||||
 | 
			
		||||
@ -365,5 +365,16 @@ export interface AceHighlightRule {
 | 
			
		||||
  next?: string;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export const dotOperatorHighlightRule: AceHighlightRule = {
 | 
			
		||||
  token: 'punctuation.operator',
 | 
			
		||||
  regex: /[.](?![.])/,
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
export const endGroupHighlightRule: AceHighlightRule = {
 | 
			
		||||
  regex: '',
 | 
			
		||||
  token: 'empty',
 | 
			
		||||
  next: 'no_regex'
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -28,7 +28,11 @@ import { EntityType } from '@shared/models/entity-type.models';
 | 
			
		||||
import { AliasFilterType } from '@shared/models/alias.models';
 | 
			
		||||
import { Observable } from 'rxjs';
 | 
			
		||||
import { TbEditorCompleter } from '@shared/models/ace/completion.models';
 | 
			
		||||
import { AceHighlightRules } from '@shared/models/ace/ace.models';
 | 
			
		||||
import {
 | 
			
		||||
  AceHighlightRules,
 | 
			
		||||
  dotOperatorHighlightRule,
 | 
			
		||||
  endGroupHighlightRule
 | 
			
		||||
} from '@shared/models/ace/ace.models';
 | 
			
		||||
 | 
			
		||||
export interface CalculatedField extends Omit<BaseData<CalculatedFieldId>, 'label'>, HasVersion, HasTenantId, ExportableEntity<CalculatedFieldId> {
 | 
			
		||||
  debugSettings?: EntityDebugSettings;
 | 
			
		||||
@ -337,6 +341,7 @@ export const getCalculatedFieldArgumentsHighlights = (
 | 
			
		||||
 | 
			
		||||
const calculatedFieldSingleArgumentValueHighlightRules: AceHighlightRules = {
 | 
			
		||||
  calculatedFieldSingleArgumentValue: [
 | 
			
		||||
    dotOperatorHighlightRule,
 | 
			
		||||
    {
 | 
			
		||||
      token: 'tb.calculated-field-value',
 | 
			
		||||
      regex: /value/,
 | 
			
		||||
@ -346,12 +351,14 @@ const calculatedFieldSingleArgumentValueHighlightRules: AceHighlightRules = {
 | 
			
		||||
      token: 'tb.calculated-field-ts',
 | 
			
		||||
      regex: /ts/,
 | 
			
		||||
      next: 'no_regex'
 | 
			
		||||
    }
 | 
			
		||||
    },
 | 
			
		||||
    endGroupHighlightRule
 | 
			
		||||
  ],
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
const calculatedFieldRollingArgumentValueHighlightRules: AceHighlightRules = {
 | 
			
		||||
  calculatedFieldRollingArgumentValue: [
 | 
			
		||||
    dotOperatorHighlightRule,
 | 
			
		||||
    {
 | 
			
		||||
      token: 'tb.calculated-field-values',
 | 
			
		||||
      regex: /values/,
 | 
			
		||||
@ -361,7 +368,8 @@ const calculatedFieldRollingArgumentValueHighlightRules: AceHighlightRules = {
 | 
			
		||||
      token: 'tb.calculated-field-time-window',
 | 
			
		||||
      regex: /timeWindow/,
 | 
			
		||||
      next: 'calculatedFieldRollingArgumentTimeWindow'
 | 
			
		||||
    }
 | 
			
		||||
    },
 | 
			
		||||
    endGroupHighlightRule
 | 
			
		||||
  ],
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user