Commit 929eca3c authored by Sébastiaan Versteeg's avatar Sébastiaan Versteeg
Browse files

Merge branch 'fix-pizzas' into 'master'

Fix pizzas ordering with new payment api

See merge request !264
parents 66c33099 d393155c
......@@ -64,6 +64,7 @@ Object {
"No": "Nee",
"No registration required.": "Aanmelden niet vereist.",
"Number of registrations": "Aantal aanmeldingen",
"Order": "Bestel",
"Price": "Prijs",
"Put me on the waiting list": "Zet me op de wachtlijst",
"Queue position {{pos}}": "Wachtlijst positie {{pos}}",
......
......@@ -198,7 +198,7 @@ describe('pizza saga', () => {
Authorization: 'Token token',
'Content-Type': 'application/json',
},
method: 'PUT',
method: 'PATCH',
body: '{"product":1}',
});
}));
......
......@@ -118,6 +118,7 @@ I18n {
"No": "Nee",
"No registration required.": "Aanmelden niet vereist.",
"Number of registrations": "Aantal aanmeldingen",
"Order": "Bestel",
"Price": "Prijs",
"Put me on the waiting list": "Zet me op de wachtlijst",
"Queue position {{pos}}": "Wachtlijst positie {{pos}}",
......@@ -325,6 +326,7 @@ I18n {
"No": "Nee",
"No registration required.": "Aanmelden niet vereist.",
"Number of registrations": "Aantal aanmeldingen",
"Order": "Bestel",
"Price": "Prijs",
"Put me on the waiting list": "Zet me op de wachtlijst",
"Queue position {{pos}}": "Wachtlijst positie {{pos}}",
......@@ -535,6 +537,7 @@ I18n {
"No": "Nee",
"No registration required.": "Aanmelden niet vereist.",
"Number of registrations": "Aantal aanmeldingen",
"Order": "Bestel",
"Price": "Prijs",
"Put me on the waiting list": "Zet me op de wachtlijst",
"Queue position {{pos}}": "Wachtlijst positie {{pos}}",
......@@ -732,6 +735,7 @@ I18n {
"No": "Nee",
"No registration required.": "Aanmelden niet vereist.",
"Number of registrations": "Aantal aanmeldingen",
"Order": "Bestel",
"Price": "Prijs",
"Put me on the waiting list": "Zet me op de wachtlijst",
"Queue position {{pos}}": "Wachtlijst positie {{pos}}",
......@@ -939,6 +943,7 @@ I18n {
"No": "Nee",
"No registration required.": "Aanmelden niet vereist.",
"Number of registrations": "Aantal aanmeldingen",
"Order": "Bestel",
"Price": "Prijs",
"Put me on the waiting list": "Zet me op de wachtlijst",
"Queue position {{pos}}": "Wachtlijst positie {{pos}}",
......@@ -1141,6 +1146,7 @@ I18n {
"No": "Nee",
"No registration required.": "Aanmelden niet vereist.",
"Number of registrations": "Aantal aanmeldingen",
"Order": "Bestel",
"Price": "Prijs",
"Put me on the waiting list": "Zet me op de wachtlijst",
"Queue position {{pos}}": "Wachtlijst positie {{pos}}",
......@@ -1308,6 +1314,7 @@ I18n {
"No": "Nee",
"No registration required.": "Aanmelden niet vereist.",
"Number of registrations": "Aantal aanmeldingen",
"Order": "Bestel",
"Price": "Prijs",
"Put me on the waiting list": "Zet me op de wachtlijst",
"Queue position {{pos}}": "Wachtlijst positie {{pos}}",
......@@ -1508,6 +1515,7 @@ I18n {
"No": "Nee",
"No registration required.": "Aanmelden niet vereist.",
"Number of registrations": "Aantal aanmeldingen",
"Order": "Bestel",
"Price": "Prijs",
"Put me on the waiting list": "Zet me op de wachtlijst",
"Queue position {{pos}}": "Wachtlijst positie {{pos}}",
......@@ -1709,6 +1717,7 @@ I18n {
"No": "Nee",
"No registration required.": "Aanmelden niet vereist.",
"Number of registrations": "Aantal aanmeldingen",
"Order": "Bestel",
"Price": "Prijs",
"Put me on the waiting list": "Zet me op de wachtlijst",
"Queue position {{pos}}": "Wachtlijst positie {{pos}}",
......@@ -1929,6 +1938,7 @@ I18n {
"No": "Nee",
"No registration required.": "Aanmelden niet vereist.",
"Number of registrations": "Aantal aanmeldingen",
"Order": "Bestel",
"Price": "Prijs",
"Put me on the waiting list": "Zet me op de wachtlijst",
"Queue position {{pos}}": "Wachtlijst positie {{pos}}",
......@@ -2126,6 +2136,7 @@ I18n {
"No": "Nee",
"No registration required.": "Aanmelden niet vereist.",
"Number of registrations": "Aantal aanmeldingen",
"Order": "Bestel",
"Price": "Prijs",
"Put me on the waiting list": "Zet me op de wachtlijst",
"Queue position {{pos}}": "Wachtlijst positie {{pos}}",
......@@ -2332,6 +2343,7 @@ I18n {
"No": "Nee",
"No registration required.": "Aanmelden niet vereist.",
"Number of registrations": "Aantal aanmeldingen",
"Order": "Bestel",
"Price": "Prijs",
"Put me on the waiting list": "Zet me op de wachtlijst",
"Queue position {{pos}}": "Wachtlijst positie {{pos}}",
......@@ -2541,6 +2553,7 @@ I18n {
"No": "Nee",
"No registration required.": "Aanmelden niet vereist.",
"Number of registrations": "Aantal aanmeldingen",
"Order": "Bestel",
"Price": "Prijs",
"Put me on the waiting list": "Zet me op de wachtlijst",
"Queue position {{pos}}": "Wachtlijst positie {{pos}}",
......@@ -2738,6 +2751,7 @@ I18n {
"No": "Nee",
"No registration required.": "Aanmelden niet vereist.",
"Number of registrations": "Aantal aanmeldingen",
"Order": "Bestel",
"Price": "Prijs",
"Put me on the waiting list": "Zet me op de wachtlijst",
"Queue position {{pos}}": "Wachtlijst positie {{pos}}",
......@@ -2945,6 +2959,7 @@ I18n {
"No": "Nee",
"No registration required.": "Aanmelden niet vereist.",
"Number of registrations": "Aantal aanmeldingen",
"Order": "Bestel",
"Price": "Prijs",
"Put me on the waiting list": "Zet me op de wachtlijst",
"Queue position {{pos}}": "Wachtlijst positie {{pos}}",
......@@ -4049,6 +4064,7 @@ I18n {
"No": "Nee",
"No registration required.": "Aanmelden niet vereist.",
"Number of registrations": "Aantal aanmeldingen",
"Order": "Bestel",
"Price": "Prijs",
"Put me on the waiting list": "Zet me op de wachtlijst",
"Queue position {{pos}}": "Wachtlijst positie {{pos}}",
......@@ -4204,6 +4220,7 @@ I18n {
"No": "Nee",
"No registration required.": "Aanmelden niet vereist.",
"Number of registrations": "Aantal aanmeldingen",
"Order": "Bestel",
"Price": "Prijs",
"Put me on the waiting list": "Zet me op de wachtlijst",
"Queue position {{pos}}": "Wachtlijst positie {{pos}}",
......@@ -4402,6 +4419,7 @@ I18n {
"No": "Nee",
"No registration required.": "Aanmelden niet vereist.",
"Number of registrations": "Aantal aanmeldingen",
"Order": "Bestel",
"Price": "Prijs",
"Put me on the waiting list": "Zet me op de wachtlijst",
"Queue position {{pos}}": "Wachtlijst positie {{pos}}",
......@@ -4599,6 +4617,7 @@ I18n {
"No": "Nee",
"No registration required.": "Aanmelden niet vereist.",
"Number of registrations": "Aantal aanmeldingen",
"Order": "Bestel",
"Price": "Prijs",
"Put me on the waiting list": "Zet me op de wachtlijst",
"Queue position {{pos}}": "Wachtlijst positie {{pos}}",
......@@ -4806,6 +4825,7 @@ I18n {
"No": "Nee",
"No registration required.": "Aanmelden niet vereist.",
"Number of registrations": "Aantal aanmeldingen",
"Order": "Bestel",
"Price": "Prijs",
"Put me on the waiting list": "Zet me op de wachtlijst",
"Queue position {{pos}}": "Wachtlijst positie {{pos}}",
......@@ -5008,6 +5028,7 @@ I18n {
"No": "Nee",
"No registration required.": "Aanmelden niet vereist.",
"Number of registrations": "Aantal aanmeldingen",
"Order": "Bestel",
"Price": "Prijs",
"Put me on the waiting list": "Zet me op de wachtlijst",
"Queue position {{pos}}": "Wachtlijst positie {{pos}}",
......@@ -5175,6 +5196,7 @@ I18n {
"No": "Nee",
"No registration required.": "Aanmelden niet vereist.",
"Number of registrations": "Aantal aanmeldingen",
"Order": "Bestel",
"Price": "Prijs",
"Put me on the waiting list": "Zet me op de wachtlijst",
"Queue position {{pos}}": "Wachtlijst positie {{pos}}",
......@@ -5375,6 +5397,7 @@ I18n {
"No": "Nee",
"No registration required.": "Aanmelden niet vereist.",
"Number of registrations": "Aantal aanmeldingen",
"Order": "Bestel",
"Price": "Prijs",
"Put me on the waiting list": "Zet me op de wachtlijst",
"Queue position {{pos}}": "Wachtlijst positie {{pos}}",
......@@ -5576,6 +5599,7 @@ I18n {
"No": "Nee",
"No registration required.": "Aanmelden niet vereist.",
"Number of registrations": "Aantal aanmeldingen",
"Order": "Bestel",
"Price": "Prijs",
"Put me on the waiting list": "Zet me op de wachtlijst",
"Queue position {{pos}}": "Wachtlijst positie {{pos}}",
......@@ -5791,6 +5815,7 @@ I18n {
"No": "Nee",
"No registration required.": "Aanmelden niet vereist.",
"Number of registrations": "Aantal aanmeldingen",
"Order": "Bestel",
"Price": "Prijs",
"Put me on the waiting list": "Zet me op de wachtlijst",
"Queue position {{pos}}": "Wachtlijst positie {{pos}}",
......@@ -5988,6 +6013,7 @@ I18n {
"No": "Nee",
"No registration required.": "Aanmelden niet vereist.",
"Number of registrations": "Aantal aanmeldingen",
"Order": "Bestel",
"Price": "Prijs",
"Put me on the waiting list": "Zet me op de wachtlijst",
"Queue position {{pos}}": "Wachtlijst positie {{pos}}",
......@@ -6195,6 +6221,7 @@ I18n {
"No": "Nee",
"No registration required.": "Aanmelden niet vereist.",
"Number of registrations": "Aantal aanmeldingen",
"Order": "Bestel",
"Price": "Prijs",
"Put me on the waiting list": "Zet me op de wachtlijst",
"Queue position {{pos}}": "Wachtlijst positie {{pos}}",
......@@ -6397,6 +6424,7 @@ I18n {
"No": "Nee",
"No registration required.": "Aanmelden niet vereist.",
"Number of registrations": "Aantal aanmeldingen",
"Order": "Bestel",
"Price": "Prijs",
"Put me on the waiting list": "Zet me op de wachtlijst",
"Queue position {{pos}}": "Wachtlijst positie {{pos}}",
......@@ -6604,6 +6632,7 @@ I18n {
"No": "Nee",
"No registration required.": "Aanmelden niet vereist.",
"Number of registrations": "Aantal aanmeldingen",
"Order": "Bestel",
"Price": "Prijs",
"Put me on the waiting list": "Zet me op de wachtlijst",
"Queue position {{pos}}": "Wachtlijst positie {{pos}}",
......@@ -6801,6 +6830,7 @@ I18n {
"No": "Nee",
"No registration required.": "Aanmelden niet vereist.",
"Number of registrations": "Aantal aanmeldingen",
"Order": "Bestel",
"Price": "Prijs",
"Put me on the waiting list": "Zet me op de wachtlijst",
"Queue position {{pos}}": "Wachtlijst positie {{pos}}",
......@@ -7008,6 +7038,7 @@ I18n {
"No": "Nee",
"No registration required.": "Aanmelden niet vereist.",
"Number of registrations": "Aantal aanmeldingen",
"Order": "Bestel",
"Price": "Prijs",
"Put me on the waiting list": "Zet me op de wachtlijst",
"Queue position {{pos}}": "Wachtlijst positie {{pos}}",
......@@ -8112,6 +8143,7 @@ I18n {
"No": "Nee",
"No registration required.": "Aanmelden niet vereist.",
"Number of registrations": "Aantal aanmeldingen",
"Order": "Bestel",
"Price": "Prijs",
"Put me on the waiting list": "Zet me op de wachtlijst",
"Queue position {{pos}}": "Wachtlijst positie {{pos}}",
......
......@@ -4,6 +4,7 @@
"No": "Nee",
"Yes": "Ja",
"From": "Van",
"Order": "Bestel",
"Until": "Tot",
"Location": "Locatie",
"Price": "Prijs",
......
......@@ -7,6 +7,12 @@ import { apiRequest } from '../utils/url';
import * as pizzaActions from '../actions/pizza';
import { tokenSelector } from '../selectors/session';
export const Payment = {
NONE: 'no_payment',
CARD: 'card_payment',
CASH: 'cash_payment',
};
const NOT_FOUND = 404;
const retrievePizzaInfo = function* retrievePizzaInfo() {
......@@ -71,7 +77,7 @@ const order = function* order(action) {
const { pk, hasOrder } = action.payload;
const token = yield select(tokenSelector);
const data = {
method: hasOrder ? 'PUT' : 'POST',
method: hasOrder ? 'PATCH' : 'POST',
headers: {
Accept: 'application/json',
'Content-Type': 'application/json',
......
......@@ -94,7 +94,6 @@ class EventAdminScreen extends Component {
containsSearchKey = (pk) => {
const name = this.cleanSearchTerm(this.state.registrations[pk].name);
console.log('name', name);
return name.indexOf(this.cleanSearchTerm(this.state.searchKey)) >= 0;
};
......
......@@ -210,7 +210,7 @@ registration and pay the full costs of €{{ fine }}? You will not be able to un
</Text>
<Button
color={Colors.magenta}
title="Bestel"
title={t('Order')}
onPress={this.props.retrievePizzaInfo}
/>
</View>,
......
......@@ -73,6 +73,9 @@ class PizzaScreen extends Component {
if (order) {
const productInfo = this.getProductFromList(order.product, pizzaList);
if (!productInfo) {
return null;
}
return (
<CardSection sectionHeader={t('Current order')}>
......@@ -255,6 +258,7 @@ PizzaScreen.propTypes = {
order: PropTypes.shape({
pk: PropTypes.number.isRequired,
paid: PropTypes.bool.isRequired,
payment: PropTypes.string.isRequired,
product: PropTypes.number.isRequired,
name: PropTypes.string,
member: PropTypes.number,
......
import { connect } from 'react-redux';
import * as pizzaActions from '../../../actions/pizza';
import { Payment } from '../../../sagas/pizza';
import PizzaScreen from './PizzaScreen';
const mapStateToProps = state => ({
......@@ -7,7 +8,11 @@ const mapStateToProps = state => ({
loading: state.pizza.loading,
hasLoaded: state.pizza.hasLoaded,
event: state.pizza.event,
order: state.pizza.order,
order: state.pizza.order && {
...state.pizza.order,
paid: state.pizza.order.paid !== undefined
? state.pizza.order.paid : state.pizza.order.payment !== Payment.NONE,
},
pizzaList: state.pizza.pizzaList,
});
......
......@@ -21,7 +21,7 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>17</string>
<string>18</string>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>whatsapp</string>
......@@ -41,7 +41,7 @@
</dict>
</dict>
<key>NSLocationWhenInUseUsageDescription</key>
<string/>
<string></string>
<key>UIAppFonts</key>
<array>
<string>AntDesign.ttf</string>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment