## Context
We've been seeing many `NotFoundError: Failed to execute 'removeChild'
on 'Node'` and `NotFoundError: Failed to execute 'insertBefore' on
'Node'` events on Sentry which are historically known to be caused by
Google Translate in the browser.
There's technically no _right way_ to address this unfortunately, but
one of the solutions which should address most of these issues is to
wrap any dynamic text within a span - we've considered that quite a
while back tbh but never took the time to do this until today with the
help of Claude. Although just a heads up that it might not necessarily
completely eradicate those issues.
Also added an eslint rule which should prevent future occurences of this
<img width="1264" height="192" alt="image"
src="https://github.com/user-attachments/assets/b2c32ea0-45a2-4ccd-82fe-1a859905fc29"
/>
## What kind of change does this PR introduce?
Feature.
## What is the current behavior?
The Dashboard only offers a reset password action for the `postgres`
role (Database Settings). To change the password of a custom role, users
have to run `alter role ... password` in the SQL editor.
## What is the new behavior?
Each role row in Database > Roles has a "Reset password" item in its
actions menu. It opens a dialog with a warning that anything using the
old password will be disconnected, and the shared password field
(generate and copy). The password is required in this dialog.
- The item is disabled for system roles, and for roles that can't log
in, with a tooltip explaining why.
- It uses the existing role update mutation, so no platform endpoint is
involved.
- `RolePasswordField` gains `isOptional` and `layout` props so the
dialog can reuse it.
<img width="271" height="174" alt="Screenshot 2026-11-02 at 11 11 33"
src="https://github.com/user-attachments/assets/36f05fa0-e95c-440c-b6bb-4fadb466c2f6"
/>
<img width="543" height="414" alt="Screenshot 2026-11-02 at 11 11 17"
src="https://github.com/user-attachments/assets/87ba4f50-1315-4e07-b390-9c5b6beba129"
/>
## Testing
New `RoleRow` component tests cover the item being available for a
custom role that can log in, disabled for system roles and roles that
can't log in, the required-password validation, and a successful reset.
Resolves FE-4813.
## What kind of change does this PR introduce?
Feature.
## What is the current behavior?
Turning on "User can login" for an existing role that couldn't log in
gives no way to set a password. Users have to run `alter role ...
password` in the SQL editor.
## What is the new behavior?
In Database > Roles, turning on "User can login" for a role that
couldn't log in now shows the same optional password field as the create
panel, including the generate and copy actions.
- The field only shows for roles that don't currently have login. Roles
that can already log in don't get one.
- The password is sent only when login is gained in that save and the
field isn't empty. An empty field turns on login without a password, as
in create mode.
- The password is kept out of the "changed fields" diff, so unrelated
edits never send `password ''`.
- The password field is extracted from the create panel into a shared
`RolePasswordField`, which also owns the "Password generated"
announcement state.
Follow-up to #52463. Changing the password of a role that can already
log in is tracked separately and is the next PR in this stack.
<img width="840" height="655" alt="Screenshot 2026-10-29 at 15 47 33"
src="https://github.com/user-attachments/assets/8bb52e86-7b1e-4911-b625-2532fb7dfa25"
/>
## Testing
- New `RoleRow` component tests cover the field's visibility, sending
the password, and omitting it when empty or for roles that already have
login.
- Existing `CreateRolePanel` tests still pass.
Part of FE-4763.