diff --git a/.gitignore b/.gitignore index 34965b337f1..c576e0b3e03 100644 --- a/.gitignore +++ b/.gitignore @@ -324,8 +324,20 @@ packages/scesim-marshaller/**/ts-gen !packages/sonataflow-builder-image/test-resources/ !packages/sonataflow-devmode-image/test-resources/ +# kogito-images: excluding test-resources +!packages/kogito-data-index-ephemeral-image/test-resources/ +!packages/kogito-data-index-postgresql-image/test-resources/ +!packages/kogito-jobs-service-ephemeral-image/test-resources/ +!packages/kogito-jobs-service-postgresql-image/test-resources/ +!packages/kogito-jobs-service-allinone-image/test-resources/ +!packages/kogito-jit-runner-image/test-resources/ + __pycache__ packages/python-venv/venv # devbox .devbox + +# turbo +.turbo +turbo.json diff --git a/.syncpackrc.json b/.syncpackrc.json index 4f613e8ad0c..7abf816f386 100644 --- a/.syncpackrc.json +++ b/.syncpackrc.json @@ -7,6 +7,16 @@ "@kie-tools/uniforms-patternfly-codegen", "@kie-tools/yaml-language-server" ] + }, + { + "dependencies": ["react", "react-dom"], + "policy": "sameRange" + }, + { + "label": "Use workspace protocol when developing local packages", + "dependencies": ["$LOCAL"], + "dependencyTypes": ["prod", "dev"], + "pinVersion": "workspace:*" } ] } diff --git a/KOGITO_UPGRADE_PROCESS.md b/KOGITO_UPGRADE_PROCESS.md index 4b74a31d4ef..2896b7f32b1 100644 --- a/KOGITO_UPGRADE_PROCESS.md +++ b/KOGITO_UPGRADE_PROCESS.md @@ -86,7 +86,7 @@ You can find an example of the Quarkus upgrade in [this PR](https://github.com/a # Upgrading Kogito -In the root directory, run `pnpm update-kogito-version-to --maven [version] --images-tag [tag]`. +In the root directory, run `pnpm update-kogito-version-to --maven [version]`. Of course, a new Kogito version may lead to incompatibilities in the code and with other dependencies. In such a case, an investigation and evetually a fix is required to complete the process. diff --git a/README.md b/README.md index e0ec6ec186d..052e4d56144 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,8 @@ To build and test all packages of the Apache KIE Tools project, you're going to - Python `3.12` _(To install, follow these instructions: https://www.python.org/downloads/)_ - Helm `3.13.3` _(To install, follow these instructions: https://helm.sh/docs/intro/install/)_ - Make +- xmllint _(To install, follow these instructions: https://www.baeldung.com/linux/xmllint)_ +- bash `5.x` _(On Linux or Nix you should be fine. On macOS, follow these instructions to use zsh: https://support.apple.com/102360)_ > **ℹ️ NOTE** > diff --git a/devbox.json b/devbox.json index bd6d1bf34f2..0268f10a97a 100644 --- a/devbox.json +++ b/devbox.json @@ -7,7 +7,8 @@ "kubernetes-helm": "3.13.3", "gnumake": "4.4.1", "go": "1.21.9", - "python": "3.12.2" + "python": "3.12.2", + "libxml2": "2.13.3" }, "env": { "PLAYWRIGHT_BROWSERS_PATH": "0", @@ -15,7 +16,8 @@ "DEVBOX_COREPACK_ENABLED": "true", "GOFLAGS": "-modcacherw", "GOPATH": "$DEVBOX_PROJECT_ROOT/.devbox/gopkgs", - "PATH": "$DEVBOX_PROJECT_ROOT/.devbox/gopkgs/bin:$PATH" + "PNPM_HOME": "$DEVBOX_PROJECT_ROOT/.devbox/pnpm-store", + "PATH": "$DEVBOX_PROJECT_ROOT/.devbox/gopkgs/bin:$DEVBOX_PROJECT_ROOT/.devbox/pnpm-store:$PATH" }, "shell": { "init_hook": [ diff --git a/devbox.lock b/devbox.lock index 810e96da462..e44362293a1 100644 --- a/devbox.lock +++ b/devbox.lock @@ -189,6 +189,110 @@ } } }, + "libxml2@2.13.3": { + "last_modified": "2024-09-12T11:58:09Z", + "resolved": "github:NixOS/nixpkgs/280db3decab4cbeb22a4599bd472229ab74d25e1#libxml2", + "source": "devbox-search", + "version": "2.13.3", + "systems": { + "aarch64-darwin": { + "outputs": [ + { + "name": "bin", + "path": "/nix/store/7gi1kd2mz9jc8ya4lkqhlv9vklc5qr2j-libxml2-2.13.3-bin", + "default": true + }, + { + "name": "dev", + "path": "/nix/store/mnij865rdzrrnxqmhj4s0abmd1xx771v-libxml2-2.13.3-dev" + }, + { + "name": "devdoc", + "path": "/nix/store/80bkizndgvrqiq42ig681irxswsf4kxv-libxml2-2.13.3-devdoc" + }, + { + "name": "out", + "path": "/nix/store/sr8lnkgivqcd06113nsk5p3jz2xcx7rp-libxml2-2.13.3" + } + ], + "store_path": "/nix/store/7gi1kd2mz9jc8ya4lkqhlv9vklc5qr2j-libxml2-2.13.3-bin" + }, + "aarch64-linux": { + "outputs": [ + { + "name": "bin", + "path": "/nix/store/gxpp5r2nbs3s0n5rw0jbnm1k5lhxrx13-libxml2-2.13.3-bin", + "default": true + }, + { + "name": "devdoc", + "path": "/nix/store/0qnymx6l3c7998yscwvr1q64iz447hfc-libxml2-2.13.3-devdoc" + }, + { + "name": "out", + "path": "/nix/store/da857dg9ip02lkci5nicgvkzf419jzc7-libxml2-2.13.3" + }, + { + "name": "py", + "path": "/nix/store/qfpnqradhvhicl1hm70w7891bk95lkad-libxml2-2.13.3-py" + }, + { + "name": "dev", + "path": "/nix/store/dph7mh2dhl8sl4i44wlgnmsrwdlcv0bc-libxml2-2.13.3-dev" + } + ], + "store_path": "/nix/store/gxpp5r2nbs3s0n5rw0jbnm1k5lhxrx13-libxml2-2.13.3-bin" + }, + "x86_64-darwin": { + "outputs": [ + { + "name": "bin", + "path": "/nix/store/gg4x2l8wy3lkd94bxpl0z7gnn9pa365i-libxml2-2.13.3-bin", + "default": true + }, + { + "name": "dev", + "path": "/nix/store/pzakdvnmm99gic3mqyg8375b08dvkqxm-libxml2-2.13.3-dev" + }, + { + "name": "devdoc", + "path": "/nix/store/xa27lhlrc2ya3i67g7nz53g64l3wqvjw-libxml2-2.13.3-devdoc" + }, + { + "name": "out", + "path": "/nix/store/ac73mddfvraxgvd816r9h57df35mm6gd-libxml2-2.13.3" + } + ], + "store_path": "/nix/store/gg4x2l8wy3lkd94bxpl0z7gnn9pa365i-libxml2-2.13.3-bin" + }, + "x86_64-linux": { + "outputs": [ + { + "name": "bin", + "path": "/nix/store/2y4a178s4w60v4m8749xhaawf8ga7cw5-libxml2-2.13.3-bin", + "default": true + }, + { + "name": "dev", + "path": "/nix/store/v40g7q9zix1ycpyara08brd50m00471n-libxml2-2.13.3-dev" + }, + { + "name": "devdoc", + "path": "/nix/store/cs49b70qkgygx0wxcl04dpy1d1g5vb91-libxml2-2.13.3-devdoc" + }, + { + "name": "out", + "path": "/nix/store/nr8mh99sfsb1gw1b1qmrwhzmxbhj84j7-libxml2-2.13.3" + }, + { + "name": "py", + "path": "/nix/store/p17nrcsmvb0q7b9g6347imljapbfcsb1-libxml2-2.13.3-py" + } + ], + "store_path": "/nix/store/2y4a178s4w60v4m8749xhaawf8ga7cw5-libxml2-2.13.3-bin" + } + } + }, "maven@3.9.6": { "last_modified": "2024-03-22T11:26:23Z", "resolved": "github:NixOS/nixpkgs/a3ed7406349a9335cb4c2a71369b697cecd9d351#maven", @@ -304,7 +408,7 @@ }, "python@3.12.2": { "last_modified": "2024-03-22T11:26:23Z", - "plugin_version": "0.0.3", + "plugin_version": "0.0.4", "resolved": "github:NixOS/nixpkgs/a3ed7406349a9335cb4c2a71369b697cecd9d351#python312", "source": "devbox-search", "version": "3.12.2", diff --git a/examples/base64png-editor/package.json b/examples/base64png-editor/package.json index 4c9ee64631e..57aff01bf6b 100644 --- a/examples/base64png-editor/package.json +++ b/examples/base64png-editor/package.json @@ -28,9 +28,7 @@ "@kie-tools-core/patternfly-base": "workspace:*", "@kie-tools-core/workspace": "workspace:*", "@patternfly/react-core": "^4.276.6", - "@patternfly/react-icons": "^4.93.6", - "react": "^17.0.2", - "react-dom": "^17.0.2" + "@patternfly/react-icons": "^4.93.6" }, "devDependencies": { "@kie-tools/root-env": "workspace:*", @@ -40,5 +38,9 @@ "copyfiles": "^2.4.1", "rimraf": "^3.0.2", "typescript": "^5.5.3" + }, + "peerDependencies": { + "react": ">=17.0.2 <19.0.0", + "react-dom": ">=17.0.2 <19.0.0" } } diff --git a/examples/jbpm-compact-architecture-example/README.md b/examples/jbpm-compact-architecture-example/README.md index c754d55ceb6..5fcae0599f9 100644 --- a/examples/jbpm-compact-architecture-example/README.md +++ b/examples/jbpm-compact-architecture-example/README.md @@ -6,13 +6,13 @@ This example showcases a basic implementation of the **Hiring** process that dri interviews until he gets hired. This quickstart project shows a simple example user task orchestration including the use of DMN decisions to -generate the candidate offer and tºimers to skip User Tasks. +generate the candidate offer and timers to skip User Tasks. This example also demonstrates how to configure the whole _Kogito_ environment using the new _Compact Architecture_ that enable simplifying the communication among _Kogito_ services removing the need of events (Kafka/HTTP) between them. This can be achieved using the following _Quarkus_ addons: -- `kogito-addons-quarkus-data-index-persistence-postgresql`: enables the _Kogito Runtime_ persisting directly into the +- `kogito-addons-quarkus-data-index-postgresql`: enables the _Kogito Runtime_ persisting directly into the _Data-Index_ database. - `kogito-addons-quarkus-jobs`: enables collocating the _Jobs Service_ inside the _Kogito Runtime_. @@ -321,7 +321,8 @@ Candidate Jon Snow don't meet the requirements for the position but we'll keep i ### Using Keycloak as Authentication Server -In this Quickstart we'll be using [Keycloak](https://www.keycloak.org/) as _Authentication Server_. It will be started as a part of the project _Infrastructure Services_, you can check the configuration on the project [docker-compose.yml](docker-compose/docker-compose.yml) in [docker-compose](docker-compose) folder. +In this Quickstart we'll be using [Keycloak](https://www.keycloak.org/) as _Authentication Server_ for _Kogito Task Console_. It will be started +as a part of the project _Infrastructure Services_, you can check the configuration on the project [docker-compose.yml](docker-compose/docker-compose.yml) in [docker-compose](docker-compose) folder. It will install the _Kogito Realm_ that comes with a predefined set of users: @@ -333,7 +334,7 @@ It will install the _Kogito Realm_ that comes with a predefined set of users: Once Keycloak is started, you should be able to access your _Keycloak Server_ at [localhost:8480/auth](http://localhost:8480/auth) with _admin_ user. -> **_NOTE:_** This example uses keycloak authentication to enable security only in the consoles not in runtime. +> **_NOTE:_** This example uses keycloak authentication to enable security only in the _Kogito Task Console_ not for the Kogito Runtime. ### Using the Kogito Runtime Consoles to interact with the Hiring Process @@ -370,10 +371,8 @@ In this guide we'll see how to use the _Kogito Management Console_ to view the s Which indicates that a new process instance with id **064a6372-b5bb-4eff-a059-d7b24d4ac64a** has been started. 2. Now let's check the process instance state with the _Kogito Management Console_. To do so, in your browser navigate - to http://localhost:8280 and log in using any of the users specified in the [Using Keycloak as Authentication Server](#using-keycloak-as-authentication-server). - - Once you are logged in, you should be redirected to the **Process Instances** page where you should be able to see - the started process instance in active state. + to http://localhost:8280 and you'll be redirected to the **Process Instances** page in the _Kogito Management Console_. + There where you should be able to see the started process instance in active state.
@@ -382,7 +381,8 @@ In this guide we'll see how to use the _Kogito Management Console_ to view the s
-3. Click on the instance **id** to navigate into the _Process Details_ page. In there you'll be able to see different panels displaying relevant information about the instance state, such as the _Diagram_, _Timeline_, _Details_, _Variables_, _Jobs_... +3. Click on the instance **id** to navigate into the _Process Details_ page. In there you'll be able to see different panels + displaying relevant information about the instance state, such as the _Diagram_, _Timeline_, _Details_, _Variables_, _Jobs_...
diff --git a/examples/jbpm-compact-architecture-example/docker-compose/README.md b/examples/jbpm-compact-architecture-example/docker-compose/README.md index 26834f79196..efc66a2e671 100644 --- a/examples/jbpm-compact-architecture-example/docker-compose/README.md +++ b/examples/jbpm-compact-architecture-example/docker-compose/README.md @@ -4,7 +4,7 @@ To allow a quick setup of all services required to run this demo, we provide a d - Postgresql - PgAdmin -- Kogito Example Service (Only available if the example has been compiled using the `container` mvn profile eg: `mvn cleanp package -Dcontainer`) +- Kogito Example Service (Only available if the example has been compiled using the `container` mvn profile eg: `mvn clean package -Dcontainer`) - Kogito Management Console - Kogito Task Console - Keycloak @@ -12,8 +12,8 @@ To allow a quick setup of all services required to run this demo, we provide a d The docker compose template provides three profiles to enable starting only the set of services you want to use. The profiles are: - **infra**: Starts only the minimal infrastructure to run the example (Postgresql, pgadmin, Kogito Data Index) -- **example**: Starts the services in _infra_ profile and the Kogito Example Service. Requires the example to be compiled using the `container` mvn profile eg: `mvn cleanp package -Dcontainer`. -- **full** (default): includes all the above and also starts the **Management Console**, **Task Console** and a **Keycloak** to handle the consoles authentication. Requires the example to be compiled using the `container` mvn profile eg: `mvn cleanp package -Dcontainer`. +- **example**: Starts the services in _infra_ profile and the Kogito Example Service. Requires the example to be compiled using the `container` mvn profile eg: `mvn clean package -Dcontainer`. +- **full** (default): includes all the above and also starts the **Management Console**, **Task Console** and a **Keycloak** to handle the consoles authentication. Requires the example to be compiled using the `container` mvn profile eg: `mvn clean package -Dcontainer`. > NOTE: In order to use it, please ensure you have Docker Compose installed on your machine, otherwise follow the instructions available > in [here](https://docs.docker.com/compose/install/). diff --git a/examples/jbpm-compact-architecture-example/pom.xml b/examples/jbpm-compact-architecture-example/pom.xml index 56b4cef9276..10fb11ac96b 100644 --- a/examples/jbpm-compact-architecture-example/pom.xml +++ b/examples/jbpm-compact-architecture-example/pom.xml @@ -99,12 +99,6 @@ kogito-addons-quarkus-data-index-postgresql - - - org.kie - kogito-addons-quarkus-data-index-persistence-postgresql - - org.kie diff --git a/examples/ping-pong-view-react/package.json b/examples/ping-pong-view-react/package.json index 9c947ed618b..788b9573efd 100644 --- a/examples/ping-pong-view-react/package.json +++ b/examples/ping-pong-view-react/package.json @@ -25,9 +25,7 @@ "dependencies": { "@kie-tools-core/envelope": "workspace:*", "@kie-tools-core/envelope-bus": "workspace:*", - "@kie-tools-examples/ping-pong-view": "workspace:*", - "react": "^17.0.2", - "react-dom": "^17.0.2" + "@kie-tools-examples/ping-pong-view": "workspace:*" }, "devDependencies": { "@kie-tools/root-env": "workspace:*", @@ -37,5 +35,9 @@ "copyfiles": "^2.4.1", "rimraf": "^3.0.2", "typescript": "^5.5.3" + }, + "peerDependencies": { + "react": ">=17.0.2 <19.0.0", + "react-dom": ">=17.0.2 <19.0.0" } } diff --git a/examples/ping-pong-view/package.json b/examples/ping-pong-view/package.json index 6135eff2325..4c200874954 100644 --- a/examples/ping-pong-view/package.json +++ b/examples/ping-pong-view/package.json @@ -21,9 +21,7 @@ }, "dependencies": { "@kie-tools-core/envelope": "workspace:*", - "@kie-tools-core/envelope-bus": "workspace:*", - "react": "^17.0.2", - "react-dom": "^17.0.2" + "@kie-tools-core/envelope-bus": "workspace:*" }, "devDependencies": { "@kie-tools/root-env": "workspace:*", @@ -32,5 +30,9 @@ "@types/react-dom": "^17.0.5", "rimraf": "^3.0.2", "typescript": "^5.5.3" + }, + "peerDependencies": { + "react": ">=17.0.2 <19.0.0", + "react-dom": ">=17.0.2 <19.0.0" } } diff --git a/examples/todo-list-view/package.json b/examples/todo-list-view/package.json index e9e79bfb8f7..40f71db6d94 100644 --- a/examples/todo-list-view/package.json +++ b/examples/todo-list-view/package.json @@ -22,9 +22,7 @@ }, "dependencies": { "@kie-tools-core/envelope": "workspace:*", - "@kie-tools-core/envelope-bus": "workspace:*", - "react": "^17.0.2", - "react-dom": "^17.0.2" + "@kie-tools-core/envelope-bus": "workspace:*" }, "devDependencies": { "@kie-tools/root-env": "workspace:*", @@ -35,5 +33,9 @@ "copyfiles": "^2.4.1", "rimraf": "^3.0.2", "typescript": "^5.5.3" + }, + "peerDependencies": { + "react": ">=17.0.2 <19.0.0", + "react-dom": ">=17.0.2 <19.0.0" } } diff --git a/examples/uniforms-patternfly/package.json b/examples/uniforms-patternfly/package.json index 77f4acef161..afc29cf9288 100644 --- a/examples/uniforms-patternfly/package.json +++ b/examples/uniforms-patternfly/package.json @@ -14,7 +14,9 @@ "@kie-tools/uniforms-patternfly": "workspace:*", "@patternfly/react-core": "^4.276.6", "@patternfly/react-icons": "^4.93.6", - "ajv": "^6.12.6", + "ajv": "^8.17.1", + "ajv-draft-04": "^1.0.0", + "ajv-formats": "^3.0.1", "react": "^17.0.2", "react-dom": "^17.0.2", "simpl-schema": "^1.12.0", diff --git a/examples/uniforms-patternfly/src/schemas/json-schema.ts b/examples/uniforms-patternfly/src/schemas/json-schema.ts index d2e99e55434..ca8a30c0506 100644 --- a/examples/uniforms-patternfly/src/schemas/json-schema.ts +++ b/examples/uniforms-patternfly/src/schemas/json-schema.ts @@ -17,10 +17,12 @@ * under the License. */ -import * as Ajv from "ajv"; +import AjvDraft04 from "ajv-draft-04"; +import addFormats from "ajv-formats"; import { JSONSchemaBridge } from "uniforms-bridge-json-schema"; -const ajv = new Ajv({ allErrors: true, useDefaults: true }); +const ajv = new AjvDraft04({ strict: false, allErrors: true, useDefaults: true }); +addFormats(ajv); function createValidator(schema: any) { const validator = ajv.compile(schema); @@ -56,7 +58,7 @@ const schema = { type: "string", format: "date-time", max: "2000-04-04T10:30:00.000Z", - description: "this is date and time field", + description: "this is the date and time field", }, }, disabled: false, diff --git a/packages/boxed-expression-component/package.json b/packages/boxed-expression-component/package.json index 26f04d18e36..a39d3184569 100644 --- a/packages/boxed-expression-component/package.json +++ b/packages/boxed-expression-component/package.json @@ -36,8 +36,6 @@ "@patternfly/react-styles": "^4.92.6", "@patternfly/react-table": "^4.112.39", "lodash": "^4.17.21", - "react": "^17.0.2", - "react-dom": "^17.0.2", "react-resizable": "^1.11.0", "react-table": "^7.6.2", "uuid": "^8.3.2" @@ -84,5 +82,9 @@ "webpack-cli": "^4.10.0", "webpack-dev-server": "^4.15.1", "webpack-merge": "^5.9.0" + }, + "peerDependencies": { + "react": ">=17.0.2 <19.0.0", + "react-dom": ">=17.0.2 <19.0.0" } } diff --git a/packages/chrome-extension/package.json b/packages/chrome-extension/package.json index b2953fc9cf1..c631c9c196d 100644 --- a/packages/chrome-extension/package.json +++ b/packages/chrome-extension/package.json @@ -31,9 +31,7 @@ "@kie-tools-core/patternfly-base": "workspace:*", "@kie-tools-core/workspace": "workspace:*", "@octokit/rest": "^18.5.3", - "minimatch": "^3.0.5", - "react": "^17.0.2", - "react-dom": "^17.0.2" + "minimatch": "^3.0.5" }, "devDependencies": { "@babel/core": "^7.16.0", @@ -58,5 +56,9 @@ "rimraf": "^3.0.2", "ts-jest": "^29.1.5", "typescript": "^5.5.3" + }, + "peerDependencies": { + "react": ">=17.0.2 <19.0.0", + "react-dom": ">=17.0.2 <19.0.0" } } diff --git a/packages/chrome-extension/src/app/components/common/ChromeResourceContentService.ts b/packages/chrome-extension/src/app/components/common/ChromeResourceContentService.ts index 064dd27e7fb..1343dd85a2a 100644 --- a/packages/chrome-extension/src/app/components/common/ChromeResourceContentService.ts +++ b/packages/chrome-extension/src/app/components/common/ChromeResourceContentService.ts @@ -44,7 +44,7 @@ class ChromeResourceContentService implements ResourceContentService { normalizedPosixPathRelativeToTheWorkspaceRoot: string, opts?: ResourceContentOptions ): Promise { - opts = opts ?? { type: ContentType.TEXT }; + opts = opts ?? { type: "text" }; return fetchFile( this.octokit, this.repoInfo.owner, diff --git a/packages/chrome-extension/src/app/github/api.ts b/packages/chrome-extension/src/app/github/api.ts index 0e86f6ed414..c33a673f0e3 100644 --- a/packages/chrome-extension/src/app/github/api.ts +++ b/packages/chrome-extension/src/app/github/api.ts @@ -35,7 +35,7 @@ export function fetchFile( ref: ref, path: path, }) - .then((res) => (contentType === ContentType.BINARY ? (res.data as any).content : atob((res.data as any).content))) + .then((res) => (contentType === "binary" ? (res.data as any).content : atob((res.data as any).content))) .catch((e) => { console.debug(`Error fetching ${path} with Octokit. Fallback is 'raw.githubusercontent.com'.`); return fetch(`https://raw.githubusercontent.com/${org}/${repo}/${ref}/${path}`).then((res) => diff --git a/packages/cors-proxy/package.json b/packages/cors-proxy/package.json index 3480719d4ee..dc96bbfef5d 100644 --- a/packages/cors-proxy/package.json +++ b/packages/cors-proxy/package.json @@ -27,7 +27,7 @@ }, "dependencies": { "cors": "^2.8.5", - "express": "^4.19.2", + "express": "^4.21.0", "node-fetch": "^3.3.1" }, "devDependencies": { diff --git a/packages/dashbuilder-component-api/package.json b/packages/dashbuilder-component-api/package.json index f974a2717ad..01edc4a68a5 100644 --- a/packages/dashbuilder-component-api/package.json +++ b/packages/dashbuilder-component-api/package.json @@ -25,10 +25,6 @@ "lint": "run-script-if --bool \"$(build-env linters.run)\" --then \"kie-tools--eslint ./src\"", "test": "run-script-if --ignore-errors \"$(build-env tests.ignoreFailures)\" --bool \"$(build-env tests.run)\" --then \"jest --silent --verbose --passWithNoTests\"" }, - "dependencies": { - "react": "^17.0.2", - "react-dom": "^17.0.2" - }, "devDependencies": { "@babel/core": "^7.16.0", "@babel/preset-env": "^7.16.0", @@ -48,5 +44,9 @@ "rimraf": "^3.0.2", "ts-jest": "^29.1.5", "typescript": "^5.5.3" + }, + "peerDependencies": { + "react": ">=17.0.2 <19.0.0", + "react-dom": ">=17.0.2 <19.0.0" } } diff --git a/packages/dashbuilder-component-echarts-base/package.json b/packages/dashbuilder-component-echarts-base/package.json index 85132571624..3fab5f39886 100644 --- a/packages/dashbuilder-component-echarts-base/package.json +++ b/packages/dashbuilder-component-echarts-base/package.json @@ -25,9 +25,7 @@ "lint": "run-script-if --bool \"$(build-env linters.run)\" --then \"kie-tools--eslint ./src\"" }, "dependencies": { - "echarts": "^5.3.2", - "react": "^17.0.2", - "react-dom": "^17.0.2" + "echarts": "^5.3.2" }, "devDependencies": { "@babel/core": "^7.16.0", @@ -41,5 +39,9 @@ "copyfiles": "^2.4.1", "rimraf": "^3.0.2", "typescript": "^5.5.3" + }, + "peerDependencies": { + "react": ">=17.0.2 <19.0.0", + "react-dom": ">=17.0.2 <19.0.0" } } diff --git a/packages/dashbuilder-component-echarts/package.json b/packages/dashbuilder-component-echarts/package.json index 231ec59ecdc..1c34d0e269d 100644 --- a/packages/dashbuilder-component-echarts/package.json +++ b/packages/dashbuilder-component-echarts/package.json @@ -22,9 +22,7 @@ }, "dependencies": { "@kie-tools/dashbuilder-component-api": "workspace:*", - "@kie-tools/dashbuilder-component-echarts-base": "workspace:*", - "react": "^17.0.2", - "react-dom": "^17.0.2" + "@kie-tools/dashbuilder-component-echarts-base": "workspace:*" }, "devDependencies": { "@babel/core": "^7.16.0", @@ -46,5 +44,9 @@ "webpack-cli": "^4.10.0", "webpack-dev-server": "^4.15.1", "webpack-merge": "^5.9.0" + }, + "peerDependencies": { + "react": ">=17.0.2 <19.0.0", + "react-dom": ">=17.0.2 <19.0.0" } } diff --git a/packages/dashbuilder-component-map/package.json b/packages/dashbuilder-component-map/package.json index 100995e97e7..76cd172180d 100644 --- a/packages/dashbuilder-component-map/package.json +++ b/packages/dashbuilder-component-map/package.json @@ -24,8 +24,6 @@ "@kie-tools-core/patternfly-base": "workspace:*", "@kie-tools/dashbuilder-component-api": "workspace:*", "d3-scale": "^4.0.2", - "react": "^17.0.2", - "react-dom": "^17.0.2", "react-simple-maps": "^3.0.0" }, "devDependencies": { @@ -50,5 +48,9 @@ "webpack-cli": "^4.10.0", "webpack-dev-server": "^4.15.1", "webpack-merge": "^5.9.0" + }, + "peerDependencies": { + "react": ">=17.0.2 <19.0.0", + "react-dom": ">=17.0.2 <19.0.0" } } diff --git a/packages/dashbuilder-component-svg-heatmap/package.json b/packages/dashbuilder-component-svg-heatmap/package.json index 41de45902e6..ef85747d77d 100644 --- a/packages/dashbuilder-component-svg-heatmap/package.json +++ b/packages/dashbuilder-component-svg-heatmap/package.json @@ -23,9 +23,7 @@ "dependencies": { "@kie-tools-core/patternfly-base": "workspace:*", "@kie-tools/dashbuilder-component-api": "workspace:*", - "heatmap.js": "^2.0.5", - "react": "^17.0.2", - "react-dom": "^17.0.2" + "heatmap.js": "^2.0.5" }, "devDependencies": { "@babel/core": "^7.16.0", @@ -47,5 +45,9 @@ "webpack-cli": "^4.10.0", "webpack-dev-server": "^4.15.1", "webpack-merge": "^5.9.0" + }, + "peerDependencies": { + "react": ">=17.0.2 <19.0.0", + "react-dom": ">=17.0.2 <19.0.0" } } diff --git a/packages/dashbuilder-component-table/package.json b/packages/dashbuilder-component-table/package.json index cd513ce158d..d85cf0846ea 100644 --- a/packages/dashbuilder-component-table/package.json +++ b/packages/dashbuilder-component-table/package.json @@ -25,9 +25,7 @@ "@kie-tools-core/patternfly-base": "workspace:*", "@kie-tools/dashbuilder-component-api": "workspace:*", "@patternfly/react-core": "^4.276.6", - "@patternfly/react-table": "^4.112.39", - "react": "^17.0.2", - "react-dom": "^17.0.2" + "@patternfly/react-table": "^4.112.39" }, "devDependencies": { "@babel/core": "^7.16.0", @@ -49,5 +47,9 @@ "webpack-cli": "^4.10.0", "webpack-dev-server": "^4.15.1", "webpack-merge": "^5.9.0" + }, + "peerDependencies": { + "react": ">=17.0.2 <19.0.0", + "react-dom": ">=17.0.2 <19.0.0" } } diff --git a/packages/dashbuilder-component-timeseries/package.json b/packages/dashbuilder-component-timeseries/package.json index 4331be319e0..fe483e5ea1e 100644 --- a/packages/dashbuilder-component-timeseries/package.json +++ b/packages/dashbuilder-component-timeseries/package.json @@ -22,9 +22,7 @@ }, "dependencies": { "@kie-tools/dashbuilder-component-api": "workspace:*", - "@kie-tools/dashbuilder-component-echarts-base": "workspace:*", - "react": "^17.0.2", - "react-dom": "^17.0.2" + "@kie-tools/dashbuilder-component-echarts-base": "workspace:*" }, "devDependencies": { "@babel/core": "^7.16.0", @@ -46,5 +44,9 @@ "webpack-cli": "^4.10.0", "webpack-dev-server": "^4.15.1", "webpack-merge": "^5.9.0" + }, + "peerDependencies": { + "react": ">=17.0.2 <19.0.0", + "react-dom": ">=17.0.2 <19.0.0" } } diff --git a/packages/dashbuilder-component-uniforms/package.json b/packages/dashbuilder-component-uniforms/package.json index 8049b275804..14ebad675aa 100644 --- a/packages/dashbuilder-component-uniforms/package.json +++ b/packages/dashbuilder-component-uniforms/package.json @@ -26,10 +26,10 @@ "@kie-tools/uniforms-patternfly": "workspace:*", "@patternfly/react-core": "^4.276.6", "@patternfly/react-table": "^4.112.39", - "ajv": "^6.12.6", + "ajv": "^8.17.1", + "ajv-draft-04": "^1.0.0", + "ajv-formats": "^3.0.1", "lodash": "^4.17.21", - "react": "^17.0.2", - "react-dom": "^17.0.2", "uniforms": "^3.10.2", "uniforms-bridge-json-schema": "^3.10.2" }, @@ -52,5 +52,9 @@ "webpack-cli": "^4.10.0", "webpack-dev-server": "^4.15.1", "webpack-merge": "^5.9.0" + }, + "peerDependencies": { + "react": ">=17.0.2 <19.0.0", + "react-dom": ">=17.0.2 <19.0.0" } } diff --git a/packages/dashbuilder-component-uniforms/src/Uniforms.tsx b/packages/dashbuilder-component-uniforms/src/Uniforms.tsx index 311ccfb730f..ad9a2979985 100644 --- a/packages/dashbuilder-component-uniforms/src/Uniforms.tsx +++ b/packages/dashbuilder-component-uniforms/src/Uniforms.tsx @@ -16,13 +16,16 @@ * specific language governing permissions and limitations * under the License. */ -import { JSONSchemaBridge } from "uniforms-bridge-json-schema"; -import { AutoForm } from "@kie-tools/uniforms-patternfly/dist/esm"; -import * as Ajv from "ajv"; import * as React from "react"; import { useCallback } from "react"; +import { AutoForm } from "@kie-tools/uniforms-patternfly/dist/esm"; +import AjvDraft04 from "ajv-draft-04"; +import addFormats from "ajv-formats"; +import { JSONSchemaBridge } from "uniforms-bridge-json-schema"; + +const ajv = new AjvDraft04({ strict: false, allErrors: true, useDefaults: true }); +addFormats(ajv); -const ajv = new Ajv({ allErrors: true, useDefaults: true }); const createValidator = (schema: any) => { const validator = ajv.compile(schema); return (model: any) => { diff --git a/packages/dashbuilder-component-victory-charts/package.json b/packages/dashbuilder-component-victory-charts/package.json index 536b206dd9c..aa6ed8d79be 100644 --- a/packages/dashbuilder-component-victory-charts/package.json +++ b/packages/dashbuilder-component-victory-charts/package.json @@ -28,8 +28,6 @@ "@patternfly/react-core": "^4.276.6", "@patternfly/react-table": "^4.112.39", "numeral": "^2.0.6", - "react": "^17.0.2", - "react-dom": "^17.0.2", "victory-zoom-container": "^35.11.4" }, "devDependencies": { @@ -53,5 +51,9 @@ "webpack-cli": "^4.10.0", "webpack-dev-server": "^4.15.1", "webpack-merge": "^5.9.0" + }, + "peerDependencies": { + "react": ">=17.0.2 <19.0.0", + "react-dom": ">=17.0.2 <19.0.0" } } diff --git a/packages/dashbuilder-editor/package.json b/packages/dashbuilder-editor/package.json index 3edcc78d059..fbc13072d76 100644 --- a/packages/dashbuilder-editor/package.json +++ b/packages/dashbuilder-editor/package.json @@ -42,8 +42,6 @@ "json-schema": "^0.4.0", "monaco-editor": "^0.39.0", "monaco-yaml": "^4.0.4", - "react": "^17.0.2", - "react-dom": "^17.0.2", "vscode-languageserver-types": "^3.16.0" }, "devDependencies": { @@ -69,5 +67,9 @@ "webpack-cli": "^4.10.0", "webpack-dev-server": "^4.15.1", "webpack-merge": "^5.9.0" + }, + "peerDependencies": { + "react": ">=17.0.2 <19.0.0", + "react-dom": ">=17.0.2 <19.0.0" } } diff --git a/packages/dashbuilder-viewer/package.json b/packages/dashbuilder-viewer/package.json index e87583a0f35..3e75900133a 100644 --- a/packages/dashbuilder-viewer/package.json +++ b/packages/dashbuilder-viewer/package.json @@ -33,9 +33,7 @@ "@kie-tools-core/patternfly-base": "workspace:*", "@kie-tools-core/workspace": "workspace:*", "@patternfly/react-core": "^4.276.6", - "@patternfly/react-icons": "^4.93.6", - "react": "^17.0.2", - "react-dom": "^17.0.2" + "@patternfly/react-icons": "^4.93.6" }, "devDependencies": { "@babel/core": "^7.16.0", @@ -59,5 +57,9 @@ "webpack-cli": "^4.10.0", "webpack-dev-server": "^4.15.1", "webpack-merge": "^5.9.0" + }, + "peerDependencies": { + "react": ">=17.0.2 <19.0.0", + "react-dom": ">=17.0.2 <19.0.0" } } diff --git a/packages/dashbuilder/LICENSE-Apache-2.0.txt b/packages/dashbuilder/LICENSE-Apache-2.0.txt deleted file mode 100644 index 7a4a3ea2424..00000000000 --- a/packages/dashbuilder/LICENSE-Apache-2.0.txt +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed 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. \ No newline at end of file diff --git a/packages/dashbuilder/appformer/pom.xml b/packages/dashbuilder/appformer/pom.xml index 7de302a7524..aeda6ca062f 100644 --- a/packages/dashbuilder/appformer/pom.xml +++ b/packages/dashbuilder/appformer/pom.xml @@ -91,7 +91,7 @@ https://repository.jboss.org/nexus/content/repositories/snapshots/ - 4.3.5.Final + 4.6.2.Final 1.3.12 diff --git a/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/debug/Debug.java b/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/debug/Debug.java index 4b36717044f..0e5df803083 100644 --- a/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/debug/Debug.java +++ b/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/debug/Debug.java @@ -87,8 +87,7 @@ public static String objectId(Object o) { *
  • the first letter of each component of the package name *
  • a dot *
  • the class name. If the class is an inner class, the name is of the form Outer$Inner - *
      - *

      + *

    * For classes in the default package, items 1 and 2 are omitted. * @param c the class whose name to abbreviate. Can be null, but will result in a null return value. * @return the abbreviated FQCN as described, or null if the input is null. diff --git a/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/mvp/PlaceRequest.java b/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/mvp/PlaceRequest.java index da33758f8ed..62335a09f86 100644 --- a/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/mvp/PlaceRequest.java +++ b/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/mvp/PlaceRequest.java @@ -65,7 +65,7 @@ PlaceRequest addParameter(final String name, void setUpdateLocationBar(boolean updateLocationBar); /** - * Invokes {@link #toString()} but exported to JavaScript so it can be invoked from different scripts. + * Invokes toString() but exported to JavaScript so it can be invoked from different scripts. */ default String asString() { return this.toString(); diff --git a/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/workbench/model/CustomPanelDefinition.java b/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/workbench/model/CustomPanelDefinition.java index 863ea0e391e..20e8d7aa91b 100644 --- a/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/workbench/model/CustomPanelDefinition.java +++ b/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/workbench/model/CustomPanelDefinition.java @@ -25,12 +25,11 @@ import jsinterop.annotations.JsIgnore; import jsinterop.annotations.JsType; import org.jboss.errai.common.client.dom.HTMLElement; -import org.uberfire.mvp.PlaceRequest; /** * A custom {@link PanelDefinition} that is associated with a HasWidgets - * or HTMLElement container. See {@link PlaceManager#goTo(PlaceRequest, HasWidgets)} - * and {@link PlaceManager#goTo(PlaceRequest, HTMLElement)} + * or HTMLElement container. See PlaceManager#goTo(PlaceRequest, HasWidgets) + * and PlaceManager#goTo(PlaceRequest, HTMLElement) */ @JsType public interface CustomPanelDefinition extends PanelDefinition { diff --git a/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/workbench/model/PanelDefinition.java b/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/workbench/model/PanelDefinition.java index b79959bb53d..07bf8d77396 100644 --- a/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/workbench/model/PanelDefinition.java +++ b/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/workbench/model/PanelDefinition.java @@ -61,7 +61,6 @@ public interface PanelDefinition { * Specifies content that should be put in this panel's main display area when it is materialized. The content to * add is specified by a PartDefinition, at the core of which is a {@link PlaceRequest} that identifies a * WorkbenchActivity (either a screen or an editor). - *

    * If the given part already belongs to an existing panel, it will be removed from that panel by a call to * removePart(part). * @param part The Part to add. Must not be null. The part's place must specify a WorkbenchActivity bean. @@ -70,9 +69,8 @@ public interface PanelDefinition { /** * Specifies content that should be put in this panel's main display area when it is materialized. - *

    * This is a convenience method equivalent to - * addPart(new PartDefinitionImpl(DefaultPlaceRequest.parse(partSpec))). + * addPart(new PartDefinitionImpl(DefaultPlaceRequest.parse(partSpec))). * @param partSpec An PlaceRequest ID with optional parameters, encoded as specified in * {@link DefaultPlaceRequest#parse(CharSequence)}. Must not be null. The place ID must specify a * WorkbenchActivity bean (either a screen or an editor). @@ -183,7 +181,7 @@ public void appendChild( /** * Set the height of this panel in pixels using a primitive int to make this method exportable to JS. - * @param width The width to set. + * @param height The height to set. */ default void setHeight(int height) { setHeight(Integer.valueOf(height)); @@ -315,7 +313,7 @@ default int getMinWidthAsInt() { void setContextDisplayMode(final ContextDisplayMode contextDisplayMode); /** - * Invokes {@link #toString()} but exported to JavaScript so it can be invoked from different scripts. + * Invokes toString() but exported to JavaScript so it can be invoked from different scripts. */ default String asString() { return this.toString(); diff --git a/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/workbench/model/PartDefinition.java b/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/workbench/model/PartDefinition.java index 6231e7d8ebf..edce9ca9cc2 100644 --- a/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/workbench/model/PartDefinition.java +++ b/packages/dashbuilder/appformer/uberfire-api/src/main/java/org/uberfire/workbench/model/PartDefinition.java @@ -49,7 +49,7 @@ public interface PartDefinition { void setContextDisplayMode(final ContextDisplayMode contextDisplayMode); /** - * Invokes {@link #toString()} but exported to JavaScript so it can be invoked from different scripts. + * Invokes toString() but exported to JavaScript so it can be invoked from different scripts. */ default String asString() { return this.toString(); diff --git a/packages/dashbuilder/appformer/uberfire-client-api/src/main/java/org/uberfire/client/annotations/WorkbenchPanel.java b/packages/dashbuilder/appformer/uberfire-client-api/src/main/java/org/uberfire/client/annotations/WorkbenchPanel.java index 549715e94c4..06b424f0a10 100644 --- a/packages/dashbuilder/appformer/uberfire-client-api/src/main/java/org/uberfire/client/annotations/WorkbenchPanel.java +++ b/packages/dashbuilder/appformer/uberfire-client-api/src/main/java/org/uberfire/client/annotations/WorkbenchPanel.java @@ -27,7 +27,7 @@ /** * Specifies an UberFire workbench panel within a templated perspective. *

    - *

    Prerequisites

    + * Prerequisites * This annotation can only be used within a class annotated with {@link WorkbenchPerspective}, and it must target a * field that implements the GWT HasWidgets interface. Further, the class this annotation is used in must not have a * method annotated with {@link Perspective}. See {@link WorkbenchPerspective} for details. diff --git a/packages/dashbuilder/appformer/uberfire-client-api/src/main/java/org/uberfire/client/annotations/WorkbenchPerspective.java b/packages/dashbuilder/appformer/uberfire-client-api/src/main/java/org/uberfire/client/annotations/WorkbenchPerspective.java index f5a4efe7229..3b1560f53e0 100644 --- a/packages/dashbuilder/appformer/uberfire-client-api/src/main/java/org/uberfire/client/annotations/WorkbenchPerspective.java +++ b/packages/dashbuilder/appformer/uberfire-client-api/src/main/java/org/uberfire/client/annotations/WorkbenchPerspective.java @@ -35,16 +35,16 @@ * programmatically build a {@link PerspectiveDefinition} object, or declare panel structure and content using Errai UI * templates. Note that you cannot mix the two approaches. *

    - *

    Programmatic Perspective Definition

    + * Programmatic Perspective Definition * To define the perspective layout programmatically, create a zero-argument method annotated with {@code @Perspective} * that returns a {@link PerspectiveDefinition}. *

    - *

    Templated Perspective Definition

    + * Templated Perspective Definition * To declare perspective layout using templates, make the class an Errai UI templated component, and then add the * {@link WorkbenchPanel} annotation to one or more of its {@code @DataField} widgets. This designates them as panel * containers and allows you to specify which parts should be added to them when the perspective launches. *

    - *

    Perspective Lifecycle

    + * Perspective Lifecycle * WorkbenchPerspectives receive the standard set of lifecycle calls for a Workbench component: *
      *
    • {@code @OnStartup}
    • diff --git a/packages/dashbuilder/appformer/uberfire-client-api/src/main/java/org/uberfire/client/annotations/WorkbenchPopup.java b/packages/dashbuilder/appformer/uberfire-client-api/src/main/java/org/uberfire/client/annotations/WorkbenchPopup.java index 3d755fdde0a..fec272c66f4 100644 --- a/packages/dashbuilder/appformer/uberfire-client-api/src/main/java/org/uberfire/client/annotations/WorkbenchPopup.java +++ b/packages/dashbuilder/appformer/uberfire-client-api/src/main/java/org/uberfire/client/annotations/WorkbenchPopup.java @@ -42,11 +42,10 @@ * In this latter case the {@code @WorkbenchPopup} need not extend * {@code com.google.gwt.user.client.ui.PopupPanel}. *

      - *

      * WorkbechPopups can receive the following life-cycle calls: *

        *
      • {@code @OnOpen}
      • - *

        + *
      */ @Inherited @Retention(RetentionPolicy.RUNTIME) diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/popups/BaseModal.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/popups/BaseModal.java index 5511ddce8ee..53e938cf8b8 100644 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/popups/BaseModal.java +++ b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/common/popups/BaseModal.java @@ -44,7 +44,7 @@ /** * Base class for modal popup implementations. Setting the following properties by default: *
        - *
      • setBackdrop( {@link BackdropType#STATIC} );
      • + *
      • setBackdrop( BackdropType#STATIC );
      • *
      • setKeyboard( true );
      • *
      • setAnimation( true );
      • *
      • setDynamicSafe( true );
      • diff --git a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/tables/TitledTextCell.java b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/tables/TitledTextCell.java index f5531c6ebba..43e0ca74d4e 100644 --- a/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/tables/TitledTextCell.java +++ b/packages/dashbuilder/appformer/uberfire-extensions/uberfire-widgets/uberfire-widgets-commons/src/main/java/org/uberfire/ext/widgets/common/client/tables/TitledTextCell.java @@ -47,7 +47,7 @@ public TitledTextCell() { /** * Constructs a TextCell that uses the provided {@link SafeHtmlRenderer} to * render its text. - * @param renderer a {@link SafeHtmlRenderer SafeHtmlRenderer} instance + * @param renderer a {@link SafeHtmlRenderer} instance */ public TitledTextCell(final SafeHtmlRenderer renderer) { super(renderer); diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/tab/TabPanelWithDropdowns.java b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/tab/TabPanelWithDropdowns.java index 821249d09eb..331bcb196cb 100644 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/tab/TabPanelWithDropdowns.java +++ b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client-views-patternfly/src/main/java/org/uberfire/client/views/pfly/tab/TabPanelWithDropdowns.java @@ -273,7 +273,7 @@ void resizeTabContent() { * Adds a new tab to this panel that doesn't have any contents itself, but can contain multiple items that appear in * a dropdown menu when the tab is clicked. This dropdown menu is initially empty. Items can be added and removed * using the {@link DropDownTab#addItem(String, Widget)} and - * {@link DropDownTab#removeItem(String, Widget)} methods. + * DropDownTab#removeItem(String, Widget) methods. * @param label The text that should appear on the dropdown tab. * @return the container for the items that appear when the tab is clicked. */ @@ -298,7 +298,7 @@ public DropDownTab addDropdownTab(String label) { /** * Adds a pre-made dropdown tab to this tab panel. This can be used for re-attaching a dropdown tab that was * previously added with {@link #addDropdownTab(String)} and then removed. - * @param tab the tab to add back + * @param contents contents */ public void addDropdownTab(DropDownTab contents) { AnchorListItem tab = contents.owningTab; diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client/src/main/java/org/uberfire/client/mvp/AbstractActivity.java b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client/src/main/java/org/uberfire/client/mvp/AbstractActivity.java index fb566779715..52beae30722 100644 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client/src/main/java/org/uberfire/client/mvp/AbstractActivity.java +++ b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client/src/main/java/org/uberfire/client/mvp/AbstractActivity.java @@ -41,7 +41,7 @@ public abstract class AbstractActivity implements Activity { } /** - * Tracks start/shutdown lifecycle. Subclasses should always call super.onStartup() in methods that + * Tracks start/shutdown lifecycle. Subclasses should always call super.onStartup() in methods that * override this one. */ @Override @@ -51,7 +51,7 @@ public void onStartup(PlaceRequest place) { } /** - * Tracks open/closed lifecycle. Subclasses should always call super.onOpen() in methods that override this + * Tracks open/closed lifecycle. Subclasses should always call super.onOpen() in methods that override this * one. */ @Override @@ -67,7 +67,7 @@ public void onOpen() { } /** - * Tracks open/closed lifecycle. Subclasses should always call super.onClose() in methods that override + * Tracks open/closed lifecycle. Subclasses should always call super.onClose() in methods that override * this one. */ @Override @@ -83,7 +83,7 @@ public void onClose() { } /** - * Tracks start/shutdown lifecycle. Subclasses should always call super.onShutdown() in methods that + * Tracks start/shutdown lifecycle. Subclasses should always call super.onShutdown() in methods that * override this one. */ @Override diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client/src/main/java/org/uberfire/client/mvp/Activity.java b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client/src/main/java/org/uberfire/client/mvp/Activity.java index 4e202dcaa56..237b7a3d584 100644 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client/src/main/java/org/uberfire/client/mvp/Activity.java +++ b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client/src/main/java/org/uberfire/client/mvp/Activity.java @@ -31,15 +31,15 @@ * see the subinterfaces for specific activity types that do get implemented. *

        * Also, implementations of this interface and its subinterfaces are typically not written by hand; instead, they are - * generated from classes annotated with {@link WorkbenchScreen}, {@link WorkbenchEditor}, {@link WorkbenchPopup}, and + * generated from classes annotated with {@link WorkbenchScreen}, {@link WorkbenchPopup}, and * others by an UberFire annotation processor. - *

        + *

        * Developers of UberFire applications will not typically come into direct contact with things that implement Activity * or its subinterfaces; instead, they will work with a {@link PlaceManager} to manipulate activities at arm's length. *

        * If you do need to get your hands on a particular {@code Activity} instance, do so using an {@link ActivityManager}. - *

        - *

        Activity Lifecycle

        + *

        + * Activity Lifecycle * Activities have the following lifecycle, which is normally driven by an {@link ActivityManager}: *
          *
        1. The activity starts off in the uninitialized state. @@ -56,7 +56,7 @@ *

          * An activity will never receive a call to {@link #onStartup(PlaceRequest)} when it is started or open, but it may be * restarted (perhaps with a different PlaceRequest) after a call to {@link #onShutdown()}. - *

          + *

          * An activity will never receive a call to {@link #onOpen()} when it is uninitialized or open, but it may be reopened after a call * to {@link #onClose()}. * @see PlaceManager diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client/src/main/java/org/uberfire/client/mvp/ActivityManager.java b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client/src/main/java/org/uberfire/client/mvp/ActivityManager.java index c3990b2528a..df5cbd6a58d 100644 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client/src/main/java/org/uberfire/client/mvp/ActivityManager.java +++ b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client/src/main/java/org/uberfire/client/mvp/ActivityManager.java @@ -53,7 +53,7 @@ public interface ActivityManager { * certain path, the returned set can contain any number of activities. * @param placeRequest the PlaceRequest to resolve activities for. Although null is permitted for convenience, it always * resolves to the empty set. - * @param secure flag indicating if calls to the {@link AuthorizationManager} service are required in order to + * @param secure flag indicating if calls to the AuthorizationManager service are required in order to * determine which activities are available. * @return an unmodifiable set of activities that can handle the given PlaceRequest. Never null, but can be empty. * To prevent memory leaks, pass Activity in the returned set to {@link #destroyActivity(Activity)} when you @@ -81,7 +81,7 @@ Set getActivities(final PlaceRequest placeRequest, /** * Finds an activity that can handle the given PlaceRequest, creating and starting a new one if necessary. * @param placeRequest the place the resolved activity should handle - * @param secure flag indicating if calls to the {@link AuthorizationManager} service are required in order to + * @param secure flag indicating if calls to the AuthorizationManager service are required in order to * determine if the resulting activity is available. * @return an activity that can handle the request, or null if no known activity can handle it. If the return value * is non-null, it will be an activity in the started or open state. @@ -102,7 +102,7 @@ T getActivity(final Class clazz, * to use {@link #getActivities(PlaceRequest, boolean)} and cast its return value explicitly. * @param clazz the type of activity that you expect to find. * @param placeRequest the place the resolved activity should handle - * @param secure flag indicating if calls to the {@link AuthorizationManager} service are required in order to + * @param secure flag indicating if calls to the AuthorizationManager service are required in order to * determine if the resulting activity is available. * @return an activity that can handle the request, or null if no known activity can handle it. If the return value * is non-null, it will be an activity in the started or open state. diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client/src/main/java/org/uberfire/client/mvp/PerspectiveManager.java b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client/src/main/java/org/uberfire/client/mvp/PerspectiveManager.java index 18bc5f4139a..9e5f0ccb371 100644 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client/src/main/java/org/uberfire/client/mvp/PerspectiveManager.java +++ b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client/src/main/java/org/uberfire/client/mvp/PerspectiveManager.java @@ -36,7 +36,6 @@ * perspective, and switching between perspectives. This includes a sequence of asynchronous operations such as fetching * any stored definition the current user has for the new perspective, and saving the definition when the user has * modified it (for example, by dragging and dropping components, launching new activities, and so on). - *

          * Structurally, the PerspectiveManager performs actions at the request of the {@link PlaceManager}, and it accomplishes * these actions by delegating to the {@link PanelManager} and {@link WorkbenchServicesProxy}. */ @@ -67,7 +66,6 @@ public interface PerspectiveManager { /** * This method should only be invoked by PlaceManager. To launch a perspective within an UberFire app, pass a * PlaceRequest for that perspective to {@link PlaceManager#goTo(org.uberfire.mvp.PlaceRequest)}. - *

          * Closes all current panels in the PanelManager (they must have already had their parts removed), then builds up * the new panel arrangement based on the {@link PerspectiveDefinition} associated with the given perspective * activity. If the given perspective is transient, its default perspective definition will always be used. @@ -76,7 +74,6 @@ public interface PerspectiveManager { * @param placeRequest the placeRequest that originated the perspective to switch to. Must not be null. * @param perspective the perspective to switch to. Must not be null. * @param doWhenFinished The command to execute once the new perspective's panels have been created. Must not be null. - *

          * When the callback is invoked, the panels will be set up in their correct positions, but no parts will * have been added. */ diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client/src/main/java/org/uberfire/client/mvp/PlaceManager.java b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client/src/main/java/org/uberfire/client/mvp/PlaceManager.java index 5f27a666a89..b048983d9b6 100644 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client/src/main/java/org/uberfire/client/mvp/PlaceManager.java +++ b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client/src/main/java/org/uberfire/client/mvp/PlaceManager.java @@ -37,8 +37,8 @@ /** * A Workbench-centric abstraction over the browser's history mechanism. Allows the application to initiate navigation * to any displayable thing: a {@link WorkbenchPerspective}, a {@link WorkbenchScreen}, a {@link WorkbenchPopup}, a - * a {@link WorkbenchPart} within a screen or editor, or the editor associated with a VFS file - * located at a particular {@link Path}. + * a WorkbenchPart within a screen or editor, or the editor associated with a VFS file + * located at a particular Path. */ @JsType public interface PlaceManager { @@ -61,7 +61,7 @@ void goTo(final PlaceRequest place, /** * Finds the currently open activity that handles the given PlaceRequest by ID. No attempt is made to match - * by path, but see {@link ActivityManagerImpl#resolveExistingParts(PlaceRequest)} for a variant that does. + * by path, but see ActivityManagerImpl#resolveExistingParts(PlaceRequest) for a variant that does. * * @param place the PlaceRequest whose activity to search for * @return the activity that currently exists in service of the given PlaceRequest's ID. Null if no current activity diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client/src/main/java/org/uberfire/client/mvp/PlaceManagerImpl.java b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client/src/main/java/org/uberfire/client/mvp/PlaceManagerImpl.java index d36815d81b3..57121979850 100644 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client/src/main/java/org/uberfire/client/mvp/PlaceManagerImpl.java +++ b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client/src/main/java/org/uberfire/client/mvp/PlaceManagerImpl.java @@ -283,7 +283,7 @@ private boolean closePlaces(final Collection placeRequests) { /** * Resolves the given place request into an Activity instance, if one can be found. If not, this method substitutes * special "not found" or "too many" place requests when the resolution doesn't work. - *

          + *

          * The behaviour of this method is affected by the boolean-valued * {@code org.uberfire.client.mvp.PlaceManagerImpl.ignoreUnkownPlaces} property in {@link UberfirePreferences}. * @param place A non-null place request that could have originated from within application code, from within the diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client/src/main/java/org/uberfire/client/workbench/AlternativeLayout.java b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client/src/main/java/org/uberfire/client/workbench/AlternativeLayout.java index cc524aa6683..f2171bb6ee4 100644 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client/src/main/java/org/uberfire/client/workbench/AlternativeLayout.java +++ b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client/src/main/java/org/uberfire/client/workbench/AlternativeLayout.java @@ -32,7 +32,7 @@ /** * Part of the worbench layout SPI. Used to declare {@link org.uberfire.client.workbench.WorkbenchLayout} - * implementations, that should be used as an alternative to the default {@link org.uberfire.client.workbench.WorkbenchLayoutImpl}.

          + * implementations, that should be used as an alternative to the default {@link org.uberfire.client.workbench.WorkbenchLayoutImpl}. * The actual discovery mechenism resides with {@link org.uberfire.client.workbench.LayoutSelection} */ @Qualifier diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client/src/main/java/org/uberfire/client/workbench/BeanFactory.java b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client/src/main/java/org/uberfire/client/workbench/BeanFactory.java index 96bebd1678b..d45a5b449d4 100644 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client/src/main/java/org/uberfire/client/workbench/BeanFactory.java +++ b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client/src/main/java/org/uberfire/client/workbench/BeanFactory.java @@ -35,11 +35,9 @@ public interface BeanFactory { /** * Creates a new part presenter/view pair with the given properties. - * @param menus The menus to associate with the new part. Null means no menus. * @param title The title to associate with the new part that the containing panel may display * @param titleDecoration The title decoration that a panel may choose to display beside the part's title. Null is permitted, * and means no title decoration. - *

          * NOTE: presently, none of the built-in panel types display a part's title decoration. * @param definition Defines all other aspects of the part to create. Must not be null. * @param partType The new part type. @@ -72,10 +70,10 @@ public WorkbenchPanelPresenter newRootPanel(PerspectiveActivity activity, public CompassDropController newDropController(final WorkbenchPanelView view); /** - * Destroys the entire graph of beans that were created and returned via a call to any of the newXXX() + * Destroys the entire graph of beans that were created and returned via a call to any of the newXXX() * methods in this class. For example, passing a {@link WorkbenchPartPresenter} instance in will result in the * destruction of that presenter, its view, and all other dependent beans injected into that graph of objects. - * @param o a bean which was returned from one of the newXXX() methods in this class and which has not + * @param o a bean which was returned from one of the newXXX() methods in this class and which has not * been destroyed yet. */ public void destroy(final Object o); diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client/src/main/java/org/uberfire/client/workbench/PanelManager.java b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client/src/main/java/org/uberfire/client/workbench/PanelManager.java index e8d3fc74953..5f47b4084ab 100644 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client/src/main/java/org/uberfire/client/workbench/PanelManager.java +++ b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client/src/main/java/org/uberfire/client/workbench/PanelManager.java @@ -58,7 +58,6 @@ public interface PanelManager { * @param part The description of the part to add. Not null. * @param panel definition of the panel to add the part to (must describe a panel that is already present in the * layout). Not null. - * @param menus The menus to display for the given part. Null means no menus. * @param uiPart The part's title and physical view. Not null. * @param contextId part of a removed framework feature (TODO: remove this?) * @param minInitialWidth minimum pixel width of the part's activity, or null if there is no known minimum width. The target @@ -108,7 +107,7 @@ PanelDefinition addWorkbenchPanel(final PanelDefinition targetPanel, /** * Creates an UberFire panel and installs its view in the given widget container. *

          - *

          Custom Panel Lifecycle

          + * Custom Panel Lifecycle *

          * Custom panels can be disposed like any other panel: by calling {@link #removeWorkbenchPanel(PanelDefinition)}. * Additionally, custom panels are monitored for DOM detachment. When a custom panel's view is removed from the DOM @@ -124,7 +123,7 @@ CustomPanelDefinition addCustomPanel(HasWidgets container, /** * Creates an UberFire panel and installs its view in the given html element container. *

          - *

          Custom Panel Lifecycle

          + * Custom Panel Lifecycle *

          * Custom panels can be disposed like any other panel: by calling {@link #removeWorkbenchPanel(PanelDefinition)}. * Additionally, custom panels are monitored for DOM detachment. When a custom panel's view is removed from the DOM @@ -140,7 +139,7 @@ CustomPanelDefinition addCustomPanel(HTMLElement container, /** * Creates an UberFire panel and installs its view in the given html element container. *

          - *

          Custom Panel Lifecycle

          + * Custom Panel Lifecycle *

          * Custom panels can be disposed like any other panel: by calling {@link #removeWorkbenchPanel(PanelDefinition)}. * Additionally, custom panels are monitored for DOM detachment. When a custom panel's view is removed from the DOM @@ -184,7 +183,7 @@ CustomPanelDefinition addCustomPanel(elemental2.dom.HTMLElement container, void onPanelFocus(final PanelDefinition panel); /** - * Closes the given part. This is a convenience method for placeManager.closePlace(part.getPlace()). + * Closes the given part. This is a convenience method for placeManager.closePlace(part.getPlace()). * @param part the part to close (remove from the GUI). Must not be null. */ void closePart(final PartDefinition part); diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client/src/main/java/org/uberfire/client/workbench/WorkbenchLayout.java b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client/src/main/java/org/uberfire/client/workbench/WorkbenchLayout.java index 11abe20fe2c..a72c9776060 100644 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client/src/main/java/org/uberfire/client/workbench/WorkbenchLayout.java +++ b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client/src/main/java/org/uberfire/client/workbench/WorkbenchLayout.java @@ -49,7 +49,6 @@ public interface WorkbenchLayout { /** * Will be invoked by the {@link org.uberfire.client.workbench.Workbench} * when the discovery of header and footer elements is completed. - * @see {@link #setFooterContents(java.util.List)} */ public void onBootstrap(); @@ -71,7 +70,6 @@ void resizeTo(int width, /** * Makes the given widget fill the entire space normally dedicated to the perspective container. Has no effect if * the given widget is already maximized. - *

          * Important: this feature is used by panels to maximize themselves. You should not pass a WorkbenchPanelView * to this method yourself; instead, you should use the panel's own API to maximize it. You are free to use this method * to maximize your own widgets that are not workbench panels. @@ -82,7 +80,6 @@ void resizeTo(int width, /** * Makes the given widget fill the entire space normally dedicated to the perspective container. Has no effect if * the given widget is already maximized. - *

          * Important: this feature is used by panels to maximize themselves. You should not pass a WorkbenchPanelView * to this method yourself; instead, you should use the panel's own API to maximize it. You are free to use this method * to maximize your own widgets that are not workbench panels. @@ -95,7 +92,6 @@ void maximize(Widget w, /** * Restores a previously maximized widget to its original size and position. Has no effect if the given widget is * not currently in a maximized state set up by {@link #maximize(Widget)}. - *

          * Important: this feature is used by panels to unmaximize themselves. You should not pass a WorkbenchPanelView * to this method yourself; instead, you should use the panel's own API to unmaximize it. You are free to use this method * to unmaximize your own widgets that have previously been passed to {@link #maximize(Widget)}. @@ -106,7 +102,6 @@ void maximize(Widget w, /** * Restores a previously maximized widget to its original size and position. Has no effect if the given widget is * not currently in a maximized state set up by {@link #maximize(Widget)}. - *

          * Important: this feature is used by panels to unmaximize themselves. You should not pass a WorkbenchPanelView * to this method yourself; instead, you should use the panel's own API to unmaximize it. You are free to use this method * to unmaximize your own widgets that have previously been passed to {@link #maximize(Widget)}. @@ -118,7 +113,6 @@ void unmaximize(Widget w, /** * Will insert the implementations of Header and Footer in the Workbench - * @see {@link #setFooterContents(java.util.List)} */ void setMarginWidgets(boolean isStandaloneMode, Set headersToKeep); diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client/src/main/java/org/uberfire/client/workbench/widgets/listbar/ResizeFlowPanel.java b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client/src/main/java/org/uberfire/client/workbench/widgets/listbar/ResizeFlowPanel.java index 9ce81c0f476..3ca7207283c 100644 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client/src/main/java/org/uberfire/client/workbench/widgets/listbar/ResizeFlowPanel.java +++ b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client/src/main/java/org/uberfire/client/workbench/widgets/listbar/ResizeFlowPanel.java @@ -28,7 +28,7 @@ /** * A FlowPanel that can exist in a hierarchy of {@link LayoutPanel}s. Behaves exactly like FlowPanel, but also - * propagates onResize events to the child widgets. + * propagates onResize events to the child widgets. */ public class ResizeFlowPanel extends FlowPanel implements RequiresResize, ProvidesResize { diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client/src/main/java/org/uberfire/client/workbench/widgets/listbar/ResizeFocusPanel.java b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client/src/main/java/org/uberfire/client/workbench/widgets/listbar/ResizeFocusPanel.java index d65d27fb968..98c01c94514 100644 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client/src/main/java/org/uberfire/client/workbench/widgets/listbar/ResizeFocusPanel.java +++ b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client/src/main/java/org/uberfire/client/workbench/widgets/listbar/ResizeFocusPanel.java @@ -29,7 +29,7 @@ /** * A FocusPanel that can exist in a hierarchy of {@link LayoutPanel}s. Behaves exactly like FocusPanel, but also - * propagates onResize events to the child widget. + * propagates >onResize events to the child widget. */ public class ResizeFocusPanel extends FocusPanel implements RequiresResize, ProvidesResize { diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client/src/main/java/org/uberfire/client/workbench/widgets/split/WorkbenchSplitLayoutPanel.java b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client/src/main/java/org/uberfire/client/workbench/widgets/split/WorkbenchSplitLayoutPanel.java index b15e83ac56a..880efcfcab0 100644 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client/src/main/java/org/uberfire/client/workbench/widgets/split/WorkbenchSplitLayoutPanel.java +++ b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client/src/main/java/org/uberfire/client/workbench/widgets/split/WorkbenchSplitLayoutPanel.java @@ -42,12 +42,10 @@ /** * A panel that adds user-positioned splitters between each of its child * widgets. - *

          * This is a fork of the standard SplitLayoutPanel with the following changes:- *

            *
          1. http://code.google.com/p/google-web-toolkit/issues/detail?id=7135
          2. *
          - *

          *

          * This panel is used in the same way as {@link DockLayoutPanel}, except that * its children's sizes are always specified in {@link Unit#PX} units, and each @@ -58,7 +56,7 @@ * the HTML page in which it is run have an explicit <!DOCTYPE> * declaration. *

          - *

          CSS Style Rules

          + * CSS Style Rules *
            *
          • .gwt-SplitLayoutPanel { the panel itself }
          • *
          • .gwt-SplitLayoutPanel .gwt-SplitLayoutPanel-HDragger { horizontal dragger @@ -67,7 +65,7 @@ *
          • *
          *

          - *

          Example

          {@example com.google.gwt.examples.SplitLayoutPanelExample} + * Example com.google.gwt.examples.SplitLayoutPanelExample *

          */ public class WorkbenchSplitLayoutPanel extends DockLayoutPanel { diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client/src/test/java/org/uberfire/client/workbench/PanelManagerTest.java b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client/src/test/java/org/uberfire/client/workbench/PanelManagerTest.java index 2e84a9e470f..1e074adb330 100644 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client/src/test/java/org/uberfire/client/workbench/PanelManagerTest.java +++ b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client/src/test/java/org/uberfire/client/workbench/PanelManagerTest.java @@ -112,7 +112,7 @@ public class PanelManagerTest { private PerspectiveDefinition testPerspectiveDef; /** - * This is the Panel Presenter returned by the mock BeanFactory when asked for newWorkbenchPanel( testPerspectiveDef.getRoot() ) ). + * This is the Panel Presenter returned by the mock BeanFactory when asked for newWorkbenchPanel( testPerspectiveDef.getRoot() ) ). */ private WorkbenchPanelPresenter testPerspectiveRootPanelPresenter; diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client/src/test/java/org/uberfire/client/workbench/panels/impl/PlaceManagerTest.java b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client/src/test/java/org/uberfire/client/workbench/panels/impl/PlaceManagerTest.java index f0de32bdb08..588d92d9c3f 100644 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client/src/test/java/org/uberfire/client/workbench/panels/impl/PlaceManagerTest.java +++ b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-client/src/test/java/org/uberfire/client/workbench/panels/impl/PlaceManagerTest.java @@ -994,7 +994,7 @@ private void verifyPlaceNotClosed(final PlaceRequest place, /** * Verifies that all the expected side effects of a screen or editor activity launch have happened. * @param placeRequest The place request that was passed to some variant of PlaceManager.goTo(). - * @param activity A Mockito mock of the activity that was resolved for placeRequest. + * @param activity A Mockito mock of the activity that was resolved for placeRequest. */ private void verifyActivityLaunchSideEffects(PlaceRequest placeRequest, WorkbenchActivity activity, @@ -1065,7 +1065,7 @@ private void verifyActivityLaunchSideEffects(PlaceRequest placeRequest, /** * Verifies that the "place change" side effects have not happened, and that the given activity is still current. * @param expectedCurrentPlace The place request that placeManager should still consider "current." - * @param activity A Mockito mock of the activity tied to expectedCurrentPlace. + * @param activity A Mockito mock of the activity tied to expectedCurrentPlace. */ private void verifyNoActivityLaunchSideEffects(PlaceRequest expectedCurrentPlace, WorkbenchScreenActivity activity) { diff --git a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-processors/src/main/java/org/uberfire/annotations/processors/GeneratorUtils.java b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-processors/src/main/java/org/uberfire/annotations/processors/GeneratorUtils.java index b09cf3d58a1..f1c887cf240 100644 --- a/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-processors/src/main/java/org/uberfire/annotations/processors/GeneratorUtils.java +++ b/packages/dashbuilder/appformer/uberfire-workbench/uberfire-workbench-processors/src/main/java/org/uberfire/annotations/processors/GeneratorUtils.java @@ -76,7 +76,6 @@ public class GeneratorUtils { * Finds the {@code @OnStartup} method suitable for workbench classes that are not {@code @WorkbenchEditor}. * The method must be public, non-static, have a return-type of void and either take zero parameters or one * parameter of type {@code PlaceRequest}. - *

          * If no such method is found, returns null. If methods annotated with {@code @OnStartup} are found but they do not * satisfy all the requirements, they are marked with errors explaining the problem. */ @@ -171,7 +170,6 @@ public static ExecutableElement getGetPreviewMethodName(TypeElement classElement * Finds the {@code @OnStartup} method suitable for {@code @WorkbenchEditor} classes. * The method must be public, non-static, have a return-type of void and either take one parameter * of type {@code Path} or two parameters of type {@code (Path, PlaceRequest)}. - *

          * If no such method is found, returns null. If methods annotated with {@code @OnStartup} are found but they do not * satisfy all the requirements, they are marked with errors explaining the problem. */ diff --git a/packages/dashbuilder/dashbuilder-client/dashbuilder-dataset-client/src/main/java/org/dashbuilder/dataset/client/DataSetClientServices.java b/packages/dashbuilder/dashbuilder-client/dashbuilder-dataset-client/src/main/java/org/dashbuilder/dataset/client/DataSetClientServices.java index 23dd13352b8..76c9a35010c 100644 --- a/packages/dashbuilder/dashbuilder-client/dashbuilder-dataset-client/src/main/java/org/dashbuilder/dataset/client/DataSetClientServices.java +++ b/packages/dashbuilder/dashbuilder-client/dashbuilder-dataset-client/src/main/java/org/dashbuilder/dataset/client/DataSetClientServices.java @@ -79,7 +79,6 @@ void exportDataSetExcel(final DataSetLookup request, * Creates a brand new data set definition for the provider type specified * * @param type The provider type - * @return A data set definition instance */ void newDataSet(DataSetProviderType type, RemoteCallback callback) throws Exception; diff --git a/packages/dashbuilder/dashbuilder-client/dashbuilder-dataset-client/src/main/java/org/dashbuilder/dataset/client/DataSetClientServicesImpl.java b/packages/dashbuilder/dashbuilder-client/dashbuilder-dataset-client/src/main/java/org/dashbuilder/dataset/client/DataSetClientServicesImpl.java index b2ac0d2938b..c2aa85d9412 100644 --- a/packages/dashbuilder/dashbuilder-client/dashbuilder-dataset-client/src/main/java/org/dashbuilder/dataset/client/DataSetClientServicesImpl.java +++ b/packages/dashbuilder/dashbuilder-client/dashbuilder-dataset-client/src/main/java/org/dashbuilder/dataset/client/DataSetClientServicesImpl.java @@ -212,7 +212,6 @@ public void exportDataSetExcel(final DataSetLookup request, * Creates a brand new data set definition for the provider type specified * * @param type The provider type - * @return A data set definition instance */ public void newDataSet(DataSetProviderType type, RemoteCallback callback) throws Exception { diff --git a/packages/dashbuilder/dashbuilder-client/dashbuilder-displayer-client/src/main/java/org/dashbuilder/displayer/client/AbstractDisplayer.java b/packages/dashbuilder/dashbuilder-client/dashbuilder-displayer-client/src/main/java/org/dashbuilder/displayer/client/AbstractDisplayer.java index 8c1cf445569..d275005ff28 100644 --- a/packages/dashbuilder/dashbuilder-client/dashbuilder-displayer-client/src/main/java/org/dashbuilder/displayer/client/AbstractDisplayer.java +++ b/packages/dashbuilder/dashbuilder-client/dashbuilder-displayer-client/src/main/java/org/dashbuilder/displayer/client/AbstractDisplayer.java @@ -58,7 +58,7 @@ * Base class for implementing custom displayers. *

          Any derived class must implement: *

            - *
          • The draw(), redraw() & close() methods.
          • + *
          • The draw(), redraw() and close() methods.
          • *
          • The capture of events coming from the DisplayerListener interface.
          • *
          */ diff --git a/packages/dashbuilder/dashbuilder-client/dashbuilder-displayer-client/src/main/java/org/dashbuilder/displayer/client/Displayer.java b/packages/dashbuilder/dashbuilder-client/dashbuilder-displayer-client/src/main/java/org/dashbuilder/displayer/client/Displayer.java index b75f830fdbd..9a808c3546d 100644 --- a/packages/dashbuilder/dashbuilder-client/dashbuilder-displayer-client/src/main/java/org/dashbuilder/displayer/client/Displayer.java +++ b/packages/dashbuilder/dashbuilder-client/dashbuilder-displayer-client/src/main/java/org/dashbuilder/displayer/client/Displayer.java @@ -70,7 +70,7 @@ public interface Displayer extends DisplayerListener, IsWidget { /** * Same as draw but does not necessary implies to repaint everything again. - * It's just a matter of update & display the latest data set changes. + * It's just a matter of update and display the latest data set changes. */ void redraw(); diff --git a/packages/dashbuilder/dashbuilder-client/dashbuilder-displayer-client/src/main/java/org/dashbuilder/displayer/client/RendererLibrary.java b/packages/dashbuilder/dashbuilder-client/dashbuilder-displayer-client/src/main/java/org/dashbuilder/displayer/client/RendererLibrary.java index 23fd1b121fa..b0f5d923750 100644 --- a/packages/dashbuilder/dashbuilder-client/dashbuilder-displayer-client/src/main/java/org/dashbuilder/displayer/client/RendererLibrary.java +++ b/packages/dashbuilder/dashbuilder-client/dashbuilder-displayer-client/src/main/java/org/dashbuilder/displayer/client/RendererLibrary.java @@ -31,7 +31,7 @@ *

          A renderer library must:

          *
            *
          • Perform all the required initializations before any displayer can be drawn
          • - *
          • Declare the displayer types & subtypes supported
          • + *
          • Declare the displayer types and subtypes supported
          • *
          • Take care of the initialization of displayer instances
          • *
          */ diff --git a/packages/dashbuilder/dashbuilder-client/dashbuilder-renderers/dashbuilder-renderer-default/src/main/java/org/dashbuilder/renderer/client/table/TableDisplayerView.java b/packages/dashbuilder/dashbuilder-client/dashbuilder-renderers/dashbuilder-renderer-default/src/main/java/org/dashbuilder/renderer/client/table/TableDisplayerView.java index 91977de216d..ce3f81cec4b 100644 --- a/packages/dashbuilder/dashbuilder-client/dashbuilder-renderers/dashbuilder-renderer-default/src/main/java/org/dashbuilder/renderer/client/table/TableDisplayerView.java +++ b/packages/dashbuilder/dashbuilder-client/dashbuilder-renderers/dashbuilder-renderer-default/src/main/java/org/dashbuilder/renderer/client/table/TableDisplayerView.java @@ -300,7 +300,7 @@ protected List getCurrentPageRows(HasData display) { } /** - * Both filter & sort invoke this method from redraw() + * Both filter and sort invoke this method from redraw() */ public void gotoFirstPage() { // Avoid fetching the data set again diff --git a/packages/dashbuilder/dashbuilder-shared/dashbuilder-displayer-api/src/main/java/org/dashbuilder/displayer/DisplayerSettingsBuilder.java b/packages/dashbuilder/dashbuilder-shared/dashbuilder-displayer-api/src/main/java/org/dashbuilder/displayer/DisplayerSettingsBuilder.java index 18a4a6ceb2c..821e32abe5e 100644 --- a/packages/dashbuilder/dashbuilder-shared/dashbuilder-displayer-api/src/main/java/org/dashbuilder/displayer/DisplayerSettingsBuilder.java +++ b/packages/dashbuilder/dashbuilder-shared/dashbuilder-displayer-api/src/main/java/org/dashbuilder/displayer/DisplayerSettingsBuilder.java @@ -50,7 +50,7 @@ public interface DisplayerSettingsBuilder extends DataSetLookupBuilder { /** * Set a direct reference to the source data set that will be used by the Displayer that is being assembled. - *

          When using this dataset provided mode the data set lookup operations set (if any): filter, group & sort will not be taking into account). + *

          When using this dataset provided mode the data set lookup operations set (if any): filter, group and sort will not be taking into account). * * @return The DisplayerSettingsBuilder instance that is being used to configure a DisplayerSettings. * @see org.dashbuilder.dataset.DataSet @@ -127,7 +127,7 @@ public interface DisplayerSettingsBuilder extends DataSetLookupBuilder { /** * Force the displayer to redraw every time interval. * - * @param seconds The refresh time frame in seconds. If < 0 then periodic refresh is disabled. + * @param seconds The refresh time frame in seconds. if < 0 then periodic refresh is disabled. * @param onStale Refresh when the data becomes stale. * * @return The DisplayerSettingsBuilder instance that is being used to configure a DisplayerSettings. diff --git a/packages/dashbuilder/kie-soup-dataset/kie-soup-dataset-api/src/main/java/org/dashbuilder/dataprovider/DataSetProvider.java b/packages/dashbuilder/kie-soup-dataset/kie-soup-dataset-api/src/main/java/org/dashbuilder/dataprovider/DataSetProvider.java index 4220399e9a7..f2b82119bd4 100644 --- a/packages/dashbuilder/kie-soup-dataset/kie-soup-dataset-api/src/main/java/org/dashbuilder/dataprovider/DataSetProvider.java +++ b/packages/dashbuilder/kie-soup-dataset/kie-soup-dataset-api/src/main/java/org/dashbuilder/dataprovider/DataSetProvider.java @@ -26,7 +26,7 @@ /** * This service provider interface is designed to provide access to different data set storage implementations with - * the main goal of providing a unified interface for the data set fetch & lookup operations. + * the main goal of providing a unified interface for the data set fetch and lookup operations. */ public interface DataSetProvider { diff --git a/packages/dashbuilder/kie-soup-dataset/kie-soup-dataset-api/src/main/java/org/dashbuilder/dataset/DataColumn.java b/packages/dashbuilder/kie-soup-dataset/kie-soup-dataset-api/src/main/java/org/dashbuilder/dataset/DataColumn.java index 7b7ab9e6337..6e4e7201d0e 100644 --- a/packages/dashbuilder/kie-soup-dataset/kie-soup-dataset-api/src/main/java/org/dashbuilder/dataset/DataColumn.java +++ b/packages/dashbuilder/kie-soup-dataset/kie-soup-dataset-api/src/main/java/org/dashbuilder/dataset/DataColumn.java @@ -100,7 +100,7 @@ public interface DataColumn { DataColumn cloneEmpty(); /** - * Clone the column entirely (definition & values). + * Clone the column entirely (definition and values). */ DataColumn cloneInstance(); } diff --git a/packages/dashbuilder/kie-soup-dataset/kie-soup-dataset-api/src/main/java/org/dashbuilder/dataset/DataSetGenerator.java b/packages/dashbuilder/kie-soup-dataset/kie-soup-dataset-api/src/main/java/org/dashbuilder/dataset/DataSetGenerator.java index cde9c9b3cb8..c05fdf5e677 100644 --- a/packages/dashbuilder/kie-soup-dataset/kie-soup-dataset-api/src/main/java/org/dashbuilder/dataset/DataSetGenerator.java +++ b/packages/dashbuilder/kie-soup-dataset/kie-soup-dataset-api/src/main/java/org/dashbuilder/dataset/DataSetGenerator.java @@ -29,7 +29,7 @@ public interface DataSetGenerator { /** * Build and get a DataSet instance. * - * @params A map of parameters to be passed through the generator. + * @param params A map of parameters to be passed through the generator. */ DataSet buildDataSet(Map params); } \ No newline at end of file diff --git a/packages/dashbuilder/kie-soup-dataset/kie-soup-dataset-api/src/main/java/org/dashbuilder/dataset/date/TimeAmount.java b/packages/dashbuilder/kie-soup-dataset/kie-soup-dataset-api/src/main/java/org/dashbuilder/dataset/date/TimeAmount.java index 6750cf93b90..d4d5c231eba 100644 --- a/packages/dashbuilder/kie-soup-dataset/kie-soup-dataset-api/src/main/java/org/dashbuilder/dataset/date/TimeAmount.java +++ b/packages/dashbuilder/kie-soup-dataset/kie-soup-dataset-api/src/main/java/org/dashbuilder/dataset/date/TimeAmount.java @@ -30,7 +30,6 @@ *

        2. -1year
        3. *
        4. +2quarter
        5. *
      - *

      */ public class TimeAmount { diff --git a/packages/dashbuilder/kie-soup-dataset/kie-soup-dataset-api/src/main/java/org/dashbuilder/dataset/date/TimeFrame.java b/packages/dashbuilder/kie-soup-dataset/kie-soup-dataset-api/src/main/java/org/dashbuilder/dataset/date/TimeFrame.java index 921f8c2e16e..c9f87654074 100644 --- a/packages/dashbuilder/kie-soup-dataset/kie-soup-dataset-api/src/main/java/org/dashbuilder/dataset/date/TimeFrame.java +++ b/packages/dashbuilder/kie-soup-dataset/kie-soup-dataset-api/src/main/java/org/dashbuilder/dataset/date/TimeFrame.java @@ -21,7 +21,7 @@ /** * A time frame defines a time period between two time instants where these two instants depends on the current time. - *

      Some examples of time frame expressions are: + *

      Some examples of time frame expressions are:

      *
        *
      • "now till 10second" => next 10 seconds
      • *
      • "begin[minute] till 10second" => first 10 seconds of current minute
      • @@ -34,7 +34,6 @@ *
      • "end[year March] +2quarter till 1quarter" => 3rd quarter of next year
      • *
      • "begin[year March] -7day till begin[year March]" => Last week of last year
      • *
      - *

      */ public class TimeFrame { diff --git a/packages/dashbuilder/kie-soup-dataset/kie-soup-dataset-api/src/main/java/org/dashbuilder/dataset/date/TimeInstant.java b/packages/dashbuilder/kie-soup-dataset/kie-soup-dataset-api/src/main/java/org/dashbuilder/dataset/date/TimeInstant.java index 74f42718106..0df7d747db5 100644 --- a/packages/dashbuilder/kie-soup-dataset/kie-soup-dataset-api/src/main/java/org/dashbuilder/dataset/date/TimeInstant.java +++ b/packages/dashbuilder/kie-soup-dataset/kie-soup-dataset-api/src/main/java/org/dashbuilder/dataset/date/TimeInstant.java @@ -25,7 +25,7 @@ /** * This class is used to represent a given time instant relative to the current time. - *

      Some examples of time instants are: + *

      Some examples of time instants are:

      *
        *
      • now
      • *
      • now -10second or just -10second
      • @@ -34,7 +34,6 @@ *
      • end[year March] +1year => end of next year (year starting on March)
      • *
      • begin[year March] -7day => last year's last week start
      • *
      - *

      */ public class TimeInstant { diff --git a/packages/dashbuilder/kie-soup-dataset/kie-soup-dataset-core/src/main/java/org/dashbuilder/dataprovider/StaticDataSetProvider.java b/packages/dashbuilder/kie-soup-dataset/kie-soup-dataset-core/src/main/java/org/dashbuilder/dataprovider/StaticDataSetProvider.java index e5aa65b282b..d8989bac03c 100644 --- a/packages/dashbuilder/kie-soup-dataset/kie-soup-dataset-core/src/main/java/org/dashbuilder/dataprovider/StaticDataSetProvider.java +++ b/packages/dashbuilder/kie-soup-dataset/kie-soup-dataset-core/src/main/java/org/dashbuilder/dataprovider/StaticDataSetProvider.java @@ -30,13 +30,12 @@ /** * DataSetProvider implementation for static (in-memory) data sets. - *

      It's been designed with several goals in mind: + *

      It's been designed with several goals in mind:

      *
        *
      • To provide a highly reusable data set cache.
      • *
      • To index almost every operation performed over a data set.
      • *
      • Multiple clients requesting the same data set operations will benefit from the indexing/caching services provided.
      • *
      - *

      */ public class StaticDataSetProvider implements DataSetProvider { diff --git a/packages/dashbuilder/kie-soup-dataset/kie-soup-dataset-shared/src/main/java/org/dashbuilder/dataset/engine/Chronometer.java b/packages/dashbuilder/kie-soup-dataset/kie-soup-dataset-shared/src/main/java/org/dashbuilder/dataset/engine/Chronometer.java index 1eb0a6244b9..eca9ecf26e6 100644 --- a/packages/dashbuilder/kie-soup-dataset/kie-soup-dataset-shared/src/main/java/org/dashbuilder/dataset/engine/Chronometer.java +++ b/packages/dashbuilder/kie-soup-dataset/kie-soup-dataset-shared/src/main/java/org/dashbuilder/dataset/engine/Chronometer.java @@ -43,7 +43,7 @@ public interface Chronometer { /** * Return the time specified in human readable format. * @param millis The time to format in milliseconds. - * @return Examples: 2d 3h 44m 2s or 20 weeks 3h 3s + * @return Examples: 2d 3h 44m 2s or 20 weeks 3h 3s */ String formatElapsedTime(long millis); } diff --git a/packages/dashbuilder/kie-soup-dataset/kie-soup-dataset-shared/src/main/java/org/dashbuilder/dataset/engine/group/IntervalBuilderFixedDate.java b/packages/dashbuilder/kie-soup-dataset/kie-soup-dataset-shared/src/main/java/org/dashbuilder/dataset/engine/group/IntervalBuilderFixedDate.java index 87b889eb3e3..cc3e606f19d 100644 --- a/packages/dashbuilder/kie-soup-dataset/kie-soup-dataset-shared/src/main/java/org/dashbuilder/dataset/engine/group/IntervalBuilderFixedDate.java +++ b/packages/dashbuilder/kie-soup-dataset/kie-soup-dataset-shared/src/main/java/org/dashbuilder/dataset/engine/group/IntervalBuilderFixedDate.java @@ -36,7 +36,7 @@ /** * Interval builder for date columns which generates a fixed number of intervals for a given interval size. - *

      The only intervals sizes supported are: QUARTER, MONTH, DAY_OF_WEEK, HOUR, MINUTE & SECOND.

      + *

      The only intervals sizes supported are: QUARTER, MONTH, DAY_OF_WEEK, HOUR, MINUTE and SECOND.

      */ public class IntervalBuilderFixedDate implements IntervalBuilder { diff --git a/packages/dashbuilder/kie-soup-dataset/kie-soup-dataset-shared/src/main/java/org/dashbuilder/dataset/engine/index/spi/DataSetIndexRegistry.java b/packages/dashbuilder/kie-soup-dataset/kie-soup-dataset-shared/src/main/java/org/dashbuilder/dataset/engine/index/spi/DataSetIndexRegistry.java index daed608d2c7..be17a298935 100644 --- a/packages/dashbuilder/kie-soup-dataset/kie-soup-dataset-shared/src/main/java/org/dashbuilder/dataset/engine/index/spi/DataSetIndexRegistry.java +++ b/packages/dashbuilder/kie-soup-dataset/kie-soup-dataset-shared/src/main/java/org/dashbuilder/dataset/engine/index/spi/DataSetIndexRegistry.java @@ -41,7 +41,7 @@ public interface DataSetIndexRegistry { /** * Removes the index for the specified data set. * @param uuid The data set unique identifier. - * @return The removed index or null if there was no mapping for uuid. + * @return The removed index or null if there was no mapping for uuid. */ DataSetIndex remove(String uuid); } diff --git a/packages/dashbuilder/kie-soup-dataset/kie-soup-dataset-shared/src/main/java/org/dashbuilder/dataset/engine/sort/CollectionsDataSetSort.java b/packages/dashbuilder/kie-soup-dataset/kie-soup-dataset-shared/src/main/java/org/dashbuilder/dataset/engine/sort/CollectionsDataSetSort.java index 78a7b22a640..58cee41d3d1 100644 --- a/packages/dashbuilder/kie-soup-dataset/kie-soup-dataset-shared/src/main/java/org/dashbuilder/dataset/engine/sort/CollectionsDataSetSort.java +++ b/packages/dashbuilder/kie-soup-dataset/kie-soup-dataset-shared/src/main/java/org/dashbuilder/dataset/engine/sort/CollectionsDataSetSort.java @@ -28,7 +28,7 @@ import org.dashbuilder.dataset.sort.ColumnSort; /** - * A basic sort algorithm takes relies on the default Collections.sort() implementation. + * A basic sort algorithm takes relies on the default Collections.sort() implementation. */ public class CollectionsDataSetSort implements DataSetSortAlgorithm { diff --git a/packages/data-index-webapp/env/index.js b/packages/data-index-webapp/env/index.js new file mode 100644 index 00000000000..45859a2171b --- /dev/null +++ b/packages/data-index-webapp/env/index.js @@ -0,0 +1,33 @@ +/* + * 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. + */ + +const { varsWithName, getOrDefault, composeEnv } = require("@kie-tools-scripts/build-env"); + +module.exports = composeEnv([require("@kie-tools/root-env/env")], { + vars: varsWithName({}), + get env() { + return { + dataIndexWebapp: { + dev: { + port: 9026, + }, + }, + }; + }, +}); diff --git a/packages/data-index-webapp/package.json b/packages/data-index-webapp/package.json new file mode 100644 index 00000000000..1627e52a3d1 --- /dev/null +++ b/packages/data-index-webapp/package.json @@ -0,0 +1,36 @@ +{ + "name": "@kie-tools/data-index-webapp", + "version": "0.0.0", + "description": "", + "license": "Apache-2.0", + "keywords": [], + "homepage": "https://github.com/apache/incubator-kie-tools", + "repository": { + "type": "git", + "url": "https://github.com/apache/incubator-kie-tools.git" + }, + "bugs": { + "url": "https://github.com/apache/incubator-kie-tools/issues" + }, + "types": "./dist/index.d.ts", + "main": "dist/index.js", + "scripts": { + "build:dev": "rimraf dist && webpack --env dev", + "build:prod": "pnpm lint && pnpm test && rimraf dist && webpack", + "lint": "echo 'Linting'", + "start": "webpack serve --host 0.0.0.0 --env dev", + "test": "run-script-if --ignore-errors \"$(build-env tests.ignoreFailures)\" --bool \"$(build-env tests.run)\" --then \"jest --silent --verbose --passWithNoTests\"" + }, + "devDependencies": { + "@kie-tools-core/webpack-base": "workspace:*", + "@kie-tools/root-env": "workspace:*", + "copy-webpack-plugin": "^11.0.0", + "jest": "^29.7.0", + "rimraf": "^3.0.2", + "ts-node": "^10.9.2", + "webpack": "^5.94.0", + "webpack-cli": "^4.10.0", + "webpack-dev-server": "^4.15.1", + "webpack-merge": "^5.9.0" + } +} diff --git a/packages/data-index-webapp/src/index.html b/packages/data-index-webapp/src/index.html new file mode 100644 index 00000000000..1456f070217 --- /dev/null +++ b/packages/data-index-webapp/src/index.html @@ -0,0 +1,50 @@ + + + + + + + + Data Index Webapp + + + + +
      +
      + +
      +

      Your Data Index service is up and working!

      +
      +

      + Data Index service is a dedicated supporting service that stores the data related to the workflow and process + instances and their associated jobs. This service provides a GraphQL endpoint allowing users to query and + modify that data. +

      + +
      +
      + + diff --git a/packages/data-index-webapp/src/styles.css b/packages/data-index-webapp/src/styles.css new file mode 100644 index 00000000000..618ac178a41 --- /dev/null +++ b/packages/data-index-webapp/src/styles.css @@ -0,0 +1,70 @@ +body { + margin: 0px; + padding: 0px; +} + +.maindiv { + font-family: "RedHatText", "Overpass", overpass, helvetica, arial, sans-serif; + background-color: #fff; + color: #fff; + display: flex; + justify-content: center; + align-items: center; + height: 100vh; +} + +.container { + text-align: center; + background-color: #fff; + max-width: 700px; +} + +.logo img { + width: 80px; + height: auto; +} + +h1 { + font-size: 48px; + color: #e44c3b; + padding-left: 15px; +} + +h4 { + font-size: 30px; + color: #c94848; + margin-top: 10px; +} + +p { + font-size: 16px; + color: #1f1e1e; + margin-top: 5px; + margin-bottom: 40px; +} + +.btn { + padding: 10px 20px; + background-color: #e44c3b; + color: #fff; + text-decoration: none; + border-radius: 5px; + font-size: 16px; + transition: background-color 0.3s; +} + +.btn:hover { + background-color: #c73828; +} + +@media (prefers-color-scheme: dark) { + .maindiv, + .container { + background-color: #232121; + } + + h4, + p { + color: #fefefe; + } +} diff --git a/packages/data-index-webapp/static/favicon.svg b/packages/data-index-webapp/static/favicon.svg new file mode 100644 index 00000000000..8806924e382 --- /dev/null +++ b/packages/data-index-webapp/static/favicon.svg @@ -0,0 +1,44 @@ + + + + + + + kie_icon_rgb_fullcolor_default + + + + + + + + + diff --git a/packages/data-index-webapp/webpack.config.js b/packages/data-index-webapp/webpack.config.js new file mode 100644 index 00000000000..ef01f3ecc63 --- /dev/null +++ b/packages/data-index-webapp/webpack.config.js @@ -0,0 +1,45 @@ +/* + * 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. + */ + +const CopyPlugin = require("copy-webpack-plugin"); +const { merge } = require("webpack-merge"); +const common = require("@kie-tools-core/webpack-base/webpack.common.config"); +const { env } = require("./env"); +const buildEnv = env; + +module.exports = async (env) => + merge(common(env), { + entry: {}, + plugins: [ + new CopyPlugin({ + patterns: [ + { from: "./src/index.html", to: "./index.html" }, + { from: "./src/styles.css", to: "./styles.css" }, + { from: "./static/favicon.svg", to: "./favicon.svg" }, + ], + }), + ], + ignoreWarnings: [/Failed to parse source map/], + devServer: { + static: { + directory: "./dist", + }, + port: buildEnv.dataIndexWebapp.dev.port, + }, + }); diff --git a/packages/dev-deployment-dmn-form-webapp/dev-webapp/quarkus-app/pom.xml b/packages/dev-deployment-dmn-form-webapp/dev-webapp/quarkus-app/pom.xml index 8120f605343..a96b5f74450 100644 --- a/packages/dev-deployment-dmn-form-webapp/dev-webapp/quarkus-app/pom.xml +++ b/packages/dev-deployment-dmn-form-webapp/dev-webapp/quarkus-app/pom.xml @@ -43,7 +43,7 @@ 17 UTF-8 UTF-8 - 3.2.5 + 3.5.0 3.12.1 3.2.0 3.4.1 diff --git a/packages/dev-deployment-dmn-form-webapp/package.json b/packages/dev-deployment-dmn-form-webapp/package.json index bd1d95219ca..2078fcd0d2e 100644 --- a/packages/dev-deployment-dmn-form-webapp/package.json +++ b/packages/dev-deployment-dmn-form-webapp/package.json @@ -35,8 +35,6 @@ "@readme/openapi-parser": "^2.5.0", "json-refs": "^3.0.15", "lodash": "^4.17.21", - "react": "^17.0.2", - "react-dom": "^17.0.2", "react-router": "^5.3.4", "react-router-dom": "^5.3.4" }, @@ -76,5 +74,9 @@ "webpack-cli": "^4.10.0", "webpack-dev-server": "^4.15.1", "webpack-merge": "^5.9.0" + }, + "peerDependencies": { + "react": ">=17.0.2 <19.0.0", + "react-dom": ">=17.0.2 <19.0.0" } } diff --git a/packages/dev-deployment-kogito-quarkus-blank-app-image/env/index.js b/packages/dev-deployment-kogito-quarkus-blank-app-image/env/index.js index db4e8b45097..7087fb761c4 100644 --- a/packages/dev-deployment-kogito-quarkus-blank-app-image/env/index.js +++ b/packages/dev-deployment-kogito-quarkus-blank-app-image/env/index.js @@ -52,7 +52,7 @@ module.exports = composeEnv([rootEnv], { description: "Tag version of this image. E.g., `main` or `10.0.x` or `10.0.0", }, DEV_DEPLOYMENT_KOGITO_QUARKUS_BLANK_APP_IMAGE__mavenM2RepoViaHttpImage: { - default: `${mavenM2RepoViaHttpImageEnv.registry}/${mavenM2RepoViaHttpImageEnv.account}/${mavenM2RepoViaHttpImageEnv.name}:${mavenM2RepoViaHttpImageEnv.tag}`, + default: `${mavenM2RepoViaHttpImageEnv.registry}/${mavenM2RepoViaHttpImageEnv.account}/${mavenM2RepoViaHttpImageEnv.name}:${mavenM2RepoViaHttpImageEnv.buildTag}`, description: "The image tag for the Maven M2 Repo via HTTP. Used during the build only.", }, }), diff --git a/packages/dev-deployment-kogito-quarkus-blank-app/pom.xml b/packages/dev-deployment-kogito-quarkus-blank-app/pom.xml index 13be51c1f55..259bc458762 100644 --- a/packages/dev-deployment-kogito-quarkus-blank-app/pom.xml +++ b/packages/dev-deployment-kogito-quarkus-blank-app/pom.xml @@ -43,7 +43,7 @@ 17 UTF-8 UTF-8 - 3.2.5 + 3.5.0 3.12.1 3.2.0 3.4.1 diff --git a/packages/dmn-editor-envelope/package.json b/packages/dmn-editor-envelope/package.json index a8b6f310719..c321f00872c 100644 --- a/packages/dmn-editor-envelope/package.json +++ b/packages/dmn-editor-envelope/package.json @@ -34,9 +34,7 @@ "@kie-tools/dmn-marshaller": "workspace:*", "@kie-tools/pmml-editor-marshaller": "workspace:*", "@kie-tools/xml-parser-ts": "workspace:*", - "@patternfly/react-core": "^4.276.6", - "react": "^17.0.2", - "react-dom": "^17.0.2" + "@patternfly/react-core": "^4.276.6" }, "devDependencies": { "@babel/core": "^7.16.0", @@ -49,5 +47,9 @@ "@types/react-dom": "^17.0.5", "rimraf": "^3.0.2", "typescript": "^5.5.3" + }, + "peerDependencies": { + "react": ">=17.0.2 <19.0.0", + "react-dom": ">=17.0.2 <19.0.0" } } diff --git a/packages/dmn-editor-envelope/src/DmnEditorRoot.tsx b/packages/dmn-editor-envelope/src/DmnEditorRoot.tsx index c6741d3cc3c..d1c5bc75c47 100644 --- a/packages/dmn-editor-envelope/src/DmnEditorRoot.tsx +++ b/packages/dmn-editor-envelope/src/DmnEditorRoot.tsx @@ -19,7 +19,7 @@ import * as __path from "path"; import * as React from "react"; -import { useEffect, useMemo, useState } from "react"; +import { useCallback, useEffect, useMemo, useState } from "react"; import * as DmnEditor from "@kie-tools/dmn-editor/dist/DmnEditor"; import { normalize, Normalized } from "@kie-tools/dmn-editor/dist/normalization/normalize"; import { DMN_LATEST_VERSION, DmnLatestModel, DmnMarshaller, getMarshaller } from "@kie-tools/dmn-marshaller"; @@ -72,12 +72,12 @@ export type DmnEditorRootState = { marshaller: DmnMarshaller | undefined; stack: Normalized[]; pointer: number; - openFilenormalizedPosixPathRelativeToTheWorkspaceRoot: string | undefined; + openFileNormalizedPosixPathRelativeToTheWorkspaceRoot: string | undefined; externalModelsByNamespace: DmnEditor.ExternalModelsIndex; isReadOnly: boolean; externalModelsManagerDoneBootstraping: boolean; keyboardShortcutsRegisterIds: number[]; - keyboardShortcutsRegistred: boolean; + keyboardShortcutsRegistered: boolean; error: Error | undefined; }; @@ -95,11 +95,11 @@ export class DmnEditorRoot extends React.Component { const marshaller = this.getMarshaller(content); @@ -142,7 +142,7 @@ export class DmnEditorRoot extends React.Component { // External change to the same file. if ( - prev.openFilenormalizedPosixPathRelativeToTheWorkspaceRoot === - openFilenormalizedPosixPathRelativeToTheWorkspaceRoot + prev.openFileNormalizedPosixPathRelativeToTheWorkspaceRoot === + openFileNormalizedPosixPathRelativeToTheWorkspaceRoot ) { const newStack = savedStackPointer.slice(0, prev.pointer + 1); return { marshaller, - openFilenormalizedPosixPathRelativeToTheWorkspaceRoot, + openFileNormalizedPosixPathRelativeToTheWorkspaceRoot, stack: [...newStack, normalize(marshaller.parser.parse())], isReadOnly: prev.isReadOnly, pointer: newStack.length, @@ -172,7 +172,7 @@ export class DmnEditorRoot extends React.Component this.props.onNewEdit({ - id: `${this.state.openFilenormalizedPosixPathRelativeToTheWorkspaceRoot}__${generateUuid()}`, + id: `${this.state.openFileNormalizedPosixPathRelativeToTheWorkspaceRoot}__${generateUuid()}`, }) ); }; private onRequestExternalModelsAvailableToInclude: DmnEditor.OnRequestExternalModelsAvailableToInclude = async () => { - if (!this.state.openFilenormalizedPosixPathRelativeToTheWorkspaceRoot) { + if (!this.state.openFileNormalizedPosixPathRelativeToTheWorkspaceRoot) { return []; } @@ -233,9 +233,9 @@ export class DmnEditorRoot extends React.Component // Do not show this DMN on the list - p === this.state.openFilenormalizedPosixPathRelativeToTheWorkspaceRoot + p === this.state.openFileNormalizedPosixPathRelativeToTheWorkspaceRoot ? [] - : __path.relative(__path.dirname(this.state.openFilenormalizedPosixPathRelativeToTheWorkspaceRoot!), p) + : __path.relative(__path.dirname(this.state.openFileNormalizedPosixPathRelativeToTheWorkspaceRoot!), p) ); }; @@ -244,7 +244,7 @@ export class DmnEditorRoot extends React.Component { const normalizedPosixPathRelativeToTheWorkspaceRoot = __path .resolve( - __path.dirname(this.state.openFilenormalizedPosixPathRelativeToTheWorkspaceRoot!), + __path.dirname(this.state.openFileNormalizedPosixPathRelativeToTheWorkspaceRoot!), normalizedPosixPathRelativeToTheOpenFile ) .substring(1); // Remove leading slash. @@ -267,7 +267,7 @@ export class DmnEditorRoot extends React.Component { - if (!this.state.openFilenormalizedPosixPathRelativeToTheWorkspaceRoot) { + if (!this.state.openFileNormalizedPosixPathRelativeToTheWorkspaceRoot) { return; } @@ -304,7 +304,7 @@ export class DmnEditorRoot extends React.Component, snapshot?: any ): void { - if (this.props.keyboardShortcutsService === undefined || this.state.keyboardShortcutsRegistred === true) { + if (this.props.keyboardShortcutsService === undefined || this.state.keyboardShortcutsRegistered === true) { return; } @@ -428,7 +428,7 @@ export class DmnEditorRoot extends React.Component ({ ...prev, - keyboardShortcutsRegistred: true, + keyboardShortcutsRegistered: true, keyboardShortcutsRegisterIds: [ bigMoveDown, bigMoveLeft, @@ -497,7 +497,7 @@ export class DmnEditorRoot extends React.Component; }) { const namespaces = useMemo( - () => - (model.definitions.import ?? []) - .map((i) => getNamespaceOfDmnImport({ dmnImport: i })) - .join(NAMESPACES_EFFECT_SEPARATOR), + () => getIncludedNamespacesFromModel(model.definitions.import), [model.definitions.import] ); @@ -563,6 +560,38 @@ function ExternalModelsManager({ }; }, [thisDmnsNormalizedPosixPathRelativeToTheWorkspaceRoot]); + const getDmnsByNamespace = useCallback((resources: (ResourceContent | undefined)[]) => { + const ret = new Map(); + for (let i = 0; i < resources.length; i++) { + const resource = resources[i]; + if (!resource) { + continue; + } + + const content = resource.content ?? ""; + const ext = __path.extname(resource.normalizedPosixPathRelativeToTheWorkspaceRoot); + if (ext === ".dmn") { + const namespace = domParser.getDomDocument(content).documentElement.getAttribute("namespace"); + if (namespace) { + // Check for multiplicity of namespaces on DMN models + if (ret.has(namespace)) { + console.warn( + `DMN EDITOR ROOT: Multiple DMN models encountered with the same namespace '${namespace}': '${ + resource.normalizedPosixPathRelativeToTheWorkspaceRoot + }' and '${ + ret.get(namespace)!.normalizedPosixPathRelativeToTheWorkspaceRoot + }'. The latter will be considered.` + ); + } + + ret.set(namespace, resource); + } + } + } + + return ret; + }, []); + // This effect actually populates `externalModelsByNamespace` through the `onChange` call. useEffect(() => { let canceled = false; @@ -584,7 +613,7 @@ function ExternalModelsManager({ resources.push( onRequestWorkspaceFileContent({ normalizedPosixPathRelativeToTheWorkspaceRoot, - opts: { type: ContentType.TEXT }, + opts: { type: "text" }, }) ); } @@ -594,6 +623,8 @@ function ExternalModelsManager({ const externalModelsIndex: DmnEditor.ExternalModelsIndex = {}; const namespacesSet = new Set(namespaces.split(NAMESPACES_EFFECT_SEPARATOR)); + const loadedDmnsByPathRelativeToTheWorkspaceRoot = new Set(); + const dmnsByNamespace = getDmnsByNamespace(resources); for (let i = 0; i < resources.length; i++) { const resource = resources[i]; @@ -601,46 +632,54 @@ function ExternalModelsManager({ continue; } - const content = resource.content ?? ""; - + const ext = __path.extname(resource.normalizedPosixPathRelativeToTheWorkspaceRoot); const normalizedPosixPathRelativeToTheOpenFile = __path.relative( __path.dirname(thisDmnsNormalizedPosixPathRelativeToTheWorkspaceRoot), resource.normalizedPosixPathRelativeToTheWorkspaceRoot ); - const ext = __path.extname(resource.normalizedPosixPathRelativeToTheWorkspaceRoot); - if (ext === ".dmn") { - const namespace = domParser.getDomDocument(content).documentElement.getAttribute("namespace"); - if (namespace && namespacesSet.has(namespace)) { - // Check for multiplicity of namespaces on DMN models - if (externalModelsIndex[namespace]) { - console.warn( - `DMN EDITOR ROOT: Multiple DMN models encountered with the same namespace '${namespace}': '${ - resource.normalizedPosixPathRelativeToTheWorkspaceRoot - }' and '${ - externalModelsIndex[namespace]!.normalizedPosixPathRelativeToTheOpenFile - }'. The latter will be considered.` - ); - } + const resourceContent = resource.content ?? ""; - externalModelsIndex[namespace] = { - normalizedPosixPathRelativeToTheOpenFile, - model: normalize(getMarshaller(content, { upgradeTo: "latest" }).parser.parse()), - type: "dmn", - svg: "", - }; + // DMN Files + if (ext === ".dmn") { + const namespaceOfTheResourceFile = domParser + .getDomDocument(resourceContent) + .documentElement.getAttribute("namespace"); + + if (namespaceOfTheResourceFile && namespacesSet.has(namespaceOfTheResourceFile)) { + checkIfNamespaceIsAlreadyLoaded({ + externalModelsIndex, + namespaceOfTheResourceFile, + normalizedPosixPathRelativeToTheWorkspaceRoot: resource.normalizedPosixPathRelativeToTheWorkspaceRoot, + }); + + loadModel({ + includedModelContent: resourceContent, + includedModelNamespace: namespaceOfTheResourceFile, + externalModelsIndex, + thisDmnsNormalizedPosixPathRelativeToTheWorkspaceRoot, + loadedDmnsByPathRelativeToTheWorkspaceRoot, + normalizedPosixPathRelativeToTheWorkspaceRoot: resource.normalizedPosixPathRelativeToTheWorkspaceRoot, + resourcesByNamespace: dmnsByNamespace, + }); } - } else if (ext === ".pmml") { + } + + // PMML Files + else if (ext === ".pmml") { const namespace = getPmmlNamespace({ normalizedPosixPathRelativeToTheOpenFile }); if (namespace && namespacesSet.has(namespace)) { // No need to check for namespaces being equal becuase there can't be two files with the same relativePath. externalModelsIndex[namespace] = { normalizedPosixPathRelativeToTheOpenFile, - model: XML2PMML(content), + model: XML2PMML(resourceContent), type: "pmml", }; } - } else { + } + + // Unknown files + else { throw new Error(`Unknown extension '${ext}'.`); } } @@ -663,6 +702,7 @@ function ExternalModelsManager({ externalUpdatesCount, workspaceRootAbsolutePosixPath, externalModelsManagerDoneBootstraping, + getDmnsByNamespace, ]); return <>; @@ -682,3 +722,93 @@ function DmnMarshallerFallbackError({ error }: { error: Error }) { ); } + +function getIncludedNamespacesFromModel(imports: Normalized) { + return (imports ?? []).map((i) => getNamespaceOfDmnImport({ dmnImport: i })).join(NAMESPACES_EFFECT_SEPARATOR); +} + +function loadModel(args: { + thisDmnsNormalizedPosixPathRelativeToTheWorkspaceRoot: string; + resourcesByNamespace: Map; + normalizedPosixPathRelativeToTheWorkspaceRoot: string; + includedModelNamespace: string; + loadedDmnsByPathRelativeToTheWorkspaceRoot: Set; + includedModelContent: string; + externalModelsIndex: DmnEditor.ExternalModelsIndex; +}) { + const normalizedPosixPathRelativeToTheOpenFile = __path.relative( + __path.dirname(args.thisDmnsNormalizedPosixPathRelativeToTheWorkspaceRoot), + args.normalizedPosixPathRelativeToTheWorkspaceRoot + ); + + const includedModel = normalize(getMarshaller(args.includedModelContent, { upgradeTo: "latest" }).parser.parse()); + args.externalModelsIndex[args.includedModelNamespace] = { + normalizedPosixPathRelativeToTheOpenFile, + model: includedModel, + type: "dmn", + svg: "", + }; + + args.loadedDmnsByPathRelativeToTheWorkspaceRoot.add(args.normalizedPosixPathRelativeToTheWorkspaceRoot); + + loadDependentModels({ + ...args, + model: includedModel, + }); +} + +// Load all included models from the model and the included models of those models, recursively. +function loadDependentModels(args: { + model: Normalized; + externalModelsIndex: DmnEditor.ExternalModelsIndex; + resourcesByNamespace: Map; + loadedDmnsByPathRelativeToTheWorkspaceRoot: Set; + thisDmnsNormalizedPosixPathRelativeToTheWorkspaceRoot: string; +}) { + const includedNamespaces = new Set( + getIncludedNamespacesFromModel(args.model.definitions.import).split(NAMESPACES_EFFECT_SEPARATOR) + ); + + for (const includedNamespace of includedNamespaces) { + if (!args.resourcesByNamespace.has(includedNamespace)) { + console.warn( + `DMN EDITOR ROOT: The included namespace '${includedNamespace}' for the model '${args.model.definitions["@_id"]}' can not be found.` + ); + continue; + } + + const resource = args.resourcesByNamespace.get(includedNamespace)!; + if (args.loadedDmnsByPathRelativeToTheWorkspaceRoot.has(resource.normalizedPosixPathRelativeToTheWorkspaceRoot)) { + continue; + } + + checkIfNamespaceIsAlreadyLoaded({ + externalModelsIndex: args.externalModelsIndex, + namespaceOfTheResourceFile: includedNamespace, + normalizedPosixPathRelativeToTheWorkspaceRoot: resource.normalizedPosixPathRelativeToTheWorkspaceRoot, + }); + + loadModel({ + ...args, + includedModelContent: resource.content ?? "", + normalizedPosixPathRelativeToTheWorkspaceRoot: resource.normalizedPosixPathRelativeToTheWorkspaceRoot, + includedModelNamespace: includedNamespace, + }); + } +} + +function checkIfNamespaceIsAlreadyLoaded(args: { + externalModelsIndex: DmnEditor.ExternalModelsIndex; + namespaceOfTheResourceFile: string; + normalizedPosixPathRelativeToTheWorkspaceRoot: string; +}) { + if (args.externalModelsIndex[args.namespaceOfTheResourceFile]) { + console.warn( + `DMN EDITOR ROOT: Multiple DMN models encountered with the same namespace '${args.namespaceOfTheResourceFile}': '${ + args.normalizedPosixPathRelativeToTheWorkspaceRoot + }' and '${ + args.externalModelsIndex[args.namespaceOfTheResourceFile]!.normalizedPosixPathRelativeToTheOpenFile + }'. The latter will be considered.` + ); + } +} diff --git a/packages/dmn-editor-standalone/src/DmnEditorStandaloneChannelApiImpl.ts b/packages/dmn-editor-standalone/src/DmnEditorStandaloneChannelApiImpl.ts index ba03446bd49..20ebb38a2b5 100644 --- a/packages/dmn-editor-standalone/src/DmnEditorStandaloneChannelApiImpl.ts +++ b/packages/dmn-editor-standalone/src/DmnEditorStandaloneChannelApiImpl.ts @@ -102,9 +102,7 @@ export class DmnEditorStandaloneChannelApiImpl implements KogitoEditorChannelApi return new ResourceContent( request.normalizedPosixPathRelativeToTheWorkspaceRoot, await resource.content, - // We need to typecast because ContentType is not exported - // and TS complains when trying to match strings with enums - resource.contentType as ContentType + resource.contentType ); } diff --git a/packages/dmn-editor-standalone/stories/DevWebApp.stories.tsx b/packages/dmn-editor-standalone/stories/DevWebApp.stories.tsx index c2b6ec0e2d5..c21a0dc6cbc 100644 --- a/packages/dmn-editor-standalone/stories/DevWebApp.stories.tsx +++ b/packages/dmn-editor-standalone/stories/DevWebApp.stories.tsx @@ -24,11 +24,10 @@ import { useRef, useState, useEffect, useCallback, useMemo } from "react"; import "@patternfly/react-core/dist/styles/base.css"; import { Page, PageSection } from "@patternfly/react-core/dist/js/components/Page"; import * as DmnEditor from "../dist/index"; -import { DmnEditorStandaloneApi } from "../dist/index"; +import { DmnEditorStandaloneApi, DmnEditorStandaloneResource } from "../dist/index"; import { Flex } from "@patternfly/react-core/dist/js/layouts/Flex/Flex"; import { FlexItem } from "@patternfly/react-core/dist/js/layouts/Flex/FlexItem"; import { Text, TextVariants } from "@patternfly/react-core/dist/js/components/Text"; -import { ContentType } from "@kie-tools-core/workspace/dist/api"; const droppingFileStyle = { position: "absolute", @@ -53,7 +52,7 @@ export type DevWebAppProps = { initialFileNormalizedPosixPathRelativeToTheWorkspaceRoot: string; initialContent: string; readOnly: boolean; - resources: Array<[string, { contentType: ContentType; content: string }]>; + resources: Array<[string, DmnEditorStandaloneResource]>; origin: string; }; diff --git a/packages/dmn-editor-standalone/tests-e2e/__fixtures__/editor.ts b/packages/dmn-editor-standalone/tests-e2e/__fixtures__/editor.ts index 5ecc57ef09d..c030c6e9858 100644 --- a/packages/dmn-editor-standalone/tests-e2e/__fixtures__/editor.ts +++ b/packages/dmn-editor-standalone/tests-e2e/__fixtures__/editor.ts @@ -18,7 +18,6 @@ */ import { Page, expect } from "@playwright/test"; -import { ContentType } from "@kie-tools-core/workspace/dist/api"; import type { open, DmnEditorStandaloneApi } from "@kie-tools/dmn-editor-standalone/dist"; import * as prettier from "prettier"; @@ -40,7 +39,7 @@ export class Editor { constructor(public page: Page) {} public async open(args?: { - resources?: Array<[string, { contentType: ContentType; content: string }]>; + resources?: Array<[string, { contentType: "text" | "binary"; content: string }]>; initialFileNormalizedPosixPathRelativeToTheWorkspaceRoot?: string; }) { await this.page.goto(""); diff --git a/packages/dmn-editor-standalone/tests-e2e/includedModels/includedModels.spec.ts b/packages/dmn-editor-standalone/tests-e2e/includedModels/includedModels.spec.ts index f3bf3aedecb..fc8f18b8c0d 100644 --- a/packages/dmn-editor-standalone/tests-e2e/includedModels/includedModels.spec.ts +++ b/packages/dmn-editor-standalone/tests-e2e/includedModels/includedModels.spec.ts @@ -18,27 +18,20 @@ */ import { test, expect } from "../__fixtures__/base"; -import { ContentType } from "@kie-tools-core/workspace/dist/api"; import { ExternalFile } from "../__fixtures__/files"; test.describe("DMN Editor - Standalone - Resources", () => { test.describe("includedModels/resources", () => { test("should list all resources", async ({ editor, files }) => { - const resources: Array<[string, { contentType: ContentType; content: string }]> = [ + const resources: Array<[string, { contentType: "text" | "binary"; content: string }]> = [ [ "loan-pre-qualification.dmn", - { content: await files.getFile(ExternalFile.LOAN_PRE_QUALIFICATION_DMN), contentType: ContentType.TEXT }, - ], - ["can-drive.dmn", { content: await files.getFile(ExternalFile.CAN_DRIVE_DMN), contentType: ContentType.TEXT }], - [ - "find-employees.dmn", - { content: await files.getFile(ExternalFile.FIND_EMPLOYEES_DMN), contentType: ContentType.TEXT }, - ], - ["types.dmn", { content: await files.getFile(ExternalFile.TYPES_DMN), contentType: ContentType.TEXT }], - [ - "scorecard.pmml", - { content: await files.getFile(ExternalFile.SCORECARD_PMML), contentType: ContentType.TEXT }, + { content: await files.getFile(ExternalFile.LOAN_PRE_QUALIFICATION_DMN), contentType: "text" }, ], + ["can-drive.dmn", { content: await files.getFile(ExternalFile.CAN_DRIVE_DMN), contentType: "text" }], + ["find-employees.dmn", { content: await files.getFile(ExternalFile.FIND_EMPLOYEES_DMN), contentType: "text" }], + ["types.dmn", { content: await files.getFile(ExternalFile.TYPES_DMN), contentType: "text" }], + ["scorecard.pmml", { content: await files.getFile(ExternalFile.SCORECARD_PMML), contentType: "text" }], ]; // Open the editor @@ -61,23 +54,20 @@ test.describe("DMN Editor - Standalone - Resources", () => { }); test("should not list any models to be included", async ({ editor, files }) => { - const resources: Array<[string, { contentType: ContentType; content: string }]> = [ + const resources: Array<[string, { contentType: "text" | "binary"; content: string }]> = [ [ "loan-pre-qualification.dmn", - { content: await files.getFile(ExternalFile.LOAN_PRE_QUALIFICATION_DMN), contentType: ContentType.TEXT }, - ], - [ - "path1/can-drive.dmn", - { content: await files.getFile(ExternalFile.CAN_DRIVE_DMN), contentType: ContentType.TEXT }, + { content: await files.getFile(ExternalFile.LOAN_PRE_QUALIFICATION_DMN), contentType: "text" }, ], + ["path1/can-drive.dmn", { content: await files.getFile(ExternalFile.CAN_DRIVE_DMN), contentType: "text" }], [ "path2/find-employees.dmn", - { content: await files.getFile(ExternalFile.FIND_EMPLOYEES_DMN), contentType: ContentType.TEXT }, + { content: await files.getFile(ExternalFile.FIND_EMPLOYEES_DMN), contentType: "text" }, ], - ["path3/types.dmn", { content: await files.getFile(ExternalFile.TYPES_DMN), contentType: ContentType.TEXT }], + ["path3/types.dmn", { content: await files.getFile(ExternalFile.TYPES_DMN), contentType: "text" }], [ "path1/pmml/scorecard.pmml", - { content: await files.getFile(ExternalFile.SCORECARD_PMML), contentType: ContentType.TEXT }, + { content: await files.getFile(ExternalFile.SCORECARD_PMML), contentType: "text" }, ], ]; @@ -94,26 +84,20 @@ test.describe("DMN Editor - Standalone - Resources", () => { }); test("should list all resources on same parent path", async ({ editor, files }) => { - const resources: Array<[string, { contentType: ContentType; content: string }]> = [ + const resources: Array<[string, { contentType: "text" | "binary"; content: string }]> = [ [ "loan-pre-qualification.dmn", - { content: await files.getFile(ExternalFile.LOAN_PRE_QUALIFICATION_DMN), contentType: ContentType.TEXT }, - ], - [ - "path1/can-drive.dmn", - { content: await files.getFile(ExternalFile.CAN_DRIVE_DMN), contentType: ContentType.TEXT }, + { content: await files.getFile(ExternalFile.LOAN_PRE_QUALIFICATION_DMN), contentType: "text" }, ], + ["path1/can-drive.dmn", { content: await files.getFile(ExternalFile.CAN_DRIVE_DMN), contentType: "text" }], [ "path2/find-employees.dmn", - { content: await files.getFile(ExternalFile.FIND_EMPLOYEES_DMN), contentType: ContentType.TEXT }, - ], - [ - "path3/types/types.dmn", - { content: await files.getFile(ExternalFile.TYPES_DMN), contentType: ContentType.TEXT }, + { content: await files.getFile(ExternalFile.FIND_EMPLOYEES_DMN), contentType: "text" }, ], + ["path3/types/types.dmn", { content: await files.getFile(ExternalFile.TYPES_DMN), contentType: "text" }], [ "path1/pmml/scorecard.pmml", - { content: await files.getFile(ExternalFile.SCORECARD_PMML), contentType: ContentType.TEXT }, + { content: await files.getFile(ExternalFile.SCORECARD_PMML), contentType: "text" }, ], ]; diff --git a/packages/dmn-editor/jest.config.js b/packages/dmn-editor/jest.config.js new file mode 100644 index 00000000000..cd848227e0f --- /dev/null +++ b/packages/dmn-editor/jest.config.js @@ -0,0 +1,30 @@ +/* + * 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. + */ + +const { config, babelTransform, typescriptTransform } = require("@kie-tools/jest-base/jest.config"); + +/** @type {import('ts-jest').JestConfigWithTsJest} */ +module.exports = { + ...config, + testEnvironment: "node", + transform: { + ...babelTransform, + ...typescriptTransform, + }, +}; diff --git a/packages/dmn-editor/package.json b/packages/dmn-editor/package.json index bd9de788abc..a7328dac98e 100644 --- a/packages/dmn-editor/package.json +++ b/packages/dmn-editor/package.json @@ -18,13 +18,14 @@ ], "scripts": { "build:dev": "rimraf dist && pnpm copy:css && tsc -p tsconfig.json", - "build:prod": "rimraf dist && pnpm copy:css && pnpm lint && tsc -p tsconfig.json && pnpm test-e2e", + "build:prod": "rimraf dist && pnpm copy:css && pnpm lint && tsc -p tsconfig.json && pnpm test-e2e && pnpm test", "build:storybook": "storybook build -o dist-storybook", "copy:css": "copyfiles -u 1 \"src/**/*.{sass,scss,css}\" dist/", "lint": "run-script-if --bool \"$(build-env linters.run)\" --then \"kie-tools--eslint ./src\"", "start": "run-script-os", "start:linux:darwin": "cross-env STORYBOOK_PORT=$(build-env dmnEditor.storybook.port) pnpm kie-tools--storybook --storybookArgs=\"dev --no-open\"", "start:win32": "pnpm powershell \"cross-env STORYBOOK_PORT=$(build-env dmnEditor.storybook.port) pnpm kie-tools--storybook --storybookArgs='dev --no-open'", + "test": "run-script-if --ignore-errors \"$(build-env tests.ignoreFailures)\" --bool \"$(build-env tests.run)\" --then \"jest --silent --verbose --passWithNoTests\"", "test-e2e": "run-script-if --ignore-errors \"$(build-env endToEndTests.ignoreFailures)\" --bool \"$(build-env endToEndTests.run)\" --then \"pnpm rimraf ./dist-tests-e2e\" \"pnpm test-e2e:run\"", "test-e2e:open": "pnpm exec playwright show-report dist-tests-e2e/reports", "test-e2e:run": "pnpm exec playwright test" @@ -53,8 +54,6 @@ "fast-deep-equal": "^3.1.3", "immer": "^10.0.3", "moment": "^2.29.4", - "react": "^17.0.2", - "react-dom": "^17.0.2", "react-error-boundary": "^4.0.11", "reactflow": "^11.8.3", "uuid": "^8.3.2", @@ -67,6 +66,7 @@ "@babel/preset-typescript": "^7.22.5", "@kie-tools-core/webpack-base": "workspace:*", "@kie-tools/eslint": "workspace:*", + "@kie-tools/jest-base": "workspace:*", "@kie-tools/playwright-base": "workspace:*", "@kie-tools/root-env": "workspace:*", "@kie-tools/storybook-base": "workspace:*", @@ -81,6 +81,8 @@ "@storybook/react-webpack5": "^7.3.2", "@types/d3-drag": "^3.0.3", "@types/d3-selection": "^3.0.6", + "@types/jest": "^29.5.12", + "@types/jest-when": "^3.5.5", "@types/lodash": "^4.14.168", "@types/node": "^20.14.2", "@types/react": "^17.0.6", @@ -91,15 +93,23 @@ "cross-env": "^7.0.3", "deep-object-diff": "^1.1.9", "file-loader": "^6.2.0", + "jest": "^29.7.0", + "jest-junit": "^16.0.0", + "jest-when": "^3.6.0", "lodash": "^4.17.21", "rimraf": "^3.0.2", "run-script-os": "^1.1.6", "start-server-and-test": "^2.0.3", "storybook": "^7.3.2", + "ts-jest": "^29.1.5", "typescript": "^5.5.3", "webpack": "^5.94.0", "webpack-cli": "^4.10.0", "webpack-dev-server": "^4.15.1", "webpack-merge": "^5.9.0" + }, + "peerDependencies": { + "react": ">=17.0.2 <19.0.0", + "react-dom": ">=17.0.2 <19.0.0" } } diff --git a/packages/dmn-editor/src/DmnEditor.tsx b/packages/dmn-editor/src/DmnEditor.tsx index 7739a0cbf7c..766c08146cb 100644 --- a/packages/dmn-editor/src/DmnEditor.tsx +++ b/packages/dmn-editor/src/DmnEditor.tsx @@ -399,7 +399,9 @@ export const DmnEditorInternal = ({ - {navigationTab === DmnEditorTab.INCLUDED_MODELS && } +
      + {navigationTab === DmnEditorTab.INCLUDED_MODELS && } +
  • diff --git a/packages/dmn-editor/src/autolayout/AutolayoutButton.tsx b/packages/dmn-editor/src/autolayout/AutolayoutButton.tsx index c1a09f169eb..0b1be461482 100644 --- a/packages/dmn-editor/src/autolayout/AutolayoutButton.tsx +++ b/packages/dmn-editor/src/autolayout/AutolayoutButton.tsx @@ -57,7 +57,10 @@ export function AutolayoutButton() { __readonly_parentNodesById, __readonly_drdIndex: s.computed(s).getDrdIndex(), __readonly_dmnObjectNamespace: s.dmn.model.definitions["@_namespace"], - __readonly_externalDmnsIndex: s.computed(s).getExternalModelTypesByNamespace(externalModelsByNamespace).dmns, + __readonly_externalDmnsIndex: s + .computed(s) + .getDirectlyIncludedExternalModelsByNamespace(externalModelsByNamespace).dmns, + __readonly_externalModelsByNamespace: externalModelsByNamespace, }); }); }, [dmnEditorStoreApi, externalModelsByNamespace]); diff --git a/packages/dmn-editor/src/boxedExpressions/BoxedExpressionScreen.tsx b/packages/dmn-editor/src/boxedExpressions/BoxedExpressionScreen.tsx index 18c7be1da75..5e4fb2ab5e9 100644 --- a/packages/dmn-editor/src/boxedExpressions/BoxedExpressionScreen.tsx +++ b/packages/dmn-editor/src/boxedExpressions/BoxedExpressionScreen.tsx @@ -89,18 +89,17 @@ export function BoxedExpressionScreen({ container }: { container: React.RefObjec const dmnEditorStoreApi = useDmnEditorStoreApi(); const thisDmn = useDmnEditorStore((s) => s.dmn); - const diagram = useDmnEditorStore((s) => s.diagram); const activeDrgElementId = useDmnEditorStore((s) => s.boxedExpressionEditor.activeDrgElementId); const isPropertiesPanelOpen = useDmnEditorStore((s) => s.boxedExpressionEditor.propertiesPanel.isOpen); const externalDmnsByNamespace = useDmnEditorStore( - (s) => s.computed(s).getExternalModelTypesByNamespace(externalModelsByNamespace).dmns + (s) => s.computed(s).getDirectlyIncludedExternalModelsByNamespace(externalModelsByNamespace).dmns ); const dataTypesTree = useDmnEditorStore((s) => s.computed(s).getDataTypes(externalModelsByNamespace).dataTypesTree); const importsByNamespace = useDmnEditorStore((s) => s.computed(s).importsByNamespace()); const externalPmmlsByNamespace = useDmnEditorStore( - (s) => s.computed(s).getExternalModelTypesByNamespace(externalModelsByNamespace).pmmls + (s) => s.computed(s).getDirectlyIncludedExternalModelsByNamespace(externalModelsByNamespace).pmmls ); const isAlternativeInputDataShape = useDmnEditorStore((s) => s.computed(s).isAlternativeInputDataShape()); const drdIndex = useDmnEditorStore((s) => s.computed(s).getDrdIndex()); diff --git a/packages/dmn-editor/src/diagram/Diagram.tsx b/packages/dmn-editor/src/diagram/Diagram.tsx index 123aba83e25..9dbd0fe75a2 100644 --- a/packages/dmn-editor/src/diagram/Diagram.tsx +++ b/packages/dmn-editor/src/diagram/Diagram.tsx @@ -216,7 +216,7 @@ export const Diagram = React.forwardRef { @@ -990,8 +994,9 @@ export const Diagram = React.forwardRef ({ ...s, __$$element: "dmndi:DMNShape" as const }))); - diagramElements.push(...clipboard.edges.map((s) => ({ ...s, __$$element: "dmndi:DMNEdge" as const }))); + diagramElements.push( + ...clipboard.shapes.map((s) => ({ + ...s, + __$$element: "dmndi:DMNShape" as const, + })) + ); + diagramElements.push( + ...clipboard.edges.map((s) => ({ + ...s, + __$$element: "dmndi:DMNEdge" as const, + })) + ); widths.push(...clipboard.widths); - repopulateInputDataAndDecisionsOnAllDecisionServices({ definitions: state.dmn.model.definitions }); + repopulateInputDataAndDecisionsOnAllDecisionServices({ + definitions: state.dmn.model.definitions, + externalModelsByNamespace, + }); state.diagram._selectedNodes = [...clipboard.drgElements, ...clipboard.artifacts].map((s) => buildXmlHref({ id: s["@_id"]! }) @@ -256,7 +271,7 @@ export function DiagramCommands(props: {}) { }); }); }; - }, [dmnEditorStoreApi, commandsRef]); + }, [dmnEditorStoreApi, commandsRef, externalModelsByNamespace]); // Select/deselect all nodes useEffect(() => { @@ -317,12 +332,13 @@ export function DiagramCommands(props: {}) { padding: CONTAINER_NODES_DESIRABLE_PADDING, }), }, + externalModelsByNamespace, }); state.dispatch(state).diagram.setNodeStatus(newNodeId, { selected: true }); }); }; - }, [dmnEditorStoreApi, commandsRef, rf]); + }, [dmnEditorStoreApi, commandsRef, rf, externalModelsByNamespace]); // Toggle hierarchy highlights useEffect(() => { @@ -369,7 +385,7 @@ export function DiagramCommands(props: {}) { canRemoveNodeFromDrdOnly({ __readonly_externalDmnsIndex: state .computed(state) - .getExternalModelTypesByNamespace(externalModelsByNamespace).dmns, + .getDirectlyIncludedExternalModelsByNamespace(externalModelsByNamespace).dmns, definitions: state.dmn.model.definitions, __readonly_drdIndex: state.computed(state).getDrdIndex(), __readonly_dmnObjectNamespace: @@ -380,7 +396,7 @@ export function DiagramCommands(props: {}) { canRemoveNodeFromDrdOnly({ __readonly_externalDmnsIndex: state .computed(state) - .getExternalModelTypesByNamespace(externalModelsByNamespace).dmns, + .getDirectlyIncludedExternalModelsByNamespace(externalModelsByNamespace).dmns, definitions: state.dmn.model.definitions, __readonly_drdIndex: state.computed(state).getDrdIndex(), __readonly_dmnObjectNamespace: @@ -393,8 +409,12 @@ export function DiagramCommands(props: {}) { drdIndex: state.computed(state).getDrdIndex(), edge: { id: edge.id, dmnObject: edge.data!.dmnObject }, mode: EdgeDeletionMode.FROM_CURRENT_DRD_ONLY, + externalModelsByNamespace, + }); + state.dispatch(state).diagram.setEdgeStatus(edge.id, { + selected: false, + draggingWaypoint: false, }); - state.dispatch(state).diagram.setEdgeStatus(edge.id, { selected: false, draggingWaypoint: false }); } } @@ -406,15 +426,16 @@ export function DiagramCommands(props: {}) { const { deletedDmnShapeOnCurrentDrd: deletedShape } = deleteNode({ definitions: state.dmn.model.definitions, __readonly_drgEdges: [], // Deleting from DRD only. - __readonly_externalModelTypesByNamespace: state + __readonly_externalDmnsIndex: state .computed(state) - .getExternalModelTypesByNamespace(externalModelsByNamespace), + .getDirectlyIncludedExternalModelsByNamespace(externalModelsByNamespace).dmns, __readonly_drdIndex: state.computed(state).getDrdIndex(), __readonly_dmnObjectNamespace: node.data.dmnObjectNamespace ?? state.dmn.model.definitions["@_namespace"], __readonly_dmnObjectQName: node.data.dmnObjectQName, __readonly_dmnObjectId: node.data.dmnObject?.["@_id"], __readonly_nodeNature: nodeNatures[node.type as NodeType], - mode: NodeDeletionMode.FROM_CURRENT_DRD_ONLY, + __readonly_mode: NodeDeletionMode.FROM_CURRENT_DRD_ONLY, + __readonly_externalModelsByNamespace: externalModelsByNamespace, }); if (deletedShape) { diff --git a/packages/dmn-editor/src/diagram/DrgNodesPanel.tsx b/packages/dmn-editor/src/diagram/DrgNodesPanel.tsx index 66b9903f8a4..2391eda1e09 100644 --- a/packages/dmn-editor/src/diagram/DrgNodesPanel.tsx +++ b/packages/dmn-editor/src/diagram/DrgNodesPanel.tsx @@ -61,8 +61,7 @@ export function DrgNodesPanel() { const containingDecisionServiceHrefsByDecisionHrefsRelativeToThisDmn = useMemo( () => computeContainingDecisionServiceHrefsByDecisionHrefs({ - drgElements: thisDmnsDrgElements, - drgElementsNamespace: thisDmnsNamespace, + drgElementsByNamespace: new Map([[thisDmnsNamespace, thisDmnsDrgElements]]), thisDmnsNamespace: thisDmnsNamespace, }), [thisDmnsDrgElements, thisDmnsNamespace] diff --git a/packages/dmn-editor/src/diagram/Palette.tsx b/packages/dmn-editor/src/diagram/Palette.tsx index 64f74263bc9..1bfed0c65d0 100644 --- a/packages/dmn-editor/src/diagram/Palette.tsx +++ b/packages/dmn-editor/src/diagram/Palette.tsx @@ -49,6 +49,7 @@ import { useInViewSelect } from "../responsiveness/useInViewSelect"; import { useDmnEditor } from "../DmnEditorContext"; import { getDrdId } from "./drd/drdId"; import { useSettings } from "../settings/DmnEditorSettingsContext"; +import { useExternalModels } from "../includedModels/DmnEditorDependenciesContext"; export const MIME_TYPE_FOR_DMN_EDITOR_NEW_NODE_FROM_PALETTE = "application/kie-dmn-editor--new-node-from-palette"; @@ -65,6 +66,7 @@ export function Palette({ pulse }: { pulse: boolean }) { const rfStoreApi = RF.useStoreApi(); const isAlternativeInputDataShape = useDmnEditorStore((s) => s.computed(s).isAlternativeInputDataShape()); const drdIndex = useDmnEditorStore((s) => s.computed(s).getDrdIndex()); + const { externalModelsByNamespace } = useExternalModels(); const settings = useSettings(); const groupNodes = useCallback(() => { @@ -88,11 +90,12 @@ export function Palette({ pulse }: { pulse: boolean }) { padding: CONTAINER_NODES_DESIRABLE_PADDING, }), }, + externalModelsByNamespace, }); state.dispatch(state).diagram.setNodeStatus(newNodeId, { selected: true }); }); - }, [dmnEditorStoreApi, rfStoreApi]); + }, [dmnEditorStoreApi, externalModelsByNamespace, rfStoreApi]); const drd = thisDmn.definitions["dmndi:DMNDI"]?.["dmndi:DMNDiagram"]?.[drdIndex]; @@ -101,6 +104,10 @@ export function Palette({ pulse }: { pulse: boolean }) { const { maxHeight } = useInViewSelect(dmnEditorRootElementRef, nodesPalletePopoverRef); + const clearCurrentFocusToAllowDraggingNewNode = useCallback(() => { + (document.activeElement as any)?.blur?.(); + }, []); + return ( <> @@ -162,7 +169,11 @@ export function Palette({ pulse }: { pulse: boolean }) { {!settings.isReadOnly && ( - +