Commit graph

7 commits

Author SHA1 Message Date
Maria A Nunez
461db71178
Add single-channel guest tracking and reporting (#35451)
* Add single-channel guest tracking and reporting

- Add AnalyticsGetSingleChannelGuestCount store method to count guests in exactly one channel
- Exclude single-channel guests from active user seat count in GetServerLimits
- Add single-channel guest count to standard analytics response
- Add Single-channel Guests card to System Statistics page with overage warning
- Add Single-channel guests row to Edition and License page with overage styling
- Add dismissible admin-only banner when single-channel guest limit is exceeded
- Gate feature behind non-Entry SKU and guest accounts enabled checks
- Re-fetch server limits on config changes for reactive UI updates
- Fix label alignment in license details panel

Made-with: Cursor

* Refine single-channel guest tracking

- Remove license GuestAccounts feature check from shouldTrackSingleChannelGuests (only config matters)
- Re-add getServerLimits calls on page mount for fresh data
- Remove config-change reactivity code (componentDidUpdate, useEffect)
- Add server i18n translations for error strings
- Sync webapp i18n via extract
- Add inline comments for business logic
- Restore struct field comments in ServerLimits model
- Add Playwright E2E tests for single-channel guest feature
- Fix label alignment in license details panel

Made-with: Cursor

* Guests over limit fixes and PR feedback

* Fix linter issues and code quality improvements

- Use max() builtin to clamp adjusted user count instead of if-statement (modernize linter)
- Change banner type from ADVISOR to CRITICAL for proper red color styling

Made-with: Cursor

* Fix overage warnings incorrectly counting single-channel guests

Single-channel guests are free and should not trigger license seat
overage warnings. Update all overage checks to use
serverLimits.activeUserCount (seat-adjusted, excluding SCG) instead
of the raw total_users_count or TOTAL_USERS analytics stat.

- UserSeatAlertBanner on License page: use serverLimits.activeUserCount
- UserSeatAlertBanner on Site Statistics page: use serverLimits.activeUserCount
- ActivatedUserCard display and overage check: use serverLimits.activeUserCount
- OverageUsersBanner: use serverLimits.activeUserCount

Made-with: Cursor

* Use license.Users as fallback for singleChannelGuestLimit before limits load

This prevents the SingleChannelGuestsCard from showing a false overage
state before serverLimits has been fetched, while still rendering the
card immediately on page load.

Made-with: Cursor

* Fix invite modal overage banner incorrectly counting single-channel guests

Made-with: Cursor

* Fix invitation modal tests missing limits entity in mock state

Made-with: Cursor

* Fix tests

* Add E2E test for single-channel guest exceeded limit scenario

Made-with: Cursor

* Fix TypeScript errors in single channel guests E2E test

Made-with: Cursor

* Fix channel name validation error caused by unawaited async getRandomId()

Made-with: Cursor

* Add contextual tooltips to stat cards when guest accounts are enabled

Made-with: Cursor

* Code review feedback: query builder, readability, tooltips, and alignment fixes

Made-with: Cursor

* Fix license page tooltip alignment, width, and SaveLicense SCG exclusion

Made-with: Cursor

* Fix banner dismiss, license spacing, and add dismiss test

Made-with: Cursor

* Exclude DM/GM channels from single-channel guest count and fix E2E tests

Filter the AnalyticsGetSingleChannelGuestCount query to only count
memberships in public/private channels, excluding DMs and GMs. Update
store tests with DM-only, GM-only, and mixed membership cases. Fix E2E
overage test to mock the server limits API instead of skipping, and
correct banner locator to use data-testid.

Made-with: Cursor
2026-03-10 10:31:10 -04:00
Maria A Nunez
3253b9ff6d
Message History Limits in Entry Edition (#33831)
* Support for Entry license with limits + updates to Edition & License screen

* Refactor message history limit to use entry sku limits

* Fixed missing update on license change

* Fix typo in limit types

* Revert unnecessary thread change

* Revert merge issue

* Cleanup

* Fix CTAs of limit notifications

* Linting

* More linting

* Linting and fix tests

* More linting

* Fix tests

* PR feedback and fix tests

* Fix tests

* Fix test

* Fix test

* Linting

* Simplified Limit panels

* Linting

* PR feedback

* Revert back job time

* Linting

* linting

* Fixed issue switching in RHS

* PR Feedback

---------

Co-authored-by: Nick Misasi <nick.misasi@mattermost.com>
Co-authored-by: Mattermost Build <build@mattermost.com>
2025-09-10 22:52:19 -04:00
Harshil Sharma
13d9a9b6cc
Removed post limit warning banner (#27036)
Co-authored-by: Mattermost Build <build@mattermost.com>
2024-05-20 09:13:16 +05:30
Harshil Sharma
b4a1b33d39
Added post limit warning (#26793)
* Renamed user limit API to app limit API

* Added post warning limit

* Added tests

* Fixed types

* Renamed AppLimits to ServerLimits

* Fixed tests and review fixes

* Updated generated code

* Updated server i18n

* Fixed TestCreateUserOrGuest test

* Exclude deleted posts from post count for liims

* Reduced limits for ease of testing

* Restored original limts
2024-04-18 11:50:30 +05:30
Harshil Sharma
b02d634916
User limit enforcement (#26511)
* Added hard limits when creating user

* Added check to user activation

* Added missing check for licensed servers

* Fix i18n

* Fixed style order

* Added a separate hard limit along with existing 10k user soft limit

* For CI

* Fixing flaky test, hopefully

* Added tests
2024-03-21 19:41:53 +05:30
Harshil Sharma
d23c16b9aa
Removed user bands (#25806) 2023-12-25 07:11:28 +00:00
Harshil Sharma
a59f5ccded
Added API to return user count bands and user count (#25796) 2023-12-21 13:00:19 +00:00