From ff4755be64bc75f47a648ec184d6b364c801b259 Mon Sep 17 00:00:00 2001 From: kAy Date: Fri, 11 Aug 2023 16:14:35 +1000 Subject: [PATCH] 5ku UI changes (#2337) * - Back button changed to cross - InstallationRequested split to a new route - Minor cleanup * - Lint fixes * - test case added for the request installation screen * - test case added for the request installation screen * - Cleanup * - Add organization button added in the Success screen - Test case updated * - Removed the auto-redirect from the jira-get.ts * - Orgs list separated to a different component * - Minor cleanup * - WIP - error states * - UI changes * - Dropdown component removed - Text changes and updating test cases * - Minor styling fix * - Link added --------- Co-authored-by: Gary Xue <105693507+gxueatlassian@users.noreply.github.com> --- spa/src/app.tsx | 2 + spa/src/common/LoggedinInfo.tsx | 31 ++++ spa/src/common/Wrapper.tsx | 5 +- spa/src/components/SelectDropdown/index.tsx | 72 --------- spa/src/components/SelectDropdown/test.tsx | 28 ---- spa/src/components/Step/index.tsx | 1 + .../pages/ConfigSteps/OrgsContainer/index.tsx | 142 ++++++++++++++++++ .../ConfigSteps/SkeletonForLoading/index.tsx | 38 +++++ spa/src/pages/ConfigSteps/index.tsx | 138 ++++------------- spa/src/pages/ConfigSteps/test.tsx | 61 ++++---- spa/src/pages/Connected/index.tsx | 40 +++-- spa/src/pages/Connected/test.tsx | 12 +- spa/src/pages/InstallationRequested/index.tsx | 48 ++++++ spa/src/pages/InstallationRequested/test.tsx | 35 +++++ spa/src/utils/modifyError.tsx | 2 +- src/routes/jira/jira-get.test.ts | 23 --- src/routes/jira/jira-get.ts | 4 - 17 files changed, 407 insertions(+), 275 deletions(-) create mode 100644 spa/src/common/LoggedinInfo.tsx delete mode 100644 spa/src/components/SelectDropdown/index.tsx delete mode 100644 spa/src/components/SelectDropdown/test.tsx create mode 100644 spa/src/pages/ConfigSteps/OrgsContainer/index.tsx create mode 100644 spa/src/pages/ConfigSteps/SkeletonForLoading/index.tsx create mode 100644 spa/src/pages/InstallationRequested/index.tsx create mode 100644 spa/src/pages/InstallationRequested/test.tsx diff --git a/spa/src/app.tsx b/spa/src/app.tsx index b808e8da96..6314647ee9 100644 --- a/spa/src/app.tsx +++ b/spa/src/app.tsx @@ -7,6 +7,7 @@ import { import StartConnection from "./pages/StartConnection"; import ConfigSteps from "./pages/ConfigSteps"; import Connected from "./pages/Connected"; +import InstallationRequested from "./pages/InstallationRequested"; import * as Sentry from "@sentry/react"; import { initSentry } from "./sentry"; @@ -32,6 +33,7 @@ const App = () => { }/> }/> }/> + }/> diff --git a/spa/src/common/LoggedinInfo.tsx b/spa/src/common/LoggedinInfo.tsx new file mode 100644 index 0000000000..c3363ee743 --- /dev/null +++ b/spa/src/common/LoggedinInfo.tsx @@ -0,0 +1,31 @@ +import Button from "@atlaskit/button"; +import styled from "@emotion/styled"; +import { popup } from "../utils"; +import analyticsClient from "../analytics"; +import OAuthManager from "../services/oauth-manager"; + +const LoggedInContent = styled.div` + display: flex; + align-items: center; + justify-content: center; + margin: 0 auto; +`; + +const LoggedinInfo = ({ username, logout }: { username: string; logout: () => void;}) => { + const clicked = () => { + // Opens the popup for logging out of GitHub + popup("https://github.com/logout"); + // Clearing the locally stored tokens + OAuthManager.clear(); + // Passed callbacks, for re-rendering/changing states + logout(); + analyticsClient.sendUIEvent({ actionSubject: "switchGitHubAccount", action: "clicked" }); + }; + + return +
Logged in as {username}
+ +
; +}; + +export default LoggedinInfo; diff --git a/spa/src/common/Wrapper.tsx b/spa/src/common/Wrapper.tsx index 61a3d5130b..215af47271 100644 --- a/spa/src/common/Wrapper.tsx +++ b/spa/src/common/Wrapper.tsx @@ -1,7 +1,7 @@ import { ReactNode } from "react"; import styled from "@emotion/styled"; import Button from "@atlaskit/button"; -import ArrowLeftIcon from "@atlaskit/icon/glyph/arrow-left"; +import CrossIcon from "@atlaskit/icon/glyph/cross"; import analyticsClient from "../analytics"; const navHeight = 56; @@ -27,7 +27,8 @@ export const Wrapper = (attr: { }) => { return