Skip to content

Commit

Permalink
[Rename] Refactored src/plugins/vis_type_tagcloud directory (#98)
Browse files Browse the repository at this point in the history
* [Rename] Refactored src/plugins/vis_type_tagcloud directory

Signed-off-by: Mihir Soni <mihirsoni.123@gmail.com>
  • Loading branch information
mihirsoni authored Mar 12, 2021
1 parent e52c3b9 commit 7f641eb
Show file tree
Hide file tree
Showing 13 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion src/plugins/vis_type_tagcloud/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import { schema, TypeOf } from '@kbn/config-schema';
import { schema, TypeOf } from '@osd/config-schema';

export const configSchema = schema.object({
enabled: schema.boolean({ defaultValue: true }),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"id": "visTypeTagcloud",
"version": "kibana",
"version": "opensearchDashboards",
"ui": true,
"server": true,
"requiredPlugins": ["data", "expressions", "visualizations", "charts"],
"requiredBundles": ["kibanaUtils", "kibanaReact", "visDefaultEditor"]
"requiredBundles": ["opensearchDashboardsUtils", "opensearchDashboardsReact", "visDefaultEditor"]
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

import React, { Component, Fragment } from 'react';
import { FormattedMessage } from '@kbn/i18n/react';
import { FormattedMessage } from '@osd/i18n/react';
import { EuiIconTip } from '@elastic/eui';

export class FeedbackMessage extends Component {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@

import React from 'react';
import { EuiPanel } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { i18n } from '@osd/i18n';
import { VisOptionsProps } from '../../../vis_default_editor/public';
import { ValidatedDualRange } from '../../../kibana_react/public';
import { ValidatedDualRange } from '../../../opensearch_dashboards_react/public';
import { SelectOption, SwitchOption } from '../../../charts/public';
import { TagCloudVisParams } 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 * as Rx from 'rxjs';
import { take } from 'rxjs/operators';
import { render, unmountComponentAtNode } from 'react-dom';
import { I18nProvider } from '@kbn/i18n/react';
import { I18nProvider } from '@osd/i18n/react';

import { getFormatService } from '../services';

Expand Down
2 changes: 1 addition & 1 deletion src/plugins/vis_type_tagcloud/public/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import { PluginInitializerContext } from 'kibana/public';
import { PluginInitializerContext } from 'opensearch-dashboards/public';
import { TagCloudPlugin as Plugin } from './plugin';

export function plugin(initializerContext: PluginInitializerContext) {
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/vis_type_tagcloud/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import { PluginInitializerContext, CoreSetup, CoreStart, Plugin } from 'kibana/public';
import { PluginInitializerContext, CoreSetup, CoreStart, Plugin } from 'opensearch-dashboards/public';
import { Plugin as ExpressionsPublicPlugin } from '../../expressions/public';
import { VisualizationsSetup } from '../../visualizations/public';
import { ChartsPluginSetup } from '../../charts/public';
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/vis_type_tagcloud/public/services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import { createGetterSetter } from '../../kibana_utils/public';
import { createGetterSetter } from '../../opensearch_dashboards_utils/public';
import { DataPublicPluginStart } from '../../data/public';

export const [getFormatService, setFormatService] = createGetterSetter<
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/vis_type_tagcloud/public/tag_cloud_fn.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { functionWrapper } from '../../expressions/common/expression_functions/s
describe('interpreter/functions#tagcloud', () => {
const fn = functionWrapper(createTagCloudFn());
const context = {
type: 'kibana_datatable',
type: 'opensearch_dashboards_datatable',
rows: [{ 'col-0-1': 0 }],
columns: [{ id: 'col-0-1', name: 'Count' }],
};
Expand Down
10 changes: 5 additions & 5 deletions src/plugins/vis_type_tagcloud/public/tag_cloud_fn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
* under the License.
*/

import { i18n } from '@kbn/i18n';
import { i18n } from '@osd/i18n';

import { ExpressionFunctionDefinition, KibanaDatatable, Render } from '../../expressions/public';
import { ExpressionFunctionDefinition, OpenSearchDashboardsDatatable, Render } from '../../expressions/public';
import { TagCloudVisParams } from './types';

const name = 'tagcloud';
Expand All @@ -31,21 +31,21 @@ interface Arguments extends TagCloudVisParams {

export interface TagCloudVisRenderValue {
visType: typeof name;
visData: KibanaDatatable;
visData: OpenSearchDashboardsDatatable;
visParams: Arguments;
}

export type TagcloudExpressionFunctionDefinition = ExpressionFunctionDefinition<
typeof name,
KibanaDatatable,
OpenSearchDashboardsDatatable,
Arguments,
Render<TagCloudVisRenderValue>
>;

export const createTagCloudFn = (): TagcloudExpressionFunctionDefinition => ({
name,
type: 'render',
inputTypes: ['kibana_datatable'],
inputTypes: ['opensearch_dashboards_datatable'],
help: i18n.translate('visTypeTagCloud.function.help', {
defaultMessage: 'Tagcloud visualization',
}),
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/vis_type_tagcloud/public/tag_cloud_type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import { i18n } from '@kbn/i18n';
import { i18n } from '@osd/i18n';

import { Schemas } from '../../vis_default_editor/public';
import { VIS_EVENT_TO_TRIGGER } from '../../visualizations/public';
Expand Down
6 changes: 3 additions & 3 deletions src/plugins/vis_type_tagcloud/public/to_ast.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import { EsaggsExpressionFunctionDefinition } from '../../data/common/search/expressions';
import { OpenSearchaggsExpressionFunctionDefinition } from '../../data/common/search/expressions';
import { buildExpression, buildExpressionFunction } from '../../expressions/public';
import { getVisSchemas, SchemaConfig, Vis, BuildPipelineParams } from '../../visualizations/public';
import { TagcloudExpressionFunctionDefinition } from './tag_cloud_fn';
Expand All @@ -35,7 +35,7 @@ const prepareDimension = (params: SchemaConfig) => {
};

export const toExpressionAst = (vis: Vis<TagCloudVisParams>, params: BuildPipelineParams) => {
const esaggs = buildExpressionFunction<EsaggsExpressionFunctionDefinition>('esaggs', {
const opensearchaggs = buildExpressionFunction<OpenSearchaggsExpressionFunctionDefinition>('opensearchaggs', {
index: vis.data.indexPattern!.id!,
metricsAtAllLevels: vis.isHierarchical(),
partialRows: false,
Expand All @@ -59,7 +59,7 @@ export const toExpressionAst = (vis: Vis<TagCloudVisParams>, params: BuildPipeli
tagcloud.addArgument('bucket', prepareDimension(schemas.segment[0]));
}

const ast = buildExpression([esaggs, tagcloud]);
const ast = buildExpression([opensearchaggs, tagcloud]);

return ast.toAst();
};
2 changes: 1 addition & 1 deletion src/plugins/vis_type_tagcloud/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import { PluginConfigDescriptor } from 'kibana/server';
import { PluginConfigDescriptor } from 'opensearch-dashboards/server';

import { configSchema, ConfigSchema } from '../config';

Expand Down

0 comments on commit 7f641eb

Please sign in to comment.