From 7c76fa83db001f6645f00b3a508e989da9b5f398 Mon Sep 17 00:00:00 2001 From: "K.C" Date: Sat, 21 Dec 2019 07:29:03 -0700 Subject: [PATCH] Update password reset email look (#8) * renaming and password reset fix * wrapping element for simpler resizing * give the user a route back to signin * tests for victory * Thats just a helper script * Speeling fixes --- cypress/integration/password-reset.spec.js | 6 +- src/components/Adventure/YamlTracker.svelte | 1 - .../email/pre-defined/email-password-reset.js | 26 ++++--- .../browserStore/display-ads.js | 2 +- .../browserStore/index.js | 0 .../browserStore/main-adventure.js | 2 +- .../browserStore/preDefinedKeys.js | 0 src/lib/global-state-stores/index.js | 0 src/lib/{stores => }/status-tracking.js | 0 src/lib/utils.js | 16 ---- src/routes/landing.svelte | 1 + src/routes/password-reset.svelte | 20 ++--- src/routes/story/[slug].svelte | 4 +- src/routes/user/new.svelte | 73 ++++++++++--------- 14 files changed, 76 insertions(+), 75 deletions(-) rename src/lib/{stores => global-state-stores}/browserStore/display-ads.js (92%) rename src/lib/{stores => global-state-stores}/browserStore/index.js (100%) rename src/lib/{stores => global-state-stores}/browserStore/main-adventure.js (95%) rename src/lib/{stores => global-state-stores}/browserStore/preDefinedKeys.js (100%) create mode 100644 src/lib/global-state-stores/index.js rename src/lib/{stores => }/status-tracking.js (100%) delete mode 100644 src/lib/utils.js diff --git a/cypress/integration/password-reset.spec.js b/cypress/integration/password-reset.spec.js index 87294aca..4e68d477 100644 --- a/cypress/integration/password-reset.spec.js +++ b/cypress/integration/password-reset.spec.js @@ -3,7 +3,7 @@ describe("Password Reset Flow: Submit an email", () => { cy.visit("/password-reset"); }); - it("displays errors and success on reset flow", () => { + it("displays errors, success, and navigation on reset flow", () => { cy.logIn() .visit("/user/login") .get('[data-cy="password-reset"]') @@ -24,6 +24,10 @@ describe("Password Reset Flow: Submit an email", () => { .click(); cy.get("h3").should("contain", "You have been sent an email"); + + cy.contains('return to login') + .click() + .url().should('match', /user\/login/) }); }); diff --git a/src/components/Adventure/YamlTracker.svelte b/src/components/Adventure/YamlTracker.svelte index 23c5b6eb..4c494661 100644 --- a/src/components/Adventure/YamlTracker.svelte +++ b/src/components/Adventure/YamlTracker.svelte @@ -1,7 +1,6 @@ -
+ {#if successMsg}

{successMsg}

- {#if $page.query.token} - Click here to login - {/if} + return to login {:else if $page.query.token}

New Password

Try not to forget this one! diff --git a/src/routes/story/[slug].svelte b/src/routes/story/[slug].svelte index 622dcc03..23ebe0d1 100644 --- a/src/routes/story/[slug].svelte +++ b/src/routes/story/[slug].svelte @@ -28,9 +28,9 @@ import BadgePopup from "src/routes/story/_BadgePopup.svelte"; import Button from "src/components/Button.svelte"; import { Logger } from "src/lib/client/logger"; - import { adStore } from "src/lib/stores/browserStore/display-ads"; + import { adStore } from "src/lib/global-state-stores/browserStore/display-ads"; import { fetchCsrf } from "src/lib/client/csrf"; - import { mainAdventure } from "src/lib/stores/browserStore/main-adventure"; + import { mainAdventure } from "src/lib/global-state-stores/browserStore/main-adventure"; import { onMount } from "svelte"; import { goto, stores } from "@sapper/app"; import { userSubscribed } from "src/lib/client/user"; diff --git a/src/routes/user/new.svelte b/src/routes/user/new.svelte index 8004b820..1ce30d9e 100644 --- a/src/routes/user/new.svelte +++ b/src/routes/user/new.svelte @@ -2,7 +2,7 @@ import * as sapper from "@sapper/app"; import { axios } from "src/lib/axios"; import { fade } from "src/lib/Transition"; - import { statusTracking } from "src/lib/stores/status-tracking"; + import { statusTracking } from "src/lib/status-tracking"; import { Input, Form, Checkbox } from "src/components/Form"; import Button from "src/components/Button.svelte"; import FAQ from "src/routes/faq.svelte"; @@ -54,6 +54,11 @@