SignupForm localised title
This commit is contained in:
@@ -5,7 +5,8 @@ import { Question } from "@components/SignupQuestionsWidget";
|
||||
|
||||
export interface SignupForm {
|
||||
id?: number;
|
||||
title: string;
|
||||
title_fi: string;
|
||||
title_en: string;
|
||||
visible: boolean;
|
||||
start_time: string;
|
||||
end_time: string;
|
||||
|
||||
@@ -54,13 +54,13 @@ class AdminCommonPage extends React.Component<AdminCommonPageProps, AdminCommonP
|
||||
}
|
||||
|
||||
return (
|
||||
<React.Fragment>
|
||||
<>
|
||||
<AdminHeader />
|
||||
<div className="admin-container">
|
||||
<AdminSidebar path={path} />
|
||||
<Page {...this.props} />
|
||||
</div>
|
||||
</React.Fragment>
|
||||
</>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ class AdminSignupPage extends React.Component<AdminSignupPageProps, AdminSignupP
|
||||
<tbody>
|
||||
{signupForms.map(signupForm => (
|
||||
<tr key={signupForm.id}>
|
||||
<td><Anchor to={`/admin/signups/${signupForm.id}`}>{signupForm.title}</Anchor></td>
|
||||
<td><Anchor to={`/admin/signups/${signupForm.id}`}>{signupForm.title_fi}</Anchor></td>
|
||||
<td>{formatRelative(new Date(signupForm.start_time), new Date())}</td>
|
||||
<td>{formatRelative(new Date(signupForm.end_time), new Date())}</td>
|
||||
</tr>
|
||||
|
||||
@@ -203,7 +203,7 @@ class EventCreatePage extends React.Component<EventCreatePageProps, EventCreateP
|
||||
type: "number",
|
||||
// TODO: A bug here, DB must have at least one SignupForm, otherwise cannot submit
|
||||
enum: signupForm.map(form => form.id),
|
||||
enumNames: signupForm.map(form => form.title),
|
||||
enumNames: signupForm.map(form => form.title_fi),
|
||||
},
|
||||
uniqueItems: true,
|
||||
},
|
||||
|
||||
@@ -36,7 +36,7 @@ class EventPageView extends React.Component<EventPageViewProps> {
|
||||
{event.signupForm.map(sf => (
|
||||
<Anchor key={sf.id} to={`/signup/${sf.id}`}>
|
||||
<Button type="filled" onClick={() => {}}>
|
||||
{sf.title}
|
||||
{sf.title_fi}
|
||||
</Button>
|
||||
</Anchor>
|
||||
)
|
||||
|
||||
@@ -119,7 +119,7 @@ export const buildFormSchema = (signUpForm: SignupForm) => {
|
||||
});
|
||||
|
||||
const schema = {
|
||||
title: signUpForm.id ? signUpForm.title : "Loading...",
|
||||
title: signUpForm.id ? signUpForm.title_fi : "Loading...",
|
||||
type: "object",
|
||||
required: requiredIds,
|
||||
properties: schemaProps,
|
||||
|
||||
@@ -52,7 +52,7 @@ const SignUpPageView: React.FC<SignUpPageViewProps> = ({
|
||||
return (
|
||||
<>
|
||||
<h1>
|
||||
{signUpForm.title}
|
||||
{signUpForm.title_fi}
|
||||
</h1>
|
||||
<Form
|
||||
schema={schema as any}
|
||||
|
||||
Reference in New Issue
Block a user