Skip to content

Commit

Permalink
switch compatibility to opensearch-dashboards 1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
jbgachot committed Jan 21, 2022
1 parent a58d5a7 commit 2c1f74c
Show file tree
Hide file tree
Showing 35 changed files with 102 additions and 101 deletions.
18 changes: 0 additions & 18 deletions kibana.json

This file was deleted.

19 changes: 19 additions & 0 deletions opensearch_dashboards.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"id": "enhancedTable",
"version": "opensearch-dashboards",
"opensearchDashboardsVersion": "1.2.0",
"server": false,
"ui": true,
"requiredPlugins": [
"visualizations",
"expressions",
"data",
"inspector",
"opensearchDashboardsLegacy",
"opensearchDashboardsUtils",
"opensearchDashboardsReact",
"share",
"charts",
"visDefaultEditor"
]
}
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@
"name": "enhanced-table",
"version": "1.11.0",
"description": "This visualization plugin is like a Data Table, but with enhanced features like computed columns, filter bar and pivot table",
"kibana": {
"version": "kibana"
"opensearch-dashboards": {
"version": "opensearch-dashboards"
},
"scripts": {
"preinstall": "node ../../preinstall_check",
"kbn": "node ../../scripts/kbn",
"osd": "node ../../scripts/osd",
"es": "node ../../scripts/es",
"lint": "../../node_modules/.bin/eslint .",
"start": "cd ../.. && node scripts/kibana --dev --oss",
"start": "cd ../.. && node scripts/opensearch_dashboards --dev",
"test:server": "../../node_modules/.bin/plugin-helpers test:server",
"test:browser": "../../node_modules/.bin/plugin-helpers test:browser",
"build": "../../node_modules/.bin/plugin-helpers build",
"compile": "rm -rf ./target && node ../../scripts/build_kibana_platform_plugins.js --scan-dir ."
"compile": "rm -rf ./target && node ../../scripts/build_opensearch_dashboards_platform_plugins.js --scan-dir ."
},
"dependencies": {
"expr-eval": "2.0.2"
Expand Down
6 changes: 3 additions & 3 deletions public/agg_table/_agg_table.scss
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
kbn-enhanced-agg-table,
kbn-enhanced-agg-table-group {
osd-enhanced-agg-table,
osd-enhanced-agg-table-group {
display: block;
}

.striped-rows .kbnAggTable__paginated {
.striped-rows .osdAggTable__paginated {
tr:nth-child(odd) td {
background-color: lighten($euiColorLightestShade, 2%);
}
Expand Down
2 changes: 1 addition & 1 deletion public/agg_table/agg_table.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
filter="filter"
totalFunc="totalFunc">

<div class="kbnAggTable__controls">
<div class="osdAggTable__controls">
<small
i18n-id="visTypeTable.aggTable.exportLabel"
i18n-default-message="Export:"
Expand Down
4 changes: 2 additions & 2 deletions public/agg_table/agg_table.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ import { CSV_SEPARATOR_SETTING, CSV_QUOTE_VALUES_SETTING } from '../../../../src
import aggTableTemplate from './agg_table.html';
import { getFormatService } from '../services';
import { fieldFormatter } from '../field_formatter';import { computeColumnTotal } from '../column_total_computer';
import { handleCourierRequest } from '../data_load/kibana_cloned_code/courier';
import { handleCourierRequest } from '../data_load/opensearch_dashboards_cloned_code/courier';
import { createTable } from '../data_load/document-table-response-handler';
import { streamSaver } from './stream_saver';

export function KbnEnhancedAggTable(config, RecursionHelper) {
export function OsdEnhancedAggTable(config, RecursionHelper) {
const fieldFormats = getFormatService();
const numberFormatter = fieldFormats.getDefaultInstance('number').getConverterFor('text');

Expand Down
24 changes: 12 additions & 12 deletions public/agg_table/agg_table_group.html
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<table ng-if="rows" class="table kbnAggTable__group" ng-repeat="table in rows">
<table ng-if="rows" class="table osdAggTable__group" ng-repeat="table in rows">
<thead>
<tr>
<th ng-if="table.tables" scope="col">
<span class="kbnAggTable__groupHeader">{{ table.title }}</span>
<span class="osdAggTable__groupHeader">{{ table.title }}</span>
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<kbn-enhanced-agg-table-group
<osd-enhanced-agg-table-group
ng-if="table.tables"
group="table"
filter="filter"
Expand All @@ -21,8 +21,8 @@
csv-full-export="csvFullExport"
csv-encoding="csvEncoding"
field-columns="fieldColumns">
</kbn-enhanced-agg-table-group>
<kbn-enhanced-agg-table
</osd-enhanced-agg-table-group>
<osd-enhanced-agg-table
ng-if="table.rows"
filter="filter"
table="table"
Expand All @@ -35,24 +35,24 @@
csv-full-export="csvFullExport"
csv-encoding="csvEncoding"
field-columns="fieldColumns">
</kbn-enhanced-agg-table>
</osd-enhanced-agg-table>
</td>
</tr>
</tbody>
</table>

<table ng-if="columns" class="table kbnAggTable__group">
<table ng-if="columns" class="table osdAggTable__group">
<thead>
<tr>
<th ng-repeat="table in columns" ng-if="table.tables" scope="col">
<span class="kbnAggTable__groupHeader">{{ table.title }}</span>
<span class="osdAggTable__groupHeader">{{ table.title }}</span>
</th>
</tr>
</thead>
<tbody>
<tr>
<td ng-repeat="table in columns">
<kbn-enhanced-agg-table-group
<osd-enhanced-agg-table-group
ng-if="table.tables"
filter="filter"
group="table"
Expand All @@ -64,8 +64,8 @@
csv-full-export="csvFullExport"
csv-encoding="csvEncoding"
field-columns="fieldColumns">
</kbn-enhanced-agg-table-group>
<kbn-enhanced-agg-table
</osd-enhanced-agg-table-group>
<osd-enhanced-agg-table
ng-if="table.rows"
filter="filter"
table="table"
Expand All @@ -78,7 +78,7 @@
csv-full-export="csvFullExport"
csv-encoding="csvEncoding"
field-columns="fieldColumns">
</kbn-enhanced-agg-table>
</osd-enhanced-agg-table>
</td>
</tr>
</tbody>
Expand Down
2 changes: 1 addition & 1 deletion public/agg_table/agg_table_group.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

import aggTableGroupTemplate from './agg_table_group.html';

export function KbnEnhancedAggTableGroup(RecursionHelper) {
export function OsdEnhancedAggTableGroup(RecursionHelper) {
return {
restrict: 'E',
template: aggTableGroupTemplate,
Expand Down
4 changes: 2 additions & 2 deletions public/components/computed_column.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@

import { clone } from 'lodash';
import React, { useEffect } from 'react';
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n/react';
import { i18n } from '@osd/i18n';
import { FormattedMessage } from '@osd/i18n/react';
import { EuiDraggable, EuiIconTip, EuiSpacer, EuiAccordion, EuiToolTip, EuiButtonIcon, EuiButtonIconProps } from '@elastic/eui';

import { NumberInputOption, SelectOption } from '../../../../src/plugins/charts/public';
Expand Down
4 changes: 2 additions & 2 deletions public/components/document_table_vis_data.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
*/

import React, { useEffect } from 'react';
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n/react';
import { i18n } from '@osd/i18n';
import { FormattedMessage } from '@osd/i18n/react';
import { EuiButtonEmpty, EuiDragDropContext, euiDragDropReorder, EuiDroppable, EuiFlexGroup, EuiFlexItem, EuiFormErrorText, EuiPanel, EuiSpacer, EuiTitle } from '@elastic/eui';

import { VisOptionsProps } from '../../../../src/plugins/vis_default_editor/public';
Expand Down
4 changes: 2 additions & 2 deletions public/components/enhanced_table_vis_options.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@

import { some } from 'lodash';
import React, { useEffect } from 'react';
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n/react';
import { i18n } from '@osd/i18n';
import { FormattedMessage } from '@osd/i18n/react';
import { EuiButtonEmpty, EuiDragDropContext, euiDragDropReorder, EuiDroppable, EuiFlexGroup, EuiFlexItem, EuiFormErrorText, EuiIconTip, EuiPanel, EuiSpacer, EuiTitle } from '@elastic/eui';

import { IAggConfigs } from '../../../../src/plugins/data/public';
Expand Down
2 changes: 1 addition & 1 deletion public/components/field.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { get } from 'lodash';
import React, { useEffect, useState, useCallback } from 'react';

import { EuiComboBox, EuiComboBoxOptionOption, EuiFormRow } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { i18n } from '@osd/i18n';

import { IndexPatternField } from '../../../../src/plugins/data/public';
import { ComboBoxGroupedOptions } from '../../../../src/plugins/vis_default_editor/public/utils';
Expand Down
2 changes: 1 addition & 1 deletion public/components/field_column.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

import { clone } from 'lodash';
import React, { useEffect } from 'react';
import { i18n } from '@kbn/i18n';
import { i18n } from '@osd/i18n';
import { IndexPatternField } from '../../../../src/plugins/data/public';
import { EuiDraggable, EuiIconTip, EuiSpacer, EuiAccordion, EuiToolTip, EuiButtonIcon, EuiButtonIconProps } from '@elastic/eui';

Expand Down
2 changes: 1 addition & 1 deletion public/components/utils.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';

export enum AggTypes {
SUM = 'sum',
Expand Down
2 changes: 1 addition & 1 deletion public/data_load/agg_config_result.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import { fieldFormatter } from '../field_formatter';

function computeBasePath(pathname) {
const endIndex = pathname ? pathname.indexOf('/app/kibana') : -1;
const endIndex = pathname ? pathname.indexOf('/app/opensearch-dashboards') : -1;
const basePath = endIndex !== -1 ? pathname.substring(0, endIndex) : '';
return basePath;
}
Expand Down
2 changes: 1 addition & 1 deletion public/data_load/document-table-response-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

import { get } from 'lodash';
import { serializeAggConfig } from './kibana_cloned_code/utils';
import { serializeAggConfig } from './opensearch_dashboards_cloned_code/utils';
import AggConfigResult from './agg_config_result';

function createColumn(fieldColumn, index, aggConfigs) {
Expand Down
4 changes: 2 additions & 2 deletions public/data_load/enhanced-table-request-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
import _ from 'lodash';
import { RequestAdapter, DataAdapter } from '../../../../src/plugins/inspector/public';
import { getSearchService, getQueryService } from '../services';
import { handleCourierRequest } from './kibana_cloned_code/courier';
import { serializeAggConfig } from './kibana_cloned_code/utils';
import { handleCourierRequest } from './opensearch_dashboards_cloned_code/courier';
import { serializeAggConfig } from './opensearch_dashboards_cloned_code/utils';

export async function enhancedTableRequestHandler ({
partialRows,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { hasIn } from 'lodash';
import { i18n } from '@kbn/i18n';
import { i18n } from '@osd/i18n';

import { calculateObjectHash } from '../../../../../src/plugins/kibana_utils/public';
import { calculateObjectHash } from '../../../../../src/plugins/opensearch_dashboards_utils/public';
import { PersistedState } from '../../../../../src/plugins/visualizations/public';
import { Adapters } from '../../../../../src/plugins/inspector/public';

Expand Down
2 changes: 1 addition & 1 deletion public/document-table-vis.js
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 tableVisTemplate from './enhanced-table-vis.html';
import { getEnhancedTableVisualizationController } from './vis_controller';
Expand Down
4 changes: 2 additions & 2 deletions public/enhanced-table-vis.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
</div>

<div ng-if="hasSomeRows" class="table-vis-container" ng-class="tableVisContainerClass" data-test-subj="tableVis">
<kbn-enhanced-agg-table-group
<osd-enhanced-agg-table-group
filter="vis.API.events.filter"
group="tableGroups"
export-title="visState.title"
Expand All @@ -46,6 +46,6 @@
csv-encoding="visState.params.csvEncoding || 'utf-8'"
field-columns="visState.params.fieldColumns">

</kbn-enhanced-agg-table-group>
</osd-enhanced-agg-table-group>
</div>
</div>
2 changes: 1 addition & 1 deletion public/enhanced-table-vis.js
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 { AggGroupNames } from '../../../src/plugins/data/public';
import { Schemas } from '../../../src/plugins/vis_default_editor/public';

Expand Down
4 changes: 2 additions & 2 deletions public/enhanced-table-vis.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
padding: 0px 5px;
}

kbn-enhanced-agg-table-group > .table > tbody > tr > td {
osd-enhanced-agg-table-group > .table > tbody > tr > td {
border-top: 0px;
}

paginate-controls {
padding: 0px 5px;
}

kbn-enhanced-agg-table-group .table {
osd-enhanced-agg-table-group .table {
margin-bottom: 0px;
}

Expand Down
12 changes: 6 additions & 6 deletions public/get_inner_angular.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@ import angular from 'angular';
// required for `ngSanitize` angular module
import 'angular-sanitize';
import 'angular-recursion';
import { i18nDirective, i18nFilter, I18nProvider } from '@kbn/i18n/angular';
import { CoreStart, IUiSettingsClient, PluginInitializerContext } from 'kibana/public';
import { i18nDirective, i18nFilter, I18nProvider } from '@osd/i18n/angular';
import { CoreStart, IUiSettingsClient, PluginInitializerContext } from 'opensearch-dashboards/public';
import {
initAngularBootstrap,
PaginateDirectiveProvider,
PaginateControlsDirectiveProvider,
PrivateProvider,
watchMultiDecorator,
KbnAccessibleClickProvider,
} from '../../../src/plugins/kibana_legacy/public';
OsdAccessibleClickProvider,
} from '../../../src/plugins/opensearch_dashboards_legacy/public';

initAngularBootstrap();

Expand All @@ -46,7 +46,7 @@ export function getAngularModule(name: string, core: CoreStart, context: PluginI

let initialized = false;

export function getInnerAngular(name = 'kibana/enhanced_table_vis', core: CoreStart) {
export function getInnerAngular(name = 'opensearch_dashboards/enhanced_table_vis', core: CoreStart) {
if (!initialized) {
createLocalPrivateModule();
createLocalI18nModule();
Expand All @@ -63,7 +63,7 @@ export function getInnerAngular(name = 'kibana/enhanced_table_vis', core: CoreSt
'tableVisI18n',
])
.config(watchMultiDecorator)
.directive('kbnAccessibleClick', KbnAccessibleClickProvider);
.directive('osdAccessibleClick', OsdAccessibleClickProvider);
}

function createLocalPrivateModule() {
Expand Down
2 changes: 1 addition & 1 deletion public/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/
import './index.scss';
import { PluginInitializerContext } from 'kibana/public';
import { PluginInitializerContext } from 'opensearch-dashboards/public';
import { EnhancedTablePlugin as Plugin } from './plugin';

export function plugin(initializerContext: PluginInitializerContext) {
Expand Down
Loading

0 comments on commit 2c1f74c

Please sign in to comment.