Sha256: e2faa4937b0b0ecfdcc5e21d75b527c6c245e54b141ee76fb8afab9da2a659c7

Contents?: true

Size: 1.17 KB

Versions: 4

Compression:

Stored size: 1.17 KB

Contents

import { connect } from 'react-redux';
import { compose, bindActionCreators } from 'redux';

import { callOnMount, callOnPopState } from 'foremanReact/common/HOC';

import WebhooksIndexPage from './WebhooksIndexPage';
import * as actions from '../WebhooksPageActions';

import {
  selectWebhooks,
  selectPage,
  selectPerPage,
  selectSearch,
  selectSort,
  selectHasData,
  selectHasError,
  selectIsLoading,
  selectSubtotal,
  selectMessage,
  selectCanCreate,
} from '../WebhooksPageSelectors';

const mapStateToProps = state => ({
  webhooks: selectWebhooks(state),
  page: selectPage(state),
  perPage: selectPerPage(state),
  search: selectSearch(state),
  sort: selectSort(state),
  isLoading: selectIsLoading(state),
  hasData: selectHasData(state),
  hasError: selectHasError(state),
  itemCount: selectSubtotal(state),
  message: selectMessage(state),
  canCreate: selectCanCreate(state),
});

const mapDispatchToProps = dispatch => bindActionCreators(actions, dispatch);

export default compose(
  connect(mapStateToProps, mapDispatchToProps),
  callOnMount(({ initializeWebhooks }) => initializeWebhooks()),
  callOnPopState(({ fetchWebhooks }) => fetchWebhooks())
)(WebhooksIndexPage);

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
foreman_webhooks-3.0.3 webpack/ForemanWebhooks/Routes/Webhooks/WebhooksIndexPage/index.js
foreman_webhooks-3.0.2 webpack/ForemanWebhooks/Routes/Webhooks/WebhooksIndexPage/index.js
foreman_webhooks-3.0.1 webpack/ForemanWebhooks/Routes/Webhooks/WebhooksIndexPage/index.js
foreman_webhooks-3.0.0 webpack/ForemanWebhooks/Routes/Webhooks/WebhooksIndexPage/index.js