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

Commit

Permalink
Merge pull request #915 from City-of-Helsinki/release/0.2.0
Browse files Browse the repository at this point in the history
Release 0.2.0
  • Loading branch information
Chi Nguyen authored Apr 9, 2019
2 parents 7feb45f + 0b4ff65 commit 3170c9b
Show file tree
Hide file tree
Showing 35 changed files with 648 additions and 157 deletions.
67 changes: 40 additions & 27 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
* 0.1.2
** MAJOR CHANGES **

- 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.

** 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.
- [#909](https://github.com/City-of-Helsinki/varaamo/pull/909) Show warning message for IE11 users.

* 0.1.1
** HOTFIX **

Expand All @@ -13,70 +26,70 @@
** CHANGELOG **

UI changes:
- #863: Make homepage banner clickable.
- [#863](https://github.com/City-of-Helsinki/varaamo/pull/863): Make homepage banner clickable.

- #865: Delayed reservation.
- [#865](https://github.com/City-of-Helsinki/varaamo/pull/865): Delayed reservation.

- #867: Add config to fetch all unit that doesn't have empty resources.
- [#867](https://github.com/City-of-Helsinki/varaamo/pull/867): Add config to fetch all unit that doesn't have empty resources.

- #868: Add municipality filters for filtering resources base on municiples.
- [#868](https://github.com/City-of-Helsinki/varaamo/pull/868): Add municipality filters for filtering resources base on municiples.

- #873: Limit the selection of time slots to the ones within max period.
- [#873](https://github.com/City-of-Helsinki/varaamo/pull/873): Limit the selection of time slots to the ones within max period.

- #875: Expand advanced search panel when filters are applied.
- [#875](https://github.com/City-of-Helsinki/varaamo/pull/875): Expand advanced search panel when filters are applied.

- #876: Free-of-charge filter for resources.
- [#876](https://github.com/City-of-Helsinki/varaamo/pull/876): Free-of-charge filter for resources.

- #878: Remove the link for old website from the footer.
- [#878](https://github.com/City-of-Helsinki/varaamo/pull/878): Remove the link for old website from the footer.

- #883: Clear all filters after reset.
- [#883](https://github.com/City-of-Helsinki/varaamo/pull/883): Clear all filters after reset.

- #889: Disable reservation time limit for admins.
- [#889](https://github.com/City-of-Helsinki/varaamo/pull/889): Disable reservation time limit for admins.

- #899: Add unpublished tag to resource search list.
- [#899](https://github.com/City-of-Helsinki/varaamo/pull/899): Add unpublished tag to resource search list.

- #901: Add navigation links to staff and higher permission user.
- [#901](https://github.com/City-of-Helsinki/varaamo/pull/901): Add navigation links to staff and higher permission user.


Upgrading:
- #854: Upgrade react-router to react-router v4.
- [#854](https://github.com/City-of-Helsinki/varaamo/pull/854): Upgrade react-router to react-router v4.

- #856: Add dockerize config to dockerize development environment.
- [#856](https://github.com/City-of-Helsinki/varaamo/pull/856): Add dockerize config to dockerize development environment.

- #857: Upgrade moment, moment-range, moment-timezome.
- [#857](https://github.com/City-of-Helsinki/varaamo/pull/857): Upgrade moment, moment-range, moment-timezome.

- #860: Upgrade lodash.
- [#860](https://github.com/City-of-Helsinki/varaamo/pull/860): Upgrade lodash.

- #862: Replace redux-logger with redux-devtools.
- [#862](https://github.com/City-of-Helsinki/varaamo/pull/862): Replace redux-logger with redux-devtools.

- #868: Upgrade react-select.
- [#868](https://github.com/City-of-Helsinki/varaamo/pull/868): Upgrade react-select.

- #874: Replace React internal prop-types with npm prop-types.
- [#874](https://github.com/City-of-Helsinki/varaamo/pull/874): Replace React internal prop-types with npm prop-types.

- #879: Upgrade React to 15.6.2, Enzyme to v3+.
- [#879](https://github.com/City-of-Helsinki/varaamo/pull/879): Upgrade React to 15.6.2, Enzyme to v3+.

- #882: Upgrade react-day-picker, remove react-date-picker.
- [#882](https://github.com/City-of-Helsinki/varaamo/pull/882): Upgrade react-day-picker, remove react-date-picker.

- #884: Upgrade babel to v7, webpack v4, replace Karma/Mocha/Chai with Jest.
- [#884](https://github.com/City-of-Helsinki/varaamo/pull/884): Upgrade babel to v7, webpack v4, replace Karma/Mocha/Chai with Jest.

- #890: Replace Chai with Jest's assertions.
- [#890](https://github.com/City-of-Helsinki/varaamo/pull/890): Replace Chai with Jest's assertions.

- #892: Remove unnecessary outdated dependencies:
- [#892](https://github.com/City-of-Helsinki/varaamo/pull/892): Remove unnecessary outdated dependencies:

- Remove react-document-title, use react-helmet
- Remove react-body-classname, classname append can be handled by classnames

- #893: Remove unnessary persisted state library, upgrade redux and dependencies:
- [#893](https://github.com/City-of-Helsinki/varaamo/pull/893): Remove unnessary persisted state library, upgrade redux and dependencies:

- Remove redux-localstorage and redux-localstorage-filter. Replaced with vanilla code.

- Upgrade redux and dependencies.

- #894: Upgrade React to 16.8.x:
- [#894](https://github.com/City-of-Helsinki/varaamo/pull/894): Upgrade React to 16.8.x:

- Upgrade React to 16.8.x
- Upgrade React's dependencies to latest.

- #900: Clean up obsolete/deprecated component.
- [#900](https://github.com/City-of-Helsinki/varaamo/pull/900): Clean up obsolete/deprecated component.

- Delete navbar, sidebar, side-navbar which was replaced by new component but not getting removed.
10 changes: 10 additions & 0 deletions app/assets/icons/heart-filled.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions app/constants/AppConstants.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ export default {
end: '',
lat: '',
lon: '',
orderBy: '',
page: 1,
people: '',
purpose: '',
Expand All @@ -68,4 +69,11 @@ export default {
TIME_FORMAT: 'H:mm',
TIME_SLOT_DEFAULT_LENGTH: 30,
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
}
};
7 changes: 6 additions & 1 deletion app/i18n/messages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,11 @@
"SearchControlsContainer.unitLabel": "Premise",
"SearchPage.title": "Search",
"ShowResourcesLink.text": "Show all premises and equipment",
"SortBy.label": "Sort By:",
"SortBy.name.label": "Name",
"SortBy.type.label": "Type",
"SortBy.premise.label": "Premise",
"SortBy.people.label": "People",
"TestSiteMessage.text": "This is the test version of Varaamo",
"TimeRangeControl.timeRangeTitle": "Time range and minimum duration",
"TimeRangeControl.title": "{date} at {start}-{end} {hours}h booking",
Expand All @@ -279,4 +284,4 @@
"UserReservationsPage.regularEmptyMessage": "No standard reservations",
"UserReservationsPage.regularReservationsHeader": "Standard reservations",
"UserReservationsPage.title": "My reservations"
}
}
7 changes: 6 additions & 1 deletion app/i18n/messages/fi.json
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,11 @@
"SearchControlsContainer.unitLabel": "Toimipiste",
"SearchPage.title": "Haku",
"ShowResourcesLink.text": "Näytä kaikki tilat ja laitteet",
"SortBy.label": "Järjestä:",
"SortBy.name.label": "Nimi",
"SortBy.type.label": "Tyyppi",
"SortBy.premise.label": "Toimipiste",
"SortBy.people.label": "Henkilömäärä",
"TimeRangeControl.timeRangeTitle": "Käytä aikaväliä ja varauksen minimipituutta",
"TimeRangeControl.title": "{date} klo {start}-{end} {hours}h varaus",
"TestSiteMessage.text": "Tämä on Varaamon testiversio",
Expand All @@ -279,4 +284,4 @@
"UserReservationsPage.regularEmptyMessage": "Ei tavallisia varauksia näytettäväksi.",
"UserReservationsPage.regularReservationsHeader": "Tavalliset varaukset",
"UserReservationsPage.title": "Omat varaukset"
}
}
7 changes: 6 additions & 1 deletion app/i18n/messages/sv.json
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,11 @@
"SearchControlsContainer.unitLabel": "Utrymmet",
"SearchPage.title": "Sök",
"ShowResourcesLink.text": "Visa alla utrymmen och apparater",
"SortBy.label": "Sortera efter:",
"SortBy.name.label": "Namn",
"SortBy.type.label": "Typ",
"SortBy.premise.label": "Lokal",
"SortBy.people.label": "Antal personer",
"TestSiteMessage.text": "Detta är Varaamo testversion",
"TimeRangeControl.timeRangeTitle": "Tidsurval och minsta reserveringstid",
"TimeRangeControl.title": "{date} kl. {start}-{end} {hours}h bokning",
Expand All @@ -281,4 +286,4 @@
"UserReservationsPage.regularEmptyMessage": "Det finns inga vanliga bokningar att visa.",
"UserReservationsPage.regularReservationsHeader": "Vanliga bokningar",
"UserReservationsPage.title": "Mina bokningar"
}
}
19 changes: 12 additions & 7 deletions app/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'react-app-polyfill/ie11';
import { browserName } from 'react-device-detect';
import 'location-origin';

import React from 'react';
import { render } from 'react-dom';
import { Provider } from 'react-intl-redux';
Expand All @@ -14,6 +15,7 @@ import { initI18n } from 'i18n';
import configureStore from 'store/configureStore';
import rootReducer from 'state/rootReducer';
import getRoutes from './routes';
import BrowserWarning from './pages/browser-warning';

const initialStoreState = createStore(rootReducer, {}).getState();
const initialServerState = window.INITIAL_STATE;
Expand All @@ -22,10 +24,13 @@ const finalState = Immutable(initialStoreState).merge([initialServerState, initi
deep: true,
});
const store = configureStore(finalState);
const isIEBrowser = browserName === 'IE';

render(
<Provider store={store}>
<Router>{getRoutes()}</Router>
</Provider>,
document.getElementById('root')
);
// TODO: Support IE11 in the future.
render(isIEBrowser ? <BrowserWarning />
: (
<Provider store={store}>
<Router>{getRoutes()}</Router>
</Provider>
),
document.getElementById('root'));
43 changes: 43 additions & 0 deletions app/pages/browser-warning/BrowserWarning.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import React from 'react';

function BrowserWarning() {
return (
<div>
<p className="alert alert-warning">
Currently, Varaamo does not support Internet Explorer.
We are investigating this issue and finding a solution.
Meanwhile, use another browser (such as
<a href="https://www.google.com/chrome/"> Chrome</a>
,
<a href="https://www.mozilla.org/en-US/firefox/new/"> Firefox </a>
or
<a href="https://www.microsoft.com/en-us/windows/microsoft-edge"> Edge</a>
).
</p>
<p className="alert alert-warning">
Varaamo ei tue Internet Explorer selainta tällä hetkellä.
Selvitämme ongelmaa sen ratkaisemiseksi.
Sillä välin, käytä toista selainta (kuten
<a href="https://www.google.com/chrome/"> Chrome</a>
,
<a href="https://www.mozilla.org/en-US/firefox/new/"> Firefox </a>
tai
<a href="https://www.microsoft.com/en-us/windows/microsoft-edge"> Edge</a>
).
</p>
<p className="alert alert-warning">
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
<a href="https://www.google.com/chrome/"> Chrome</a>
,
<a href="https://www.mozilla.org/en-US/firefox/new/"> Firefox </a>
eller
<a href="https://www.microsoft.com/en-us/windows/microsoft-edge"> Edge</a>
).
</p>
</div>
);
}

export default BrowserWarning;
25 changes: 25 additions & 0 deletions app/pages/browser-warning/BrowserWarning.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import React from 'react';

import BrowserWarning from './BrowserWarning';
import { shallowWithIntl } from 'utils/testUtils';

describe('pages/browser-warning/BrowserWarning', () => {
function getWrapper() {
return shallowWithIntl(<BrowserWarning />);
}

test('renders a browser warning div', () => {
const div = getWrapper().find('div');
expect(div.length).toBe(1);
});

test('renders a browser warning paragraph', () => {
const p = getWrapper().find('p');
expect(p.length).toBe(3);
});

test('renders all specified browser links', () => {
const a = getWrapper().find('a');
expect(a.length).toBe(9);
});
});
3 changes: 3 additions & 0 deletions app/pages/browser-warning/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import BrowserWarning from './BrowserWarning';

export default BrowserWarning;
17 changes: 17 additions & 0 deletions app/pages/search/SearchPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ import isEqual from 'lodash/isEqual';
import PropTypes from 'prop-types';
import React, { Component } from 'react';
import { connect } from 'react-redux';
import queryString from 'query-string';
import { bindActionCreators } from 'redux';
import Row from 'react-bootstrap/lib/Row';
import Col from 'react-bootstrap/lib/Col';

import { searchResources, toggleMap } from 'actions/searchActions';
import { changeSearchFilters } from 'actions/uiActions';
Expand All @@ -14,12 +17,14 @@ import ResourceMap from 'shared/resource-map';
import SearchControls from './controls';
import searchPageSelector from './searchPageSelector';
import SearchResults from './results/SearchResults';
import Sort from './Sort';
import MapToggle from './results/MapToggle';

class UnconnectedSearchPage extends Component {
constructor(props) {
super(props);
this.searchResources = this.searchResources.bind(this);
this.sortResource = this.sortResource.bind(this);
}

componentDidMount() {
Expand Down Expand Up @@ -68,6 +73,11 @@ class UnconnectedSearchPage extends Component {
this.props.actions.searchResources({ ...filters, ...position });
}

sortResource(value) {
const filters = { ...this.props.filters, ...{ orderBy: value } };
this.props.history.push(`/search?${queryString.stringify(filters)}`);
}

render() {
const {
actions,
Expand All @@ -80,6 +90,7 @@ class UnconnectedSearchPage extends Component {
searchDone,
selectedUnitId,
showMap,
filters,
t,
} = this.props;
return (
Expand All @@ -96,7 +107,13 @@ class UnconnectedSearchPage extends Component {
showMap={showMap}
/>
)}

<PageWrapper className="app-SearchPage__wrapper" title={t('SearchPage.title')} transparent>
<Row className="app-SearchPage__sortControlRow">
<Col className="app-SearchPage__sortControl" md={4} mdOffset={8} sm={6}>
<Sort onChange={this.sortResource} sortValue={filters.orderBy} />
</Col>
</Row>
<div className="app-SearchPage__content">
{(searchDone || isFetchingSearchResults) && (
<SearchResults
Expand Down
Loading

0 comments on commit 3170c9b

Please sign in to comment.