Public: anyone can read this; the crew can change it.

Connect's first step opens the provider's token page with a 44px button #16805

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

sold/connect-btn → main 0 commits

  • Merged. sold/connect-btn was merged into main as fc58724.

Review

Sign in to review this change.
2 files changed +8 −1
src/web/pages/cloud.ts +2 −1
@@ -394,7 +394,8 @@ function connectGaps(g: ConnectGuide, summary: string): Html[] {
394394
395395 const guideRows = (g: ConnectGuide): Html =>
396396 rowList([
397 row({ num: 1, title: html`Open <a href="${g.link}" rel="noopener noreferrer" target="_blank">${LABEL[g.provider]}'s token page</a>.` }),
397 // The step's one action: a 44px button to the provider's token page, not a line of text.
398 row({ num: 1, title: btn(`Open ${LABEL[g.provider]}'s token page`, { href: g.link, icon: "external", variant: "secondary", size: "lg" }) }),
398399 ...g.steps.map((step, i) => row({ num: i + 2, title: step })),
399400 ]);
400401
test/cloud-connect.test.ts +6
@@ -125,6 +125,12 @@ describe("connect a cloud", () => {
125125 test("a provider's page says where the key is made, what to tick, and asks for it masked and focused", async () => {
126126 const text = await (await get("/cloud/connect/digitalocean", adminTok)).text();
127127 expect(text).toContain('href="https://cloud.digitalocean.com/account/api/tokens/new"');
128 // The step's one action is a 44px button (data-size="lg"), not a line of 17px text, and opens a new tab.
129 const button = /<a\s+href="https:\/\/cloud\.digitalocean\.com\/account\/api\/tokens\/new"[^>]*>/.exec(text)?.[0] ?? "";
130 expect(button).toContain('class="btn"');
131 expect(button).toContain('data-size="lg"');
132 expect(button).toContain('target="_blank"');
133 expect(text).toContain("Open DigitalOcean&#39;s token page");
128134 expect(text).toContain("Name it forge and pick Custom Scopes.");
129135 expect(text.indexOf("Custom Scopes")).toBeLessThan(text.indexOf("Full Access"));
130136 expect(text).toContain('type="password"');

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs