Skip to content

Commit 5589c99

Browse files
[Streams] Add DLM phases flyout (#271395)
Closes #266039 ## Summary This PR: - Added a new `EditDlmPhasesFlyout` with its own RHF+Zod model that emits/saves `IngestStreamLifecycleDSL['dsl']` (frozen/delete “after” only) and includes debounced `onChange`. - Updated lifecycle UI to support frozen-phase warnings with reusable enterprise/default-repository callouts and a warning icon on the frozen phase button. - Refactored shared flyout plumbing into `data_phases/shared` Flyout shell, phase tabs row, blur-commit draft, debounced emit, phase syncing, and “after” help text utilities) and switched shared copy to neutral i18n namespaces. - Updated the ILM flyout copy (including “Apply”) and switched toggleable fields from switches to checkboxes. - Expanded/added Jest and Storybook coverage for DLM flows, shared utilities, and lifecycle-phase callout rendering.
1 parent ae93a37 commit 5589c99

52 files changed

Lines changed: 3169 additions & 561 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

oas_docs/output/kibana.serverless.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78782,6 +78782,10 @@ components:
7878278782
- after
7878378783
- fixed_interval
7878478784
type: array
78785+
frozen_after:
78786+
description: A non-empty string.
78787+
minLength: 1
78788+
type: string
7878578789
required:
7878678790
- dsl
7878778791
- additionalProperties: false

oas_docs/output/kibana.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91249,6 +91249,10 @@ components:
9124991249
- after
9125091250
- fixed_interval
9125191251
type: array
91252+
frozen_after:
91253+
description: A non-empty string.
91254+
minLength: 1
91255+
type: string
9125291256
required:
9125391257
- dsl
9125491258
- additionalProperties: false

x-pack/platform/packages/shared/kbn-data-lifecycle-phases/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@ export * from './src/enterprise_gating_modal';
1515
export * from './src/default_snapshot_repository_required_modal';
1616
export * from './src/edit_failed_data_lifecycle_flyout';
1717
export * from './src/phase_requirement_badges';
18+
export * from './src/searchable_snapshot_repository_info';

x-pack/platform/packages/shared/kbn-data-lifecycle-phases/moon.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ project:
1818
sourceRoot: x-pack/platform/packages/shared/kbn-data-lifecycle-phases
1919
dependsOn:
2020
- '@kbn/i18n'
21+
- '@kbn/i18n-react'
2122
- '@kbn/storybook'
2223
- '@kbn/index-lifecycle-management-common-shared'
2324
- '@kbn/test-jest-helpers'
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the Elastic License
4+
* 2.0; you may not use this file except in compliance with the Elastic License
5+
* 2.0.
6+
*/
7+
8+
export { SearchableSnapshotRepositoryInfo } from './searchable_snapshot_repository_info';
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the Elastic License
4+
* 2.0; you may not use this file except in compliance with the Elastic License
5+
* 2.0.
6+
*/
7+
8+
import React from 'react';
9+
import { FormattedMessage } from '@kbn/i18n-react';
10+
import { EuiLink } from '@elastic/eui';
11+
12+
export interface SearchableSnapshotRepositoryInfoProps {
13+
defaultRepository: string;
14+
manageRepositoriesHref?: string;
15+
}
16+
17+
export const SearchableSnapshotRepositoryInfo = ({
18+
defaultRepository,
19+
manageRepositoriesHref,
20+
}: SearchableSnapshotRepositoryInfoProps) => {
21+
const manageLink = (chunks: React.ReactNode) =>
22+
manageRepositoriesHref ? (
23+
<EuiLink href={manageRepositoriesHref}>{chunks}</EuiLink>
24+
) : (
25+
<>{chunks}</>
26+
);
27+
28+
return (
29+
<FormattedMessage
30+
id="xpack.dataLifecyclePhases.searchableSnapshotRepositoryInfo.bodyWithDefaultRepository"
31+
defaultMessage="All streams using a data stream lifecycle use the deployment's default snapshot repository, ‘{defaultRepository}’. To change the default repository, <manageLink>manage your repositories</manageLink>."
32+
values={{ defaultRepository, manageLink }}
33+
/>
34+
);
35+
};

x-pack/platform/packages/shared/kbn-data-lifecycle-phases/tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
],
2121
"kbn_references": [
2222
"@kbn/i18n",
23+
"@kbn/i18n-react",
2324
"@kbn/storybook",
2425
"@kbn/index-lifecycle-management-common-shared",
2526
"@kbn/test-jest-helpers"

x-pack/platform/packages/shared/kbn-streams-schema/src/models/ingest/lifecycle/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { createIsNarrowSchema } from '../../../shared/type_guards';
1212
export interface IngestStreamLifecycleDSL {
1313
dsl: {
1414
data_retention?: string;
15+
frozen_after?: string;
1516
downsample?: DownsampleStep[];
1617
};
1718
}
@@ -68,6 +69,7 @@ const downsampleStepSchema = z.object({
6869
const dslLifecycleSchema = z.object({
6970
dsl: z.object({
7071
data_retention: z.optional(NonEmptyString),
72+
frozen_after: z.optional(NonEmptyString),
7173
downsample: z.optional(z.array(downsampleStepSchema)),
7274
}),
7375
});

x-pack/platform/plugins/private/translations/translations/de-DE.json

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50833,9 +50833,6 @@
5083350833
"xpack.streams.editDslStepsFlyout.stepTabHasErrorsIconAriaLabel": "Schritt {stepNumber} enthält Fehler",
5083450834
"xpack.streams.editDslStepsFlyout.stepTabLabel": "Schritt {stepNumber}",
5083550835
"xpack.streams.editDslStepsFlyout.title": "Downsampling-Schritte bearbeiten",
50836-
"xpack.streams.editIlmPhasesFlyout.addPhaseAriaLabel": "Datenphase hinzufügen",
50837-
"xpack.streams.editIlmPhasesFlyout.allPhasesInUseTooltip": "Alle Datenphasen sind im Einsatz",
50838-
"xpack.streams.editIlmPhasesFlyout.cancel": "Abbrechen",
5083950836
"xpack.streams.editIlmPhasesFlyout.createSnapshotRepository": "Repository erstellen",
5084050837
"xpack.streams.editIlmPhasesFlyout.deleteAfterAriaLabel": "Löschen nach Wert",
5084150838
"xpack.streams.editIlmPhasesFlyout.deleteAfterLabel": "Nach dem Speichern der Daten löschen",
@@ -50868,20 +50865,16 @@
5086850865
"xpack.streams.editIlmPhasesFlyout.moveAfterUnitAriaLabel": "Daten nach Einheit verschieben",
5086950866
"xpack.streams.editIlmPhasesFlyout.nonNegativeNumberRequired": "Eine nicht-negative Zahl ist erforderlich.",
5087050867
"xpack.streams.editIlmPhasesFlyout.numberGreaterThan0Required": "Eine Zahl größer als 0 ist erforderlich.",
50871-
"xpack.streams.editIlmPhasesFlyout.phaseTabHasErrorsIconAriaLabel": "Die {phase}-Phase weist Fehler auf",
5087250868
"xpack.streams.editIlmPhasesFlyout.readOnlyHelp": "Aktivieren, um den Index auf schreibgeschützt zu stellen. Deaktivieren, um das Schreiben im Index zu erlauben.",
5087350869
"xpack.streams.editIlmPhasesFlyout.readOnlyLabel": "Schreibgeschützten Zugriff aktivieren",
5087450870
"xpack.streams.editIlmPhasesFlyout.refreshSnapshotRepositoriesAriaLabel": "Snapshot-Repositories aktualisieren",
5087550871
"xpack.streams.editIlmPhasesFlyout.removePhase": "{phase} Phase entfernen",
50876-
"xpack.streams.editIlmPhasesFlyout.save": "Speichern",
50877-
"xpack.streams.editIlmPhasesFlyout.saveDisabledTooltip": "Beheben Sie die Formularfehler vor dem Speichern.",
5087850872
"xpack.streams.editIlmPhasesFlyout.searchableSnapshotHelp": "Konfigurieren Sie durchsuchbare Snapshots für diese Phase.",
5087950873
"xpack.streams.editIlmPhasesFlyout.searchableSnapshotRepoRequired": "Es ist ein Snapshot-Repository erforderlich.",
5088050874
"xpack.streams.editIlmPhasesFlyout.searchableSnapshotTitle": "Durchsuchbarer Snapshot",
5088150875
"xpack.streams.editIlmPhasesFlyout.snapshotRepositoryAriaLabel": "Snapshot-Repository",
5088250876
"xpack.streams.editIlmPhasesFlyout.snapshotRepositoryHelp": "Jede Phase verwendet dasselbe Snapshot-Repository.",
5088350877
"xpack.streams.editIlmPhasesFlyout.snapshotRepositoryLabel": "Snapshot-Repository",
50884-
"xpack.streams.editIlmPhasesFlyout.title": "Datenphasen bearbeiten",
5088550878
"xpack.streams.editingQueryStreamEntry.cancelButton": "Abbrechen",
5088650879
"xpack.streams.editingQueryStreamEntry.fetchError": "Details zum Abfrage-Stream konnten nicht geladen werden.",
5088750880
"xpack.streams.editingQueryStreamEntry.updateButton": "Update",

x-pack/platform/plugins/private/translations/translations/fr-FR.json

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50663,9 +50663,6 @@
5066350663
"xpack.streams.editDslStepsFlyout.stepTabHasErrorsIconAriaLabel": "L'étape {stepNumber} contient des erreurs",
5066450664
"xpack.streams.editDslStepsFlyout.stepTabLabel": "Étape {stepNumber}",
5066550665
"xpack.streams.editDslStepsFlyout.title": "Modifier les étapes de sous-échantillonnage",
50666-
"xpack.streams.editIlmPhasesFlyout.addPhaseAriaLabel": "Ajouter une phase de données",
50667-
"xpack.streams.editIlmPhasesFlyout.allPhasesInUseTooltip": "Toutes les phases de données sont utilisées",
50668-
"xpack.streams.editIlmPhasesFlyout.cancel": "Annuler",
5066950666
"xpack.streams.editIlmPhasesFlyout.createSnapshotRepository": "Créer un dépôt",
5067050667
"xpack.streams.editIlmPhasesFlyout.deleteAfterAriaLabel": "Supprimer après la valeur",
5067150668
"xpack.streams.editIlmPhasesFlyout.deleteAfterLabel": "Supprimer après le stockage des données",
@@ -50698,20 +50695,16 @@
5069850695
"xpack.streams.editIlmPhasesFlyout.moveAfterUnitAriaLabel": "Déplacer les données après l'unité",
5069950696
"xpack.streams.editIlmPhasesFlyout.nonNegativeNumberRequired": "Un nombre non négatif est requis.",
5070050697
"xpack.streams.editIlmPhasesFlyout.numberGreaterThan0Required": "Un nombre supérieur à 0 est requis.",
50701-
"xpack.streams.editIlmPhasesFlyout.phaseTabHasErrorsIconAriaLabel": "La phase {phase} présente des erreurs",
5070250698
"xpack.streams.editIlmPhasesFlyout.readOnlyHelp": "Activez pour définir l'accès à l'index en lecture seule. Désactivez pour autoriser l'écriture dans l'index.",
5070350699
"xpack.streams.editIlmPhasesFlyout.readOnlyLabel": "Activer l’accès en lecture seule",
5070450700
"xpack.streams.editIlmPhasesFlyout.refreshSnapshotRepositoriesAriaLabel": "Actualiser les référentiels de snapshots",
5070550701
"xpack.streams.editIlmPhasesFlyout.removePhase": "Supprimer la phase {phase}",
50706-
"xpack.streams.editIlmPhasesFlyout.save": "Enregistrer",
50707-
"xpack.streams.editIlmPhasesFlyout.saveDisabledTooltip": "Corrigez les erreurs de formulaire avant d'enregistrer.",
5070850702
"xpack.streams.editIlmPhasesFlyout.searchableSnapshotHelp": "Configurez des snapshots interrogeables pour cette phase.",
5070950703
"xpack.streams.editIlmPhasesFlyout.searchableSnapshotRepoRequired": "Un référentiel de snapshot est requis.",
5071050704
"xpack.streams.editIlmPhasesFlyout.searchableSnapshotTitle": "Snapshot interrogeable",
5071150705
"xpack.streams.editIlmPhasesFlyout.snapshotRepositoryAriaLabel": "Référentiel de snapshot",
5071250706
"xpack.streams.editIlmPhasesFlyout.snapshotRepositoryHelp": "Chaque phase utilise le même référentiel de snapshot.",
5071350707
"xpack.streams.editIlmPhasesFlyout.snapshotRepositoryLabel": "Référentiel de snapshot",
50714-
"xpack.streams.editIlmPhasesFlyout.title": "Modifier les phases de données",
5071550708
"xpack.streams.editingQueryStreamEntry.cancelButton": "Annuler",
5071650709
"xpack.streams.editingQueryStreamEntry.fetchError": "Impossible de charger les détails du flux de requêtes",
5071750710
"xpack.streams.editingQueryStreamEntry.updateButton": "Mettre à jour",

0 commit comments

Comments
 (0)