Skip to content

Commit

Permalink
KOGITO-5611: Move SWF runtime tools packages from kogito-apps to kie-…
Browse files Browse the repository at this point in the history
…tools (#1982)
  • Loading branch information
paulovmr authored Sep 29, 2023
1 parent fb9d3e1 commit ff4bdb1
Show file tree
Hide file tree
Showing 224 changed files with 28,657 additions and 610 deletions.
18 changes: 0 additions & 18 deletions .github/workflows/ci_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ jobs:
pnpm
-F='!@kie-tools/serverless-logic-web-tools-swf-dev-mode-image'
-F='!@kie-tools/dmn-dev-deployment-base-image'
-F='!@kie-tools/serverless-logic-web-tools-swf-builder-image'
-F='!@kie-tools/serverless-logic-web-tools-base-builder-image'
-F='!@kie-tools/dashbuilder-viewer-image'
-r --workspace-concurrency=1 build:prod
Expand Down Expand Up @@ -141,23 +140,6 @@ jobs:
echo "Build @kie-tools/dmn-dev-deployment-base-image"
pnpm -F @kie-tools/dmn-dev-deployment-base-image... --workspace-concurrency=1 build:prod
- name: "FULL → Build → serverless-logic-web-tools-swf-builder-image"
if: steps.setup_build_mode.outputs.mode == 'full' && runner.os == 'Linux'
env:
KIE_TOOLS_BUILD__runTests: "true"
KIE_TOOLS_BUILD__runIntegrationTests: "true"
KIE_TOOLS_BUILD__buildContainerImages: "true"
run: |
echo "Clean up container image resources"
if command -v docker &> /dev/null; then
docker system prune -af
fi
if command -v podman &> /dev/null; then
podman system prune --all --force
fi
echo "Build @kie-tools/serverless-logic-web-tools-swf-builder-image"
pnpm -F @kie-tools/serverless-logic-web-tools-swf-builder-image... --workspace-concurrency=1 build:prod
- name: "FULL → Build → serverless-logic-web-tools-base-builder-image"
if: steps.setup_build_mode.outputs.mode == 'full' && runner.os == 'Linux'
env:
Expand Down
27 changes: 27 additions & 0 deletions packages/runtime-tools-components/env/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* 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, composeEnv } = require("@kie-tools-scripts/build-env");

