mirror of
https://gitlab.nic.cz/turris/reforis/foris-js.git
synced 2024-12-25 00:11:36 +01:00
Fix imports.
This commit is contained in:
parent
de09e7a03c
commit
3bb760ceb3
|
@ -8,7 +8,8 @@ module.exports = {
|
||||||
"@babel/preset-react",
|
"@babel/preset-react",
|
||||||
],
|
],
|
||||||
plugins: [
|
plugins: [
|
||||||
"@babel/plugin-syntax-export-default-from",
|
|
||||||
"@babel/plugin-transform-runtime",
|
"@babel/plugin-transform-runtime",
|
||||||
|
"@babel/plugin-syntax-export-namespace-from",
|
||||||
|
"@babel/plugin-syntax-export-default-from",
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
9
package-lock.json
generated
9
package-lock.json
generated
|
@ -426,6 +426,15 @@
|
||||||
"@babel/helper-plugin-utils": "^7.0.0"
|
"@babel/helper-plugin-utils": "^7.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"@babel/plugin-syntax-export-namespace-from": {
|
||||||
|
"version": "7.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@babel/plugin-syntax-export-namespace-from/-/plugin-syntax-export-namespace-from-7.2.0.tgz",
|
||||||
|
"integrity": "sha512-1zGA3UNch6A+A11nIzBVEaE3DDJbjfB+eLIcf0GGOh/BJr/8NxL3546MGhV/r0RhH4xADFIEso39TKCfEMlsGA==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"@babel/helper-plugin-utils": "^7.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"@babel/plugin-syntax-json-strings": {
|
"@babel/plugin-syntax-json-strings": {
|
||||||
"version": "7.2.0",
|
"version": "7.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.2.0.tgz",
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
"@babel/core": "^7.4.5",
|
"@babel/core": "^7.4.5",
|
||||||
"@babel/plugin-proposal-class-properties": "^7.4.4",
|
"@babel/plugin-proposal-class-properties": "^7.4.4",
|
||||||
"@babel/plugin-syntax-export-default-from": "^7.2.0",
|
"@babel/plugin-syntax-export-default-from": "^7.2.0",
|
||||||
|
"@babel/plugin-syntax-export-namespace-from": "^7.2.0",
|
||||||
"@babel/plugin-transform-runtime": "^7.4.4",
|
"@babel/plugin-transform-runtime": "^7.4.4",
|
||||||
"@babel/preset-env": "^7.4.5",
|
"@babel/preset-env": "^7.4.5",
|
||||||
"@babel/preset-react": "^7.0.0",
|
"@babel/preset-react": "^7.0.0",
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { render } from "customTestRender";
|
import { render } from "customTestRender";
|
||||||
|
|
||||||
import SubmitButton, { STATES } from "../components/SubmitButton";
|
import { STATES, SubmitButton } from "../components/SubmitButton";
|
||||||
|
|
||||||
describe("<SubmitButton/>", () => {
|
describe("<SubmitButton/>", () => {
|
||||||
it("Render ready", () => {
|
it("Render ready", () => {
|
||||||
|
|
|
@ -99,7 +99,7 @@ export default function ForisForm({
|
||||||
|
|
||||||
const [alertIsDismissed, setAlertIsDismissed] = useState(false);
|
const [alertIsDismissed, setAlertIsDismissed] = useState(false);
|
||||||
|
|
||||||
if (!formState.data) return <Spinner className="row justify-content-center"/>;
|
if (!formState.data) return <Spinner className="row justify-content-center" />;
|
||||||
|
|
||||||
const formIsDisabled = disabled || forisModuleState.isLoading || postState.isSending;
|
const formIsDisabled = disabled || forisModuleState.isLoading || postState.isSending;
|
||||||
const submitButtonIsDisabled = disabled || !!formState.errors;
|
const submitButtonIsDisabled = disabled || !!formState.errors;
|
||||||
|
@ -126,15 +126,15 @@ export default function ForisForm({
|
||||||
let alert = null;
|
let alert = null;
|
||||||
if (!alertIsDismissed) {
|
if (!alertIsDismissed) {
|
||||||
if (postState.isSuccess) {
|
if (postState.isSuccess) {
|
||||||
alert = <SuccessAlert onDismiss={() => setAlertIsDismissed(true)}/>;
|
alert = <SuccessAlert onDismiss={() => setAlertIsDismissed(true)} />;
|
||||||
} else if (postState.isError) {
|
} else if (postState.isError) {
|
||||||
alert = <FailAlert onDismiss={() => setAlertIsDismissed(true)}/>;
|
alert = <FailAlert onDismiss={() => setAlertIsDismissed(true)} />;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Prompt message={getMessageOnLeavingPage}/>
|
<Prompt message={getMessageOnLeavingPage} />
|
||||||
{alert}
|
{alert}
|
||||||
<form onSubmit={onSubmit}>
|
<form onSubmit={onSubmit}>
|
||||||
{childrenWithFormProps}
|
{childrenWithFormProps}
|
||||||
|
|
56
src/index.js
56
src/index.js
|
@ -1,19 +1,40 @@
|
||||||
|
import * as Alert from "bootstrap/Alert";
|
||||||
|
import * as Button from "bootstrap/Button";
|
||||||
|
import * as CheckBox from "bootstrap/Checkbox";
|
||||||
|
import * as formFieldsSize from "bootstrap/constants";
|
||||||
|
import * as DataTimeInput from "bootstrap/DataTimeInput";
|
||||||
|
import * as EmailInput from "bootstrap/EmailInput";
|
||||||
|
import * as Input from "bootstrap/Input";
|
||||||
|
import * as NumberInput from "bootstrap/NumberInput";
|
||||||
|
import * as PasswordInput from "bootstrap/PasswordInput";
|
||||||
|
import * as RadioSet from "bootstrap/RadioSet";
|
||||||
|
import * as Select from "bootstrap/Select";
|
||||||
|
import * as TextInput from "bootstrap/TextInput";
|
||||||
|
|
||||||
|
import * as useWSForisModule from "webSockets/hooks";
|
||||||
|
import * as WebSockets from "webSockets/WebSockets";
|
||||||
|
import * as Portal from "utils/Portal";
|
||||||
|
|
||||||
|
import ForisForm from "form/components/ForisForm";
|
||||||
|
|
||||||
// API
|
// API
|
||||||
export { useAPIGet, useAPIPost } from "./api/hooks";
|
export { useAPIGet, useAPIPost } from "./api/hooks";
|
||||||
|
|
||||||
// Bootstrap
|
// Bootstrap
|
||||||
export * as Alert from "bootstrap/Alert";
|
export {
|
||||||
export * as Button from "bootstrap/Button";
|
Alert,
|
||||||
export * as CheckBox from "bootstrap/Checkbox";
|
Button,
|
||||||
export * as formFieldsSize from "bootstrap/constants";
|
CheckBox,
|
||||||
export * as DataTimeInput from "bootstrap/DataTimeInput";
|
formFieldsSize,
|
||||||
export * as EmailInput from "bootstrap/EmailInput";
|
DataTimeInput,
|
||||||
export * as Input from "bootstrap/Input";
|
EmailInput,
|
||||||
export * as NumberInput from "bootstrap/NumberInput";
|
Input,
|
||||||
export * as PasswordInput from "bootstrap/PasswordInput";
|
NumberInput,
|
||||||
export * as RadioSet from "bootstrap/RadioSet";
|
PasswordInput,
|
||||||
export * as Select from "bootstrap/Select";
|
RadioSet,
|
||||||
export * as TextInput from "bootstrap/TextInput";
|
Select,
|
||||||
|
TextInput,
|
||||||
|
};
|
||||||
export {
|
export {
|
||||||
Spinner,
|
Spinner,
|
||||||
SpinnerElement,
|
SpinnerElement,
|
||||||
|
@ -27,7 +48,7 @@ export {
|
||||||
|
|
||||||
|
|
||||||
// Form
|
// Form
|
||||||
export ForisForm from "form/components/ForisForm";
|
export { ForisForm };
|
||||||
export { SubmitButton, STATES as SUBMIT_BUTTON_STATES } from "form/components/SubmitButton";
|
export { SubmitButton, STATES as SUBMIT_BUTTON_STATES } from "form/components/SubmitButton";
|
||||||
export { useForisModule, useForm } from "form/hooks";
|
export { useForisModule, useForm } from "form/hooks";
|
||||||
|
|
||||||
|
@ -35,20 +56,15 @@ export { useForisModule, useForm } from "form/hooks";
|
||||||
// Test Utils
|
// Test Utils
|
||||||
export { mockedWS } from "testUtils/mockWS";
|
export { mockedWS } from "testUtils/mockWS";
|
||||||
|
|
||||||
|
|
||||||
// WebSockets
|
// WebSockets
|
||||||
export * as useWSForisModule from "webSockets/hooks";
|
export { useWSForisModule, WebSockets };
|
||||||
export * as WebSockets from "webSockets/WebSockets";
|
|
||||||
|
|
||||||
|
|
||||||
// Utils
|
// Utils
|
||||||
export * as Portal from "utils/Portal";
|
export { Portal };
|
||||||
|
|
||||||
|
|
||||||
// Foris URL
|
// Foris URL
|
||||||
export { ForisURLs, REFORIS_URL_PREFIX } from "./forisUrls";
|
export { ForisURLs, REFORIS_URL_PREFIX } from "./forisUrls";
|
||||||
|
|
||||||
|
|
||||||
// Validation
|
// Validation
|
||||||
export {
|
export {
|
||||||
validateIPv4Address,
|
validateIPv4Address,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user