Show ABM organization name in edit-fleets success toast (#49877)

<!-- Add the related story/sub-task/bug number, like Resolves #123, or
remove if NA -->
**Related issue:** Resolves #48914

## Description

The success toast shown after editing fleet assignments for an Apple
Business Manager (ABM) organization read:

> Successfully updated fleets for AB token.

The trailing "AB token" made the message unclear. It now names the
organization instead, matching the modal's title:

> Successfully updated fleets for `<org name>`.

The organization name (`token.org_name`) was already available in the
component (it's used as the modal title), so this is a copy-only change
with no new data plumbing.

Note: the issue's expected behavior left the exact wording to Product
("TODO — Product to decide"). This implements Product's written
suggestion (`Successfully updated fleets for {org name}`) so the awkward
wording isn't blocking; the string is trivial to adjust if
Product/design prefer different phrasing in review.

## Testing

- Manually QA'd in the UI: with a configured ABM organization, edited a
fleet assignment and confirmed the toast now shows the org name.
- Existing unit tests for the modal's helpers (`getOptions`,
`getSelectedTeamIds`) still pass; no test asserts the toast string.
- `eslint` and `prettier` pass on the changed file (added
`token.org_name` to the `useCallback` dependency array to satisfy
`react-hooks/exhaustive-deps`).

# Checklist for submitter

- [x] Changes file added for user-visible changes in `changes/`.
See [Changes
files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/guides/committing-changes.md#changes-files)
for more information.
- [x] Input data is properly validated, `SELECT *` is avoided, SQL
injection is prevented (using placeholders for values in statements), JS
inline code is prevented especially for url redirects, and untrusted
data interpolated into shell scripts/commands is validated against shell
metacharacters.

## Testing

- [x] QA'd all new/changed functionality manually


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Bug Fixes**
* Updated the success notification shown after fleet teams are saved to
include the associated organization name.
* Ensured the notification always reflects the currently selected
organization.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
Rajendra Kadam
2026-07-24 13:30:57 +05:30
committed by GitHub
parent b22a046a96
commit aa572dcca4
2 changed files with 10 additions and 2 deletions
+1
View File
@@ -0,0 +1 @@
- Improved the Apple Business success toast shown after editing fleet assignments to name the organization.
@@ -111,14 +111,21 @@ const EditTeamsAbmModal = ({
tokenId: token.id,
teams: getSelectedTeamIds(selectedTeamNames, availableTeams),
});
notify.success("Successfully updated fleets for AB token.");
notify.success(`Successfully updated fleets for ${token.org_name}`);
onSuccess();
} catch (e) {
notify.error("Couldnt edit. Please try again.", { response: e });
onCancel();
}
},
[token.id, selectedTeamNames, availableTeams, onSuccess, onCancel]
[
token.id,
token.org_name,
selectedTeamNames,
availableTeams,
onSuccess,
onCancel,
]
);
return (