[arvados-workbench2] created: 2.6.2-2-gaba0f702
git repository hosting
git at public.arvados.org
Wed May 24 20:36:52 UTC 2023
at aba0f702843b8b385b8fe0c5d7b19f9cbbc433ac (commit)
commit aba0f702843b8b385b8fe0c5d7b19f9cbbc433ac
Author: Stephen Smith <stephen at curii.com>
Date: Wed May 24 16:35:06 2023 -0400
20538: Change confirmation dialog divs to block spans to get rid of warning
Arvados-DCO-1.1-Signed-off-by: Stephen Smith <stephen at curii.com>
diff --git a/src/components/confirmation-dialog/confirmation-dialog.tsx b/src/components/confirmation-dialog/confirmation-dialog.tsx
index 28b19bb9..fa09ffc6 100644
--- a/src/components/confirmation-dialog/confirmation-dialog.tsx
+++ b/src/components/confirmation-dialog/confirmation-dialog.tsx
@@ -26,8 +26,8 @@ export const ConfirmationDialog = (props: ConfirmationDialogProps & WithDialogPr
<DialogContent style={{ display: 'flex', alignItems: 'center' }}>
<WarningIcon />
<DialogContentText style={{ paddingLeft: '8px' }}>
- <div>{props.data.text}</div>
- <div>{props.data.info}</div>
+ <span style={{display: 'block'}}>{props.data.text}</span>
+ <span style={{display: 'block'}}>{props.data.info}</span>
</DialogContentText>
</DialogContent>
<DialogActions style={{ margin: '0px 24px 24px' }}>
commit 37504d34196d446ae8fa2e01fa84bdc0ecbbed78
Author: Stephen Smith <stephen at curii.com>
Date: Wed May 24 16:32:43 2023 -0400
20538: Add 403 error handling to remove process action and suppress errors from the containerRequestService
Arvados-DCO-1.1-Signed-off-by: Stephen Smith <stephen at curii.com>
diff --git a/src/services/common-service/common-resource-service.ts b/src/services/common-service/common-resource-service.ts
index d9be8dae..515eb6a4 100644
--- a/src/services/common-service/common-resource-service.ts
+++ b/src/services/common-service/common-resource-service.ts
@@ -13,6 +13,7 @@ export enum CommonResourceServiceError {
OWNERSHIP_CYCLE = 'OwnershipCycle',
MODIFYING_CONTAINER_REQUEST_FINAL_STATE = 'ModifyingContainerRequestFinalState',
NAME_HAS_ALREADY_BEEN_TAKEN = 'NameHasAlreadyBeenTaken',
+ PERMISSION_ERROR_FORBIDDEN = 'PermissionErrorForbidden',
UNKNOWN = 'Unknown',
NONE = 'None'
}
@@ -64,11 +65,11 @@ export const getCommonResourceServiceError = (errorResponse: any) => {
return CommonResourceServiceError.MODIFYING_CONTAINER_REQUEST_FINAL_STATE;
case /Name has already been taken/.test(error):
return CommonResourceServiceError.NAME_HAS_ALREADY_BEEN_TAKEN;
+ case /403 Forbidden/.test(error):
+ return CommonResourceServiceError.PERMISSION_ERROR_FORBIDDEN;
default:
return CommonResourceServiceError.UNKNOWN;
}
}
return CommonResourceServiceError.NONE;
};
-
-
diff --git a/src/store/processes/processes-actions.ts b/src/store/processes/processes-actions.ts
index b26c2017..4a27cba6 100644
--- a/src/store/processes/processes-actions.ts
+++ b/src/store/processes/processes-actions.ts
@@ -24,6 +24,7 @@ import { CommandOutputParameter } from "cwlts/mappings/v1.0/CommandOutputParamet
import { ContainerResource } from "models/container";
import { ContainerRequestResource, ContainerRequestState } from "models/container-request";
import { FilterBuilder } from "services/api/filter-builder";
+import { CommonResourceServiceError, getCommonResourceServiceError } from "services/common-service/common-resource-service";
export const loadProcess = (containerRequestUuid: string) =>
async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository): Promise<Process | undefined> => {
@@ -291,8 +292,17 @@ export const REMOVE_PROCESS_DIALOG = 'removeProcessDialog';
export const removeProcessPermanently = (uuid: string) =>
async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
- dispatch(snackbarActions.OPEN_SNACKBAR({ message: 'Removing ...', kind: SnackbarKind.INFO }));
- await services.containerRequestService.delete(uuid);
- dispatch(projectPanelActions.REQUEST_ITEMS());
- dispatch(snackbarActions.OPEN_SNACKBAR({ message: 'Removed.', hideDuration: 2000, kind: SnackbarKind.SUCCESS }));
+ try {
+ dispatch(snackbarActions.OPEN_SNACKBAR({ message: 'Removing ...', kind: SnackbarKind.INFO }));
+ await services.containerRequestService.delete(uuid, false);
+ dispatch(projectPanelActions.REQUEST_ITEMS());
+ dispatch(snackbarActions.OPEN_SNACKBAR({ message: 'Removed.', hideDuration: 2000, kind: SnackbarKind.SUCCESS }));
+ } catch(e) {
+ const error = getCommonResourceServiceError(e);
+ if (error === CommonResourceServiceError.PERMISSION_ERROR_FORBIDDEN) {
+ dispatch(snackbarActions.OPEN_SNACKBAR({ message: `Access denied`, hideDuration: 2000, kind: SnackbarKind.ERROR }));
+ } else {
+ dispatch(snackbarActions.OPEN_SNACKBAR({ message: `Deletion failed`, hideDuration: 2000, kind: SnackbarKind.ERROR }));
+ }
+ }
};
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list