Skip to content

Commit

Permalink
Merge pull request #105 from sharetribe/update-v8.1.0-from-upstream
Browse files Browse the repository at this point in the history
Update v8.1.0 from upstream
  • Loading branch information
Gnito authored Jul 1, 2020
2 parents 872a7a7 + 8b24a27 commit 3f3da0c
Show file tree
Hide file tree
Showing 15 changed files with 99 additions and 79 deletions.
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,26 @@ https://github.com/sharetribe/flex-template-web/

## Upcoming version 2020-XX-XX

## [v8.1.0] 2020-07-01

- [change] Change the transaction process name to be `flex-hourly-default-process/release-1`
[#104](https://github.com/sharetribe/ftw-hourly/pull/104)

### Updates from upstream (FTW-daily v6.1.0)

- [fix] MainPanel: search filter bug. Address and bounds are handled outside of MainPanel, URL
params should be trusted instead of values stored to state.
[#1320](https://github.com/sharetribe/ftw-daily/pull/1320)
- [fix] small typo. [#1319](https://github.com/sharetribe/ftw-daily/pull/1319)
- [fix] Fix typo (which is copy-pasted in 4 files).
[#1318](https://github.com/sharetribe/ftw-daily/pull/1318)
- [add] Update French translation file (Spanish and German translations have still missing keys).
[#1316](https://github.com/sharetribe/ftw-daily/pull/1316)
- [fix] Sync bookingUnitType variables and update comments. Client app's API (proxy) server needs to
know about unit type. [#1317](https://github.com/sharetribe/ftw-daily/pull/1317)

[v8.1.0]: https://github.com/sharetribe/flex-template-web/compare/v8.0.0...v8.1.0

## [v8.0.0] 2020-07-01

### Updates from upstream (FTW-daily v6.0.0)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "app",
"version": "8.0.0",
"version": "8.1.0",
"private": true,
"license": "Apache-2.0",
"dependencies": {
Expand Down
8 changes: 5 additions & 3 deletions server/api-util/lineItems.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ const { calculateQuantityFromHours, calculateTotalFromLineItems } = require('./l
const { types } = require('sharetribe-flex-sdk');
const { Money } = types;

const unitType = 'line-item/night';
// This bookingUnitType needs to be one of the following:
// line-item/night, line-item/day or line-item/units
const bookingUnitType = 'line-item/units';
const PROVIDER_COMMISSION_PERCENTAGE = -10;

/** Returns collection of lineItems (max 50)
Expand Down Expand Up @@ -39,9 +41,9 @@ exports.transactionLineItems = (listing, bookingData) => {
* By default BookingBreakdown prints line items inside LineItemUnknownItemsMaybe if the lineItem code is not recognized. */

const booking = {
code: 'line-item/units',
code: bookingUnitType,
unitPrice,
quantity: calculateQuantityFromHours(startDate, endDate, unitType),
quantity: calculateQuantityFromHours(startDate, endDate),
includeFor: ['customer', 'provider'],
};

Expand Down
2 changes: 1 addition & 1 deletion server/renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ exports.render = function(requestUrl, context, preloadedState) {
<script>window.__PRELOADED_STATE__ = ${JSON.stringify(serializedState)};</script>
`;

// We want to precicely control where the analytics script is
// We want to precisely control where the analytics script is
// injected in the HTML file so we can catch all events as early as
// possible. This is why we inject the GA script separately from
// react-helmet. This script also ensures that all the GA scripts
Expand Down
8 changes: 6 additions & 2 deletions src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,12 @@ const bookingProcessAlias = 'flex-hourly-default-process/release-1';
//
// Possible values: ['line-item/night', 'line-item/day', 'line-item/units';]
//
// Note: translations will use different translation keys for night, day or unit
// depending on the value chosen.
// Note 1: This 'bookingUnitType' variable affects only web app.
// If you are using privileged transitions (which is used by the default process),
// you also need to configure unit type in API server: server/api-util/lineItems.js
//
// Note 2: Translations will use different translation keys for night, day or unit
// depending on the value chosen.
const bookingUnitType = 'line-item/units';

// Should the application fetch available time slots (currently defined as
Expand Down
6 changes: 3 additions & 3 deletions src/containers/CheckoutPage/CheckoutPage.duck.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { fetchCurrentUserHasOrdersSuccess, fetchCurrentUser } from '../../ducks/

// ================ Action types ================ //

export const SET_INITAL_VALUES = 'app/CheckoutPage/SET_INITIAL_VALUES';
export const SET_INITIAL_VALUES = 'app/CheckoutPage/SET_INITIAL_VALUES';

export const INITIATE_ORDER_REQUEST = 'app/CheckoutPage/INITIATE_ORDER_REQUEST';
export const INITIATE_ORDER_SUCCESS = 'app/CheckoutPage/INITIATE_ORDER_SUCCESS';
Expand Down Expand Up @@ -50,7 +50,7 @@ const initialState = {
export default function checkoutPageReducer(state = initialState, action = {}) {
const { type, payload } = action;
switch (type) {
case SET_INITAL_VALUES:
case SET_INITIAL_VALUES:
return { ...initialState, ...payload };

case SPECULATE_TRANSACTION_REQUEST:
Expand Down Expand Up @@ -108,7 +108,7 @@ export default function checkoutPageReducer(state = initialState, action = {}) {
// ================ Action creators ================ //

export const setInitialValues = initialValues => ({
type: SET_INITAL_VALUES,
type: SET_INITIAL_VALUES,
payload: pick(initialValues, Object.keys(initialState)),
});

Expand Down
8 changes: 4 additions & 4 deletions src/containers/CheckoutPage/CheckoutPage.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import { renderShallow } from '../../util/test-helpers';
import { createUser, createCurrentUser, createListing, fakeIntl } from '../../util/test-data';
import { CheckoutPageComponent } from './CheckoutPage';
import checkoutPageReducer, { SET_INITAL_VALUES, setInitialValues } from './CheckoutPage.duck';
import checkoutPageReducer, { SET_INITIAL_VALUES, setInitialValues } from './CheckoutPage.duck';

const noop = () => null;

Expand Down Expand Up @@ -56,7 +56,7 @@ describe('CheckoutPage', () => {
bookingEnd: new Date(Date.UTC(2017, 3, 16)),
};
const expectedAction = {
type: SET_INITAL_VALUES,
type: SET_INITIAL_VALUES,
payload: { listing, bookingDates },
};

Expand All @@ -81,7 +81,7 @@ describe('CheckoutPage', () => {
expect(checkoutPageReducer(undefined, {})).toEqual(initialValues);
});

it('should handle SET_INITAL_VALUES', () => {
it('should handle SET_INITIAL_VALUES', () => {
const listing = createListing(
'00000000-0000-0000-0000-000000000000',
{},
Expand All @@ -95,7 +95,7 @@ describe('CheckoutPage', () => {
};
const payload = { listing, bookingDates };
const expected = { ...initialValues, ...payload };
expect(checkoutPageReducer({}, { type: SET_INITAL_VALUES, payload })).toEqual(expected);
expect(checkoutPageReducer({}, { type: SET_INITIAL_VALUES, payload })).toEqual(expected);
});
});
});
Expand Down
6 changes: 3 additions & 3 deletions src/containers/ListingPage/ListingPage.duck.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const { UUID } = sdkTypes;

// ================ Action types ================ //

export const SET_INITAL_VALUES = 'app/ListingPage/SET_INITIAL_VALUES';
export const SET_INITIAL_VALUES = 'app/ListingPage/SET_INITIAL_VALUES';

export const SHOW_LISTING_REQUEST = 'app/ListingPage/SHOW_LISTING_REQUEST';
export const SHOW_LISTING_ERROR = 'app/ListingPage/SHOW_LISTING_ERROR';
Expand Down Expand Up @@ -64,7 +64,7 @@ const initialState = {
const listingPageReducer = (state = initialState, action = {}) => {
const { type, payload } = action;
switch (type) {
case SET_INITAL_VALUES:
case SET_INITIAL_VALUES:
return { ...initialState, ...payload };

case SHOW_LISTING_REQUEST:
Expand Down Expand Up @@ -139,7 +139,7 @@ export default listingPageReducer;
// ================ Action creators ================ //

export const setInitialValues = initialValues => ({
type: SET_INITAL_VALUES,
type: SET_INITIAL_VALUES,
payload: pick(initialValues, Object.keys(initialState)),
});

Expand Down
9 changes: 8 additions & 1 deletion src/containers/SearchPage/MainPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,15 @@ class MainPanel extends Component {

return updatedURLParams => {
const updater = prevState => {
const { address, bounds } = urlQueryParams;
const mergedQueryParams = { ...urlQueryParams, ...prevState.currentQueryParams };
return { currentQueryParams: { ...mergedQueryParams, ...updatedURLParams } };

// Address and bounds are handled outside of MainPanel.
// I.e. TopbarSearchForm && search by moving the map.
// We should always trust urlQueryParams with those.
return {
currentQueryParams: { ...mergedQueryParams, ...updatedURLParams, address, bounds },
};
};

const callback = () => {
Expand Down
6 changes: 3 additions & 3 deletions src/containers/TransactionPage/TransactionPage.duck.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const CUSTOMER = 'customer';

// ================ Action types ================ //

export const SET_INITAL_VALUES = 'app/TransactionPage/SET_INITIAL_VALUES';
export const SET_INITIAL_VALUES = 'app/TransactionPage/SET_INITIAL_VALUES';

export const FETCH_TRANSACTION_REQUEST = 'app/TransactionPage/FETCH_TRANSACTION_REQUEST';
export const FETCH_TRANSACTION_SUCCESS = 'app/TransactionPage/FETCH_TRANSACTION_SUCCESS';
Expand Down Expand Up @@ -117,7 +117,7 @@ const mergeEntityArrays = (a, b) => {
export default function checkoutPageReducer(state = initialState, action = {}) {
const { type, payload } = action;
switch (type) {
case SET_INITAL_VALUES:
case SET_INITIAL_VALUES:
return { ...initialState, ...payload };

case FETCH_TRANSACTION_REQUEST:
Expand Down Expand Up @@ -246,7 +246,7 @@ export const acceptOrDeclineInProgress = state => {

// ================ Action creators ================ //
export const setInitialValues = initialValues => ({
type: SET_INITAL_VALUES,
type: SET_INITIAL_VALUES,
payload: pick(initialValues, Object.keys(initialState)),
});

Expand Down
32 changes: 8 additions & 24 deletions src/translations/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
"AuthenticationPage.verifyEmailTitle": "{name}, bitte prüfe deine Email-Inbox um deine Email zu verifizieren",
"Avatar.bannedUserDisplayName": "Gesperrter Benutzer",
"Avatar.deletedUserDisplayName": "Gelöschter Benutzer",
"BookingBreakdown.bookingPeriod": "{bookingStart} – {bookingEnd}",
"BookingBreakdown.commission": "Saunatime Gebühr *",
"BookingBreakdown.commissionFeeNote": "* Die Gebühr hilft uns, die Plattform zu betreiben und dir den bestmöglichen Service zu bieten!",
"BookingBreakdown.dayCount": "{count, number} {count, plural, one {Tag} other {Tage}}",
Expand Down Expand Up @@ -187,9 +186,6 @@
"EditListingPhotosForm.showListingFailed": "Fehler beim Laden der Eintragsdaten",
"EditListingPhotosForm.updateFailed": "Fehler beim Aktualisieren des Eintrags. Bitte erneut versuchen.",
"EditListingPhotosPanel.createListingTitle": "Einige Bilder hinzufügen",
"EditListingPhotosPanel.payoutModalInfo": "Weil dies dein erster Eintrag ist, brauchen wir etwas mehr Informationen um dir Geld für den eventuellen Verkauf schicken zu können. Diese Informationen werden nur einmal gefragt.",
"EditListingPhotosPanel.payoutModalTitleOneMoreThing": "Noch eine Sache:",
"EditListingPhotosPanel.payoutModalTitlePayoutPreferences": "Auszahlungseinstellungen",
"EditListingPhotosPanel.title": "Bilder von {listingTitle} ändern",
"EditListingPoliciesForm.rulesLabel": "Sauna Regeln",
"EditListingPoliciesForm.rulesPlaceholder": "Beschreibe, was nicht erlaubt ist",
Expand Down Expand Up @@ -506,19 +502,6 @@
"PayoutDetailsForm.businessURLPlaceholder": "Die öffentliche Website der Firma",
"PayoutDetailsForm.businessURLRequired": "Eine gültige URL-Adresse wird benötigt.",
"PayoutDetailsForm.canadianProvinceLabel": "Provinz",
"PayoutDetailsForm.canadianProvinceNames.AB": "Alberta",
"PayoutDetailsForm.canadianProvinceNames.BC": "British Columbia",
"PayoutDetailsForm.canadianProvinceNames.MB": "Manitoba",
"PayoutDetailsForm.canadianProvinceNames.NB": "New Brunswick",
"PayoutDetailsForm.canadianProvinceNames.NL": "Newfoundland and Labrador",
"PayoutDetailsForm.canadianProvinceNames.NS": "Nova Scotia",
"PayoutDetailsForm.canadianProvinceNames.NT": "Northwest Territories",
"PayoutDetailsForm.canadianProvinceNames.NU": "Nunavut",
"PayoutDetailsForm.canadianProvinceNames.ON": "Ontario",
"PayoutDetailsForm.canadianProvinceNames.PE": "Prince Edward Island",
"PayoutDetailsForm.canadianProvinceNames.QC": "Quebec",
"PayoutDetailsForm.canadianProvinceNames.SK": "Saskatchewan",
"PayoutDetailsForm.canadianProvinceNames.YT": "Yukon",
"PayoutDetailsForm.canadianProvincePlaceholder": "Proviz",
"PayoutDetailsForm.canadianProvinceRequired": "Dieses Feld wird benötigt",
"PayoutDetailsForm.cityLabel": "Stadt",
Expand Down Expand Up @@ -565,20 +548,28 @@
"PayoutDetailsForm.countryNames.CH": "Die Schweiz",
"PayoutDetailsForm.countryNames.DE": "Deutschland",
"PayoutDetailsForm.countryNames.DK": "Dänemark",
"PayoutDetailsForm.countryNames.EE": "Estonia",
"PayoutDetailsForm.countryNames.ES": "Spanien",
"PayoutDetailsForm.countryNames.FI": "Finnland",
"PayoutDetailsForm.countryNames.FR": "Frankreich",
"PayoutDetailsForm.countryNames.GR": "Greece",
"PayoutDetailsForm.countryNames.GB": "Vereinigtes Königreich",
"PayoutDetailsForm.countryNames.HK": "Hong Kong",
"PayoutDetailsForm.countryNames.IE": "Irland",
"PayoutDetailsForm.countryNames.IT": "Italien",
"PayoutDetailsForm.countryNames.JP": "Japan",
"PayoutDetailsForm.countryNames.LU": "Luxembourg",
"PayoutDetailsForm.countryNames.LT": "Lithuania",
"PayoutDetailsForm.countryNames.LV": "Latvia",
"PayoutDetailsForm.countryNames.MX": "Mexico",
"PayoutDetailsForm.countryNames.NL": "Niederlande",
"PayoutDetailsForm.countryNames.NO": "Norwegien",
"PayoutDetailsForm.countryNames.NZ": "Neuseeland",
"PayoutDetailsForm.countryNames.PT": "Portugal",
"PayoutDetailsForm.countryNames.SE": "Schweden",
"PayoutDetailsForm.countryNames.SG": "Singapore",
"PayoutDetailsForm.countryNames.SI": "Slovenia",
"PayoutDetailsForm.countryNames.SK": "Slovakia",
"PayoutDetailsForm.countryNames.US": "Vereinigte Staaten",
"PayoutDetailsForm.countryPlaceholder": "Land wählen…",
"PayoutDetailsForm.countryRequired": "Dieses Feld wird benötigt",
Expand Down Expand Up @@ -630,13 +621,6 @@
"PayoutDetailsForm.stripeToSText": "Beim Speichern, zustimmst du dem {stripeConnectedAccountTermsLink}",
"PayoutDetailsForm.submitButtonText": "Angaben speichern & Eintrag veröffentlichen",
"PayoutDetailsForm.title": "Noch etwas: Auszahlungseinstellungen",
"PayoutPreferencesPage.heading": "Zahlungseinstellungen",
"PayoutPreferencesPage.loadingData": "Daten werden geladen…",
"PayoutPreferencesPage.payoutDetailsSaved": "Zahlungsdaten erfolgreich gespeichert! Wenn du deine Zahlungsinformationen ändern möchtest, bitte kontaktiere die Marktplatz-Administratoren.",
"PayoutPreferencesPage.stripeAlreadyConnected": "Du hast schon deine Zahlungsdaten eingegeben. Wenn du deine Zahlungsdaten ändern möchtest, bitte kontaktiere die Marktplatz-Administratoren.",
"PayoutPreferencesPage.stripeNotConnected": "Zahlungsinformationen wurden nicht gespeichert. Bitte das Formular ausfüllen, um Zahlungen von deinen Einträgen entgegennehmen zu können.",
"PayoutPreferencesPage.submitButtonText": "Angaben speichern",
"PayoutPreferencesPage.title": "Zahlungseinstellungen",
"PriceFilter.clear": "Löschen",
"PriceFilter.label": "Preis",
"PriceFilter.labelSelectedPlain": "Preis: {minPrice} - {maxPrice}",
Expand Down
11 changes: 8 additions & 3 deletions src/translations/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -237,9 +237,6 @@
"EditListingPhotosForm.showListingFailed": "Error al recopilar datos del perfil",
"EditListingPhotosForm.updateFailed": "Error al actualizar. Por favor, inténtalo de nuevo.",
"EditListingPhotosPanel.createListingTitle": "Añade imágenes",
"EditListingPhotosPanel.payoutModalInfo": "Como ya has completado tu perfil, necesitamos saber un poco más de ti para poder depositarte dinero. Sólo te lo vamos a pedir una vez.",
"EditListingPhotosPanel.payoutModalTitleOneMoreThing": "Un detalle más:",
"EditListingPhotosPanel.payoutModalTitlePayoutPreferences": "Preferencias de pago",
"EditListingPhotosPanel.listingTitle": "Tu perfil de profesor",
"EditListingPhotosPanel.title": "Edita las imágenes de {listingTitle}",
"EditListingPoliciesForm.rulesLabel": "Reglamento del estudio de yoga",
Expand Down Expand Up @@ -606,20 +603,28 @@
"PayoutDetailsForm.countryNames.CH": "Suiza",
"PayoutDetailsForm.countryNames.DE": "Alemania",
"PayoutDetailsForm.countryNames.DK": "Dinamarca",
"PayoutDetailsForm.countryNames.EE": "Estonia",
"PayoutDetailsForm.countryNames.ES": "España",
"PayoutDetailsForm.countryNames.FI": "Finlandia",
"PayoutDetailsForm.countryNames.FR": "Francia",
"PayoutDetailsForm.countryNames.GR": "Greece",
"PayoutDetailsForm.countryNames.GB": "Reino Unido",
"PayoutDetailsForm.countryNames.HK": "Hong Kong",
"PayoutDetailsForm.countryNames.IE": "Irlanda",
"PayoutDetailsForm.countryNames.IT": "Italia",
"PayoutDetailsForm.countryNames.JP": "Japan",
"PayoutDetailsForm.countryNames.LU": "Luxemburgo",
"PayoutDetailsForm.countryNames.LT": "Lithuania",
"PayoutDetailsForm.countryNames.LV": "Latvia",
"PayoutDetailsForm.countryNames.MX": "Mexico",
"PayoutDetailsForm.countryNames.NL": "Países Bajos",
"PayoutDetailsForm.countryNames.NO": "Noruega",
"PayoutDetailsForm.countryNames.NZ": "Nueva Zelanda",
"PayoutDetailsForm.countryNames.PT": "Portugal",
"PayoutDetailsForm.countryNames.SE": "Suecia",
"PayoutDetailsForm.countryNames.SG": "Singapur",
"PayoutDetailsForm.countryNames.SI": "Slovenia",
"PayoutDetailsForm.countryNames.SK": "Slovakia",
"PayoutDetailsForm.countryNames.US": "Estados Unidos",
"PayoutDetailsForm.countryPlaceholder": "Selecciona tu país…",
"PayoutDetailsForm.countryRequired": "Este campo es necesario",
Expand Down
Loading

0 comments on commit 3f3da0c

Please sign in to comment.