forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Fleet] Add "Keep Policies up to Date" functionality for integrations (…
…elastic#112702) * Add initial implementation for keep policies up to date functionality * Upgrade package policies during preconfiguration check * Only show keep policies up to date switch for default/auto-update packages * Fix type error * Fixup setup policy upgrade logic * Add migration for keep policies up to date flag * Move setup package policy logic to new module + add tests * Update snapshots to include keepPoliciesUpToDate field * Fix type errors * Fix some CI failures * Fix more type errors * Fix type error in isolation test * Fix package fixtures types * Fix another type error * Move policy upgrade error swallowing up a level in setup * Address PR feedback - Move keep policies up to date switch to separate component - Use PACKAGE_POLICY_SAVED_OBJECT_TYPE instead of magic string * Fix overwriting user values when upgrading Fixes elastic#113731 * Add test package * Fix tests for overridePackageVars * Address PR feedback - Don't index keep_policies_up_to_date field - Use SO_SEARCH_LIMIT constant instead of magic number * Make toast translation usage more consistent Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
- Loading branch information
1 parent
e870b6f
commit 426b119
Showing
41 changed files
with
796 additions
and
13 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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
46 changes: 46 additions & 0 deletions
46
...s/integrations/sections/epm/screens/detail/components/keep_policies_up_to_date_switch.tsx
This file contains 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,46 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import React from 'react'; | ||
import { i18n } from '@kbn/i18n'; | ||
import { FormattedMessage } from '@kbn/i18n/react'; | ||
import { EuiSwitch, EuiSpacer, EuiText, EuiFlexGroup, EuiFlexItem, EuiIcon } from '@elastic/eui'; | ||
|
||
interface Props { | ||
checked: boolean; | ||
onChange: () => void; | ||
} | ||
|
||
export const KeepPoliciesUpToDateSwitch: React.FunctionComponent<Props> = ({ | ||
checked, | ||
onChange, | ||
}) => ( | ||
<> | ||
<EuiSwitch | ||
label={i18n.translate( | ||
'xpack.fleet.integrations.settings.keepIntegrationPoliciesUpToDateLabel', | ||
{ defaultMessage: 'Keep integration policies up to date automatically' } | ||
)} | ||
checked={checked} | ||
onChange={onChange} | ||
/> | ||
<EuiSpacer size="s" /> | ||
<EuiText color="subdued" size="xs"> | ||
<EuiFlexGroup alignItems="center" gutterSize="none"> | ||
<EuiFlexItem grow={false}> | ||
<EuiIcon type="iInCircle" /> | ||
</EuiFlexItem> | ||
<EuiFlexItem grow={false}> | ||
<FormattedMessage | ||
id="xpack.fleet.integrations.settings.keepIntegrationPoliciesUpToDateDescription" | ||
defaultMessage="When enabled, Fleet will attempt to upgrade and deploy integration policies automatically" | ||
/> | ||
</EuiFlexItem> | ||
</EuiFlexGroup> | ||
</EuiText> | ||
</> | ||
); |
This file contains 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 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 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 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 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 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 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 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
Oops, something went wrong.