[Fleet] Add redesigned Fleet Server flyout#127786
Conversation
|
@elasticmachine merge upstream |
|
@elasticmachine merge upstream |
x-pack/plugins/fleet/public/components/agent_enrollment_flyout/agent_enrollment_flyout.test.tsx
Show resolved
Hide resolved
| fleetServerHostForm, | ||
| deploymentMode, | ||
| setDeploymentMode, | ||
| } = useAdvancedForm(); |
There was a problem hiding this comment.
I was a little on the fence about wrapping all of this data up into a single hook like this, and I could probably be convinced that it'd be better to simply compose multiple hooks in these "tab" files instead. The only real problem this solves is in managed_instructions.tsx where we import this same useAdvancedForm hook because we need almost all of this state again, so it made sense to simply ship the "composed" set of hooks all at once to prevent too much repetition between these two places.
However, I could see the argument that our hooks should be a little more specific than this, which is very coupled to a given UI.
| }; | ||
|
|
||
| // Renders instructions inside of a flyout | ||
| export const FleetServerFlyout: React.FunctionComponent<Props> = ({ onClose }) => { |
There was a problem hiding this comment.
This file exports both the flyout "version" of this component as well as the non-flyout version. It seemed a bit extreme to separate these into two files, and then share the tab implementation between those files, but it's something we might want to consider.
| }), | ||
| getInstallFleetServerStep({ | ||
| isFleetServerReady, | ||
| disabled: quickStartCreateForm.status !== 'success', |
There was a problem hiding this comment.
Quick note on disabled/complete status for these steps: since the designs call for showing/hiding individual steps based on current form state, we allow a disabled prop to be passed in to support this use case. If a given step needs to implement a "complete" state (only a subset of steps do this), it's done within the component itself.
| @@ -1,752 +0,0 @@ | |||
| /* | |||
There was a problem hiding this comment.
The contents of this file have been replaced with distinct components in the fleet/components/fleet_server_instructions files above.
|
@elasticmachine merge upstream |
|
@elasticmachine merge upstream |
|
@elasticmachine merge upstream |
|
Created a follow up issue for converting the tab implementation (at least on the |
|
Another follow-up issue for the "stuck state" when selecting a Fleet Server policy from the dropdown in the "Add Agent" flyout here: #130892 |
|
@elasticmachine merge upstream |
|
@elasticmachine merge upstream |
hop-dev
left a comment
There was a problem hiding this comment.
Code review only, a few nits none of them should stop you from merging
...cations/fleet/components/fleet_server_instructions/components/fleet_server_host_combobox.tsx
Outdated
Show resolved
Hide resolved
...ublic/applications/fleet/components/fleet_server_instructions/hooks/use_fleet_server_host.ts
Outdated
Show resolved
Hide resolved
...ublic/applications/fleet/components/fleet_server_instructions/steps/install_fleet_server.tsx
Outdated
Show resolved
Hide resolved
...public/applications/fleet/components/fleet_server_instructions/steps/set_deployment_mode.tsx
Outdated
Show resolved
Hide resolved
…t_server_instructions/components/fleet_server_host_combobox.tsx Co-authored-by: Mark Hopkin <mark.hopkin@elastic.co>
…t_server_instructions/steps/install_fleet_server.tsx Co-authored-by: Mark Hopkin <mark.hopkin@elastic.co>
…t_server_instructions/steps/set_deployment_mode.tsx Co-authored-by: Mark Hopkin <mark.hopkin@elastic.co>
💚 Build SucceededMetrics [docs]Module Count
Async chunks
Page load bundle
History
To update your PR or re-run it, just comment with: cc @kpollich |
Is this an already existing issue before this pr? |
It is not. We don't limit the set of policies in the dropdown on Screen.Recording.2022-04-26.at.10.14.05.AM.mov |
|
I took a look at addressing the issue reported in #130892 as part of this PR, but I think it falls a bit out of scope. I'm landing this one and will address follow-ups separately. |
⚪ Backport skippedThe pull request was not backported as there were no branches to backport to. If this is a mistake, please apply the desired version labels or run the backport tool manually. Manual backportTo create the backport manually run: Questions ?Please refer to the Backport tool documentation |
I was asking to check if we introduce a new bug. Maybe we could avoid limiting the dropdown so it is not stuck in fleet server state? |
I'm going to update #130892 shortly to detail the implementation for a root fix here. The summary is:
|
* WIP new fleet server flyout * WIP finish up quick start tab * Refactor quick start steps into separate files: * Initial refactor of existing fleet server instructions * Move quick start form return value to explicit type * Flesh out fleet server commands * Fix translation error * Migrate on prem instructions component over to new file structure * Makes quick start tab actually create policy * Fix type errors * Fix missing hooks + update snapshots * Fix paths in mocks * Fix translations * WIP test fixes * Implement enabled/disabled state for new steps * Fix cypress tests * Force re-render to get last test passing * Fix failing tests * Fix import errors after conflicts * Fix snapshot tests * Use id instead of full policy for policy selector * Replace Fleet Server instructions w/ Advanced Tab contents * First pass at integrating add agent/fleet server flyouts * Test commit * Fix imports * Fix imports * [CI] Auto-commit changed files from 'node scripts/eslint --no-cache --fix' * Enforce https-only fleet server URL's + improve errors * Fix failing tests * Fix fleet server command in quick start * Show success state in Quick start when policy exists + use first fleet server host if it exists * Set initial service token value when Fleet Server policy ID is initiall set * Generate service token instead of enrollment token * Fix fleet server flyout opening from unhealthy callout * Revert service token change + use EuiComboBox for fleet server host * Fix checks + use custom option text * Move fleet server host combobox to component * Use new combobox in advanced tab * Fix translations * Fix unused import * Don't recreate quick start policy if it already exists * Actually use quick start policy fields 🙃 * Fix policy check * Update x-pack/plugins/fleet/public/applications/fleet/components/fleet_server_instructions/components/fleet_server_host_combobox.tsx Co-authored-by: Mark Hopkin <mark.hopkin@elastic.co> * Update x-pack/plugins/fleet/public/applications/fleet/components/fleet_server_instructions/steps/install_fleet_server.tsx Co-authored-by: Mark Hopkin <mark.hopkin@elastic.co> * Update x-pack/plugins/fleet/public/applications/fleet/components/fleet_server_instructions/steps/set_deployment_mode.tsx Co-authored-by: Mark Hopkin <mark.hopkin@elastic.co> * Fix formatting issue * Clean up fleet server settings variable declaration per PR review Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Mark Hopkin <mark.hopkin@elastic.co>
Summary
Resolves #125640
Blocked by #128381Implements the redesigned Fleet Server flyout and refactors various "fleet server instruction" components.