From 4b252157cf1b64127a86a3a6fe35721479e7af80 Mon Sep 17 00:00:00 2001 From: Andrew Bestbier Date: Wed, 27 Jul 2016 15:35:04 +0100 Subject: [PATCH 01/10] Added ticket release date, ticket available and action link to event --- lib/event/eventFields.js | 13 +++++++++++++ lib/event/eventFields.spec.js | 7 ++++++- lib/fetch.js | 3 +++ lib/fetch.spec.js | 3 +++ prismic/custom-types/events.json | 20 ++++++++++++++++++++ test/fixtures/events.json | 18 ++++++++++++++++++ 6 files changed, 63 insertions(+), 1 deletion(-) diff --git a/lib/event/eventFields.js b/lib/event/eventFields.js index 1c9d7c2..ca0d565 100644 --- a/lib/event/eventFields.js +++ b/lib/event/eventFields.js @@ -5,6 +5,7 @@ import { GraphQLObjectType, GraphQLString, GraphQLList, + GraphQLBoolean, } from 'graphql'; import { fetchEvent, @@ -73,6 +74,18 @@ export const EventType = new GraphQLObjectType({ type: DateTimeType, resolve: mapDateTime('endDateTime'), }, + ticketReleaseDate: { + type: DateTimeType, + resolve: mapDateTime('ticketReleaseDate'), + }, + ticketsAvailiable: { + type: GraphQLBoolean, + description: 'A boolean show whether tickets are availiable', + }, + eventActionLink: { + type: GraphQLString, + description: 'The action link for the event', + }, schedule: { type: new GraphQLList(ScheduleItemType), description: 'An array of schedule items that each have a date and text description', diff --git a/lib/event/eventFields.spec.js b/lib/event/eventFields.spec.js index bdf1334..cd1fc18 100644 --- a/lib/event/eventFields.spec.js +++ b/lib/event/eventFields.spec.js @@ -37,6 +37,8 @@ describe('Event Queries', () => { datetime text } + eventActionLink + ticketsAvailiable sponsors { websiteURL imageURL @@ -55,7 +57,6 @@ describe('Event Queries', () => { `; const result = await graphql(EventsSchema, query); - expect(result.data).to.deep.equal({ allEvents: [ { @@ -71,6 +72,8 @@ describe('Event Queries', () => { longitude: '-0.08610963821411133', }, }, + eventActionLink: 'http://www.google.com', + ticketsAvailiable: false, schedule: [], sponsors: [], }, @@ -97,6 +100,8 @@ describe('Event Queries', () => { datetime: '2016-07-25T23:00:00+0000', text: 'Various speakers chat', }], + eventActionLink: 'http://www.google.com', + ticketsAvailiable: false, sponsors: [{ imageURL: 'http://react.london/img/SVG/Badger_Roundel.svg', websiteURL: 'http://red-badger.com', diff --git a/lib/fetch.js b/lib/fetch.js index 8619895..b537080 100644 --- a/lib/fetch.js +++ b/lib/fetch.js @@ -29,6 +29,9 @@ export function sanitizeEventAndNews(item, type) { startDateTime: get(`${type}.timestamp`), endDateTime: pathOr(get(`${type}.timestamp`), ['data', `${type}.timestampEnd`, 'value'], item), + ticketReleaseDate: get(`${type}.ticketReleaseDate`), + ticketsAvailiable: get(`${type}.ticketsAvailiable`) || false, + eventActionLink: get(`${type}.eventActionLink`), internalLinks: reformatLinkList((get(`${type}.internalLinks`))), externalLinks: reformatLinkList((get(`${type}.externalLinks`))), body: get(`${type}.body`) || [], diff --git a/lib/fetch.spec.js b/lib/fetch.spec.js index 2252eff..196a27a 100644 --- a/lib/fetch.spec.js +++ b/lib/fetch.spec.js @@ -81,6 +81,9 @@ describe('Data sanitation', () => { datetime: null, startDateTime: null, endDateTime: null, + eventActionLink: null, + ticketReleaseDate: null, + ticketsAvailiable: false, body: [], talks: [], schedule: [], diff --git a/prismic/custom-types/events.json b/prismic/custom-types/events.json index 1523dbd..34ffad6 100644 --- a/prismic/custom-types/events.json +++ b/prismic/custom-types/events.json @@ -47,6 +47,26 @@ "label" : "End date and time" } }, + "ticketReleaseDate" : { + "type" : "Timestamp", + "config" : { + "placeholder" : "Ticket release date" + } + }, + "ticketsAvailiable" : { + "type" : "Select", + "fieldset" : "A boolean showing whether the tickets are availiable", + "config" : { + "label" : "Tickets Availiable", + "options" : [ false, true ] + } + }, + "eventActionLink" : { + "type" : "Text", + "config" : { + "placeholder" : "Link URL" + } + }, "address" : { "type" : "Text", "fieldset" : "Event location", diff --git a/test/fixtures/events.json b/test/fixtures/events.json index e343cd3..3d21c47 100644 --- a/test/fixtures/events.json +++ b/test/fixtures/events.json @@ -28,6 +28,15 @@ "url": "/about-us/people/joe-stanton" } ], + "eventActionLink": "http://www.google.com", + "ticketReleaseDate": { + "iso": "2013-07-24T12:00:00.000Z", + "date": "24", + "monthSym": "Jul", + "month": "07", + "year": "2013" + }, + "ticketsAvailiable": false, "featureImageFilename": "profile_DW_thumb.jpg", "body": "The Red Badger tech team talk about how Node powered the new BBC Now homepage pilot.", "datetime": { @@ -58,6 +67,15 @@ "url": "https://www.react-europe.org/#about" } ], + "eventActionLink": "http://www.google.com", + "ticketReleaseDate": { + "iso": "2013-07-24T12:00:00.000Z", + "date": "24", + "monthSym": "Jul", + "month": "07", + "year": "2013" + }, + "ticketsAvailiable": false, "schedule": [ { "datetime": { From 0334f06cc5fcd5fffc0c2ac7979835c7c3f03102 Mon Sep 17 00:00:00 2001 From: Andrew Bestbier Date: Wed, 27 Jul 2016 15:49:08 +0100 Subject: [PATCH 02/10] Added date to event tests --- lib/event/eventFields.spec.js | 9 +++++++++ test/fixtures/events.json | 16 ++-------------- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/lib/event/eventFields.spec.js b/lib/event/eventFields.spec.js index cd1fc18..d73e537 100644 --- a/lib/event/eventFields.spec.js +++ b/lib/event/eventFields.spec.js @@ -44,6 +44,9 @@ describe('Event Queries', () => { imageURL name } + ticketReleaseDate { + date + } featureImageFilename location { address @@ -72,6 +75,9 @@ describe('Event Queries', () => { longitude: '-0.08610963821411133', }, }, + ticketReleaseDate: { + date: '24', + }, eventActionLink: 'http://www.google.com', ticketsAvailiable: false, schedule: [], @@ -90,6 +96,9 @@ describe('Event Queries', () => { longitude: '-0.08610963821411133', }, }, + ticketReleaseDate: { + date: '24', + }, schedule: [{ datetime: '2016-07-25T23:00:00+0000', text: 'Doors open for pizza and beers', diff --git a/test/fixtures/events.json b/test/fixtures/events.json index 3d21c47..7dd452d 100644 --- a/test/fixtures/events.json +++ b/test/fixtures/events.json @@ -29,13 +29,7 @@ } ], "eventActionLink": "http://www.google.com", - "ticketReleaseDate": { - "iso": "2013-07-24T12:00:00.000Z", - "date": "24", - "monthSym": "Jul", - "month": "07", - "year": "2013" - }, + "ticketReleaseDate": "2013-07-24T12:00:00.000Z", "ticketsAvailiable": false, "featureImageFilename": "profile_DW_thumb.jpg", "body": "The Red Badger tech team talk about how Node powered the new BBC Now homepage pilot.", @@ -68,13 +62,7 @@ } ], "eventActionLink": "http://www.google.com", - "ticketReleaseDate": { - "iso": "2013-07-24T12:00:00.000Z", - "date": "24", - "monthSym": "Jul", - "month": "07", - "year": "2013" - }, + "ticketReleaseDate": "2013-07-24T12:00:00.000Z", "ticketsAvailiable": false, "schedule": [ { From c4e96b1a6cd9be6c35b25d4e2d749058f1a4bb80 Mon Sep 17 00:00:00 2001 From: Andrew Bestbier Date: Wed, 27 Jul 2016 15:53:21 +0100 Subject: [PATCH 03/10] Minor update to event prismic schema --- prismic/custom-types/events.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/prismic/custom-types/events.json b/prismic/custom-types/events.json index 34ffad6..551b298 100644 --- a/prismic/custom-types/events.json +++ b/prismic/custom-types/events.json @@ -50,12 +50,12 @@ "ticketReleaseDate" : { "type" : "Timestamp", "config" : { - "placeholder" : "Ticket release date" + "label" : "Ticket release date" } }, "ticketsAvailiable" : { "type" : "Select", - "fieldset" : "A boolean showing whether the tickets are availiable", + "fieldset" : "Ticket availability and action", "config" : { "label" : "Tickets Availiable", "options" : [ false, true ] From 26780b7c96aaf47148c19b5cc29794a6d6ca0c91 Mon Sep 17 00:00:00 2001 From: Andrew Bestbier Date: Wed, 27 Jul 2016 15:55:49 +0100 Subject: [PATCH 04/10] Changed test data to use fake website names --- lib/event/eventFields.js | 2 +- lib/event/eventFields.spec.js | 4 ++-- test/fixtures/events.json | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/event/eventFields.js b/lib/event/eventFields.js index ca0d565..078fec7 100644 --- a/lib/event/eventFields.js +++ b/lib/event/eventFields.js @@ -80,7 +80,7 @@ export const EventType = new GraphQLObjectType({ }, ticketsAvailiable: { type: GraphQLBoolean, - description: 'A boolean show whether tickets are availiable', + description: 'A boolean to show whether tickets are availiable', }, eventActionLink: { type: GraphQLString, diff --git a/lib/event/eventFields.spec.js b/lib/event/eventFields.spec.js index d73e537..7c292b6 100644 --- a/lib/event/eventFields.spec.js +++ b/lib/event/eventFields.spec.js @@ -78,7 +78,7 @@ describe('Event Queries', () => { ticketReleaseDate: { date: '24', }, - eventActionLink: 'http://www.google.com', + eventActionLink: 'foo.com', ticketsAvailiable: false, schedule: [], sponsors: [], @@ -109,7 +109,7 @@ describe('Event Queries', () => { datetime: '2016-07-25T23:00:00+0000', text: 'Various speakers chat', }], - eventActionLink: 'http://www.google.com', + eventActionLink: 'foo.com', ticketsAvailiable: false, sponsors: [{ imageURL: 'http://react.london/img/SVG/Badger_Roundel.svg', diff --git a/test/fixtures/events.json b/test/fixtures/events.json index 7dd452d..8340c24 100644 --- a/test/fixtures/events.json +++ b/test/fixtures/events.json @@ -28,7 +28,7 @@ "url": "/about-us/people/joe-stanton" } ], - "eventActionLink": "http://www.google.com", + "eventActionLink": "foo.com", "ticketReleaseDate": "2013-07-24T12:00:00.000Z", "ticketsAvailiable": false, "featureImageFilename": "profile_DW_thumb.jpg", @@ -61,7 +61,7 @@ "url": "https://www.react-europe.org/#about" } ], - "eventActionLink": "http://www.google.com", + "eventActionLink": "foo.com", "ticketReleaseDate": "2013-07-24T12:00:00.000Z", "ticketsAvailiable": false, "schedule": [ From 2462e372dc8259685ea132e7e3c5d127527736e1 Mon Sep 17 00:00:00 2001 From: Andrew Bestbier Date: Wed, 27 Jul 2016 16:44:19 +0100 Subject: [PATCH 05/10] Removed eventActionLink and updated event schema --- lib/event/eventFields.js | 4 ---- lib/event/eventFields.spec.js | 3 --- lib/fetch.js | 1 - lib/fetch.spec.js | 1 - prismic/custom-types/events.json | 6 ------ test/fixtures/events.json | 2 -- 6 files changed, 17 deletions(-) diff --git a/lib/event/eventFields.js b/lib/event/eventFields.js index 078fec7..ccb35eb 100644 --- a/lib/event/eventFields.js +++ b/lib/event/eventFields.js @@ -82,10 +82,6 @@ export const EventType = new GraphQLObjectType({ type: GraphQLBoolean, description: 'A boolean to show whether tickets are availiable', }, - eventActionLink: { - type: GraphQLString, - description: 'The action link for the event', - }, schedule: { type: new GraphQLList(ScheduleItemType), description: 'An array of schedule items that each have a date and text description', diff --git a/lib/event/eventFields.spec.js b/lib/event/eventFields.spec.js index 7c292b6..4fd87d5 100644 --- a/lib/event/eventFields.spec.js +++ b/lib/event/eventFields.spec.js @@ -37,7 +37,6 @@ describe('Event Queries', () => { datetime text } - eventActionLink ticketsAvailiable sponsors { websiteURL @@ -78,7 +77,6 @@ describe('Event Queries', () => { ticketReleaseDate: { date: '24', }, - eventActionLink: 'foo.com', ticketsAvailiable: false, schedule: [], sponsors: [], @@ -109,7 +107,6 @@ describe('Event Queries', () => { datetime: '2016-07-25T23:00:00+0000', text: 'Various speakers chat', }], - eventActionLink: 'foo.com', ticketsAvailiable: false, sponsors: [{ imageURL: 'http://react.london/img/SVG/Badger_Roundel.svg', diff --git a/lib/fetch.js b/lib/fetch.js index b537080..833c611 100644 --- a/lib/fetch.js +++ b/lib/fetch.js @@ -31,7 +31,6 @@ export function sanitizeEventAndNews(item, type) { ['data', `${type}.timestampEnd`, 'value'], item), ticketReleaseDate: get(`${type}.ticketReleaseDate`), ticketsAvailiable: get(`${type}.ticketsAvailiable`) || false, - eventActionLink: get(`${type}.eventActionLink`), internalLinks: reformatLinkList((get(`${type}.internalLinks`))), externalLinks: reformatLinkList((get(`${type}.externalLinks`))), body: get(`${type}.body`) || [], diff --git a/lib/fetch.spec.js b/lib/fetch.spec.js index 196a27a..6f5da38 100644 --- a/lib/fetch.spec.js +++ b/lib/fetch.spec.js @@ -81,7 +81,6 @@ describe('Data sanitation', () => { datetime: null, startDateTime: null, endDateTime: null, - eventActionLink: null, ticketReleaseDate: null, ticketsAvailiable: false, body: [], diff --git a/prismic/custom-types/events.json b/prismic/custom-types/events.json index 551b298..c73f4a8 100644 --- a/prismic/custom-types/events.json +++ b/prismic/custom-types/events.json @@ -61,12 +61,6 @@ "options" : [ false, true ] } }, - "eventActionLink" : { - "type" : "Text", - "config" : { - "placeholder" : "Link URL" - } - }, "address" : { "type" : "Text", "fieldset" : "Event location", diff --git a/test/fixtures/events.json b/test/fixtures/events.json index 8340c24..79b81f0 100644 --- a/test/fixtures/events.json +++ b/test/fixtures/events.json @@ -28,7 +28,6 @@ "url": "/about-us/people/joe-stanton" } ], - "eventActionLink": "foo.com", "ticketReleaseDate": "2013-07-24T12:00:00.000Z", "ticketsAvailiable": false, "featureImageFilename": "profile_DW_thumb.jpg", @@ -61,7 +60,6 @@ "url": "https://www.react-europe.org/#about" } ], - "eventActionLink": "foo.com", "ticketReleaseDate": "2013-07-24T12:00:00.000Z", "ticketsAvailiable": false, "schedule": [ From 71f66d56cd6a0cd6fc29de97c396c83e78f90118 Mon Sep 17 00:00:00 2001 From: Sammy Isseyegh Date: Wed, 27 Jul 2016 17:07:59 +0100 Subject: [PATCH 06/10] default all links to have a type of OTHER --- lib/fetch.js | 2 ++ lib/sharedTypes.js | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/lib/fetch.js b/lib/fetch.js index 833c611..de29b09 100644 --- a/lib/fetch.js +++ b/lib/fetch.js @@ -6,12 +6,14 @@ function makeGetter(json) { return key => pathOr(null, ['data', key, 'value'], json); } +// TODO: move to sanitizing layer TBD. export function reformatLinkList(linkList) { if (!linkList) return []; return linkList.map((link) => { const newLink = {}; newLink.title = link.label; newLink.url = link.link; + newLink.type = link.type || { value: 'OTHER' }; return newLink; }); } diff --git a/lib/sharedTypes.js b/lib/sharedTypes.js index 03a7584..f207ba5 100644 --- a/lib/sharedTypes.js +++ b/lib/sharedTypes.js @@ -109,5 +109,9 @@ export const RelatedLinkType = new GraphQLObjectType({ type: GraphQLString, description: 'Full URL of the link', }, + type: { + type: GraphQLString, + description: 'Type of the link', + }, }, }); From 5496043cc72065d00d4696fb9550cbfb82d655d9 Mon Sep 17 00:00:00 2001 From: Sammy Isseyegh Date: Thu, 28 Jul 2016 10:02:35 +0100 Subject: [PATCH 07/10] be consistent with internal & external links, add type property --- prismic/custom-types/events.json | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/prismic/custom-types/events.json b/prismic/custom-types/events.json index c73f4a8..5fb9f48 100644 --- a/prismic/custom-types/events.json +++ b/prismic/custom-types/events.json @@ -55,7 +55,7 @@ }, "ticketsAvailiable" : { "type" : "Select", - "fieldset" : "Ticket availability and action", + "fieldset" : "A boolean showing whether the tickets are availiable", "config" : { "label" : "Tickets Availiable", "options" : [ false, true ] @@ -87,6 +87,15 @@ "config" : { "placeholder" : "Link URL" } + }, + "type" : { + "type" : "Select", + "fieldset" : "A type of link", + "config" : { + "label" : "Link Type", + "options" : [ "STREAM", "EVENT" ], + "placeholder" : "OTHER" + } } } } @@ -153,6 +162,15 @@ "config" : { "placeholder" : "Link URL" } + }, + "type" : { + "type" : "Select", + "fieldset" : "A type of link", + "config" : { + "label" : "Link Type", + "options" : [ "STREAM", "EVENT" ], + "placeholder" : "OTHER" + } } } } From 81df1bceb61bb72f412c896d6cc981a6e9c18ec7 Mon Sep 17 00:00:00 2001 From: Sammy Isseyegh Date: Thu, 28 Jul 2016 10:14:57 +0100 Subject: [PATCH 08/10] add tests for refromatLinkList --- lib/fetch.spec.js | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/lib/fetch.spec.js b/lib/fetch.spec.js index 6f5da38..ca5b4d5 100644 --- a/lib/fetch.spec.js +++ b/lib/fetch.spec.js @@ -11,6 +11,7 @@ import { sanitizeCommunity, sanitizeSpeaker, sanitizeTalk, + reformatLinkList, } from './fetch'; describe('Fetch', () => { @@ -187,4 +188,28 @@ describe('sanitizeTalk', () => { ], }); }); + + describe.only('RefromatLinks', () => { + it('returns an array of formatted objects', () => { + const initialList = [ + { label: { value: 'foo' }, link: { value: 'bar.com' }, type: { value: 'STREAM' } }, + ]; + const expectedNewList = [ + { title: { value: 'foo' }, url: { value: 'bar.com' }, type: { value: 'STREAM' } }, + ]; + + expect(reformatLinkList(initialList)).to.deep.equal(expectedNewList); + }); + + it('no type property defaults type to OTHER', () => { + const initialList = [ + { label: { value: 'foo' }, link: { value: 'bar.com' } }, + ]; + const expectedNewList = [ + { title: { value: 'foo' }, url: { value: 'bar.com' }, type: { value: 'OTHER' } }, + ]; + + expect(reformatLinkList(initialList)).to.deep.equal(expectedNewList); + }); + }); }); From 6caa54796fce33db62b5f9ff8d162fe9e043fdcf Mon Sep 17 00:00:00 2001 From: Sammy Isseyegh Date: Thu, 28 Jul 2016 10:41:00 +0100 Subject: [PATCH 09/10] improve tests for internal/externalLinks --- lib/event/eventFields.js | 1 + lib/event/eventFields.spec.js | 37 +++++++++++++++++++++++++++ lib/fetch.spec.js | 2 +- test/fixtures/events.json | 48 ++++++++++++++++++++++++++--------- 4 files changed, 75 insertions(+), 13 deletions(-) diff --git a/lib/event/eventFields.js b/lib/event/eventFields.js index ccb35eb..0cd886e 100644 --- a/lib/event/eventFields.js +++ b/lib/event/eventFields.js @@ -76,6 +76,7 @@ export const EventType = new GraphQLObjectType({ }, ticketReleaseDate: { type: DateTimeType, + description: 'The date when the event tickets are released.', resolve: mapDateTime('ticketReleaseDate'), }, ticketsAvailiable: { diff --git a/lib/event/eventFields.spec.js b/lib/event/eventFields.spec.js index 4fd87d5..2ec9d49 100644 --- a/lib/event/eventFields.spec.js +++ b/lib/event/eventFields.spec.js @@ -33,6 +33,16 @@ describe('Event Queries', () => { title slug strapline + internalLinks { + title + url + type + } + externalLinks { + title + url + type + } schedule { datetime text @@ -74,6 +84,25 @@ describe('Event Queries', () => { longitude: '-0.08610963821411133', }, }, + externalLinks: [ + { + title: 'London Node.js User Group', + type: 'STREAM', + url: 'http://lnug.org/', + }, + { + title: 'Attend or track the event on Lanyrd', + url: 'http://lanyrd.com/2013/lnug-july/', + type: 'OTHER', + }, + ], + internalLinks: [ + { + title: 'Who is David?', + url: '/about-us/people/david-wynne', + type: 'OTHER', + }, + ], ticketReleaseDate: { date: '24', }, @@ -94,6 +123,14 @@ describe('Event Queries', () => { longitude: '-0.08610963821411133', }, }, + externalLinks: [ + { + title: 'For more information please visit the conference page', + url: 'https://www.react-europe.org/#about', + type: 'EVENT', + }, + ], + internalLinks: [], ticketReleaseDate: { date: '24', }, diff --git a/lib/fetch.spec.js b/lib/fetch.spec.js index ca5b4d5..9219292 100644 --- a/lib/fetch.spec.js +++ b/lib/fetch.spec.js @@ -189,7 +189,7 @@ describe('sanitizeTalk', () => { }); }); - describe.only('RefromatLinks', () => { + describe('RefromatLinks', () => { it('returns an array of formatted objects', () => { const initialList = [ { label: { value: 'foo' }, link: { value: 'bar.com' }, type: { value: 'STREAM' } }, diff --git a/test/fixtures/events.json b/test/fixtures/events.json index 79b81f0..cd8766f 100644 --- a/test/fixtures/events.json +++ b/test/fixtures/events.json @@ -10,22 +10,39 @@ "sponsors": [], "externalLinks": [ { - "title": "London Node.js User Group", - "url": "http://lnug.org/" + "title": { + "value": "London Node.js User Group" + }, + "url": { + "value": "http://lnug.org/" + }, + "type": { + "value": "STREAM" + } }, { - "title": "Attend or track the event on Lanyrd", - "url": "http://lanyrd.com/2013/lnug-july/" + "title": { + "value": "Attend or track the event on Lanyrd" + }, + "url": { + "value": "http://lanyrd.com/2013/lnug-july/" + }, + "type": { + "value": "OTHER" + } } ], "internalLinks": [ { - "title": "Who is David?", - "url": "/about-us/people/david-wynne" - }, - { - "title": "Who is Joe?", - "url": "/about-us/people/joe-stanton" + "title": { + "value": "Who is David?" + }, + "url": { + "value": "/about-us/people/david-wynne" + }, + "type": { + "value": "OTHER" + } } ], "ticketReleaseDate": "2013-07-24T12:00:00.000Z", @@ -56,8 +73,15 @@ "featureImageFilename": "react-europe.jpg", "externalLinks": [ { - "title": "For more information please visit the conference page", - "url": "https://www.react-europe.org/#about" + "title": { + "value": "For more information please visit the conference page" + }, + "url": { + "value": "https://www.react-europe.org/#about" + }, + "type": { + "value": "EVENT" + } } ], "ticketReleaseDate": "2013-07-24T12:00:00.000Z", From 8e55cd39c78009eaa79c6c9c47c5e48724f5e50c Mon Sep 17 00:00:00 2001 From: Sammy Isseyegh Date: Thu, 28 Jul 2016 10:55:09 +0100 Subject: [PATCH 10/10] fix spelling mistakes --- lib/event/eventFields.js | 2 +- lib/event/eventFields.spec.js | 6 +++--- lib/fetch.js | 2 +- lib/fetch.spec.js | 4 ++-- prismic/custom-types/events.json | 4 ++-- test/fixtures/events.json | 4 ++-- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/event/eventFields.js b/lib/event/eventFields.js index 0cd886e..1977598 100644 --- a/lib/event/eventFields.js +++ b/lib/event/eventFields.js @@ -79,7 +79,7 @@ export const EventType = new GraphQLObjectType({ description: 'The date when the event tickets are released.', resolve: mapDateTime('ticketReleaseDate'), }, - ticketsAvailiable: { + ticketsAvailable: { type: GraphQLBoolean, description: 'A boolean to show whether tickets are availiable', }, diff --git a/lib/event/eventFields.spec.js b/lib/event/eventFields.spec.js index 2ec9d49..5444aa7 100644 --- a/lib/event/eventFields.spec.js +++ b/lib/event/eventFields.spec.js @@ -47,7 +47,7 @@ describe('Event Queries', () => { datetime text } - ticketsAvailiable + ticketsAvailable sponsors { websiteURL imageURL @@ -106,7 +106,7 @@ describe('Event Queries', () => { ticketReleaseDate: { date: '24', }, - ticketsAvailiable: false, + ticketsAvailable: false, schedule: [], sponsors: [], }, @@ -144,7 +144,7 @@ describe('Event Queries', () => { datetime: '2016-07-25T23:00:00+0000', text: 'Various speakers chat', }], - ticketsAvailiable: false, + ticketsAvailable: false, sponsors: [{ imageURL: 'http://react.london/img/SVG/Badger_Roundel.svg', websiteURL: 'http://red-badger.com', diff --git a/lib/fetch.js b/lib/fetch.js index de29b09..21753f9 100644 --- a/lib/fetch.js +++ b/lib/fetch.js @@ -32,7 +32,7 @@ export function sanitizeEventAndNews(item, type) { endDateTime: pathOr(get(`${type}.timestamp`), ['data', `${type}.timestampEnd`, 'value'], item), ticketReleaseDate: get(`${type}.ticketReleaseDate`), - ticketsAvailiable: get(`${type}.ticketsAvailiable`) || false, + ticketsAvailable: get(`${type}.ticketsAvailable`) || false, internalLinks: reformatLinkList((get(`${type}.internalLinks`))), externalLinks: reformatLinkList((get(`${type}.externalLinks`))), body: get(`${type}.body`) || [], diff --git a/lib/fetch.spec.js b/lib/fetch.spec.js index 9219292..ad458fb 100644 --- a/lib/fetch.spec.js +++ b/lib/fetch.spec.js @@ -83,7 +83,7 @@ describe('Data sanitation', () => { startDateTime: null, endDateTime: null, ticketReleaseDate: null, - ticketsAvailiable: false, + ticketsAvailable: false, body: [], talks: [], schedule: [], @@ -189,7 +189,7 @@ describe('sanitizeTalk', () => { }); }); - describe('RefromatLinks', () => { + describe('reformatLinks', () => { it('returns an array of formatted objects', () => { const initialList = [ { label: { value: 'foo' }, link: { value: 'bar.com' }, type: { value: 'STREAM' } }, diff --git a/prismic/custom-types/events.json b/prismic/custom-types/events.json index 5fb9f48..5addc05 100644 --- a/prismic/custom-types/events.json +++ b/prismic/custom-types/events.json @@ -53,11 +53,11 @@ "label" : "Ticket release date" } }, - "ticketsAvailiable" : { + "ticketsAvailable" : { "type" : "Select", "fieldset" : "A boolean showing whether the tickets are availiable", "config" : { - "label" : "Tickets Availiable", + "label" : "Tickets Available", "options" : [ false, true ] } }, diff --git a/test/fixtures/events.json b/test/fixtures/events.json index cd8766f..154c2e8 100644 --- a/test/fixtures/events.json +++ b/test/fixtures/events.json @@ -46,7 +46,7 @@ } ], "ticketReleaseDate": "2013-07-24T12:00:00.000Z", - "ticketsAvailiable": false, + "ticketsAvailable": false, "featureImageFilename": "profile_DW_thumb.jpg", "body": "The Red Badger tech team talk about how Node powered the new BBC Now homepage pilot.", "datetime": { @@ -85,7 +85,7 @@ } ], "ticketReleaseDate": "2013-07-24T12:00:00.000Z", - "ticketsAvailiable": false, + "ticketsAvailable": false, "schedule": [ { "datetime": {