Skip to content

Commit

Permalink
"Create drilldown" flyout - design cleanup (#60309)
Browse files Browse the repository at this point in the history
* create drilldown flyout cleanup

* remove border from selectedActionFactoryContainer

* adjust callout in DrilldownHello

* update form labels

* remove unused file

* fix type error

Co-authored-by: Anton Dosov <[email protected]>
  • Loading branch information
andreadelrio and Dosant authored Mar 17, 2020
1 parent 7a7beeb commit 5418305
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 18 deletions.
3 changes: 2 additions & 1 deletion packages/kbn-storybook/storybook_config/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ module.exports = async ({ config }) => {
config.module.rules.push({
test: /\.tsx$/,
// Exclude example files, as we don't display props info for them
exclude: /\.examples.tsx$/,
// TODO: validated_dual_range throws: https://github.com/elastic/kibana/issues/60356
exclude: /\.examples.tsx$|validated_dual_range.tsx$/,
use: [
// Parse TS comments to create Props tables in the UI
require.resolve('react-docgen-typescript-loader'),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
.auaActionWizard__selectedActionFactoryContainer {
background-color: $euiColorLightestShade;
padding: $euiSize;
border-radius: $euiBorderRadius;
}

.auaActionWizard__actionFactoryItem {
.euiKeyPadMenuItem__label {
height: #{$euiSizeXL};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ const SelectedActionFactory: React.FC<SelectedActionFactoryProps> = ({
</EuiFlexItem>
{showDeselect && (
<EuiFlexItem grow={false}>
<EuiButtonEmpty size="s" onClick={() => onDeselect()}>
<EuiButtonEmpty size="xs" onClick={() => onDeselect()}>
{txtChangeButton}
</EuiButtonEmpty>
</EuiFlexItem>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ import {
EuiFlexGroup,
EuiFlexItem,
EuiTextColor,
EuiText,
EuiLink,
EuiSpacer,
EuiButtonEmpty,
EuiIcon,
} from '@elastic/eui';
import './drilldown_hello_bar.scss';
import { txtHideHelpButtonLabel, txtHelpText, txtViewDocsLinkLabel } from './i18n';

export interface DrilldownHelloBarProps {
Expand All @@ -30,12 +31,16 @@ export const DrilldownHelloBar: React.FC<DrilldownHelloBarProps> = ({
}) => {
return (
<EuiCallOut
iconType="help"
data-test-subj={WELCOME_MESSAGE_TEST_SUBJ}
title={
<EuiFlexGroup className="drdHelloBar__content">
<EuiFlexItem grow={false}>
<EuiIcon type="help" />
</EuiFlexItem>
<EuiFlexItem grow={true}>
<EuiTextColor color="subdued">{txtHelpText}</EuiTextColor>
<EuiText size={'s'}>
<EuiTextColor color="subdued">{txtHelpText}</EuiTextColor>
</EuiText>
{docsLink && (
<>
<EuiSpacer size={'xs'} />
Expand All @@ -45,7 +50,7 @@ export const DrilldownHelloBar: React.FC<DrilldownHelloBarProps> = ({
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiButtonEmpty size="xs" onClick={onHideClick}>
<EuiTextColor color="subdued">{txtHideHelpButtonLabel}</EuiTextColor>
{txtHideHelpButtonLabel}
</EuiButtonEmpty>
</EuiFlexItem>
</EuiFlexGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,23 @@ storiesOf('components/FlyoutDrilldownWizard', module)
/>
</EuiFlyout>
);
})
.add('open in flyout - edit, just 1 action type', () => {
return (
<EuiFlyout onClose={() => {}}>
<FlyoutDrilldownWizard
onClose={() => {}}
drilldownActionFactories={[dashboardFactory]}
initialDrilldownWizardConfig={{
name: 'My fancy drilldown',
actionFactory: urlFactory as any,
actionConfig: {
url: 'https://elastic.co',
openInNewTab: true,
},
}}
mode={'edit'}
/>
</EuiFlyout>
);
});
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export const FormDrilldownWizard: React.FC<FormDrilldownWizardProps> = ({

const actionWizard = (
<EuiFormRow
label={txtDrilldownAction}
label={actionFactories?.length > 1 ? txtDrilldownAction : undefined}
fullWidth={true}
className="drdFormDrilldownWizard__formRow"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { i18n } from '@kbn/i18n';
export const txtNameOfDrilldown = i18n.translate(
'xpack.drilldowns.components.FormCreateDrilldown.nameOfDrilldown',
{
defaultMessage: 'Name of drilldown:',
defaultMessage: 'Name',
}
);

Expand All @@ -23,6 +23,6 @@ export const txtUntitledDrilldown = i18n.translate(
export const txtDrilldownAction = i18n.translate(
'xpack.drilldowns.components.FormCreateDrilldown.drilldownAction',
{
defaultMessage: 'Drilldown action:',
defaultMessage: 'Action',
}
);

0 comments on commit 5418305

Please sign in to comment.