Skip to content

fix(FR-2228): add email input field to password change modal#5777

Closed
ironAiken2 wants to merge 1 commit intographite-base/5777from
03-06-fix_fr-2228_add_email_input_field_to_password_change_modal
Closed

fix(FR-2228): add email input field to password change modal#5777
ironAiken2 wants to merge 1 commit intographite-base/5777from
03-06-fix_fr-2228_add_email_input_field_to_password_change_modal

Conversation

@ironAiken2
Copy link
Copy Markdown
Contributor

@ironAiken2 ironAiken2 commented Mar 6, 2026

Resolves #5776 (FR-2228, FR-2264)

The 'Change Password' link in the login form previously opened a help panel (sidebar) instead of a proper input UI. This meant users had no way to actually enter their email address to receive a password change link.

This PR extracts the forgot-password flow into a standalone SendChangePasswordEmailModal component with a proper email form input, fixing the broken user flow.

Changes:

  • Added SendChangePasswordEmailModal as a dedicated React modal component
  • Modal includes email input with validation and submit button
  • Password change link now opens the modal instead of the help panel

Checklist: (if applicable)

  • Documentation
  • Minium required manager version
  • Specific setting for review (eg., KB link, endpoint or how to setup)
  • Minimum requirements to check during review
  • Test case(s) to demonstrate the difference of before/after

Copy link
Copy Markdown
Contributor Author

ironAiken2 commented Mar 6, 2026


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • flow:merge-queue - adds this PR to the back of the merge queue
  • flow:hotfix - for urgent changes, fast-track this PR to the front of the merge queue

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has required the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 6, 2026

Coverage report for ./react

St.
Category Percentage Covered / Total
🔴 Statements
7.55% (-0.01% 🔻)
1189/15742
🔴 Branches
6.36% (-0% 🔻)
695/10923
🔴 Functions
5.04% (-0.01% 🔻)
226/4480
🔴 Lines
7.39% (-0.01% 🔻)
1136/15365

Test suite run success

624 tests passing in 32 suites.

Report generated by 🧪jest coverage report action from 302c82c

@ironAiken2 ironAiken2 force-pushed the 02-26-fix_fr-2173_fix_password_change_modal_blocked_by_login_modal_on_password_expiry branch from 180cb24 to 4a8efd7 Compare March 6, 2026 08:19
@ironAiken2 ironAiken2 force-pushed the 03-06-fix_fr-2228_add_email_input_field_to_password_change_modal branch from 682c631 to 302c82c Compare March 6, 2026 08:19
@ironAiken2 ironAiken2 changed the base branch from 02-26-fix_fr-2173_fix_password_change_modal_blocked_by_login_modal_on_password_expiry to graphite-base/5777 March 9, 2026 02:36
@ironAiken2 ironAiken2 marked this pull request as ready for review March 10, 2026 10:27
Copilot AI review requested due to automatic review settings March 10, 2026 10:27
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes the broken “forgot/change password” flow in the login UI by replacing the help-panel-only behavior with a modal that collects an email address and triggers the password-change email endpoint.

Changes:

  • Adds a new SendChangePasswordEmailModal UI with an email input + submit action.
  • Updates the “Change Password” link to open the modal instead of populating the help side panel.
  • Wires the modal submit to POST /cloud/send-password-change-email using the anonymous client.

You can also share your feedback on Copilot code review. Take the survey.

<Form.Item name="email" rules={[{ required: true, type: 'email' }]}>
<Input
prefix={<MailOutlined />}
placeholder={t('login.E-mailOrUsername')}
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The field is validated as type: 'email' but the placeholder uses t('login.E-mailOrUsername'), which suggests usernames are accepted even though they will be rejected by validation (and the API wrapper docs for /cloud/send-password-change-email indicate it expects an email). Consider using an email-only placeholder/label (and optionally type="email"/autoComplete="email") so the UI matches the actual accepted input.

Suggested change
placeholder={t('login.E-mailOrUsername')}
type="email"
autoComplete="email"
placeholder={t('login.E-mail')}

Copilot uses AI. Check for mistakes.
<Form.Item name="email" rules={[{ required: true, type: 'email' }]}>
<Input
prefix={<MailOutlined />}
placeholder={t('login.E-mailOrUsername')}
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The email input in this modal is missing an accessible label (aria-label or a visible Form.Item label). In the same file, the login identifier field sets aria-label="Email or Username"; adding a similar label here will improve screen reader support.

Suggested change
placeholder={t('login.E-mailOrUsername')}
placeholder={t('login.E-mailOrUsername')}
aria-label={t('login.E-mailOrUsername')}

Copilot uses AI. Check for mistakes.
content: t('login.DescChangePasswordEmail'),
})
}
onClick={() => setShowChangePasswordEmail(true)}
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clicking “Change Password” only opens the modal, but it doesn’t clear/hide an already-open help side panel. Since the help panel uses a higher z-index (1060) than the modal (1002), the panel can visually overlap the modal and block interaction. Consider closing the help panel when opening this modal (e.g., setHelpPanel(null)) or adjust the visibility/z-index relationship so the modal always stays on top.

Suggested change
onClick={() => setShowChangePasswordEmail(true)}
onClick={() => {
setShowChangePasswordEmail(true);
setHelpPanel(null);
}}

Copilot uses AI. Check for mistakes.
Comment on lines +796 to +807
const onSubmit = () => {
form.validateFields().then((values) => {
mutation.mutate(
{ email: values.email },
{
onSuccess() {
message.success(t('login.EmailSent'));
onCancel();
},
},
);
});
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

onSubmit calls form.validateFields().then(...) without handling the rejection path, which can result in an unhandled promise rejection when validation fails. Also, the mutation only defines onSuccess—errors (network/server) will fail silently with no user feedback. Please handle validation failures (catch/early return) and surface mutation errors (e.g., onError with message.error(...) or mutateAsync in a try/catch) similar to the pattern used in SignupModal.

Suggested change
const onSubmit = () => {
form.validateFields().then((values) => {
mutation.mutate(
{ email: values.email },
{
onSuccess() {
message.success(t('login.EmailSent'));
onCancel();
},
},
);
});
const onSubmit = async () => {
let values: { email: string };
try {
values = await form.validateFields();
} catch {
// Validation failed; do not proceed with mutation.
return;
}
mutation.mutate(
{ email: values.email },
{
onSuccess() {
message.success(t('login.EmailSent'));
onCancel();
},
onError(error) {
const errorMessage =
(error as { message?: string })?.message ||
t('login.EmailSendFailed');
message.error(errorMessage);
},
},
);

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor

@agatha197 agatha197 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please check copilot reviews

@ironAiken2 ironAiken2 marked this pull request as draft March 18, 2026 03:43
@ironAiken2 ironAiken2 closed this Mar 19, 2026
Copy link
Copy Markdown
Contributor Author

duplicated by #6033

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100~500 LoC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants