Compare commits
4 Commits
98b86363f5
...
afb833bd19
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
afb833bd19 | ||
|
|
6215944972 | ||
|
|
a08c55ec41 | ||
|
|
2a56144bbc |
6
Jenkinsfile
vendored
6
Jenkinsfile
vendored
|
|
@ -11,7 +11,11 @@ pipeline {
|
|||
def success = false
|
||||
|
||||
// Clean npm cache and try normal install and npm ci once
|
||||
sh 'npm cache clean --force'
|
||||
try {
|
||||
sh 'npm cache clean --force'
|
||||
} catch (Exception e0) {
|
||||
echo 'npm cache clean --force failed trying more things'
|
||||
}
|
||||
try {
|
||||
sh 'npm install'
|
||||
success = true
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ import Footer from "./components/footer/footer";
|
|||
import VerifyMail from "./components/verify_email/verify_mail";
|
||||
import ThankYou from "./components/verify_email/thank_you";
|
||||
import DEBUG from "./components/DEBUG/DEBUG";
|
||||
import GenericForm from "./components/form/genericForm";
|
||||
import {getFormProperties} from "./components/form/formData";
|
||||
import {FormProperties} from "./components/form/formInterfaces";
|
||||
import FormActiveRedirect from "./components/form/formActiveRedirect";
|
||||
|
|
|
|||
|
|
@ -1,11 +1,12 @@
|
|||
import {FormData} from "./formInterfaces";
|
||||
import {useEffect, useState} from "react";
|
||||
import {useEffect, useState, useCallback} from "react";
|
||||
import GenericForm from "./genericForm";
|
||||
|
||||
const FormActiveRedirect = (formData: FormData) => {
|
||||
const [isLoading, setLoading] = useState(true);
|
||||
const [isFormActive, setFormActive] = useState(false);
|
||||
const handleCheckForm = async () => {
|
||||
|
||||
const handleCheckForm = useCallback(async () => {
|
||||
const result = await fetch(`${process.env.REACT_APP_BACKEND_BASE_URL}/api/checks/formActive`, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
|
|
@ -14,11 +15,11 @@ const FormActiveRedirect = (formData: FormData) => {
|
|||
const response = await result.json();
|
||||
setFormActive(response.isActive);
|
||||
setLoading(false);
|
||||
};
|
||||
}, [formData.backendFormName]);
|
||||
|
||||
useEffect(() => {
|
||||
handleCheckForm();
|
||||
}, []);
|
||||
handleCheckForm().then(() => {});
|
||||
}, [handleCheckForm]);
|
||||
|
||||
if (isLoading) {
|
||||
return <div className={"container"}><h2>Checking if form is active</h2></div>;
|
||||
|
|
@ -32,4 +33,5 @@ const FormActiveRedirect = (formData: FormData) => {
|
|||
<GenericForm {...formData} />
|
||||
);
|
||||
}
|
||||
|
||||
export default FormActiveRedirect;
|
||||
Loading…
Reference in New Issue
Block a user