Skip to content

Commit

Permalink
[Security Solution][Endpoint][Admin] Custom malware user notification…
Browse files Browse the repository at this point in the history
… message allows spaces now (#85207)

Co-authored-by: Kibana Machine <[email protected]>
  • Loading branch information
parkiino and kibanamachine authored Dec 14, 2020
1 parent ea4e222 commit 80ca5a5
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,43 @@ export const getPolicyDataForUpdate = (
): NewPolicyData | Immutable<NewPolicyData> => {
// eslint-disable-next-line @typescript-eslint/naming-convention
const { id, revision, created_by, created_at, updated_by, updated_at, ...newPolicy } = policy;
return newPolicy;

// trim custom malware notification string
return {
...newPolicy,
inputs: (newPolicy as Immutable<NewPolicyData>).inputs.map((input) => ({
...input,
config: input.config && {
...input.config,
policy: {
...input.config.policy,
value: {
...input.config.policy.value,
windows: {
...input.config.policy.value.windows,
popup: {
...input.config.policy.value.windows.popup,
malware: {
...input.config.policy.value.windows.popup.malware,
message: input.config.policy.value.windows.popup.malware.message.trim(),
},
},
},
mac: {
...input.config.policy.value.mac,
popup: {
...input.config.policy.value.mac.popup,
malware: {
...input.config.policy.value.mac.popup.malware,
message: input.config.policy.value.mac.popup.malware.message.trim(),
},
},
},
},
},
},
})),
};
};

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ export const MalwareProtections = React.memo(() => {
if (policyDetailsConfig) {
const newPayload = cloneDeep(policyDetailsConfig);
for (const os of OSes) {
newPayload[os].popup[protection].message = event.target.value.trim();
newPayload[os].popup[protection].message = event.target.value;
}
dispatch({
type: 'userChangedPolicyConfig',
Expand Down

0 comments on commit 80ca5a5

Please sign in to comment.