Skip to content

Commit

Permalink
CB-5368 naming
Browse files Browse the repository at this point in the history
  • Loading branch information
devnaumov committed Oct 23, 2024
1 parent 645fe9c commit 3ae20b1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {
DatabaseDataConstraintAction,
DataViewerContextMenuService,
type IDatabaseDataModel,
type IDataGridCellMenuContext,
type IDataViewerContextMenu,
type IResultSetColumnKey,
IS_NOT_NULL_ID,
IS_NULL_ID,
Expand Down Expand Up @@ -82,11 +82,11 @@ export class DataGridContextMenuFilterService {
}

private getGeneralizedMenuItems(
context: IMenuContext<IDataGridCellMenuContext>,
context: IMenuContext<IDataViewerContextMenu>,
value: any | (() => any),
icon: string,
isHidden?: (context: IMenuContext<IDataGridCellMenuContext>) => boolean,
): Array<IContextMenuItem<IDataGridCellMenuContext>> {
isHidden?: (context: IMenuContext<IDataViewerContextMenu>) => boolean,
): Array<IContextMenuItem<IDataViewerContextMenu>> {
const { model, resultIndex, key } = context.data;
const source = model.source as unknown as ResultSetDataSource;
const data = source.getAction(resultIndex, ResultSetDataAction);
Expand Down Expand Up @@ -185,7 +185,7 @@ export class DataGridContextMenuFilterService {

return supportedOperations.length === 0;
},
panel: new ComputedContextMenuModel<IDataGridCellMenuContext>({
panel: new ComputedContextMenuModel<IDataViewerContextMenu>({
id: 'clipboardValuePanel',
menuItemsGetter: context => {
if (context.contextType !== DataViewerContextMenuService.cellContext) {
Expand Down Expand Up @@ -232,7 +232,7 @@ export class DataGridContextMenuFilterService {

return value === undefined || supportedOperations.length === 0 || format.isNull(key);
},
panel: new ComputedContextMenuModel<IDataGridCellMenuContext>({
panel: new ComputedContextMenuModel<IDataViewerContextMenu>({
id: 'cellValuePanel',
menuItemsGetter: context => {
const { model, resultIndex, key } = context.data;
Expand Down Expand Up @@ -261,7 +261,7 @@ export class DataGridContextMenuFilterService {

return cellValue === undefined || supportedOperations.length === 0;
},
panel: new ComputedContextMenuModel<IDataGridCellMenuContext>({
panel: new ComputedContextMenuModel<IDataViewerContextMenu>({
id: 'customValuePanel',
menuItemsGetter: context => {
const { model, resultIndex, key } = context.data;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import type { IDatabaseDataModel } from './DatabaseDataModel/IDatabaseDataModel.
import type { IDataPresentationActions } from './TableViewer/IDataPresentationActions.js';
import type { IDataTableActions } from './TableViewer/IDataTableActions.js';

export interface IDataGridCellMenuContext {
export interface IDataViewerContextMenu {
model: IDatabaseDataModel;
actions: IDataTableActions;
spreadsheetActions: IDataPresentationActions<IResultSetElementKey>;
Expand All @@ -25,7 +25,7 @@ export interface IDataGridCellMenuContext {

@injectable()
export class DataViewerContextMenuService {
onRootMenuOpen: IExecutor<IDataGridCellMenuContext>;
onRootMenuOpen: IExecutor<IDataViewerContextMenu>;

static cellContext = 'data-viewer-cell-context-menu';
private static readonly menuToken = 'data-viewer-context-menu';
Expand All @@ -46,7 +46,7 @@ export class DataViewerContextMenuService {
key: IResultSetElementKey,
simple: boolean,
): IMenuPanel {
return this.contextMenuService.createContextMenu<IDataGridCellMenuContext>(
return this.contextMenuService.createContextMenu<IDataViewerContextMenu>(
{
menuId: this.getMenuToken(),
contextType: DataViewerContextMenuService.cellContext,
Expand All @@ -67,7 +67,7 @@ export class DataViewerContextMenuService {
this.onRootMenuOpen.execute({ model, actions, spreadsheetActions, resultIndex, key, simple });
}

add(panelId: string, menuItem: IContextMenuItem<IDataGridCellMenuContext>): void {
add(panelId: string, menuItem: IContextMenuItem<IDataViewerContextMenu>): void {
this.contextMenuService.addMenuItem(panelId, menuItem);
}
}

0 comments on commit 3ae20b1

Please sign in to comment.