+ TOGGLE_ONE: 'TOGGLE_ONE',
+ SET_SELECTED_UUID: 'SET_SELECTED_UUID',
+ ADD_DISABLED: 'ADD_DISABLED',
+ REMOVE_DISABLED: 'REMOVE_DISABLED',
+};
+
+export const msNavigateToOutput = (resource: ContextMenuResource | ContainerRequestResource) => async (dispatch: Dispatch<any>, getState: () => RootState, services: ServiceRepository) => {
+ try {
+ await services.collectionService.get(resource.outputUuid || '');
+ dispatch<any>(navigateTo(resource.outputUuid || ''));
+ } catch {
+ dispatch(snackbarActions.OPEN_SNACKBAR({ message: "Output collection was trashed or deleted.", hideDuration: 4000, kind: SnackbarKind.WARNING }));
+ }
+};
+
+export const isExactlyOneSelected = (checkedList: TCheckedList) => {
+ let tally = 0;
+ let current = '';
+ for (const uuid in checkedList) {
+ if (checkedList[uuid] === true) {
+ tally++;
+ current = uuid;
+ }
+ }
+ return tally === 1 ? current : null