displaying civid

This commit is contained in:
msramalho
2022-03-15 12:06:09 +01:00
parent 400adc61f6
commit 4081710de4
3 changed files with 14 additions and 0 deletions

View File

@@ -11,6 +11,7 @@ import hash from "object-hash";
export const generateCardLayout = {
basic: ({ event }) => {
console.log(event)
return [
[
{
@@ -23,6 +24,11 @@ export const generateCardLayout = {
title: "Location",
value: event.location || ``,
},
{
kind: "text",
title: "id",
value: event.civId || ``,
},
],
[{ kind: "line-break", times: 0.4 }],
[
@@ -36,6 +42,7 @@ export const generateCardLayout = {
];
},
sourced: ({ event }) => {
console.log(event)
return [
[
{
@@ -48,6 +55,11 @@ export const generateCardLayout = {
title: "Location",
value: event.location || ``,
},
{
kind: "text",
title: "id",
value: event.civId || ``,
},
],
[
{

View File

@@ -17,6 +17,7 @@ function createEventSchema(custom) {
return Joi.object()
.keys({
id: Joi.string().allow(""),
civId: Joi.string().allow(""),
description: Joi.string().allow("").required(),
date: Joi.string().allow(""),
time: Joi.string().allow(""),

View File

@@ -160,6 +160,7 @@ export function validateDomain(domain, features) {
// append events with datetime and sort
sanitizedDomain.events = sanitizedDomain.events.filter((event, idx) => {
let errorMsg = "";
event.civId = event.id;
event.id = idx;
// event.associations comes in as a [association.ids...]; convert to actual association objects
event.associations = event.associations.reduce((acc, id) => {