Skip to content

Commit

Permalink
[Fleet] Remove Fleet server upgrade modal (#142622)
Browse files Browse the repository at this point in the history
  • Loading branch information
nchaulet authored Oct 4, 2022
1 parent ae07eb2 commit 87fa95d
Show file tree
Hide file tree
Showing 11 changed files with 26 additions and 294 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ properties:
type: string
has_seen_add_data_notice:
type: boolean
has_seen_fleet_migration_notice:
type: boolean
fleet_server_hosts:
type: array
items:
Expand Down
1 change: 0 additions & 1 deletion x-pack/plugins/fleet/common/types/models/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import type { SavedObjectAttributes } from '@kbn/core/public';

export interface BaseSettings {
has_seen_add_data_notice?: boolean;
has_seen_fleet_migration_notice?: boolean;
fleet_server_hosts: string[];
}

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,7 @@ describe('AgentApp', () => {
mockedUseGetSettings.mockReturnValue({
isLoading: false,
data: {
item: {
has_seen_fleet_migration_notice: true,
},
item: {},
},
} as any);
mockedUseAuthz.mockReturnValue({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,20 @@
* 2.0.
*/

import React, { useCallback, useEffect, useState } from 'react';
import React from 'react';
import { FormattedMessage } from '@kbn/i18n-react';
import { Router, Route, Switch, useHistory } from 'react-router-dom';
import { EuiButton, EuiFlexGroup, EuiFlexItem } from '@elastic/eui';

import { FLEET_ROUTING_PATHS } from '../../constants';
import { Loading, Error } from '../../components';
import {
useConfig,
useFleetStatus,
useBreadcrumbs,
useAuthz,
useGetSettings,
useFlyoutContext,
} from '../../hooks';
import { useConfig, useFleetStatus, useBreadcrumbs, useAuthz, useFlyoutContext } from '../../hooks';
import { DefaultLayout, WithoutHeaderLayout } from '../../layouts';

import { AgentListPage } from './agent_list_page';
import { FleetServerRequirementPage, MissingESRequirementsPage } from './agent_requirements_page';
import { AgentDetailsPage } from './agent_details_page';
import { NoAccessPage } from './error_pages/no_access';
import { FleetServerUpgradeModal } from './components/fleet_server_upgrade_modal';

export const AgentsApp: React.FunctionComponent = () => {
useBreadcrumbs('agent_list');
Expand All @@ -36,20 +28,6 @@ export const AgentsApp: React.FunctionComponent = () => {
const fleetStatus = useFleetStatus();
const flyoutContext = useFlyoutContext();

const settings = useGetSettings();

const [fleetServerModalVisible, setFleetServerModalVisible] = useState(false);
const onCloseFleetServerModal = useCallback(() => {
setFleetServerModalVisible(false);
}, [setFleetServerModalVisible]);

useEffect(() => {
// if it's undefined do not show the modal
if (settings.data && settings.data?.item.has_seen_fleet_migration_notice === false) {
setFleetServerModalVisible(true);
}
}, [settings.data]);

if (!agents.enabled) return null;
if (!fleetStatus.missingRequirements && fleetStatus.isLoading) {
return <Loading />;
Expand Down Expand Up @@ -114,9 +92,6 @@ export const AgentsApp: React.FunctionComponent = () => {
</Route>
<Route path={FLEET_ROUTING_PATHS.agents}>
<DefaultLayout section="agents" rightColumn={rightColumn}>
{fleetServerModalVisible && (
<FleetServerUpgradeModal onClose={onCloseFleetServerModal} />
)}
{displayInstructions ? (
<FleetServerRequirementPage showEnrollmentRecommendation={false} />
) : (
Expand Down
4 changes: 3 additions & 1 deletion x-pack/plugins/fleet/server/saved_objects/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ import {
migratePackagePolicyToV840,
} from './migrations/to_v8_4_0';
import { migratePackagePolicyToV850, migrateAgentPolicyToV850 } from './migrations/to_v8_5_0';
import { migrateSettingsToV860 } from './migrations/to_v8_6_0';

/*
* Saved object types and mappings
Expand All @@ -56,6 +57,7 @@ import { migratePackagePolicyToV850, migrateAgentPolicyToV850 } from './migratio
const getSavedObjectTypes = (
encryptedSavedObjects: EncryptedSavedObjectsPluginSetup
): { [key: string]: SavedObjectsType } => ({
// Deprecated
[GLOBAL_SETTINGS_SAVED_OBJECT_TYPE]: {
name: GLOBAL_SETTINGS_SAVED_OBJECT_TYPE,
hidden: false,
Expand All @@ -67,12 +69,12 @@ const getSavedObjectTypes = (
properties: {
fleet_server_hosts: { type: 'keyword' },
has_seen_add_data_notice: { type: 'boolean', index: false },
has_seen_fleet_migration_notice: { type: 'boolean', index: false },
},
},
migrations: {
'7.10.0': migrateSettingsToV7100,
'7.13.0': migrateSettingsToV7130,
'8.6.0': migrateSettingsToV860,
},
},
[AGENT_POLICY_SAVED_OBJECT_TYPE]: {
Expand Down
20 changes: 20 additions & 0 deletions x-pack/plugins/fleet/server/saved_objects/migrations/to_v8_6_0.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* 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 type { SavedObjectMigrationFn } from '@kbn/core/server';

import type { Settings } from '../../../common/types';

export const migrateSettingsToV860: SavedObjectMigrationFn<Settings, Settings> = (
settingsDoc,
migrationContext
) => {
// @ts-expect-error has_seen_fleet_migration_notice property does not exists anymore
delete settingsDoc.attributes.has_seen_fleet_migration_notice;

return settingsDoc;
};
1 change: 0 additions & 1 deletion x-pack/plugins/fleet/server/types/rest_spec/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ export const PutSettingsRequestSchema = {
})
),
has_seen_add_data_notice: schema.maybe(schema.boolean()),
has_seen_fleet_migration_notice: schema.maybe(schema.boolean()),
additional_yaml_config: schema.maybe(schema.string()),
// Deprecated not used
kibana_urls: schema.maybe(
Expand Down
12 changes: 0 additions & 12 deletions x-pack/plugins/translations/translations/fr-FR.json
Original file line number Diff line number Diff line change
Expand Up @@ -12779,9 +12779,6 @@
"xpack.fleet.fleetServerSetup.deploymentModeProductionOption": "{production} : fournissez vos propres certificats. Cette option demande aux agents de préciser une clé de certificat lors de leur enregistrement avec Fleet",
"xpack.fleet.fleetServerSetup.deploymentModeQuickStartOption": "{quickStart} : le serveur Fleet génère un certificat autosigné. Les agents suivants doivent être enregistrés avec l'indicateur --insecure. Non recommandé pour les cas d'utilisation en production.",
"xpack.fleet.fleetServerSetupPermissionDeniedErrorMessage": "Le serveur Fleet doit être configuré. Pour cela, le privilège de cluster {roleName} est requis. Contactez votre administrateur.",
"xpack.fleet.fleetServerUpgradeModal.breakingChangeMessage": "Il s'agit d'un changement majeur, c'est pourquoi nous l'appliquons dans une version bêta. Nous vous prions de nous excuser pour la gêne occasionnée. Partagez {link} si vous avez des questions ou si vous avez besoin d'aide.",
"xpack.fleet.fleetServerUpgradeModal.cloudDescriptionMessage": "Le serveur Fleet est désormais disponible et renforce la scalabilité et la sécurité. Si vous aviez déjà une instance APM sur Elastic Cloud, nous l'avons mise à niveau vers APM et Fleet. Dans le cas contraire, vous pouvez en ajouter une gratuitement à votre déploiement. {existingAgentsMessage} Pour continuer à utiliser Fleet, vous devez utiliser le serveur Fleet et installer la nouvelle version d'Elastic Agent sur chaque hôte.",
"xpack.fleet.fleetServerUpgradeModal.onPremDescriptionMessage": "Le serveur Fleet est désormais disponible et renforce la scalabilité et la sécurité. {existingAgentsMessage} Pour continuer à utiliser Fleet, vous devez installer un serveur Fleet et la nouvelle version d'Elastic Agent sur chaque hôte. Apprenez-en plus avec notre {link}.",
"xpack.fleet.homeIntegration.tutorialModule.noticeText": "{notePrefix} Une version plus récente de ce module est {availableAsIntegrationLink}. Pour en savoir plus sur les intégrations et le nouvel agent Elastic Agent, lisez notre {blogPostLink}.",
"xpack.fleet.integration.settings.versionInfo.updatesAvailableBody": "Passez à la version {latestVersion} pour bénéficier des fonctionnalités les plus récentes.",
"xpack.fleet.integrations.confirmUpdateModal.body.agentCount": "{agentCount, plural, one {# agent} other {# agents}}",
Expand Down Expand Up @@ -13508,15 +13505,6 @@
"xpack.fleet.fleetServerSetup.waitingText": "En attente de connexion d'un serveur Fleet…",
"xpack.fleet.fleetServerSetupPermissionDeniedErrorTitle": "Autorisation refusée",
"xpack.fleet.fleetServerUnhealthy.requestError": "Une erreur s’est produite lors de la récupération du statut du serveur Fleet.",
"xpack.fleet.fleetServerUpgradeModal.announcementImageAlt": "Annonce de mise à niveau du serveur Fleet",
"xpack.fleet.fleetServerUpgradeModal.checkboxLabel": "Ne plus afficher ce message",
"xpack.fleet.fleetServerUpgradeModal.closeButton": "Fermer et démarrer",
"xpack.fleet.fleetServerUpgradeModal.errorLoadingAgents": "Erreur lors du chargement des agents",
"xpack.fleet.fleetServerUpgradeModal.existingAgentText": "Vos agents Elastic existants ont été désenregistrés automatiquement et ont cessé d'envoyer des données.",
"xpack.fleet.fleetServerUpgradeModal.failedUpdateTitle": "Erreur lors de l'enregistrement des paramètres",
"xpack.fleet.fleetServerUpgradeModal.fleetFeedbackLink": "commentaires",
"xpack.fleet.fleetServerUpgradeModal.fleetServerMigrationGuide": "Guide sur la migration du serveur Fleet",
"xpack.fleet.fleetServerUpgradeModal.modalTitle": "Enregistrer vos agents sur le serveur Fleet",
"xpack.fleet.genericActionsMenuText": "Ouvrir",
"xpack.fleet.homeIntegration.tutorialDirectory.fleetAppButtonText": "Tester les intégrations",
"xpack.fleet.homeIntegration.tutorialModule.noticeText.blogPostLink": "article de blog d'annonce",
Expand Down
Loading

0 comments on commit 87fa95d

Please sign in to comment.