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

Added choice radio button handling #1798

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from

Conversation

GuidoZam
Copy link
Contributor

Q A
Bug fix? [ ]
New feature? [x]
New sample? [ ]
Related issues? fixes #1797

What's in this Pull Request?

Added handling of the choice field when set to radio button instead of dropdown.

@joelfmrodrigues joelfmrodrigues self-assigned this May 14, 2024
@joelfmrodrigues
Copy link
Collaborator

@GuidoZam many thanks for the improvements. I reviewed it and all seems fine, but I will consider waiting for #1726 to avoid conflicts. If the other PR doesn't move forward quickly, I will then merge this PR first.

@GuidoZam
Copy link
Contributor Author

Thanks @joelfmrodrigues for the update, I'll wait for the merge 😁

@IRRDC
Copy link
Contributor

IRRDC commented Jul 2, 2024

I just wrote the same feature and then I found this :-)
Is it going to be included in a release build soon?

@GuidoZam
Copy link
Contributor Author

GuidoZam commented Jul 2, 2024

@IRRDC I think we're still waiting for the other PR.
@joelfmrodrigues do you have any news?

@joelfmrodrigues
Copy link
Collaborator

@GuidoZam hi, sorry I have been struggling to find time and was a bit away from things for personal reasons. Hope to get moving again soon

@GuidoZam
Copy link
Contributor Author

GuidoZam commented Jul 2, 2024

Hope everything's fine @joelfmrodrigues!
I didn't want to rush you, I was just checking 😉

@IRRDC
Copy link
Contributor

IRRDC commented Jul 3, 2024

@GuidoZam I tested your code and would suggest that you remove these two lines:
Zwischenablage04
since they lead to duplicate labels and make the field always required.
Before removing them:
Zwischenablage013
After removing them:
Zwischenablage02

@GuidoZam
Copy link
Contributor Author

GuidoZam commented Jul 3, 2024

Thanks for the feedback @IRRDC!!
I've updated the code.

@michaelmaillot
Copy link
Collaborator

Hi Guido, would you mind updating your branch / PR regarding conflicts? Thanks.

@GuidoZam
Copy link
Contributor Author

Hi @michaelmaillot, I've resolved the conflicts.

Copy link
Collaborator

@michaelmaillot michaelmaillot 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 update!

I think you've missed the choiceType variable init during the PR's sync with dev branch here:

// Store the choice type for Choice fields
// This represent the format of the choice field (Dropdown or Radio Buttons)
choiceType = field.FormatType;

A few things to update and we should be fine.

{labelEl}
</div>
<Dropdown
let choiceControl: any = undefined;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
let choiceControl: any = undefined;
let choiceControl: JSX.Element = undefined;

<Icon className={styles.fieldIcon} iconName={customIcon ?? "CheckMark"} />
{labelEl}
</div>
{choiceControl}
{descriptionEl}
</div>;

Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
}

@@ -191,18 +191,46 @@ export class DynamicFieldBase extends React.Component<IDynamicFieldProps, IDynam
}

case 'Choice':
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
case 'Choice':
case 'Choice': {

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.

4 participants