Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport 2.x] UI Adjustments Left Nav, Notebooks, Applications #2170

Merged
merged 1 commit into from
Sep 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {
EuiFieldSearch,
EuiFlexGroup,
EuiFlexItem,
EuiHorizontalRule,
EuiInMemoryTable,
EuiLink,
EuiLoadingSpinner,
Expand Down Expand Up @@ -236,7 +235,7 @@ export function AppTable(props: AppTableProps) {
</EuiTitle>
)}
</EuiPageHeader>
<EuiPageContent id="applicationArea">
<EuiPageContent id="applicationArea" paddingSize="m">
<EuiPageContentHeader>
<EuiFlexGroup gutterSize="s" alignItems="center">
<EuiFlexItem>
Expand All @@ -261,7 +260,6 @@ export function AppTable(props: AppTableProps) {
</EuiFlexItem>
</EuiFlexGroup>
</EuiPageContentHeader>
<EuiHorizontalRule />
{filteredApplications.length > 0 ? (
<EuiInMemoryTable
loading={props.loading}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
EuiPageHeaderSection,
EuiPanel,
EuiSelectOption,
EuiSpacer,
EuiTabbedContent,
EuiTabbedContentTab,
EuiText,
Expand Down Expand Up @@ -134,7 +133,7 @@
const [serviceFlyoutName, setServiceFlyoutName] = useState<string>('');
const [traceFlyoutId, setTraceFlyoutId] = useState<string>('');
const [spanFlyoutId, setSpanFlyoutId] = useState<string>('');
const [spanDSL, setSpanDSL] = useState<any>({});

Check warning on line 136 in public/components/application_analytics/components/application.tsx

View workflow job for this annotation

GitHub Actions / Lint

Unexpected any. Specify a different type
const [totalSpans, setTotalSpans] = useState<number>(0);
const [editVizId, setEditVizId] = useState<string>('');
const [visWithAvailability, setVisWithAvailability] = useState<EuiSelectOption[]>([]);
Expand All @@ -157,7 +156,7 @@
sessionStorage.setItem(`${application.name}EndTime`, newEndTime);
};

const addSpanFilter = (field: string, value: any) => {

Check warning on line 159 in public/components/application_analytics/components/application.tsx

View workflow job for this annotation

GitHub Actions / Lint

Unexpected any. Specify a different type
const newFilters = [...filters];
const index = newFilters.findIndex(({ field: filterField }) => field === filterField);
if (index === -1) {
Expand Down Expand Up @@ -286,13 +285,12 @@
},
];

const nameColumnAction = (item: any) => openServiceFlyout(item);

Check warning on line 288 in public/components/application_analytics/components/application.tsx

View workflow job for this annotation

GitHub Actions / Lint

Unexpected any. Specify a different type
const traceColumnAction = () => switchToTrace();

const getService = () => {
return (
<>
<EuiSpacer size="m" />
<ServicesContent
{...props}
page="app"
Expand All @@ -317,7 +315,6 @@
const getTrace = () => {
return (
<>
<EuiSpacer size="m" />
<TracesContent
{...props}
page="app"
Expand All @@ -330,7 +327,6 @@
setEndTime={setEndTimeForApp}
dataSourceMDSId={[{ id: '', label: '' }]}
/>
<EuiSpacer size="m" />
<EuiPanel>
<PanelTitle title="Spans" totalItems={totalSpans} />
<EuiHorizontalRule margin="m" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
EuiTitle,
} from '@elastic/eui';
import { ApplicationRequestType, ApplicationType } from 'common/types/application_analytics';
import { last } from 'lodash';

Check failure on line 27 in public/components/application_analytics/components/configuration.tsx

View workflow job for this annotation

GitHub Actions / Lint

'last' is defined but never used. Allowed unused vars must match /^_/u
import React, { useState } from 'react';

interface ConfigProps {
Expand All @@ -37,19 +37,12 @@
}

export const Configuration = (props: ConfigProps) => {
const {
appId,
application,
parentBreadcrumbs,
visWithAvailability,
updateApp,
switchToAvailability,
} = props;
const { appId, application, visWithAvailability, updateApp, switchToAvailability } = props;
const [availabilityVisId, setAvailabilityVisId] = useState(
application.availability.availabilityVisId || ''
);

const onAvailabilityVisChange = (event: any) => {

Check warning on line 45 in public/components/application_analytics/components/configuration.tsx

View workflow job for this annotation

GitHub Actions / Lint

Unexpected any. Specify a different type
setAvailabilityVisId(event.target.value);
updateApp(appId, { availabilityVisId: event.target.value }, 'editAvailability');
};
Expand All @@ -58,11 +51,11 @@
<div>
<EuiPage>
<EuiPageBody component="div">
<EuiPageContent>
<EuiPageContent paddingSize="m">
<EuiPageContentHeader>
<EuiPageContentHeaderSection>
<EuiTitle>
<h3 style={{ paddingTop: '10px' }}>Configuration details</h3>
<EuiTitle size="s">
<h2>Configuration details</h2>
</EuiTitle>
</EuiPageContentHeaderSection>
<EuiPageContentHeaderSection>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ exports[`<NoteTable /> spec renders the component 1`] = `
</div>
</header>
<div
class="euiPanel euiPanel--paddingLarge euiPanel--borderRadiusMedium euiPanel--plain euiPanel--hasShadow euiPageContent"
class="euiPanel euiPanel--paddingMedium euiPanel--borderRadiusMedium euiPanel--plain euiPanel--hasShadow euiPageContent"
id="notebookArea"
role="main"
>
Expand Down Expand Up @@ -190,8 +190,8 @@ exports[`<NoteTable /> spec renders the component 1`] = `
</div>
</div>
</div>
<hr
class="euiHorizontalRule euiHorizontalRule--full euiHorizontalRule--marginMedium"
<div
class="euiSpacer euiSpacer--m"
/>
<div
class="euiBasicTable"
Expand Down Expand Up @@ -933,7 +933,7 @@ exports[`<NoteTable /> spec renders the empty component 1`] = `
</div>
</header>
<div
class="euiPanel euiPanel--paddingLarge euiPanel--borderRadiusMedium euiPanel--plain euiPanel--hasShadow euiPageContent"
class="euiPanel euiPanel--paddingMedium euiPanel--borderRadiusMedium euiPanel--plain euiPanel--hasShadow euiPageContent"
id="notebookArea"
role="main"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,74 +29,86 @@ exports[`<Notebook /> spec Renders the empty component 1`] = `
<div
class="euiFlexItem euiFlexItem--flexGrowZero"
>
<button
class="euiButtonIcon euiButtonIcon--danger euiButtonIcon--small"
data-test-subj="notebook-delete-icon"
type="button"
<span
class="euiToolTipAnchor"
>
<svg
aria-hidden="true"
class="euiIcon euiIcon--medium euiIcon--inherit euiIcon-isLoading euiButtonIcon__icon"
focusable="false"
height="16"
role="img"
viewBox="0 0 16 16"
width="16"
xmlns="http://www.w3.org/2000/svg"
<button
class="euiButtonIcon euiButtonIcon--danger euiButtonIcon--small"
data-test-subj="notebook-delete-icon"
type="button"
>
<path
d="M5.277 10.088c.02.014.04.03.057.047.582.55 1.134.812 1.666.812.586 0 1.84-.293 3.713-.88L9 6.212V2H7v4.212l-1.723 3.876Zm-.438.987L3.539 14h8.922l-1.32-2.969C9.096 11.677 7.733 12 7 12c-.74 0-1.463-.315-2.161-.925ZM6 2H5V1h6v1h-1v4l3.375 7.594A1 1 0 0 1 12.461 15H3.54a1 1 0 0 1-.914-1.406L6 6V2Z"
/>
</svg>
</button>
<svg
aria-hidden="true"
class="euiIcon euiIcon--medium euiIcon--inherit euiIcon-isLoading euiButtonIcon__icon"
focusable="false"
height="16"
role="img"
viewBox="0 0 16 16"
width="16"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M5.277 10.088c.02.014.04.03.057.047.582.55 1.134.812 1.666.812.586 0 1.84-.293 3.713-.88L9 6.212V2H7v4.212l-1.723 3.876Zm-.438.987L3.539 14h8.922l-1.32-2.969C9.096 11.677 7.733 12 7 12c-.74 0-1.463-.315-2.161-.925ZM6 2H5V1h6v1h-1v4l3.375 7.594A1 1 0 0 1 12.461 15H3.54a1 1 0 0 1-.914-1.406L6 6V2Z"
/>
</svg>
</button>
</span>
</div>
<div
class="euiFlexItem euiFlexItem--flexGrowZero"
>
<button
class="euiButtonIcon euiButtonIcon--primary euiButtonIcon--small"
data-test-subj="notebook-edit-icon"
type="button"
<span
class="euiToolTipAnchor"
>
<svg
aria-hidden="true"
class="euiIcon euiIcon--medium euiIcon--inherit euiIcon-isLoading euiButtonIcon__icon"
focusable="false"
height="16"
role="img"
viewBox="0 0 16 16"
width="16"
xmlns="http://www.w3.org/2000/svg"
<button
class="euiButtonIcon euiButtonIcon--primary euiButtonIcon--small"
data-test-subj="notebook-edit-icon"
type="button"
>
<path
d="M5.277 10.088c.02.014.04.03.057.047.582.55 1.134.812 1.666.812.586 0 1.84-.293 3.713-.88L9 6.212V2H7v4.212l-1.723 3.876Zm-.438.987L3.539 14h8.922l-1.32-2.969C9.096 11.677 7.733 12 7 12c-.74 0-1.463-.315-2.161-.925ZM6 2H5V1h6v1h-1v4l3.375 7.594A1 1 0 0 1 12.461 15H3.54a1 1 0 0 1-.914-1.406L6 6V2Z"
/>
</svg>
</button>
<svg
aria-hidden="true"
class="euiIcon euiIcon--medium euiIcon--inherit euiIcon-isLoading euiButtonIcon__icon"
focusable="false"
height="16"
role="img"
viewBox="0 0 16 16"
width="16"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M5.277 10.088c.02.014.04.03.057.047.582.55 1.134.812 1.666.812.586 0 1.84-.293 3.713-.88L9 6.212V2H7v4.212l-1.723 3.876Zm-.438.987L3.539 14h8.922l-1.32-2.969C9.096 11.677 7.733 12 7 12c-.74 0-1.463-.315-2.161-.925ZM6 2H5V1h6v1h-1v4l3.375 7.594A1 1 0 0 1 12.461 15H3.54a1 1 0 0 1-.914-1.406L6 6V2Z"
/>
</svg>
</button>
</span>
</div>
<div
class="euiFlexItem euiFlexItem--flexGrowZero"
>
<button
class="euiButtonIcon euiButtonIcon--primary euiButtonIcon--small"
data-test-subj="notebook-duplicate-icon"
type="button"
<span
class="euiToolTipAnchor"
>
<svg
aria-hidden="true"
class="euiIcon euiIcon--medium euiIcon--inherit euiIcon-isLoading euiButtonIcon__icon"
focusable="false"
height="16"
role="img"
viewBox="0 0 16 16"
width="16"
xmlns="http://www.w3.org/2000/svg"
<button
class="euiButtonIcon euiButtonIcon--primary euiButtonIcon--small"
data-test-subj="notebook-duplicate-icon"
type="button"
>
<path
d="M5.277 10.088c.02.014.04.03.057.047.582.55 1.134.812 1.666.812.586 0 1.84-.293 3.713-.88L9 6.212V2H7v4.212l-1.723 3.876Zm-.438.987L3.539 14h8.922l-1.32-2.969C9.096 11.677 7.733 12 7 12c-.74 0-1.463-.315-2.161-.925ZM6 2H5V1h6v1h-1v4l3.375 7.594A1 1 0 0 1 12.461 15H3.54a1 1 0 0 1-.914-1.406L6 6V2Z"
/>
</svg>
</button>
<svg
aria-hidden="true"
class="euiIcon euiIcon--medium euiIcon--inherit euiIcon-isLoading euiButtonIcon__icon"
focusable="false"
height="16"
role="img"
viewBox="0 0 16 16"
width="16"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M5.277 10.088c.02.014.04.03.057.047.582.55 1.134.812 1.666.812.586 0 1.84-.293 3.713-.88L9 6.212V2H7v4.212l-1.723 3.876Zm-.438.987L3.539 14h8.922l-1.32-2.969C9.096 11.677 7.733 12 7 12c-.74 0-1.463-.315-2.161-.925ZM6 2H5V1h6v1h-1v4l3.375 7.594A1 1 0 0 1 12.461 15H3.54a1 1 0 0 1-.914-1.406L6 6V2Z"
/>
</svg>
</button>
</span>
</div>
</div>
<div
Expand Down Expand Up @@ -482,26 +494,30 @@ exports[`<Notebook /> spec Renders the visualization component 1`] = `
<div
class="euiFlexItem euiFlexItem--flexGrowZero"
>
<button
class="euiButtonIcon euiButtonIcon--danger euiButtonIcon--small"
data-test-subj="notebook-delete-icon"
type="button"
<span
class="euiToolTipAnchor"
>
<svg
aria-hidden="true"
class="euiIcon euiIcon--medium euiIcon--inherit euiButtonIcon__icon"
focusable="false"
height="16"
role="img"
viewBox="0 0 16 16"
width="16"
xmlns="http://www.w3.org/2000/svg"
<button
class="euiButtonIcon euiButtonIcon--danger euiButtonIcon--small"
data-test-subj="notebook-delete-icon"
type="button"
>
<path
d="M11 3h5v1H0V3h5V1a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2Zm-7.056 8H7v1H4.1l.392 2.519c.042.269.254.458.493.458h6.03c.239 0 .451-.189.493-.458l1.498-9.576H14l-1.504 9.73c-.116.747-.74 1.304-1.481 1.304h-6.03c-.741 0-1.365-.557-1.481-1.304l-1.511-9.73H9V5.95H3.157L3.476 8H8v1H3.632l.312 2ZM6 3h4V1H6v2Z"
/>
</svg>
</button>
<svg
aria-hidden="true"
class="euiIcon euiIcon--medium euiIcon--inherit euiButtonIcon__icon"
focusable="false"
height="16"
role="img"
viewBox="0 0 16 16"
width="16"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M11 3h5v1H0V3h5V1a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2Zm-7.056 8H7v1H4.1l.392 2.519c.042.269.254.458.493.458h6.03c.239 0 .451-.189.493-.458l1.498-9.576H14l-1.504 9.73c-.116.747-.74 1.304-1.481 1.304h-6.03c-.741 0-1.365-.557-1.481-1.304l-1.511-9.73H9V5.95H3.157L3.476 8H8v1H3.632l.312 2ZM6 3h4V1H6v2Z"
/>
</svg>
</button>
</span>
</div>
</div>
<div
Expand Down
5 changes: 2 additions & 3 deletions public/components/notebooks/components/note_table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
EuiCompressedFieldSearch,
EuiFlexGroup,
EuiFlexItem,
EuiHorizontalRule,
EuiInMemoryTable,
EuiLink,
EuiOverlayMask,
Expand Down Expand Up @@ -114,7 +113,7 @@
if (url[url.length - 1] === 'create') {
createNote();
}
}, [location]);

Check warning on line 116 in public/components/notebooks/components/note_table.tsx

View workflow job for this annotation

GitHub Actions / Lint

React Hook useEffect has a missing dependency: 'createNote'. Either include it or remove the dependency array

const closeModal = () => {
setIsModalVisible(false);
Expand Down Expand Up @@ -239,7 +238,7 @@
</EuiPageHeaderSection>
</EuiPageHeader>
)}
<EuiPageContent id="notebookArea">
<EuiPageContent id="notebookArea" paddingSize="m">
{newNavigation ? (
<HeaderControlledComponentsWrapper
description={
Expand Down Expand Up @@ -348,7 +347,7 @@
/>
</EuiFlexItem>
</EuiFlexGroup>
<EuiHorizontalRule margin="m" />
<EuiSpacer size="m" />
<EuiInMemoryTable
loading={loading}
items={
Expand Down
Loading
Loading