Skip to content

Commit

Permalink
Fine tuned dev tool datasource selector UI
Browse files Browse the repository at this point in the history
Signed-off-by: Su <szhongna@amazon.com>
  • Loading branch information
zhongnansu committed Apr 7, 2023
1 parent 174756f commit 147cc7b
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 47 deletions.
79 changes: 34 additions & 45 deletions src/plugins/dev_tools/public/application.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -154,51 +154,40 @@ function DevToolsWrapper({

return (
<main className="devApp">
<div>
<EuiFlexGroup gutterSize="none">
<EuiFlexItem>
<EuiTabs>
{devTools.map((currentDevTool) => (
<EuiToolTip content={currentDevTool.tooltipContent} key={currentDevTool.id}>
<EuiTab
disabled={currentDevTool.isDisabled()}
isSelected={currentDevTool === activeDevTool}
onClick={() => {
if (!currentDevTool.isDisabled()) {
updateRoute(`/${currentDevTool.id}`);
}
}}
>
{currentDevTool.title}
</EuiTab>
</EuiToolTip>
))}
</EuiTabs>
</EuiFlexItem>
{dataSourceEnabled ? (
<EuiFlexItem grow={false} className="dataSourceSelector">
<EuiComboBox
aria-label={i18n.translate('devTool.devToolWrapper.DataSourceComboBoxAriaLabel', {
defaultMessage: 'Select a Data Source',
})}
placeholder={i18n.translate(
'devTool.devToolWrapper.DataSourceComboBoxPlaceholder',
{
defaultMessage: 'Select a Data Source',
}
)}
singleSelection={{ asPlainText: true }}
options={dataSources}
selectedOptions={selectedOptions}
onChange={onChange}
prepend="DataSource"
compressed
isDisabled={!dataSourceEnabled}
/>
</EuiFlexItem>
) : null}
</EuiFlexGroup>
</div>
<EuiTabs className="devAppTabs">
{devTools.map((currentDevTool) => (
<EuiToolTip content={currentDevTool.tooltipContent} key={currentDevTool.id}>
<EuiTab
disabled={currentDevTool.isDisabled()}
isSelected={currentDevTool === activeDevTool}
onClick={() => {
if (!currentDevTool.isDisabled()) {
updateRoute(`/${currentDevTool.id}`);
}
}}
>
{currentDevTool.title}
</EuiTab>
</EuiToolTip>
))}
<div className="devAppDataSourcePicker">
<EuiComboBox
aria-label={i18n.translate('devTool.devToolWrapper.DataSourceComboBoxAriaLabel', {
defaultMessage: 'Select a Data Source',
})}
placeholder={i18n.translate('devTool.devToolWrapper.DataSourceComboBoxPlaceholder', {
defaultMessage: 'Select a Data Source',
})}
singleSelection={{ asPlainText: true }}
options={dataSources}
selectedOptions={selectedOptions}
onChange={onChange}
prepend="DataSource"
compressed
isDisabled={!dataSourceEnabled}
/>
</div>
</EuiTabs>

<div
className="devApp__container"
Expand Down
11 changes: 9 additions & 2 deletions src/plugins/dev_tools/public/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,14 @@
flex-grow: 1;
}

.dataSourceSelector {
margin: 5px 10px 5px 5px;
.devAppDataSourcePicker {
margin: 7px 8px 0px 0px;
min-width: 400px;
}

.devAppTabs {
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: space-between;
}

0 comments on commit 147cc7b

Please sign in to comment.