diff --git a/CHANGELOG.md b/CHANGELOG.md index 9c10e8248..ce6baf73c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,10 +4,18 @@ All notable changes to this project will be documented in this file. Dates are d Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). +#### [v0.90.0](https://github.com/isomerpages/isomercms-frontend/compare/v0.89.0...v0.90.0) + +- fix: use menlo security for gsib [`#1937`](https://github.com/isomerpages/isomercms-frontend/pull/1937) +- backport v0.89.0 [`#1924`](https://github.com/isomerpages/isomercms-frontend/pull/1924) + #### [v0.89.0](https://github.com/isomerpages/isomercms-frontend/compare/v0.88.0...v0.89.0) +> 21 August 2024 + - update referrer policy for hyperlinks [`#1922`](https://github.com/isomerpages/isomercms-frontend/pull/1922) - backport v0.88.0 [`#1911`](https://github.com/isomerpages/isomercms-frontend/pull/1911) +- chore: bump version to v0.89.0 [`db396c8`](https://github.com/isomerpages/isomercms-frontend/commit/db396c8c8ff72e0069c2e4c22b3a6ee4cf878918) #### [v0.88.0](https://github.com/isomerpages/isomercms-frontend/compare/v0.87.0...v0.88.0) diff --git a/package-lock.json b/package-lock.json index 2e9bfb3f2..466400e3d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "isomercms-frontend", - "version": "0.89.0", + "version": "0.90.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "isomercms-frontend", - "version": "0.89.0", + "version": "0.90.0", "hasInstallScript": true, "dependencies": { "@braintree/sanitize-url": "^6.0.1", diff --git a/package.json b/package.json index b68daf2f5..e1732f9cb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "isomercms-frontend", - "version": "0.89.0", + "version": "0.90.0", "private": true, "engines": { "node": ">=16.0.0" diff --git a/src/components/ViewStagingSiteModal/ViewStagingSiteModal.tsx b/src/components/ViewStagingSiteModal/ViewStagingSiteModal.tsx index ceab2006a..c7e4dae96 100644 --- a/src/components/ViewStagingSiteModal/ViewStagingSiteModal.tsx +++ b/src/components/ViewStagingSiteModal/ViewStagingSiteModal.tsx @@ -17,6 +17,8 @@ import { useEffect, useState } from "react" import { ButtonLink } from "components/ButtonLink" import { Modal } from "components/Modal" +import { useStagingLink } from "hooks/useStagingLink" + export interface ViewStagingSiteModalProps { isOpen: boolean onClose: () => void @@ -57,6 +59,8 @@ export function ViewStagingSiteModal({ stagingUrl, editMode, }: ViewStagingSiteModalProps) { + const stagingLink = useStagingLink(stagingUrl) + return ( @@ -78,7 +82,7 @@ export function ViewStagingSiteModal({ what your site may look like on smaller devices: - + @@ -87,7 +91,7 @@ export function ViewStagingSiteModal({ Close - + Open staging site in a new tab diff --git a/src/hooks/useStagingLink.ts b/src/hooks/useStagingLink.ts new file mode 100644 index 000000000..522eed16c --- /dev/null +++ b/src/hooks/useStagingLink.ts @@ -0,0 +1,12 @@ +const GSIB_INDICATOR = "menlo-view.menlosecurity.com" + +export const useStagingLink = (link?: string): string | undefined => { + // NOTE: Prepend the menlo link if this is on GSIB because + // GSIBs do a security scan that will fail otherwise with a TOO_MANY_REDIRECTS + // error when we access the raw link directly. + if (window.name.includes(GSIB_INDICATOR)) { + return `https://safe.menlosecurity.com/${link}` + } + + return link +} diff --git a/src/layouts/SiteDashboard/SiteDashboard.tsx b/src/layouts/SiteDashboard/SiteDashboard.tsx index 149c279ee..927805646 100644 --- a/src/layouts/SiteDashboard/SiteDashboard.tsx +++ b/src/layouts/SiteDashboard/SiteDashboard.tsx @@ -47,6 +47,7 @@ import { import { useGetBrokenLinks } from "hooks/siteDashboardHooks/useGetLinkChecker" import { useRefreshLinkChecker } from "hooks/siteDashboardHooks/useRefreshLinkChecker" import useRedirectHook from "hooks/useRedirectHook" +import { useStagingLink } from "hooks/useStagingLink" import { getDateTimeFromUnixTime } from "utils/date" import { isSiteLaunchEnabled } from "utils/siteLaunchUtils" @@ -96,6 +97,7 @@ export const SiteDashboard = (): JSX.Element => { const { mutateAsync: updateViewedReviewRequests, } = useUpdateViewedReviewRequests() + const stagingLink = useStagingLink(siteInfo?.stagingUrl) const isBrokenLinksReporterEnabled = useFeatureIsOn( "is_broken_links_report_enabled" @@ -143,11 +145,11 @@ export const SiteDashboard = (): JSX.Element => { mainButtonText="Open staging" isDisabled={isSiteInfoLoading || isSiteInfoError} as={ButtonLink} - href={siteInfo?.stagingUrl} + href={stagingLink} >