Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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) => {
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),
/>
);
};
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);
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>
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']);
}
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);
);
}
}
export default compose(
withDialog(),
withEditorProps,
withSelectedEntities("duplicatesToRemove"),
reduxForm({
form: "RemoveDuplicatesDialog"
}),
formValues("ignoreName", "ignoreStrand", "ignoreStartAndEnd")
)(RemoveDuplicatesDialog);
import { formValues } from 'redux-form'
export default formValues('inputs')
},
{
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,