Set initial values for some EventMetadata elements

Otherwise it fails backend validation

Closes #931

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2021-11-22 10:02:57 +01:00
parent 6167d8c416
commit 49ad1637f9
No known key found for this signature in database
GPG Key ID: A061B9DDE0CA0773
2 changed files with 8 additions and 4 deletions

View File

@ -16,6 +16,7 @@
>
<b-autocomplete
expanded
:clear-on-select="true"
v-model="search"
ref="autocomplete"
:data="filteredDataArray"
@ -140,7 +141,10 @@ export default class EventMetadataList extends Vue {
}
set metadata(metadata: IEventMetadata[]) {
this.$emit("input", metadata);
this.$emit(
"input",
metadata.filter((elem) => elem)
);
}
localizedCategories: Record<EventMetadataCategories, string> = {

View File

@ -14,7 +14,7 @@ export const eventMetaDataList: IEventMetadataDescription[] = [
description: i18n.t(
"Whether the event is accessible with a wheelchair"
) as string,
value: "",
value: "no",
type: EventMetadataType.STRING,
keyType: EventMetadataKeyType.CHOICE,
choices: {
@ -29,7 +29,7 @@ export const eventMetaDataList: IEventMetadataDescription[] = [
key: "mz:accessibility:live:subtitle",
label: i18n.t("Subtitles") as string,
description: i18n.t("Whether the event live video is subtitled") as string,
value: "",
value: "false",
type: EventMetadataType.BOOLEAN,
keyType: EventMetadataKeyType.PLAIN,
choices: {
@ -47,7 +47,7 @@ export const eventMetaDataList: IEventMetadataDescription[] = [
description: i18n.t(
"Whether the event is interpreted in sign language"
) as string,
value: "",
value: "false",
type: EventMetadataType.BOOLEAN,
keyType: EventMetadataKeyType.PLAIN,
choices: {