Skip to content

Commit

Permalink
[Fleet] Use "Integrations" breadcrumb in "Add integrations" (elastic#…
Browse files Browse the repository at this point in the history
…103227)

* update the UI breadcrumbs in create policy package to always look like it came from integrations

* added comment about the removal of a path from fleet

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
  • Loading branch information
jloleysens and kibanamachine authored Jun 24, 2021
1 parent f293772 commit 8a422fd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -495,17 +495,13 @@ export const CreatePackagePolicyPage: React.FunctionComponent = () => {
onCancel={() => setFormState('VALID')}
/>
)}
{from === 'package'
? packageInfo && (
<IntegrationBreadcrumb
pkgTitle={integrationInfo?.title || packageInfo.title}
pkgkey={pkgKeyFromPackageInfo(packageInfo)}
integration={integrationInfo?.name}
/>
)
: agentPolicy && (
<PolicyBreadcrumb policyName={agentPolicy.name} policyId={agentPolicy.id} />
)}
{packageInfo && (
<IntegrationBreadcrumb
pkgTitle={integrationInfo?.title || packageInfo.title}
pkgkey={pkgKeyFromPackageInfo(packageInfo)}
integration={integrationInfo?.name}
/>
)}
<StepsWithLessPadding steps={steps} />
<EuiSpacer size="xl" />
<EuiSpacer size="xl" />
Expand Down Expand Up @@ -559,14 +555,6 @@ export const CreatePackagePolicyPage: React.FunctionComponent = () => {
);
};

const PolicyBreadcrumb: React.FunctionComponent<{
policyName: string;
policyId: string;
}> = ({ policyName, policyId }) => {
useBreadcrumbs('add_integration_from_policy', { policyName, policyId });
return null;
};

const IntegrationBreadcrumb: React.FunctionComponent<{
pkgTitle: string;
pkgkey: string;
Expand Down
1 change: 1 addition & 0 deletions x-pack/plugins/fleet/public/constants/page_paths.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ export const FLEET_ROUTING_PATHS = {
policy_details: '/policies/:policyId/:tabId?',
policy_details_settings: '/policies/:policyId/settings',
edit_integration: '/policies/:policyId/edit-integration/:packagePolicyId',
// TODO: Review uses and remove if it is no longer used or linked to in any UX flows
add_integration_from_policy: '/policies/:policyId/add-integration',
enrollment_tokens: '/enrollment-tokens',
data_streams: '/data-streams',
Expand Down

0 comments on commit 8a422fd

Please sign in to comment.