-
Notifications
You must be signed in to change notification settings - Fork 191
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
KOGITO-5611: Move SWF runtime tools packages from kogito-apps to kie-…
…tools (#1982)
- Loading branch information
Showing
224 changed files
with
28,657 additions
and
610 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 {}; | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
} |
140 changes: 140 additions & 0 deletions
140
packages/runtime-tools-components/src/common/components/BulkList/BulkList.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | ||
); | ||
}; |
20 changes: 20 additions & 0 deletions
20
packages/runtime-tools-components/src/common/components/BulkList/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"; |
Oops, something went wrong.