Skip to content

Commit

Permalink
Merge pull request #1901 from isomerpages/release_v0.87.0
Browse files Browse the repository at this point in the history
release v0.87.0
  • Loading branch information
alexanderleegs authored Jun 13, 2024
2 parents b32c4e3 + 35aeb3c commit 75bee62
Show file tree
Hide file tree
Showing 9 changed files with 2,830 additions and 1,984 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,17 @@ 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.87.0](https://github.com/isomerpages/isomercms-frontend/compare/v0.86.0...v0.87.0)

- Add layout and functionality for 2d broken link checker [`#1891`](https://github.com/isomerpages/isomercms-frontend/pull/1891)
- fix/prevent logout in login routes [`#1889`](https://github.com/isomerpages/isomercms-frontend/pull/1889)
- chore: update snyk [`#1895`](https://github.com/isomerpages/isomercms-frontend/pull/1895)
- backport v0.86.0 [`#1893`](https://github.com/isomerpages/isomercms-frontend/pull/1893)

#### [v0.86.0](https://github.com/isomerpages/isomercms-frontend/compare/v0.85.0...v0.86.0)

> 30 May 2024
- chore: add frustration [`#1888`](https://github.com/isomerpages/isomercms-frontend/pull/1888)
- chore: increase contact us field limits [`#1887`](https://github.com/isomerpages/isomercms-frontend/pull/1887)
- [Snyk] Security upgrade dompurify from 3.0.6 to 3.1.3 [`#1874`](https://github.com/isomerpages/isomercms-frontend/pull/1874)
Expand All @@ -20,6 +29,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
- chore(deps-dev): bump ip from 1.1.8 to 2.0.1 [`#1839`](https://github.com/isomerpages/isomercms-frontend/pull/1839)
- chore(mergify): enhance mergify [`#1865`](https://github.com/isomerpages/isomercms-frontend/pull/1865)
- chore: bump version to v0.85.0 [`0e3139f`](https://github.com/isomerpages/isomercms-frontend/commit/0e3139f2d3f6c2cf7abacb366e6d1d15f6d7b17e)
- chore: bump version to v0.86.0 [`5608b1b`](https://github.com/isomerpages/isomercms-frontend/commit/5608b1b8639f25b974a106d2341d4160516e3fae)

#### [v0.85.0](https://github.com/isomerpages/isomercms-frontend/compare/v0.84.0...v0.85.0)

Expand Down
2,357 changes: 1,354 additions & 1,003 deletions package-lock.json

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "isomercms-frontend",
"version": "0.86.0",
"version": "0.87.0",
"private": true,
"engines": {
"node": ">=16.0.0"
Expand All @@ -15,7 +15,7 @@
"@chakra-ui/utils": "^2.0.14",
"@craco/craco": "^7.1.0",
"@datadog/browser-rum": "^4.38.0",
"@datadog/datadog-ci": "^2.30.0",
"@datadog/datadog-ci": "^2.37.0",
"@emotion/react": "^11.7.1",
"@emotion/styled": "^11.6.0",
"@fontsource/ibm-plex-mono": "^5.0.5",
Expand Down Expand Up @@ -50,7 +50,7 @@
"@tiptap/pm": "^2.1.12",
"@tiptap/react": "^2.1.12",
"@tiptap/starter-kit": "^2.1.12",
"axios": "^1.6.5",
"axios": "^1.7.2",
"bluebird": "^3.7.1",
"bootstrap": "^4.6.0",
"cheerio": "^1.0.0-rc.10",
Expand Down Expand Up @@ -96,7 +96,7 @@
"react-simplemde-editor": "^5.2.0",
"react-virtuoso": "^2.19.0",
"remixicon": "^3.5.0",
"sass": "^1.51.0",
"sass": "^1.77.4",
"sgds-govtech": "^1.3.16",
"slugify": "^1.6.5",
"tinycolor2": "^1.6.0",
Expand All @@ -105,7 +105,7 @@
"turndown": "^7.1.1",
"turndown-plugin-gfm": "^1.0.2",
"uuid": "^3.4.0",
"webpack": "^5.76.1",
"webpack": "^5.91.0",
"yaml": "^1.10.2",
"yup": "^0.32.11"
},
Expand Down
1,215 changes: 529 additions & 686 deletions src/assets/images/NoBrokenLinksImage.tsx

Large diffs are not rendered by default.

42 changes: 42 additions & 0 deletions src/components/PaginateButton.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import { Text, HStack } from "@chakra-ui/react"
import {
IconButton,
BxChevronLeft,
BxChevronRight,
} from "@opengovsg/design-system-react"

import { typography } from "theme/foundations/typography"

export default function PaginateButton({
currentPage,
totalPage,
onPageChange,
}: {
currentPage: number
totalPage: number
onPageChange: (arg: number) => void
}) {
return (
<HStack>
<Text textStyle="caption-1">
Page {currentPage} out of {totalPage}{" "}
</Text>
<IconButton
size="sm"
aria-label="Previous Page"
icon={<BxChevronLeft />}
onClick={() => onPageChange(currentPage - 1)}
isDisabled={currentPage <= 1}
marginLeft="1.25rem"
marginRight="0.75rem"
/>
<IconButton
size="sm"
aria-label="Next Page"
icon={<BxChevronRight />}
onClick={() => onPageChange(currentPage + 1)}
isDisabled={currentPage === totalPage}
/>
</HStack>
)
}
9 changes: 8 additions & 1 deletion src/contexts/LoginContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
useCallback,
useState,
} from "react"
import { useLocation } from "react-router-dom"

import { LOCAL_STORAGE_KEYS } from "constants/localStorage"

Expand All @@ -15,6 +16,7 @@ import { useLocalStorage } from "hooks/useLocalStorage"
import { LoggedInUser, UserType, UserTypes } from "types/user"

const { REACT_APP_BACKEND_URL_V2: BACKEND_URL } = process.env
const LOGIN_PATHS = ["/", "/sgid-callback"]

interface LoginContextProps extends LoggedInUser {
isLoading: boolean
Expand All @@ -36,6 +38,7 @@ const useLoginContext = (): LoginContextProps => {
const LoginProvider = ({
children,
}: PropsWithChildren<Record<string, never>>): JSX.Element => {
const { pathname } = useLocation()
const [, , removeSites] = useLocalStorage(
LOCAL_STORAGE_KEYS.SitesIsPrivate,
false
Expand Down Expand Up @@ -69,7 +72,11 @@ const LoginProvider = ({
return response
},
async (error) => {
if (error.response && error.response.status === 401) {
if (
error.response &&
error.response.status === 401 &&
!LOGIN_PATHS.includes(pathname)
) {
await logout()
}
setIsLoading(false)
Expand Down
Loading

0 comments on commit 75bee62

Please sign in to comment.