Skip to content

Commit 2d9be72

Browse files
committed
feat(pay): update login flow and button text for clarity
Refactor the login process to redirect users to the catalog page after initiating login, enhancing user experience. Update button text to reflect the action of trying a free project for unauthenticated users, and adjust tooltips accordingly. Modify acceptance tests to ensure correct behavior and messaging throughout the pay page.
1 parent 4ddc5d8 commit 2d9be72

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed

app/components/pay-page/pricing-card.hbs

+6-2
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,14 @@
7272
{{svg-jar "github" class="fill-current w-4 transform transition-all mr-2"}}
7373
{{/unless}}
7474

75-
Start membership →
75+
{{#if this.authenticator.isAuthenticated}}
76+
Start membership 
77+
{{else}}
78+
Try a free project 
79+
{{/if}}
7680

7781
{{#unless this.authenticator.isAuthenticated}}
78-
<EmberTooltip @text="Login via GitHub to start a membership." />
82+
<EmberTooltip @text="Login via GitHub to try a free project." />
7983
{{/unless}}
8084
</button>
8185

app/controllers/pay.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ export default class PayController extends Controller {
5858
this.configureCheckoutSessionModalIsOpen = true;
5959
this.selectedPricingFrequency = pricingFrequency;
6060
} else {
61-
this.authenticator.initiateLogin();
61+
// The CTA is "Try a free project ->", so doesn't make sense to redirect to /pay again
62+
this.authenticator.initiateLoginAndRedirectTo('/catalog');
6263
}
6364
}
6465

tests/acceptance/pay-test.js

+4-7
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,16 @@ module('Acceptance | pay-test', function (hooks) {
2525
await payPage.pricingCards[0].startPaymentButton.hover();
2626

2727
assertTooltipContent(assert, {
28-
contentString: 'Login via GitHub to start a membership.',
28+
contentString: 'Login via GitHub to try a free project.',
2929
});
3030
});
3131

32-
test('user can view the page through the upgrade button', async function (assert) {
32+
test('user can view the page through the pricing link', async function (assert) {
3333
testScenario(this.server);
3434

3535
await catalogPage.visit();
3636

37-
assert.ok(catalogPage.header.upgradeButton.isVisible, 'Upgrade button is visible');
38-
39-
await catalogPage.header.upgradeButton.click();
40-
37+
await catalogPage.header.clickOnHeaderLink('Pricing');
4138
assert.strictEqual(currentURL(), '/pay');
4239
});
4340

@@ -49,7 +46,7 @@ module('Acceptance | pay-test', function (hooks) {
4946

5047
assert.strictEqual(
5148
windowMock.location.href,
52-
`${windowMock.location.origin}/login?next=http%3A%2F%2Flocalhost%3A${window.location.port}%2Fpay`,
49+
`${windowMock.location.origin}/login?next=http%3A%2F%2Flocalhost%3A${window.location.port}%2Fcatalog`,
5350
'should redirect to login URL',
5451
);
5552
});

0 commit comments

Comments
 (0)