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

[KED-2981] Re-write Kedro UI buttons #716

Merged
merged 10 commits into from
Jan 28, 2022

Conversation

rashidakanchwala
Copy link
Contributor

@rashidakanchwala rashidakanchwala commented Jan 25, 2022

Description

This PR is a part of the Kedro-UI migration ticket. In this PR we migrate the button functionality from Kedro-ui to Kedro-viz

Development notes

The Kedro-UI button functionality had lot of styles that we weren't using in Kedro-viz. So I have made that simple in this PR. In Kedro-UI, we have primary button, second button, small button, button with wipe transition. For consistency sake, I have used only one button style (primary) for all buttons on Kedro-viz. Additionally added the size small since it was used in the experiment tracking. I have removed secondary button style (which was also used for experiment tracking) and also removed the wipe transition (used in large pipeline warning) for the sake of consistency and simplicity.

UPDATE - As per the discussion with Tynan, and Gabriel in the check-in, I have added secondary mode for buttons (since it's used). I have removed wipe transition which was used in large pipelines - and Gabriel is comfortable with it.
I have also removed disable since we are not using it atm.

QA notes

Checklist

  • Read the contributing guidelines
  • Opened this PR as a 'Draft Pull Request' if it is work-in-progress
  • Updated the documentation to reflect the code changes
  • Added new entries to the RELEASE.md file
  • Added tests to cover my changes

@rashidakanchwala rashidakanchwala self-assigned this Jan 25, 2022
@rashidakanchwala rashidakanchwala marked this pull request as draft January 25, 2022 09:33
@rashidakanchwala rashidakanchwala marked this pull request as ready for review January 25, 2022 09:53
Signed-off-by: Rashida Kanchwala <[email protected]>
…org/kedro-viz into KED-2981/rewrite-kedro-ui-buttons
@tynandebold
Copy link
Member

Just a quick comment off the top: I think we need to keep the secondary button style (and really any other styles that were used in Viz).

For example, the edit runs modal has two button styles:
Screen Shot 2022-01-25 at 10 03 44

Though with your change it looks like this:
Screen Shot 2022-01-25 at 10 02 19

There should be some differentiation between those two.

Signed-off-by: Rashida Kanchwala <[email protected]>
Copy link
Member

@tynandebold tynandebold 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! Just one tiny comment about not removing the theme prop in one file, but it's not a blocker :)

@@ -181,7 +181,7 @@ const ExperimentWrapper = ({ theme }) => {
rel="noreferrer"
target="_blank"
>
<Button theme={theme}>View docs</Button>
Copy link
Member

Choose a reason for hiding this comment

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

I noticed you're removing the theme prop here, which is fine, but didn't remove it on the buttons in the src/components/export-modal/export-modal.js file. I wonder why? I think you can remove it there as well can't you?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, i will remove it :) .. thanks!

Signed-off-by: Rashida Kanchwala <[email protected]>
Comment on lines 14 to 15
`kui-button__btn--${size}`,
`kui-button__btn--${mode}`
Copy link
Contributor

Choose a reason for hiding this comment

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

Just curious... what's up with the ` instead of '?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's called template literals similar to f-string or % in python ( https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals)

Copy link
Contributor

Choose a reason for hiding this comment

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

Ahh cool, thank you!

Copy link
Contributor

@studioswong studioswong left a comment

Choose a reason for hiding this comment

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

I just had an initial skim through and tested the button, looks good! I'll do a more through dive into the code and let you know if I spot anything.

Please update the release notes for this feature in the meantime :)

--color-button__text: #{rgba($color-light, 0.85)};
}

.kui-button {
Copy link
Contributor

@studioswong studioswong Jan 27, 2022

Choose a reason for hiding this comment

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

Please remove references of kui and rename all css classnames for this component to either kedro-button or just button ( also note that we are moving away from the pipeline prefix as well, which we have started doing from the experiment tracking components and will do so for new components moving forward)

Copy link
Contributor

@studioswong studioswong left a comment

Choose a reason for hiding this comment

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

The code overall looks good! Requesting changes mainly for renaming the button classes as we are moving away from kui references. (I understand we have used kui-theme for the theme naming for the overall app given our previous setup and links to kui, which I have put in a ticket to rename those class name to strip away the kui reference( just theme--light or theme--dark, and can be done in one go after we have migrated all kui elements.)

Signed-off-by: Rashida Kanchwala <[email protected]>
Copy link
Contributor

@studioswong studioswong left a comment

Choose a reason for hiding this comment

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

Nice one 👏

@rashidakanchwala rashidakanchwala merged commit 492c25f into main Jan 28, 2022
@rashidakanchwala rashidakanchwala deleted the KED-2981/rewrite-kedro-ui-buttons branch January 28, 2022 09:42
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