Skip to content

Commit

Permalink
Update glsp to v2.3.0-next.390
Browse files Browse the repository at this point in the history
- Align ActionDispatcher API (GLSP-1416)
  • Loading branch information
ivy-lli committed Nov 29, 2024
1 parent 3b2f1be commit 8f88c39
Show file tree
Hide file tree
Showing 24 changed files with 90 additions and 77 deletions.
4 changes: 2 additions & 2 deletions integration/eclipse/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
"@axonivy/process-editor": "~12.0.1-next",
"@axonivy/process-editor-inscription": "~12.0.1-next",
"@axonivy/process-editor-inscription-view": "~12.0.1-next",
"@eclipse-glsp/client": "2.3.0-next.381",
"@eclipse-glsp/client": "2.3.0-next.390",
"@eclipse-glsp/ide": "2.3.0-next.134",
"@eclipse-glsp/protocol": "2.3.0-next.381"
"@eclipse-glsp/protocol": "2.3.0-next.390"
},
"devDependencies": {
"@vscode/codicons": "^0.0.25",
Expand Down
8 changes: 4 additions & 4 deletions integration/eclipse/src/startup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@ import type { ToolBar } from '@axonivy/process-editor';
import { IVY_TYPES } from '@axonivy/process-editor';
import { EnableInscriptionAction } from '@axonivy/process-editor-inscription';
import { EnableViewportAction, SwitchThemeAction, UpdatePaletteItems } from '@axonivy/process-editor-protocol';
import type { IDiagramStartup} from '@eclipse-glsp/client';
import { EnableToolPaletteAction, GLSPActionDispatcher, ShowGridAction, TYPES } from '@eclipse-glsp/client';
import type { IActionDispatcher, IDiagramStartup } from '@eclipse-glsp/client';
import { EnableToolPaletteAction, ShowGridAction, TYPES } from '@eclipse-glsp/client';
import { ContainerModule, inject, injectable } from 'inversify';
import type { IvyDiagramOptions } from './di.config';

import './index.css';

@injectable()
export class EclipseDiagramStartup implements IDiagramStartup {
@inject(GLSPActionDispatcher)
protected actionDispatcher: GLSPActionDispatcher;
@inject(TYPES.IActionDispatcher)
protected actionDispatcher: IActionDispatcher;

@inject(IVY_TYPES.ToolBar)
protected toolBar: ToolBar;
Expand Down
2 changes: 1 addition & 1 deletion integration/standalone/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"@axonivy/process-editor-inscription": "~12.0.1-next",
"@axonivy/process-editor-inscription-view": "~12.0.1-next",
"@axonivy/ui-components": "~12.0.1-next.384",
"@eclipse-glsp/client": "2.3.0-next.381"
"@eclipse-glsp/client": "2.3.0-next.390"
},
"devDependencies": {
"@vscode/codicons": "^0.0.25",
Expand Down
5 changes: 3 additions & 2 deletions integration/standalone/src/app.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { MonacoEditorUtil } from '@axonivy/process-editor-inscription-view';
import { IvyBaseJsonrpcGLSPClient, SwitchThemeActionHandler } from '@axonivy/process-editor';
import type { ThemeMode } from '@axonivy/process-editor-protocol';
import { DiagramLoader, EditMode, GLSPActionDispatcher, GLSPWebSocketProvider, MessageAction, StatusAction } from '@eclipse-glsp/client';
import type { IActionDispatcher } from '@eclipse-glsp/client';
import { DiagramLoader, EditMode, GLSPWebSocketProvider, MessageAction, StatusAction, TYPES } from '@eclipse-glsp/client';
import { ApplicationIdProvider, GLSPClient } from '@eclipse-glsp/protocol';
import type { Container } from 'inversify';
import type { MessageConnection } from 'vscode-jsonrpc';
Expand Down Expand Up @@ -63,7 +64,7 @@ async function initialize(connectionProvider: MessageConnection, isReconnecting
}
});

