Skip to content

Commit

Permalink
feat(settings): Wire up nodeLabel setting
Browse files Browse the repository at this point in the history
This commit wires up the `nodeLabel` setting so the user can choose what
label a node shows.

relates: https://issues.redhat.com/browse/KTO-441
relates: KaotoIO/kaoto#1221
relates: KaotoIO/kaoto#1264
  • Loading branch information
lordrip committed Jul 30, 2024
1 parent 2a9081a commit ff8a7cf
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 15 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# 1.3.0

- Enable `nodeLabel` setting to configure the node label used in the Kaoto editor
- Upgrade Kaoto 2.2.0-RC3

# 1.2.0
Expand Down
13 changes: 12 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,16 @@
"default": null,
"markdownDescription": "URL to a Kaoto catalog. For instance `https://raw.githubusercontent.com/KaotoIO/catalogs/main/catalogs/index.json`. Documentation to generate your own set of catalog is available [here](https://github.com/KaotoIO/kaoto/tree/main/packages/catalog-generator). It requires to reopen the kaoto editors to be effective.",
"scope": "window"
},
"kaoto.nodeLabel": {
"type": "string",
"default": "description",
"markdownDescription": "Node label, which will be used for nodes in the canvas. Can be either `description` or `id`. If `description` is selected, it will be displayed only if it is available, otherwise `id` will be displayed by default.",
"enum": [
"description",
"id"
],
"scope": "window"
}
}
},
Expand Down Expand Up @@ -183,7 +193,8 @@
"@patternfly/react-core": "5.2.2",
"@patternfly/react-icons": "5.2.1",
"@patternfly/react-table": "5.2.2",
"@patternfly/react-topology": "5.2.1"
"@patternfly/react-topology": "5.2.1",
"@kaoto/kaoto": "portal:/home/rmartinez/repos/kaoto/packages/ui"
},
"packageManager": "[email protected]"
}
7 changes: 5 additions & 2 deletions src/webview/VSCodeKaotoEditorChannelApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,12 @@ 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 settingsModel: ISettingsModel = {
catalogUrl: vscode.workspace.getConfiguration('kaoto').get<string | null>('catalog.url') ?? '',
nodeLabel: NodeLabelType.Description,
catalogUrl: catalogUrl ?? '',
nodeLabel: nodeLabel ?? NodeLabelType.Description,
};

return new SettingsModel(settingsModel);
Expand Down
36 changes: 24 additions & 12 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -258,9 +258,9 @@ __metadata:
languageName: node
linkType: hard

"@kaoto/kaoto@npm:2.2.0-RC3":
version: 2.2.0-RC3
resolution: "@kaoto/kaoto@npm:2.2.0-RC3"
"@kaoto/kaoto@portal:/home/rmartinez/repos/kaoto/packages/ui::locator=vscode-kaoto%40workspace%3A.":
version: 0.0.0-use.local
resolution: "@kaoto/kaoto@portal:/home/rmartinez/repos/kaoto/packages/ui::locator=vscode-kaoto%40workspace%3A."
dependencies:
"@kaoto-next/uniforms-patternfly": ^0.6.15
"@kie-tools-core/editor": 0.32.0
Expand Down Expand Up @@ -290,14 +290,13 @@ __metadata:
react-router-dom: ^6.14.1
simple-zustand-devtools: ^1.1.0
uniforms: 4.0.0-alpha.5
uniforms-bridge-json-schema: 4.0.0-alpha.5
uniforms-bridge-json-schema: 4.0.0-alpha.6
usehooks-ts: ^3.0.0
uuid: ^10.0.0
yaml: ^2.3.2
zustand: ^4.3.9
checksum: de0ad2b00c4b1f8fdcc8cfed08201c583a76c704f69a9e038b3842ca0a91adbf71101c73e8db1e144b91d97d6083b7d78a8209d6fb28c7054860a25ad0655725
languageName: node
linkType: hard
linkType: soft

"@kie-tools-core/backend@npm:0.32.0":
version: 0.32.0
Expand Down Expand Up @@ -7790,19 +7789,19 @@ __metadata:
languageName: node
linkType: hard

"uniforms-bridge-json-schema@npm:4.0.0-alpha.5":
version: 4.0.0-alpha.5
resolution: "uniforms-bridge-json-schema@npm:4.0.0-alpha.5"
"uniforms-bridge-json-schema@npm:4.0.0-alpha.6":
version: 4.0.0-alpha.6
resolution: "uniforms-bridge-json-schema@npm:4.0.0-alpha.6"
dependencies:
invariant: ^2.0.0
lodash: ^4.0.0
tslib: ^2.2.0
uniforms: ^4.0.0-alpha.5
checksum: 7968c9a72f249189050c387a9dad7605d74fc28589c70c7dc323237596e01a56fc77950774eb42b49028a9e3efb747120e2470fec63fd0300f63a555c991d0e3
uniforms: ^4.0.0-alpha.6
checksum: 88bb00953ee37894e71e682b94111a701634c465882728897f02cdef0b933311eb983010af2b60a2277f4d10ee5d82b98e2b49caddf0c5300aa6057e3bb77804
languageName: node
linkType: hard

"uniforms@npm:4.0.0-alpha.5, uniforms@npm:^4.0.0-alpha.5":
"uniforms@npm:4.0.0-alpha.5":
version: 4.0.0-alpha.5
resolution: "uniforms@npm:4.0.0-alpha.5"
dependencies:
Expand All @@ -7815,6 +7814,19 @@ __metadata:
languageName: node
linkType: hard

"uniforms@npm:^4.0.0-alpha.6":
version: 4.0.0-alpha.6
resolution: "uniforms@npm:4.0.0-alpha.6"
dependencies:
invariant: ^2.0.0
lodash: ^4.0.0
tslib: ^2.2.0
peerDependencies:
react: ^18.0.0 || ^17.0.0 || ^16.8.0
checksum: 033057936957755550564e700665f67df1a755be0d270ebd29cbe9cd9fa58571eb1fe3b9e3205e93ad8ef32a714282b46eaae656c38f7c491db9e63c31a54a3f
languageName: node
linkType: hard

"unique-filename@npm:^3.0.0":
version: 3.0.0
resolution: "unique-filename@npm:3.0.0"
Expand Down

0 comments on commit ff8a7cf

Please sign in to comment.