mattermost-mobile/app/client/rest
Jesse Hallam 15f59b7eee
[MM-63728] Add license load metric to About screen (#8769)
* Add license load metric to About screen

- Add REST endpoint to fetch license load percentage
- Display load metric in About screen next to server version

Fixes: https://mattermost.atlassian.net/browse/MM-63728

* MM-63728: Address PR feedback from enahum

- Move license load metric fetch to a remote action
- Use isMinimumServerVersion to check for server 10.8.0 or higher

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* MM-63728: Simplify getLicenseLoadMetric to directly return number

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* MM-63728: Move getLicenseLoadMetric to dedicated license.ts file

- Create new remote action file specifically for license-related functions
- Add test file for the license actions
- Update imports in about.tsx

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* MM-63728: Remove redundant license check in about.tsx

- Rely on getLicenseLoadMetric to handle the license check

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* MM-63728: Update E2E tests for license load metric

- Add license load metric test IDs to about screen
- Update E2E test to check for load metric when license is enabled
- Handle cases where server might not support the feature

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* recover app/actions/remote/general.ts

* MM-63728: Return error from getLicenseLoadMetric instead of silent failure

- Remove silent failure and debug logging
- Return the error object when API call fails
- Update the About component to handle possible error responses
- Update tests to verify error handling

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* MM-63728: Remove groupLabel parameter from getLicenseLoadMetric

- Remove groupLabel parameter from client getLicenseLoadMetric method in interface and implementation
- Update client tests to reflect the parameter removal
- Update license action test to verify no parameter is passed

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* simplify about screen checks

* MM-63728: Use jest.mocked and real version checks in license tests

- Removed isMinimumServerVersion mock, letting tests use real version checking
- Used proper type casting for mock Client
- Added comprehensive version compatibility test cases
- Simplified test setup

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* MM-63728: Remove redundant server version test

- Removed redundant test for different server versions
- Existing tests already cover the necessary version compatibility cases

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* MM-63728: Refactor license test to use better mocking pattern

- Refactored the test file to use a better mocking pattern similar to custom_emoji.test.ts
- Simplified mock declarations using jest.mock()
- Added type import for Client for better readability
- Improved type casting for mock objects

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* npm run fix

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-04-17 17:29:47 -03:00
..
apps.ts Request metrics improvements (#8420) 2025-01-16 13:55:29 -07:00
base.ts Feature schedule posts (#8509) 2025-04-14 22:08:59 +05:30
categories.test.ts MM-59683 + more - Add tests to client/rest (#8447) 2025-01-07 08:23:28 -05:00
categories.ts Request metrics improvements (#8420) 2025-01-16 13:55:29 -07:00
channel_bookmark.test.ts Request metrics improvements (#8420) 2025-01-16 13:55:29 -07:00
channel_bookmark.ts Request metrics improvements (#8420) 2025-01-16 13:55:29 -07:00
channels.test.ts MM-59683 + more - Add tests to client/rest (#8447) 2025-01-07 08:23:28 -05:00
channels.ts Request metrics improvements (#8420) 2025-01-16 13:55:29 -07:00
constants.ts Integrate react-native-network-client (#5499) 2021-07-06 11:16:35 -04:00
custom_profile_attributes.test.ts [MM-62701] [MM-62176]Edit custom profile attributes in user profile (#8557) 2025-02-19 15:51:59 +01:00
custom_profile_attributes.ts [MM-62565] DB only custom profile attributes and fields (#8739) 2025-04-09 15:35:27 +02:00
emojis.test.ts MM-59683 + more - Add tests to client/rest (#8447) 2025-01-07 08:23:28 -05:00
emojis.ts Remove watermelondb limitation on updating an already updated model (#7067) 2023-02-03 17:11:57 +02:00
error.ts Refactor errors around the app (#7306) 2023-05-03 13:08:55 +02:00
files.test.ts MM-59683 + more - Add tests to client/rest (#8447) 2025-01-07 08:23:28 -05:00
files.ts MM-59683 + more - Add tests to client/rest (#8447) 2025-01-07 08:23:28 -05:00
general.test.ts [MM-63728] Add license load metric to About screen (#8769) 2025-04-17 17:29:47 -03:00
general.ts [MM-63728] Add license load metric to About screen (#8769) 2025-04-17 17:29:47 -03:00
groups.test.ts Request metrics improvements (#8420) 2025-01-16 13:55:29 -07:00
groups.ts Request metrics improvements (#8420) 2025-01-16 13:55:29 -07:00
index.test.js [Gekidou] Fix & small refactor to the app entry logic and WS reconnection (#5937) 2022-02-09 12:49:37 -03:00
index.ts Feature schedule posts (#8509) 2025-04-14 22:08:59 +05:30
integrations.test.ts MM-59683 + more - Add tests to client/rest (#8447) 2025-01-07 08:23:28 -05:00
integrations.ts Upgrade RN as well as update or replace other dependencies (#8011) 2024-06-19 09:33:45 +08:00
nps.test.ts MM-59683 + more - Add tests to client/rest (#8447) 2025-01-07 08:23:28 -05:00
nps.ts Remove watermelondb limitation on updating an already updated model (#7067) 2023-02-03 17:11:57 +02:00
plugins.test.ts MM-59683 + more - Add tests to client/rest (#8447) 2025-01-07 08:23:28 -05:00
plugins.ts Remove watermelondb limitation on updating an already updated model (#7067) 2023-02-03 17:11:57 +02:00
posts.test.ts MM-59683 + more - Add tests to client/rest (#8447) 2025-01-07 08:23:28 -05:00
posts.ts Request metrics improvements (#8420) 2025-01-16 13:55:29 -07:00
preferences.test.ts Request metrics improvements (#8420) 2025-01-16 13:55:29 -07:00
preferences.ts Request metrics improvements (#8420) 2025-01-16 13:55:29 -07:00
scheduled_post.test.ts Feature schedule posts (#8509) 2025-04-14 22:08:59 +05:30
scheduled_post.ts Feature schedule posts (#8509) 2025-04-14 22:08:59 +05:30
teams.test.ts MM-59683 + more - Add tests to client/rest (#8447) 2025-01-07 08:23:28 -05:00
teams.ts Request metrics improvements (#8420) 2025-01-16 13:55:29 -07:00
threads.test.ts Request metrics improvements (#8420) 2025-01-16 13:55:29 -07:00
threads.ts Request metrics improvements (#8420) 2025-01-16 13:55:29 -07:00
tos.test.ts MM-59683 + more - Add tests to client/rest (#8447) 2025-01-07 08:23:28 -05:00
tos.ts Remove watermelondb limitation on updating an already updated model (#7067) 2023-02-03 17:11:57 +02:00
tracking.test.ts [MM-62777] Fix errors being nested. Make MFA code more resilient to this situation (#8531) 2025-01-31 08:31:15 +02:00
tracking.ts Fix MM-61975 (#8459) 2025-02-17 13:45:12 +01:00
users.test.ts MM-59683 + more - Add tests to client/rest (#8447) 2025-01-07 08:23:28 -05:00
users.ts Request metrics improvements (#8420) 2025-01-16 13:55:29 -07:00