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

Update D&D action button loading behavior #5201

Merged
merged 5 commits into from
Aug 20, 2024

Conversation

jpople
Copy link
Contributor

@jpople jpople commented Aug 15, 2024

Closes PROD-2547

Description Of Changes

Updates loading behavior on D&D action buttons; spinner now renders inside of button corresponding to action that's loading. Also adds loading state to discovery monitor table "Scan" action button.

Previous behavior:

Screen.Recording.2024-08-15.at.09.20.16.mov

New behavior:

Screen.Recording.2024-08-15.at.09.20.48.mov

Code Changes

  • Refactor ActionButton component to use more of Chakra's built-in button props

Pre-Merge Checklist

  • All CI Pipelines Succeeded
  • Issue Requirements are Met
  • Update CHANGELOG.md

Copy link

vercel bot commented Aug 15, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
fides-plus-nightly ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 20, 2024 7:46pm

Copy link

cypress bot commented Aug 15, 2024



Test summary

4 0 0 0


Run details

Project fides
Status Passed
Commit d25a754b22 ℹ️
Started Aug 20, 2024 7:51 PM
Ended Aug 20, 2024 7:52 PM
Duration 00:37 💡
OS Linux Ubuntu -
Browser Electron 106

View run in Cypress Cloud ➡️


This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Cloud

Copy link
Contributor

@gilluminate gilluminate left a comment

Choose a reason for hiding this comment

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

Looks good overall! Just a best-practice suggestion on the ActionButton component itself.

<Text marginLeft={icon && 1} fontWeight="semibold" fontSize={12}>
{title}
</Text>
{title}
</Button>
);
Copy link
Contributor

Choose a reason for hiding this comment

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

Since you are extending all ButtonProps in the interface now, you should be able to simplify this quite a bit just by passing all of those props along to the Button. A good best-practice for making custom components a true extension of the original.

const ActionButton = ({
  title,
  icon,
  variant = "outline",
  ...props
}: ActionButtonProps) => (
  <Button
    size="xs"
    variant={variant}
    data-testid={`action-${title}`}
    loadingText={title}
    leftIcon={icon}
    {...props}
  >
    {title}
  </Button>
);

@jpople jpople merged commit f582841 into main Aug 20, 2024
13 checks passed
@jpople jpople deleted the jpople/prod-2547/dnd-button-spinner branch August 20, 2024 21:55
Copy link

cypress bot commented Aug 20, 2024



Test summary

4 0 0 0


Run details

Project fides
Status Passed
Commit f582841
Started Aug 20, 2024 10:07 PM
Ended Aug 20, 2024 10:07 PM
Duration 00:35 💡
OS Linux Ubuntu -
Browser Electron 106

View run in Cypress Cloud ➡️


This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Cloud

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.

2 participants