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

Add ResourceSelector component #3

Merged
merged 3 commits into from
Nov 8, 2021
Merged

Add ResourceSelector component #3

merged 3 commits into from
Nov 8, 2021

Conversation

andresmgot
Copy link
Collaborator

@andresmgot andresmgot commented Nov 5, 2021

Common component for a ResourceSelector:

Screenshot from 2021-11-05 13-35-30

Epic at #28
Design doc

This has been extracted from the current implementation of the same component in Redshift (not really much to review here).

One thing to notice is that I had to upgrade some @grafana dependencies.

@andresmgot andresmgot requested review from a team, iwysiu and sarahzinger and removed request for a team November 5, 2021 12:37
Copy link
Member

@sarahzinger sarahzinger left a comment

Choose a reason for hiding this comment

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

Looks great!

Part of me wonders if this stuff should just live in grafana/ui since there is not a lot specific here to a resource or sql or aws. But I'm cool with moving this here for now and if we ever want them in other datasources we could move them out then!

@@ -2,19 +2,19 @@

exports[`ConnectionConfig should render component 1`] = `
<fieldset
className="css-lq6a48"
Copy link
Member

Choose a reason for hiding this comment

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

Should we use this opportunity to get rid of the snap file entirely?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I agree, the test is a bit pointless


return (
<InlineField label={props.label} labelWidth={props.labelWidth} tooltip={props.tooltip}>
<div data-testid={props['data-testid']} title={props.title}>
Copy link
Member

Choose a reason for hiding this comment

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

why do we use title again? Can we just remove it? I think generally we want to avoid title attributes if we can: https://www.a11yproject.com/posts/2013-04-22-title-attributes/

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I am using it to show a message when the input is disabled:

Screenshot from 2021-11-05 15-58-09

Is there a better way of doing this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

merging this now, let me know if you have a suggestion for this! (I can open a new pr for that)

@andresmgot andresmgot merged commit 8167026 into main Nov 8, 2021
@andresmgot andresmgot deleted the resourceSelector branch November 8, 2021 11:15
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.

None yet

2 participants