module.exports = composeEnv([require("@kie-tools/root-env/env")], {
vars: varsWithName({}),
get env() {
return {};
},
});
81 changes: 81 additions & 0 deletions packages/runtime-tools-components/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
{
"name": "@kie-tools/runtime-tools-components",
"version": "0.0.0",
"description": "",
"license": "Apache-2.0",
"keywords": [],
"homepage": "https://github.com/kiegroup/kie-tools",
"repository": {
"type": "git",
"url": "https://github.com/kiegroup/kie-tools.git"
},
"bugs": {
"url": "https://github.com/kiegroup/kie-tools/issues"
},
"types": "./dist/index.d.ts",
"main": "dist/index.js",
"files": [
"dist"
],
"scripts": {
"build:dev": "rimraf dist && tsc -p tsconfig.json && pnpm copy:css",
"build:prod": "pnpm lint && rimraf dist && tsc -p tsconfig.json && pnpm copy:css && pnpm test",
"copy:css": "copyfiles -u 2 \"src/**/*.{sass,scss,css,svg,png}\" dist/",
"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": {
"@kie-tools-core/editor": "workspace:*",
"@kie-tools-core/envelope": "workspace:*",
"@kie-tools-core/envelope-bus": "workspace:*",
"@kie-tools-core/i18n": "workspace:*",
"@kie-tools-core/monaco-editor": "workspace:*",
"@kie-tools-core/notifications": "workspace:*",
"@kie-tools-core/operating-system": "workspace:*",
"@kie-tools-core/patternfly-base": "workspace:*",
"@kie-tools/i18n-common-dictionary": "workspace:*",
"@kie-tools/json-yaml-language-service": "workspace:*",
"@kie-tools/runtime-tools-gateway-api": "workspace:*",
"@kie-tools/uniforms-patternfly": "workspace:*",
"@patternfly/react-core": "^4.276.6",
"@patternfly/react-icons": "^4.93.6",
"@patternfly/react-table": "^4.112.39",
"ajv": "^6.12.6",
"copyfiles": "^2.4.1",
"jsonpath": "^1.1.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",
"uniforms": "^3.10.2",
"uniforms-bridge-json-schema": "^3.10.2",
"uuid": "^8.3.2"
},
"devDependencies": {
"@babel/core": "^7.16.0",
"@babel/preset-env": "^7.16.0",
"@babel/preset-react": "^7.16.0",
"@kie-tools-core/webpack-base": "workspace:*",
"@kie-tools/eslint": "workspace:*",
"@kie-tools/root-env": "workspace:*",
"@kie-tools/tsconfig": "workspace:*",
"@testing-library/jest-dom": "^5.16.1",
"@types/jest": "^26.0.23",
"@types/jest-when": "^2.7.4",
"@types/jsonpath": "^0.2.0",
"@types/lodash": "^4.14.168",
"@types/react": "^17.0.6",
"@types/react-datetime-picker": "^3.4.1",
"@types/react-dom": "^17.0.5",
"@types/testing-library__jest-dom": "^5.9.1",
"@types/uuid": "^8.3.0",
"jest": "^26.6.3",
"jest-junit": "^14.0.0",
"jest-when": "^3.5.0",
"rimraf": "^3.0.2",
"ts-jest": "^26.5.6",
"typescript": "^4.6.2"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
/*
* 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 {
TextContent,
TextVariants,
Text,
TextList,
TextListItem,
} from "@patternfly/react-core/dist/js/components/Text";
import { Divider } from "@patternfly/react-core/dist/js/components/Divider";
import { ItemDescriptor } from "../ItemDescriptor";
import { OUIAProps, componentOuiaProps } from "../../ouiaTools";

export enum BulkListType {
PROCESS_INSTANCE = "process_instance",
JOB = "job",
WORKFLOW = "workflow",
}
export interface IOperationResult {
successItems: BulkListItem[];
failedItems: BulkListItem[];
ignoredItems: BulkListItem[];
}
export interface IOperationMessages {
successMessage: string;
warningMessage?: string;
ignoredMessage: string;
noItemsMessage: string;
}

export interface IOperationFunctions {
perform: () => void;
}

export interface IOperationResults {
[key: string]: IOperationResult;
}

export interface IOperation {
type: string;
results: IOperationResult;
messages: IOperationMessages;
functions: IOperationFunctions;
}

export interface IOperations {
[key: string]: IOperation;
}
export interface IOwnProps {
operationResult: IOperation;
}
export interface BulkListItem {
id: string;
name?: string;
description?: string;
errorMessage?: string;
}

export const BulkList: React.FC<IOwnProps & OUIAProps> = ({ operationResult, ouiaId, ouiaSafe }) => {
const iterateItems = (itemList: BulkListItem[]) => {
return (
<TextList>
{itemList.map((item: BulkListItem) => {
return (
<TextListItem key={item.id}>
<strong>
<ItemDescriptor itemDescription={item} />
</strong>{" "}
{item.errorMessage && <span> - {item.errorMessage}</span>}
</TextListItem>
);
})}
</TextList>
);
};
return (
<div {...componentOuiaProps(ouiaId, "bulk-list", ouiaSafe)}>
{operationResult.results.successItems.length > 0 ? (
<>
<TextContent>
<Text component={TextVariants.h2}>{operationResult.messages.successMessage}</Text>
{iterateItems(operationResult.results.successItems)}
</TextContent>
{operationResult.results.successItems.length !== 0 && operationResult.messages.warningMessage && (
<TextContent className="pf-u-mt-sm">
<Text component={TextVariants.small}>{operationResult.messages.warningMessage}</Text>
</TextContent>
)}
</>
) : (
<TextContent>
<Text component={TextVariants.h2}>{operationResult.messages.noItemsMessage}</Text>
</TextContent>
)}
{operationResult.results.ignoredItems.length !== 0 && (
<>
<Divider component="div" className="pf-u-my-xl" />
<TextContent>
<Text component={TextVariants.h2}>
{operationResult.type === BulkListType.PROCESS_INSTANCE && <span>Ignored process instances:</span>}
{operationResult.type === BulkListType.WORKFLOW && <span>Ignored workflows:</span>}
{operationResult.type === BulkListType.JOB && <span>Ignored jobs:</span>}
</Text>
<Text component={TextVariants.small} className="pf-u-mt-sm">
<span>{operationResult.messages.ignoredMessage}</span>
</Text>
{iterateItems(operationResult.results.ignoredItems)}
</TextContent>
</>
)}
{operationResult.results.failedItems.length !== 0 && (
<>
<Divider component="div" className="pf-u-my-xl" />
<TextContent>
<Text component={TextVariants.h2}>Errors:</Text>
{iterateItems(operationResult.results.failedItems)}
</TextContent>
</>
)}
</div>
);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
* 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.
*/

export * from "./BulkList";
Loading

0 comments on commit ff4bdb1

Please sign in to comment.