Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add 25Mar2020 Virtual Session fields for non-offline sessions #2

Open
wants to merge 2 commits into
base: feature/configurable-sessionseries-dates
Choose a base branch
from

Conversation

lukehesluke
Copy link

@lukehesluke lukehesluke commented Mar 27, 2020

QA

Example of a golden session:

Screenshot 2020-03-27 at 20 53 31

Online sessions have no location:

Screenshot 2020-03-27 at 20 58 00

Example of an affiliated location:

Screenshot 2020-03-27 at 20 59 09

@lukehesluke lukehesluke marked this pull request as ready for review March 27, 2020 21:00
@@ -119,7 +124,7 @@ function generateOffer(age, baseUrl, modified, golden, free) {

function generateImages(golden) {
var out = [];
var imageCount = faker.random.number(golden ? {min: 4, max: 6} : 6);
var imageCount = faker.random.number(golden ? {min: 4, max: 6} : { max: 6 });
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My error checker gets confused when function call signatures are mixed with a single call (i.e. number(max: number) vs number({ max: number, min: number })).

So I've updated it to both use the same signature (with the min/max object)

var startDate = moment.tz(startDateString, tzid);
var endDate = startDate.clone().add(moment.duration(duration));
/**
* @param {Date} startDate
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was not a string - it was a Date

Comment on lines +462 to +545
/**
* @param {string} orgBaseUrl
* @param {boolean} golden
*/
function generatePlace(orgBaseUrl, golden) {
var siteName = faker.address.streetName() + " " + faker.random.arrayElement(["Sports Village", "Leisure Centre", "Centre"]);
var postcodeObj = postcodes[faker.random.number(postcodes.length - 1)];
return {
"type": "Place",
"url": orgBaseUrl + "/" + faker.random.arrayElement(["sites", "centres", "locations"]) + "/" + faker.helpers.slugify(siteName.toLowerCase()),
"name": siteName,
"description": faker.lorem.paragraphs(golden ? 4 : faker.random.number(4)),
"identifier": faker.finance.bic(),
"address": {
"type": "PostalAddress",
"streetAddress": faker.address.streetAddress(),
"addressLocality": "Oxford",
"addressRegion": "Oxfordshire",
"postalCode": postcodeObj.postcode,
"addressCountry": "GB"
},
"telephone": faker.phone.phoneNumber(),
"geo": {
"type": "GeoCoordinates",
"latitude": postcodeObj.latitude,
"longitude": postcodeObj.longitude
},
"image": generateImages(),
"amenityFeature": generateAmenityFeature(golden),
"openingHoursSpecification": [
{
"type": "OpeningHoursSpecification",
"dayOfWeek": "https://schema.org/Sunday",
"opens": "09:00",
"closes": "17:30"
},
{
"type": "OpeningHoursSpecification",
"dayOfWeek": "https://schema.org/Monday",
"opens": "06:30",
"closes": "21:30"
},
{
"type": "OpeningHoursSpecification",
"dayOfWeek": "https://schema.org/Tuesday",
"opens": "06:30",
"closes": "21:30"
},
{
"type": "OpeningHoursSpecification",
"dayOfWeek": "https://schema.org/Wednesday",
"opens": "06:30",
"closes": "21:30"
},
{
"type": "OpeningHoursSpecification",
"dayOfWeek": "https://schema.org/Thursday",
"opens": "06:30",
"closes": "21:30"
},
{
"type": "OpeningHoursSpecification",
"dayOfWeek": "https://schema.org/Friday",
"opens": "06:30",
"closes": "20:30"
},
{
"type": "OpeningHoursSpecification",
"dayOfWeek": "https://schema.org/Saturday",
"opens": "07:15",
"closes": "17:30"
}
]
};
}

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an exact copy of the Place object that was created in generateSessionSeriesItemData. I have made no updates to it other than moving it into its own function

@lukehesluke lukehesluke temporarily deployed to imin-lorem-fitsum-prod March 27, 2020 21:22 Inactive
@lukehesluke lukehesluke force-pushed the feature/virtual-fields branch from a471fb9 to 94277ef Compare March 28, 2020 09:03
@lukehesluke lukehesluke temporarily deployed to imin-lorem-fitsum-prod March 28, 2020 09:03 Inactive
@lukehesluke
Copy link
Author

nickevansuk and others added 2 commits April 1, 2020 12:20
…rable-sessionseries-dates

feat: Configure timestamp and schedule generation for SessionSeries feed
@lukehesluke lukehesluke force-pushed the feature/virtual-fields branch from 94277ef to b530461 Compare April 1, 2020 12:17
@lukehesluke lukehesluke changed the title feat: Add 27Mar2020 Virtual Session fields for non-offline sessions feat: Add 25Mar2020 Virtual Session fields for non-offline sessions Apr 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants