Skip to content
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
4 changes: 2 additions & 2 deletions .github/workflows/run_regression_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ jobs:
GITHUB-TOKEN: ${{ steps.generate-token.outputs.token }}
run: |
if [[ "$TARGET_ENVIRONMENT" != "prod" && "$TARGET_ENVIRONMENT" != "ref" ]]; then
REGRESSION_TEST_REPO_TAG="v3.8.20" # This is the tag or branch of the regression test code to run, usually a version tag like v3.1.0 or a branch name
REGRESSION_TEST_WORKFLOW_TAG="v3.8.20" # This is the tag of the github workflow to run, usually the same as REGRESSION_TEST_REPO_TAG
REGRESSION_TEST_REPO_TAG="v3.9.9" # This is the tag or branch of the regression test code to run, usually a version tag like v3.1.0 or a branch name
REGRESSION_TEST_WORKFLOW_TAG="v3.9.9" # This is the tag of the github workflow to run, usually the same as REGRESSION_TEST_REPO_TAG


if [[ -z "$REGRESSION_TEST_REPO_TAG" || -z "$REGRESSION_TEST_WORKFLOW_TAG" ]]; then
Expand Down
6 changes: 0 additions & 6 deletions packages/cpt-ui/__tests__/EpsHeader.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ jest.mock("@/constants/ui-strings/HeaderStrings", () => ({
HEADER_STRINGS: {
CHANGE_ROLE_BUTTON: "Change role",
CHANGE_ROLE_TARGET: "/change-your-role",
EXIT_BUTTON: "Exit",
EXIT_TARGET: "/exit",
FEEDBACK_BUTTON: "Give feedback (opens in new tab)",
FEEDBACK_TARGET: "https://feedback.digital.nhs.uk/jfe/form/SV_ahG2dymAdr0oRz8",
LOG_OUT_BUTTON: "Log out",
Expand Down Expand Up @@ -151,10 +149,6 @@ describe("EpsHeader", () => {
"Log out"
)
})

it("does NOT display an 'Exit' button by default", () => {
expect(screen.queryByTestId("eps_header_exit")).not.toBeInTheDocument()
})
})

describe("Select Your Role link behavior", () => {
Expand Down
2 changes: 0 additions & 2 deletions packages/cpt-ui/__tests__/HeaderStrings.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ describe("HeaderStrings", () => {
expect(HEADER_STRINGS.CHANGE_ROLE_BUTTON).toBe("Change role")
expect(HEADER_STRINGS.SELECT_YOUR_ROLE_BUTTON).toBe("Select Your Role")
expect(HEADER_STRINGS.PRESCRIPTION_SEARCH_BUTTON).toBe("Search for a prescription")
expect(HEADER_STRINGS.EXIT_BUTTON).toBe("Exit")
expect(HEADER_STRINGS.FEEDBACK_BUTTON).toBe("Give feedback (opens in new tab)")
expect(HEADER_STRINGS.LOG_OUT_BUTTON).toBe("Log out")
expect(HEADER_STRINGS.SKIP_TO_MAIN_CONTENT).toBe("Skip to main content")
Expand All @@ -20,7 +19,6 @@ describe("HeaderStrings", () => {
})

it("has the correct target paths", () => {
expect(HEADER_STRINGS.EXIT_TARGET).toBe("/")
expect(HEADER_STRINGS.CHANGE_ROLE_TARGET).toBe("/change-your-role")
expect(HEADER_STRINGS.SELECT_YOUR_ROLE_TARGET).toBe("/select-your-role")
expect(HEADER_STRINGS.PRESCRIPTION_SEARCH_TARGET).toBe("/search-by-prescription-id")
Expand Down
39 changes: 1 addition & 38 deletions packages/cpt-ui/src/components/EpsHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ export default function EpsHeader() {
const [shouldShowSelectRole, setShouldShowSelectRole] = useState(false)
const [shouldShowChangeRole, setShouldShowChangeRole] = useState(false)
const [shouldShowLogoutLink, setShouldShowLogoutLink] = useState(false)
const [shouldShowExitButton, setShouldShowExitButton] = useState(false)
const [showLogoutModal, setShowLogoutModal] = useState(false)
const [isDropdownOpen, setIsDropdownOpen] = useState(false)
const [isMobileView, setIsMobileView] = useState(false)
Expand Down Expand Up @@ -50,12 +49,6 @@ export default function EpsHeader() {
)

setShouldShowLogoutLink(Boolean(auth?.isSignedIn))

setShouldShowExitButton(
(path === FRONTEND_PATHS.LOGOUT && !auth?.isSignedIn) ||
(path === FRONTEND_PATHS.SELECT_YOUR_ROLE && authContext.rolesWithAccess.length === 0) ||
(path === "/notfound")
)
}, [location, auth, authContext])

useEffect(() => {
Expand Down Expand Up @@ -168,21 +161,6 @@ export default function EpsHeader() {
<span className="text">{HEADER_STRINGS.LOG_OUT_BUTTON}</span>
</a>
)}

{shouldShowExitButton && (
<a
href="#"
onClick={(e: React.MouseEvent) => {
e.preventDefault()
navigate(getHomeLink(false))
setIsDropdownOpen(false)
}}
className="eps-header__nav-item"
data-testid="eps_header_exit"
>
<span className="text">Exit</span>
</a>
)}
</div>
)}

Expand All @@ -196,7 +174,7 @@ export default function EpsHeader() {
aria-label="Toggle navigation menu"
data-testid="eps_header_menuToggle"
>
<span className="text">More</span>
<span className="text">{HEADER_STRINGS.MORE}</span>
<svg
className="eps-header__menu-icon"
width="24"
Expand Down Expand Up @@ -271,21 +249,6 @@ export default function EpsHeader() {
<span className="text">{HEADER_STRINGS.LOG_OUT_BUTTON}</span>
</a>
)}

{shouldShowExitButton && (
<a
href="#"
onClick={(e: React.MouseEvent) => {
e.preventDefault()
navigate(getHomeLink(false))
setIsDropdownOpen(false)
}}
className="eps-header__dropdown-item"
data-testid="eps_header_exit_mobile"
>
<span className="text">Exit</span>
</a>
)}
</div>
</div>
)}
Expand Down
5 changes: 2 additions & 3 deletions packages/cpt-ui/src/constants/ui-strings/HeaderStrings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import {FRONTEND_PATHS} from "@/constants/environment"
export const HEADER_STRINGS = {
CHANGE_ROLE_BUTTON: "Change role",
CHANGE_ROLE_TARGET: FRONTEND_PATHS.CHANGE_YOUR_ROLE,
EXIT_BUTTON: "Exit",
EXIT_TARGET: "/",
FEEDBACK_BUTTON: "Give feedback (opens in new tab)",
FEEDBACK_TARGET: "https://feedback.digital.nhs.uk/jfe/form/SV_ahG2dymAdr0oRz8",
LOG_OUT_BUTTON: "Log out",
Expand All @@ -14,5 +12,6 @@ export const HEADER_STRINGS = {
SELECT_YOUR_ROLE_BUTTON: "Select Your Role",
SELECT_YOUR_ROLE_TARGET: FRONTEND_PATHS.SELECT_YOUR_ROLE,
SERVICE: "Prescription Tracker (private beta)",
SKIP_TO_MAIN_CONTENT: "Skip to main content"
SKIP_TO_MAIN_CONTENT: "Skip to main content",
MORE: "More"
}
2 changes: 0 additions & 2 deletions packages/staticContent/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@
<div class="nhsuk-navigation-container">
<nav class="nhsuk-navigation masthead-nav" id="header-navigation" role="navigation">
<ul class="nhsuk-header__navigation-list nhsuk-header__navigation-list--left-aligned">
<li class="nhsuk-header__navigation-item"><a class="nhsuk-header__navigation-link"
data-testid="eps_header_exit" href="/site">Exit</a></li>
</ul>
</nav>
</div>
Expand Down