Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor (and delete?) the src/mixins/base-input.js::change() method #393

Open
1 task done
volterra79 opened this issue Mar 28, 2023 · 2 comments
Open
1 task done
Assignees
Labels
refactoring Anything which could result in a API change
Milestone

Comments

@volterra79
Copy link
Member

volterra79 commented Mar 28, 2023

Checklist

  • I've searched through the current issues to make sure this feature hasn't been requested already.

Motivation

There is a lot of confusion about input change of state.value fields (form's input).

It can be changed by input itself or in some other way (eg. result of default_expression).

Suggested solution

Remove change (mixin base-input) method:

// called when input value change
change() {
this.service.setEmpty();
this.service.setUpdate();
// validate input if is required or need to be unique
if (this.state.validate.required || this.state.validate.unique) this.service.validate();
// emit change input
this.$emit('changeinput', this.state);
},

in favor of a common state.value watcher (or another way).

Alternatives considered

No response

@volterra79 volterra79 added feature New feature or request refactoring Anything which could result in a API change labels Mar 28, 2023
@volterra79 volterra79 added this to the v3.8 milestone Mar 28, 2023
@volterra79 volterra79 self-assigned this Mar 28, 2023
@Raruto Raruto removed the feature New feature or request label Mar 29, 2023
@Raruto
Copy link
Collaborator

Raruto commented Mar 29, 2023

I know it's a much broader topic, but I'm also of the opinion that some classes and functions (in here) could be moved directly into the editing plugin.

If then in the future some similar features will be necessary within other plugins (eg. editing some of the layer properties), it would be safier to re-implement that functionality within each "external" plugin (or that at least that this third party plugin should relies mostly on classes provided by the editing plugin, and not somewhere in between) .

@volterra79
Copy link
Member Author

@Raruto I agree. It is just a remainder to don't forget to refactor editing in better way

@volterra79 volterra79 modified the milestones: v3.8, v3.9 Mar 29, 2023
@Raruto Raruto changed the title Refactor and optimize Input Form state.value fields change and change() method Refactor (and delete?) the src/mixins/base-input.js::change() method Aug 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactoring Anything which could result in a API change
Projects
None yet
Development

No branches or pull requests

2 participants