示例#1
0
function mapStateToProps(state) {
  return ({
    values: getFormValues('vehicleSubstitution')(state) || Immutable.Map(), // eslint-disable-line
    vehMakes: selectVehMakes()(state),
    vehModels: selectVehModels()(state),
    addresses: selectAddresses()(state),
  });
}
 const onSort = (column) => {
   const sortDirection = sorting.getIn(['generalDescriptionSearch', 'column']) === column.property ?
     sorting.getIn(['generalDescriptionSearch', 'sortDirection']) || sortDirectionTypes.DESC : sortDirectionTypes.DESC
   const newSorting = sorting.mergeIn(['generalDescriptionSearch'],
     { column: column.property,
       sortDirection: sortDirection === sortDirectionTypes.DESC && sortDirectionTypes.ASC || sortDirectionTypes.DESC })
   updateUI('sorting', newSorting)
   sortOnClick(getFormValues('generalDescriptionSearchForm'))
 }
 (state, { form }) => {
   const getFormState = getFormValues(form)
   const getIsSubmiting = isSubmitting(form)
   const getHasSubmitSucceeded = hasSubmitSucceeded(form)
   let formState = getFormState(state)
   formState = _convertToRaw(formState)
   return {
     formState,
     entityId: getSelectedEntityId(state),
     entityType: getSelectedEntityConcreteType(state),
     languageId: getContentLanguageId(state),
     hasSubmitted: getHasSubmitSucceeded(state),
     isSubmitting: getIsSubmiting(state),
     userName: getUserName(state)
   }
 }, {
const withPristineAfterSubmit = formOptions => form => {
  const getWrappedFormValues = getFormValues(formOptions.form)
  const onSubmit = (values, dispatch, ownProps) => {
    const { formValues } = ownProps
    formOptions.onSubmit(formValues, dispatch, ownProps)
    dispatch(initialize(formOptions.form, formValues))
    dispatch(reset(formOptions.form))
  }
  return compose(
    connect(
      state => ({
        formValues: getWrappedFormValues(state)
      })
    ),
    reduxForm({
      ...formOptions,
      onSubmit
    })
  )(form)
}
import { List, fromJS } from 'immutable'
import { defineMessages, injectIntl, intlShape } from 'react-intl'

const messages = defineMessages({
  connectedLabel: {
    id: 'appComponents.ConnectionStep.AddConnectionButton.ConnectedLabel',
    defaultMessage: 'Liitetty'
  },
  connectToLabel: {
    id: 'appComponents.ConnectionStep.AddConnectionButton.ConnectToLabel',
    defaultMessage: 'Liitä'
  }
})

const getSelectedConnections = createSelector(
  getFormValues('connections'),
  formValues => (formValues && formValues.get('selectedConnections')) || List()
)
const getSelectedConnectionsIds = createSelector(
  getSelectedConnections,
  selectedConnections => (
    selectedConnections &&
    selectedConnections.map(connection => connection.get('id'))
  ) || List()
)
const getIsSelected = id => createSelector(
  getSelectedConnectionsIds,
  selectedIds => (
    selectedIds &&
    selectedIds.some(selectedId => selectedId === id)
  ) || false
示例#6
0
function mapStateToProps(state) {
  return ({
    formValues: getFormValues('vehicleChangeType')(state),
  });
}
示例#7
0
function mapStateToProps(state) {
  return ({
    values: getFormValues('wizardForm')(state),
  });
}
示例#8
0
 connect((state, ownProps) => {
   const formState = getFormValues(ownProps.formName)(state) || Map()
   return {
     checked: ownProps.id === formState.get(ownProps.formProperty) || false
   }
 })
示例#9
0
const getOpeningDays = (formName, index) => createSelector(
  getFormValues(formName),
  formValues => formValues.getIn(['openingHours', 'normalOpeningHours', index, 'dailyOpeningHours']) || Map()
)