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

change: [M3-8175] - Refactor KubeConfigDrawer to use CodeBlock and add Codeblock story #11019

Merged
merged 6 commits into from
Oct 4, 2024

Conversation

hana-akamai
Copy link
Contributor

@hana-akamai hana-akamai commented Sep 30, 2024

Description 📝

Refactor KubeConfigDrawer component to use the CodeBlock component for UI consistency. I also moved CodeBlock to the components folder since it is pretty generic and added a story for it

Changes 🔄

List any change relevant to the reviewer.

  • Refactor KubeConfigDrawer to use CodeBlock component and minor cleanup
  • Moved CodeBlock from features to components folder and decoupled it a bit from Linode Create
  • Added CodeBlock story

Preview 📷

(info has been obscured)

Before After
image image

image

How to test 🧪

Prerequisites

Verification steps

(How to verify changes)

  • Create a cluster pointing to dev API

  • Once the cluster is provisioned, go to the cluster's details page

  • Click on View under Kubeconfig

  • Confirm new UI and no regressions

  • Delete the cluster afterward

  • Run storybook locally and confirm CodeBlock story

As an Author I have considered 🤔

Check all that apply

  • 👀 Doing a self review
  • ❔ Our contribution guidelines
  • 🤏 Splitting feature into small PRs
  • ➕ Adding a changeset
  • 🧪 Providing/Improving test coverage
  • 🔐 Removing all sensitive information from the code and PR description
  • 🚩 Using a feature flag to protect the release
  • 👣 Providing comprehensive reproduction steps
  • 📑 Providing or updating our documentation
  • 🕛 Scheduling a pair reviewing session
  • 📱 Providing mobile support
  • ♿ Providing accessibility support

@hana-akamai hana-akamai self-assigned this Sep 30, 2024
commandType: string;
language: 'bash';
handleCopyIconClick?: () => void;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added handleCopyIconClick to optionally override the component's internal handling of the copy icon which assumes the component is being used in Linode Create

@hana-akamai hana-akamai marked this pull request as ready for review September 30, 2024 20:22
@hana-akamai hana-akamai requested a review from a team as a code owner September 30, 2024 20:22
@hana-akamai hana-akamai requested review from carrillo-erik, coliu-akamai and cpathipa and removed request for a team September 30, 2024 20:22
@coliu-akamai
Copy link
Contributor

heads up - there's a few conflicts that need to be resolved

@hana-akamai hana-akamai force-pushed the M3-8175-codeblock-story branch from 4668a1f to 9618942 Compare October 3, 2024 21:43
@hana-akamai
Copy link
Contributor Author

@coliu-akamai thanks for the heads-up! Just rebased with develop to resolve conflicts

If you run into issues pulling, you might need to delete your pulled down branch and gh pr checkout 11019 again

Copy link

github-actions bot commented Oct 3, 2024

Coverage Report:
Base Coverage: 87.19%
Current Coverage: 87.18%

@harsh-akamai harsh-akamai self-requested a review October 4, 2024 11:51
Copy link
Contributor

@harsh-akamai harsh-akamai left a comment

Choose a reason for hiding this comment

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

PR looks good! 👍

@hana-akamai hana-akamai force-pushed the M3-8175-codeblock-story branch from 9618942 to 550de7f Compare October 4, 2024 18:13
Copy link
Contributor

@coliu-akamai coliu-akamai left a comment

Choose a reason for hiding this comment

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

✅ confirmed storybook works
✅ confirmed codeblock in KubeConfig
✅ reviewed codeblock in the LinodeCreate flow, looked/copied as expected

thanks Hana for the additional cleanup! 🎉

Wondering if we'd want to add comments for fields like command, handleCopyIconClick, ldTrackingKey?

Is it worth adding couple of tests for CodeBlock as well? I know it's a relatively simple component in comparison with others tho

@coliu-akamai
Copy link
Contributor

just saw this console error this when closing the View codeblock drawer for the Kubeconfig:

image

@hana-akamai
Copy link
Contributor Author

@coliu-akamai It's a pretty simple component so I don't think it needs any tests itself, but the other components using CodeBlock such as in the ApiAwarenessModal folder could use some tests (will address in a separate PR)!

Looks like the console error is an existing issue so I created M3-8713 to look into that

@hana-akamai hana-akamai merged commit 34d5d1f into linode:develop Oct 4, 2024
19 of 20 checks passed
@hana-akamai hana-akamai deleted the M3-8175-codeblock-story branch October 4, 2024 21:52
Copy link

cypress bot commented Oct 4, 2024

Cloud Manager E2E    Run #6625

Run Properties:  status check passed Passed #6625  •  git commit 34d5d1f83a: change: [M3-8175] - Refactor KubeConfigDrawer to use CodeBlock and add Codeblock...
Project Cloud Manager E2E
Branch Review develop
Run status status check passed Passed #6625
Run duration 24m 54s
Commit git commit 34d5d1f83a: change: [M3-8175] - Refactor KubeConfigDrawer to use CodeBlock and add Codeblock...
Committer Hana Xu
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 2
Tests that did not run due to a developer annotating a test with .skip  Pending 2
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 414
View all changes introduced in this branch ↗︎

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants