-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feat/nric-opt-in-out' into staging-alt2
- Loading branch information
Showing
29 changed files
with
867 additions
and
371 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
export const PREVIEW_MOCK_UINFIN = 'S1234567A' | ||
export const PREVIEW_MASKED_MOCK_UINFIN = '*****567A' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
.../features/admin-form/settings/components/AuthSettingsSection/FormNricCollectionToggle.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import { useCallback } from 'react' | ||
|
||
import { FormSettings } from '~shared/types/form' | ||
|
||
import Toggle from '~components/Toggle' | ||
|
||
import { useMutateFormSettings } from '../../mutations' | ||
|
||
interface FormSubmitterIdCollectionProps { | ||
settings: FormSettings | ||
isDisabled: boolean | ||
} | ||
|
||
export const FormSubmitterIdCollectionToggle = ({ | ||
settings, | ||
isDisabled, | ||
}: FormSubmitterIdCollectionProps): JSX.Element => { | ||
const isSubmitterIdCollectionEnabled = | ||
!!settings?.isSubmitterIdCollectionEnabled | ||
|
||
const { mutateIsSubmitterIdCollectionEnabled } = useMutateFormSettings() | ||
|
||
const handleToggleCollection = useCallback(() => { | ||
if (!settings || mutateIsSubmitterIdCollectionEnabled.isLoading) return | ||
const nextIsNricMaskEnabled = !settings.isSubmitterIdCollectionEnabled | ||
return mutateIsSubmitterIdCollectionEnabled.mutate(nextIsNricMaskEnabled) | ||
}, [mutateIsSubmitterIdCollectionEnabled, settings]) | ||
|
||
return ( | ||
<Toggle | ||
containerStyles={{ opacity: isDisabled ? 0.3 : 1 }} | ||
isDisabled={isDisabled} | ||
isLoading={!settings || mutateIsSubmitterIdCollectionEnabled.isLoading} | ||
isChecked={isSubmitterIdCollectionEnabled} | ||
label="Collect NRIC/FIN/UENs with form submissions" | ||
description="NRIC/FIN/UENs are not collected or stored with form submissions by default" | ||
onChange={handleToggleCollection} | ||
/> | ||
) | ||
} |
39 changes: 0 additions & 39 deletions
39
...nd/src/features/admin-form/settings/components/AuthSettingsSection/FormNricMaskToggle.tsx
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.