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

feat: Add missing settings to VS Code Kaoto #756

Merged
merged 1 commit into from
Jan 8, 2025
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

- Fix Kaoto Datamapper editor on Windows (issue when attaching an xsd)
- Upgrade to Kaoto 2.4.0-RC1
- Add the possibility to select how to show the Step toolbar (onHover or onSelection)
- Add the possibility to enable drag & drop experimental feature

# 2.3.0

Expand Down
15 changes: 15 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,21 @@
"id"
],
"scope": "window"
},
"kaoto.nodeToolbarTrigger": {
"type": "string",
"default": "onHover",
"markdownDescription": "Choose when to open the Node toolbar. Can be either `onHover` or `onSelection`. If `onHover` is selected, the toolbar will be automatically open upon hovering a node, otherwise, it will be open when selecting a node",
"enum": [
"onHover",
"onSelection"
]
},
"kaoto.enableDragAndDrop": {
"type": "boolean",
"default": false,
"markdownDescription": "Control whether to enable drag and drop feature",
"tags": ["experimental"]
}
}
},
Expand Down
8 changes: 7 additions & 1 deletion src/webview/VSCodeKaotoEditorChannelApi.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { KaotoEditorChannelApi } from '@kaoto/kaoto';
import { ISettingsModel, NodeLabelType, SettingsModel } from '@kaoto/kaoto/models';
import { ISettingsModel, NodeLabelType, NodeToolbarTrigger, SettingsModel } from '@kaoto/kaoto/models';
import { BackendProxy } from '@kie-tools-core/backend/dist/api';
import { I18n } from '@kie-tools-core/i18n/dist/core';
import { NotificationsChannelApi } from "@kie-tools-core/notifications/dist/api";
Expand Down Expand Up @@ -39,10 +39,16 @@ export class VSCodeKaotoEditorChannelApi extends DefaultVsCodeKieEditorChannelAp
async getVSCodeKaotoSettings(): Promise<ISettingsModel> {
const catalogUrl = await vscode.workspace.getConfiguration('kaoto').get<Promise<string | null>>('catalog.url');
const nodeLabel = await vscode.workspace.getConfiguration('kaoto').get<Promise<NodeLabelType | null>>('nodeLabel');
const nodeToolbarTrigger = await vscode.workspace.getConfiguration('kaoto').get<Promise<NodeToolbarTrigger | null>>('nodeToolbarTrigger');
const enableDragAndDrop = await vscode.workspace.getConfiguration('kaoto').get<Promise<ISettingsModel['experimentalFeatures']['enableDragAndDrop'] | null>>('enableDragAndDrop');

const settingsModel: Partial<ISettingsModel> = {
catalogUrl: catalogUrl ?? '',
nodeLabel: nodeLabel ?? NodeLabelType.Description,
nodeToolbarTrigger: nodeToolbarTrigger ?? NodeToolbarTrigger.onHover,
experimentalFeatures: {
enableDragAndDrop: enableDragAndDrop ?? false,
},
};

return new SettingsModel(settingsModel);
Expand Down
Loading