Skip to content

Use the literal resolve action instead of its translation in bulk alert actions - #93

Open
lavr wants to merge 1 commit into
roxy-wi:mainfrom
lavr:fix/bulk-resolve-literal-action
Open

lavr wants to merge 1 commit into
roxy-wi:mainfrom
lavr:fix/bulk-resolve-literal-action

Conversation

@lavr

@lavr lavr commented Sep 20, 2026

Copy link
Copy Markdown

Fixes #92.

The bulk resolve action used the translated action name as an identifier, and that value ends up in the API path:

apiPost("/api/alerts/" + id + "/" + action, {}, next);   // alerts.js:3211

With a non-English UI this produced requests like POST /api/alerts/7/закрыть, which 404. It worked in English only because the English translation of alert_details.bulk.resolve_action happens to be the string resolve.

This replaces the translation with the literal "resolve" in the three places where the value is used as an identifier, matching how "ack" is already handled:

  • alerts.js:144 — the filter that decides which selected groups are eligible
  • alerts.js:259 — the selected-count shown on the button
  • alerts.js:3191 — the call that triggers the bulk action

Changing only the call site would not be enough: the filter at line 144 compares against the same translated value, so it would stop matching and the button would report an empty selection instead.

alerts.js:3233 still uses i18n.t("alert_details.bulk.resolve_action") to build the human-readable label, which is the correct use of the translation and is left unchanged.

Verified against the Russian locale, where the bulk resolve button now sends POST /api/alerts/{id}/resolve.

@Aidaho12

Copy link
Copy Markdown
Member

Hello, thanks for the pl, but could you add comment with /cla-sign?

@Aidaho12

Copy link
Copy Markdown
Member

Also please, do the pl to the release/2.3 branch

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bulk resolve sends the translated action name as the API path, breaking it in every non-English locale

2 participants