From 4081710de41df4f3d7b942739735b234976a820a Mon Sep 17 00:00:00 2001 From: msramalho <19508417+msramalho@users.noreply.github.com> Date: Tue, 15 Mar 2022 12:06:09 +0100 Subject: [PATCH] displaying civid --- src/components/controls/Card.js | 12 ++++++++++++ src/reducers/validate/eventSchema.js | 1 + src/reducers/validate/validators.js | 1 + 3 files changed, 14 insertions(+) diff --git a/src/components/controls/Card.js b/src/components/controls/Card.js index 8bd3a07..e292ead 100644 --- a/src/components/controls/Card.js +++ b/src/components/controls/Card.js @@ -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 || `—`, + }, ], [ { diff --git a/src/reducers/validate/eventSchema.js b/src/reducers/validate/eventSchema.js index 3a038ac..7350219 100644 --- a/src/reducers/validate/eventSchema.js +++ b/src/reducers/validate/eventSchema.js @@ -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(""), diff --git a/src/reducers/validate/validators.js b/src/reducers/validate/validators.js index 597639d..768161e 100644 --- a/src/reducers/validate/validators.js +++ b/src/reducers/validate/validators.js @@ -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) => {