jomarko commented on code in PR #2660:
URL:
https://github.com/apache/incubator-kie-tools/pull/2660#discussion_r1810675196
##########
packages/kie-editors-dev-vscode-extension/package.json:
##########
@@ -96,15 +97,19 @@
"dark": "./static/svg-icon-dark.png",
"light": "./static/svg-icon-light.png"
},
- "title": "Save Preview SVG"
+ "title": "Kogito Editors: Save Preview SVG"
},
{
"command": "extension.kogito.runTest",
- "title": "Run"
+ "title": "Kogito Editors: Run"
},
{
"command": "extension.kogito.silentlyGenerateSvg",
- "title": "Generate SVG without any notification"
+ "title": "Kogito Editors: Generate SVG without any notification"
+ },
+ {
+ "command": "extension.apache.kie.kogitoEditors.generateFormCode",
+ "title": "Kogito Editors: Generate form code for human interactions
from jBPM project"
Review Comment:
not sure about word `Kogito` as we are in `kie-editors-dev-vscode-extension`
package, not a `kogito-editors-dev-vscode-extension`
##########
packages/form-code-generator-vscode-command/src/generateFormCodeCommand.ts:
##########
@@ -0,0 +1,234 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import * as vscode from "vscode";
+import * as fs from "fs";
+import * as path from "path";
+import { generateFormCode } from
"@kie-tools/form-code-generator/dist/generateFormCode";
+import { removeInvalidVarChars } from
"@kie-tools/jbpm-form-code-generator-themes/dist/removeInvalidVarChars";
+import { jbpmBootstrap4FormCodeGeneratorTheme } from
"@kie-tools/jbpm-form-code-generator-themes/dist/jbpmBootstrap4FormCodeGeneratorTheme";
+import { jbpmPatternflyFormCodeGeneratorTheme } from
"@kie-tools/jbpm-form-code-generator-themes/dist/jbpmPatternflyFormCodeGeneratorTheme";
+import { FormSchema } from "@kie-tools/form-code-generator/dist/types";
+import { PATTERNFLY_FILE_EXT } from
"@kie-tools/form-code-generator-patternfly-theme/dist/theme";
+import { BOOTSTRAP4_FILE_EXT } from
"@kie-tools/form-code-generator-bootstrap4-theme/dist/theme";
+
+const FORM_CODE_GENERATION_DEST_PATH = "src/main/resources/forms";
+const JSON_SCHEMA_PATH = "target/classes/META-INF/jsonSchema";
+
+export async function generateFormsCommand() {
+ // Get workspace path as default value
+ const defaultPath = vscode.workspace.workspaceFolders ?
vscode.workspace.workspaceFolders[0].uri.fsPath : undefined;
+
+ // Select project path
+ const projectUri = await vscode.window.showOpenDialog({
+ canSelectFiles: false,
+ canSelectFolders: true,
+ canSelectMany: false,
+ openLabel: "Select Project Folder",
+ defaultUri: defaultPath ? vscode.Uri.file(defaultPath) : undefined,
+ });
Review Comment:
The problem with added dialogues/prompts/popups, not sure what is the
terminology in VSCode is only with the first one. There is no additionl
linformation in the step of selecting path to the jBPM project. See the second
screenshot below.:
### 01

### 02

it seems `openLabel: "Select Project Folder",` config is not used? In the
documentation I see alternative `title` ?
https://code.visualstudio.com/api/references/vscode-api#OpenDialogOptions
Using the generate command for the first time I was confused what should I
do in the step **02**.
##########
packages/kie-editors-dev-vscode-extension/package.json:
##########
@@ -144,7 +149,7 @@
},
"customEditors": [
{
- "displayName": "KIE Kogito Editors",
+ "displayName": "Apache KIE Kogito Editors",
Review Comment:
similar comment
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]