Skip to content

refactor: use WidgetsIcon for null resources #3754

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

Conversation

jsjoeio
Copy link
Contributor

@jsjoeio jsjoeio commented Aug 30, 2022

This PR updates the icon used for null resources

image

Previous icon used:

image

h/t to @kconley-sq for the suggestion! 🎉

Also found another issue which I will tackle after this: #3767

@jsjoeio jsjoeio requested a review from a team as a code owner August 30, 2022 15:00
@jsjoeio jsjoeio removed the request for review from a team August 30, 2022 15:00
@jsjoeio jsjoeio requested a review from Kira-Pilot August 30, 2022 15:00
@jsjoeio jsjoeio self-assigned this Aug 30, 2022
@jsjoeio jsjoeio removed the request for review from Kira-Pilot August 30, 2022 15:07
@bpmct
Copy link
Member

bpmct commented Aug 30, 2022

NICE! 👍🏼

@bpmct
Copy link
Member

bpmct commented Aug 30, 2022

@jsjoeio is the unknown resource still a ? or does this also apply to unknown resources? (e.g. aws_spot_instance_request)

Screen Shot 2022-08-30 at 10 13 17 AM

Edit: answered my own question, I think we should changed this to the widget icon too

const IconComponent = iconByResource[type] ?? HelpIcon

@bpmct
Copy link
Member

bpmct commented Aug 30, 2022

resolves #3301

@jsjoeio jsjoeio marked this pull request as draft August 30, 2022 15:29
@jsjoeio
Copy link
Contributor Author

jsjoeio commented Aug 30, 2022

Edit: answered my own question, I think we should changed this to the widget icon too

Nice catch! I'll update that now then re-request a review.

// this resource can return undefined
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
const IconComponent = iconByResource[type] ?? HelpIcon
const IconComponent = iconByResource[type] ?? WidgetsIcon
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since the resource can be undefined, I modified the return type of iconByResource to match that, which lets us remove this eslint line.

@jsjoeio jsjoeio requested a review from presleyp August 30, 2022 15:44
@jsjoeio jsjoeio marked this pull request as ready for review August 30, 2022 15:45
@jsjoeio jsjoeio requested review from BrunoQuaresma and bpmct August 30, 2022 15:45
@jsjoeio jsjoeio marked this pull request as draft August 30, 2022 16:07
@jsjoeio jsjoeio force-pushed the 3301-user-can-interpret-the-question-mark-icon-in-the-resources-list-as-some-kind-of-problem branch from 728ceeb to 459cbd9 Compare August 30, 2022 23:06
Based on user feedback, we believe the `WidgetsIcon` will cause less
confusion.
Before, we were using `string` for `type` in `ResourceAvatar`. This
meant it wasn't tied to the types generated from the backend.

Now it imports `WorkspaceResource` so that there is a single source of
truth and they always stay in sync.
@jsjoeio jsjoeio force-pushed the 3301-user-can-interpret-the-question-mark-icon-in-the-resources-list-as-some-kind-of-problem branch from 459cbd9 to 6716acc Compare August 30, 2022 23:22
@jsjoeio jsjoeio requested a review from bpmct August 30, 2022 23:28
@jsjoeio jsjoeio marked this pull request as ready for review August 30, 2022 23:28
@jsjoeio jsjoeio merged commit e6802f0 into main Aug 31, 2022
@jsjoeio jsjoeio deleted the 3301-user-can-interpret-the-question-mark-icon-in-the-resources-list-as-some-kind-of-problem branch August 31, 2022 14:44
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.

User can interpret the question mark icon in the resources list as some kind of problem
3 participants