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

Table visualization renderer #79455

Merged
merged 13 commits into from
Oct 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@ export interface IInterpreterRenderHandlers
| [event](./kibana-plugin-plugins-expressions-public.iinterpreterrenderhandlers.event.md) | <code>(event: any) =&gt; void</code> | |
| [onDestroy](./kibana-plugin-plugins-expressions-public.iinterpreterrenderhandlers.ondestroy.md) | <code>(fn: () =&gt; void) =&gt; void</code> | |
| [reload](./kibana-plugin-plugins-expressions-public.iinterpreterrenderhandlers.reload.md) | <code>() =&gt; void</code> | |
| [uiState](./kibana-plugin-plugins-expressions-public.iinterpreterrenderhandlers.uistate.md) | <code>PersistedState</code> | |
| [update](./kibana-plugin-plugins-expressions-public.iinterpreterrenderhandlers.update.md) | <code>(params: any) =&gt; void</code> | |

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-plugins-expressions-public](./kibana-plugin-plugins-expressions-public.md) &gt; [IInterpreterRenderHandlers](./kibana-plugin-plugins-expressions-public.iinterpreterrenderhandlers.md) &gt; [uiState](./kibana-plugin-plugins-expressions-public.iinterpreterrenderhandlers.uistate.md)

## IInterpreterRenderHandlers.uiState property

<b>Signature:</b>

```typescript
uiState?: PersistedState;
```
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@ export interface IInterpreterRenderHandlers
| [event](./kibana-plugin-plugins-expressions-server.iinterpreterrenderhandlers.event.md) | <code>(event: any) =&gt; void</code> | |
| [onDestroy](./kibana-plugin-plugins-expressions-server.iinterpreterrenderhandlers.ondestroy.md) | <code>(fn: () =&gt; void) =&gt; void</code> | |
| [reload](./kibana-plugin-plugins-expressions-server.iinterpreterrenderhandlers.reload.md) | <code>() =&gt; void</code> | |
| [uiState](./kibana-plugin-plugins-expressions-server.iinterpreterrenderhandlers.uistate.md) | <code>PersistedState</code> | |
| [update](./kibana-plugin-plugins-expressions-server.iinterpreterrenderhandlers.update.md) | <code>(params: any) =&gt; void</code> | |

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-plugins-expressions-server](./kibana-plugin-plugins-expressions-server.md) &gt; [IInterpreterRenderHandlers](./kibana-plugin-plugins-expressions-server.iinterpreterrenderhandlers.md) &gt; [uiState](./kibana-plugin-plugins-expressions-server.iinterpreterrenderhandlers.uistate.md)

## IInterpreterRenderHandlers.uiState property

<b>Signature:</b>

```typescript
uiState?: PersistedState;
```
3 changes: 3 additions & 0 deletions src/plugins/expressions/common/expression_renderers/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
* under the License.
*/

import { PersistedState } from 'src/plugins/visualizations/public';

export interface ExpressionRenderDefinition<Config = unknown> {
/**
* Technical name of the renderer, used as ID to identify renderer in
Expand Down Expand Up @@ -68,4 +70,5 @@ export interface IInterpreterRenderHandlers {
reload: () => void;
update: (params: any) => void;
event: (event: any) => void;
uiState?: PersistedState;
}
3 changes: 3 additions & 0 deletions src/plugins/expressions/public/public.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { EnvironmentMode } from '@kbn/config';
import { EventEmitter } from 'events';
import { Observable } from 'rxjs';
import { PackageInfo } from '@kbn/config';
import { PersistedState } from 'src/plugins/visualizations/public';
import { Plugin as Plugin_2 } from 'src/core/public';
import { PluginInitializerContext as PluginInitializerContext_2 } from 'src/core/public';
import React from 'react';
Expand Down Expand Up @@ -883,6 +884,8 @@ export interface IInterpreterRenderHandlers {
// (undocumented)
reload: () => void;
// (undocumented)
uiState?: PersistedState;
// (undocumented)
update: (params: any) => void;
}

Expand Down
3 changes: 3 additions & 0 deletions src/plugins/expressions/server/server.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { CoreStart } from 'src/core/server';
import { Ensure } from '@kbn/utility-types';
import { EventEmitter } from 'events';
import { Observable } from 'rxjs';
import { PersistedState } from 'src/plugins/visualizations/public';
import { Plugin as Plugin_2 } from 'src/core/server';
import { PluginInitializerContext } from 'src/core/server';
import { UnwrapPromiseOrReturn } from '@kbn/utility-types';
Expand Down Expand Up @@ -717,6 +718,8 @@ export interface IInterpreterRenderHandlers {
// (undocumented)
reload: () => void;
// (undocumented)
uiState?: PersistedState;
// (undocumented)
update: (params: any) => void;
}

Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion src/plugins/vis_type_table/public/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
import './index.scss';
import { PluginInitializerContext } from 'kibana/public';
import { TableVisPlugin as Plugin } from './plugin';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
.table-vis {
display: flex;
flex-direction: column;
flex: 1 0 100%;
flex: 1 1 0;
overflow: auto;

@include euiScrollBar;
}

.table-vis-container {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
* under the License.
*/
import _ from 'lodash';
import { CSV_SEPARATOR_SETTING, CSV_QUOTE_VALUES_SETTING } from '../../../share/public';
import { CSV_SEPARATOR_SETTING, CSV_QUOTE_VALUES_SETTING } from '../../../../share/public';
import aggTableTemplate from './agg_table.html';
import { getFormatService } from '../services';
import { getFormatService } from '../../services';
import { i18n } from '@kbn/i18n';

export function KbnAggTable(config, RecursionHelper) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ import 'angular-mocks';
import sinon from 'sinon';
import { round } from 'lodash';

import { getFieldFormatsRegistry } from '../../../data/public/test_utils';
import { coreMock } from '../../../../core/public/mocks';
import { initAngularBootstrap } from '../../../kibana_legacy/public';
import { setUiSettings } from '../../../data/public/services';
import { UI_SETTINGS } from '../../../data/public/';
import { CSV_SEPARATOR_SETTING, CSV_QUOTE_VALUES_SETTING } from '../../../share/public';

import { setFormatService } from '../services';
import { getFieldFormatsRegistry } from '../../../../data/public/test_utils';
import { coreMock } from '../../../../../core/public/mocks';
import { initAngularBootstrap } from '../../../../kibana_legacy/public';
import { setUiSettings } from '../../../../data/public/services';
import { UI_SETTINGS } from '../../../../data/public/';
import { CSV_SEPARATOR_SETTING, CSV_QUOTE_VALUES_SETTING } from '../../../../share/public';

import { setFormatService } from '../../services';
import { getInnerAngular } from '../get_inner_angular';
import { initTableVisLegacyModule } from '../table_vis_legacy_module';
import { tabifiedData } from './tabified_data';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ import angular from 'angular';
import 'angular-mocks';
import expect from '@kbn/expect';

import { getFieldFormatsRegistry } from '../../../data/public/test_utils';
import { coreMock } from '../../../../core/public/mocks';
import { initAngularBootstrap } from '../../../kibana_legacy/public';
import { setUiSettings } from '../../../data/public/services';
import { setFormatService } from '../services';
import { getFieldFormatsRegistry } from '../../../../data/public/test_utils';
import { coreMock } from '../../../../../core/public/mocks';
import { initAngularBootstrap } from '../../../../kibana_legacy/public';
import { setUiSettings } from '../../../../data/public/services';
import { setFormatService } from '../../services';
import { getInnerAngular } from '../get_inner_angular';
import { initTableVisLegacyModule } from '../table_vis_legacy_module';
import { tabifiedData } from './tabified_data';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import {
PrivateProvider,
watchMultiDecorator,
KbnAccessibleClickProvider,
} from '../../kibana_legacy/public';
} from '../../../kibana_legacy/public';

