mirror of
https://github.com/kingomarnajjar/flex-template-web.git
synced 2026-07-26 06:47:17 +10:00
Update InboxPage container: use SCA process
This commit is contained in:
parent
5eea53eecf
commit
551ea6a9b3
4 changed files with 57 additions and 13 deletions
|
|
@ -12,6 +12,8 @@ import {
|
|||
txIsEnquired,
|
||||
txIsRequested,
|
||||
txHasBeenDelivered,
|
||||
txIsPaymentExpired,
|
||||
txIsPaymentPending,
|
||||
} from '../../util/transaction';
|
||||
import { LINE_ITEM_DAY, LINE_ITEM_UNITS, propTypes } from '../../util/types';
|
||||
import { formatMoney } from '../../util/currency';
|
||||
|
|
@ -89,6 +91,26 @@ export const txState = (intl, tx, type) => {
|
|||
};
|
||||
|
||||
return requested;
|
||||
} else if (txIsPaymentPending(tx)) {
|
||||
return {
|
||||
nameClassName: isOrder ? css.nameNotEmphasized : css.nameEmphasized,
|
||||
bookingClassName: css.bookingNoActionNeeded,
|
||||
lastTransitionedAtClassName: css.lastTransitionedAtNotEmphasized,
|
||||
stateClassName: isOrder ? css.stateActionNeeded : css.stateNoActionNeeded,
|
||||
state: intl.formatMessage({
|
||||
id: 'InboxPage.statePendingPayment',
|
||||
}),
|
||||
};
|
||||
} else if (txIsPaymentExpired(tx)) {
|
||||
return {
|
||||
nameClassName: css.nameNotEmphasized,
|
||||
bookingClassName: css.bookingNoActionNeeded,
|
||||
lastTransitionedAtClassName: css.lastTransitionedAtNotEmphasized,
|
||||
stateClassName: css.stateNoActionNeeded,
|
||||
state: intl.formatMessage({
|
||||
id: 'InboxPage.stateExpired',
|
||||
}),
|
||||
};
|
||||
} else if (txIsDeclined(tx)) {
|
||||
return {
|
||||
nameClassName: css.nameNotEmphasized,
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import {
|
|||
} from '../../util/test-data';
|
||||
import { InboxPageComponent, InboxItem, txState } from './InboxPage';
|
||||
import routeConfiguration from '../../routeConfiguration';
|
||||
import { TRANSITION_REQUEST } from '../../util/transaction';
|
||||
import { TRANSITION_CONFIRM_PAYMENT } from '../../util/transaction';
|
||||
import { LINE_ITEM_NIGHT } from '../../util/types';
|
||||
|
||||
const noop = () => null;
|
||||
|
|
@ -61,7 +61,7 @@ describe('InboxPage', () => {
|
|||
transactions: [
|
||||
createTransaction({
|
||||
id: 'order-1',
|
||||
lastTransition: TRANSITION_REQUEST,
|
||||
lastTransition: TRANSITION_CONFIRM_PAYMENT,
|
||||
customer,
|
||||
provider,
|
||||
lastTransitionedAt: new Date(Date.UTC(2017, 0, 15)),
|
||||
|
|
@ -69,7 +69,7 @@ describe('InboxPage', () => {
|
|||
}),
|
||||
createTransaction({
|
||||
id: 'order-2',
|
||||
lastTransition: TRANSITION_REQUEST,
|
||||
lastTransition: TRANSITION_CONFIRM_PAYMENT,
|
||||
customer,
|
||||
provider,
|
||||
lastTransitionedAt: new Date(Date.UTC(2016, 0, 15)),
|
||||
|
|
@ -118,7 +118,7 @@ describe('InboxPage', () => {
|
|||
transactions: [
|
||||
createTransaction({
|
||||
id: 'sale-1',
|
||||
lastTransition: TRANSITION_REQUEST,
|
||||
lastTransition: TRANSITION_CONFIRM_PAYMENT,
|
||||
customer,
|
||||
provider,
|
||||
lastTransitionedAt: new Date(Date.UTC(2017, 0, 15)),
|
||||
|
|
@ -126,7 +126,7 @@ describe('InboxPage', () => {
|
|||
}),
|
||||
createTransaction({
|
||||
id: 'sale-2',
|
||||
lastTransition: TRANSITION_REQUEST,
|
||||
lastTransition: TRANSITION_CONFIRM_PAYMENT,
|
||||
customer,
|
||||
provider,
|
||||
lastTransitionedAt: new Date(Date.UTC(2016, 0, 15)),
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ exports[`InboxPage matches snapshot 1`] = `
|
|||
Object {
|
||||
"attributes": Object {
|
||||
"createdAt": 2017-05-01T00:00:00.000Z,
|
||||
"lastTransition": "transition/request",
|
||||
"lastTransition": "transition/confirm-payment",
|
||||
"lastTransitionedAt": 2017-01-15T00:00:00.000Z,
|
||||
"lineItems": Array [
|
||||
Object {
|
||||
|
|
@ -158,7 +158,12 @@ exports[`InboxPage matches snapshot 1`] = `
|
|||
Object {
|
||||
"by": "customer",
|
||||
"createdAt": 2017-05-01T00:00:00.000Z,
|
||||
"transition": "transition/request",
|
||||
"transition": "transition/request-payment",
|
||||
},
|
||||
Object {
|
||||
"by": "customer",
|
||||
"createdAt": 2017-05-01T00:00:01.000Z,
|
||||
"transition": "transition/confirm-payment",
|
||||
},
|
||||
Object {
|
||||
"by": "provider",
|
||||
|
|
@ -252,7 +257,7 @@ exports[`InboxPage matches snapshot 1`] = `
|
|||
Object {
|
||||
"attributes": Object {
|
||||
"createdAt": 2017-05-01T00:00:00.000Z,
|
||||
"lastTransition": "transition/request",
|
||||
"lastTransition": "transition/confirm-payment",
|
||||
"lastTransitionedAt": 2016-01-15T00:00:00.000Z,
|
||||
"lineItems": Array [
|
||||
Object {
|
||||
|
|
@ -306,7 +311,12 @@ exports[`InboxPage matches snapshot 1`] = `
|
|||
Object {
|
||||
"by": "customer",
|
||||
"createdAt": 2017-05-01T00:00:00.000Z,
|
||||
"transition": "transition/request",
|
||||
"transition": "transition/request-payment",
|
||||
},
|
||||
Object {
|
||||
"by": "customer",
|
||||
"createdAt": 2017-05-01T00:00:01.000Z,
|
||||
"transition": "transition/confirm-payment",
|
||||
},
|
||||
Object {
|
||||
"by": "provider",
|
||||
|
|
@ -546,7 +556,7 @@ exports[`InboxPage matches snapshot 3`] = `
|
|||
Object {
|
||||
"attributes": Object {
|
||||
"createdAt": 2017-05-01T00:00:00.000Z,
|
||||
"lastTransition": "transition/request",
|
||||
"lastTransition": "transition/confirm-payment",
|
||||
"lastTransitionedAt": 2017-01-15T00:00:00.000Z,
|
||||
"lineItems": Array [
|
||||
Object {
|
||||
|
|
@ -600,7 +610,12 @@ exports[`InboxPage matches snapshot 3`] = `
|
|||
Object {
|
||||
"by": "customer",
|
||||
"createdAt": 2017-05-01T00:00:00.000Z,
|
||||
"transition": "transition/request",
|
||||
"transition": "transition/request-payment",
|
||||
},
|
||||
Object {
|
||||
"by": "customer",
|
||||
"createdAt": 2017-05-01T00:00:01.000Z,
|
||||
"transition": "transition/confirm-payment",
|
||||
},
|
||||
Object {
|
||||
"by": "provider",
|
||||
|
|
@ -694,7 +709,7 @@ exports[`InboxPage matches snapshot 3`] = `
|
|||
Object {
|
||||
"attributes": Object {
|
||||
"createdAt": 2017-05-01T00:00:00.000Z,
|
||||
"lastTransition": "transition/request",
|
||||
"lastTransition": "transition/confirm-payment",
|
||||
"lastTransitionedAt": 2016-01-15T00:00:00.000Z,
|
||||
"lineItems": Array [
|
||||
Object {
|
||||
|
|
@ -748,7 +763,12 @@ exports[`InboxPage matches snapshot 3`] = `
|
|||
Object {
|
||||
"by": "customer",
|
||||
"createdAt": 2017-05-01T00:00:00.000Z,
|
||||
"transition": "transition/request",
|
||||
"transition": "transition/request-payment",
|
||||
},
|
||||
Object {
|
||||
"by": "customer",
|
||||
"createdAt": 2017-05-01T00:00:01.000Z,
|
||||
"transition": "transition/confirm-payment",
|
||||
},
|
||||
Object {
|
||||
"by": "provider",
|
||||
|
|
|
|||
|
|
@ -303,7 +303,9 @@
|
|||
"InboxPage.stateDeclined": "Declined",
|
||||
"InboxPage.stateDelivered": "Delivered",
|
||||
"InboxPage.stateEnquiry": "Enquiry",
|
||||
"InboxPage.stateExpired": "Payment expired",
|
||||
"InboxPage.statePending": "Pending",
|
||||
"InboxPage.statePendingPayment": "Pending payment",
|
||||
"InboxPage.stateRequested": "Requested",
|
||||
"InboxPage.title": "Inbox",
|
||||
"LandingPage.schemaDescription": "Book a sauna using Saunatime or earn some income by sharing your sauna",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue