Skip to content

Commit

Permalink
Merge pull request #317 from City-of-Helsinki/HP-2252-password-info
Browse files Browse the repository at this point in the history
HP-2254 Show verify email info for helsinki account
  • Loading branch information
Riippi authored Feb 27, 2024
2 parents 9d2365c + 26af198 commit f733c0f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "open-city-profile-ui",
"version": "1.3.1",
"version": "1.4.0",
"license": "MIT",
"private": true,
"dependencies": {
Expand Down
8 changes: 6 additions & 2 deletions src/profile/components/emailEditor/EmailEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ import FocusKeeper from '../../../common/focusKeeper/FocusKeeper';
import AccessibleFormikErrors from '../accessibleFormikErrors/AccessibleFormikErrors';
import AccessibilityFieldHelpers from '../../../common/accessibilityFieldHelpers/AccessibilityFieldHelpers';
import useProfile from '../../../auth/useProfile';
import { hasTunnistusSuomiFiAmr } from '../profileInformation/authenticationProviderUtil';
import {
hasHelsinkiAccountAMR,
hasTunnistusSuomiFiAmr,
} from '../profileInformation/authenticationProviderUtil';
import { useCommonEditHandling } from '../../hooks/useCommonEditHandling';
import AddButton from '../addButton/AddButton';

Expand Down Expand Up @@ -55,7 +58,8 @@ function EmailEditor(): React.ReactElement | null {
const formFields = getFormFields(dataType);
const ariaLabels = createActionAriaLabels(dataType, email, t);
const { profile } = useProfile();
const willSendEmailVerificationCode = hasTunnistusSuomiFiAmr(profile);
const willSendEmailVerificationCode =
hasTunnistusSuomiFiAmr(profile) || hasHelsinkiAccountAMR(profile);
const { hasFieldError, getFieldErrorMessage } = createFormFieldHelpers<
EmailValue
>(t, true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,7 @@ export function getAmrStatic(profile: Profile | null): AMRStatic | null {
export function hasTunnistusSuomiFiAmr(profile: Profile | null): boolean {
return getAmrFromProfileData(profile) === tunnistusSuomifiAMR;
}

export function hasHelsinkiAccountAMR(profile: Profile | null): boolean {
return getAmrFromProfileData(profile) === config.helsinkiAccountAMR;
}

0 comments on commit f733c0f

Please sign in to comment.