How to use the redux-form.formValues function in redux-form

To help you get started, we’ve selected a few redux-form examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github kleros / doges-on-trial / src / utils / create-form-generator.js View on Github external
VisibleIf.propTypes = {
    // State
    [key]: PropTypes.oneOfType([
      PropTypes.bool,
      PropTypes.string,
      PropTypes.number
    ])
  }

  VisibleIf.defaultProps = {
    // State
    [key]: false
  }

  return formValues(key)(VisibleIf)
}
const validateIf = (validate, valueKey) => (val, allVals, ...rest) => {
github prescottprue / fireadmin / src / routes / Projects / routes / Project / routes / BucketConfig / components / BucketConfigForm / BucketConfigForm.enhancer.js View on Github external
showError('Error: Service Account Does Not Have Access')
          throw new Error('Service Account does not have Access')
        }
        showError('Error Updating Storage Bucket Config')
        throw err
      }
    }
  }),
  // form capability including submit
  reduxForm({
    form: formName,
    enableReinitialize: true,
    keepDirtyOnReinitialize: true
  }),
  formValues('serviceAccount'),
  formValues('environment'),
  formValues('body'),
  formValues('method'),
  // Add more props
  withProps(({ projectEnvironmentsById, environment }) => {
    const databaseURL = get(
      projectEnvironmentsById,
      `${environment}.databaseURL`
    )
    const databaseName = databaseURL && databaseURLToProjectName(databaseURL)
    return {
      databaseName,
      storageBucket: databaseName && `${databaseName}.appspot.com`
    }
  }),
  // Show a loading spinner while submitting
  spinnerWhile(({ submitting }) => submitting),
github opennode / waldur-homeport / app / scripts / components / form-react / FormContainer.fixture.tsx View on Github external
/>
      
    
  );
};

export const getNameField = (wrapper: ReactWrapper) => wrapper.find('input').first();
export const getDescriptionField = (wrapper: ReactWrapper) => wrapper.find('textarea').first();
export const getFieldGroups = (wrapper: ReactWrapper) => wrapper.find('.form-group');
export const getRequiredFields = (wrapper: ReactWrapper) => wrapper.find('.text-danger');
export const submitForm = (wrapper: ReactWrapper) => wrapper.find('form').simulate('submit');
export const getErrors = (wrapper: ReactWrapper) => wrapper.find('.help-block');
export const getDescriptions = (wrapper: ReactWrapper) => wrapper.find('.text-muted');
export const renderTestForm = options => mountTestForm(Component(options));

export const OptionalFieldForm = formValues('type')(props => (
  
    
    {(props as any).type === 'subtask' && (
      
    )}
  
));

export const renderOptionalFieldForm = () => mountTestForm(OptionalFieldForm);
github AlexanderShushunov / lets-kill-lifecycle / src / ContactForm / ContactForm.jsx View on Github external
Field,
    formValues,
    reduxForm
} from 'redux-form';
import {FormLabel} from '../FormLabel';
import {CONTACT_FORM_NAME} from './contactFormName';
import {connect} from 'react-redux';
import {isVip} from '../vipState';

export const ContactForm = connect(state => ({
    isVip: isVip(state)
}))(
    reduxForm({
        form: CONTACT_FORM_NAME
    })(
        formValues('employed')(
            ({employed, isVip}) => (
                <form>
                    
                        
                    
                    
                        
                    </form>
github opennode / waldur-homeport / app / scripts / components / resource / monitoring / ZabbixHostCreateDialog.tsx View on Github external
settings_uuid: ownProps.link.service_settings_uuid,
    };
    if (query) {
      request.name = query;
    }
    return actions.loadTemplates(request, dispatch);
  },

  createHost: data =>
    actions.createHost({...data, resource: ownProps.resolve.resource}, dispatch),
});

const enhance = compose(
  withTranslation,
  reduxForm({form: 'monitoringCreate'}),
  formValues({link: 'service_project_link'}),
  connect(null, mapDispatchToProps),
);

export default connectAngularComponent(enhance(ZabbixHostCreateDialog), ['resolve']);
github TeselaGen / openVectorEditor / src / helperComponents / MergeFeaturesDialog / index.js View on Github external
}

function required(val) {
  if (!val) return "Required";
}
export default compose(
  withDialog({
    isDraggable: true,
    height: 480,
    width: 400
  }),
  withEditorProps,
  reduxForm({
    form: "MergeFeaturesDialog"
  }),
  formValues("id1", "id2")
)(MergeFeaturesDialog);
github TeselaGen / openVectorEditor / src / helperComponents / RemoveDuplicates / index.js View on Github external
);
  }
}

export default compose(
  withDialog(),
  withEditorProps,

  withSelectedEntities("duplicatesToRemove"),

  reduxForm({
    form: "RemoveDuplicatesDialog"
  }),
  formValues("ignoreName", "ignoreStrand", "ignoreStartAndEnd")
)(RemoveDuplicatesDialog);
github reportportal / service-ui / app / src / pages / inside / common / modals / editItemsModal / editItemsModal.jsx View on Github external
},
  {
    value: DESCRIPTION_CREATE,
    label: formatMessage(messages.descriptionReplaceLabel),
  },
];

@withModal('editItemsModal')
@injectIntl
@reduxForm({
  form: 'editItemsForm',
  validate: ({ commonAttributes }) => ({
    commonAttributes: !validate.attributesArray(commonAttributes),
  }),
})
@formValues('descriptionAction', 'uniqueAttributes')
@connect(
  (state) => ({
    currentProject: activeProjectSelector(state),
  }),
  {
    showNotification,
    showDefaultErrorNotification,
  },
)
export class EditItemsModal extends Component {
  static propTypes = {
    data: PropTypes.shape({
      items: PropTypes.array,
      parentLaunch: PropTypes.object,
      type: PropTypes.string,
      fetchFunc: PropTypes.func,