Compare commits
9
Commits
d005b72634
..
dev
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
afb833bd19 | ||
|
|
6215944972 | ||
|
|
a08c55ec41 | ||
|
|
2a56144bbc | ||
|
|
98b86363f5 | ||
|
|
75559af7c8 | ||
|
|
21e23b98ad | ||
|
|
67eddc0394 | ||
|
|
960fc1707b |
Vendored
+12
@@ -11,7 +11,11 @@ pipeline {
|
|||||||
def success = false
|
def success = false
|
||||||
|
|
||||||
// Clean npm cache and try normal install and npm ci once
|
// Clean npm cache and try normal install and npm ci once
|
||||||
|
try {
|
||||||
sh 'npm cache clean --force'
|
sh 'npm cache clean --force'
|
||||||
|
} catch (Exception e0) {
|
||||||
|
echo 'npm cache clean --force failed trying more things'
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
sh 'npm install'
|
sh 'npm install'
|
||||||
success = true
|
success = true
|
||||||
@@ -39,6 +43,12 @@ pipeline {
|
|||||||
echo "Retry ${retryCount}/${MAX_RETRIES} failed"
|
echo "Retry ${retryCount}/${MAX_RETRIES} failed"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
try {
|
||||||
|
sh 'npm install --legacy-peer-deps --force'
|
||||||
|
success = true
|
||||||
|
} catch (Exception e4) {
|
||||||
|
echo "npm install --legacy-peer-deps --force failed"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!success) {
|
if (!success) {
|
||||||
@@ -56,9 +66,11 @@ pipeline {
|
|||||||
}
|
}
|
||||||
stage('discord') {
|
stage('discord') {
|
||||||
when {
|
when {
|
||||||
|
anyOf {
|
||||||
branch 'main'
|
branch 'main'
|
||||||
branch 'master'
|
branch 'master'
|
||||||
}
|
}
|
||||||
|
}
|
||||||
steps {
|
steps {
|
||||||
discordSend description: "Build: ${BUILD_NUMBER}", showChangeset: true, result: currentBuild.currentResult, title: currentBuild.fullProjectName, webhookURL: env.discordwebhook
|
discordSend description: "Build: ${BUILD_NUMBER}", showChangeset: true, result: currentBuild.currentResult, title: currentBuild.fullProjectName, webhookURL: env.discordwebhook
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -6,9 +6,9 @@ import Footer from "./components/footer/footer";
|
|||||||
import VerifyMail from "./components/verify_email/verify_mail";
|
import VerifyMail from "./components/verify_email/verify_mail";
|
||||||
import ThankYou from "./components/verify_email/thank_you";
|
import ThankYou from "./components/verify_email/thank_you";
|
||||||
import DEBUG from "./components/DEBUG/DEBUG";
|
import DEBUG from "./components/DEBUG/DEBUG";
|
||||||
import GenericForm from "./components/form/genericForm";
|
|
||||||
import {getFormProperties} from "./components/form/formData";
|
import {getFormProperties} from "./components/form/formData";
|
||||||
import {FormProperties} from "./components/form/formInterfaces";
|
import {FormProperties} from "./components/form/formInterfaces";
|
||||||
|
import FormActiveRedirect from "./components/form/formActiveRedirect";
|
||||||
|
|
||||||
function App() {
|
function App() {
|
||||||
return (
|
return (
|
||||||
@@ -21,7 +21,7 @@ function App() {
|
|||||||
<Route
|
<Route
|
||||||
key={property.path}
|
key={property.path}
|
||||||
path={property.path}
|
path={property.path}
|
||||||
element={<GenericForm {...property.formData} />}
|
element={<FormActiveRedirect {...property.formData} />}
|
||||||
/>
|
/>
|
||||||
))}
|
))}
|
||||||
<Route path="/verify-email" element={<VerifyMail/>}/>
|
<Route path="/verify-email" element={<VerifyMail/>}/>
|
||||||
|
|||||||
@@ -213,5 +213,6 @@ export const apply: FormData = {
|
|||||||
other: Yup.string()
|
other: Yup.string()
|
||||||
.max(2000, 'Please provide at most 2000 characters')
|
.max(2000, 'Please provide at most 2000 characters')
|
||||||
}),
|
}),
|
||||||
title: "Staff Application"
|
title: "Staff Application",
|
||||||
|
backendFormName: "StaffApplication",
|
||||||
};
|
};
|
||||||
@@ -48,5 +48,6 @@ export const contact: FormData = {
|
|||||||
.max(2000, 'Question should not exceed 2000 characters')
|
.max(2000, 'Question should not exceed 2000 characters')
|
||||||
.required('Question is required')
|
.required('Question is required')
|
||||||
}),
|
}),
|
||||||
title: "Contact Form"
|
title: "Contact Form",
|
||||||
|
backendFormName: "ContactForm",
|
||||||
};
|
};
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
import {FormData} from "./formInterfaces";
|
||||||
|
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 = useCallback(async () => {
|
||||||
|
const result = await fetch(`${process.env.REACT_APP_BACKEND_BASE_URL}/api/checks/formActive`, {
|
||||||
|
method: 'POST',
|
||||||
|
headers: { 'Content-Type': 'application/json' },
|
||||||
|
body: JSON.stringify({ formName: formData.backendFormName })
|
||||||
|
});
|
||||||
|
const response = await result.json();
|
||||||
|
setFormActive(response.isActive);
|
||||||
|
setLoading(false);
|
||||||
|
}, [formData.backendFormName]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
handleCheckForm().then(() => {});
|
||||||
|
}, [handleCheckForm]);
|
||||||
|
|
||||||
|
if (isLoading) {
|
||||||
|
return <div className={"container"}><h2>Checking if form is active</h2></div>;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!isFormActive) {
|
||||||
|
return <div className={"container"}><h2>The {formData.title} is not currently active</h2></div>;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<GenericForm {...formData} />
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default FormActiveRedirect;
|
||||||
@@ -22,6 +22,7 @@ export interface UserInput {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export type FormData = {
|
export type FormData = {
|
||||||
|
backendFormName: string;
|
||||||
steps: Step[];
|
steps: Step[];
|
||||||
backend: string;
|
backend: string;
|
||||||
userInput: UserInput;
|
userInput: UserInput;
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
import React, {useState} from "react";
|
import React, {useState} from "react";
|
||||||
import './GenericForm.css';
|
import './GenericForm.css';
|
||||||
import {useNavigate} from 'react-router-dom'
|
import {useNavigate} from 'react-router-dom'
|
||||||
import {ErrorMessage, Field, Form, FormikProvider, FormikValues, useFormik} from "formik";
|
import {ErrorMessage, Form, FormikProvider, FormikValues, useFormik} from "formik";
|
||||||
import {Step, UserInput, FormData} from './formInterfaces';
|
import {Step, UserInput, FormData} from './formInterfaces';
|
||||||
import * as Yup from "yup";
|
import * as Yup from "yup";
|
||||||
import formHTML from "./formHTML";
|
|
||||||
import FormHTML from "./formHTML";
|
import FormHTML from "./formHTML";
|
||||||
|
|
||||||
const GenericForm = (formData: FormData) => {
|
const GenericForm = (formData: FormData) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user