mattermost-mobile/app/actions/remote
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
..
entry Feature schedule posts (#8509) 2025-04-14 22:08:59 +05:30
apps.test.ts MM-59445 + others - Add tests for channel bookmarks, systems, apps and tos files in remote/actions (#8558) 2025-02-07 23:57:17 +08:00
apps.ts Make attachments and app bindings more robust yet secure (#8570) 2025-03-14 12:02:32 +01:00
category.test.ts Add tests for actions/remote/category (#8371) 2024-11-25 11:58:50 -05:00
category.ts Refactor errors around the app (#7306) 2023-05-03 13:08:55 +02:00
channel.test.ts Login improvement (#8306) 2024-11-13 08:06:12 +08:00
channel.ts Feature schedule posts (#8509) 2025-04-14 22:08:59 +05:30
channel_bookmark.test.ts Only fetch bookmarks when the license allows to use them (#8616) 2025-02-28 10:25:32 +01:00
channel_bookmark.ts Only fetch bookmarks when the license allows to use them (#8616) 2025-02-28 10:25:32 +01:00
command.test.ts Increase branch test coverage of actions/remote files (#8370) 2024-11-25 12:02:34 -05:00
command.ts MM-59444 Add tests for actions/remote/command (#8326) 2024-11-11 08:29:32 -05:00
custom_emoji.test.ts Improve emoji picker performance introducing flashList (#8650) 2025-03-11 22:09:46 +08:00
custom_emoji.ts Improve emoji picker performance introducing flashList (#8650) 2025-03-11 22:09:46 +08:00
file.test.ts test(MM-59431): file.ts unit test (#8424) 2025-01-08 20:19:24 -07:00
file.ts Channel Bookmarks (#7817) 2024-07-18 09:10:28 +08:00
general.ts Refactor errors around the app (#7306) 2023-05-03 13:08:55 +02:00
groups.test.ts Add tests to actions/remote/groups (#8303) 2024-11-04 19:24:01 +08:00
groups.ts Request metrics improvements (#8420) 2025-01-16 13:55:29 -07:00
integrations.ts Refactor errors around the app (#7306) 2023-05-03 13:08:55 +02:00
license.test.ts [MM-63728] Add license load metric to About screen (#8769) 2025-04-17 17:29:47 -03:00
license.ts [MM-63728] Add license load metric to About screen (#8769) 2025-04-17 17:29:47 -03:00
notifications.test.ts Fix team sidebar not showing thread unreads (#8624) 2025-03-18 13:33:15 +01:00
notifications.ts Add test notification tool (#8271) 2024-11-11 10:22:57 +01:00
nps.ts Refactor errors around the app (#7306) 2023-05-03 13:08:55 +02:00
performance.test.ts Add performance metrics to the app (#7953) 2024-06-12 09:45:27 +02:00
performance.ts Add performance metrics to the app (#7953) 2024-06-12 09:45:27 +02:00
permalink.ts Refactor errors around the app (#7306) 2023-05-03 13:08:55 +02:00
post.test.ts Fix team sidebar not showing thread unreads (#8624) 2025-03-18 13:33:15 +01:00
post.ts Request metrics improvements (#8420) 2025-01-16 13:55:29 -07:00
preference.test.ts Fix team sidebar not showing thread unreads (#8624) 2025-03-18 13:33:15 +01:00
preference.ts Request metrics improvements (#8420) 2025-01-16 13:55:29 -07:00
reactions.test.ts Fix team sidebar not showing thread unreads (#8624) 2025-03-18 13:33:15 +01:00
reactions.ts [MM-42586] Reaction toggle behavior (#7674) 2023-11-22 21:05:58 +08:00
retry.test.ts MM-59433 Add unit tests to actions/remote/retry (#8445) 2025-01-08 12:30:16 -05:00
retry.ts Refactor errors around the app (#7306) 2023-05-03 13:08:55 +02:00
role.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
search.test.ts Fix team sidebar not showing thread unreads (#8624) 2025-03-18 13:33:15 +01:00
search.ts MM-59683 + more - Add tests to client/rest (#8447) 2025-01-07 08:23:28 -05:00
session.test.ts Fix MM-61975 (#8459) 2025-02-17 13:45:12 +01:00
session.ts Fix MM-61975 (#8459) 2025-02-17 13:45:12 +01:00
systems.test.ts MM-59445 + others - Add tests for channel bookmarks, systems, apps and tos files in remote/actions (#8558) 2025-02-07 23:57:17 +08:00
systems.ts Request metrics improvements (#8420) 2025-01-16 13:55:29 -07:00
team.test.ts Feature schedule posts (#8509) 2025-04-14 22:08:59 +05:30
team.ts Feature schedule posts (#8509) 2025-04-14 22:08:59 +05:30
terms_of_service.test.ts MM-59445 + others - Add tests for channel bookmarks, systems, apps and tos files in remote/actions (#8558) 2025-02-07 23:57:17 +08:00
terms_of_service.ts Refactor errors around the app (#7306) 2023-05-03 13:08:55 +02:00
thread.test.ts Fix team sidebar not showing thread unreads (#8624) 2025-03-18 13:33:15 +01:00
thread.ts Better handle threads sync (#8641) 2025-03-19 09:23:22 +01:00
user.test.ts [MM-62666] Cpa sort order (#8618) 2025-02-25 10:54:38 +01:00
user.ts [MM-62565] DB only custom profile attributes and fields (#8739) 2025-04-09 15:35:27 +02:00