-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Fleet] added tour component, removed search (#203741)
## Summary Closes elastic/ingest-dev#4324 - Added tour component for Export CSV feature, it goes away on`Close tour` - Removed search in column selection - Tried a few ways to fix the search not to remove the existing selection (see in #203103), but doesn't seem possible with EuiTable. Removed for now as there aren't that many columns, and don't want to leave it in as is. <img width="1772" alt="image" src="https://github.com/user-attachments/assets/464f8247-bc2d-45d5-8fd4-96d790a40833"> <img width="860" alt="image" src="https://github.com/user-attachments/assets/5d3058f0-2e52-4248-af34-0dfa1c149417">
- Loading branch information
1 parent
84b19ec
commit 96573a4
Showing
5 changed files
with
79 additions
and
9 deletions.
There are no files selected for viewing
68 changes: 68 additions & 0 deletions
68
...c/applications/fleet/sections/agents/agent_list_page/components/agent_export_csv_tour.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,68 @@ | ||
/* | ||
* 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 { EuiText, EuiTourStep } from '@elastic/eui'; | ||
import React, { useState } from 'react'; | ||
import { FormattedMessage } from '@kbn/i18n-react'; | ||
|
||
import type { TOUR_STORAGE_CONFIG } from '../../../../constants'; | ||
import { TOUR_STORAGE_KEYS } from '../../../../constants'; | ||
import { useStartServices } from '../../../../hooks'; | ||
|
||
export const AgentExportCSVTour: React.FC<{}> = () => { | ||
const { storage, uiSettings } = useStartServices(); | ||
|
||
const [tourState, setTourState] = useState({ isOpen: true }); | ||
|
||
const isTourHidden = | ||
uiSettings.get('hideAnnouncements', false) || | ||
( | ||
storage.get(TOUR_STORAGE_KEYS.AGENT_EXPORT_CSV) as | ||
| TOUR_STORAGE_CONFIG['AGENT_EXPORT_CSV'] | ||
| undefined | ||
)?.active === false; | ||
|
||
const setTourAsHidden = () => { | ||
storage.set(TOUR_STORAGE_KEYS.AGENT_EXPORT_CSV, { | ||
active: false, | ||
} as TOUR_STORAGE_CONFIG['AGENT_EXPORT_CSV']); | ||
}; | ||
|
||
const onFinish = () => { | ||
setTourState({ isOpen: false }); | ||
setTourAsHidden(); | ||
}; | ||
|
||
return ( | ||
<> | ||
<EuiTourStep | ||
content={ | ||
<EuiText> | ||
<FormattedMessage | ||
id="xpack.fleet.agentExportCSVTour.tourContent" | ||
defaultMessage="Once you have selected the agents, click the action menu to download the CSV file." | ||
/> | ||
</EuiText> | ||
} | ||
isStepOpen={!isTourHidden && tourState.isOpen} | ||
onFinish={onFinish} | ||
minWidth={360} | ||
maxWidth={360} | ||
step={1} | ||
stepsTotal={1} | ||
title={ | ||
<FormattedMessage | ||
id="xpack.fleet.agentExportCSVTour.tourTitle" | ||
defaultMessage="Download CSV file" | ||
/> | ||
} | ||
anchorPosition="upLeft" | ||
anchor="#agentListSelectionText" | ||
/> | ||
</> | ||
); | ||
}; |
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