diff --git a/CHANGELOG.md b/CHANGELOG.md index 088acc11c..fd0a33473 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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** diff --git a/app/pages/reservation/reservation-information/InternalReservationFields.js b/app/pages/reservation/reservation-information/InternalReservationFields.js index a6ac27e56..6c4462aed 100644 --- a/app/pages/reservation/reservation-information/InternalReservationFields.js +++ b/app/pages/reservation/reservation-information/InternalReservationFields.js @@ -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'; @@ -23,7 +24,7 @@ class InternalReservationFields extends Component { component="input" id="internalReservationChecked" label="internalReservation" - name="internalReservation" + name="staffEvent" type="checkbox" /> @@ -39,8 +40,10 @@ class InternalReservationFields extends Component { value === RESERVATION_TYPE.BLOCKED} label="markAsClosed" - name="markAsClosed" + name="type" + normalize={value => (value ? RESERVATION_TYPE.BLOCKED : RESERVATION_TYPE.NORMAL)} type="checkbox" /> @@ -89,5 +92,5 @@ InternalReservationFields.propTypes = { export default injectT(reduxForm({ form: FormTypes.RESERVATION, - initialValues: { internalReservation: true } + initialValues: { staffEvent: true, type: RESERVATION_TYPE.NORMAL } })(InternalReservationFields)); diff --git a/src/domain/reservation/constants.js b/src/domain/reservation/constants.js index 2e32e9cd9..b20b5f191 100644 --- a/src/domain/reservation/constants.js +++ b/src/domain/reservation/constants.js @@ -22,3 +22,8 @@ export const RESERVATION_SHOWONLY_FILTERS = { FAVORITE: 'favorite', CAN_MODIFY: 'can_modify' }; + +export const RESERVATION_TYPE = { + NORMAL: 'normal', + BLOCKED: 'blocked' +};