From ea42eff8e4c105eeb64e72b6f2bcac92ecdd9c82 Mon Sep 17 00:00:00 2001 From: RachelElysia <71795832+RachelElysia@users.noreply.github.com> Date: Fri, 24 Feb 2023 10:38:29 -0500 Subject: [PATCH] Fleet UI: Saving policy platforms always successful even if incompatible (#10058) --- changes/9994-policy-platform-saves | 1 + .../policies/PolicyPage/components/PolicyForm/PolicyForm.tsx | 5 +---- 2 files changed, 2 insertions(+), 4 deletions(-) create mode 100644 changes/9994-policy-platform-saves diff --git a/changes/9994-policy-platform-saves b/changes/9994-policy-platform-saves new file mode 100644 index 0000000000..a75af05ca9 --- /dev/null +++ b/changes/9994-policy-platform-saves @@ -0,0 +1 @@ +- Even for default policies, you can save new (even uncompatible) policy platforms using the platform checkboxes as a user would expect the options to successfully save diff --git a/frontend/pages/policies/PolicyPage/components/PolicyForm/PolicyForm.tsx b/frontend/pages/policies/PolicyPage/components/PolicyForm/PolicyForm.tsx index 06b37edd07..21ea0a16fe 100644 --- a/frontend/pages/policies/PolicyPage/components/PolicyForm/PolicyForm.tsx +++ b/frontend/pages/policies/PolicyPage/components/PolicyForm/PolicyForm.tsx @@ -237,10 +237,7 @@ const PolicyForm = ({ description: lastEditedQueryDescription, query: lastEditedQueryBody, resolution: lastEditedQueryResolution, - platform: - defaultPolicy && lastEditedQueryPlatform - ? lastEditedQueryPlatform - : newPlatformString, + platform: newPlatformString, }; if (isPremiumTier) { payload.critical = lastEditedQueryCritical;