Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kie-issues#833: Move all UI packages from kogito-apps to kie-tools #2180

Merged
merged 24 commits into from
Mar 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 3 additions & 3 deletions examples/uniforms-patternfly/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@
"@kie-tools/tsconfig": "workspace:*",
"@types/react": "^17.0.6",
"@types/react-dom": "^17.0.5",
"@types/react-router": "^5.1.14",
"@types/react-router-dom": "^5.1.7",
"@types/react-router": "^5.1.20",
"@types/react-router-dom": "^5.3.3",
"@types/simpl-schema": "^1.12.0",
"copy-webpack-plugin": "^11.0.0",
"react-router-dom": "^5.2.1",
"react-router-dom": "^5.3.4",
"rimraf": "^3.0.2",
"typescript": "^4.6.2",
"webpack": "^5.88.2",
Expand Down
6 changes: 3 additions & 3 deletions examples/webapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@
"@kie-tools/tsconfig": "workspace:*",
"@types/react": "^17.0.6",
"@types/react-dom": "^17.0.5",
"@types/react-router": "^5.1.14",
"@types/react-router-dom": "^5.1.7",
"@types/react-router": "^5.1.20",
"@types/react-router-dom": "^5.3.3",
"copy-webpack-plugin": "^11.0.0",
"react-router-dom": "^5.2.1",
"react-router-dom": "^5.3.4",
"rimraf": "^3.0.2",
"typescript": "^4.6.2",
"webpack": "^5.88.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/dashbuilder-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"build:prod": "pnpm build:dev",
"copy:dashbuilder": "run-script-os",
"copy:dashbuilder:linux:darwin": "copyfiles -e \"../**/*/WEB-INF/**/*\" -e \"../**/*/ace/**/*\" -u 6 \"../dashbuilder/dashbuilder-runtime-parent/dashbuilder-runtime-client/target/dashbuilder-runtime-client/**/*\" ./dist/",
"copy:dashbuilder:win32": "mkdir dist && touch dist/.keep && echo \"Build not supported on Windows\""
"copy:dashbuilder:win32": "copyfiles -e \"../**/*/WEB-INF/**/*\" -e \"../**/*/ace/**/*\" -u 6 \"../dashbuilder/dashbuilder-runtime-parent/dashbuilder-runtime-client/target/dashbuilder-runtime-client/**/*\" ./dist/"
},
"devDependencies": {
"@kie-tools/dashbuilder": "workspace:*",
Expand Down
8 changes: 4 additions & 4 deletions packages/dashbuilder-viewer-deployment-webapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
"@patternfly/react-icons": "^4.93.6",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-router": "^5.2.1",
"react-router-dom": "^5.2.1"
"react-router": "^5.3.4",
"react-router-dom": "^5.3.4"
},
"devDependencies": {
"@babel/core": "^7.16.0",
Expand All @@ -50,8 +50,8 @@
"@types/jest-when": "^2.7.4",
"@types/react": "^17.0.6",
"@types/react-dom": "^17.0.5",
"@types/react-router": "^5.1.14",
"@types/react-router-dom": "^5.1.7",
"@types/react-router": "^5.1.20",
"@types/react-router-dom": "^5.3.3",
"copy-webpack-plugin": "^11.0.0",
"html-replace-webpack-plugin": "^2.6.0",
"html-webpack-plugin": "^5.3.2",
Expand Down
6 changes: 3 additions & 3 deletions packages/dashbuilder/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@
"build:dev:linux:darwin": "mvn clean install -DskipTests -Dgwt.compiler.skip=true",
"build:dev:runtime": "run-script-os",
"build:dev:runtime:linux:darwin": "cd ./dashbuilder-runtime-parent/dashbuilder-runtime-client/ && mvn clean install -Psources -DskipTests",
"build:dev:runtime:win32": "echo \"Build not supported on Windows\"",
"build:dev:runtime:win32": "cd ./dashbuilder-runtime-parent/dashbuilder-runtime-client/ && mvn clean install -Psources -DskipTests",
"build:dev:win32": "pnpm powershell \"mvn clean install `-DskipTests `-Dgwt.compiler.skip=true\"",
"build:prod": "pnpm copy:components && pnpm lint && run-script-os && pnpm build:prod:runtime && pnpm delete:components",
"build:prod:darwin": "mvn clean install -Dgwt.compiler.skip=true -DskipTests",
"build:prod:linux": "mvn clean install -Dgwt.compiler.skip=true -DskipTests=$(build-env tests.run --not) -Dmaven.test.failure.ignore=$(build-env tests.ignoreFailures)",
"build:prod:runtime": "run-script-os",
"build:prod:runtime:darwin": "cd ./dashbuilder-runtime-parent/dashbuilder-runtime-client/ && mvn clean install -Dfull -DskipTests",
"build:prod:runtime:darwin": "cd ./dashbuilder-runtime-parent/dashbuilder-runtime-client/ && mvn clean install -Psources -DskipTests",
"build:prod:runtime:linux": "cd ./dashbuilder-runtime-parent/dashbuilder-runtime-client/ && mvn clean install -Dfull -DskipTests=$(build-env tests.run --not) -Dmaven.test.failure.ignore=$(build-env tests.ignoreFailures)",
"build:prod:runtime:win32": "echo \"Build not supported on Windows\"",
"build:prod:runtime:win32": "cd ./dashbuilder-runtime-parent/dashbuilder-runtime-client/ && mvn clean install -Psources -DskipTests",
"build:prod:win32": "pnpm powershell \"mvn clean install `-Dgwt.compiler.skip=true `-DskipTests\"",
"copy:components": "pnpm delete:components && copyfiles -u 3 \"../dashbuilder-component-assembler/dist/**/*\" ./dashbuilder-runtime-parent/dashbuilder-runtime-client/src/main/webapp/dashbuilder/component",
"delete:components": "rimraf ./dashbuilder-runtime-parent/dashbuilder-runtime-client/src/main/webapp/dashbuilder/component",
Expand Down
13 changes: 5 additions & 8 deletions packages/dev-deployment-dmn-form-webapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@
"build:prod": "pnpm lint && pnpm test && rimraf dist && webpack",
"lint": "run-script-if --bool \"$(build-env linters.run)\" --then \"kie-tools--eslint ./src\"",
"start": "cross-env WEBPACK__sourceMaps=false node ./dev-webapp/start.js",
"test": "run-script-os",
"test:linux": "run-script-if --ignore-errors \"$(build-env tests.ignoreFailures)\" --bool \"$(build-env tests.run)\" --then \"jest --silent --verbose\"",
"test:win32:darwin": "echo 'Not supported'"
"test": "run-script-if --ignore-errors \"$(build-env tests.ignoreFailures)\" --bool \"$(build-env tests.run)\" --then \"jest --silent --verbose\""
},
"dependencies": {
"@kie-tools-core/i18n": "workspace:*",
Expand All @@ -38,8 +36,8 @@
"lodash": "^4.17.21",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-router": "^5.2.1",
"react-router-dom": "^5.2.1"
"react-router": "^5.3.4",
"react-router-dom": "^5.3.4"
},
"devDependencies": {
"@babel/core": "^7.16.0",
Expand All @@ -56,8 +54,8 @@
"@types/lodash": "^4.14.168",
"@types/react": "^17.0.6",
"@types/react-dom": "^17.0.5",
"@types/react-router": "^5.1.14",
"@types/react-router-dom": "^5.1.7",
"@types/react-router": "^5.1.20",
"@types/react-router-dom": "^5.3.3",
"@types/testing-library__jest-dom": "^5.9.1",
"@types/testing-library__react": "^9.1.2",
"copy-webpack-plugin": "^11.0.0",
Expand All @@ -69,7 +67,6 @@
"node-polyfill-webpack-plugin": "^2.0.1",
"process": "^0.11.10",
"rimraf": "^3.0.2",
"run-script-os": "^1.1.6",
"ts-jest": "^26.5.6",
"typescript": "^4.6.2",
"webpack": "^5.88.2",
Expand Down
4 changes: 2 additions & 2 deletions packages/k8s-yaml-to-apiserver-requests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@
"@kie-tools/tsconfig": "workspace:*",
"@types/jest": "^26.0.23",
"@types/js-yaml": "^4.0.5",
"@types/react-router": "^5.1.14",
"@types/react-router": "^5.1.20",
"jest": "^26.6.3",
"jest-junit": "^14.0.0",
"react-router": "^5.2.1",
"react-router": "^5.3.4",
"rimraf": "^3.0.2",
"ts-jest": "^26.5.6",
"ts-node": "^10.9.1",
Expand Down
4 changes: 2 additions & 2 deletions packages/kie-editors-standalone/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"@types/minimatch": "^3.0.5",
"@types/react": "^17.0.6",
"@types/react-dom": "^17.0.5",
"@types/react-router-dom": "^5.1.7",
"@types/react-router-dom": "^5.3.3",
"@types/underscore": "^1.11.2",
"copy-webpack-plugin": "^11.0.0",
"cypress": "^13.5.1",
Expand All @@ -77,7 +77,7 @@
"raw-loader": "^4.0.2",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-router-dom": "^5.2.1",
"react-router-dom": "^5.3.4",
"rimraf": "^3.0.2",
"run-script-os": "^1.1.6",
"start-server-and-test": "^1.12.1",
Expand Down
8 changes: 4 additions & 4 deletions packages/online-editor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-dropzone": "^11.4.2",
"react-router": "^5.2.1",
"react-router-dom": "^5.2.1",
"react-router": "^5.3.4",
"react-router-dom": "^5.3.4",
"react-virtualized-auto-sizer": "^1.0.7",
"react-window": "^1.3.1",
"uuid": "^8.3.2"
Expand All @@ -99,8 +99,8 @@
"@types/lodash": "^4.14.168",
"@types/react": "^17.0.6",
"@types/react-dom": "^17.0.5",
"@types/react-router": "^5.1.14",
"@types/react-router-dom": "^5.1.7",
"@types/react-router": "^5.1.20",
"@types/react-router-dom": "^5.3.3",
"@types/react-virtualized-auto-sizer": "^1.0.1",
"@types/react-window": "^1.8.5",
"@types/testing-library__jest-dom": "^5.9.1",
Expand Down
8 changes: 4 additions & 4 deletions packages/pmml-editor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@
"react-dom": "^17.0.2",
"react-monaco-editor": "^0.49.0",
"react-redux": "^7.2.4",
"react-router": "^5.2.1",
"react-router-dom": "^5.2.1",
"react-router": "^5.3.4",
"react-router-dom": "^5.3.4",
"react-sortable-hoc": "^2.0.0",
"react-transition-group": "^4.4.1",
"redux": "^4.1.0",
Expand All @@ -78,8 +78,8 @@
"@types/react": "^17.0.6",
"@types/react-dom": "^17.0.5",
"@types/react-redux": "^7.1.16",
"@types/react-router": "^5.1.14",
"@types/react-router-dom": "^5.1.7",
"@types/react-router": "^5.1.20",
"@types/react-router-dom": "^5.3.3",
"@types/react-transition-group": "^4.4.1",
"@types/testing-library__jest-dom": "^5.9.1",
"@types/testing-library__react": "^9.1.2",
Expand Down
12 changes: 7 additions & 5 deletions packages/runtime-tools-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,23 +29,25 @@
"@kie-tools-core/operating-system": "workspace:*",
"@kie-tools-core/patternfly-base": "workspace:*",
"@kie-tools/json-yaml-language-service": "workspace:*",
"@kie-tools/runtime-tools-gateway-api": "workspace:*",
"@kie-tools/runtime-tools-shared-gateway-api": "workspace:*",
"@kie-tools/uniforms-patternfly": "workspace:*",
"@patternfly/react-core": "^4.276.6",
"@patternfly/react-icons": "^4.93.6",
"@patternfly/react-styles": "^4.92.6",
"@patternfly/react-table": "^4.112.39",
"ajv": "^6.12.6",
"axios": "^1.6.4",
"copyfiles": "^2.4.1",
"history": "^4.9.0",
"keycloak-js": "^13.0.1",
"lodash": "^4.17.21",
"monaco-editor": "^0.39.0",
"react": "^17.0.2",
"react-datetime-picker": "^3.5.0",
"react-dom": "^17.0.2",
"react-moment": "0.9.7",
"react-router": "^5.2.1",
"react-router-dom": "^5.2.1",
"react-router": "^5.3.4",
"react-router-dom": "^5.3.4",
"uniforms": "^3.10.2",
"uniforms-bridge-json-schema": "^3.10.2",
"uuid": "^8.3.2"
Expand All @@ -62,8 +64,8 @@
"@types/react": "^17.0.6",
"@types/react-datetime-picker": "^3.4.1",
"@types/react-dom": "^17.0.5",
"@types/react-router": "^5.1.14",
"@types/react-router-dom": "^5.1.7",
"@types/react-router": "^5.1.20",
"@types/react-router-dom": "^5.3.3",
"@types/testing-library__jest-dom": "^5.9.1",
"@types/uuid": "^8.3.0",
"jest": "^26.6.3",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
import React from "react";
import { AboutModal } from "@patternfly/react-core/dist/js/components/AboutModal";
import { TextContent, Text, TextList, TextListItem } from "@patternfly/react-core/dist/js/components/Text";

import "../styles.css";
import aboutPageBackground from "../../static/kogitoAbout.png";
import { OUIAProps, componentOuiaProps } from "../../ouiaTools";
import { useBrandContext } from "../../contexts/BrandContext/BrandContext";

declare global {
interface Window {
DATA_INDEX_ENDPOINT: string;
}
}

export interface IOwnProps {
isOpenProp: boolean;
handleModalToggleProp: any;
}
const AboutModalBox: React.FC<IOwnProps & OUIAProps> = ({ isOpenProp, handleModalToggleProp, ouiaId, ouiaSafe }) => {
const dataIndexURL = window.DATA_INDEX_ENDPOINT || process.env.KOGITO_DATAINDEX_HTTP_URL;
const brandContext = useBrandContext();
return (
<AboutModal
isOpen={isOpenProp}
onClose={handleModalToggleProp}
trademark={`${process.env.KOGITO_APP_NAME} is part of Kogito, an open source software released under the Apache Software License 2.0`}
brandImageSrc={brandContext.imageSrc}
brandImageAlt={brandContext.altText}
className="kogito-consoles-common--aboutModalBox"
backgroundImageSrc={aboutPageBackground}
{...componentOuiaProps(ouiaId, "AboutModalBox", ouiaSafe)}
>
<TextContent>
<Text component="h5" />
<TextList component="dl">
<TextListItem component="dt">Version: </TextListItem>
<TextListItem component="dd">{process.env.KOGITO_APP_VERSION}</TextListItem>
<TextListItem component="dt">License information: </TextListItem>
<TextListItem component="dd">
<a href="https://github.com/kiegroup/kogito-runtimes/blob/main/LICENSE" target="_blank" rel="noreferrer">
https://github.com/kiegroup/kogito-runtimes/blob/main/LICENSE
</a>
</TextListItem>
<TextListItem component="dt">Report a bug: </TextListItem>
<TextListItem component="dd">
<a href="https://issues.redhat.com/projects/KOGITO" target="_blank" rel="noreferrer">
https://issues.redhat.com/projects/KOGITO
</a>
</TextListItem>
<TextListItem component="dt">Get involved/help/docs: </TextListItem>
<TextListItem component="dd">
<a href="https://docs.jboss.org/kogito/release/latest/html_single/" target="_blank" rel="noreferrer">
https://docs.jboss.org/kogito/release/latest/html_single/
</a>
</TextListItem>
<TextListItem component="dt">Kogito URL: </TextListItem>
<TextListItem component="dd">
<a href="https://kogito.kie.org" target="_blank" rel="noreferrer">
https://kogito.kie.org
</a>
</TextListItem>
<TextListItem component="dt">Data-Index URL: </TextListItem>
<TextListItem component="dd">{dataIndexURL} </TextListItem>
</TextList>
</TextContent>
</AboutModal>
);
};

export default AboutModalBox;
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import {
ICell,
sortable,
ISortBy,
SortByDirection,
} from "@patternfly/react-table/dist/js/components/Table";
import isEmpty from "lodash/isEmpty";
import filter from "lodash/filter";
Expand Down Expand Up @@ -56,7 +57,7 @@ interface IOwnProps {
LoadingComponent?: React.ReactNode;
ErrorComponent?: React.ReactNode;
sortBy?: ISortBy;
onSorting?: (index: number, direction: string) => void;
onSorting?: (index: number, direction: SortByDirection) => void;
}

const getCellData = (dataObj: Record<string, any>, path: string): string => {
Expand All @@ -67,7 +68,7 @@ const getCellData = (dataObj: Record<string, any>, path: string): string => {
}
};

const getColumns = (data: any[], columns: DataTableColumn[]) => {
const getColumns = (data: any[] | undefined, columns: DataTableColumn[]) => {
if (data) {
return columns
? filter(columns, (column) => !isEmpty(column.path)).map((column) => {
Expand Down Expand Up @@ -138,7 +139,7 @@ export const DataTable: React.FC<IOwnProps & OUIAProps> = ({

useEffect(() => {
if (isLoading) {
const cols = getColumns([], columns);
const cols = getColumns(undefined, columns);
const row = [
{
cells: [
Expand All @@ -159,7 +160,7 @@ export const DataTable: React.FC<IOwnProps & OUIAProps> = ({
setColumnList(cols);
setRows(row);
} else if (isEmpty(data)) {
const cols = getColumns([], columns);
const cols = getColumns(undefined, columns);
const row = [
{
cells: [
Expand All @@ -186,7 +187,7 @@ export const DataTable: React.FC<IOwnProps & OUIAProps> = ({
}
}, [data, isLoading]);

const onSort = (event: any, index: number, direction: any) => {
const onSort = (event: any, index: number, direction: SortByDirection) => {
if (isFunction(onSorting)) {
onSorting(index, direction);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export const FormNotification: React.FC<IOwnProps & OUIAProps> = ({ notification
)}
{notification.customActions &&
notification.customActions.length > 0 &&
notification.customActions.map((customAction: Action, index: number) => {
notification.customActions.map((customAction, index) => {
return (
<AlertActionLink onClick={customAction.onClick} key={index}>
{customAction.label}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ import { componentOuiaProps, OUIAProps } from "../../ouiaTools";
import { FormAction, lookupValidator, ModelConversionTool } from "../../utils";
import { FormFooter } from "../FormFooter";
import "../styles.css";
import { FormRendererApi } from "@kie-tools/runtime-tools-gateway-api/dist/types";

export interface FormRendererApi {
doReset: () => void;
}

interface IOwnProps {
formSchema: any;
Expand Down
Loading
Loading