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

SOF-6794: add more rjsf widgets #29

Merged
merged 5 commits into from
Oct 31, 2023
Merged

SOF-6794: add more rjsf widgets #29

merged 5 commits into from
Oct 31, 2023

Conversation

zoomchik
Copy link
Contributor

@zoomchik zoomchik commented Sep 4, 2023

No description provided.


type InfoPopoverOptions = InfoPopoverProps & { content: string };

export default function InputWithInfoPopover(props: WidgetProps) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if we should mark somewhere what role the components fulfill (e.g. Template, Widget, or Field). If we plan to add a couple of more RJSF components, then perhaps we can divide them into subfolders named templates, widgets, and fields. As we have only 4 right now, perhaps a simple JSDoc string would suffice. What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agree, dividing into subfolders make a clean separation.

Copy link
Contributor

@azech-hqs azech-hqs left a comment

Choose a reason for hiding this comment

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

looks good 👍


export default function InputWithInfoPopover(props: WidgetProps) {
const { uiSchema } = props;
const infoPopover = (uiSchema ? uiSchema["ui:options"]?.infoPopover : {}) as InfoPopoverOptions;
Copy link
Member

Choose a reason for hiding this comment

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

That's a very strange type casting here.
And later you use it with conditions like infoPopover?.title as it can be null or undefined

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Typed it more explicitly


const { BaseInputTemplate } = Templates;

type InfoPopoverOptions = InfoPopoverProps & { content: string };
Copy link
Member

Choose a reason for hiding this comment

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

I found you defined this type three times in this PR.
Why is that needed?

@zoomchik zoomchik merged commit a7d64c1 into main Oct 31, 2023
2 checks passed
@zoomchik zoomchik deleted the feature/SOF-6794 branch October 31, 2023 19:37
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