fleet
fleet copied to clipboard
Fleet UI: Button loading spinners
Cerra #6666
Fix
- All UI
Buttonthat post to the API contain loading spinners using theisLoadingparameter and adding the appropriate className*button-name*-loading - Buttons: save, save label, update label, save policy, save query pack, add query, create, transfer, schedule, download installer, delete, remove
- Fix any modals that show the loading spinner across the whole modal when it updates the API to just show the loading spinner on the CTA button
Other tech debt
- Rename
DeletePoliciesModal.tsxtoDeletePolicyModal.tsxto match every otherDelete*singularnoun*Modal.tsxnaming convention - Style
modal-cta-wrapbuttons globally removing all reused${baseClass}__btn-wrapstyling - Fix className
add-policy-modal__modaltoadd-policy-modal - Fix use of className
button button--brandorbutton button--unstyledto usevariantparameterbrandorunstyled - Fix alignment for show, copy, edit, delete icons for Enroll secret modal
- Fix
SecretEditorModal.tsxto useISecretEditorModalPropsnotIAddSecretModal - Standardize everything to
isLoading*Item*andisUpdating*Item*(some were written asis*Item*Loading, e.g.isLoadingLabels,isUpdatingHosts)
Screenshot examples (Delete, Save label, Remove, Schedule):

Checklist for submitter
If some of the following don't apply, delete the relevant line.
- [x] Changes file added for user-visible changes (in
changes/and/ororbit/changes/). - [x] Manual QA for all new/changed functionality
The best version of this kind of spinner I've seen is Angular Material's loading spinner: https://material.angular.io/components/progress-spinner/overview. It's also works very well inside a button. Of course, we want use that because it's specific to Angular, but I'm going to poke around and see if I can find a CSS-only version we can use.
Here's an example of a CSS-only version that I customized a bit: https://codepen.io/lukeheath-the-encoder/pen/JjLaWMw
Here's an example of a CSS-only version that I customized a bit: https://codepen.io/lukeheath-the-encoder/pen/JjLaWMw
Super clean!!!!
Looks great! ✨
I would like to update the white background version so we're using a single spinner throughout. I'll take a closer look at that this week. Since this is not an urgent issue, we can push this feature to the next release.
Let me know if you're able to make it a single spinner. I was wrestling with it but the animation is attached to one color only and I couldn't get it to render different colors for the same element.
Let me know if you're able to make it a single spinner. I was wrestling with it but the animation is attached to one color only and I couldn't get it to render different colors for the same element.
@RachelElysia Just put in a PR to your branch with some changes: https://github.com/RachelElysia/fleet/pull/51. Let me know what you think! If it looks good, feel free to merge in and take it from here. I tested and all seems good but always good to get another set of eyes.
@lukeheath This is good to go! Would love to merge early next week to avoid more merge conflicts since it touches so many files!