diff --git a/components/x-gift-article/readme.md b/components/x-gift-article/readme.md index 568d2bec0..66d837a28 100644 --- a/components/x-gift-article/readme.md +++ b/components/x-gift-article/readme.md @@ -81,5 +81,3 @@ Property | Type | Required | Note `apiDomain` | String | no | The domain to use when making requests to the gift article and URL shortening services. `enterpriseApiBaseUrl` | String | no | The base URL to use when making requests to the enterprise sharing service. -### -`isArticleSharingUxUpdates` boolean has been added as part of ACC-749 to enable AB testing of the impact of minor UX improvements to x-gift-article. Once AB testing is done, and decision to keep / remove has been made, the changes made in https://github.com/Financial-Times/x-dash/pull/579 need to be ditched or baked in as default. diff --git a/components/x-gift-article/src/CopyConfirmation.jsx b/components/x-gift-article/src/CopyConfirmation.jsx index a111606f5..39e5bd2cd 100644 --- a/components/x-gift-article/src/CopyConfirmation.jsx +++ b/components/x-gift-article/src/CopyConfirmation.jsx @@ -1,6 +1,6 @@ import { h } from '@financial-times/x-engine' -export default ({ hideCopyConfirmation, isArticleSharingUxUpdates }) => ( +export default ({ hideCopyConfirmation }) => (
(

- {isArticleSharingUxUpdates ? ( - The link has been copied to your clipboard - ) : ( - The link has been copied to your clipboard - )} + The link has been copied to your clipboard

diff --git a/components/x-gift-article/src/Form.jsx b/components/x-gift-article/src/Form.jsx index 29c8e3315..48f908b2d 100644 --- a/components/x-gift-article/src/Form.jsx +++ b/components/x-gift-article/src/Form.jsx @@ -11,11 +11,10 @@ export default (props) => (
- + <Title title={props.title} /> <RadioButtonsSection shareType={props.shareType} - isArticleSharingUxUpdates={props.isArticleSharingUxUpdates} showGiftUrlSection={props.actions.showGiftUrlSection} showEnterpriseUrlSection={props.actions.showEnterpriseUrlSection} showNonGiftUrlSection={props.actions.showNonGiftUrlSection} @@ -44,10 +43,7 @@ export default (props) => ( </form> {props.showCopyConfirmation && ( - <CopyConfirmation - hideCopyConfirmation={props.actions.hideCopyConfirmation} - isArticleSharingUxUpdates={props.isArticleSharingUxUpdates} - /> + <CopyConfirmation hideCopyConfirmation={props.actions.hideCopyConfirmation} /> )} {props.shareType === ShareType.enterprise && !props.enterpriseFirstTimeUser && ( diff --git a/components/x-gift-article/src/GiftArticle.jsx b/components/x-gift-article/src/GiftArticle.jsx index 5f6c17e4c..afd065cd1 100644 --- a/components/x-gift-article/src/GiftArticle.jsx +++ b/components/x-gift-article/src/GiftArticle.jsx @@ -14,9 +14,6 @@ import { ShareType } from './lib/constants' const isCopySupported = typeof document !== 'undefined' && document.queryCommandSupported && document.queryCommandSupported('copy') -const todayDate = new Date() -const monthNow = `${updaters.monthNames[todayDate.getMonth()]}` - const withGiftFormActions = withActions( (initialProps) => { const api = new ApiClient({ @@ -237,12 +234,10 @@ const withGiftFormActions = withActions( title: 'Share this article', giftCredits: undefined, monthlyAllowance: undefined, - monthNow: monthNow, showCopyButton: isCopySupported, isGiftUrlCreated: false, isGiftUrlShortened: false, isNonGiftUrlShortened: false, - isArticleSharingUxUpdates: false, includeHighlights: false, hasHighlights: false, showHighlightsRecipientMessage: new URL(location.href).searchParams.has('highlights'), diff --git a/components/x-gift-article/src/Message.jsx b/components/x-gift-article/src/Message.jsx index 8ca29dddd..b67cdbdd9 100644 --- a/components/x-gift-article/src/Message.jsx +++ b/components/x-gift-article/src/Message.jsx @@ -10,45 +10,11 @@ export default ({ nextRenewalDateText, redemptionLimit, invalidResponseFromApi, - isArticleSharingUxUpdates, enterpriseLimit, enterpriseHasCredits, enterpriseRequestAccess, enterpriseFirstTimeUser }) => { - if (isArticleSharingUxUpdates) { - if (isFreeArticle) { - return null - } - - if (shareType === ShareType.gift) { - if (giftCredits === 0) { - return ( - <div className="x-gift-article-message"> - You’ve used all your <strong>gift article credits</strong> - <br /> - You’ll get your next {monthlyAllowance} on <strong>{nextRenewalDateText}</strong> - </div> - ) - } - - if (invalidResponseFromApi) { - return ( - <div className="x-gift-article-message">Unable to fetch gift credits. Please try again later</div> - ) - } - - return ( - <div className="x-gift-article-message"> - A gift link can be opened up to <strong>{redemptionLimit ? redemptionLimit : 3} times</strong> - </div> - ) - } - - if (shareType === ShareType.nonGift) { - return <div className="x-gift-article-message">This link can only be read by existing subscribers</div> - } - } if (shareType === ShareType.gift) { if (giftCredits === 0) { diff --git a/components/x-gift-article/src/Title.jsx b/components/x-gift-article/src/Title.jsx index 5f70e3ebc..1c75afb16 100644 --- a/components/x-gift-article/src/Title.jsx +++ b/components/x-gift-article/src/Title.jsx @@ -1,32 +1,9 @@ import { h } from '@financial-times/x-engine' -export default ({ - giftCredits, - monthlyAllowance, - monthNow, - isFreeArticle, - isArticleSharingUxUpdates, - title = '' -}) => { - if (isArticleSharingUxUpdates) { - if (title !== 'Share on Social') { - if (isFreeArticle) { - title = 'This article is free for anyone to read' - } else { - title = `You have ${giftCredits} out of ${monthlyAllowance} gift credits left in ${monthNow}` - } - } - - return ( - <h2 className="x-gift-article__title" id="gift-article-title"> - {title} - </h2> - ) - } else { - return ( - <h2 className="x-gift-article__title" id="gift-article-title"> - {title} - </h2> - ) - } +export default ({ title = '' }) => { + return ( + <h2 className="x-gift-article__title" id="gift-article-title"> + {title} + </h2> + ) } diff --git a/components/x-gift-article/src/UrlSection.jsx b/components/x-gift-article/src/UrlSection.jsx index 661abf644..a8acd8d9f 100644 --- a/components/x-gift-article/src/UrlSection.jsx +++ b/components/x-gift-article/src/UrlSection.jsx @@ -18,7 +18,6 @@ export default ({ showCopyButton, nativeShare, invalidResponseFromApi, - isArticleSharingUxUpdates, actions, enterpriseLimit, enterpriseHasCredits, @@ -58,7 +57,6 @@ export default ({ nextRenewalDateText, redemptionLimit, invalidResponseFromApi, - isArticleSharingUxUpdates, enterpriseHasCredits, enterpriseLimit, enterpriseRequestAccess, diff --git a/package-lock.json b/package-lock.json index c86b4ab67..738e9d8ae 100644 --- a/package-lock.json +++ b/package-lock.json @@ -124,7 +124,7 @@ "@financial-times/o-loading": "^5.2.1", "@financial-times/o-message": "^5.2.1", "@financial-times/o-normalise": "^3.2.2", - "@financial-times/o-typography": "^7.2.2", + "@financial-times/o-typography": "^7.4.1", "@financial-times/x-rollup": "file:../../packages/x-rollup", "check-engine": "^1.10.1", "sass": "^1.49.0" @@ -134,13 +134,15 @@ "npm": "7.x || 8.x" }, "peerDependencies": { + "@financial-times/o-banner": "^4.4.9", "@financial-times/o-buttons": "^7.2.2", + "@financial-times/o-colors": "^6.6.0", "@financial-times/o-forms": "^9.2.3", "@financial-times/o-labels": "^6.2.2", "@financial-times/o-loading": "^5.2.1", "@financial-times/o-message": "^5.2.1", "@financial-times/o-normalise": "^3.2.2", - "@financial-times/o-typography": "^7.2.2" + "@financial-times/o-typography": "^7.4.1" } }, "components/x-increment": { @@ -2549,6 +2551,25 @@ "@financial-times/o-typography": "^7.0.3" } }, + "node_modules/@financial-times/o-banner": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/@financial-times/o-banner/-/o-banner-4.5.0.tgz", + "integrity": "sha512-f9wRIgwfElK0mYoMbpeqBByAnQkj8yHTBZBqDphP1zZUwR4Hi/rDpl7k45ppdCJQrA+ym7ludPu4kZJNN7LUEg==", + "peer": true, + "engines": { + "npm": "^7 || ^8" + }, + "peerDependencies": { + "@financial-times/math": "^1.0.0", + "@financial-times/o-buttons": "^7.8.0", + "@financial-times/o-colors": "^6.5.0", + "@financial-times/o-grid": "^6.0.0", + "@financial-times/o-icons": "^7.0.1", + "@financial-times/o-spacing": "^3.0.0", + "@financial-times/o-typography": "^7.0.1", + "@financial-times/o-visual-effects": "^4.0.1" + } + }, "node_modules/@financial-times/o-brand": { "version": "4.2.1", "license": "MIT", @@ -2558,23 +2579,24 @@ } }, "node_modules/@financial-times/o-buttons": { - "version": "7.7.5", - "dev": true, - "license": "MIT", + "version": "7.8.1", + "resolved": "https://registry.npmjs.org/@financial-times/o-buttons/-/o-buttons-7.8.1.tgz", + "integrity": "sha512-GVx1sujFKbBwwZQZbMbHxRZLLjNRYXpXOcENOzx7Lz+RdY0Vg22gHOdxJQy09y13yI/BLn4Jy9nccwC7VYqpaA==", "engines": { "npm": "^7 || ^8" }, "peerDependencies": { "@financial-times/o-brand": "^4.1.0", - "@financial-times/o-colors": "^6.0.1", + "@financial-times/o-colors": "^6.5.0", "@financial-times/o-icons": "^7.0.0", "@financial-times/o-normalise": "^3.3.0", "@financial-times/o-typography": "^7.0.1" } }, "node_modules/@financial-times/o-colors": { - "version": "6.4.4", - "license": "MIT", + "version": "6.6.1", + "resolved": "https://registry.npmjs.org/@financial-times/o-colors/-/o-colors-6.6.1.tgz", + "integrity": "sha512-56eCyczA4ZlaKyIg5CVaSPtuvhT1gwY9D/S0S7LGrhJAOiVI0nMc5EZdWz9GCCsrvAWXNDZhh+giM5tz3Bg/vQ==", "engines": { "npm": "^7 || ^8" }, @@ -2845,8 +2867,9 @@ } }, "node_modules/@financial-times/o-typography": { - "version": "7.3.4", - "license": "MIT", + "version": "7.4.1", + "resolved": "https://registry.npmjs.org/@financial-times/o-typography/-/o-typography-7.4.1.tgz", + "integrity": "sha512-4Qe7FVYX68wztHzUdjsdU/PK0pmS3bCYXwcYa1SIwiulIujfzOXiFjUMWQ1juLwoVZa6BWOWMtOQN5RQWQ69rA==", "dependencies": { "fontfaceobserver": "^2.0.9" }, @@ -2855,7 +2878,7 @@ }, "peerDependencies": { "@financial-times/math": "^1.0.0", - "@financial-times/o-colors": "^6.0.1", + "@financial-times/o-colors": "^6.6.0", "@financial-times/o-fonts": "^5.0.0", "@financial-times/o-grid": "^6.1.1", "@financial-times/o-icons": "^7.0.0", @@ -2890,7 +2913,6 @@ "version": "4.2.0", "resolved": "https://registry.npmjs.org/@financial-times/o-visual-effects/-/o-visual-effects-4.2.0.tgz", "integrity": "sha512-lP4weMLDcdu+GkC6RL8vWL3GjtOAZGTKYJkQhRMv3jrnko/Wtw8Ghn/gjR9VSZoAO1FWzuU2063C5T8iKk429g==", - "dev": true, "peer": true, "engines": { "npm": "^7 || ^8" @@ -28573,17 +28595,27 @@ "peer": true, "requires": {} }, + "@financial-times/o-banner": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/@financial-times/o-banner/-/o-banner-4.5.0.tgz", + "integrity": "sha512-f9wRIgwfElK0mYoMbpeqBByAnQkj8yHTBZBqDphP1zZUwR4Hi/rDpl7k45ppdCJQrA+ym7ludPu4kZJNN7LUEg==", + "peer": true, + "requires": {} + }, "@financial-times/o-brand": { "version": "4.2.1", "peer": true }, "@financial-times/o-buttons": { - "version": "7.7.5", - "dev": true, + "version": "7.8.1", + "resolved": "https://registry.npmjs.org/@financial-times/o-buttons/-/o-buttons-7.8.1.tgz", + "integrity": "sha512-GVx1sujFKbBwwZQZbMbHxRZLLjNRYXpXOcENOzx7Lz+RdY0Vg22gHOdxJQy09y13yI/BLn4Jy9nccwC7VYqpaA==", "requires": {} }, "@financial-times/o-colors": { - "version": "6.4.4", + "version": "6.6.1", + "resolved": "https://registry.npmjs.org/@financial-times/o-colors/-/o-colors-6.6.1.tgz", + "integrity": "sha512-56eCyczA4ZlaKyIg5CVaSPtuvhT1gwY9D/S0S7LGrhJAOiVI0nMc5EZdWz9GCCsrvAWXNDZhh+giM5tz3Bg/vQ==", "requires": {} }, "@financial-times/o-editorial-typography": { @@ -28694,7 +28726,9 @@ } }, "@financial-times/o-typography": { - "version": "7.3.4", + "version": "7.4.1", + "resolved": "https://registry.npmjs.org/@financial-times/o-typography/-/o-typography-7.4.1.tgz", + "integrity": "sha512-4Qe7FVYX68wztHzUdjsdU/PK0pmS3bCYXwcYa1SIwiulIujfzOXiFjUMWQ1juLwoVZa6BWOWMtOQN5RQWQ69rA==", "requires": { "fontfaceobserver": "^2.0.9" } @@ -28718,7 +28752,6 @@ "version": "4.2.0", "resolved": "https://registry.npmjs.org/@financial-times/o-visual-effects/-/o-visual-effects-4.2.0.tgz", "integrity": "sha512-lP4weMLDcdu+GkC6RL8vWL3GjtOAZGTKYJkQhRMv3jrnko/Wtw8Ghn/gjR9VSZoAO1FWzuU2063C5T8iKk429g==", - "dev": true, "peer": true, "requires": {} }, @@ -28781,7 +28814,7 @@ "@financial-times/o-loading": "^5.2.1", "@financial-times/o-message": "^5.2.1", "@financial-times/o-normalise": "^3.2.2", - "@financial-times/o-typography": "^7.2.2", + "@financial-times/o-typography": "^7.4.1", "@financial-times/x-engine": "file:../../packages/x-engine", "@financial-times/x-interaction": "file:../x-interaction", "@financial-times/x-rollup": "file:../../packages/x-rollup",