How to use the redux-form.formValueSelector 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 entando / entando-components / plugins / entando-plugin-dashboard / app-builder / src / state / main / actions.js View on Github external
new Promise((resolve) => {
    const state = getState();
    const selector = formValueSelector('dashboard-config-form');
    const serverId = selector(state, 'id');
    if (datasourceId) {
      if (serverId) {
        pingDatasource(serverId, datasourceId).then((response) => {
          response.json().then((json) => {
            if (response.ok) {
              const status = json.payload ? 'online' : 'offline';
              dispatch(setCheckDatasource(datasourceId, { status }));
              resolve();
            } else {
              dispatch(setCheckDatasource(datasourceId, { status: 'offline' }));
              // const { errors } = json;
              // dispatch(addErrors(errors.map(e => e.message)));
              // errors.map(e => dispatch(addToast(e.message, TOAST_ERROR)));
              resolve();
            }
github cmdmnt / commandment / ui / src / forms / payloads / WIFIPayloadForm.tsx View on Github external
payload_certificate_uuid?: string;

    // Proxy
    proxy_server?: string;
    proxy_server_port?: number;
    proxy_username?: string;
    proxy_password?: string;
    proxy_pac_url?: string;
    proxy_pac_fallback_allowed?: boolean;
}

interface WIFIPayloadFormProps extends FormProps {
    is_hotspot: boolean;
}

const selector = formValueSelector("wifi_payload");

export class UnconnectedWIFIPayloadForm extends React.Component {

    render() {
        const {
            is_hotspot,
        } = this.props;

        return (
            <form>
                <div>
                    <div>
                        <label>SSID</label>
                        
                    </div>
                    <div></div></div></form>
github adobe / reactor-extension-core / src / view / actions / customCode.jsx View on Github external
) : null
    }

    <div>
      
    </div>
  
);

const valueSelector = formValueSelector('default');
const stateToProps = state =&gt; ({ language: valueSelector(state, 'language') });

export default connect(stateToProps)(CustomCode);

export const formConfig = {
  settingsToFormValues(values, settings) {
    return {
      ...values,
      ...settings,
      language: settings.language || LANGUAGES.JAVASCRIPT
    };
  },
  formValuesToSettings(settings, values) {
    settings = {
      ...settings,
      ...values
github mitmedialab / MediaCloud-Web-Tools / src / components / topic / snapshots / foci / builder / FocusForm2ConfigureContainer.js View on Github external
import PropTypes from 'prop-types';
import React from 'react';
import { formValueSelector } from 'redux-form';
import { FormattedMessage, injectIntl } from 'react-intl';
import { connect } from 'react-redux';
import EditKeywordSearchContainer from './keywordSearch/EditKeywordSearchContainer';
import EditRetweetPartisanshipContainer from './retweetPartisanship/EditRetweetPartisanshipContainer';
import EditTopCountriesContainer from './topCountries/EditTopCountriesContainer';
import EditNytThemeContainer from './nyttheme/EditNytThemeContainer';
import EditMediaTypeContainer from './mediaType/EditMediaTypeContainer';
import { goToCreateFocusStep } from '../../../../../actions/topicActions';
import { FOCAL_TECHNIQUE_BOOLEAN_QUERY, FOCAL_TECHNIQUE_RETWEET_PARTISANSHIP, FOCAL_TECHNIQUE_TOP_COUNTRIES, FOCAL_TECHNIQUE_NYT_THEME, FOCAL_TECHNIQUE_MEDIA_TYPE } from '../../../../../lib/focalTechniques';
import messages from '../../../../../resources/messages';

const formSelector = formValueSelector('snapshotFocus');

const FocusForm2ConfigureContainer = (props) =&gt; {
  const { topicId, initialValues, handleNextStep, currentFocalTechnique, handlePreviousStep, location } = props;
  let content = null;
  switch (currentFocalTechnique) {
    case FOCAL_TECHNIQUE_BOOLEAN_QUERY:
      content = (
        
      );
      break;
github ninjadotorg / handshake-app / src / components / handshakes / exchange / Feed / FeedCreditCard.jsx View on Github external
const FormSpecificAmount = createForm({
  propsReduxForm: {
    form: nameFormSpecificAmount,
    initialValues: {
      currency: {
        id: CRYPTO_CURRENCY.BTC,
        text: <span><img width="{22}" src="{iconBitcoin}"> {CRYPTO_CURRENCY_NAME[CRYPTO_CURRENCY.BTC]}</span>,
      },
      fiatCurrency: {
        id: FIAT_CURRENCY.USD,
        text: <span><img width="{24}" src="{iconUsd}"> {FIAT_CURRENCY_NAME[FIAT_CURRENCY.USD]}</span>,
      },
    },
  },
});
const selectorFormSpecificAmount = formValueSelector(nameFormSpecificAmount);

const nameFormCreditCard = 'creditCard';
const FormCreditCard = createForm({
  propsReduxForm: {
    form: nameFormCreditCard,
    initialValues: {},
  },
});
const selectorFormCreditCard = formValueSelector(nameFormCreditCard);

const DECIMAL_NUMBER = 2;

class FeedCreditCard extends React.Component {
  constructor(props) {
    super(props);
github walmartlabs / concord / console / src / project / RepositoryPopup / form.js View on Github external
return errors;
};

repositoryForm.propTypes = {
    onSubmit: PropTypes.func.isRequired
};

repositoryForm = reduxForm({
    form: 'repository',
    initialValues: { sourceType: c.BRANCH_SOURCE_TYPE },
    validate,
    enableReinitialize: true,
    keepDirtyOnReinitialize: true
})(repositoryForm);

const selector = formValueSelector('repository');

const mapStateToProps = (state) => ({
    org: getCurrentOrg(state.session),
    sourceTypeValue: selector(state, 'sourceType'),
    formValues: getFormValues('repository')(state),
    testResult: repoSelectors.getTestResult(state.repository),
    testError: repoSelectors.getError(state.repository),
    testLoading: repoSelectors.isLoading(state.repository)
});

const mapDispatchToProps = (dispatch) => ({
    onSaveFn: () => dispatch(submitForm('repository')),
    onTestRepoFn: (data) => dispatch(repoActions.testRepository(data))
});

export default connect(mapStateToProps, mapDispatchToProps)(repositoryForm);
github dimorinny / ethereum-erc20-wallet / src / containers / send / send.js View on Github external
function mapStateToProps(state) {
    const selector = formValueSelector(FORM_NAME);

    return {
        send: state.send,
        address: selector(state, 'address') || '',
        value: parseFloat(selector(state, 'value')) || undefined
    };
}
github ninjadotorg / handshake-app / src / pages / Escrow / Deposit.jsx View on Github external
import taggingConfig from '@/services/tagging-config';
import CreditATM from '@/services/neuron/neuron-creditatm';
import { isEmpty } from '@/utils/is';
import { BigNumber } from 'bignumber.js';
import axios from 'axios';
import './CommonStyle.scss';
import './Deposit.scss';

const nameFormEscrowDeposit = 'escrowDeposit';
const FormEscrowDeposit = createForm({
  propsReduxForm: {
    form: nameFormEscrowDeposit,
  },
});

const selectorFormEscrowDeposit = formValueSelector(nameFormEscrowDeposit);

export const CRYPTO_ICONS = {
  [CRYPTO_CURRENCY.ETH]: iconEthereum,
  [CRYPTO_CURRENCY.BTC]: iconBitcoin,
  BCH: iconBitcoinCash,
};

const CRYPTO_CURRENCY_CREDIT_CARD = {
  ...CRYPTO_CURRENCY, BCH: 'BCH',
};

let listCurrency = Object.values(CRYPTO_CURRENCY_CREDIT_CARD).map((item) => {
  return { name: item, icon: CRYPTO_ICONS[item], allowPercentage: true };
});

const PERCENT = {
github reportportal / service-ui / app / src / components / integrations / integrationProviders / emailIntegration / emailFormFields / emailFormFields.jsx View on Github external
@connect((state) => ({
  authEnabled: formValueSelector(INTEGRATION_FORM)(state, AUTH_ENABLED_KEY),
}))
@injectIntl