mirror of
https://github.com/fleetdm/fleet
synced 2026-05-23 17:08:53 +00:00
Add success notification for creating and updating labels (#1205)
- Add "Label created. Try refreshing this page in just a moment to see the updated host count for your label." message after the user successfully creates a label.
This commit is contained in:
parent
6290bb24e6
commit
a21d027518
2 changed files with 15 additions and 2 deletions
|
|
@ -46,6 +46,9 @@ describe("Label flow", () => {
|
|||
|
||||
cy.findByRole("button", { name: /update label/i }).click();
|
||||
|
||||
// Close success notification
|
||||
cy.get(".flash-message__remove").click();
|
||||
|
||||
cy.findByRole("button", { name: /delete/i }).click();
|
||||
|
||||
// Can't figure out how attach findByRole onto modal button
|
||||
|
|
|
|||
|
|
@ -203,7 +203,12 @@ export class ManageHostsPage extends PureComponent {
|
|||
return dispatch(labelActions.update(selectedLabel, updateAttrs))
|
||||
.then(() => {
|
||||
dispatch(push(`${PATHS.MANAGE_HOSTS}/${selectedFilter}`));
|
||||
|
||||
dispatch(
|
||||
renderFlash(
|
||||
"success",
|
||||
"Label updated. Try refreshing this page in just a moment to see the updated host count for your label."
|
||||
)
|
||||
);
|
||||
return false;
|
||||
})
|
||||
.catch(() => false);
|
||||
|
|
@ -234,7 +239,12 @@ export class ManageHostsPage extends PureComponent {
|
|||
|
||||
return dispatch(labelActions.create(formData)).then(() => {
|
||||
dispatch(push(PATHS.MANAGE_HOSTS));
|
||||
|
||||
dispatch(
|
||||
renderFlash(
|
||||
"success",
|
||||
"Label created. Try refreshing this page in just a moment to see the updated host count for your label."
|
||||
)
|
||||
);
|
||||
return false;
|
||||
});
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue