Skip to content

Commit

Permalink
Merge branch 'main' into flaky-alerts-loading
Browse files Browse the repository at this point in the history
  • Loading branch information
tomsonpl authored Oct 31, 2023
2 parents 76d1e87 + 7ad80a0 commit 212cc0a
Show file tree
Hide file tree
Showing 49 changed files with 775 additions and 427 deletions.
23 changes: 18 additions & 5 deletions .buildkite/pipelines/quality-gates/pipeline.tests-qa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,21 @@ steps:

- wait: ~

- label: ":judge::seedling: Trigger Manual Tests Phase"
command: "make -C /agent trigger-manual-verification-phase"
if: build.branch == "main"
agents:
image: "docker.elastic.co/ci-agent-images/manual-verification-agent:0.0.2"
- group: "Kibana Release Manager"
steps:
- label: ":judge::seedling: Trigger Manual Tests Phase - Kibana Release Manager"
command: "make -C /agent trigger-manual-verification-phase"
env:
USE_GROUP_LABEL: true
agents:
image: "docker.elastic.co/ci-agent-images/manual-verification-agent:0.0.4"

- group: "Observability"
steps:
- label: ":judge::seedling: Trigger Manual Tests Phase - Observability"
command: "make -C /agent trigger-manual-verification-phase"
env:
NOTIFICATION_APPENDIX: "<!subteam^S060GJFKGGP> please execute your manual testing plan."
USE_GROUP_LABEL: true
agents:
image: "docker.elastic.co/ci-agent-images/manual-verification-agent:0.0.4"
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,5 @@ steps:

