From 4e163dd720425c2fded62459fd623a014e89b23a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luiz=20Jo=C3=A3o=20Motta?= Date: Mon, 16 Dec 2024 09:56:21 -0300 Subject: [PATCH] kie-issues#1704: Change custom forms directory from `src/main/resources/forms` to `src/main/resources/custom-forms-dev` (#2798) --- .../src/generateFormCodeCommand.ts | 2 +- .../devui/runtime/forms/impl/FormsStorageImpl.java | 2 +- .../devui/runtime/forms/impl/FormsStorageImplTest.java | 2 +- .../hiring_HRInterview.config | 0 .../{forms => custom-forms-dev}/hiring_HRInterview.html | 0 .../hiring_HRInterviewWithoutConfig.html | 0 .../hiring_ITInterview.config | 0 .../{forms => custom-forms-dev}/hiring_ITInterview.html | 0 .../server/MockData/controllers.js | 9 ++++++--- 9 files changed, 9 insertions(+), 6 deletions(-) rename packages/jbpm-quarkus-devui/jbpm-quarkus-devui-runtime/src/test/resources/{forms => custom-forms-dev}/hiring_HRInterview.config (100%) rename packages/jbpm-quarkus-devui/jbpm-quarkus-devui-runtime/src/test/resources/{forms => custom-forms-dev}/hiring_HRInterview.html (100%) rename packages/jbpm-quarkus-devui/jbpm-quarkus-devui-runtime/src/test/resources/{forms => custom-forms-dev}/hiring_HRInterviewWithoutConfig.html (100%) rename packages/jbpm-quarkus-devui/jbpm-quarkus-devui-runtime/src/test/resources/{forms => custom-forms-dev}/hiring_ITInterview.config (100%) rename packages/jbpm-quarkus-devui/jbpm-quarkus-devui-runtime/src/test/resources/{forms => custom-forms-dev}/hiring_ITInterview.html (100%) diff --git a/packages/form-code-generator-vscode-command/src/generateFormCodeCommand.ts b/packages/form-code-generator-vscode-command/src/generateFormCodeCommand.ts index 6e09ac4c42d..0a30c74a42b 100644 --- a/packages/form-code-generator-vscode-command/src/generateFormCodeCommand.ts +++ b/packages/form-code-generator-vscode-command/src/generateFormCodeCommand.ts @@ -28,7 +28,7 @@ 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 FORM_CODE_GENERATION_DEST_PATH = "src/main/resources/custom-forms-dev"; const JSON_SCHEMA_PATH = "target/classes/META-INF/jsonSchema"; export async function generateFormsCommand() { diff --git a/packages/jbpm-quarkus-devui/jbpm-quarkus-devui-runtime/src/main/java/org/jbpm/quarkus/devui/runtime/forms/impl/FormsStorageImpl.java b/packages/jbpm-quarkus-devui/jbpm-quarkus-devui-runtime/src/main/java/org/jbpm/quarkus/devui/runtime/forms/impl/FormsStorageImpl.java index d1cc3e671f0..6bea503cffd 100644 --- a/packages/jbpm-quarkus-devui/jbpm-quarkus-devui-runtime/src/main/java/org/jbpm/quarkus/devui/runtime/forms/impl/FormsStorageImpl.java +++ b/packages/jbpm-quarkus-devui/jbpm-quarkus-devui-runtime/src/main/java/org/jbpm/quarkus/devui/runtime/forms/impl/FormsStorageImpl.java @@ -60,7 +60,7 @@ public class FormsStorageImpl implements FormsStorage { private static final String CONFIG_EXT = ".config"; - private static final String FORMS_STORAGE_PATH = "/forms"; + private static final String FORMS_STORAGE_PATH = "/custom-forms-dev"; private static final String JAR_FORMS_STORAGE_PATH = "/target/classes" + FORMS_STORAGE_PATH; private static final String FS_FORMS_STORAGE_PATH = "/src/main/resources" + FORMS_STORAGE_PATH; diff --git a/packages/jbpm-quarkus-devui/jbpm-quarkus-devui-runtime/src/test/java/org/jbpm/quarkus/devui/runtime/forms/impl/FormsStorageImplTest.java b/packages/jbpm-quarkus-devui/jbpm-quarkus-devui-runtime/src/test/java/org/jbpm/quarkus/devui/runtime/forms/impl/FormsStorageImplTest.java index a1e1af2a1b4..016a87b8705 100644 --- a/packages/jbpm-quarkus-devui/jbpm-quarkus-devui-runtime/src/test/java/org/jbpm/quarkus/devui/runtime/forms/impl/FormsStorageImplTest.java +++ b/packages/jbpm-quarkus-devui/jbpm-quarkus-devui-runtime/src/test/java/org/jbpm/quarkus/devui/runtime/forms/impl/FormsStorageImplTest.java @@ -65,7 +65,7 @@ public void init() throws IOException { storage.mkdir(); System.setProperty(PROJECT_FORM_STORAGE_PROP, storage.getAbsolutePath()); - URL formsFolder = Thread.currentThread().getContextClassLoader().getResource("forms"); + URL formsFolder = Thread.currentThread().getContextClassLoader().getResource("custom-forms-dev"); formsStorage = new FormsStorageImpl(formsFolder); } diff --git a/packages/jbpm-quarkus-devui/jbpm-quarkus-devui-runtime/src/test/resources/forms/hiring_HRInterview.config b/packages/jbpm-quarkus-devui/jbpm-quarkus-devui-runtime/src/test/resources/custom-forms-dev/hiring_HRInterview.config similarity index 100% rename from packages/jbpm-quarkus-devui/jbpm-quarkus-devui-runtime/src/test/resources/forms/hiring_HRInterview.config rename to packages/jbpm-quarkus-devui/jbpm-quarkus-devui-runtime/src/test/resources/custom-forms-dev/hiring_HRInterview.config diff --git a/packages/jbpm-quarkus-devui/jbpm-quarkus-devui-runtime/src/test/resources/forms/hiring_HRInterview.html b/packages/jbpm-quarkus-devui/jbpm-quarkus-devui-runtime/src/test/resources/custom-forms-dev/hiring_HRInterview.html similarity index 100% rename from packages/jbpm-quarkus-devui/jbpm-quarkus-devui-runtime/src/test/resources/forms/hiring_HRInterview.html rename to packages/jbpm-quarkus-devui/jbpm-quarkus-devui-runtime/src/test/resources/custom-forms-dev/hiring_HRInterview.html diff --git a/packages/jbpm-quarkus-devui/jbpm-quarkus-devui-runtime/src/test/resources/forms/hiring_HRInterviewWithoutConfig.html b/packages/jbpm-quarkus-devui/jbpm-quarkus-devui-runtime/src/test/resources/custom-forms-dev/hiring_HRInterviewWithoutConfig.html similarity index 100% rename from packages/jbpm-quarkus-devui/jbpm-quarkus-devui-runtime/src/test/resources/forms/hiring_HRInterviewWithoutConfig.html rename to packages/jbpm-quarkus-devui/jbpm-quarkus-devui-runtime/src/test/resources/custom-forms-dev/hiring_HRInterviewWithoutConfig.html diff --git a/packages/jbpm-quarkus-devui/jbpm-quarkus-devui-runtime/src/test/resources/forms/hiring_ITInterview.config b/packages/jbpm-quarkus-devui/jbpm-quarkus-devui-runtime/src/test/resources/custom-forms-dev/hiring_ITInterview.config similarity index 100% rename from packages/jbpm-quarkus-devui/jbpm-quarkus-devui-runtime/src/test/resources/forms/hiring_ITInterview.config rename to packages/jbpm-quarkus-devui/jbpm-quarkus-devui-runtime/src/test/resources/custom-forms-dev/hiring_ITInterview.config diff --git a/packages/jbpm-quarkus-devui/jbpm-quarkus-devui-runtime/src/test/resources/forms/hiring_ITInterview.html b/packages/jbpm-quarkus-devui/jbpm-quarkus-devui-runtime/src/test/resources/custom-forms-dev/hiring_ITInterview.html similarity index 100% rename from packages/jbpm-quarkus-devui/jbpm-quarkus-devui-runtime/src/test/resources/forms/hiring_ITInterview.html rename to packages/jbpm-quarkus-devui/jbpm-quarkus-devui-runtime/src/test/resources/custom-forms-dev/hiring_ITInterview.html diff --git a/packages/runtime-tools-process-dev-ui-webapp/server/MockData/controllers.js b/packages/runtime-tools-process-dev-ui-webapp/server/MockData/controllers.js index 5df1d04cb90..b83b56c9a17 100644 --- a/packages/runtime-tools-process-dev-ui-webapp/server/MockData/controllers.js +++ b/packages/runtime-tools-process-dev-ui-webapp/server/MockData/controllers.js @@ -362,11 +362,14 @@ module.exports = controller = { } let sourceString; - const configString = fs.readFileSync(path.join(`${__dirname}/forms/examples/${formName}.config`), "utf8"); + const configString = fs.readFileSync( + path.join(`${__dirname}/custom-forms-dev/examples/${formName}.config`), + "utf8" + ); if (formInfo[0].type.toLowerCase() === "html") { - sourceString = fs.readFileSync(path.join(`${__dirname}/forms/examples/${formName}.html`), "utf8"); + sourceString = fs.readFileSync(path.join(`${__dirname}/custom-forms-dev/examples/${formName}.html`), "utf8"); } else if (formInfo[0].type.toLowerCase() === "tsx") { - sourceString = fs.readFileSync(path.join(`${__dirname}/forms/examples/${formName}.tsx`), "utf8"); + sourceString = fs.readFileSync(path.join(`${__dirname}/custom-forms-dev/examples/${formName}.tsx`), "utf8"); } const response = { formInfo: formInfo[0],