mirror of
https://github.com/kingomarnajjar/flex-template-web.git
synced 2026-07-25 22:37:18 +10:00
Fix: availabilityPlan prop in EditListingAvailabilityForm was missing.
This commit is contained in:
parent
0ac72e2ff4
commit
eed0b9b0e8
6 changed files with 106 additions and 1 deletions
|
|
@ -26,6 +26,39 @@ export const Empty = {
|
|||
onFetchAvailabilityExceptions: () => console.log('onFetchAvailabilityExceptions called'),
|
||||
onFetchBookings: () => console.log('onFetchBookings called'),
|
||||
},
|
||||
availabilityPlan: {
|
||||
type: 'availability-plan/day',
|
||||
entries: [
|
||||
{
|
||||
dayOfWeek: 'mon',
|
||||
seats: 1,
|
||||
},
|
||||
{
|
||||
dayOfWeek: 'tue',
|
||||
seats: 1,
|
||||
},
|
||||
{
|
||||
dayOfWeek: 'wed',
|
||||
seats: 1,
|
||||
},
|
||||
{
|
||||
dayOfWeek: 'thu',
|
||||
seats: 1,
|
||||
},
|
||||
{
|
||||
dayOfWeek: 'fri',
|
||||
seats: 1,
|
||||
},
|
||||
{
|
||||
dayOfWeek: 'sat',
|
||||
seats: 1,
|
||||
},
|
||||
{
|
||||
dayOfWeek: 'sun',
|
||||
seats: 1,
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
group: 'forms',
|
||||
};
|
||||
|
|
|
|||
|
|
@ -84,6 +84,7 @@ EditListingAvailabilityFormComponent.propTypes = {
|
|||
updateError: propTypes.error,
|
||||
updateInProgress: bool.isRequired,
|
||||
availability: object.isRequired,
|
||||
availabilityPlan: propTypes.availabilityPlan.isRequired,
|
||||
};
|
||||
|
||||
export default compose(injectIntl)(EditListingAvailabilityFormComponent);
|
||||
|
|
|
|||
|
|
@ -32,6 +32,39 @@ describe('EditListingAvailabilityForm', () => {
|
|||
onFetchAvailabilityExceptions: noop,
|
||||
onFetchBookings: noop,
|
||||
}}
|
||||
availabilityPlan={{
|
||||
type: 'availability-plan/day',
|
||||
entries: [
|
||||
{
|
||||
dayOfWeek: 'mon',
|
||||
seats: 1,
|
||||
},
|
||||
{
|
||||
dayOfWeek: 'tue',
|
||||
seats: 1,
|
||||
},
|
||||
{
|
||||
dayOfWeek: 'wed',
|
||||
seats: 1,
|
||||
},
|
||||
{
|
||||
dayOfWeek: 'thu',
|
||||
seats: 1,
|
||||
},
|
||||
{
|
||||
dayOfWeek: 'fri',
|
||||
seats: 1,
|
||||
},
|
||||
{
|
||||
dayOfWeek: 'sat',
|
||||
seats: 1,
|
||||
},
|
||||
{
|
||||
dayOfWeek: 'sun',
|
||||
seats: 1,
|
||||
},
|
||||
],
|
||||
}}
|
||||
/>
|
||||
);
|
||||
expect(tree).toMatchSnapshot();
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ import {
|
|||
ensureAvailabilityException,
|
||||
ensureDayAvailabilityPlan,
|
||||
} from '../../util/data';
|
||||
import { DAYS_OF_WEEK } from '../../util/types';
|
||||
import { DAYS_OF_WEEK, propTypes } from '../../util/types';
|
||||
import { monthIdString, monthIdStringInUTC } from '../../util/dates';
|
||||
import { IconArrowHead, IconSpinner } from '../../components';
|
||||
|
||||
|
|
@ -510,6 +510,7 @@ ManageAvailabilityCalendar.propTypes = {
|
|||
onDeleteAvailabilityException: func.isRequired,
|
||||
onCreateAvailabilityException: func.isRequired,
|
||||
}).isRequired,
|
||||
availabilityPlan: propTypes.availabilityPlan.isRequired,
|
||||
onMonthChanged: func,
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -11,6 +11,41 @@ exports[`EditListingAvailabilityForm matches snapshot 1`] = `
|
|||
"onFetchBookings": [Function],
|
||||
}
|
||||
}
|
||||
availabilityPlan={
|
||||
Object {
|
||||
"entries": Array [
|
||||
Object {
|
||||
"dayOfWeek": "mon",
|
||||
"seats": 1,
|
||||
},
|
||||
Object {
|
||||
"dayOfWeek": "tue",
|
||||
"seats": 1,
|
||||
},
|
||||
Object {
|
||||
"dayOfWeek": "wed",
|
||||
"seats": 1,
|
||||
},
|
||||
Object {
|
||||
"dayOfWeek": "thu",
|
||||
"seats": 1,
|
||||
},
|
||||
Object {
|
||||
"dayOfWeek": "fri",
|
||||
"seats": 1,
|
||||
},
|
||||
Object {
|
||||
"dayOfWeek": "sat",
|
||||
"seats": 1,
|
||||
},
|
||||
Object {
|
||||
"dayOfWeek": "sun",
|
||||
"seats": 1,
|
||||
},
|
||||
],
|
||||
"type": "availability-plan/day",
|
||||
}
|
||||
}
|
||||
dispatch={[Function]}
|
||||
intl={
|
||||
Object {
|
||||
|
|
|
|||
|
|
@ -190,6 +190,8 @@ const availabilityPlan = shape({
|
|||
),
|
||||
});
|
||||
|
||||
propTypes.availabilityPlan = availabilityPlan;
|
||||
|
||||
const ownListingAttributes = shape({
|
||||
title: string.isRequired,
|
||||
description: string,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue