Skip to content

Commit

Permalink
Set data-path attribute on inputs #3488
Browse files Browse the repository at this point in the history
Replaced Saga with Juke.
  • Loading branch information
edloidas committed Sep 12, 2024
1 parent e5c788f commit 9ce339e
Show file tree
Hide file tree
Showing 9 changed files with 570 additions and 336 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@ src/main/resources/assets/spec/coverage/

# Visual Studio Code
/bin/
.vscode/
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import * as Q from 'q';
import {DivEl} from '../dom/DivEl';
import {PropertyPath} from '../data/PropertyPath';
import {DivEl} from '../dom/DivEl';
import {Element} from '../dom/Element';
import {JukeAiHelper} from '../juke/JukeAiHelper';
import {FormItemOccurrence} from './FormItemOccurrence';
import {HelpTextContainer} from './HelpTextContainer';
import {RemoveButtonClickedEvent} from './RemoveButtonClickedEvent';
import {SagaHelper} from '../saga/SagaHelper';
import {Element} from '../dom/Element';

export interface FormItemOccurrenceViewConfig {
className: string;
Expand Down Expand Up @@ -36,7 +36,7 @@ export abstract class FormItemOccurrenceView
}

protected initListeners(): void {
if (this.isSagaEditableType()) {
if (this.isManagedType()) {
const updatePathCall = setInterval(() => {
this.updateInputElDataPath();
}, 1000);
Expand Down Expand Up @@ -144,10 +144,10 @@ export abstract class FormItemOccurrenceView
}

protected updateInputElDataPath(): void {
this.getDataPathElement().getEl().setAttribute(SagaHelper.DATA_ATTR, this.getDataPath()?.toString().replace(/\./g, '/'));
this.getDataPathElement().getEl().setAttribute(JukeAiHelper.DATA_ATTR, this.getDataPath()?.toString().replace(/\./g, '/'));
}

protected isSagaEditableType(): boolean {
protected isManagedType(): boolean {
return false;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
import * as $ from 'jquery';
import * as Q from 'q';
import {ClassHelper} from '../../../ClassHelper';
import {ObjectHelper} from '../../../ObjectHelper';
import {ValidationError} from '../../../ValidationError';
import {Property} from '../../../data/Property';
import {PropertyArray} from '../../../data/PropertyArray';
import {Value} from '../../../data/Value';
import {Element} from '../../../dom/Element';
import {FormInputEl} from '../../../dom/FormInputEl';
import {InputTypeViewContext} from '../InputTypeViewContext';
import {assertNotNull} from '../../../util/Assert';
import {i18n} from '../../../util/Messages';
import {AdditionalValidationRecord} from '../../AdditionalValidationRecord';
import {Input} from '../../Input';
import {InputValidityChangedEvent} from '../InputValidityChangedEvent';
import {Element} from '../../../dom/Element';
import {InputValidationRecording} from '../InputValidationRecording';
import {OccurrenceAddedEvent} from '../../OccurrenceAddedEvent';
import {OccurrenceRenderedEvent} from '../../OccurrenceRenderedEvent';
import {OccurrenceRemovedEvent} from '../../OccurrenceRemovedEvent';
import {OccurrenceRenderedEvent} from '../../OccurrenceRenderedEvent';
import {InputTypeViewContext} from '../InputTypeViewContext';
import {InputValidationRecording} from '../InputValidationRecording';
import {InputValidityChangedEvent} from '../InputValidityChangedEvent';
import {ValueChangedEvent} from '../ValueChangedEvent';
import {ClassHelper} from '../../../ClassHelper';
import {ObjectHelper} from '../../../ObjectHelper';
import {BaseInputType} from './BaseInputType';
import {InputOccurrenceView} from './InputOccurrenceView';
import {InputOccurrences} from './InputOccurrences';
import {assertNotNull} from '../../../util/Assert';
import {OccurrenceValidationRecord} from './OccurrenceValidationRecord';
import {BaseInputType} from './BaseInputType';
import {ValidationError} from '../../../ValidationError';
import {AdditionalValidationRecord} from '../../AdditionalValidationRecord';
import {i18n} from '../../../util/Messages';

export abstract class BaseInputTypeNotManagingAdd
extends BaseInputType {
Expand Down Expand Up @@ -398,7 +398,7 @@ export abstract class BaseInputTypeNotManagingAdd
});
}

isSagaEditable(): boolean {
isManaged(): boolean {
return false;
}
}
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import * as Q from 'q';
import {Property} from '../../../data/Property';
import {PropertyValueChangedEvent} from '../../../data/PropertyValueChangedEvent';
import {FormItemOccurrenceView, FormItemOccurrenceViewConfig} from '../../FormItemOccurrenceView';
import {Element} from '../../../dom/Element';
import {DivEl} from '../../../dom/DivEl';
import {Value} from '../../../data/Value';
import {PropertyPath} from '../../../data/PropertyPath';
import {InputOccurrence} from './InputOccurrence';
import {BaseInputTypeNotManagingAdd} from './BaseInputTypeNotManagingAdd';
import {ButtonEl} from '../../../dom/ButtonEl';
import {OccurrenceValidationRecord} from './OccurrenceValidationRecord';
import { Property } from '../../../data/Property';
import { PropertyPath } from '../../../data/PropertyPath';
import { PropertyValueChangedEvent } from '../../../data/PropertyValueChangedEvent';
import { Value } from '../../../data/Value';
import { ButtonEl } from '../../../dom/ButtonEl';
import { DivEl } from '../../../dom/DivEl';
import { Element } from '../../../dom/Element';
import { FormItemOccurrenceView, FormItemOccurrenceViewConfig } from '../../FormItemOccurrenceView';
import { BaseInputTypeNotManagingAdd } from './BaseInputTypeNotManagingAdd';
import { InputOccurrence } from './InputOccurrence';
import { OccurrenceValidationRecord } from './OccurrenceValidationRecord';

export interface InputOccurrenceViewConfig extends FormItemOccurrenceViewConfig {
inputTypeView: BaseInputTypeNotManagingAdd;
Expand Down Expand Up @@ -214,8 +214,8 @@ export class InputOccurrenceView
this.toggleClass('invalid', !!errorMessage);
}

protected isSagaEditableType(): boolean {
return this.inputTypeView.isSagaEditable();
protected isManagedType(): boolean {
return this.inputTypeView.isManaged();
}

protected getDataPathElement(): Element {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import {NumberHelper} from '../../../util/NumberHelper';
import {FormInputEl} from '../../../dom/FormInputEl';
import {ValueTypes} from '../../../data/ValueTypes';
import {i18n} from '../../../util/Messages';
import {BaseInputTypeNotManagingAdd} from '../support/BaseInputTypeNotManagingAdd';
import {InputTypeViewContext} from '../InputTypeViewContext';
import {Property} from '../../../data/Property';
import {AdditionalValidationRecord} from '../../AdditionalValidationRecord';
import {InputValueLengthCounterEl} from './InputValueLengthCounterEl';
import * as Q from 'q';
import {Value} from '../../../data/Value';
import {StringHelper} from '../../../util/StringHelper';
import {Element, LangDirection} from '../../../dom/Element';
import {ValueTypeConverter} from '../../../data/ValueTypeConverter';
import {ValueChangedEvent} from '../../../ValueChangedEvent';
import {ValueType} from '../../../data/ValueType';
import {TextInput} from '../../../ui/text/TextInput';
import {Locale} from '../../../locale/Locale';
import { Property } from '../../../data/Property';
import { Value } from '../../../data/Value';
import { ValueType } from '../../../data/ValueType';
import { ValueTypeConverter } from '../../../data/ValueTypeConverter';
import { ValueTypes } from '../../../data/ValueTypes';
import { Element, LangDirection } from '../../../dom/Element';
import { FormInputEl } from '../../../dom/FormInputEl';
import { Locale } from '../../../locale/Locale';
import { TextInput } from '../../../ui/text/TextInput';
import { i18n } from '../../../util/Messages';
import { NumberHelper } from '../../../util/NumberHelper';
import { StringHelper } from '../../../util/StringHelper';
import { ValueChangedEvent } from '../../../ValueChangedEvent';
import { AdditionalValidationRecord } from '../../AdditionalValidationRecord';
import { InputTypeViewContext } from '../InputTypeViewContext';
import { BaseInputTypeNotManagingAdd } from '../support/BaseInputTypeNotManagingAdd';
import { InputValueLengthCounterEl } from './InputValueLengthCounterEl';

export abstract class TextInputType
extends BaseInputTypeNotManagingAdd {
Expand Down Expand Up @@ -162,7 +162,7 @@ export abstract class TextInputType
});
}

isSagaEditable(): boolean {
isManaged(): boolean {
return true;
}
}
Loading

0 comments on commit 9ce339e

Please sign in to comment.