initAngularBootstrap();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,7 @@ import 'angular-mocks';

import { getAngularModule } from '../get_inner_angular';
import { initTableVisLegacyModule } from '../table_vis_legacy_module';
import { coreMock } from '../../../../core/public/mocks';

jest.mock('../../../kibana_legacy/public/angular/angular_config', () => ({
configureAppAngularModule: () => {},
}));
import { coreMock } from '../../../../../core/public/mocks';

interface Sort {
columnIndex: number;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,18 @@ export function KbnRows($compile) {
}

$scope.filter({
data: [
{
table: $scope.table,
row: $scope.rows.findIndex((r) => r === row),
column: $scope.table.columns.findIndex((c) => c.id === column.id),
value,
},
],
negate,
name: 'filterBucket',
data: {
data: [
{
table: $scope.table,
row: $scope.rows.findIndex((r) => r === row),
column: $scope.table.columns.findIndex((c) => c.id === column.id),
value,
},
],
negate,
},
});
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

<div ng-if="tableGroups" class="table-vis-container" data-test-subj="tableVis">
<kbn-agg-table-group
filter="vis.API.events.filter"
filter="filter"
dimensions="dimensions"
group="tableGroups"
export-title="visState.title"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,24 +24,19 @@ import $ from 'jquery';

import { getAngularModule } from './get_inner_angular';
import { initTableVisLegacyModule } from './table_vis_legacy_module';
import { getTableVisTypeDefinition } from './table_vis_type';
import { Vis } from '../../visualizations/public';
import { stubFields } from '../../data/public/stubs';
import { tableVisResponseHandler } from './table_vis_response_handler';
import { coreMock } from '../../../core/public/mocks';
import { IAggConfig, search } from '../../data/public';
import { getStubIndexPattern } from '../../data/public/test_utils';
// TODO: remove linting disable
import { searchServiceMock } from '../../data/public/search/mocks';
import { tableVisTypeDefinition } from '../table_vis_type';
import { Vis } from '../../../visualizations/public';
import { stubFields } from '../../../data/public/stubs';
import { tableVisResponseHandler } from '../table_vis_response_handler';
import { coreMock } from '../../../../core/public/mocks';
import { IAggConfig, search } from '../../../data/public';
import { getStubIndexPattern } from '../../../data/public/test_utils';
import { searchServiceMock } from '../../../data/public/search/mocks';

const { createAggConfigs } = searchServiceMock.createStartContract().aggs;

const { tabifyAggResponse } = search;

jest.mock('../../kibana_legacy/public/angular/angular_config', () => ({
configureAppAngularModule: () => {},
}));

interface TableVisScope extends IScope {
[key: string]: any;
}
Expand Down Expand Up @@ -112,10 +107,6 @@ describe('Table Vis - Controller', () => {
coreMock.createSetup()
);
});
const tableVisTypeDefinition = getTableVisTypeDefinition(
coreMock.createSetup(),
coreMock.createPluginInitializerContext()
);

function getRangeVis(params?: object) {
return ({
Expand Down
Loading