const actionDispatcher = container.get(GLSPActionDispatcher);
const actionDispatcher = container.get<IActionDispatcher>(TYPES.IActionDispatcher);
if (isReconnecting) {
const message = `Connection to the ${id} glsp server got closed. Connection was successfully re-established.`;
const timeout = 5000;
Expand Down
8 changes: 4 additions & 4 deletions integration/standalone/src/startup.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { EnableInscriptionAction } from '@axonivy/process-editor-inscription';
import { EnableViewportAction, SwitchThemeAction, UpdatePaletteItems } from '@axonivy/process-editor-protocol';
import type { IDiagramStartup } from '@eclipse-glsp/client';
import { EnableToolPaletteAction, GLSPActionDispatcher, NavigationTarget, SelectAction, TYPES } from '@eclipse-glsp/client';
import type { IActionDispatcher, IDiagramStartup } from '@eclipse-glsp/client';
import { EnableToolPaletteAction, NavigationTarget, SelectAction, TYPES } from '@eclipse-glsp/client';
import { ContainerModule, inject, injectable } from 'inversify';
import type { IvyDiagramOptions } from './di.config';
import './index.css';

@injectable()
export class StandaloneDiagramStartup implements IDiagramStartup {
@inject(GLSPActionDispatcher)
protected actionDispatcher: GLSPActionDispatcher;
@inject(TYPES.IActionDispatcher)
protected actionDispatcher: IActionDispatcher;

@inject(TYPES.IDiagramOptions)
protected options: IvyDiagramOptions;
Expand Down
2 changes: 1 addition & 1 deletion integration/viewer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
},
"dependencies": {
"@axonivy/process-editor": "~12.0.1-next",
"@eclipse-glsp/client": "2.3.0-next.381"
"@eclipse-glsp/client": "2.3.0-next.390"
},
"devDependencies": {
"@vscode/codicons": "^0.0.25",
Expand Down
5 changes: 3 additions & 2 deletions integration/viewer/src/app.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { IvyBaseJsonrpcGLSPClient, SwitchThemeActionHandler } from '@axonivy/process-editor';
import type { ThemeMode } from '@axonivy/process-editor-protocol';
import { DiagramLoader, EditMode, GLSPActionDispatcher, GLSPWebSocketProvider, MessageAction, StatusAction } from '@eclipse-glsp/client';
import type { IActionDispatcher } from '@eclipse-glsp/client';
import { DiagramLoader, EditMode, GLSPWebSocketProvider, MessageAction, StatusAction, TYPES } from '@eclipse-glsp/client';
import { ApplicationIdProvider, GLSPClient } from '@eclipse-glsp/protocol';
import type { Container } from 'inversify';
import type { MessageConnection } from 'vscode-jsonrpc';
Expand Down Expand Up @@ -59,7 +60,7 @@ async function initialize(connectionProvider: MessageConnection, isReconnecting
}
});

