Skip to content
This repository has been archived by the owner on Feb 8, 2023. It is now read-only.

Commit

Permalink
Added waitingListOpen boolean to event type
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewBestbier committed Jul 28, 2016
1 parent 287d07a commit f0fb05d
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/event/eventFields.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ export const EventType = new GraphQLObjectType({
type: GraphQLBoolean,
description: 'A boolean to show whether tickets are availiable',
},
waitingListOpen: {
type: GraphQLBoolean,
description: 'A boolean to show whether the waiting list is open',
},
schedule: {
type: new GraphQLList(ScheduleItemType),
description: 'An array of schedule items that each have a date and text description',
Expand Down
3 changes: 3 additions & 0 deletions lib/event/eventFields.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ describe('Event Queries', () => {
text
}
ticketsAvailable
waitingListOpen
sponsors {
websiteURL
imageURL
Expand Down Expand Up @@ -130,6 +131,7 @@ describe('Event Queries', () => {
date: '24',
},
ticketsAvailable: false,
waitingListOpen: false,
schedule: [],
sponsors: [],
},
Expand Down Expand Up @@ -168,6 +170,7 @@ describe('Event Queries', () => {
text: 'Various speakers chat',
}],
ticketsAvailable: false,
waitingListOpen: false,
sponsors: [{
imageURL: 'http://react.london/img/SVG/Badger_Roundel.svg',
websiteURL: 'http://red-badger.com',
Expand Down
1 change: 1 addition & 0 deletions lib/fetch.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export function sanitizeEventAndNews(item, type) {
['data', `${type}.timestampEnd`, 'value'], item),
ticketReleaseDate: get(`${type}.ticketReleaseDate`),
ticketsAvailable: get(`${type}.ticketsAvailable`) || false,
waitingListOpen: get(`${type}.waitingListOpen`) || false,
internalLinks: reformatLinkList((get(`${type}.internalLinks`))),
externalLinks: reformatLinkList((get(`${type}.externalLinks`))),
body: get(`${type}.body`) || [],
Expand Down
1 change: 1 addition & 0 deletions lib/fetch.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ describe('Data sanitation', () => {
endDateTime: null,
ticketReleaseDate: null,
ticketsAvailable: false,
waitingListOpen: false,
body: [],
talks: [],
schedule: [],
Expand Down
8 changes: 8 additions & 0 deletions prismic/custom-types/events.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,14 @@
"options" : [ false, true ]
}
},
"waitingListOpen" : {
"type" : "Select",
"fieldset" : "A boolean showing whether the waiting list is open",
"config" : {
"label" : "Waiting List Open",
"options" : [ false, true ]
}
},
"address" : {
"type" : "Text",
"fieldset" : "Event location",
Expand Down
2 changes: 2 additions & 0 deletions test/fixtures/events.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
],
"ticketReleaseDate": "2013-07-24T12:00:00.000Z",
"ticketsAvailable": false,
"waitingListOpen": false,
"featureImageFilename": "profile_DW_thumb.jpg",
"body": "The Red Badger tech team talk about how Node powered the new BBC Now homepage pilot.",
"datetime": {
Expand Down Expand Up @@ -86,6 +87,7 @@
],
"ticketReleaseDate": "2013-07-24T12:00:00.000Z",
"ticketsAvailable": false,
"waitingListOpen": false,
"schedule": [
{
"datetime": {
Expand Down

0 comments on commit f0fb05d

Please sign in to comment.