Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PON-338: Add subscriptions marketing link on the order and subscription page #309

Merged
merged 1 commit into from
Jun 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ LOGO_TRADEMARK_URL=''
LOGO_WHITE_URL=''
FAVICON_URL=''
ENABLE_B2C_SUBSCRIPTIONS=false
SUBSCRIPTIONS_MARKETING_URL=''
1 change: 1 addition & 0 deletions .env.development
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ LOGO_TRADEMARK_URL=https://edx-cdn.org/v3/default/logo-trademark.svg
LOGO_WHITE_URL=https://edx-cdn.org/v3/default/logo-white.svg
FAVICON_URL=https://edx-cdn.org/v3/default/favicon.ico
ENABLE_B2C_SUBSCRIPTIONS=true
SUBSCRIPTIONS_MARKETING_URL=/program-subscriptions
1 change: 1 addition & 0 deletions .env.test
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ LOGO_TRADEMARK_URL=https://edx-cdn.org/v3/default/logo-trademark.svg
LOGO_WHITE_URL=https://edx-cdn.org/v3/default/logo-white.svg
FAVICON_URL=https://edx-cdn.org/v3/default/favicon.ico
ENABLE_B2C_SUBSCRIPTIONS=true
SUBSCRIPTIONS_MARKETING_URL=/program-subscriptions
1 change: 1 addition & 0 deletions src/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ mergeConfig({
COMMERCE_COORDINATOR_BASE_URL: process.env.COMMERCE_COORDINATOR_BASE_URL,
ENABLE_B2C_SUBSCRIPTIONS: process.env.ENABLE_B2C_SUBSCRIPTIONS,
SUBSCRIPTIONS_BASE_URL: process.env.SUBSCRIPTIONS_BASE_URL,
SUBSCRIPTIONS_MARKETING_URL: process.env.SUBSCRIPTIONS_MARKETING_URL,
SUPPORT_URL: process.env.SUPPORT_URL,
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,14 @@ exports[`<OrdersAndSubscriptions /> Renders correctly in various states renders
<span
className="pgn__action-row-spacer"
/>
<button
<a
className="text-nowrap btn btn-primary btn-sm"
disabled={false}
type="button"
href="http://localhost:18000/program-subscriptions"
onClick={[Function]}
onKeyDown={[Function]}
>
Explore subscription options
</button>
</a>
</div>
</div>
</div>
Expand Down
1 change: 1 addition & 0 deletions src/setupTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ mergeConfig({
COMMERCE_COORDINATOR_BASE_URL: process.env.COMMERCE_COORDINATOR_BASE_URL,
ENABLE_B2C_SUBSCRIPTIONS: process.env.ENABLE_B2C_SUBSCRIPTIONS,
SUBSCRIPTIONS_BASE_URL: process.env.SUBSCRIPTIONS_BASE_URL,
SUBSCRIPTIONS_MARKETING_URL: process.env.SUBSCRIPTIONS_MARKETING_URL,
SUPPORT_URL: process.env.SUPPORT_URL,
});

Expand Down
9 changes: 8 additions & 1 deletion src/subscriptions/SubscriptionUpsell.jsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
import React from 'react';
import { useMediaQuery } from 'react-responsive';

import { getConfig } from '@edx/frontend-platform';
import { FormattedMessage } from '@edx/frontend-platform/i18n';
import { Alert, Badge, Button } from '@edx/paragon';

const SubscriptionUpsell = () => (
<Alert
className="bg-light-200"
actions={[
<Button className="text-nowrap">
<Button
href={
getConfig().MARKETING_SITE_BASE_URL
+ getConfig().SUBSCRIPTIONS_MARKETING_URL
}
className="text-nowrap"
>
<FormattedMessage
id="ecommerce.order.history.subscription.upsell.button"
defaultMessage="Explore subscription options"
Expand Down
9 changes: 5 additions & 4 deletions src/subscriptions/__snapshots__/Subscriptions.test.jsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -164,13 +164,14 @@ exports[`<Subscriptions /> Renders correctly in various states renders with no s
<span
className="pgn__action-row-spacer"
/>
<button
<a
className="text-nowrap btn btn-primary btn-sm"
disabled={false}
type="button"
href="http://localhost:18000/program-subscriptions"
onClick={[Function]}
onKeyDown={[Function]}
>
Explore subscription options
</button>
</a>
</div>
</div>
</div>
Expand Down