cronofy-elements
Advanced tools
Comparing version 1.29.2 to 1.30.0
{ | ||
"name": "cronofy-elements", | ||
"version": "1.29.2", | ||
"version": "1.30.0", | ||
"description": "Fast track scheduling with Cronofy's embeddable UI Elements", | ||
@@ -5,0 +5,0 @@ "main": "build/npm/CronofyElements.js", |
@@ -95,3 +95,4 @@ import React, { useState, useEffect, useRef } from "react"; | ||
pagesLoaded: [], | ||
startDay: options.config.startDay | ||
startDay: options.config.startDay, | ||
allowExpansion: options.config.allowExpansion | ||
}); | ||
@@ -98,0 +99,0 @@ |
@@ -46,5 +46,9 @@ import React, { useContext, useState } from "react"; | ||
)} | ||
{status.mode === "free_select" && <TimeExpander backwards={true} />} | ||
{(status.mode === "free_select" || status.allowExpansion) && ( | ||
<TimeExpander backwards={true} /> | ||
)} | ||
{labelsOutput} | ||
{status.mode === "free_select" && <TimeExpander />} | ||
{(status.mode === "free_select" || status.allowExpansion) && ( | ||
<TimeExpander /> | ||
)} | ||
</div> | ||
@@ -51,0 +55,0 @@ ); |
@@ -144,2 +144,8 @@ import moment from "moment-timezone"; | ||
const allowExpansion = | ||
typeof config.allow_expansion === "undefined" || | ||
config.allow_expansion === "default" | ||
? false | ||
: config.allow_expansion; | ||
const startDay = | ||
@@ -174,2 +180,3 @@ typeof config.week_start_day === "undefined" || | ||
...config, | ||
allowExpansion, | ||
start_time: startTime.time, | ||
@@ -215,2 +222,3 @@ end_time: endTime.time, | ||
delete config.week_start_day; | ||
delete config.allow_expansion; | ||
delete config.translations; | ||
@@ -217,0 +225,0 @@ |
@@ -32,2 +32,3 @@ import moment from "moment-timezone"; | ||
config: { | ||
allow_expansion: true, | ||
bounds_control: true, | ||
@@ -46,2 +47,3 @@ start_time: "01:00", | ||
config: { | ||
allowExpansion: true, | ||
boundsControl: true, | ||
@@ -706,2 +708,38 @@ end_time: "02:00", | ||
}); | ||
it("correctly adds config.allowExpansion", () => { | ||
const input = { | ||
data_center: "DATA_CENTER", | ||
availability_query: { | ||
query_periods: generic_query_periods, | ||
required_duration: "TEST" | ||
}, | ||
target_id: "TARGET", | ||
element_token: "TOKEN" | ||
}; | ||
const result = parseAvailabilityViewerOptions(input); | ||
expect(result.config).toHaveProperty("allowExpansion"); | ||
expect(result.config.allowExpansion).toBe(false); | ||
}); | ||
it("correctly parses config.allow_expansion", () => { | ||
const input = { | ||
data_center: "DATA_CENTER", | ||
availability_query: { | ||
query_periods: generic_query_periods, | ||
required_duration: "TEST" | ||
}, | ||
target_id: "TARGET", | ||
element_token: "TOKEN", | ||
config: { | ||
allow_expansion: true | ||
} | ||
}; | ||
const result = parseAvailabilityViewerOptions(input); | ||
expect(result.config).toHaveProperty("allowExpansion"); | ||
expect(result.config).not.toHaveProperty("allow_expansion"); | ||
expect(result.config.allowExpansion).toBe(true); | ||
}); | ||
}); |
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
2918052
27553