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

chore(app): add hide text option to ModifiedDropdown #1688

Merged
merged 4 commits into from
May 30, 2024

Conversation

mbarrramsey
Copy link
Contributor

@mbarrramsey mbarrramsey commented May 29, 2024

Jira: https://wandb.atlassian.net/browse/WB-18777

Updates the ModifiedDropdown component to support hiding the input text prop so that we can display a JSX label as a dropdown option on its own. This will be used in the clone/ create report modal in an upcoming PR, https://github.com/wandb/core/pull/21754.

Before:

Screenshot 2024-05-29 at 12 50 58 PM

After:

Screen.Recording.2024-05-29.at.12.48.58.PM.mov

@circle-job-mirror
Copy link

circle-job-mirror bot commented May 29, 2024

@mbarrramsey mbarrramsey changed the title display label option chore(app): add label option to ModifiedDropdown May 29, 2024
@@ -477,7 +484,7 @@ type OptionWithTooltipProps = {
text: string | null;
};

const OptionWithTooltip: React.FC<OptionWithTooltipProps> = ({text}) => {
export const OptionWithTooltip: React.FC<OptionWithTooltipProps> = ({text}) => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

props.text = hideText ? null : (
<OptionWithTooltip text={opt.text as string} />
);
return props;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Adding the option to hide the text prop so that we can still search it's value, but only display the JSX label if we'd like

@mbarrramsey mbarrramsey marked this pull request as ready for review May 29, 2024 19:58
@mbarrramsey mbarrramsey requested a review from a team as a code owner May 29, 2024 19:58
@mbarrramsey mbarrramsey changed the title chore(app): add label option to ModifiedDropdown chore(app): add hide text option to ModifiedDropdown May 29, 2024
@mbarrramsey mbarrramsey merged commit 1801786 into master May 30, 2024
26 checks passed
@mbarrramsey mbarrramsey deleted the mbarrramsey/display_label_option branch May 30, 2024 18:29
@github-actions github-actions bot locked and limited conversation to collaborators May 30, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants