[Fleet] Bugfix: Apply namespace from agent policy if there is one when adding integration (#149949)

## Summary

Closes #149919 

Apply the default namespace of the agent policy if there is one when
adding an integration to a policy.


https://user-images.githubusercontent.com/3315046/215801897-60754173-167e-4522-91ab-0566e6c83eb5.mp4
This commit is contained in:
Mark Hopkin 2023-01-31 16:35:01 +00:00 committed by GitHub
parent d715cf6ec4
commit 4e6c3f6540
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -204,7 +204,7 @@ export function useOnSubmit({
packageToPackagePolicy(
packageInfo,
agentPolicy?.id || '',
DEFAULT_PACKAGE_POLICY.namespace,
agentPolicy?.namespace || DEFAULT_PACKAGE_POLICY.namespace,
DEFAULT_PACKAGE_POLICY.name || incrementedName,
DEFAULT_PACKAGE_POLICY.description,
integrationToEnable