-
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.
* Added new GlobalConfig layout. * Added filter components. * Added filterViews and their transforming. * Refactored getFilterFormatter method. * Added types. * Added hook for connecting to the canvas store. * Added filter types. * Fixed the style of filter view. * Added sidebar reducer and saved groupByOption there. * Added strict type. * Added time formatting and translations. * added invalid date translation. * Added components to the view of filter. * Fixed some bugs and done refactoring. * Added unit tests for filter.ts lib. * Refactored use_canvas_filters and added unit tests for filter_adapters. * Fixed format. * Added test to groupFiltersBy function. * Added default (beta) FiltersGroup story. * Refactored the code. * Storybook and snapshot for FiltersGroup component. * Added utils for WorkpadFilters storybook. * FilterComponent storybook and snapshot added. * WorkpadFiltersComponent storybook and snapshots added. * WorkpadFilters redux storybook added. * Added element without group to the redux WorkpadFilters storybook. * Updated snapshot for filter.component. * Moved filter views to a workpad_filters directory. * Fixed styles of the filter component. * Changed FunctionComponent to FC. * filter_group.tsx to filter_group.component.tsx * Added default to the groupFiltersByField * Added DEFAULT_GROUP_BY_FIELD. * filters_group.stories to filters_group.component.stories * Updated snapshots. Co-authored-by: Kibana Machine <[email protected]>
- Loading branch information
1 parent
25d1927
commit 0c8115c
Showing
43 changed files
with
2,702 additions
and
50 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
27 changes: 0 additions & 27 deletions
27
x-pack/plugins/canvas/public/components/sidebar/global_config.tsx
This file was deleted.
Oops, something went wrong.
15 changes: 15 additions & 0 deletions
15
x-pack/plugins/canvas/public/components/sidebar/global_config/filter_config.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,15 @@ | ||
/* | ||
* 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 React, { FC } from 'react'; | ||
import { WorkpadFilters } from '../../workpad_filters'; | ||
// @ts-expect-error unconverted component | ||
import { SidebarSection } from '../sidebar_section'; | ||
|
||
export const FilterConfig: FC = () => { | ||
return <WorkpadFilters />; | ||
}; |
29 changes: 29 additions & 0 deletions
29
x-pack/plugins/canvas/public/components/sidebar/global_config/general_config.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,29 @@ | ||
/* | ||
* 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 React, { Fragment, FC } from 'react'; | ||
// @ts-expect-error unconverted component | ||
import { ElementConfig } from '../../element_config'; | ||
// @ts-expect-error unconverted component | ||
import { PageConfig } from '../../page_config'; | ||
import { WorkpadConfig } from '../../workpad_config'; | ||
// @ts-expect-error unconverted component | ||
import { SidebarSection } from '../sidebar_section'; | ||
|
||
export const GeneralConfig: FC = () => { | ||
return ( | ||
<Fragment> | ||
<SidebarSection> | ||
<WorkpadConfig /> | ||
<ElementConfig /> | ||
</SidebarSection> | ||
<SidebarSection> | ||
<PageConfig /> | ||
</SidebarSection> | ||
</Fragment> | ||
); | ||
}; |
62 changes: 62 additions & 0 deletions
62
x-pack/plugins/canvas/public/components/sidebar/global_config/global_config.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,62 @@ | ||
/* | ||
* 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 React, { Fragment, FC } from 'react'; | ||
import { EuiTabbedContent, EuiTitle, EuiSpacer } from '@elastic/eui'; | ||
import { i18n } from '@kbn/i18n'; | ||
import { GeneralConfig } from './general_config'; | ||
import { FilterConfig } from './filter_config'; | ||
|
||
const strings = { | ||
getTitle: () => | ||
i18n.translate('xpack.canvas.globalConfig.title', { | ||
defaultMessage: 'Workpad settings', | ||
}), | ||
getGeneralLabel: () => | ||
i18n.translate('xpack.canvas.globalConfig.general', { | ||
defaultMessage: 'General', | ||
}), | ||
getFilterLabel: () => | ||
i18n.translate('xpack.canvas.globalConfig.filter', { | ||
defaultMessage: 'Filter', | ||
}), | ||
}; | ||
|
||
export const GlobalConfig: FC = () => { | ||
const tabs = [ | ||
{ | ||
id: 'general', | ||
name: strings.getGeneralLabel(), | ||
content: ( | ||
<div className="canvasSidebar__pop"> | ||
<EuiSpacer size="m" /> | ||
<GeneralConfig /> | ||
</div> | ||
), | ||
}, | ||
{ | ||
id: 'filter', | ||
name: strings.getFilterLabel(), | ||
content: ( | ||
<div className="canvasSidebar__pop"> | ||
<FilterConfig /> | ||
</div> | ||
), | ||
}, | ||
]; | ||
|
||
return ( | ||
<Fragment> | ||
<div className="canvasLayout__sidebarHeader"> | ||
<EuiTitle size="xs"> | ||
<h4>{strings.getTitle()}</h4> | ||
</EuiTitle> | ||
</div> | ||
<EuiTabbedContent tabs={tabs} initialSelectedTab={tabs[0]} size="s" /> | ||
</Fragment> | ||
); | ||
}; |
8 changes: 8 additions & 0 deletions
8
x-pack/plugins/canvas/public/components/sidebar/global_config/index.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,8 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
export { GlobalConfig } from './global_config'; |
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
Oops, something went wrong.