-
Notifications
You must be signed in to change notification settings - Fork 921
45641 Display ran_custom_mdm_command activities in host and global activity feeds #47897
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
andymFleet
wants to merge
18
commits into
main
Choose a base branch
from
45641-mdm-command-activity-feed-ui
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
25b52c7
Add ran_custom_mdm_command activity when a custom MDM command is run
andymFleet fe2abf8
add change file
andymFleet 023f6ce
Skip activity for hosts where MDM command enqueue partially fails
andymFleet 2b01096
Log activity errors instead of returning them after successful MDM co…
andymFleet 9541478
Assert activity user in MDM command tests
andymFleet 460655b
Enqueue MDM commands using resolved host UUIDs, not raw request input
andymFleet 8ed91ed
Use commandPlatform for activity platform field
andymFleet 24d577c
Merge branch '45640-apple-windows-mdm-command-activities' into 45641-…
andymFleet fb1f40e
Add ran_custom_mdm_command activity feed UI
andymFleet 250bc09
Fix empty bold element when actor_full_name is missing in MDM command…
andymFleet eb93746
Guard against missing command_uuid and host_uuid in MDM command activ…
andymFleet 88601dc
Fix getMdmCommandDisplayName dropping empty last segment for trailing…
andymFleet 48db4ce
Use accurate verb based on MDM command status icon in activity modal
andymFleet 42f27e2
Add additional tests for custom MDM command activity
andymFleet ecca0a9
Merge branch 'main' into 45641-mdm-command-activity-feed-ui
andymFleet dd452f1
Add boundary tests for Windows MDM status code ranges in GetIconName
andymFleet de1124b
Merge branch 'main' into 45641-mdm-command-activity-feed-ui
andymFleet 76f3bef
Merge branch 'main' into 45641-mdm-command-activity-feed-ui
andymFleet File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
69 changes: 69 additions & 0 deletions
69
frontend/pages/hosts/components/CommandDetailsModal/CommandDetailsModal.tests.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| import { GetIconName, getVerbForCommandStatus } from "./CommandDetailsModal"; | ||
|
|
||
| describe("GetIconName", () => { | ||
| it("returns error for Apple Error status", () => { | ||
| expect(GetIconName("Error")).toEqual("error"); | ||
| }); | ||
|
|
||
| it("returns error for Apple CommandFormatError status", () => { | ||
| expect(GetIconName("CommandFormatError")).toEqual("error"); | ||
| }); | ||
|
|
||
| it("returns success for Apple Acknowledged status", () => { | ||
| expect(GetIconName("Acknowledged")).toEqual("success"); | ||
| }); | ||
|
|
||
| it("returns pending-outline for Apple Pending status", () => { | ||
| expect(GetIconName("Pending")).toEqual("pending-outline"); | ||
| }); | ||
|
|
||
| it("returns pending-outline for Apple NotNow status", () => { | ||
| expect(GetIconName("NotNow")).toEqual("pending-outline"); | ||
| }); | ||
|
|
||
| it("returns success for Windows 200 status", () => { | ||
| expect(GetIconName("200")).toEqual("success"); | ||
| }); | ||
|
|
||
| it("returns error for Windows 400 status", () => { | ||
| expect(GetIconName("400")).toEqual("error"); | ||
| }); | ||
|
|
||
| it("returns error for Windows 500 status", () => { | ||
| expect(GetIconName("500")).toEqual("error"); | ||
| }); | ||
|
|
||
| it("returns pending-outline for Windows 101 status", () => { | ||
| expect(GetIconName("101")).toEqual("pending-outline"); | ||
| }); | ||
|
|
||
| it("returns pending-outline for Windows 199 status (upper pending boundary)", () => { | ||
| expect(GetIconName("199")).toEqual("pending-outline"); | ||
| }); | ||
|
|
||
| it("returns success for Windows 399 status (upper success boundary)", () => { | ||
| expect(GetIconName("399")).toEqual("success"); | ||
| }); | ||
|
|
||
| it("returns warning for an unknown status", () => { | ||
| expect(GetIconName("unknown")).toEqual("warning"); | ||
| }); | ||
| }); | ||
|
|
||
| describe("getVerbForCommandStatus", () => { | ||
| it("returns 'ran' for a successful status", () => { | ||
| expect(getVerbForCommandStatus("Acknowledged")).toEqual("ran"); | ||
| }); | ||
|
|
||
| it("returns 'failed to run' for an error status", () => { | ||
| expect(getVerbForCommandStatus("Error")).toEqual("failed to run"); | ||
| }); | ||
|
|
||
| it("returns 'sent' for a pending status", () => { | ||
| expect(getVerbForCommandStatus("Pending")).toEqual("sent"); | ||
| }); | ||
|
|
||
| it("returns 'sent' for an unknown status", () => { | ||
| expect(getVerbForCommandStatus("unknown")).toEqual("sent"); | ||
| }); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,2 @@ | ||
| export { default } from "./CommandDetailsModal"; | ||
| export { GetIconName } from "./CommandDetailsModal"; | ||
| export { GetIconName, getVerbForCommandStatus } from "./CommandDetailsModal"; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.