Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Rename] Refactored src/plugins/vis_type_tagcloud directory #98

Merged
merged 2 commits into from
Mar 12, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
4 changes: 2 additions & 2 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 esaggs = buildExpressionFunction<OpenSearchaggsExpressionFunctionDefinition>('esaggs', {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

esaggs --> opensearchaggs ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

index: vis.data.indexPattern!.id!,
metricsAtAllLevels: vis.isHierarchical(),
partialRows: false,
Expand Down
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