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

[AAE-12065] Add isDefault flag to dropdown #8771

Closed
wants to merge 4 commits into from

Conversation

DiogoABastos
Copy link
Contributor

@DiogoABastos DiogoABastos commented Jul 20, 2023

Please check if the PR fulfills these requirements

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

What kind of change does this PR introduce? (check one with "x")

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation
  • Other... Please describe:

What is the current behaviour? (You can also link to an open issue here)
If dropdown field had the same id as the DEFAULT_OPTION.id, it would be taken as the default option

https://alfresco.atlassian.net/browse/AAE-12065
https://github.com/Alfresco/alfresco-apps/pull/5894

What is the new behaviour?
Add isDefault flag to allow users to use the DEFAULT_OPTION.id as an id, without making such an option the default option
Is compatible with JSON forms previously created

Does this PR introduce a breaking change? (check one with "x")

  • Yes
  • No

If this PR contains a breaking change, please describe the impact and migration path for existing applications: ...

Other information:

Copy link
Contributor

@eromano eromano left a comment

Choose a reason for hiding this comment

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

what happens if isDefault is not present in the JSON because is a form previously created?

@DiogoABastos
Copy link
Contributor Author

what happens if isDefault is not present in the JSON because is a form previously created?

isDefault flag is defaulted to false. The problem is that when the dropdown has the default option enabled, it will be regarded as a normal option because of the isDefault's default value. I'll make some changes to account for that

Copy link
Contributor

@eromano eromano left a comment

Choose a reason for hiding this comment

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

can we add a unit that cover this scenario?

@sonarcloud
Copy link

sonarcloud bot commented Jul 24, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@DiogoABastos
Copy link
Contributor Author

No need for this changes anymore. https://alfresco.atlassian.net/browse/AAE-12065?focusedCommentId=1192290

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

Successfully merging this pull request may close these issues.

2 participants