- label: ":judge::seedling: Trigger Manual Tests Phase"
command: "make -C /agent trigger-manual-verification-phase"
if: build.branch == "main"
agents:
image: "docker.elastic.co/ci-agent-images/manual-verification-agent:0.0.2"
image: "docker.elastic.co/ci-agent-images/manual-verification-agent:0.0.4"
2 changes: 1 addition & 1 deletion fleet_packages.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
},
{
"name": "fleet_server",
"version": "1.3.1"
"version": "1.4.0"
},
{
"name": "profiler_symbolizer",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,11 @@ export class ChromeService {
projectNavigation.setProjectName(projectName);
};

const setProjectUrl = (projectUrl: string) => {
validateChromeStyle();
projectNavigation.setProjectUrl(projectUrl);
};

const isIE = () => {
const ua = window.navigator.userAgent;
const msie = ua.indexOf('MSIE '); // IE 10 or older
Expand Down Expand Up @@ -387,8 +392,6 @@ export class ChromeService {
loadingCount$={http.getLoadingCount$()}
headerBanner$={headerBanner$.pipe(takeUntil(this.stop$))}
homeHref$={projectNavigation.getProjectHome$()}
projectsUrl$={projectNavigation.getProjectsUrl$()}
projectName$={projectNavigation.getProjectName$()}
docLinks={docLinks}
kibanaVersion={injectedMetadata.getKibanaVersion()}
prependBasePath={http.basePath.prepend}
Expand Down Expand Up @@ -521,6 +524,7 @@ export class ChromeService {
project: {
setHome: setProjectHome,
setProjectsUrl,
setProjectUrl,
setProjectName,
setNavigation: setProjectNavigation,
setSideNavComponent: setProjectSideNavComponent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,35 +6,40 @@
* Side Public License, v 1.
*/

import { EuiContextMenuPanel, EuiContextMenuItem } from '@elastic/eui';
import {
AppDeepLinkId,
ChromeProjectBreadcrumb,
ChromeProjectNavigationNode,
ChromeSetProjectBreadcrumbsParams,
ChromeBreadcrumb,
} from '@kbn/core-chrome-browser';
import { createHomeBreadcrumb } from './home_breadcrumbs';
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n-react';
import React from 'react';

export function buildBreadcrumbs({
homeHref,
projectsUrl,
projectName,
projectUrl,
projectBreadcrumbs,
activeNodes,
chromeBreadcrumbs,
}: {
homeHref: string;
projectsUrl?: string;
projectName?: string;
projectUrl?: string;
projectBreadcrumbs: {
breadcrumbs: ChromeProjectBreadcrumb[];
params: ChromeSetProjectBreadcrumbsParams;
};
chromeBreadcrumbs: ChromeBreadcrumb[];
activeNodes: ChromeProjectNavigationNode[][];
}): ChromeProjectBreadcrumb[] {
const homeBreadcrumb = createHomeBreadcrumb({
homeHref,
});
const rootCrumb = buildRootCrumb({ projectsUrl, projectName, projectUrl });

if (projectBreadcrumbs.params.absolute) {
return [homeBreadcrumb, ...projectBreadcrumbs.breadcrumbs];
return [rootCrumb, ...projectBreadcrumbs.breadcrumbs];
}

// breadcrumbs take the first active path
Expand All @@ -52,7 +57,7 @@ export function buildBreadcrumbs({

// if there are project breadcrumbs set, use them
if (projectBreadcrumbs.breadcrumbs.length !== 0) {
return [homeBreadcrumb, ...navBreadcrumbs, ...projectBreadcrumbs.breadcrumbs];
return [rootCrumb, ...navBreadcrumbs, ...projectBreadcrumbs.breadcrumbs];
}

// otherwise try to merge legacy breadcrumbs with navigational project breadcrumbs using deeplinkid
Expand All @@ -70,12 +75,50 @@ export function buildBreadcrumbs({
}

if (chromeBreadcrumbStartIndex === -1) {
return [homeBreadcrumb, ...navBreadcrumbs];
return [rootCrumb, ...navBreadcrumbs];
} else {
return [
homeBreadcrumb,
rootCrumb,
...navBreadcrumbs.slice(0, navBreadcrumbEndIndex),
...chromeBreadcrumbs.slice(chromeBreadcrumbStartIndex),
];
}
}

function buildRootCrumb({
projectsUrl,
projectName,
projectUrl,
}: {
projectsUrl?: string;
projectName?: string;
projectUrl?: string;
}): ChromeProjectBreadcrumb {
return {
text:
projectName ??
i18n.translate('core.ui.primaryNav.cloud.projectLabel', {
defaultMessage: 'Project',
}),
popoverContent: (
<EuiContextMenuPanel
size="s"
items={[
<EuiContextMenuItem key="project" href={projectUrl} icon={'gear'}>
<FormattedMessage
id="core.ui.primaryNav.cloud.linkToProject"
defaultMessage="Manage project"
/>
</EuiContextMenuItem>,
<EuiContextMenuItem key="projects" href={projectsUrl} icon={'grid'}>
<FormattedMessage
id="core.ui.primaryNav.cloud.linkToAllProjects"
defaultMessage="View all projects"
/>
</EuiContextMenuItem>,
]}
/>
),
popoverProps: { panelPaddingSize: 'none' },
};
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,35 @@ describe('breadcrumbs', () => {
expect(breadcrumbs).toMatchInlineSnapshot(`
Array [
Object {
"data-test-subj": "breadcrumb-home",
"href": "/",
"text": <EuiIcon
type="home"
"popoverContent": <EuiContextMenuPanel
items={
Array [
<EuiContextMenuItem
icon="gear"
>
<FormattedMessage
defaultMessage="Manage project"
id="core.ui.primaryNav.cloud.linkToProject"
values={Object {}}
/>
</EuiContextMenuItem>,
<EuiContextMenuItem
icon="grid"
>
<FormattedMessage
defaultMessage="View all projects"
id="core.ui.primaryNav.cloud.linkToAllProjects"
values={Object {}}
/>
</EuiContextMenuItem>,
]
}
size="s"
/>,
"title": "Home",
"popoverProps": Object {
"panelPaddingSize": "none",
},
"text": "Project",
},
Object {
"deepLinkId": "navItem1",
Expand Down Expand Up @@ -125,12 +148,35 @@ describe('breadcrumbs', () => {
expect(breadcrumbs).toMatchInlineSnapshot(`
Array [
Object {
"data-test-subj": "breadcrumb-home",
"href": "/",
"text": <EuiIcon
type="home"
"popoverContent": <EuiContextMenuPanel
items={
Array [
<EuiContextMenuItem
icon="gear"
>
<FormattedMessage
defaultMessage="Manage project"
id="core.ui.primaryNav.cloud.linkToProject"
values={Object {}}
/>
</EuiContextMenuItem>,
<EuiContextMenuItem
icon="grid"
>
<FormattedMessage
defaultMessage="View all projects"
id="core.ui.primaryNav.cloud.linkToAllProjects"
values={Object {}}
/>
</EuiContextMenuItem>,
]
}
size="s"
/>,
"title": "Home",
"popoverProps": Object {
"panelPaddingSize": "none",
},
"text": "Project",
},
Object {
"href": "/custom1",
Expand Down Expand Up @@ -158,12 +204,35 @@ describe('breadcrumbs', () => {
expect(breadcrumbs).toMatchInlineSnapshot(`
Array [
Object {
"data-test-subj": "breadcrumb-home",
"href": "/",
"text": <EuiIcon
type="home"
"popoverContent": <EuiContextMenuPanel
items={
Array [
<EuiContextMenuItem
icon="gear"
>
<FormattedMessage
defaultMessage="Manage project"
id="core.ui.primaryNav.cloud.linkToProject"
values={Object {}}
/>
</EuiContextMenuItem>,
<EuiContextMenuItem
icon="grid"
>
<FormattedMessage
defaultMessage="View all projects"
id="core.ui.primaryNav.cloud.linkToAllProjects"
values={Object {}}
/>
</EuiContextMenuItem>,
]
}
size="s"
/>,
"title": "Home",
"popoverProps": Object {
"panelPaddingSize": "none",
},
"text": "Project",
},
Object {
"deepLinkId": "navItem1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export class ProjectNavigationService {
private projectHome$ = new BehaviorSubject<string | undefined>(undefined);
private projectsUrl$ = new BehaviorSubject<string | undefined>(undefined);
private projectName$ = new BehaviorSubject<string | undefined>(undefined);
private projectUrl$ = new BehaviorSubject<string | undefined>(undefined);
private projectNavigation$ = new BehaviorSubject<ChromeProjectNavigation | undefined>(undefined);
private activeNodes$ = new BehaviorSubject<ChromeProjectNavigationNode[][]>([]);
private projectNavigationNavTreeFlattened: Record<string, ChromeProjectNavigationNode> = {};
Expand Down Expand Up @@ -106,6 +107,9 @@ export class ProjectNavigationService {
getProjectName$: () => {
return this.projectName$.asObservable();
},
setProjectUrl: (projectUrl: string) => {
this.projectUrl$.next(projectUrl);
},
setProjectNavigation: (projectNavigation: ChromeProjectNavigation) => {
this.projectNavigation$.next(projectNavigation);
this.projectNavigationNavTreeFlattened = flattenNav(projectNavigation.navigationTree);
Expand Down Expand Up @@ -136,17 +140,30 @@ export class ProjectNavigationService {
return combineLatest([
this.projectBreadcrumbs$,
this.activeNodes$,
this.projectHome$.pipe(map((homeHref) => homeHref ?? '/')),
chromeBreadcrumbs$,
this.projectsUrl$,
this.projectUrl$,
this.projectName$,
]).pipe(
map(([projectBreadcrumbs, activeNodes, homeHref, chromeBreadcrumbs]) => {
return buildBreadcrumbs({
homeHref: this.http?.basePath.prepend?.(homeHref) ?? homeHref,
map(
([
projectBreadcrumbs,
activeNodes,
chromeBreadcrumbs,
});
})
projectsUrl,
projectUrl,
projectName,
]) => {
return buildBreadcrumbs({
projectUrl,
projectName,
projectsUrl,
projectBreadcrumbs,
activeNodes,
chromeBreadcrumbs,
});
}
)
);
},
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ export interface InternalChromeStart extends ChromeStart {
*/
setProjectName(projectName: string): void;

/**
* Sets the project url.
* @param projectUrl
*/
setProjectUrl(projectUrl: string): void;

/**
* Sets the project navigation config to be used for rendering project navigation.
* It is used for default project sidenav, project breadcrumbs, tracking active deep link.
Expand Down
Loading

0 comments on commit 212cc0a

Please sign in to comment.