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

View File

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