Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat: WorkspaceSection action #1623

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

Merged
merged 1 commit into from
May 20, 2022
Merged

Conversation

greyscaled
Copy link
Contributor

Summary

This prepares the WorkspacesSection component (via props & Storybook) for the
changes needed in #1455.

Details

This PR is a squash of refactors and improvements in our Workspace and
WorkspaceSection components. An action prop is added to WorkspaceSection
and along the way, I refactored things that were not meeting conventions
or were hard to read. With this addition, I am further unblocked in
making auto-start/off editable in the UI, as I intend to use the Action
prop to trigger a modal (or routed page view) with the form.

Squashed commits:

  • refactor: spaces for readability
    It's hard to read HTMl markup without spaces on adjacent nodes

  • refactor: props
    Our components had unused props and arbitrary ordering.

Impact of Change

This PR is a squash of refactors and improvements in our Workspace and
WorkspaceSection components. An action prop is added to WorkspaceSection
and along the way, I refactored things that were not meeting conventions
or were hard to read. With this addition, I am further unblocked in
making auto-start/off editable in the UI, as I intend to use the Action
prop to trigger a modal (or routed page view) with the form.

Squashed commits:

* refactor: spaces for readability
It's hard to read HTMl markup without spaces on adjacent nodes

* refactor: props
Our components had unused props and arbitrary ordering.
@greyscaled greyscaled requested a review from a team as a code owner May 20, 2022 15:22
Comment on lines -12 to +16
organization?: TypesGen.Organization
workspace: TypesGen.Workspace
template?: TypesGen.Template
handleStart: () => void
handleStop: () => void
handleRetry: () => void
handleUpdate: () => void
workspace: TypesGen.Workspace
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Review:

  • oraganization and template were unused (note this is one caveat when a prop is optional, we don't really know if we're even using it. I wonder if there's a lint rule that can help with that, but suffice it to say I just checked which of these the component was de-structuring. Also this is why de-structuring props is superior to the prop arg...it's helpful to see where everything is being used with a simple find/replace).
  • Furthermore, the grouping was odd. I'll add a note about organizing props in our FE V, but essentially, I think what I see in most codebases is alphabetical but mandatory props are grouped in front of optional props. We can also use a different convention, what matters to me is "at a glance" behaviors. Mix-n-match requires more brain power to read.

<WorkspaceSection title="Resources">
<Placeholder />
</WorkspaceSection>
</div>

Copy link
Contributor Author

@greyscaled greyscaled May 20, 2022

Choose a reason for hiding this comment

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

Review: Will add this to FE V and search for lint rule. zero spaces in HTML markup makes me dizzy!

</IconButton>
),
title: "Action Section",
}
Copy link
Contributor Author

@greyscaled greyscaled May 20, 2022

Choose a reason for hiding this comment

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

Review: We forgot to add this story additionally, but now it's here and with two examples. I couldn't think of an example for contentProps because it's mostly used to inject styles or classes.

@greyscaled greyscaled changed the title feat: WorkspaceSection action, styles feat: WorkspaceSection action May 20, 2022
@greyscaled greyscaled self-assigned this May 20, 2022
Copy link
Collaborator

@BrunoQuaresma BrunoQuaresma left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@jsjoeio jsjoeio left a comment

Choose a reason for hiding this comment

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

Your PR description and comments made this a breeze to review. You're setting the bar high for the rest of us! Nice work 🚀

@greyscaled greyscaled merged commit 4f70f84 into main May 20, 2022
@greyscaled greyscaled deleted the vapurrmaid/gh-1455/part-1/refactors branch May 20, 2022 15:55
@greyscaled
Copy link
Contributor Author

I guess this doesn't matter as much anymore because of #1450

kylecarbs pushed a commit that referenced this pull request Jun 10, 2022
This PR is a squash of refactors and improvements in our Workspace and
WorkspaceSection components. An action prop is added to WorkspaceSection
and along the way, I refactored things that were not meeting conventions
or were hard to read. With this addition, I am further unblocked in
making auto-start/off editable in the UI, as I intend to use the Action
prop to trigger a modal (or routed page view) with the form.

Squashed commits:

* refactor: spaces for readability
It's hard to read HTMl markup without spaces on adjacent nodes

* refactor: props
Our components had unused props and arbitrary ordering.
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.

3 participants