cronofy-elements 1.46.0 → 1.46.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/CronofyElements.v1.46.1.js +2 -0
- package/build/{CronofyElements.v1.46.0.js.LICENSE.txt → CronofyElements.v1.46.1.js.LICENSE.txt} +0 -0
- package/build/npm/CronofyElements.js +2 -2
- package/package.json +1 -1
- package/src/js/components/AvailabilityRules/Wrapper.js +4 -18
- package/src/js/components/generic/TimeZoneSelector.js +1 -0
- package/tests/AvailabilityRules/__snapshots__/AvailabilityRules.test.js.snap +1 -0
- package/build/CronofyElements.v1.46.0.js +0 -2
package/package.json
CHANGED
|
@@ -115,17 +115,7 @@ const Wrapper = ({ options }) => {
|
|
|
115
115
|
const allSlots = { ...slots, ...newSlots };
|
|
116
116
|
setSlots(allSlots);
|
|
117
117
|
const newRules = buildNewRules(allSlots);
|
|
118
|
-
|
|
119
|
-
notification: {
|
|
120
|
-
type: "availability_rule_edited",
|
|
121
|
-
},
|
|
122
|
-
availability_rule: {
|
|
123
|
-
...account,
|
|
124
|
-
calendar_ids: calendars.active,
|
|
125
|
-
weekly_periods: newRules,
|
|
126
|
-
},
|
|
127
|
-
};
|
|
128
|
-
status.callback(callbackContent);
|
|
118
|
+
setRules(newRules);
|
|
129
119
|
};
|
|
130
120
|
|
|
131
121
|
useEffect(() => {
|
|
@@ -148,7 +138,6 @@ const Wrapper = ({ options }) => {
|
|
|
148
138
|
|
|
149
139
|
useEffect(() => {
|
|
150
140
|
if (!status.loading && !status.error) {
|
|
151
|
-
const newRules = buildNewRules(slots);
|
|
152
141
|
const callbackContent = {
|
|
153
142
|
notification: {
|
|
154
143
|
type: "availability_rule_edited",
|
|
@@ -156,12 +145,12 @@ const Wrapper = ({ options }) => {
|
|
|
156
145
|
availability_rule: {
|
|
157
146
|
...account,
|
|
158
147
|
calendar_ids: calendars.active,
|
|
159
|
-
weekly_periods:
|
|
148
|
+
weekly_periods: rules,
|
|
160
149
|
},
|
|
161
150
|
};
|
|
162
151
|
status.callback(callbackContent);
|
|
163
152
|
}
|
|
164
|
-
}, [calendars]);
|
|
153
|
+
}, [calendars, account, rules]);
|
|
165
154
|
|
|
166
155
|
useEffect(() => {
|
|
167
156
|
// Query the API for rules and calendars, but don't do anything until
|
|
@@ -295,10 +284,7 @@ const Wrapper = ({ options }) => {
|
|
|
295
284
|
}, [tz.selectedTzid.tzid]);
|
|
296
285
|
|
|
297
286
|
const generateRules = () => {
|
|
298
|
-
const
|
|
299
|
-
|
|
300
|
-
setRules(newRules);
|
|
301
|
-
const rulesRequest = { ...account, weekly_periods: newRules };
|
|
287
|
+
const rulesRequest = { ...account, weekly_periods: rules };
|
|
302
288
|
|
|
303
289
|
let tempStatus = status;
|
|
304
290
|
|
|
@@ -117,6 +117,7 @@ const TimeZoneSelector = ({ locale, theme, tz, setTz }) => {
|
|
|
117
117
|
<button
|
|
118
118
|
className={theme.classBuilder("timezone-selector--button")}
|
|
119
119
|
id="timezone-button"
|
|
120
|
+
type="button"
|
|
120
121
|
aria-haspopup="listbox"
|
|
121
122
|
aria-label="Choose a timezone"
|
|
122
123
|
aria-expanded={showList}
|
|
@@ -1019,6 +1019,7 @@ exports[`Snapshot test of Availability Rules Elements renders AvailabilityRules
|
|
|
1019
1019
|
aria-label="Choose a timezone"
|
|
1020
1020
|
class="PREFIX__timezone-selector--button AR__timezone-selector--button"
|
|
1021
1021
|
id="timezone-button"
|
|
1022
|
+
type="button"
|
|
1022
1023
|
>
|
|
1023
1024
|
London
|
|
1024
1025
|
<svg
|