Use localized fields from be

This commit is contained in:
Aarni Halinen
2020-10-08 18:37:46 +03:00
parent d5158648bc
commit da71a86822
3 changed files with 21 additions and 9 deletions
+2
View File
@@ -13,6 +13,8 @@ export interface Event {
description_en: string;
content_fi: string;
content_en: string;
location_fi: string;
location_en: string;
start_time: string;
end_time: string;
image: string;
+11 -6
View File
@@ -168,7 +168,7 @@ class EventCreatePage extends React.Component<EventCreatePageProps, EventCreateP
const schema = {
title: formData.id ? formData.title_fi : "New Event",
type: "object",
required: ["title_fi", "title_en", "tags", "location", "start_time", "end_time", "description_fi", "description_en", "content_fi", "content_en"],
required: ["title_fi", "title_en", "tags", "location_fi", "location_en", "start_time", "end_time", "description_fi", "description_en", "content_fi", "content_en"],
properties: {
tags: {
type: "array",
@@ -186,11 +186,6 @@ class EventCreatePage extends React.Component<EventCreatePageProps, EventCreateP
title: "Visible",
default: true,
},
location: {
type: "string",
title: "Location",
default: "",
},
start_time: {
type: "string",
title: "Start time",
@@ -237,6 +232,11 @@ class EventCreatePage extends React.Component<EventCreatePageProps, EventCreateP
title: "Content",
default: "",
},
location_fi: {
type: "string",
title: "Location",
default: "",
},
english_section_divider: {
title: "English",
type: "string",
@@ -256,6 +256,11 @@ class EventCreatePage extends React.Component<EventCreatePageProps, EventCreateP
title: "Content",
default: "",
},
location_en: {
type: "string",
title: "Location",
default: "",
},
}
};
return schema;
+8 -3
View File
@@ -129,11 +129,16 @@ class SignupCreatePage extends React.Component<SignupCreatePageProps, SignupCrea
const schema = {
title: formData.id ? formData.title : "New Sign-up form",
type: "object",
required: ["title", "start_time", "end_time", "questions"],
required: ["title_fi", "title_en", "start_time", "end_time", "questions"],
properties: {
title: {
title_fi: {
type: "string",
title: "Title",
title: "Title (FI)",
default: "",
},
title_en: {
type: "string",
title: "Title (EN)",
default: "",
},
visible: {