Skip to content

angular: add option to toggle off errors without user interaction#2583

Merged
sdirix merged 5 commits into
eclipsesource:masterfrom
pedroestabruxelles:mark-touched-optional
May 29, 2026
Merged

angular: add option to toggle off errors without user interaction#2583
sdirix merged 5 commits into
eclipsesource:masterfrom
pedroestabruxelles:mark-touched-optional

Conversation

@pedroestabruxelles
Copy link
Copy Markdown
Contributor

By default the library is marking all fields as touched, to avoid creating regressions I added an option to toggle this behavior off.

Added as a component option or as a global configuration.
Since everything is being treated as "any" which is not really a good convention for this component I added an interface with the new option, where for now will be only available on Angular (feel free to move to the core if someone wants to implement on the other frameworks).

Fixes #2458

@netlify
Copy link
Copy Markdown

netlify Bot commented May 22, 2026

Deploy Preview for jsonforms-examples ready!

Name Link
🔨 Latest commit 1b60813
🔍 Latest deploy log https://app.netlify.com/projects/jsonforms-examples/deploys/6a199b709e705100078b5414
😎 Deploy Preview https://deploy-preview-2583--jsonforms-examples.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented May 22, 2026

CLA assistant check
All committers have signed the CLA.

@sdirix
Copy link
Copy Markdown
Member

sdirix commented May 28, 2026

Thanks for the PR. However we can only accept it in case you sign the CLA

@pedroestabruxelles
Copy link
Copy Markdown
Contributor Author

Already did not sure it's still saying I haven't. I've give another try.

@pedroestabruxelles
Copy link
Copy Markdown
Contributor Author

"You have agreed to the CLA for multiple repositories or organizations"
The form is blocked so not sure what am I supposed to do additionally?
@sdirix

@sdirix
Copy link
Copy Markdown
Member

sdirix commented May 28, 2026

Looks like the commit author points to a different Github account than the one you signed the CLA with, i.e. pedro-fernandes-bxl vs pedroestabruxelles

Copy link
Copy Markdown
Member

@sdirix sdirix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution. I had a look over the code, please see my comments.

Comment thread packages/angular/src/library/abstract-control.ts Outdated
Comment thread packages/angular/src/library/index.ts Outdated
Comment thread packages/angular/src/library/jsonforms.config.ts Outdated
@pedroestabruxelles
Copy link
Copy Markdown
Contributor Author

Looks like the commit author points to a different Github account than the one you signed the CLA with, i.e. pedro-fernandes-bxl vs pedroestabruxelles

Oh snap, forgot about that. I guess I will have to redo the whole thing on my personal laptop.

@sdirix
Copy link
Copy Markdown
Member

sdirix commented May 28, 2026

You could amend the existing commit and force push to switch the author

@coveralls
Copy link
Copy Markdown

coveralls commented May 29, 2026

Coverage Status

coverage: 83.105% (+0.2%) from 82.946% — pedroestabruxelles:mark-touched-optional into eclipsesource:master

@pedroestabruxelles pedroestabruxelles requested a review from sdirix May 29, 2026 10:12
Copy link
Copy Markdown
Member

@sdirix sdirix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the changes. Please have a look at my comments.

Comment thread packages/angular/src/library/jsonforms.config.ts

export const angularConfigDefault: JsonFormsAngularConfig = {
showErrorsOnTouch: false,
};
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

angularConfigDefault is redundant: showErrorsOnTouch: false is equivalent to undefined in the !appliedUiSchemaOptions.showErrorsOnTouch check. Dropping the const (and the merges referencing it in jsonforms-root.component.ts) would simplify the wiring and we don't need a framework-specific default at all.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

this.readonly = !this.readonly;
}

toggleShowErrorsImmediately() {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leftover naming from the previous iteration. Rename to toggleShowErrorsOnTouch to match the config flag.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

*/
import { registerExamples } from '../register';

export const schema = {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this example needed? There is nothing "show-errors-on-touch" related in here? So we can just skip all the examples changes?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed, it was to test with all component as required.

@pedroestabruxelles pedroestabruxelles requested a review from sdirix May 29, 2026 13:16
sdirix
sdirix previously approved these changes May 29, 2026
Comment thread packages/angular/src/library/jsonforms.config.ts Outdated
@sdirix sdirix enabled auto-merge (squash) May 29, 2026 15:40
@sdirix sdirix merged commit 755cfe1 into eclipsesource:master May 29, 2026
13 of 14 checks passed
@sdirix
Copy link
Copy Markdown
Member

sdirix commented May 29, 2026

Thanks for the contribution ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Angular - Formcontrol is always touched

4 participants