Sha256: 097fce61b1774db8bc330325fbbdf16f27c542802cfacfa78e3350e6784d529a

Contents?: true

Size: 1.12 KB

Versions: 7

Compression:

Stored size: 1.12 KB

Contents

import { connect } from 'react-redux';

import {
  loadSnapshotList,
  snapshotDeleteAction,
  snapshotUpdateAction,
  snapshotRollbackAction,
} from './SnapshotManagementActions';
import SnapshotManagement from './SnapshotManagement';
import * as Selector from './SnapshotManagementSelectors';

// process state from redux store
const mapStateToProps = state => ({
  snapshots: Selector.selectSnapshots(state),
  isLoading: Selector.selectIsLoading(state),
  isWorking: Selector.selectIsWorking(state),
  hasError: Selector.selectHasError(state),
  error: Selector.selectError(state),
  needsReload: Selector.selectNeedsReload(state),
});

// dispatch actions from Component to Store
const mapDispatchToProps = dispatch => ({
  loadSnapshots: host => dispatch(loadSnapshotList(host)),
  deleteAction: (hostId, rowData) =>
    dispatch(snapshotDeleteAction(hostId, rowData)),
  updateAction: (hostId, rowData) =>
    dispatch(snapshotUpdateAction(hostId, rowData)),
  rollbackAction: (hostId, rowData) =>
    dispatch(snapshotRollbackAction(hostId, rowData)),
});

export default connect(mapStateToProps, mapDispatchToProps)(SnapshotManagement);

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
foreman_snapshot_management-4.0.0 webpack/components/SnapshotManagement/index.js
foreman_snapshot_management-3.0.1 webpack/components/SnapshotManagement/index.js
foreman_snapshot_management-3.0.0 webpack/components/SnapshotManagement/index.js
foreman_snapshot_management-2.0.3 webpack/components/SnapshotManagement/index.js
foreman_snapshot_management-2.0.2 webpack/components/SnapshotManagement/index.js
foreman_snapshot_management-2.0.1 webpack/components/SnapshotManagement/index.js
foreman_snapshot_management-2.0.0 webpack/components/SnapshotManagement/index.js