-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Canvas] Adds editor menu to Canvas (#113194)
- Loading branch information
Showing
21 changed files
with
629 additions
and
86 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
34 changes: 27 additions & 7 deletions
34
src/plugins/presentation_util/public/components/solution_toolbar/items/quick_group.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 |
---|---|---|
@@ -1,11 +1,31 @@ | ||
.quickButtonGroup { | ||
.quickButtonGroup__button { | ||
background-color: $euiColorEmptyShade; | ||
@include kbnThemeStyle('v8') { | ||
// sass-lint:disable-block no-important | ||
border-width: $euiBorderWidthThin !important; | ||
border-style: solid !important; | ||
border-color: $euiBorderColor !important; | ||
.euiButtonGroup__buttons { | ||
border-radius: $euiBorderRadius; | ||
|
||
.quickButtonGroup__button { | ||
background-color: $euiColorEmptyShade; | ||
@include kbnThemeStyle('v8') { | ||
// sass-lint:disable-block no-important | ||
border-width: $euiBorderWidthThin !important; | ||
border-style: solid !important; | ||
border-color: $euiBorderColor !important; | ||
} | ||
} | ||
|
||
.quickButtonGroup__button:first-of-type { | ||
@include kbnThemeStyle('v8') { | ||
// sass-lint:disable-block no-important | ||
border-top-left-radius: $euiBorderRadius !important; | ||
border-bottom-left-radius: $euiBorderRadius !important; | ||
} | ||
} | ||
|
||
.quickButtonGroup__button:last-of-type { | ||
@include kbnThemeStyle('v8') { | ||
// sass-lint:disable-block no-important | ||
border-top-right-radius: $euiBorderRadius !important; | ||
border-bottom-right-radius: $euiBorderRadius !important; | ||
} | ||
} | ||
} | ||
} |
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 |
---|---|---|
|
@@ -25,6 +25,7 @@ | |
"features", | ||
"inspector", | ||
"presentationUtil", | ||
"visualizations", | ||
"uiActions", | ||
"share" | ||
], | ||
|
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
81 changes: 81 additions & 0 deletions
81
...onents/workpad_header/editor_menu/__stories__/__snapshots__/editor_menu.stories.storyshot
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
107 changes: 107 additions & 0 deletions
107
...s/canvas/public/components/workpad_header/editor_menu/__stories__/editor_menu.stories.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,107 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { storiesOf } from '@storybook/react'; | ||
import { action } from '@storybook/addon-actions'; | ||
import React from 'react'; | ||
import { EmbeddableFactoryDefinition, IEmbeddable } from 'src/plugins/embeddable/public'; | ||
import { BaseVisType, VisTypeAlias } from 'src/plugins/visualizations/public'; | ||
import { EditorMenu } from '../editor_menu.component'; | ||
|
||
const testFactories: EmbeddableFactoryDefinition[] = [ | ||
{ | ||
type: 'ml_anomaly_swimlane', | ||
getDisplayName: () => 'Anomaly swimlane', | ||
getIconType: () => '', | ||
getDescription: () => 'Description for anomaly swimlane', | ||
isEditable: () => Promise.resolve(true), | ||
create: () => Promise.resolve({ id: 'swimlane_embeddable' } as IEmbeddable), | ||
grouping: [ | ||
{ | ||
id: 'ml', | ||
getDisplayName: () => 'machine learning', | ||
getIconType: () => 'machineLearningApp', | ||
}, | ||
], | ||
}, | ||
{ | ||
type: 'ml_anomaly_chart', | ||
getDisplayName: () => 'Anomaly chart', | ||
getIconType: () => '', | ||
getDescription: () => 'Description for anomaly chart', | ||
isEditable: () => Promise.resolve(true), | ||
create: () => Promise.resolve({ id: 'anomaly_chart_embeddable' } as IEmbeddable), | ||
grouping: [ | ||
{ | ||
id: 'ml', | ||
getDisplayName: () => 'machine learning', | ||
getIconType: () => 'machineLearningApp', | ||
}, | ||
], | ||
}, | ||
{ | ||
type: 'log_stream', | ||
getDisplayName: () => 'Log stream', | ||
getIconType: () => '', | ||
getDescription: () => 'Description for log stream', | ||
isEditable: () => Promise.resolve(true), | ||
create: () => Promise.resolve({ id: 'anomaly_chart_embeddable' } as IEmbeddable), | ||
}, | ||
]; | ||
|
||
const testVisTypes: BaseVisType[] = [ | ||
{ title: 'TSVB', icon: '', description: 'Description of TSVB', name: 'tsvb' } as BaseVisType, | ||
{ | ||
titleInWizard: 'Custom visualization', | ||
title: 'Vega', | ||
icon: '', | ||
description: 'Description of Vega', | ||
name: 'vega', | ||
} as BaseVisType, | ||
]; | ||
|
||
const testVisTypeAliases: VisTypeAlias[] = [ | ||
{ | ||
title: 'Lens', | ||
aliasApp: 'lens', | ||
aliasPath: 'path/to/lens', | ||
icon: 'lensApp', | ||
name: 'lens', | ||
description: 'Description of Lens app', | ||
stage: 'production', | ||
}, | ||
{ | ||
title: 'Maps', | ||
aliasApp: 'maps', | ||
aliasPath: 'path/to/maps', | ||
icon: 'gisApp', | ||
name: 'maps', | ||
description: 'Description of Maps app', | ||
stage: 'production', | ||
}, | ||
]; | ||
|
||
storiesOf('components/WorkpadHeader/EditorMenu', module) | ||
.add('default', () => ( | ||
<EditorMenu | ||
factories={testFactories} | ||
promotedVisTypes={testVisTypes} | ||
visTypeAliases={testVisTypeAliases} | ||
createNewVisType={() => action('createNewVisType')} | ||
createNewEmbeddable={() => action('createNewEmbeddable')} | ||
/> | ||
)) | ||
.add('dark mode', () => ( | ||
<EditorMenu | ||
factories={testFactories} | ||
isDarkThemeEnabled | ||
promotedVisTypes={testVisTypes} | ||
visTypeAliases={testVisTypeAliases} | ||
createNewVisType={() => action('createNewVisType')} | ||
createNewEmbeddable={() => action('createNewEmbeddable')} | ||
/> | ||
)); |
Oops, something went wrong.