18559: Update user profile cypress tests and fix minor issues
[arvados-workbench2.git] / src / store / user-profile / user-profile-actions.ts
index 4d3d34aaf24969bfe7371b7cfff8f9545c1341a6..9935518b98286e083ca29df33f8390a03e5e23b8 100644 (file)
@@ -114,6 +114,10 @@ export const setup = (uuid: string) =>
     try {
       const resources = await services.userService.setup(uuid);
       dispatch(updateResources(resources.items));
+
+      // Refresh data explorer
+      dispatch(UserProfileGroupsActions.REQUEST_ITEMS());
+
       dispatch(snackbarActions.OPEN_SNACKBAR({ message: "User has been setup", hideDuration: 2000, kind: SnackbarKind.SUCCESS }));
     } catch (e) {
       dispatch(snackbarActions.OPEN_SNACKBAR({ message: e.message, hideDuration: 2000, kind: SnackbarKind.ERROR }));
@@ -127,6 +131,10 @@ export const activate = (uuid: string) =>
     try {
       const user = await services.userService.activate(uuid);
       dispatch(updateResources([user]));
+
+      // Refresh data explorer
+      dispatch(UserProfileGroupsActions.REQUEST_ITEMS());
+
       dispatch(snackbarActions.OPEN_SNACKBAR({ message: "User has been activated", hideDuration: 2000, kind: SnackbarKind.SUCCESS }));
     } catch (e) {
       dispatch(snackbarActions.OPEN_SNACKBAR({ message: e.message, hideDuration: 2000, kind: SnackbarKind.ERROR }));
@@ -152,6 +160,9 @@ export const deactivate = (uuid: string) =>
       // Remove all users membership locally
       dispatch<any>(deleteResources(memberships.map(link => link.uuid)));
 
+      // Refresh data explorer
+      dispatch(UserProfileGroupsActions.REQUEST_ITEMS());
+
       dispatch(snackbarActions.OPEN_SNACKBAR({
         message: "User has been deactivated.",
         hideDuration: 2000,