Skip to content

Commit

Permalink
Merge pull request #6857 from opengovsg/release_v6.85.0
Browse files Browse the repository at this point in the history
build: release v6.85.0
  • Loading branch information
wanlingt authored Oct 31, 2023
2 parents 470a046 + 80c1645 commit 9bd11db
Show file tree
Hide file tree
Showing 99 changed files with 5,422 additions and 510 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,21 @@ 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).

#### [v6.85.0](https://github.com/opengovsg/FormSG/compare/v6.84.0...v6.85.0)

- fix(workspaces): remove form from collab workspace [`#6843`](https://github.com/opengovsg/FormSG/pull/6843)
- feat(workspaces): folders [`#6856`](https://github.com/opengovsg/FormSG/pull/6856)
- fix: use secret to sign and verify sgid jwt [`#6845`](https://github.com/opengovsg/FormSG/pull/6845)
- fix: conditionally render POCDEX login [`#6850`](https://github.com/opengovsg/FormSG/pull/6850)
- chore(deps-dev): bump browserify-sign from 4.2.1 to 4.2.2 in /frontend [`#6853`](https://github.com/opengovsg/FormSG/pull/6853)
- chore(deps-dev): bump browserify-sign from 4.2.1 to 4.2.2 [`#6851`](https://github.com/opengovsg/FormSG/pull/6851)
- build: merge release v6.84.0 into develop [`#6847`](https://github.com/opengovsg/FormSG/pull/6847)
- build: release v6.84.0 [`#6846`](https://github.com/opengovsg/FormSG/pull/6846)

#### [v6.84.0](https://github.com/opengovsg/FormSG/compare/v6.83.0...v6.84.0)

> 26 October 2023

- revert: "feat(workspaces): folders (#6639)" [`#6844`](https://github.com/opengovsg/FormSG/pull/6844)
- fix: mobileno is always editable [`#6841`](https://github.com/opengovsg/FormSG/pull/6841)
- feat(workspaces): folders [`#6639`](https://github.com/opengovsg/FormSG/pull/6639)
Expand All @@ -21,6 +34,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
- chore(deps): [Snyk] Upgrade bson from 5.1.0 to 5.4.0 [`#6661`](https://github.com/opengovsg/FormSG/pull/6661)
- chore(deps-dev): bump @babel/traverse from 7.22.5 to 7.23.2 [`#6811`](https://github.com/opengovsg/FormSG/pull/6811)
- build: release v6.83.0 [`#6823`](https://github.com/opengovsg/FormSG/pull/6823)
- chore: bump version to v6.84.0 [`916bf22`](https://github.com/opengovsg/FormSG/commit/916bf229916f774686707b3c46eae55735760314)

#### [v6.83.0](https://github.com/opengovsg/FormSG/compare/v6.82.0...v6.83.0)

Expand Down
1 change: 1 addition & 0 deletions __tests__/setup/.test-env
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ SGID_FORM_LOGIN_REDIRECT_URI=http://localhost:5000/sgid/login
SGID_ADMIN_LOGIN_REDIRECT_URI=http://localhost:5000/api/v3/auth/sgid/login
SGID_PRIVATE_KEY=./node_modules/@opengovsg/mockpass/static/certs/key.pem
SGID_PUBLIC_KEY=./node_modules/@opengovsg/mockpass/static/certs/server.crt
SGID_JWT_SECRET=sgidjwtsecret

IS_SP_MAINTENANCE=Date/Time-SP
IS_CP_MAINTENANCE=Date/Time-CP
Expand Down
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ services:
- SGID_HOSTNAME=http://localhost:5156
- SGID_CLIENT_ID=sgidclientid
- SGID_CLIENT_SECRET=sgidclientsecret
- SGID_JWT_SECRET=sgidjwtsecret
- SGID_ADMIN_LOGIN_REDIRECT_URI=http://localhost:5001/api/v3/auth/sgid/login
- SGID_FORM_LOGIN_REDIRECT_URI=http://localhost:5001/sgid/login
- SGID_PRIVATE_KEY=./node_modules/@opengovsg/mockpass/static/certs/key.pem
Expand Down
67 changes: 35 additions & 32 deletions frontend/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 frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "form-frontend",
"version": "6.84.0",
"version": "6.85.0",
"homepage": ".",
"private": true,
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/constants/localStorage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const LOCAL_STORAGE_EVENT = 'local-storage'
* Key to store whether a user has seen the rollout announcements before.
*/
export const ROLLOUT_ANNOUNCEMENT_KEY_PREFIX =
'has-seen-rollout-announcement-20230531b-'
'has-seen-rollout-announcement-20231026-'

/**
* Key to store whether the admin has seen the feature tour in localStorage.
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/features/admin-form/common/mutations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,8 @@ export const useMutateCollaborators = () => {

// Remove all related queries from cache.
queryClient.removeQueries(adminFormKeys.id(formId))
queryClient.invalidateQueries(workspaceKeys.all)
queryClient.invalidateQueries(workspaceKeys.dashboard)
queryClient.invalidateQueries(workspaceKeys.workspaces)

navigate(DASHBOARD_ROUTE)
},
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/features/admin-form/template/mutation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ const useCommonHooks = () => {

const handleSuccess = useCallback(
(data: Pick<FormDto, '_id'>) => {
queryClient.invalidateQueries(workspaceKeys.all)
queryClient.invalidateQueries(workspaceKeys.dashboard)
queryClient.invalidateQueries(workspaceKeys.workspaces)
navigate(`${ADMINFORM_ROUTE}/${data._id}`)
},
[navigate, queryClient],
Expand Down
12 changes: 10 additions & 2 deletions frontend/src/features/login/LoginPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,15 @@ import { OrDivider } from './components/OrDivider'
import { OtpForm, OtpFormInputs } from './components/OtpForm'
import { SgidLoginButton } from './components/SgidLoginButton'
import { LoginPageTemplate } from './LoginPageTemplate'
import { useIsIntranetCheck } from './queries'

export type LoginOtpData = {
email: string
}

export const LoginPage = (): JSX.Element => {
const { data: isIntranetIp } = useIsIntranetCheck()

const [, setIsAuthenticated] = useLocalStorage<boolean>(LOGGED_IN_KEY)
const [email, setEmail] = useState<string>()
const [otpPrefix, setOtpPrefix] = useState<string>('')
Expand Down Expand Up @@ -89,8 +92,13 @@ export const LoginPage = (): JSX.Element => {
{!email ? (
<Stack spacing="2rem">
<LoginForm onSubmit={handleSendOtp} />
<OrDivider />
<SgidLoginButton />
{/* Only show sgID login button if user is not on intranet */}
{!isIntranetIp && (
<>
<OrDivider />
<SgidLoginButton />
</>
)}
</Stack>
) : (
<OtpForm
Expand Down
20 changes: 16 additions & 4 deletions frontend/src/features/login/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,29 @@ import { ApiError } from '~typings/core'
import { ApiService } from '~services/ApiService'

export const SGID_PROFILES_ENDPOINT = '/auth/sgid/profiles'
export const INTRANET_CHECK_ENDPOINT = '/intranet/is-intranet-check'

const sgidProfileKeys = {
base: ['sgidProfiles'] as const,
const loginKeys = {
sgidProfiles: ['sgidProfiles'] as const,
intranetCheck: ['intranetCheck'] as const,
}

export const useSgidProfiles = (): UseQueryResult<
SgidProfilesDto,
ApiError
> => {
return useQuery<SgidProfilesDto, ApiError>(sgidProfileKeys.base, async () => {
const { data } = await ApiService.get(SGID_PROFILES_ENDPOINT)
return useQuery<SgidProfilesDto, ApiError>(
loginKeys.sgidProfiles,
async () => {
const { data } = await ApiService.get(SGID_PROFILES_ENDPOINT)
return data
},
)
}

export const useIsIntranetCheck = (): UseQueryResult<boolean, ApiError> => {
return useQuery<boolean, ApiError>(loginKeys.intranetCheck, async () => {
const { data } = await ApiService.get(INTRANET_CHECK_ENDPOINT)
return data
})
}
16 changes: 0 additions & 16 deletions frontend/src/features/rollout-announcement/Announcements.tsx

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import { ModalCloseButton } from '~components/Modal'

import { ProgressIndicator } from '../../components/ProgressIndicator/ProgressIndicator'

import { NEW_FEATURES } from './components/AnnouncementsFeatureList'
import { NewFeatureContent } from './components/NewFeatureContent'
import { NEW_FEATURES } from './Announcements'

interface RolloutAnnouncementModalProps {
isOpen: boolean
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import { GUIDE_PAYMENTS_ENTRY } from '~constants/links'

import { FeatureUpdateImage } from '~features/whats-new/FeatureUpdateList'

import foldersDashboard from '../../whats-new/assets/folders_dashboard.svg'
import PaymentsAnnouncementGraphic from '../assets/payments.json'

export interface NewFeature {
title: string
description: string
learnMoreLink?: string
image: FeatureUpdateImage
}
// When updating this, remember to update the ROLLOUT_ANNOUNCEMENT_KEY_PREFIX with the new date
// so admins will see new announcements.
export const NEW_FEATURES: NewFeature[] = [
{
// Announcement date: 2023-10-31
title: 'Introducing Folders!',
description:
'Say hello to a new way of managing your forms! Create folders and organise your forms to find them easily later.',
image: {
url: foldersDashboard,
alt: 'Dashboard page with folders',
},
},
{
// Announcement date: 2023-05-31
title: 'Collect payments on your form',
description:
'Respondents can now pay for fees and services directly on your form! We integrate with Stripe to provide reliable payments and hassle-free reconciliations. Payment methods we support include debit / credit cards and PayNow.',
learnMoreLink: GUIDE_PAYMENTS_ENTRY,
image: {
animationData: PaymentsAnnouncementGraphic,
alt: 'Collect payments on your form',
},
},
]
Loading

0 comments on commit 9bd11db

Please sign in to comment.