Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
} else if (component === "filter-expression") {
return eVisibleComponent.FILTER_EXPRESSION
}
return eVisibleComponent.LAYER_FORM
}
return {
tabName: ownProps.params.tabName,
mapDefinition: maps[ownProps.params.mapId],
layerId: ownProps.params.layerId,
layerDefinition: maps[ownProps.params.mapId].json.layers[ownProps.params.layerId],
layerFillColourScheme: layerFormValues(state, "fillColourScheme") as string,
doFill: layerFormValues(state, "valueExpression") !== "",
visibleComponent: getVisibleComponent(ownProps.params.component),
dirtyFormModalOpen: app.modals.get("dirtyLayerForm") || false,
isDirty: isDirty("layerForm")(state),
geominfo: ealgis.geominfo,
colourinfo: ealgis.colourinfo,
layerFormSubmitting: layerform.submitting,
muiThemePalette: ownProps.muiTheme.palette,
}
}
export const isProductFormDirty = state => isDirty( REDUX_FORM_NAME )( state );
const connectComponent = connect( state => {
const siteId = getSelectedSiteId( state );
return {
dirty: isDirty( form ),
isFetchingPages: isRequestingPostsForQuery( state, siteId, query ),
siteId,
};
} );
state => ( {
dirty: isDirty( form ),
enableRegistration: selector( state, 'account.enableRegistration' ),
generateUsername: selector( state, 'account.generateUsername' ),
submissionDuration: selector( state, 'duration.submissionDuration' ),
} ),
{ change }
function mapStateToProps(state, ownProps) {
const formName = loadElementFormStateName(ownProps.element.ID);
return {
formDirty: isDirty(`element.${formName}`, getFormState)(state),
};
}
const changedForms = forms.filter((form) => {
const schema = Object.values(schemas).find(item => item.name === form.name);
const notify = schema && schema.state && schema.state.notifyUnsavedChanges;
if (!notify) {
return false;
}
return isDirty(form.name, getFormState)(state);
});
(state, ownProps) => ({
isValid: isValid(ownProps.formName)(state),
isDirty: isDirty(ownProps.formName)(state),
submitErrors: getFormSubmitErrors(ownProps.formName)(state)
}),
{
const mapStateToProps = state => {
const {
intl: { locale },
} = state
return {
settings: {
locale,
},
isDirty: isDirty('settings')(state),
}
}
export function* checkOnDirtyForm(name) {
let someOneDirtyForm = false;
const state = yield select();
const widgets = makePageWidgetsByIdSelector(name)(state);
const widgetsKeys = keys(widgets);
for (let i = 0; i < widgetsKeys.length; i++) {
if (widgets[widgetsKeys[i]].src === 'FormWidget') {
someOneDirtyForm = isDirty(widgetsKeys[i])(state);
}
}
return someOneDirtyForm;
}