From 833606d8240250d8c64200bc622ec51ba537d6bf Mon Sep 17 00:00:00 2001 From: Sergey Korzh Date: Sun, 1 Apr 2018 11:43:06 +0300 Subject: [PATCH] As a stakeholder I want all copy on checkout page to be editable from administration interface (#13) * [#155649274] Added fields for Checkout settings. * [#155649274] Added default values for Checkout settings. * [#155649274] Reverted wrong commit. * [#155649274] Updated order of fields. * [#155649274] Outputted step1 description from the backend. * [#155649274] Outputted descriptions from the backend. --- ...ig_pages.site_content_settings.default.yml | 63 +++++++++++++++++++ ...ig_pages.site_content_settings.default.yml | 43 +++++++++++++ ...t_settings.field_config_checkout_cards.yml | 24 +++++++ ..._settings.field_config_checkout_optins.yml | 24 +++++++ ...tings.field_config_checkout_page_title.yml | 21 +++++++ ..._settings.field_config_checkout_step_1.yml | 21 +++++++ ..._settings.field_config_checkout_step_2.yml | 21 +++++++ ...nfig_pages.field_config_checkout_cards.yml | 19 ++++++ ...fig_pages.field_config_checkout_optins.yml | 19 ++++++ ...pages.field_config_checkout_page_title.yml | 21 +++++++ ...fig_pages.field_config_checkout_step_1.yml | 21 +++++++ ...fig_pages.field_config_checkout_step_2.yml | 21 +++++++ .../CheckoutCardsContainer/index.js | 17 +++-- .../CheckoutContainer/gb/CheckoutContainer.js | 13 ++-- .../gb/CheckoutFormOptins.js | 10 ++- .../CheckoutContainer/ie/CheckoutContainer.js | 13 ++-- .../ie/CheckoutFormOptins.js | 10 ++- .../src/views/CheckoutView/index.js | 17 +++-- 18 files changed, 374 insertions(+), 24 deletions(-) create mode 100644 backend-gifts/config/sync/field.field.config_pages.site_content_settings.field_config_checkout_cards.yml create mode 100644 backend-gifts/config/sync/field.field.config_pages.site_content_settings.field_config_checkout_optins.yml create mode 100644 backend-gifts/config/sync/field.field.config_pages.site_content_settings.field_config_checkout_page_title.yml create mode 100644 backend-gifts/config/sync/field.field.config_pages.site_content_settings.field_config_checkout_step_1.yml create mode 100644 backend-gifts/config/sync/field.field.config_pages.site_content_settings.field_config_checkout_step_2.yml create mode 100644 backend-gifts/config/sync/field.storage.config_pages.field_config_checkout_cards.yml create mode 100644 backend-gifts/config/sync/field.storage.config_pages.field_config_checkout_optins.yml create mode 100644 backend-gifts/config/sync/field.storage.config_pages.field_config_checkout_page_title.yml create mode 100644 backend-gifts/config/sync/field.storage.config_pages.field_config_checkout_step_1.yml create mode 100644 backend-gifts/config/sync/field.storage.config_pages.field_config_checkout_step_2.yml diff --git a/backend-gifts/config/sync/core.entity_form_display.config_pages.site_content_settings.default.yml b/backend-gifts/config/sync/core.entity_form_display.config_pages.site_content_settings.default.yml index 509841a..0faa607 100644 --- a/backend-gifts/config/sync/core.entity_form_display.config_pages.site_content_settings.default.yml +++ b/backend-gifts/config/sync/core.entity_form_display.config_pages.site_content_settings.default.yml @@ -4,6 +4,11 @@ status: true dependencies: config: - config_pages.type.site_content_settings + - field.field.config_pages.site_content_settings.field_config_checkout_cards + - field.field.config_pages.site_content_settings.field_config_checkout_optins + - field.field.config_pages.site_content_settings.field_config_checkout_page_title + - field.field.config_pages.site_content_settings.field_config_checkout_step_1 + - field.field.config_pages.site_content_settings.field_config_checkout_step_2 - field.field.config_pages.site_content_settings.field_config_contact_us_address - field.field.config_pages.site_content_settings.field_config_corporate_images - field.field.config_pages.site_content_settings.field_config_corporate_labels @@ -68,6 +73,7 @@ third_party_settings: - group_config_front_page - group_config_contact_us_page - group_corporate_gifts + - group_checkout parent_name: '' weight: 0 format_type: tabs @@ -103,11 +109,68 @@ third_party_settings: description: '' required_fields: true label: 'How Gifts Work section' + group_checkout: + children: + - field_config_checkout_page_title + - field_config_checkout_step_1 + - field_config_checkout_optins + - field_config_checkout_step_2 + - field_config_checkout_cards + parent_name: group_config_tabs + weight: 5 + format_type: tab + format_settings: + id: '' + classes: '' + formatter: closed + description: '' + required_fields: true + label: Checkout id: config_pages.site_content_settings.default targetEntityType: config_pages bundle: site_content_settings mode: default content: + field_config_checkout_cards: + weight: 10 + settings: + rows: 5 + placeholder: '' + third_party_settings: { } + type: text_textarea + region: content + field_config_checkout_optins: + weight: 8 + settings: + rows: 5 + placeholder: '' + third_party_settings: { } + type: text_textarea + region: content + field_config_checkout_page_title: + weight: 6 + settings: + size: 60 + placeholder: '' + third_party_settings: { } + type: string_textfield + region: content + field_config_checkout_step_1: + weight: 7 + settings: + size: 60 + placeholder: '' + third_party_settings: { } + type: string_textfield + region: content + field_config_checkout_step_2: + weight: 9 + settings: + size: 60 + placeholder: '' + third_party_settings: { } + type: string_textfield + region: content field_config_contact_us_address: weight: 5 settings: diff --git a/backend-gifts/config/sync/core.entity_view_display.config_pages.site_content_settings.default.yml b/backend-gifts/config/sync/core.entity_view_display.config_pages.site_content_settings.default.yml index 38ba76d..d074f4b 100644 --- a/backend-gifts/config/sync/core.entity_view_display.config_pages.site_content_settings.default.yml +++ b/backend-gifts/config/sync/core.entity_view_display.config_pages.site_content_settings.default.yml @@ -4,6 +4,11 @@ status: true dependencies: config: - config_pages.type.site_content_settings + - field.field.config_pages.site_content_settings.field_config_checkout_cards + - field.field.config_pages.site_content_settings.field_config_checkout_optins + - field.field.config_pages.site_content_settings.field_config_checkout_page_title + - field.field.config_pages.site_content_settings.field_config_checkout_step_1 + - field.field.config_pages.site_content_settings.field_config_checkout_step_2 - field.field.config_pages.site_content_settings.field_config_contact_us_address - field.field.config_pages.site_content_settings.field_config_corporate_images - field.field.config_pages.site_content_settings.field_config_corporate_labels @@ -20,6 +25,44 @@ targetEntityType: config_pages bundle: site_content_settings mode: default content: + field_config_checkout_cards: + weight: 13 + label: above + settings: { } + third_party_settings: { } + type: text_default + region: content + field_config_checkout_optins: + weight: 12 + label: above + settings: { } + third_party_settings: { } + type: text_default + region: content + field_config_checkout_page_title: + weight: 9 + label: above + settings: + link_to_entity: false + third_party_settings: { } + type: string + region: content + field_config_checkout_step_1: + weight: 10 + label: above + settings: + link_to_entity: false + third_party_settings: { } + type: string + region: content + field_config_checkout_step_2: + weight: 11 + label: above + settings: + link_to_entity: false + third_party_settings: { } + type: string + region: content field_config_contact_us_address: weight: 4 label: above diff --git a/backend-gifts/config/sync/field.field.config_pages.site_content_settings.field_config_checkout_cards.yml b/backend-gifts/config/sync/field.field.config_pages.site_content_settings.field_config_checkout_cards.yml new file mode 100644 index 0000000..931ebdc --- /dev/null +++ b/backend-gifts/config/sync/field.field.config_pages.site_content_settings.field_config_checkout_cards.yml @@ -0,0 +1,24 @@ +uuid: 4d1e1402-5f73-45b5-b5f0-1ff1647e7a47 +langcode: en +status: true +dependencies: + config: + - config_pages.type.site_content_settings + - field.storage.config_pages.field_config_checkout_cards + module: + - text +id: config_pages.site_content_settings.field_config_checkout_cards +field_name: field_config_checkout_cards +entity_type: config_pages +bundle: site_content_settings +label: 'Cards description' +description: 'Description for the Cards section.' +required: false +translatable: false +default_value: + - + value: "

Each gift comes with either an e-card or a postal card. All you have to do is choose which one you want your relative or friend to receive. If you choose to send an e-card, we’ll send it directly on your behalf. If you would prefer to give a postal card, we will post it to you and you’ll be able to deliver it in person.

\r\n" + format: basic_html +default_value_callback: '' +settings: { } +field_type: text_long diff --git a/backend-gifts/config/sync/field.field.config_pages.site_content_settings.field_config_checkout_optins.yml b/backend-gifts/config/sync/field.field.config_pages.site_content_settings.field_config_checkout_optins.yml new file mode 100644 index 0000000..193d670 --- /dev/null +++ b/backend-gifts/config/sync/field.field.config_pages.site_content_settings.field_config_checkout_optins.yml @@ -0,0 +1,24 @@ +uuid: 388a2a24-c8b9-4d58-be29-4573d599ed84 +langcode: en +status: true +dependencies: + config: + - config_pages.type.site_content_settings + - field.storage.config_pages.field_config_checkout_optins + module: + - text +id: config_pages.site_content_settings.field_config_checkout_optins +field_name: field_config_checkout_optins +entity_type: config_pages +bundle: site_content_settings +label: 'Opt-ins Description' +description: 'Description for the Opt-ins section.' +required: false +translatable: false +default_value: + - + value: "

We would love to keep you updated about our work and let you know how you can continue to help changing lives. Please tick the boxes below to confirm that we can contact you by:

\r\n" + format: basic_html +default_value_callback: '' +settings: { } +field_type: text_long diff --git a/backend-gifts/config/sync/field.field.config_pages.site_content_settings.field_config_checkout_page_title.yml b/backend-gifts/config/sync/field.field.config_pages.site_content_settings.field_config_checkout_page_title.yml new file mode 100644 index 0000000..f7e1780 --- /dev/null +++ b/backend-gifts/config/sync/field.field.config_pages.site_content_settings.field_config_checkout_page_title.yml @@ -0,0 +1,21 @@ +uuid: b3e1dff7-ef5d-4659-be62-693ffe239629 +langcode: en +status: true +dependencies: + config: + - config_pages.type.site_content_settings + - field.storage.config_pages.field_config_checkout_page_title +id: config_pages.site_content_settings.field_config_checkout_page_title +field_name: field_config_checkout_page_title +entity_type: config_pages +bundle: site_content_settings +label: 'Page title' +description: '' +required: true +translatable: false +default_value: + - + value: 'Checkout and save lives' +default_value_callback: '' +settings: { } +field_type: string diff --git a/backend-gifts/config/sync/field.field.config_pages.site_content_settings.field_config_checkout_step_1.yml b/backend-gifts/config/sync/field.field.config_pages.site_content_settings.field_config_checkout_step_1.yml new file mode 100644 index 0000000..47df01d --- /dev/null +++ b/backend-gifts/config/sync/field.field.config_pages.site_content_settings.field_config_checkout_step_1.yml @@ -0,0 +1,21 @@ +uuid: 13dbee6b-9a5b-4136-8fa7-3866635b8eba +langcode: en +status: true +dependencies: + config: + - config_pages.type.site_content_settings + - field.storage.config_pages.field_config_checkout_step_1 +id: config_pages.site_content_settings.field_config_checkout_step_1 +field_name: field_config_checkout_step_1 +entity_type: config_pages +bundle: site_content_settings +label: 'Step 1 Subheader' +description: '' +required: false +translatable: false +default_value: + - + value: 'Step 1 - Enter your personal details' +default_value_callback: '' +settings: { } +field_type: string diff --git a/backend-gifts/config/sync/field.field.config_pages.site_content_settings.field_config_checkout_step_2.yml b/backend-gifts/config/sync/field.field.config_pages.site_content_settings.field_config_checkout_step_2.yml new file mode 100644 index 0000000..715ab57 --- /dev/null +++ b/backend-gifts/config/sync/field.field.config_pages.site_content_settings.field_config_checkout_step_2.yml @@ -0,0 +1,21 @@ +uuid: 8e000fdd-ee47-4dd9-887c-a1b3d5e2d9be +langcode: en +status: true +dependencies: + config: + - config_pages.type.site_content_settings + - field.storage.config_pages.field_config_checkout_step_2 +id: config_pages.site_content_settings.field_config_checkout_step_2 +field_name: field_config_checkout_step_2 +entity_type: config_pages +bundle: site_content_settings +label: 'Step 2 Subheader' +description: '' +required: false +translatable: false +default_value: + - + value: 'Step 2 - Choose a card to go with your gifts' +default_value_callback: '' +settings: { } +field_type: string diff --git a/backend-gifts/config/sync/field.storage.config_pages.field_config_checkout_cards.yml b/backend-gifts/config/sync/field.storage.config_pages.field_config_checkout_cards.yml new file mode 100644 index 0000000..20db49d --- /dev/null +++ b/backend-gifts/config/sync/field.storage.config_pages.field_config_checkout_cards.yml @@ -0,0 +1,19 @@ +uuid: 1aa67cf5-e850-49ad-8a0c-086f8130fcd9 +langcode: en +status: true +dependencies: + module: + - config_pages + - text +id: config_pages.field_config_checkout_cards +field_name: field_config_checkout_cards +entity_type: config_pages +type: text_long +settings: { } +module: text +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/backend-gifts/config/sync/field.storage.config_pages.field_config_checkout_optins.yml b/backend-gifts/config/sync/field.storage.config_pages.field_config_checkout_optins.yml new file mode 100644 index 0000000..0769acd --- /dev/null +++ b/backend-gifts/config/sync/field.storage.config_pages.field_config_checkout_optins.yml @@ -0,0 +1,19 @@ +uuid: e7b68da3-b25b-493a-b054-781e85117a84 +langcode: en +status: true +dependencies: + module: + - config_pages + - text +id: config_pages.field_config_checkout_optins +field_name: field_config_checkout_optins +entity_type: config_pages +type: text_long +settings: { } +module: text +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/backend-gifts/config/sync/field.storage.config_pages.field_config_checkout_page_title.yml b/backend-gifts/config/sync/field.storage.config_pages.field_config_checkout_page_title.yml new file mode 100644 index 0000000..de89451 --- /dev/null +++ b/backend-gifts/config/sync/field.storage.config_pages.field_config_checkout_page_title.yml @@ -0,0 +1,21 @@ +uuid: 7e742497-aacb-4f67-b093-dc11782d0342 +langcode: en +status: true +dependencies: + module: + - config_pages +id: config_pages.field_config_checkout_page_title +field_name: field_config_checkout_page_title +entity_type: config_pages +type: string +settings: + max_length: 255 + is_ascii: false + case_sensitive: false +module: core +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/backend-gifts/config/sync/field.storage.config_pages.field_config_checkout_step_1.yml b/backend-gifts/config/sync/field.storage.config_pages.field_config_checkout_step_1.yml new file mode 100644 index 0000000..3e2966f --- /dev/null +++ b/backend-gifts/config/sync/field.storage.config_pages.field_config_checkout_step_1.yml @@ -0,0 +1,21 @@ +uuid: 8d995f7f-147f-4b8b-9174-9e51dcec6089 +langcode: en +status: true +dependencies: + module: + - config_pages +id: config_pages.field_config_checkout_step_1 +field_name: field_config_checkout_step_1 +entity_type: config_pages +type: string +settings: + max_length: 255 + is_ascii: false + case_sensitive: false +module: core +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/backend-gifts/config/sync/field.storage.config_pages.field_config_checkout_step_2.yml b/backend-gifts/config/sync/field.storage.config_pages.field_config_checkout_step_2.yml new file mode 100644 index 0000000..1cd3dcf --- /dev/null +++ b/backend-gifts/config/sync/field.storage.config_pages.field_config_checkout_step_2.yml @@ -0,0 +1,21 @@ +uuid: ee306d19-af7d-47a1-b7db-eced2b1f0d13 +langcode: en +status: true +dependencies: + module: + - config_pages +id: config_pages.field_config_checkout_step_2 +field_name: field_config_checkout_step_2 +entity_type: config_pages +type: string +settings: + max_length: 255 + is_ascii: false + case_sensitive: false +module: core +locked: false +cardinality: 1 +translatable: true +indexes: { } +persist_with_no_fields: false +custom_storage: false diff --git a/frontend-gifts/src/containers/CheckoutCardsContainer/index.js b/frontend-gifts/src/containers/CheckoutCardsContainer/index.js index 15b5105..9f06402 100644 --- a/frontend-gifts/src/containers/CheckoutCardsContainer/index.js +++ b/frontend-gifts/src/containers/CheckoutCardsContainer/index.js @@ -60,7 +60,7 @@ class CheckoutCardsContainer extends Component { } render() { - const { basketType, cardItems, dispatch } = this.props; + const { basketType, cardItems, dispatch, siteContentSettings } = this.props; // Do not render pane for corporate gifts. if (basketType !== 'gift' || cardItems.length === 0) { @@ -69,10 +69,12 @@ class CheckoutCardsContainer extends Component { return ( -

Step 2 - Choose a card to go with your gifts

-

- Each gift comes with either an e-card or a postal card. All you have to do is choose which one you want your relative or friend to receive. If you choose to send an e-card, we’ll send it directly on your behalf. If you would prefer to give a postal card, we will post it to you and you’ll be able to deliver it in person. -

+ {siteContentSettings.fieldConfigCheckoutStep2 && +

{siteContentSettings.fieldConfigCheckoutStep2}

+ } + {siteContentSettings.fieldConfigCheckoutCards && siteContentSettings.fieldConfigCheckoutCards.value && +

+ } @@ -93,6 +95,7 @@ CheckoutCardsContainer.propTypes = { basketType: PropTypes.string, cardItems: PropTypes.array, dispatch: PropTypes.func, + siteContentSettings: PropTypes.object.isRequired, }; const mapStateToProps = state => ({ @@ -105,7 +108,9 @@ const mapStateToProps = state => ({ orderUuid: state.checkout.order.order_uuid, // Data from profile form is used in E-Card preview. senderFirstName: state.checkout.form.profile.formData.field_profile_first_name, - senderLastName: state.checkout.form.profile.formData.field_profile_last_name + senderLastName: state.checkout.form.profile.formData.field_profile_last_name, + dispatch: PropTypes.func, + siteContentSettings: state.siteContentSettings.data }); export default connect(mapStateToProps)(CheckoutCardsContainer); diff --git a/frontend-gifts/src/containers/CheckoutContainer/gb/CheckoutContainer.js b/frontend-gifts/src/containers/CheckoutContainer/gb/CheckoutContainer.js index d33dd9a..b5d6a9f 100644 --- a/frontend-gifts/src/containers/CheckoutContainer/gb/CheckoutContainer.js +++ b/frontend-gifts/src/containers/CheckoutContainer/gb/CheckoutContainer.js @@ -69,7 +69,8 @@ class CheckoutContainer extends Component { showErrors, orderId, eventcodes, - processing + processing, + siteContentSettings } = this.props; if (showThankYouPage) { @@ -91,7 +92,9 @@ class CheckoutContainer extends Component { if (eventcodes.isFulfilled && eventcodes.codes.length) { return (

-

Step 1 - Enter your personal details

+ {siteContentSettings.fieldConfigCheckoutStep1 && +

{siteContentSettings.fieldConfigCheckoutStep1}

+ } {/* Different parts of the form are controlled by this container and built on top of CheckoutFormContainer */} } - + {showCards && /* Card container is special case. It manages everything related to cards. */ @@ -137,6 +140,7 @@ CheckoutContainer.propTypes = { showThankYouPage: PropTypes.bool.isRequired, orderId: PropTypes.string.isRequired, eventcodes: PropTypes.object.isRequired, + siteContentSettings: PropTypes.object.isRequired, showErrors: PropTypes.bool.isRequired, processing: PropTypes.bool.isRequired, isEmpty: PropTypes.bool.isRequired, @@ -153,7 +157,8 @@ const mapStateToProps = state => ({ showErrors: state.checkout.showErrors, orderId: state.checkout.order.order_id, eventcodes: state.eventcodes, - processing: state.checkout.processing + processing: state.checkout.processing, + siteContentSettings: state.siteContentSettings.data, }); diff --git a/frontend-gifts/src/containers/CheckoutContainer/gb/CheckoutFormOptins.js b/frontend-gifts/src/containers/CheckoutContainer/gb/CheckoutFormOptins.js index 7c1529c..42cdce3 100644 --- a/frontend-gifts/src/containers/CheckoutContainer/gb/CheckoutFormOptins.js +++ b/frontend-gifts/src/containers/CheckoutContainer/gb/CheckoutFormOptins.js @@ -36,14 +36,17 @@ class CheckoutFormOptins extends Component { } render() { + const { description, onFormValidate } = this.props; return ( -

We’d love to keep you updated about how your generous support is making a difference to our vital work tackling hunger and how you can help transform more lives through campaigning and appeals. We always keep your details safe and we never pass them on to other organisations. You can change your preferences at any time.

+ {description && +

+ } @@ -53,7 +56,8 @@ class CheckoutFormOptins extends Component { } CheckoutFormOptins.propTypes = { - onFormValidate: PropTypes.func.isRequired + onFormValidate: PropTypes.func.isRequired, + description: PropTypes.string }; export default CheckoutFormOptins; diff --git a/frontend-gifts/src/containers/CheckoutContainer/ie/CheckoutContainer.js b/frontend-gifts/src/containers/CheckoutContainer/ie/CheckoutContainer.js index fc633fa..8005aad 100644 --- a/frontend-gifts/src/containers/CheckoutContainer/ie/CheckoutContainer.js +++ b/frontend-gifts/src/containers/CheckoutContainer/ie/CheckoutContainer.js @@ -62,7 +62,8 @@ class CheckoutContainer extends Component { showErrors, orderId, eventcodes, - processing + processing, + siteContentSettings } = this.props; if (showThankYouPage) { @@ -84,7 +85,9 @@ class CheckoutContainer extends Component { if (eventcodes.isFulfilled && eventcodes.codes.length) { return (

-

Step 1 - Enter your personal details

+ {siteContentSettings.fieldConfigCheckoutStep1 && +

{siteContentSettings.fieldConfigCheckoutStep1}

+ } {/* Different parts of the form are controlled by this container and built on top of CheckoutFormContainer */} } - + {showCards && /* Card container is special case. It manages everything related to cards. */ @@ -129,6 +132,7 @@ CheckoutContainer.propTypes = { showThankYouPage: PropTypes.bool.isRequired, orderId: PropTypes.string.isRequired, eventcodes: PropTypes.object.isRequired, + siteContentSettings: PropTypes.object.isRequired, showErrors: PropTypes.bool.isRequired, processing: PropTypes.bool.isRequired, isEmpty: PropTypes.bool.isRequired, @@ -145,7 +149,8 @@ const mapStateToProps = state => ({ showErrors: state.checkout.showErrors, orderId: state.checkout.order.order_id, eventcodes: state.eventcodes, - processing: state.checkout.processing + processing: state.checkout.processing, + siteContentSettings: state.siteContentSettings.data, }); diff --git a/frontend-gifts/src/containers/CheckoutContainer/ie/CheckoutFormOptins.js b/frontend-gifts/src/containers/CheckoutContainer/ie/CheckoutFormOptins.js index 2d8dc1e..44fe4bf 100644 --- a/frontend-gifts/src/containers/CheckoutContainer/ie/CheckoutFormOptins.js +++ b/frontend-gifts/src/containers/CheckoutContainer/ie/CheckoutFormOptins.js @@ -34,14 +34,17 @@ class CheckoutFormOptins extends Component { } render() { + const { description, onFormValidate } = this.props; return ( -

We would love to keep you updated about our work and let you know how you can continue to help changing lives. Please tick the boxes below to confirm that we can contact you by:

+ {description && +

+ } @@ -51,7 +54,8 @@ class CheckoutFormOptins extends Component { } CheckoutFormOptins.propTypes = { - onFormValidate: PropTypes.func.isRequired + onFormValidate: PropTypes.func.isRequired, + description: PropTypes.string }; export default CheckoutFormOptins; diff --git a/frontend-gifts/src/views/CheckoutView/index.js b/frontend-gifts/src/views/CheckoutView/index.js index cc5e1d8..12562c7 100644 --- a/frontend-gifts/src/views/CheckoutView/index.js +++ b/frontend-gifts/src/views/CheckoutView/index.js @@ -1,4 +1,5 @@ -import React from 'react'; +import React, { PropTypes } from 'react'; +import { connect } from 'react-redux'; import Sticky from 'react-stickynode'; import { Grid, Col, Row } from 'react-bootstrap'; import Metatags from '../../components/Metatags'; @@ -6,13 +7,13 @@ import CheckoutContainer from '../../containers/CheckoutContainer'; import CheckoutBasketSummary from '../../containers/CheckoutBasketSummary'; import CheckoutPaymentContainer from '../../containers/CheckoutPaymentContainer'; -const CheckoutView = () => ( +const CheckoutView = ({ siteContentSettings }) => (

- Checkout and save lives + {siteContentSettings.fieldConfigCheckoutPageTitle}

@@ -35,4 +36,12 @@ const CheckoutView = () => (
); -export default CheckoutView; +CheckoutView.propTypes = { + siteContentSettings: PropTypes.object.isRequired, +}; + +const mapStateToProps = state => ({ + siteContentSettings: state.siteContentSettings.data, +}); + +export default connect(mapStateToProps)(CheckoutView);