diff --git a/.env.example b/.env.example
index 740f234ce..dcf8ac845 100644
--- a/.env.example
+++ b/.env.example
@@ -1,5 +1,6 @@
CLIENT_ID=
CLIENT_SECRET=
SESSION_SECRET=
+TIME_ZONE=
TARGET_APP=
CUSTOM_MUNICIPALITY_OPTIONS=[]
diff --git a/.eslintrc b/.eslintrc
index 809ded2bc..b1bdd4b72 100644
--- a/.eslintrc
+++ b/.eslintrc
@@ -63,7 +63,9 @@
"react/no-string-refs": "off",
- "react/no-unused-prop-types": ["error", { "skipShapeProps": true }],
+ "react/no-unused-state": "warn",
+
+ "react/no-unused-prop-types": ["warn", { "skipShapeProps": true }],
"react/prefer-stateless-function": "off",
@@ -89,6 +91,18 @@
"react/no-array-index-key": "off",
- "comma-dangle": "off"
+ "comma-dangle": "off",
+
+ "max-len": ["warn", { "code": 120}],
+
+ "no-plusplus": "off",
+
+ "no-undef": "warn",
+
+ "arrow-body-style": "off",
+
+ "quote-props": "off",
+
+ "no-case-declarations": "off"
}
}
diff --git a/CHANGELOG.md b/CHANGELOG.md
index a7d875bf8..4da4f7ff7 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,21 +1,62 @@
+# 0.6.0
+ **MAJOR CHANGES**
+ - Support for payments in Varaamo.
+ - Add option to configure time zone of calendar/resources. Defaults to `Europe/Helsinki`.
+ - Permission checking has been changed: We are now using unit authorizations instead of unit object permissions from respa admin.
+
+ ***CALENDAR***
+ - Add reusable FullCalendar component.
+ - Fix FullCalendar not auto-select `min_period` time slot when user select. Various fixes related to edit reservation calendar, drag and drop and select error handler.
+ - Fix missing `max_period` check when user select / resize calendar reservation. Show notification and revert to `max_period` if user select bigger amount of time slot than the limit. Various improvement for calendar is included as well.
+ - Add custom mobile view and stylings in calendar.
+
+ **MINOR CHANGES**
+ - Replace failure message and add a return button for reservation payment.
+ - Fix manage reservation page only display `can_approve` reservation, now display *all* reservations. Add strict rules for staff to be able to edit/cancel specific reservation.
+ - Fix missing reservation metadata fields data in manage reservation view. Trim empty field row.
+ - Add `show_only` filter section to filter reservation list. This filter have `can_modify` as its default value.
+ - Anonymous users now see a log in button below the calendar on the resource page helping them understand that they need to log in to continue.
+ - Errors from respa backend are not swallowed in our ApiClient anymore.
+ - Allow user to select time slot which is already happening.
+
+ **HOTFIX**
+ - Fix resource information headlines and icon.
+ - Fix default timezone being overrided and disappear from moment object by fullcalendar moment-timezone plugin.
+
+ **CHANGELOG**
+ - [#995](https://github.com/City-of-Helsinki/varaamo/pull/995) Fix resource information headlines and icon.
+ - [#968](https://github.com/City-of-Helsinki/varaamo/pull/968) Support payments for Varaamo.
+ - [#999](https://github.com/City-of-Helsinki/varaamo/pull/968) Add reusable FullCalendar component. Used in resource page.
+ - [#1002](https://github.com/City-of-Helsinki/varaamo/pull/1002) Replace failure message and add a return button.
+ - [#1004](https://github.com/City-of-Helsinki/varaamo/pull/1004) Staff cannot see normal reservations.
+ - [#1005](https://github.com/City-of-Helsinki/varaamo/pull/1005) Reservation information modal is missing metadata fields.
+ - [#1006](https://github.com/City-of-Helsinki/varaamo/pull/1006) Manage reservation filter buttons.
+ - [#1026](https://github.com/City-of-Helsinki/varaamo/pull/1026) Add support for minPeriod auto-select.
+ - [#1027](https://github.com/City-of-Helsinki/varaamo/pull/1027) Improve resource page usability for anonymous users.
+ - [#1028](https://github.com/City-of-Helsinki/varaamo/pull/1028) Always fetch reservations with start and end filters.
+ - [#1029](https://github.com/City-of-Helsinki/varaamo/pull/1029) Add option to configure time zone for resources.
+ - [#1033](https://github.com/City-of-Helsinki/varaamo/pull/1033) Show errors to staff members if editing of reservations fail.
+ - [#1031](https://github.com/City-of-Helsinki/varaamo/pull/1031) Use resource's userPermissions.isAdmin flag to check if user isStaff.
+ - [#1032](https://github.com/City-of-Helsinki/varaamo/pull/1032) Better max period handling for FullCalendar.
+ - [#1035](https://github.com/City-of-Helsinki/varaamo/pull/1035) Daily / weekly view for mobile.
+ - [#1037](https://github.com/City-of-Helsinki/varaamo/pull/1037) Allow to select timeslot which is already happening.
+ - [#1039](https://github.com/City-of-Helsinki/varaamo/pull/1039) Fix moment-timezone default timezone.
+
# 0.4.2
**HOTFIX**
- ```
- Fix various styling issue for date-picker [#991](https://github.com/City-of-Helsinki/varaamo/pull/991)
- ```
+ - Add `isAdmin` check for RecurringReservationControl to normal user will not able to make recurring reservation. [#993](https://github.com/City-of-Helsinki/varaamo/pull/993/)
+
# 0.4.1
**HOTFIX**
- ```
- Fix security warnings for dependencies: react-select, jest, postcss-loader, codecov, node-sass, eslint
- ```
# 0.4.0
**MAJOR CHANGES**
- ```
- Add new purpose section for sauna and organize events. As well as mock placeholder icon.
- Some technical improvements.
- ```
+
**CHANGELOG**
- [#940](https://github.com/City-of-Helsinki/varaamo/pull/940) Upgrade fortawesome, add new temp purpose icon.
- [#939](https://github.com/City-of-Helsinki/varaamo/pull/939) Rename all classnames imports to classNames
@@ -23,7 +64,6 @@
# 0.3.0
**MAJOR CHANGES**
- ```
- Add translation for date-picker, show date and month in currently selected language.
- Set varaamo timezone to flexible base on user local timezone.
@@ -31,7 +71,6 @@
- Add slotSize and minPeriod to reservation select, enable ability to reserve sauna slots with default amount of minPeriod. Time slot range equal with slotSize config from backend.
- Show access-code pending text if the access-code is generated 24h before reservation starts.
- ```
**CHANGELOG**
@@ -50,12 +89,12 @@
- Add new selection field to sort filtered resources. Currently support to search by name, type, premise, people.
- Temporarily only show warning messages in 3 languages for IE11 user.
- - Ability to favourite resources straight on search view instead going to resource detail page.
+ - Ability to favorite resources straight on search view instead going to resource detail page.
**CHANGELOG**
- [#895](https://github.com/City-of-Helsinki/varaamo/pull/895) Add sort to sort filtered resources.
- - [#904](https://github.com/City-of-Helsinki/varaamo/pull/904) Favourite Resource on search view.
+ - [#904](https://github.com/City-of-Helsinki/varaamo/pull/904) Favorite Resource on search view.
- [#909](https://github.com/City-of-Helsinki/varaamo/pull/909) Show warning message for IE11 users.
# 0.1.1
diff --git a/README.md b/README.md
index e8bf86149..1229b9912 100644
--- a/README.md
+++ b/README.md
@@ -70,6 +70,7 @@ By default the running app can be found at `localhost:3000`.
TARGET_APP
API_URL
CUSTOM_MUNICIPALITY_OPTIONS
+ TIME_ZONE
```
Environment's variable guideline:
@@ -82,6 +83,8 @@ By default the running app can be found at `localhost:3000`.
Without this config, default to use 3 central cities Helsinki, Espoo, Vantaa as options.
+ - `TIME_ZONE`:
+ The time zone of your resources. Bookings and calendars will be shown with this time zone no matter what the end users' browser is configured for. Defaults to Europe/Helsinki.
3. Then, start the development server:
@@ -202,7 +205,7 @@ All setting was included under .vscode directory.
- On Jest test:
[Guideline](https://jestjs.io/docs/en/troubleshooting#debugging-in-vs-code). Setting was under `Vscode Jest debugger` name.
- - Put breakpoint in test file `(*.spec.js)`
+ - Put breakpoint in test file `(*.test.js)`
- Run command:
diff --git a/app/actions/__tests__/reservationActions.spec.js b/app/actions/__tests__/reservationActions.test.js
similarity index 93%
rename from app/actions/__tests__/reservationActions.spec.js
rename to app/actions/__tests__/reservationActions.test.js
index bf8e47777..0d36e3334 100644
--- a/app/actions/__tests__/reservationActions.spec.js
+++ b/app/actions/__tests__/reservationActions.test.js
@@ -1,7 +1,7 @@
import simple from 'simple-mock';
-import * as apiUtils from 'utils/apiUtils';
-import * as reservationActions from 'actions/reservationActions';
+import * as apiUtils from '../../utils/apiUtils';
+import * as reservationActions from '../reservationActions';
describe('Actions: reservationActions', () => {
const reservation = {
diff --git a/app/actions/__tests__/resourceActions.spec.js b/app/actions/__tests__/resourceActions.test.js
similarity index 87%
rename from app/actions/__tests__/resourceActions.spec.js
rename to app/actions/__tests__/resourceActions.test.js
index 68580bf7e..4cf8f508a 100644
--- a/app/actions/__tests__/resourceActions.spec.js
+++ b/app/actions/__tests__/resourceActions.test.js
@@ -1,8 +1,7 @@
-import types from 'constants/ActionTypes';
-
-import { favoriteResource, unfavoriteResource } from 'actions/resourceActions';
-import { buildAPIUrl } from 'utils/apiUtils';
-import { createApiTest } from 'utils/testUtils';
+import types from '../../constants/ActionTypes';
+import { favoriteResource, unfavoriteResource } from '../resourceActions';
+import { buildAPIUrl } from '../../utils/apiUtils';
+import { createApiTest } from '../../utils/testUtils';
describe('Actions: resourceActions', () => {
describe('favoriteResource', () => {
diff --git a/app/actions/__tests__/routeActions.spec.js b/app/actions/__tests__/routeActions.test.js
similarity index 91%
rename from app/actions/__tests__/routeActions.spec.js
rename to app/actions/__tests__/routeActions.test.js
index 974b7b6eb..58f855463 100644
--- a/app/actions/__tests__/routeActions.spec.js
+++ b/app/actions/__tests__/routeActions.test.js
@@ -1,7 +1,7 @@
import simple from 'simple-mock';
import * as reduxActions from 'redux-actions';
-import { updateRoute } from 'actions/routeActions';
+import { updateRoute } from '../routeActions';
describe('Actions: resourceActions', () => {
describe('updateRoute', () => {
diff --git a/app/actions/__tests__/searchActions.spec.js b/app/actions/__tests__/searchActions.test.js
similarity index 93%
rename from app/actions/__tests__/searchActions.spec.js
rename to app/actions/__tests__/searchActions.test.js
index 478dc1248..7c62856a4 100644
--- a/app/actions/__tests__/searchActions.spec.js
+++ b/app/actions/__tests__/searchActions.test.js
@@ -1,7 +1,7 @@
import simple from 'simple-mock';
-import { getPiwikActionName, searchResources } from 'actions/searchActions';
-import * as apiUtils from 'utils/apiUtils';
+import { getPiwikActionName, searchResources } from '../searchActions';
+import * as apiUtils from '../../utils/apiUtils';
describe('Actions: searchActions', () => {
let getRequestTypeDescriptorMock;
diff --git a/app/actions/__tests__/unitActions.spec.js b/app/actions/__tests__/unitActions.test.js
similarity index 83%
rename from app/actions/__tests__/unitActions.spec.js
rename to app/actions/__tests__/unitActions.test.js
index ef2f0c194..abf78279f 100644
--- a/app/actions/__tests__/unitActions.spec.js
+++ b/app/actions/__tests__/unitActions.test.js
@@ -1,9 +1,8 @@
-import types from 'constants/ActionTypes';
-
import simple from 'simple-mock';
-import * as apiUtils from 'utils/apiUtils';
-import { fetchUnits } from 'actions/unitActions';
+import types from '../../constants/ActionTypes';
+import * as apiUtils from '../../utils/apiUtils';
+import { fetchUnits } from '../unitActions';
describe('Actions: unitActions', () => {
let getRequestTypeDescriptorMock;
diff --git a/app/actions/__tests__/userActions.spec.js b/app/actions/__tests__/userActions.test.js
similarity index 86%
rename from app/actions/__tests__/userActions.spec.js
rename to app/actions/__tests__/userActions.test.js
index c618cfa7f..5a2f514c2 100644
--- a/app/actions/__tests__/userActions.spec.js
+++ b/app/actions/__tests__/userActions.test.js
@@ -1,7 +1,7 @@
import simple from 'simple-mock';
-import * as apiUtils from 'utils/apiUtils';
-import { fetchUser } from 'actions/userActions';
+import * as apiUtils from '../../utils/apiUtils';
+import { fetchUser } from '../userActions';
describe('Actions: userActions', () => {
let getRequestTypeDescriptorMock;
diff --git a/app/actions/notificationsActions.js b/app/actions/notificationsActions.js
deleted file mode 100644
index be3662b09..000000000
--- a/app/actions/notificationsActions.js
+++ /dev/null
@@ -1,13 +0,0 @@
-import types from 'constants/ActionTypes';
-
-import { createAction } from 'redux-actions';
-
-
-const addNotification = createAction(types.UI.ADD_NOTIFICATION);
-
-const hideNotification = createAction(types.UI.HIDE_NOTIFICATION);
-
-export {
- addNotification,
- hideNotification,
-};
diff --git a/app/actions/purposeActions.js b/app/actions/purposeActions.js
deleted file mode 100644
index fdc175199..000000000
--- a/app/actions/purposeActions.js
+++ /dev/null
@@ -1,35 +0,0 @@
-import types from 'constants/ActionTypes';
-
-import { RSAA } from 'redux-api-middleware';
-
-import schemas from 'store/middleware/Schemas';
-import {
- buildAPIUrl,
- getErrorTypeDescriptor,
- getHeadersCreator,
- getRequestTypeDescriptor,
- getSuccessTypeDescriptor,
-} from 'utils/apiUtils';
-
-function fetchPurposes() {
- return {
- [RSAA]: {
- types: [
- getRequestTypeDescriptor(types.API.PURPOSES_GET_REQUEST),
- getSuccessTypeDescriptor(
- types.API.PURPOSES_GET_SUCCESS,
- { schema: schemas.paginatedPurposesSchema }
- ),
- getErrorTypeDescriptor(types.API.PURPOSES_GET_ERROR),
- ],
- endpoint: buildAPIUrl('purpose'),
- method: 'GET',
- headers: getHeadersCreator(),
- bailout: state => !state.api.shouldFetch.purposes,
- },
- };
-}
-
-export {
- fetchPurposes,
-};
diff --git a/app/actions/reservationActions.js b/app/actions/reservationActions.js
index 9d9a0d391..6d281b87b 100644
--- a/app/actions/reservationActions.js
+++ b/app/actions/reservationActions.js
@@ -1,18 +1,17 @@
-import types from 'constants/ActionTypes';
-
-import pickBy from 'lodash/pickBy';
import { decamelizeKeys } from 'humps';
+import pickBy from 'lodash/pickBy';
import { RSAA } from 'redux-api-middleware';
-import schemas from 'store/middleware/Schemas';
+import types from '../constants/ActionTypes';
+import schemas from '../store/middleware/Schemas';
import {
buildAPIUrl,
getErrorTypeDescriptor,
getHeadersCreator,
getRequestTypeDescriptor,
getSuccessTypeDescriptor,
-} from 'utils/apiUtils';
-import { getMissingValues, isStaffEvent } from 'utils/reservationUtils';
+} from '../utils/apiUtils';
+import { getMissingValues, isStaffEvent } from '../utils/reservationUtils';
function commentReservation(reservation, resource, comments) {
const missingValues = getMissingValues(reservation);
diff --git a/app/actions/resourceActions.js b/app/actions/resourceActions.js
index 245c24ab1..91599fd52 100644
--- a/app/actions/resourceActions.js
+++ b/app/actions/resourceActions.js
@@ -1,15 +1,14 @@
-import types from 'constants/ActionTypes';
-
import { RSAA } from 'redux-api-middleware';
-import schemas from 'store/middleware/Schemas';
+import types from '../constants/ActionTypes';
+import schemas from '../store/middleware/Schemas';
import {
buildAPIUrl,
getErrorTypeDescriptor,
getHeadersCreator,
getRequestTypeDescriptor,
getSuccessTypeDescriptor,
-} from 'utils/apiUtils';
+} from '../utils/apiUtils';
function fetchFavoritedResources(timeAsMoment, source) {
const params = {
@@ -40,7 +39,6 @@ function fetchResource(id, params = {}) {
function fetchResources(params = {}, source) {
const fetchParams = Object.assign({}, params, { pageSize: 500 });
-
return {
[RSAA]: {
types: [
diff --git a/app/actions/searchActions.js b/app/actions/searchActions.js
index feecb17d9..99db6e2f9 100644
--- a/app/actions/searchActions.js
+++ b/app/actions/searchActions.js
@@ -1,19 +1,17 @@
-import types from 'constants/ActionTypes';
-import constants from 'constants/AppConstants';
-
import { createAction } from 'redux-actions';
import { RSAA } from 'redux-api-middleware';
-
-import schemas from 'store/middleware/Schemas';
+import types from '../constants/ActionTypes';
+import constants from '../constants/AppConstants';
+import schemas from '../store/middleware/Schemas';
import {
buildAPIUrl,
getErrorTypeDescriptor,
getHeadersCreator,
getRequestTypeDescriptor,
getSuccessTypeDescriptor,
-} from 'utils/apiUtils';
-import { getFetchParamsFromFilters } from 'utils/searchUtils';
+} from '../utils/apiUtils';
+import { getFetchParamsFromFilters } from '../utils/searchUtils';
const clearSearchResults = createAction(types.UI.CLEAR_SEARCH_FILTERS);
const toggleMap = createAction(types.UI.TOGGLE_SEARCH_SHOW_MAP);
diff --git a/app/actions/uiActions.js b/app/actions/uiActions.js
index 83e4d339f..124fe1472 100644
--- a/app/actions/uiActions.js
+++ b/app/actions/uiActions.js
@@ -1,9 +1,8 @@
-
-import types from 'constants/ActionTypes';
-import ModalTypes from 'constants/ModalTypes';
-
import { createAction } from 'redux-actions';
+import types from '../constants/ActionTypes';
+import ModalTypes from '../constants/ModalTypes';
+
const cancelReservationEdit = createAction(types.UI.CANCEL_RESERVATION_EDIT);
const cancelReservationEditInInfoModal = createAction(
@@ -78,8 +77,6 @@ const openReservationCommentModal = createAction(
() => ModalTypes.RESERVATION_COMMENT
);
-const selectReservationSlot = createAction(types.UI.SELECT_RESERVATION_SLOT);
-
const selectReservationToCancel = createAction(types.UI.SELECT_RESERVATION_TO_CANCEL);
const selectReservationToEdit = createAction(types.UI.SELECT_RESERVATION_TO_EDIT);
@@ -92,9 +89,7 @@ const showReservationInfoModal = createAction(types.UI.SHOW_RESERVATION_INFO_MOD
const startReservationEditInInfoModal = createAction(types.UI.START_RESERVATION_EDIT_IN_INFO_MODAL);
-const toggleTimeSlot = createAction(types.UI.TOGGLE_TIME_SLOT);
-
-const clearTimeSlots = createAction(types.UI.CLEAR_TIME_SLOTS);
+const setSelectedTimeSlots = createAction(types.UI.SET_SELECTED_TIME_SLOTS);
const toggleResourceMap = createAction(types.UI.TOGGLE_RESOURCE_SHOW_MAP);
@@ -103,7 +98,6 @@ const unselectAdminResourceType = createAction(types.UI.UNSELECT_ADMIN_RESOURCE_
export {
cancelReservationEdit,
cancelReservationEditInInfoModal,
- clearTimeSlots,
changeAdminReservationFilters,
changeAdminResourcesPageDate,
changeSearchFilters,
@@ -125,11 +119,10 @@ export {
openResourceTermsModal,
selectReservationToCancel,
selectReservationToEdit,
- selectReservationSlot,
selectReservationToShow,
showReservationInfoModal,
startReservationEditInInfoModal,
toggleResourceMap,
- toggleTimeSlot,
unselectAdminResourceType,
+ setSelectedTimeSlots,
};
diff --git a/app/actions/unitActions.js b/app/actions/unitActions.js
index ded90366c..8309733da 100644
--- a/app/actions/unitActions.js
+++ b/app/actions/unitActions.js
@@ -1,15 +1,14 @@
-import types from 'constants/ActionTypes';
-
import { RSAA } from 'redux-api-middleware';
-import schemas from 'store/middleware/Schemas';
+import types from '../constants/ActionTypes';
+import schemas from '../store/middleware/Schemas';
import {
buildAPIUrl,
getErrorTypeDescriptor,
getHeadersCreator,
getRequestTypeDescriptor,
getSuccessTypeDescriptor,
-} from 'utils/apiUtils';
+} from '../utils/apiUtils';
function fetchUnits() {
const fetchParams = { pageSize: 500, unit_has_resource: true };
diff --git a/app/actions/userActions.js b/app/actions/userActions.js
index ce322bc6b..13dec6e96 100644
--- a/app/actions/userActions.js
+++ b/app/actions/userActions.js
@@ -1,14 +1,13 @@
-import types from 'constants/ActionTypes';
-
import { RSAA } from 'redux-api-middleware';
+import types from '../constants/ActionTypes';
import {
buildAPIUrl,
getErrorTypeDescriptor,
getHeadersCreator,
getRequestTypeDescriptor,
getSuccessTypeDescriptor,
-} from 'utils/apiUtils';
+} from '../utils/apiUtils';
function fetchUser(id, params = {}) {
return {
diff --git a/app/assets/icons/comment.svg b/app/assets/icons/comment.svg
new file mode 100644
index 000000000..3f836e351
--- /dev/null
+++ b/app/assets/icons/comment.svg
@@ -0,0 +1,16 @@
+
+
diff --git a/app/assets/icons/completed.svg b/app/assets/icons/completed.svg
new file mode 100644
index 000000000..dabbf37a3
--- /dev/null
+++ b/app/assets/icons/completed.svg
@@ -0,0 +1,12 @@
+
+
\ No newline at end of file
diff --git a/app/assets/icons/error.svg b/app/assets/icons/error.svg
new file mode 100644
index 000000000..456b486d5
--- /dev/null
+++ b/app/assets/icons/error.svg
@@ -0,0 +1,23 @@
+
+
\ No newline at end of file
diff --git a/app/assets/icons/hds-info.svg b/app/assets/icons/hds-info.svg
new file mode 100644
index 000000000..db748d86f
--- /dev/null
+++ b/app/assets/icons/hds-info.svg
@@ -0,0 +1,15 @@
+
+
\ No newline at end of file
diff --git a/app/assets/icons/hds-success.svg b/app/assets/icons/hds-success.svg
new file mode 100644
index 000000000..21fa43ed3
--- /dev/null
+++ b/app/assets/icons/hds-success.svg
@@ -0,0 +1,12 @@
+
+
\ No newline at end of file
diff --git a/app/assets/icons/hds-warning.svg b/app/assets/icons/hds-warning.svg
new file mode 100644
index 000000000..edf4a103d
--- /dev/null
+++ b/app/assets/icons/hds-warning.svg
@@ -0,0 +1,18 @@
+
+
\ No newline at end of file
diff --git a/app/assets/styles/main.scss b/app/assets/styles/main.scss
index 43c088da4..3eeb254fc 100644
--- a/app/assets/styles/main.scss
+++ b/app/assets/styles/main.scss
@@ -10,16 +10,20 @@
@import '~react-notifications/lib/notifications.css';
@import '~react-toggle/style.css';
+@import '~@fullcalendar/core/main.css';
+@import '~@fullcalendar/daygrid/main.css';
+@import '~@fullcalendar/timegrid/main.css';
+
@import './layout';
@import './mixins';
@import '../../pages/pages';
@import '../../shared/shared';
+@import '../../../src/domain/domain';
+@import '../../../src/common/common';
@import './elements';
@import './loader';
@import './modals';
@import './react-select';
@import './react-toggle';
-
-@import './customization/espoo/customization';
diff --git a/app/constants/ActionTypes.js b/app/constants/ActionTypes.js
index d34ed054e..d75a4b927 100644
--- a/app/constants/ActionTypes.js
+++ b/app/constants/ActionTypes.js
@@ -4,10 +4,6 @@ export default {
AUTH_GET_REQUEST: 'AUTH_GET_REQUEST',
AUTH_GET_SUCCESS: 'AUTH_GET_SUCCESS',
- PURPOSES_GET_ERROR: 'PURPOSES_GET_ERROR',
- PURPOSES_GET_REQUEST: 'PURPOSES_GET_REQUEST',
- PURPOSES_GET_SUCCESS: 'PURPOSES_GET_SUCCESS',
-
RESERVATION_DELETE_ERROR: 'RESERVATION_DELETE_ERROR',
RESERVATION_DELETE_REQUEST: 'RESERVATION_DELETE_REQUEST',
RESERVATION_DELETE_SUCCESS: 'RESERVATION_DELETE_SUCCESS',
@@ -61,7 +57,6 @@ export default {
CHANGE_SEARCH_FILTERS: 'CHANGE_SEARCH_FILTERS',
CLEAR_RESERVATIONS: 'CLEAR_RESERVATIONS',
CLEAR_SEARCH_FILTERS: 'CLEAR_SEARCH_FILTERS',
- CLEAR_TIME_SLOTS: 'CLEAR_TIME_SLOTS',
CLOSE_MODAL: 'CLOSE_MODAL',
DISABLE_GEOPOSITION: 'DISABLE_GEOPOSITION',
DISABLE_TIME_RANGE: 'DISABLE_TIME_RANGE',
@@ -75,7 +70,6 @@ export default {
SEARCH_MAP_CLICK: 'SEARCH_MAP_CLICK',
OPEN_MODAL: 'OPEN_MODAL',
SELECT_SEARCH_RESULTS_UNIT: 'SELECT_SEARCH_RESULTS_UNIT',
- SELECT_RESERVATION_SLOT: 'SELECT_RESERVATION_SLOT',
SELECT_RESERVATION_TO_CANCEL: 'SELECT_RESERVATION_TO_CANCEL',
SELECT_RESERVATION_TO_EDIT: 'SELECT_RESERVATION_TO_EDIT',
SELECT_RESERVATION_TO_SHOW: 'SELECT_RESERVATION_TO_SHOW',
@@ -83,7 +77,7 @@ export default {
START_RESERVATION_EDIT_IN_INFO_MODAL: 'START_RESERVATION_EDIT_IN_INFO_MODAL',
TOGGLE_RESOURCE_SHOW_MAP: 'TOGGLE_RESOURCE_SHOW_MAP',
TOGGLE_SEARCH_SHOW_MAP: 'TOGGLE_SEARCH_SHOW_MAP',
- TOGGLE_TIME_SLOT: 'TOGGLE_TIME_SLOT',
UNSELECT_ADMIN_RESOURCE_TYPE: 'UNSELECT_ADMIN_RESOURCE_TYPE',
+ SET_SELECTED_TIME_SLOTS: 'SET_SELECTED_TIME_SLOTS',
},
};
diff --git a/app/constants/AppConstants.js b/app/constants/AppConstants.js
index b92dd8f1c..252d7ef9f 100644
--- a/app/constants/AppConstants.js
+++ b/app/constants/AppConstants.js
@@ -14,14 +14,8 @@ export default {
timePeriod: 30,
timePeriodType: 'minutes',
},
- NOTIFICATION_DEFAULTS: {
- message: '',
- type: 'info',
- timeOut: 5000,
- hidden: false,
- },
REQUIRED_API_HEADERS: {
- Accept: 'application/json',
+ 'Accept': 'application/json',
'Accept-Language': 'fi',
'Content-Type': 'application/json',
},
@@ -52,9 +46,7 @@ export default {
freeOfCharge: '',
date: '',
distance: '',
- duration: 0,
municipality: [],
- end: '',
lat: '',
lon: '',
orderBy: '',
@@ -62,18 +54,16 @@ export default {
people: '',
purpose: '',
search: '',
- start: '',
unit: '',
- useTimeRange: false,
+ availableBetween: '',
},
TIME_FORMAT: 'H:mm',
- TIME_SLOT_DEFAULT_LENGTH: 30,
+ TIME_ZONE: SETTINGS.TIME_ZONE,
TRACKING: SETTINGS.TRACKING,
SORT_BY_OPTIONS: {
NAME: 'resource_name_lang',
TYPE: 'type_name_lang',
PREMISES: 'unit_name_lang',
PEOPLE: 'people_capacity',
- // TODO: sortby 'open now' should be implemented later after API support it
}
};
diff --git a/app/i18n/changeLocale.spec.js b/app/i18n/__tests__/changeLocale.test.js
similarity index 74%
rename from app/i18n/changeLocale.spec.js
rename to app/i18n/__tests__/changeLocale.test.js
index f7e1a8e33..b920cec2e 100644
--- a/app/i18n/changeLocale.spec.js
+++ b/app/i18n/__tests__/changeLocale.test.js
@@ -1,5 +1,5 @@
-import changeLocale from './changeLocale';
-import * as persistState from 'store/middleware/persistState';
+import changeLocale from '../changeLocale';
+import * as persistState from '../../store/middleware/persistState';
describe('changeLocale', () => {
test('should invoke savePersistLocale', () => {
diff --git a/app/i18n/changeLocale.js b/app/i18n/changeLocale.js
index 198d980be..75e165f46 100644
--- a/app/i18n/changeLocale.js
+++ b/app/i18n/changeLocale.js
@@ -1,10 +1,10 @@
import moment from 'moment';
import { updateIntl } from 'react-intl-redux';
-import { savePersistLocale } from 'store/middleware/persistState';
-import enMessages from 'i18n/messages/en.json';
-import fiMessages from 'i18n/messages/fi.json';
-import svMessages from 'i18n/messages/sv.json';
+import { savePersistLocale } from '../store/middleware/persistState';
+import enMessages from './messages/en.json';
+import fiMessages from './messages/fi.json';
+import svMessages from './messages/sv.json';
const messages = {
fi: fiMessages,
@@ -12,14 +12,13 @@ const messages = {
sv: svMessages,
};
-function changeLocale(language) {
- const locale = language === 'sv' ? 'se' : language;
+function changeLocale(locale) {
savePersistLocale(locale);
-
moment.locale(`varaamo-${locale}`);
+
return updateIntl({
locale,
- messages: messages[language],
+ messages: messages[locale],
});
}
diff --git a/app/i18n/index.js b/app/i18n/index.js
deleted file mode 100644
index add84bc5f..000000000
--- a/app/i18n/index.js
+++ /dev/null
@@ -1,9 +0,0 @@
-import changeLocale from './changeLocale';
-import initI18n from './initI18n';
-import injectT from './injectT';
-
-export {
- changeLocale,
- initI18n,
- injectT,
-};
diff --git a/app/i18n/initI18n.js b/app/i18n/initI18n.js
index b95f6178a..9e0fea897 100644
--- a/app/i18n/initI18n.js
+++ b/app/i18n/initI18n.js
@@ -2,26 +2,24 @@ import 'moment/locale/en-gb';
import 'moment/locale/fi';
import 'moment/locale/sv';
import 'moment-timezone/builds/moment-timezone-with-data-10-year-range';
-
-import constants from 'constants/AppConstants';
-
import moment from 'moment';
import { addLocaleData } from 'react-intl';
import en from 'react-intl/locale-data/en';
import fi from 'react-intl/locale-data/fi';
-import se from 'react-intl/locale-data/se';
-
-import { loadPersistedLocale } from 'store/middleware/persistState';
-import enMessages from 'i18n/messages/en.json';
-import fiMessages from 'i18n/messages/fi.json';
-import svMessages from 'i18n/messages/sv.json';
+import sv from 'react-intl/locale-data/sv';
+import constants from '../constants/AppConstants';
+import { loadPersistedLocale } from '../store/middleware/persistState';
+import enMessages from './messages/en.json';
+import fiMessages from './messages/fi.json';
+import svMessages from './messages/sv.json';
const messages = {
en: enMessages,
fi: fiMessages,
- se: svMessages,
+ sv: svMessages,
};
+moment.tz.setDefault(SETTINGS.TIME_ZONE);
moment.defineLocale('varaamo-en', {
parentLocale: 'en-gb',
@@ -35,11 +33,11 @@ moment.defineLocale('varaamo-fi', {
},
});
-moment.defineLocale('varaamo-se', {
+moment.defineLocale('varaamo-sv', {
parentLocale: 'sv',
});
-addLocaleData([...en, ...fi, ...se]);
+addLocaleData([...en, ...fi, ...sv]);
function initI18n() {
const persistedData = loadPersistedLocale();
diff --git a/app/i18n/injectT.js b/app/i18n/injectT.js
index b48f59bb4..20250998c 100644
--- a/app/i18n/injectT.js
+++ b/app/i18n/injectT.js
@@ -17,7 +17,7 @@ function injectT(WrappedComponent) {
}
render() {
- return
{t(translationKeys.lead)}
-{t('AboutPageContent.pilotParagraph')}
-{t(translationKeys.reservable)}
-{t('AboutPageContent.developmentParagraph')}
-{t('AboutPageContent.goalParagraph')}
-
- {t('AboutPageContent.feedbackParagraph')}
- {' '}
-
- {t('AboutPageContent.customerRegisterParagraph')} - {' '} - - {t('AboutPageContent.customerRegisterLink')} - -
-+ Currently, Varaamo does not support Internet Explorer. We are investigating this issue and finding a solution. Meanwhile, use another browser (such as Chrome + , Firefox + or Edge + ).
+ Varaamo ei tue Internet Explorer selainta tällä hetkellä. Selvitämme ongelmaa sen ratkaisemiseksi. Sillä välin, käytä toista selainta (kuten Chrome + , Firefox + tai Edge + ).
+ Varaamo fungerar inte längre med Internet Explorer. Vi arbetar med att lösa problemet. Under tiden så var vänlig och använd någon annan browser (t.ex Chrome + , Firefox + eller Edge + ).
{t('payment.text')}
+ {resourceId && ( + + + + )} + + + +{introText}
} + + {/* Selected recurring info */} +{t('ReservationPage.paymentText')}
+
-
+
-
+
- + + +
-