Skip to content

Commit

Permalink
add bookingTYpeID when readOnly
Browse files Browse the repository at this point in the history
  • Loading branch information
LinaYahya committed Aug 26, 2020
1 parent f08b690 commit 51ce591
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 3 additions & 1 deletion client/src/components/DayView/Calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ class Calendar extends React.Component {
userName: event.name,
color: event.color,
noOfPeople: event.noofpeople,
typeID: event.bookingtype_id,
})),
});
})
Expand All @@ -98,7 +99,7 @@ class Calendar extends React.Component {
start,
end,
title,
extendedProps: { description, userName, userid, noOfPeople },
extendedProps: { description, userName, userid, noOfPeople, typeID },
} = event;
this.setState({
modalData: {
Expand All @@ -112,6 +113,7 @@ class Calendar extends React.Component {
userid,
readOnly: true,
noOfPeople,
typeID,
},
});
this.showModal();
Expand Down
5 changes: 4 additions & 1 deletion client/src/components/Form/Reservation/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ class BookingForm extends React.Component {
description,
readOnly,
noOfPeople,
typeID,
} = modalData;
const disabled = confirmLoading || readOnly;
const { admin, userID } = this.context;
Expand Down Expand Up @@ -90,6 +91,7 @@ class BookingForm extends React.Component {
repeat: 'once',
remind: true,
noOfPeople,
bookingTypeId: typeID,
}}
ref={this.formRef}
onFinish={(values) => {
Expand Down Expand Up @@ -147,7 +149,7 @@ class BookingForm extends React.Component {
label="Booking Type"
rules={[{ required: true, message: 'Choose booking type' }]}
>
<Select>
<Select disabled={disabled}>
{types.map((type) => (
<Select.Option key={type.id} value={type.id}>
{type.category}
Expand Down Expand Up @@ -255,6 +257,7 @@ BookingForm.propTypes = {
title: PropTypes.string,
description: PropTypes.string,
userName: PropTypes.string,
typeID: PropTypes.string,
userid: PropTypes.number,
readOnly: PropTypes.bool,
noOfPeople: PropTypes.number,
Expand Down

0 comments on commit 51ce591

Please sign in to comment.