X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/d9ee24d0f78a21603e2276d0d3142d4db40a831b..ecfd85a34f5852c160a25ab61bc5c38059927c56:/src/store/subprocess-panel/subprocess-panel-actions.ts diff --git a/src/store/subprocess-panel/subprocess-panel-actions.ts b/src/store/subprocess-panel/subprocess-panel-actions.ts index d3a230cb..592e3d5d 100644 --- a/src/store/subprocess-panel/subprocess-panel-actions.ts +++ b/src/store/subprocess-panel/subprocess-panel-actions.ts @@ -6,51 +6,12 @@ import { Dispatch } from 'redux'; import { RootState } from '~/store/store'; import { ServiceRepository } from '~/services/services'; import { bindDataExplorerActions } from '~/store/data-explorer/data-explorer-action'; -/* import { setBreadcrumbs } from '~/store/breadcrumbs/breadcrumbs-actions'; -import { dialogActions } from '~/store/dialog/dialog-actions'; -import { ProcessResource } from '~/models/process'; -import { getResource } from '~/store/resources/resources'; -import { snackbarActions, SnackbarKind } from '~/store/snackbar/snackbar-actions'; -import { REMOVE_PROCESS_DIALOG } from '~/store/processes/processes-actions'; -*/ export const SUBPROCESS_PANEL_ID = "subprocessPanel"; export const SUBPROCESS_ATTRIBUTES_DIALOG = 'subprocessAttributesDialog'; export const subprocessPanelActions = bindDataExplorerActions(SUBPROCESS_PANEL_ID); export const loadSubprocessPanel = () => (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => { + dispatch(subprocessPanelActions.CLEAR()); dispatch(subprocessPanelActions.REQUEST_ITEMS()); }; - -/* -export const openSubprocessAttributesDialog = (uuid: string) => - (dispatch: Dispatch, getState: () => RootState) => { - const { resources } = getState(); - const subprocess = getResource(uuid)(resources); - dispatch(dialogActions.OPEN_DIALOG({ id: SUBPROCESS_ATTRIBUTES_DIALOG, data: { subprocess } })); - }; - -export const openLinkRemoveDialog = (uuid: string) => - (dispatch: Dispatch, getState: () => RootState) => { - dispatch(dialogActions.OPEN_DIALOG({ - id: REMOVE_PROCESS_DIALOG, - data: { - title: 'Remove process', - text: 'Are you sure you want to remove this process?', - confirmButtonLabel: 'Remove', - uuid - } - })); - }; - -export const removeSubprocess = (uuid: string) => - async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => { - dispatch(snackbarActions.OPEN_SNACKBAR({ message: 'Removing ...', kind: SnackbarKind.INFO })); - try { - await services.containerRequestService.delete(uuid); - dispatch(subprocessPanelActions.REQUEST_ITEMS()); - dispatch(snackbarActions.OPEN_SNACKBAR({ message: 'Process has been successfully removed.', hideDuration: 2000, kind: SnackbarKind.SUCCESS })); - } catch (e) { - return; - } - };*/ \ No newline at end of file