Skip to content

Commit

Permalink
Replace metrics slider with ResizableContainer (opensearch-project#602)…
Browse files Browse the repository at this point in the history
… (opensearch-project#635)

Signed-off-by: Peter Fitzgibbons <peter.fitzgibbons@gmail.com>
(cherry picked from commit 3b35600)

Co-authored-by: Peter Fitzgibbons <peter.fitzgibbons@gmail.com>
(cherry picked from commit b1d38a3)
  • Loading branch information
opensearch-trigger-bot[bot] authored and A9 Swift Project User committed Aug 10, 2023
1 parent cc5be41 commit 4d21d22
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 42 deletions.
4 changes: 2 additions & 2 deletions auto_sync_commit_metadata.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"last_github_commit": "55d99546729e43611ff28de655f6975adf2ccd9c",
"last_gitfarm_commit": "5adea465ea0f4ddace40ef75a5d528ecbfd29f23"
"last_github_commit": "b1d38a3b70852ef5c6c8dc8c44b05ce755c85c68",
"last_gitfarm_commit": "5111509e1ee759880bde927eda1360f79447bd71"
}
73 changes: 33 additions & 40 deletions public/components/metrics/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
EuiGlobalToastList,
EuiPage,
EuiPageBody,
EuiResizableContainer,
htmlIdGenerator,
OnTimeChangeProps,
ShortDate,
Expand Down Expand Up @@ -187,47 +188,39 @@ export const Home = ({
setSearch={setSearch}
/>
<div className="dscAppContainer">
<div
className={`col-md-2 dscSidebar__container dscCollapsibleSidebar ${sidebarClassName}`}
>
<div className="">
{!isSidebarClosed && (
<Sidebar http={http} pplService={pplService} search={search} />
)}
<EuiButtonIcon
iconType={isSidebarClosed ? 'menuRight' : 'menuLeft'}
iconSize="m"
size="s"
onClick={() => onSideBarClick()}
data-test-subj="collapseSideBarButton"
aria-controls="discover-sidebar"
aria-expanded={isSidebarClosed ? 'false' : 'true'}
aria-label="Toggle sidebar"
className="dscCollapsibleSidebar__collapseButton"
/>
</div>
</div>
<div className={`dscWrapper ${mainSectionClassName}`}>
{selectedMetrics.length > 0 ? (
<MetricsGrid
http={http}
chrome={chrome}
panelVisualizations={panelVisualizations}
setPanelVisualizations={setPanelVisualizations}
editMode={editMode}
pplService={pplService}
startTime={startTime}
endTime={endTime}
moveToEvents={onEditClick}
onRefresh={onRefresh}
editActionType={editActionType}
setEditActionType={setEditActionType}
spanParam={spanValue + resolutionValue}
/>
) : (
<EmptyMetricsView />
<EuiResizableContainer>
{(EuiResizablePanel, EuiResizableButton) => (
<>
<EuiResizablePanel mode="collapsible" initialSize={20} minSize="10%">
<Sidebar http={http} pplService={pplService} search={search} />
</EuiResizablePanel>

<EuiResizableButton />

<EuiResizablePanel mode="main" initialSize={80} minSize="50px">
{selectedMetrics.length > 0 ? (
<MetricsGrid
http={http}
chrome={chrome}
panelVisualizations={panelVisualizations}
setPanelVisualizations={setPanelVisualizations}
editMode={editMode}
pplService={pplService}
startTime={startTime}
endTime={endTime}
moveToEvents={onEditClick}
onRefresh={onRefresh}
editActionType={editActionType}
setEditActionType={setEditActionType}
spanParam={spanValue + resolutionValue}
/>
) : (
<EmptyMetricsView />
)}
</EuiResizablePanel>
</>
)}
</div>
</EuiResizableContainer>
</div>
</EuiPageBody>
</EuiPage>
Expand Down

0 comments on commit 4d21d22

Please sign in to comment.