Skip to content

Commit

Permalink
Merge pull request #1938 from isomerpages/release_v0.90.0
Browse files Browse the repository at this point in the history
release v0.90.0
  • Loading branch information
alexanderleegs authored Oct 21, 2024
2 parents 36d9caa + a99212f commit e787ba4
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 7 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "isomercms-frontend",
"version": "0.89.0",
"version": "0.90.0",
"private": true,
"engines": {
"node": ">=16.0.0"
Expand Down
8 changes: 6 additions & 2 deletions src/components/ViewStagingSiteModal/ViewStagingSiteModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -57,6 +59,8 @@ export function ViewStagingSiteModal({
stagingUrl,
editMode,
}: ViewStagingSiteModalProps) {
const stagingLink = useStagingLink(stagingUrl)

return (
<Modal isOpen={isOpen} onClose={onClose}>
<ModalOverlay />
Expand All @@ -78,7 +82,7 @@ export function ViewStagingSiteModal({
what your site may look like on smaller devices:
</Text>

<GenerateQr text={stagingUrl || ""} />
<GenerateQr text={stagingLink || ""} />
</VStack>
</ModalBody>
<ModalFooter>
Expand All @@ -87,7 +91,7 @@ export function ViewStagingSiteModal({
Close
</Button>
<Skeleton isLoaded={!isLoading}>
<ButtonLink href={stagingUrl}>
<ButtonLink href={stagingLink}>
<Text color="white">Open staging site in a new tab</Text>
</ButtonLink>
</Skeleton>
Expand Down
12 changes: 12 additions & 0 deletions src/hooks/useStagingLink.ts
Original file line number Diff line number Diff line change
@@ -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
}
6 changes: 4 additions & 2 deletions src/layouts/SiteDashboard/SiteDashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -143,11 +145,11 @@ export const SiteDashboard = (): JSX.Element => {
mainButtonText="Open staging"
isDisabled={isSiteInfoLoading || isSiteInfoError}
as={ButtonLink}
href={siteInfo?.stagingUrl}
href={stagingLink}
>
<MenuDropdownItem
as={ButtonLink}
href={siteInfo?.stagingUrl}
href={stagingLink}
isDisabled={isSiteInfoLoading || isSiteInfoError}
>
<Text textStyle="body-1" fill="text.body">
Expand Down

0 comments on commit e787ba4

Please sign in to comment.