forked from opensearch-project/dashboards-flow-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add resizable side panel for workspace component details
Signed-off-by: Tyler Ohlsen <[email protected]>
- Loading branch information
Showing
8 changed files
with
95 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
public/pages/workflow_detail/workspace/component_inputs.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import React from 'react'; | ||
import { EuiFlexGroup, EuiFlexItem, EuiText } from '@elastic/eui'; | ||
import { Workflow } from '../../../../common'; | ||
|
||
// styling | ||
import './workspace-styles.scss'; | ||
|
||
interface ComponentInputsProps {} | ||
|
||
export function ComponentInputs(props: ComponentInputsProps) { | ||
return ( | ||
<EuiFlexGroup | ||
direction="column" | ||
gutterSize="none" | ||
justifyContent="spaceBetween" | ||
className="workspace-panel" | ||
> | ||
<EuiFlexItem className="resizable-panel-border"> | ||
<EuiText>Side panel</EuiText> | ||
</EuiFlexItem> | ||
</EuiFlexGroup> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
public/pages/workflow_detail/workspace/resizable_workspace.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import React from 'react'; | ||
import { EuiResizableContainer } from '@elastic/eui'; | ||
import { Workflow } from '../../../../common'; | ||
import { Workspace } from './workspace'; | ||
import { ComponentInputs } from './component_inputs'; | ||
|
||
interface ResizableWorkspaceProps { | ||
workflow?: Workflow; | ||
} | ||
|
||
export function ResizableWorkspace(props: ResizableWorkspaceProps) { | ||
return ( | ||
<EuiResizableContainer | ||
direction="horizontal" | ||
style={{ marginLeft: '-14px' }} | ||
> | ||
{(EuiResizablePanel, EuiResizableButton) => ( | ||
<> | ||
<EuiResizablePanel | ||
mode="main" | ||
initialSize={80} | ||
minSize="50%" | ||
style={{ margin: 0, padding: 0 }} | ||
> | ||
<Workspace workflow={props.workflow} /> | ||
</EuiResizablePanel> | ||
<EuiResizableButton /> | ||
<EuiResizablePanel mode="collapsible" initialSize={20} minSize="10%"> | ||
<ComponentInputs /> | ||
</EuiResizablePanel> | ||
</> | ||
)} | ||
</EuiResizableContainer> | ||
); | ||
} |
12 changes: 12 additions & 0 deletions
12
public/pages/workflow_detail/workspace/workspace-styles.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
.workspace-panel { | ||
// this ratio will allow the workspace to render on a standard | ||
// laptop (3024 x 1964) without introducing overflow/scrolling | ||
height: 60vh; | ||
padding: 0; | ||
} | ||
|
||
.resizable-panel-border { | ||
border-style: groove; | ||
border-color: gray; | ||
border-width: 1px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters