diff options
author | Hector Dearman <hjd@google.com> | 2023-02-27 13:26:39 +0000 |
---|---|---|
committer | Hector Dearman <hjd@google.com> | 2023-02-27 13:27:10 +0000 |
commit | 7263acc9de5c88899d88f5a23a4624996de8e821 (patch) | |
tree | 55785014af434bf12a543517f6af488cfcd62f37 | |
parent | fa6793891b1ef1b154ee75318e8fbb387cb5e862 (diff) | |
download | perfetto-7263acc9de5c88899d88f5a23a4624996de8e821.tar.gz |
ui: Remove redux from pivot table code
Previously there were two versions of the pivot table in the code base.
The original one (pivot_table) and the new one (pivot_table_redux).
For a while now only the new one (pivot_table_redux) has existed.
The `redux` in the name now isn't needed and is a source of potential
confusion and overly long names, remove it renaming everything to do
with the pivot table simply 'pivot_table'.
Pure noop rename.
Change-Id: I44076dc1eb53365eee82036d35034a627f8ea477
-rw-r--r-- | ui/src/assets/common.scss | 2 | ||||
-rw-r--r-- | ui/src/common/actions.ts | 53 | ||||
-rw-r--r-- | ui/src/common/empty_state.ts | 4 | ||||
-rw-r--r-- | ui/src/common/state.ts | 22 | ||||
-rw-r--r-- | ui/src/controller/pivot_table_controller.ts (renamed from ui/src/controller/pivot_table_redux_controller.ts) | 36 | ||||
-rw-r--r-- | ui/src/controller/pivot_table_tree_builder_unittest.ts | 2 | ||||
-rw-r--r-- | ui/src/controller/trace_controller.ts | 6 | ||||
-rw-r--r-- | ui/src/frontend/details_panel.ts | 12 | ||||
-rw-r--r-- | ui/src/frontend/pivot_table.ts (renamed from ui/src/frontend/pivot_table_redux.ts) | 65 | ||||
-rw-r--r-- | ui/src/frontend/pivot_table_argument_popup.ts (renamed from ui/src/frontend/pivot_table_redux_argument_popup.ts) | 0 | ||||
-rw-r--r-- | ui/src/frontend/pivot_table_query_generator.ts (renamed from ui/src/frontend/pivot_table_redux_query_generator.ts) | 11 | ||||
-rw-r--r-- | ui/src/frontend/pivot_table_types.ts (renamed from ui/src/frontend/pivot_table_redux_types.ts) | 0 |
12 files changed, 103 insertions, 110 deletions
diff --git a/ui/src/assets/common.scss b/ui/src/assets/common.scss index 547064390..ccf477610 100644 --- a/ui/src/assets/common.scss +++ b/ui/src/assets/common.scss @@ -792,7 +792,7 @@ button.query-ctrl { user-select: none; } -.pivot-table-redux { +.pivot-table { user-select: text; padding: 10px; diff --git a/ui/src/common/actions.ts b/ui/src/common/actions.ts index 2909c734b..38e9d449b 100644 --- a/ui/src/common/actions.ts +++ b/ui/src/common/actions.ts @@ -23,7 +23,7 @@ import { TableColumn, tableColumnEquals, toggleEnabled, -} from '../frontend/pivot_table_redux_types'; +} from '../frontend/pivot_table_types'; import {randomColor} from './colorizer'; import { @@ -44,7 +44,7 @@ import { LogsPagination, NewEngineMode, OmniboxState, - PivotTableReduxResult, + PivotTableResult, PrimaryTrackSortKey, ProfileType, RecordingTarget, @@ -1031,25 +1031,23 @@ export const StateActions = { } }, - togglePivotTableRedux(state: StateDraft, args: {areaId: string|null}) { - state.nonSerializableState.pivotTableRedux.selectionArea = - args.areaId === null ? + togglePivotTable(state: StateDraft, args: {areaId: string|null}) { + state.nonSerializableState.pivotTable.selectionArea = args.areaId === null ? undefined : {areaId: args.areaId, tracks: globals.state.areas[args.areaId].tracks}; if (args.areaId !== - state.nonSerializableState.pivotTableRedux.selectionArea?.areaId) { - state.nonSerializableState.pivotTableRedux.queryResult = null; + state.nonSerializableState.pivotTable.selectionArea?.areaId) { + state.nonSerializableState.pivotTable.queryResult = null; } }, setPivotStateQueryResult( - state: StateDraft, args: {queryResult: PivotTableReduxResult|null}) { - state.nonSerializableState.pivotTableRedux.queryResult = args.queryResult; + state: StateDraft, args: {queryResult: PivotTableResult|null}) { + state.nonSerializableState.pivotTable.queryResult = args.queryResult; }, - setPivotTableReduxConstrainToArea( - state: StateDraft, args: {constrain: boolean}) { - state.nonSerializableState.pivotTableRedux.constrainToArea = args.constrain; + setPivotTableConstrainToArea(state: StateDraft, args: {constrain: boolean}) { + state.nonSerializableState.pivotTable.constrainToArea = args.constrain; }, dismissFlamegraphModal(state: StateDraft, _: {}) { @@ -1058,41 +1056,40 @@ export const StateActions = { addPivotTableAggregation( state: StateDraft, args: {aggregation: Aggregation, after: number}) { - state.nonSerializableState.pivotTableRedux.selectedAggregations.splice( + state.nonSerializableState.pivotTable.selectedAggregations.splice( args.after, 0, args.aggregation); }, removePivotTableAggregation(state: StateDraft, args: {index: number}) { - state.nonSerializableState.pivotTableRedux.selectedAggregations.splice( + state.nonSerializableState.pivotTable.selectedAggregations.splice( args.index, 1); }, setPivotTableQueryRequested( state: StateDraft, args: {queryRequested: boolean}) { - state.nonSerializableState.pivotTableRedux.queryRequested = - args.queryRequested; + state.nonSerializableState.pivotTable.queryRequested = args.queryRequested; }, setPivotTablePivotSelected( state: StateDraft, args: {column: TableColumn, selected: boolean}) { toggleEnabled( tableColumnEquals, - state.nonSerializableState.pivotTableRedux.selectedPivots, + state.nonSerializableState.pivotTable.selectedPivots, args.column, args.selected); }, setPivotTableAggregationFunction( state: StateDraft, args: {index: number, function: AggregationFunction}) { - state.nonSerializableState.pivotTableRedux.selectedAggregations[args.index] + state.nonSerializableState.pivotTable.selectedAggregations[args.index] .aggregationFunction = args.function; }, setPivotTableSortColumn( state: StateDraft, args: {aggregationIndex: number, order: SortDirection}) { - state.nonSerializableState.pivotTableRedux.selectedAggregations = - state.nonSerializableState.pivotTableRedux.selectedAggregations.map( + state.nonSerializableState.pivotTable.selectedAggregations = + state.nonSerializableState.pivotTable.selectedAggregations.map( (agg, index) => ({ column: agg.column, aggregationFunction: agg.aggregationFunction, @@ -1114,26 +1111,24 @@ export const StateActions = { setPivotTableArgumentNames( state: StateDraft, args: {argumentNames: string[]}) { - state.nonSerializableState.pivotTableRedux.argumentNames = - args.argumentNames; + state.nonSerializableState.pivotTable.argumentNames = args.argumentNames; }, changePivotTablePivotOrder( state: StateDraft, args: {from: number, to: number, direction: DropDirection}) { - const pivots = state.nonSerializableState.pivotTableRedux.selectedPivots; - state.nonSerializableState.pivotTableRedux.selectedPivots = - performReordering( - computeIntervals(pivots.length, args.from, args.to, args.direction), - pivots); + const pivots = state.nonSerializableState.pivotTable.selectedPivots; + state.nonSerializableState.pivotTable.selectedPivots = performReordering( + computeIntervals(pivots.length, args.from, args.to, args.direction), + pivots); }, changePivotTableAggregationOrder( state: StateDraft, args: {from: number, to: number, direction: DropDirection}) { const aggregations = - state.nonSerializableState.pivotTableRedux.selectedAggregations; - state.nonSerializableState.pivotTableRedux.selectedAggregations = + state.nonSerializableState.pivotTable.selectedAggregations; + state.nonSerializableState.pivotTable.selectedAggregations = performReordering( computeIntervals( aggregations.length, args.from, args.to, args.direction), diff --git a/ui/src/common/empty_state.ts b/ui/src/common/empty_state.ts index 72b7f8b0d..4267be2b1 100644 --- a/ui/src/common/empty_state.ts +++ b/ui/src/common/empty_state.ts @@ -15,7 +15,7 @@ import {createEmptyRecordConfig} from '../controller/record_config_types'; import { Aggregation, -} from '../frontend/pivot_table_redux_types'; +} from '../frontend/pivot_table_types'; import { autosaveConfigStore, recordTargetStore, @@ -57,7 +57,7 @@ export const COUNT_AGGREGATION: Aggregation = { export function createEmptyNonSerializableState(): NonSerializableState { return { - pivotTableRedux: { + pivotTable: { queryResult: null, selectedPivots: [{kind: 'regular', table: 'slice', column: 'name'}], selectedAggregations: [ diff --git a/ui/src/common/state.ts b/ui/src/common/state.ts index b3b9aba7b..3b978b9a3 100644 --- a/ui/src/common/state.ts +++ b/ui/src/common/state.ts @@ -18,7 +18,7 @@ import { PivotTree, RegularColumn, TableColumn, -} from '../frontend/pivot_table_redux_types'; +} from '../frontend/pivot_table_types'; /** * A plain js object, holding objects of type |Class| keyed by string id. @@ -403,41 +403,41 @@ export interface MetricsState { // Auxiliary metadata needed to parse the query result, as well as to render it // correctly. Generated together with the text of query and passed without the // change to the query response. -export interface PivotTableReduxQueryMetadata { +export interface PivotTableQueryMetadata { pivotColumns: TableColumn[]; aggregationColumns: Aggregation[]; countIndex: number; } // Everything that's necessary to run the query for pivot table -export interface PivotTableReduxQuery { +export interface PivotTableQuery { text: string; - metadata: PivotTableReduxQueryMetadata; + metadata: PivotTableQueryMetadata; } // Pivot table query result -export interface PivotTableReduxResult { +export interface PivotTableResult { // Hierarchical pivot structure on top of rows tree: PivotTree; // Copy of the query metadata from the request, bundled up with the query // result to ensure the correct rendering. - metadata: PivotTableReduxQueryMetadata; + metadata: PivotTableQueryMetadata; } // Input parameters to check whether the pivot table needs to be re-queried. -export interface PivotTableReduxAreaState { +export interface PivotTableAreaState { areaId: string; tracks: string[]; } export type SortDirection = 'DESC'|'ASC'; -export interface PivotTableReduxState { +export interface PivotTableState { // Currently selected area, if null, pivot table is not going to be visible. - selectionArea?: PivotTableReduxAreaState; + selectionArea?: PivotTableAreaState; // Query response - queryResult: PivotTableReduxResult|null; + queryResult: PivotTableResult|null; // Selected pivots for tables other than slice. // Because of the query generation, pivoting happens first on non-slice @@ -477,7 +477,7 @@ export type LoadedConfig = LoadedConfigNone|LoadedConfigAutomatic|LoadedConfigNamed; export interface NonSerializableState { - pivotTableRedux: PivotTableReduxState; + pivotTable: PivotTableState; } export interface LogFilteringCriteria { diff --git a/ui/src/controller/pivot_table_redux_controller.ts b/ui/src/controller/pivot_table_controller.ts index 6329e8104..cc33e3e4e 100644 --- a/ui/src/controller/pivot_table_redux_controller.ts +++ b/ui/src/controller/pivot_table_controller.ts @@ -21,22 +21,22 @@ import {featureFlags} from '../common/feature_flags'; import {ColumnType, STR} from '../common/query_result'; import { AreaSelection, - PivotTableReduxQuery, - PivotTableReduxQueryMetadata, - PivotTableReduxResult, - PivotTableReduxState, + PivotTableQuery, + PivotTableQueryMetadata, + PivotTableResult, + PivotTableState, } from '../common/state'; import {globals} from '../frontend/globals'; import { aggregationIndex, generateQueryFromState, -} from '../frontend/pivot_table_redux_query_generator'; -import {Aggregation, PivotTree} from '../frontend/pivot_table_redux_types'; +} from '../frontend/pivot_table_query_generator'; +import {Aggregation, PivotTree} from '../frontend/pivot_table_types'; import {Controller} from './controller'; export const PIVOT_TABLE_REDUX_FLAG = featureFlags.register({ - id: 'pivotTableRedux', + id: 'pivotTable', name: 'Pivot tables V2', description: 'Second version of pivot table', // Enabled in canary and autopush by default. @@ -53,7 +53,7 @@ function expectNumber(value: ColumnType): number { // Auxiliary class to build the tree from query response. export class PivotTableTreeBuilder { private readonly root: PivotTree; - queryMetadata: PivotTableReduxQueryMetadata; + queryMetadata: PivotTableQueryMetadata; get pivotColumnsCount(): number { return this.queryMetadata.pivotColumns.length; @@ -63,8 +63,7 @@ export class PivotTableTreeBuilder { return this.queryMetadata.aggregationColumns; } - constructor( - queryMetadata: PivotTableReduxQueryMetadata, firstRow: ColumnType[]) { + constructor(queryMetadata: PivotTableQueryMetadata, firstRow: ColumnType[]) { this.queryMetadata = queryMetadata; this.root = this.createNode(firstRow); let tree = this.root; @@ -163,8 +162,8 @@ export class PivotTableTreeBuilder { } } -function createEmptyQueryResult(metadata: PivotTableReduxQueryMetadata): - PivotTableReduxResult { +function createEmptyQueryResult(metadata: PivotTableQueryMetadata): + PivotTableResult { return { tree: { aggregates: [], @@ -178,7 +177,7 @@ function createEmptyQueryResult(metadata: PivotTableReduxQueryMetadata): // Controller responsible for showing the panel with pivot table, as well as // executing its queries and post-processing query results. -export class PivotTableReduxController extends Controller<{}> { +export class PivotTableController extends Controller<{}> { static detailsCount = 0; engine: Engine; lastQueryAreaId = ''; @@ -205,7 +204,7 @@ export class PivotTableReduxController extends Controller<{}> { return true; } - shouldRerun(state: PivotTableReduxState, selection: AreaSelection) { + shouldRerun(state: PivotTableState, selection: AreaSelection) { if (state.selectionArea === undefined) { return false; } @@ -220,7 +219,7 @@ export class PivotTableReduxController extends Controller<{}> { return false; } - async processQuery(query: PivotTableReduxQuery) { + async processQuery(query: PivotTableQuery) { const result = await this.engine.query(query.text); try { await result.waitAllRows(); @@ -256,7 +255,7 @@ export class PivotTableReduxController extends Controller<{}> { globals.dispatch(Actions.setPivotStateQueryResult( {queryResult: {tree: treeBuilder.build(), metadata: query.metadata}})); - globals.dispatch(Actions.setCurrentTab({tab: 'pivot_table_redux'})); + globals.dispatch(Actions.setCurrentTab({tab: 'pivot_table'})); } async requestArgumentNames() { @@ -285,7 +284,7 @@ export class PivotTableReduxController extends Controller<{}> { this.requestArgumentNames(); } - const pivotTableState = globals.state.nonSerializableState.pivotTableRedux; + const pivotTableState = globals.state.nonSerializableState.pivotTable; const selection = globals.state.currentSelection; if (pivotTableState.queryRequested || @@ -301,8 +300,7 @@ export class PivotTableReduxController extends Controller<{}> { if (selection !== null && selection.kind === 'AREA' && (pivotTableState.selectionArea === undefined || pivotTableState.selectionArea.areaId !== selection.areaId)) { - globals.dispatch( - Actions.togglePivotTableRedux({areaId: selection.areaId})); + globals.dispatch(Actions.togglePivotTable({areaId: selection.areaId})); } } } diff --git a/ui/src/controller/pivot_table_tree_builder_unittest.ts b/ui/src/controller/pivot_table_tree_builder_unittest.ts index b2e5c7e94..5ab93f954 100644 --- a/ui/src/controller/pivot_table_tree_builder_unittest.ts +++ b/ui/src/controller/pivot_table_tree_builder_unittest.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import {PivotTableTreeBuilder} from './pivot_table_redux_controller'; +import {PivotTableTreeBuilder} from './pivot_table_controller'; describe('Pivot Table tree builder', () => { test('aggregates averages correctly', () => { diff --git a/ui/src/controller/trace_controller.ts b/ui/src/controller/trace_controller.ts index 0e42c8f64..7fd41ed61 100644 --- a/ui/src/controller/trace_controller.ts +++ b/ui/src/controller/trace_controller.ts @@ -82,8 +82,8 @@ import {LogsController} from './logs_controller'; import {MetricsController} from './metrics_controller'; import { PIVOT_TABLE_REDUX_FLAG, - PivotTableReduxController, -} from './pivot_table_redux_controller'; + PivotTableController, +} from './pivot_table_controller'; import {QueryController, QueryControllerArgs} from './query_controller'; import {SearchController} from './search_controller'; import { @@ -311,7 +311,7 @@ export class TraceController extends Controller<States> { app: globals, })); childControllers.push( - Child('pivot_table_redux', PivotTableReduxController, {engine})); + Child('pivot_table', PivotTableController, {engine})); childControllers.push(Child('logs', LogsController, { engine, diff --git a/ui/src/frontend/details_panel.ts b/ui/src/frontend/details_panel.ts index d195b7e91..2c73385be 100644 --- a/ui/src/frontend/details_panel.ts +++ b/ui/src/frontend/details_panel.ts @@ -36,7 +36,7 @@ import {globals} from './globals'; import {LogPanel} from './logs_panel'; import {NotesEditorTab} from './notes_panel'; import {AnyAttrsVnode, PanelContainer} from './panel_container'; -import {PivotTableRedux} from './pivot_table_redux'; +import {PivotTable} from './pivot_table'; import {QueryTable} from './query_table'; import {SliceDetailsPanel} from './slice_details_panel'; import {ThreadStateTab} from './thread_state_tab'; @@ -355,15 +355,15 @@ export class DetailsPanel implements m.ClassComponent { } - if (globals.state.nonSerializableState.pivotTableRedux.selectionArea !== + if (globals.state.nonSerializableState.pivotTable.selectionArea !== undefined) { detailsPanels.push({ - key: 'pivot_table_redux', + key: 'pivot_table', name: 'Pivot Table', - vnode: m(PivotTableRedux, { - key: 'pivot_table_redux', + vnode: m(PivotTable, { + key: 'pivot_table', selectionArea: - globals.state.nonSerializableState.pivotTableRedux.selectionArea, + globals.state.nonSerializableState.pivotTable.selectionArea, }), }); } diff --git a/ui/src/frontend/pivot_table_redux.ts b/ui/src/frontend/pivot_table.ts index 20f1b48f1..a408b22aa 100644 --- a/ui/src/frontend/pivot_table_redux.ts +++ b/ui/src/frontend/pivot_table.ts @@ -23,34 +23,34 @@ import {COUNT_AGGREGATION} from '../common/empty_state'; import {ColumnType} from '../common/query_result'; import { Area, - PivotTableReduxAreaState, - PivotTableReduxResult, + PivotTableAreaState, + PivotTableResult, SortDirection, } from '../common/state'; import {fromNs, timeToCode} from '../common/time'; import { - PivotTableReduxController, -} from '../controller/pivot_table_redux_controller'; + PivotTableController, +} from '../controller/pivot_table_controller'; import {globals} from './globals'; import {fullscreenModalContainer, ModalDefinition} from './modal'; import {Panel} from './panel'; import {AnyAttrsVnode} from './panel_container'; -import {ArgumentPopup} from './pivot_table_redux_argument_popup'; +import {ArgumentPopup} from './pivot_table_argument_popup'; import { aggregationIndex, areaFilter, extractArgumentExpression, sliceAggregationColumns, tables, -} from './pivot_table_redux_query_generator'; +} from './pivot_table_query_generator'; import { Aggregation, AggregationFunction, columnKey, PivotTree, TableColumn, -} from './pivot_table_redux_types'; +} from './pivot_table_types'; import {PopupMenuButton, PopupMenuItem} from './popup_menu'; import {ReorderableCell, ReorderableCellGroup} from './reorderable_cells'; @@ -60,8 +60,8 @@ interface PathItem { nextKey: ColumnType; } -interface PivotTableReduxAttrs { - selectionArea: PivotTableReduxAreaState; +interface PivotTableAttrs { + selectionArea: PivotTableAreaState; } interface DrillFilter { @@ -107,12 +107,12 @@ export function markFirst(index: number) { return ''; } -export class PivotTableRedux extends Panel<PivotTableReduxAttrs> { +export class PivotTable extends Panel<PivotTableAttrs> { get pivotState() { - return globals.state.nonSerializableState.pivotTableRedux; + return globals.state.nonSerializableState.pivotTable; } get constrainToArea() { - return globals.state.nonSerializableState.pivotTableRedux.constrainToArea; + return globals.state.nonSerializableState.pivotTable.constrainToArea; } renderCanvas(): void {} @@ -139,7 +139,7 @@ export class PivotTableRedux extends Panel<PivotTableReduxAttrs> { // custom query is a temporary one, replace with a proper UI. globals.dispatch(Actions.executeQuery({ queryId: `pivot_table_details_${ - PivotTableReduxController.detailsCount++}`, + PivotTableController.detailsCount++}`, query, })); }, @@ -149,7 +149,7 @@ export class PivotTableRedux extends Panel<PivotTableReduxAttrs> { renderSectionRow( area: Area, path: PathItem[], tree: PivotTree, - result: PivotTableReduxResult): m.Vnode { + result: PivotTableResult): m.Vnode { const renderedCells = []; for (let j = 0; j + 1 < path.length; j++) { renderedCells.push(m('td', m('span.indent', ' '), `${path[j].nextKey}`)); @@ -200,8 +200,8 @@ export class PivotTableRedux extends Panel<PivotTableReduxAttrs> { } renderTree( - area: Area, path: PathItem[], tree: PivotTree, - result: PivotTableReduxResult, sink: m.Vnode[]) { + area: Area, path: PathItem[], tree: PivotTree, result: PivotTableResult, + sink: m.Vnode[]) { if (tree.isCollapsed) { sink.push(this.renderSectionRow(area, path, tree, result)); return; @@ -251,7 +251,7 @@ export class PivotTableRedux extends Panel<PivotTableReduxAttrs> { } } - renderTotalsRow(queryResult: PivotTableReduxResult) { + renderTotalsRow(queryResult: PivotTableResult) { const overallValuesRow = [m('td.total-values', {'colspan': queryResult.metadata.pivotColumns.length}, @@ -328,7 +328,7 @@ export class PivotTableRedux extends Panel<PivotTableReduxAttrs> { aggregation: Aggregation, index: number, removeItem: boolean): ReorderableCell { const popupItems: PopupMenuItem[] = []; - const state = globals.state.nonSerializableState.pivotTableRedux; + const state = globals.state.nonSerializableState.pivotTable; let icon = 'more_horiz'; if (aggregation.sortDirection === undefined) { popupItems.push( @@ -409,13 +409,14 @@ export class PivotTableRedux extends Panel<PivotTableReduxAttrs> { renderModal(): ModalDefinition { return { title: 'Enter argument name', - content: m(ArgumentPopup, { - knownArguments: globals.state.nonSerializableState - .pivotTableRedux.argumentNames, - onArgumentChange: (arg) => { - this.typedArgument = arg; - }, - }) as AnyAttrsVnode, + content: + m(ArgumentPopup, { + knownArguments: + globals.state.nonSerializableState.pivotTable.argumentNames, + onArgumentChange: (arg) => { + this.typedArgument = arg; + }, + }) as AnyAttrsVnode, buttons: [ { text: 'Add', @@ -433,7 +434,7 @@ export class PivotTableRedux extends Panel<PivotTableReduxAttrs> { } renderPivotColumnHeader( - queryResult: PivotTableReduxResult, pivot: TableColumn, + queryResult: PivotTableResult, pivot: TableColumn, selectedPivots: Set<string>): ReorderableCell { const items: PopupMenuItem[] = [{ itemType: 'regular', @@ -496,12 +497,12 @@ export class PivotTableRedux extends Panel<PivotTableReduxAttrs> { }; } - renderResultsTable(attrs: PivotTableReduxAttrs) { - const state = globals.state.nonSerializableState.pivotTableRedux; + renderResultsTable(attrs: PivotTableAttrs) { + const state = globals.state.nonSerializableState.pivotTable; if (state.queryResult === null) { return m('div', 'Loading...'); } - const queryResult: PivotTableReduxResult = state.queryResult; + const queryResult: PivotTableResult = state.queryResult; const renderedRows: m.Vnode[] = []; const tree = state.queryResult.tree; @@ -566,7 +567,7 @@ export class PivotTableRedux extends Panel<PivotTableReduxAttrs> { 'Query data for the whole timeline' : 'Constrain to selected area', callback: () => { - globals.dispatch(Actions.setPivotTableReduxConstrainToArea( + globals.dispatch(Actions.setPivotTableConstrainToArea( {constrain: !state.constrainToArea})); globals.dispatch(Actions.setPivotTableQueryRequested( {queryRequested: true})); @@ -576,11 +577,11 @@ export class PivotTableRedux extends Panel<PivotTableReduxAttrs> { m('tbody', this.renderTotalsRow(state.queryResult), renderedRows)); } - view({attrs}: m.Vnode<PivotTableReduxAttrs>): m.Children { + view({attrs}: m.Vnode<PivotTableAttrs>): m.Children { if (this.showModal) { fullscreenModalContainer.updateVdom(this.renderModal()); } - return m('.pivot-table-redux', this.renderResultsTable(attrs)); + return m('.pivot-table', this.renderResultsTable(attrs)); } } diff --git a/ui/src/frontend/pivot_table_redux_argument_popup.ts b/ui/src/frontend/pivot_table_argument_popup.ts index b8b05f307..b8b05f307 100644 --- a/ui/src/frontend/pivot_table_redux_argument_popup.ts +++ b/ui/src/frontend/pivot_table_argument_popup.ts diff --git a/ui/src/frontend/pivot_table_redux_query_generator.ts b/ui/src/frontend/pivot_table_query_generator.ts index 8e819cb13..50df91984 100644 --- a/ui/src/frontend/pivot_table_redux_query_generator.ts +++ b/ui/src/frontend/pivot_table_query_generator.ts @@ -17,8 +17,8 @@ import {sqliteString} from '../base/string_utils'; import { Area, - PivotTableReduxQuery, - PivotTableReduxState, + PivotTableQuery, + PivotTableState, } from '../common/state'; import {toNs} from '../common/time'; import { @@ -29,7 +29,7 @@ import {globals} from './globals'; import { Aggregation, TableColumn, -} from './pivot_table_redux_types'; +} from './pivot_table_types'; export interface Table { name: string; @@ -132,9 +132,8 @@ export function aggregationIndex(pivotColumns: number, aggregationNo: number) { return pivotColumns + aggregationNo; } -export function generateQueryFromState( - state: PivotTableReduxState, - ): PivotTableReduxQuery { +export function generateQueryFromState(state: PivotTableState): + PivotTableQuery { if (state.selectionArea === undefined) { throw new QueryGeneratorError('Should not be called without area'); } diff --git a/ui/src/frontend/pivot_table_redux_types.ts b/ui/src/frontend/pivot_table_types.ts index 0e4913bb5..0e4913bb5 100644 --- a/ui/src/frontend/pivot_table_redux_types.ts +++ b/ui/src/frontend/pivot_table_types.ts |