1
0
mirror of https://gitlab.nic.cz/turris/reforis/foris-js.git synced 2024-07-02 20:30:27 +00:00

Revert "Prompt as an optional element of ForisForm."

This reverts commit 75bfbb88ae.
This commit is contained in:
Maciej Lenartowicz 2020-01-17 12:44:11 +01:00
parent 813a865f62
commit 556e12c964
2 changed files with 2 additions and 8 deletions

View File

@ -17,11 +17,10 @@ WiFiSettings.propTypes = {
endpoint: PropTypes.string.isRequired,
resetEndpoint: PropTypes.string.isRequired,
hasGuestNetwork: PropTypes.bool,
hasPrompt: PropTypes.bool,
};
export function WiFiSettings({
ws, endpoint, resetEndpoint, hasGuestNetwork, hasPrompt,
ws, endpoint, resetEndpoint, hasGuestNetwork,
}) {
return (
<>
@ -34,7 +33,6 @@ export function WiFiSettings({
prepData={prepData}
prepDataToSubmit={prepDataToSubmit}
validator={validator}
hasPrompt={hasPrompt}
>
<WiFiForm hasGuestNetwork={hasGuestNetwork} />
</ForisForm>

View File

@ -48,8 +48,6 @@ ForisForm.propTypes = {
validator: PropTypes.func.isRequired,
/** Disables form */
disabled: PropTypes.bool,
/** If true user will be prompted before leaving the page containing form. */
hasPrompt: PropTypes.bool,
/** reForis form components. */
children: PropTypes.node.isRequired,
/** Optional override of form submit callback */
@ -73,7 +71,6 @@ ForisForm.defaultProps = {
postCallback: () => undefined,
validator: () => undefined,
disabled: false,
hasPrompt: true,
};
/** Serves as HOC for all foris forms components. */
@ -85,7 +82,6 @@ export function ForisForm({
postCallback,
validator,
disabled,
hasPrompt,
onSubmitOverridden,
children,
}) {
@ -160,7 +156,7 @@ export function ForisForm({
return (
<div className={formFieldsSize}>
{hasPrompt && <Prompt message={getMessageOnLeavingPage} />}
<Prompt message={getMessageOnLeavingPage} />
<form onSubmit={onSubmit}>
{childrenWithFormProps}
<div className="text-right">