SignupForm localised title

This commit is contained in:
Aarni Halinen
2020-10-08 18:54:54 +03:00
parent 4b71d8ee67
commit 09b85067b0
7 changed files with 9 additions and 8 deletions
+2 -1
View File
@@ -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;
+2 -2
View File
@@ -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>
</>
);
}
}
+1 -1
View File
@@ -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>
+1 -1
View File
@@ -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,
},
+1 -1
View File
@@ -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>
)
+1 -1
View File
@@ -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,
+1 -1
View File
@@ -52,7 +52,7 @@ const SignUpPageView: React.FC<SignUpPageViewProps> = ({
return (
<>
<h1>
{signUpForm.title}
{signUpForm.title_fi}
</h1>
<Form
schema={schema as any}