Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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();
}
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>
) : null
}
<div>
</div>
);
const valueSelector = formValueSelector('default');
const stateToProps = state => ({ 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
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) => {
const { topicId, initialValues, handleNextStep, currentFocalTechnique, handlePreviousStep, location } = props;
let content = null;
switch (currentFocalTechnique) {
case FOCAL_TECHNIQUE_BOOLEAN_QUERY:
content = (
);
break;
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);
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);
function mapStateToProps(state) {
const selector = formValueSelector(FORM_NAME);
return {
send: state.send,
address: selector(state, 'address') || '',
value: parseFloat(selector(state, 'value')) || undefined
};
}
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 = {
@connect((state) => ({
authEnabled: formValueSelector(INTEGRATION_FORM)(state, AUTH_ENABLED_KEY),
}))
@injectIntl