Skip to content

Export shared member name comparator and use it in team chat sharing#9799

Draft
Saby-Bishops wants to merge 1 commit intomasterfrom
codex/export-name-based-sorting-and-add-consumers
Draft

Export shared member name comparator and use it in team chat sharing#9799
Saby-Bishops wants to merge 1 commit intomasterfrom
codex/export-name-based-sorting-and-add-consumers

Conversation

@Saby-Bishops
Copy link
Copy Markdown
Member

Motivation

  • Provide a stable, standalone name-based comparator so other modules can apply the same team-member sorting semantics when userDoc is missing or partial.
  • Prevent divergent comparator behavior across modules by centralizing the sort key and making it explicitly consumable.

Description

  • Exported a resilient sort key and comparator in src/app/teams/teams.utils.ts as memberSortName and memberNameCompare with a brief docstring describing intended external usage.
  • Hardened the comparator fallback chain to use userDoc.doc.lastName, userDoc.lastName, userDoc.fullName, name, and finally userId when available.
  • Added an explicit external consumer by importing and applying memberNameCompare in src/app/shared/dialogs/dialogs-chat-share.component.ts to sort membership recipients before sending notifications.
  • Added unit tests in src/app/shared/dialogs/dialogs-chat-share.component.spec.ts that assert membership filtering and stable name sorting when userDoc is missing.

Testing

  • Added a unit spec file src/app/shared/dialogs/dialogs-chat-share.component.spec.ts covering membership filtering and name-sorting behavior (tests present in the tree).
  • Attempted to run the spec with npm run test / npx ng test for the single spec, but automated test execution failed in this environment due to missing Angular CLI (ng: not found / CLI executable unavailable).
  • No other automated test failures detected in this change set during local validation steps.

Codex Task

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant