Skip to content

Commit

Permalink
Restructure files in kbn_vislib_vis_types folder (elastic#43866)
Browse files Browse the repository at this point in the history
* Files restructure

* Get rid of export from index
  • Loading branch information
sulemanof authored Aug 28, 2019
1 parent b20c7fc commit 15377f3
Show file tree
Hide file tree
Showing 33 changed files with 104 additions and 110 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import { VisFactoryProvider } from 'ui/vis/vis_factory';
import { i18n } from '@kbn/i18n';
import { Schemas } from 'ui/vis/editors/default/schemas';
import { PointSeriesOptions } from './editors/point_series';
import { PointSeriesOptions } from './components/options';
import { getLegendPositions, LegendPositions } from './utils/legend_positions';
import { palettes } from '@elastic/eui/lib/services';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { VisOptionsProps } from 'ui/vis/editors/default';
import { SwitchOption } from './switch';
import { SelectOption } from './select';

export interface BasicOptionsParams {
interface BasicOptionsParams {
addTooltip: boolean;
legendPosition: string;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,10 @@
* under the License.
*/

import 'ui/directives/inequality';
import { uiModules } from 'ui/modules';
import pointSeriesOptionsTemplate from './point_series_options.html';
const module = uiModules.get('kibana');

module.directive('pointSeriesOptions', function () {
return {
restrict: 'E',
template: pointSeriesOptionsTemplate,
replace: true
};
});
export { BasicOptions } from './basic_options';
export { NumberInputOption } from './number_input';
export { RangeOption } from './range';
export { SelectOption } from './select';
export { SwitchOption } from './switch';
export { TextInputOption } from './text_input';
export { TruncateLabelsOption } from './truncate_labels';
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

export * from './common';
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import React, { useCallback } from 'react';
import { EuiSpacer } from '@elastic/eui';

import { VisOptionsProps } from 'ui/vis/editors/default';
import { GaugeVisParams } from '../../gauge';
import { GaugeVisParams } from '../../../gauge';
import { RangesPanel } from './ranges_panel';
import { StylePanel } from './style_panel';
import { LabelsPanel } from './labels_panel';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ import { EuiPanel, EuiSpacer, EuiTitle } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n/react';

import { SwitchOption } from '../../controls/switch';
import { TextInputOption } from '../../controls/text_input';
import { SwitchOption, TextInputOption } from '../../common';
import { GaugeOptionsInternalProps } from '.';

function LabelsPanel({ stateParams, setValue, setGaugeValue }: GaugeOptionsInternalProps) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n/react';

import { RangesParamEditor } from 'ui/agg_types/controls/ranges';
import { SelectOption } from '../../controls/select';
import { SwitchOption } from '../../controls/switch';
import { SelectOption, SwitchOption } from '../../common';
import { GaugeOptionsInternalProps } from '.';

function RangesPanel({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n/react';

import { AggGroupNames } from 'ui/vis/editors/default';
import { SelectOption } from '../../controls/select';
import { GaugeVisParams } from '../../gauge';
import { SelectOption } from '../../common';
import { GaugeVisParams } from '../../../gauge';
import { GaugeOptionsInternalProps } from '.';

function StylePanel({
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

export { GaugeOptions } from './gauge';
export { PieOptions } from './pie';
export { PointSeriesOptions } from './point_series';
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@ import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n/react';

import { VisOptionsProps } from 'ui/vis/editors/default';
import { BasicOptions } from '../controls/basic_options';
import { SwitchOption } from '../controls/switch';
import { TruncateLabelsOption } from '../controls/truncate_labels';
import { PieVisParams } from '../pie';
import { BasicOptions, TruncateLabelsOption, SwitchOption } from '../common';
import { PieVisParams } from '../../pie';

function PieOptions(props: VisOptionsProps<PieVisParams>) {
const { stateParams, setValue } = props;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@ import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n/react';

import { VisOptionsProps } from 'ui/vis/editors/default';
import { SwitchOption } from '../switch';
import { SelectOption } from '../select';
import { BasicVislibParams, ValueAxis } from '../../types';
import { SelectOption, SwitchOption } from '../../common';
import { BasicVislibParams, ValueAxis } from '../../../types';

function GridOptions({
stateParams,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

export { PointSeriesOptions } from './point_series';
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,9 @@ import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n/react';

import { VisOptionsProps } from 'ui/vis/editors/default';
import { SwitchOption } from '../controls/switch';
import { GridOptions } from '../controls/point_series/grid_options';
import { BasicOptions } from '../controls/basic_options';
import { BasicVislibParams } from '../types';
import { NumberInputOption } from '../controls/number_input';
import { SelectOption } from '../controls/select';
import { BasicOptions, NumberInputOption, SelectOption, SwitchOption } from '../../common';
import { GridOptions } from './grid_options';
import { BasicVislibParams } from '../../../types';

function PointSeriesOptions(props: VisOptionsProps<BasicVislibParams>) {
const { stateParams, setValue, vis } = props;
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { i18n } from '@kbn/i18n';
import { VisFactoryProvider } from 'ui/vis/vis_factory';
import { Schemas } from 'ui/vis/editors/default/schemas';
import { colorSchemas } from 'ui/vislib/components/color/colormaps';
import { GaugeOptions } from './editors/gauge';
import { GaugeOptions } from './components/options';

export default function GaugeVisType(Private) {
const VisFactory = Private(VisFactoryProvider);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { VisFactoryProvider } from 'ui/vis/vis_factory';
import { i18n } from '@kbn/i18n';
import { Schemas } from 'ui/vis/editors/default/schemas';
import { colorSchemas } from 'ui/vislib/components/color/colormaps';
import { GaugeOptions } from './editors/gauge';
import { GaugeOptions } from './components/options';

export default function GoalVisType(Private) {
const VisFactory = Private(VisFactoryProvider);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import { VisFactoryProvider } from 'ui/vis/vis_factory';
import { i18n } from '@kbn/i18n';
import { Schemas } from 'ui/vis/editors/default/schemas';
import { PointSeriesOptions } from './editors/point_series';
import { PointSeriesOptions } from './components/options';
import { getLegendPositions, LegendPositions } from './utils/legend_positions';
import { palettes } from '@elastic/eui/lib/services';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import { VisFactoryProvider } from 'ui/vis/vis_factory';
import { i18n } from '@kbn/i18n';
import { Schemas } from 'ui/vis/editors/default/schemas';
import { PointSeriesOptions } from './editors/point_series';
import { PointSeriesOptions } from './components/options';
import { getLegendPositions, LegendPositions } from './utils/legend_positions';

export default function PointSeriesVisType(Private) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import { VisFactoryProvider } from 'ui/vis/vis_factory';
import { i18n } from '@kbn/i18n';
import { Schemas } from 'ui/vis/editors/default/schemas';
import { PointSeriesOptions } from './editors/point_series';
import { PointSeriesOptions } from './components/options';
import { getLegendPositions, LegendPositions } from './utils/legend_positions';
import { palettes } from '@elastic/eui/lib/services';

Expand Down
2 changes: 1 addition & 1 deletion src/legacy/core_plugins/kbn_vislib_vis_types/public/pie.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import { VisFactoryProvider } from 'ui/vis/vis_factory';
import { i18n } from '@kbn/i18n';
import { Schemas } from 'ui/vis/editors/default/schemas';
import { PieOptions } from './editors/pie';
import { PieOptions } from './components/options';

export default function HistogramVisType(Private) {
const VisFactory = Private(VisFactoryProvider);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,11 @@ import { FormattedMessage } from '@kbn/i18n/react';
import { toastNotifications } from 'ui/notify';
import { FileLayerField, VectorLayer, ServiceSettings } from 'ui/vis/map/service_settings';
import { VisOptionsProps } from 'ui/vis/editors/default';
import { SelectOption } from '../../../kbn_vislib_vis_types/public/controls/select';
import { SwitchOption } from '../../../kbn_vislib_vis_types/public/controls/switch';
import { NumberInputOption } from '../../../kbn_vislib_vis_types/public/controls/number_input';
import {
NumberInputOption,
SelectOption,
SwitchOption,
} from '../../../kbn_vislib_vis_types/public/components';
import { ORIGIN } from '../../../tile_map/common/origin';
import { WmsOptions } from '../../../tile_map/public/components/wms_options';
import { mapToLayerWithId } from '../util';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,12 @@ import { i18n } from '@kbn/i18n';

import { ServiceSettings } from 'ui/vis/map/service_settings';
import { VisOptionsProps } from 'ui/vis/editors/default';
import { SelectOption } from '../../../kbn_vislib_vis_types/public/controls/select';
import { RangeOption } from '../../../kbn_vislib_vis_types/public/controls/range';
import { BasicOptions } from '../../../kbn_vislib_vis_types/public/controls/basic_options';
import { SwitchOption } from '../../../kbn_vislib_vis_types/public/controls/switch';
import {
BasicOptions,
RangeOption,
SelectOption,
SwitchOption,
} from '../../../kbn_vislib_vis_types/public/components';
import { WmsOptions } from './wms_options';
import { TileMapVisParams } from '../types';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import React from 'react';
import { EuiLink, EuiSpacer, EuiText, EuiScreenReaderOnly } from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';

import { TextInputOption } from '../../../kbn_vislib_vis_types/public/controls/text_input';
import { TextInputOption } from '../../../kbn_vislib_vis_types/public/components';
import { WMSOptions } from '../types';

interface WmsInternalOptions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ import { FormattedMessage } from '@kbn/i18n/react';

import { toastNotifications } from 'ui/notify';
import { TmsLayer } from 'ui/vis/map/service_settings';
import { SelectOption } from '../../../kbn_vislib_vis_types/public/controls/select';
import { SwitchOption } from '../../../kbn_vislib_vis_types/public/controls/switch';
import { SelectOption, SwitchOption } from '../../../kbn_vislib_vis_types/public/components';
import { RegionMapOptionsProps } from '../../../region_map/public/components/region_map_options';
import { WmsInternalOptions } from './wms_internal_options';
import { TileMapOptionsProps } from './tile_map_options';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n/react';

import { VisOptionsProps } from 'ui/vis/editors/default';
import { SwitchOption } from '../../kbn_vislib_vis_types/public/controls/switch';
import { RangeOption } from '../../kbn_vislib_vis_types/public/controls/range';
import { RangeOption, SwitchOption } from '../../kbn_vislib_vis_types/public/components';
import { MarkdownVisParams } from './types';

function SettingsOptions({ stateParams, setValue }: VisOptionsProps<MarkdownVisParams>) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ import { i18n } from '@kbn/i18n';

import { ValidatedDualRange } from 'ui/validated_range';
import { VisOptionsProps } from 'ui/vis/editors/default';
import { SelectOption } from '../../../kbn_vislib_vis_types/public/controls/select';
import { SwitchOption } from '../../../kbn_vislib_vis_types/public/controls/switch';
import { SelectOption, SwitchOption } from '../../../kbn_vislib_vis_types/public/components';
import { TagCloudVisParams } from '../types';

function TagCloudOptions({ stateParams, setValue, vis }: VisOptionsProps<TagCloudVisParams>) {
Expand Down
1 change: 0 additions & 1 deletion src/legacy/ui/public/vis/vis_types/vislib_vis_type.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
* under the License.
*/

import 'plugins/kbn_vislib_vis_types/controls/point_series_options';
import 'plugins/kbn_vislib_vis_types/controls/line_interpolation_option';
import 'plugins/kbn_vislib_vis_types/controls/heatmap_options';
import 'plugins/kbn_vislib_vis_types/controls/point_series';
Expand Down

0 comments on commit 15377f3

Please sign in to comment.