const actionDispatcher = container.get(GLSPActionDispatcher);
const actionDispatcher = container.get<IActionDispatcher>(TYPES.IActionDispatcher);
if (isReconnecting) {
const message = `Connection to the ${id} glsp server got closed. Connection was successfully re-established.`;
const timeout = 5000;
Expand Down
8 changes: 4 additions & 4 deletions integration/viewer/src/startup.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { EnableViewportAction, MoveIntoViewportAction, SetViewportZoomAction, SwitchThemeAction } from '@axonivy/process-editor-protocol';
import type { Action, IDiagramStartup } from '@eclipse-glsp/client';
import { CenterAction, GLSPActionDispatcher, NavigationTarget, SelectAction, TYPES } from '@eclipse-glsp/client';
import type { Action, IActionDispatcher, IDiagramStartup } from '@eclipse-glsp/client';
import { CenterAction, NavigationTarget, SelectAction, TYPES } from '@eclipse-glsp/client';
import type { interfaces } from 'inversify';
import { ContainerModule, inject, injectable } from 'inversify';
import type { IvyDiagramOptions } from './di.config';
Expand All @@ -10,8 +10,8 @@ const ContainerSymbol = Symbol('ContainerSymbol');

@injectable()
export class ViewerDiagramStartup implements IDiagramStartup {
@inject(GLSPActionDispatcher)
protected actionDispatcher: GLSPActionDispatcher;
@inject(TYPES.IActionDispatcher)
protected actionDispatcher: IActionDispatcher;

@inject(TYPES.IDiagramOptions)
protected options: IvyDiagramOptions;
Expand Down
57 changes: 33 additions & 24 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion packages/editor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
],
"dependencies": {
"@axonivy/process-editor-protocol": "~12.0.1-next",
"@eclipse-glsp/client": "2.3.0-next.381",
"@eclipse-glsp/client": "2.3.0-next.390",
"showdown": "^2.1.0",
"toastify-js": "1.12.0"
},
Expand Down
6 changes: 3 additions & 3 deletions packages/editor/src/jump/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import {
isViewport,
Viewport,
TYPES,
GLSPActionDispatcher,
SetViewportAction
SetViewportAction,
type IActionDispatcher
} from '@eclipse-glsp/client';
import { SelectAllAction } from '@eclipse-glsp/protocol';
import { injectable, inject } from 'inversify';
Expand All @@ -19,7 +19,7 @@ import { JumpAction } from '@axonivy/process-editor-protocol';

@injectable()
export class JumpActionHandler implements IActionHandler {
@inject(TYPES.IActionDispatcher) protected readonly actionDispatcher: GLSPActionDispatcher;
@inject(TYPES.IActionDispatcher) protected readonly actionDispatcher: IActionDispatcher;
@inject(EditorContextService) protected readonly editorContext: EditorContextService;
private jumpStack: Map<string, Viewport> = new Map();

Expand Down
2 changes: 1 addition & 1 deletion packages/editor/src/tools/di.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ export const ivyChangeBoundsToolModule = new FeatureModule(
// GSLP defaults
configureCommand(context, ShowChangeBoundsToolResizeFeedbackCommand);
configureCommand(context, HideChangeBoundsToolResizeFeedbackCommand);
bindAsService(context, TYPES.IDefaultTool, IvyChangeBoundsTool);

// GLSP replacements
bindAsService(context, TYPES.IChangeBoundsManager, IvyChangeBoundsManager);
bindAsService(context, TYPES.IDefaultTool, IvyChangeBoundsTool);
configureView(context, GResizeHandle.TYPE, IvyResizeHandleView);
},
{ featureId: changeBoundsToolModule.featureId }
Expand Down
3 changes: 2 additions & 1 deletion packages/editor/src/tools/ivy-change-bounds-tool.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import type { TrackedResize } from '@eclipse-glsp/client';
import { Bounds, ChangeBoundsListener, ChangeBoundsTool, ResizeHandleLocation, SetBoundsFeedbackAction } from '@eclipse-glsp/client';
import { LaneNode } from '../diagram/model';

import { injectable } from 'inversify';
@injectable()
export class IvyChangeBoundsTool extends ChangeBoundsTool {
protected createChangeBoundsListener() {
return new IvyChangeBoundsListener(this);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
import {
Action,
GLSPActionDispatcher,
IActionHandler,
ICommand,
PaletteItem,
RequestContextActions,
SetContextActions,
TYPES
TYPES,
type IActionDispatcher
} from '@eclipse-glsp/client';
import { injectable, inject } from 'inversify';
import { ShowQuickActionMenuAction } from '../quick-action-menu-ui';
import { UpdateColorPaletteAction, UpdatePaletteItems } from '@axonivy/process-editor-protocol';

@injectable()
export class ColorPaletteHandler implements IActionHandler {
@inject(TYPES.IActionDispatcher) protected readonly actionDispatcher: GLSPActionDispatcher;
@inject(TYPES.IActionDispatcher) protected readonly actionDispatcher: IActionDispatcher;

protected paletteItems: PaletteItem[] = [];

Expand Down
4 changes: 2 additions & 2 deletions packages/editor/src/ui-tools/quick-action/color/action.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Action, GLSPActionDispatcher, PaletteItem, GModelElement, TYPES } from '@eclipse-glsp/client';
import { Action, PaletteItem, GModelElement, TYPES, type IActionDispatcher } from '@eclipse-glsp/client';
import { QuickAction, QuickActionProvider } from '../quick-action';
import { ShowQuickActionMenuAction } from '../quick-action-menu-ui';
import { injectable, inject } from 'inversify';
Expand All @@ -11,7 +11,7 @@ import { LaneTypes } from '../../../diagram/view-types';
@injectable()
export class SelectColorQuickActionProvider implements QuickActionProvider {
@inject(IVY_TYPES.ColorPalette) protected readonly colors: ColorPaletteHandler;
@inject(TYPES.IActionDispatcher) protected readonly actionDispatcher: GLSPActionDispatcher;
@inject(TYPES.IActionDispatcher) protected readonly actionDispatcher: IActionDispatcher;

singleQuickAction(element: GModelElement): QuickAction | undefined {
if (element.type === LaneTypes.POOL) {
Expand Down
Loading

0 comments on commit 8f88c39

Please sign in to comment.