Skip to content
This repository has been archived by the owner on Apr 5, 2024. It is now read-only.

VAR-161 | Staff event checkbox for staff #1058

Merged
merged 5 commits into from
Nov 6, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# 0.7.0-pre
**CHANGELOG**
- [#1052](https://github.com/City-of-Helsinki/varaamo/pull/1052) Add internal field for staff in ReservationForm.
- [#1058](https://github.com/City-of-Helsinki/varaamo/pull/1058) Renamed internal fields for staff in ReservationForm.

# 0.6.1
**HOTFIX**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import Row from 'react-bootstrap/lib/Row';
import Col from 'react-bootstrap/lib/Col';
import PropTypes from 'prop-types';

import { RESERVATION_TYPE } from '../../../../src/domain/reservation/constants';
import injectT from '../../../i18n/injectT';
import FormTypes from '../../../constants/FormTypes';

Expand All @@ -23,7 +24,7 @@ class InternalReservationFields extends Component {
component="input"
id="internalReservationChecked"
label="internalReservation"
name="internalReservation"
name="staffEvent"
type="checkbox"
/>
</Col>
Expand All @@ -39,8 +40,10 @@ class InternalReservationFields extends Component {
<Col md={1}>
<Field
component="input"
format={value => value === RESERVATION_TYPE.BLOCKED}
label="markAsClosed"
name="markAsClosed"
name="type"
normalize={value => (value ? RESERVATION_TYPE.BLOCKED : RESERVATION_TYPE.NORMAL)}
type="checkbox"
/>
</Col>
Expand Down Expand Up @@ -89,5 +92,5 @@ InternalReservationFields.propTypes = {

export default injectT(reduxForm({
form: FormTypes.RESERVATION,
initialValues: { internalReservation: true }
initialValues: { staffEvent: true, type: RESERVATION_TYPE.NORMAL }
})(InternalReservationFields));
5 changes: 5 additions & 0 deletions src/domain/reservation/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,8 @@ export const RESERVATION_SHOWONLY_FILTERS = {
FAVORITE: 'favorite',
CAN_MODIFY: 'can_modify'
};

export const RESERVATION_TYPE = {
NORMAL: 'normal',
BLOCKED: 'blocked'
};