cronofy-elements
Advanced tools
Comparing version 1.27.0 to 1.27.1
{ | ||
"name": "cronofy-elements", | ||
"version": "1.27.0", | ||
"version": "1.27.1", | ||
"description": "Fast track scheduling with Cronofy's embeddable UI Elements", | ||
@@ -5,0 +5,0 @@ "main": "build/npm/CronofyElements.js", |
@@ -250,3 +250,3 @@ import React, { useState, useEffect } from "react"; | ||
active: rulesResponse.availability_rule.calendar_ids || [], | ||
all: calsResponse.parsed, | ||
all: calsResponse.calendars, | ||
profiles: calsResponse.profiles | ||
@@ -253,0 +253,0 @@ }); |
@@ -93,6 +93,14 @@ import * as mocks from "./mocks"; | ||
export const parseRulesCalendars = response => { | ||
const parsed = response["cronofy.data"].profiles.map(profile => { | ||
return profile.profile_calendars | ||
.filter(cal => !cal.calendar_deleted) | ||
.map(cal => ({ | ||
// Filter deleted calendars | ||
const profiles = response["cronofy.data"].profiles.map(profile => { | ||
const profile_calendars = profile.profile_calendars.filter( | ||
cal => !cal.calendar_deleted | ||
); | ||
return { ...profile, profile_calendars }; | ||
}); | ||
// Format and flatten calendars into 1D array | ||
const calendars = profiles | ||
.map(profile => | ||
profile.profile_calendars.map(cal => ({ | ||
name: cal.calendar_name, | ||
@@ -102,8 +110,9 @@ id: cal.calendar_id, | ||
provider_name: profile.provider_name | ||
})); | ||
}); | ||
})) | ||
) | ||
.reduce((acc, curr) => [...acc, ...curr], []); | ||
return { | ||
parsed: parsed.reduce((acc, curr) => [...acc, ...curr], []), | ||
profiles: response["cronofy.data"].profiles | ||
calendars, | ||
profiles | ||
}; | ||
@@ -110,0 +119,0 @@ }; |
@@ -10,2 +10,3 @@ import { | ||
import { default_availability_rules } from "./mocks"; | ||
import moment from "moment-timezone"; | ||
@@ -12,0 +13,0 @@ export const parseAvailabilityRulesOptions = (options = {}) => { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2912436
27441