Skip to content

Commit

Permalink
NO-ISSUE: jBPM Quarkus Dev UI and Compact Architecture Example genera…
Browse files Browse the repository at this point in the history
…l adjustments (Part 1) (apache#2710)
  • Loading branch information
tiagobento authored Oct 28, 2024
1 parent cda60cf commit e4f35da
Show file tree
Hide file tree
Showing 33 changed files with 327 additions and 306 deletions.
7 changes: 7 additions & 0 deletions _intellij-project/.idea/jsLibraryMappings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions _intellij-project/.idea/prettier.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions examples/jbpm-compact-architecture-example/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
docker-compose/.env
docker-compose/svg/
docker-compose/persistence/
445 changes: 258 additions & 187 deletions examples/jbpm-compact-architecture-example/README.md

Large diffs are not rendered by default.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
version: "3"

services:
postgres:
container_name: postgres
image: postgres:16.1-alpine3.19
profiles: ["infra", "example", "full"]
profiles: ["infra", "example-only", "full"]
ports:
- "5432:5432"
volumes:
Expand All @@ -21,7 +19,7 @@ services:
pgadmin:
container_name: pgadmin
image: dpage/pgadmin4:8.2
profiles: ["infra", "example", "full"]
profiles: ["infra", "example-only", "full"]
ports:
- 8055:80
depends_on:
Expand All @@ -45,7 +43,7 @@ services:
jbpm-compact-architecture-example-service:
container_name: jbpm-compact-architecture-example-service
image: dev.local/${USER}/jbpm-compact-architecture-example-service:${PROJECT_VERSION}
profiles: ["example", "full"]
profiles: ["example-only", "full"]
ports:
- "8080:8080"
environment:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,22 @@

PROFILE="full"

echo "Script requires your Kogito Example to be compiled"
echo "This script requires this example's app to have been compiled with 'mvn clean package -Pcontainer'"
echo "==="
echo "Using profile '${PROFILE}'..."

PROJECT_VERSION=$(cd ../ && mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
KOGITO_MANAGEMENT_CONSOLE_IMAGE=$(cd ../ && mvn help:evaluate -Dexpression=kogito.management-console.image -q -DforceStdout)

if [ -n "$1" ]; then
if [[ ("$1" == "full") || ("$1" == "infra") || ("$1" == "example")]];
if [[ ("$1" == "full") || ("$1" == "infra") || ("$1" == "example-only")]];
then
PROFILE="$1"
else
echo "Unknown docker profile '$1'. The supported profiles are:"
echo "* 'infra': Use this profile to start only the minimum infrastructure to run the example (postgresql, data-index & jobs-service)."
echo "* 'example': Use this profile to start the example infrastructure and the kogito-example service. Requires the example to be compiled using the 'container' profile (-Pcontainer)"
echo "* 'full' (default): Starts full example setup, including infrastructure (database, data-index & jobs-service), the kogito-example-service container and the runtime consoles (management-console & keycloak). Requires the example to be compiled using the 'container' profile (-Pcontainer)"
echo "* 'example-only': Use this profile to start the example infrastructure and the kogito-example service. Requires the example to have been compiled using the 'container' profile (-Pcontainer)"
echo "* 'full' (default): Starts full example setup, including infrastructure (database, data-index & jobs-service), the kogito-example-service container, Management Console, and Keycloak. Requires the example to have been compiled using the 'container' profile (-Pcontainer)"
exit 1;
fi
fi
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 9 additions & 13 deletions examples/jbpm-compact-architecture-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,23 @@
"url": "https://github.com/apache/incubator-kie-tools/issues"
},
"scripts": {
"build": "run-script-os",
"build:darwin:linux": "mvn clean install -P container",
"build:dev": "run-script-if --bool \"$(build-env examples.build)\" --then run-script-os",
"build:dev:darwin:linux": "mvn clean compile -DskipTests",
"build:dev:win32": "pnpm powershell \"mvn clean compile `-DskipTests \"",
"build:dev:win32": "pnpm powershell \"mvn clean compile `-DskipTests\"",
"build:prod": "pnpm lint && run-script-if --bool \"$(build-env examples.build)\" --then run-script-os",
"build:prod:darwin:linux": "mvn clean compile -DskipTests=$(build-env tests.run --not) -Dmaven.test.failure.ignore=$(build-env tests.ignoreFailures) -Pcontainer",
"build:prod:win32": "pnpm powershell \"mvn clean compile `-DskipTests `-Dmaven.test.failure.ignore=$(build-env tests.ignoreFailures) `-Pcontainer \"",
"build:prod:win32": "pnpm powershell \"mvn clean compile `-DskipTests `-Dmaven.test.failure.ignore=$(build-env tests.ignoreFailures) `-Pcontainer\"",
"install": "node install.js",
"lint": "echo 'Linting'",
"powershell": "@powershell -NoProfile -ExecutionPolicy Unrestricted -Command",
"quarkus:dev": "run-script-os",
"quarkus:dev:darwin:linux": "mvn clean package quarkus:dev -DskipTests -Pdevelopment",
"quarkus:dev:win32": "mvn clean package quarkus:dev `-DskipTests `-Pdevelopment",
"run": "run-script-os",
"run:darwin:linux": "cd ./docker-compose && sh startServices.sh",
"start": "run-script-os",
"start:darwin:linux": "pnpm run build && pnpm run run",
"start:win32": "echo Running full example ot supported in windows",
"stop": "run-script-os",
"stop:darwin:linux": "cd ./docker-compose && docker compose down"
"start:darwin:linux": "mvn quarkus:dev -DskipTests -Pdevelopment",
"start:win32": "mvn quarkus:dev `-DskipTests `-Pdevelopment",
"startContainers": "run-script-os || pnpm run stopContainers",
"startContainers:darwin:linux": "mvn clean install -Pcontainer && cd ./docker-compose && sh startContainers.sh",
"startContainers:win32": "echo Running containers example is not supported on Windows",
"stopContainers": "run-script-os",
"stopContainers:darwin:linux": "cd ./docker-compose && docker compose down"
},
"dependencies": {
"@kie-tools/jbpm-quarkus-devui": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion examples/jbpm-compact-architecture-example/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
<artifactId>kie-addons-quarkus-persistence-jdbc</artifactId>
</dependency>

<!-- Data Index Addon -->
<!-- Data-Index Addon -->
<dependency>
<groupId>org.kie</groupId>
<artifactId>kogito-addons-quarkus-data-index-jpa</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion packages/jbpm-quarkus-devui/dev/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
<artifactId>kogito-addons-quarkus-jobs-management</artifactId>
</dependency>

<!-- Data Index -->
<!-- Data-Index -->
<dependency>
<groupId>org.kie</groupId>
<artifactId>kogito-addons-quarkus-data-index-postgresql</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,14 +139,14 @@ public CardPageBuildItem pages(

cardPageBuildItem.addPage(Page.webComponentPageBuilder()
.componentLink("qwc-jbpm-quarkus-devui.js")
.metadata("page", "TaskInbox")
.metadata("page", "Tasks")
.title("Tasks")
.icon("font-awesome-solid:bars-progress")
.dynamicLabelJsonRPCMethodName("queryTasksCount"));

cardPageBuildItem.addPage(Page.webComponentPageBuilder()
.componentLink("qwc-jbpm-quarkus-devui.js")
.metadata("page", "JobsManagement")
.metadata("page", "Jobs")
.title("Jobs")
.icon("font-awesome-solid:clock")
.dynamicLabelJsonRPCMethodName("queryJobsCount"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
public class DevConsoleRuntimeConfig {

/**
* Mocked users data for the task inbox screen.
* Mocked users data for the Tasks screen.
*/
@ConfigItem(name = "users")
public Map<String, UserConfig> userConfigByUser;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ const TaskDetailsPage: React.FC<RouteComponentProps<Props> & OUIAProps> = ({ oui
<Card className={"kogito-management-console__full-size"}>
<ServerErrors error={error} variant="large">
<Button variant="primary" onClick={() => goToInbox()}>
Go to Inbox
Go to Tasks
</Button>
</ServerErrors>
</Card>
Expand Down Expand Up @@ -229,7 +229,7 @@ const TaskDetailsPage: React.FC<RouteComponentProps<Props> & OUIAProps> = ({ oui
taskInboxGatewayApi.clearOpenTask();
}}
>
Task Inbox
Tasks
</Link>
</BreadcrumbItem>
<BreadcrumbItem>{userTask.referenceName}</BreadcrumbItem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import { Card } from "@patternfly/react-core/dist/js/components/Card";

const TasksPage: React.FC<OUIAProps> = (ouiaId, ouiaSafe) => {
useEffect(() => {
return ouiaPageTypeAndObjectId("task-inbox-page");
return ouiaPageTypeAndObjectId("tasks-page");
});

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ const DevUINav: React.FC<IOwnProps> = ({ pathname }) => {
</NavItem>
)}
{(!availablePages || availablePages.includes("Jobs")) && (
<NavItem key={"jobs-management-nav"} isActive={pathname === "/JobsManagement"}>
<Link to="/JobsManagement" {...ouiaAttribute("data-ouia-navigation-name", "jobs-management-nav")}>
<NavItem key={"jobs-management-nav"} isActive={pathname === "/Jobs"}>
<Link to="/Jobs" {...ouiaAttribute("data-ouia-navigation-name", "jobs-management-nav")}>
Jobs
</Link>
</NavItem>
)}
{(!availablePages || availablePages.includes("Tasks")) && (
<NavItem key={"task-inbox-nav"} isActive={pathname === "/TaskInbox"}>
<Link to="/TaskInbox" {...ouiaAttribute("data-ouia-navigation-name", "task-inbox-nav")}>
<NavItem key={"tasks-nav"} isActive={pathname === "/Tasks"}>
<Link to="/Tasks" {...ouiaAttribute("data-ouia-navigation-name", "tasks-nav")}>
Tasks
</Link>
</NavItem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ interface IOwnProps {

type DevUIRoute = { enabled: () => boolean; node: React.ReactNode };

const defaultPath = "/JobsManagement";
const defaultPath = "/Jobs";

const defaultButton = "Go to jobs management";
const defaultButton = "Go to Jobs";

const DevUIRoutes: React.FC<IOwnProps> = ({ navigate }) => {
const context = useDevUIAppContext();
Expand All @@ -58,11 +58,11 @@ const DevUIRoutes: React.FC<IOwnProps> = ({ navigate }) => {
},
{
enabled: () => context.isProcessEnabled,
node: <Route key="3" exact path="/JobsManagement" component={JobsManagementPage} />,
node: <Route key="3" exact path="/Jobs" component={JobsManagementPage} />,
},
{
enabled: () => context.isProcessEnabled,
node: <Route key="4" exact path="/TaskInbox" component={TaskInboxPage} />,
node: <Route key="4" exact path="/Tasks" component={TaskInboxPage} />,
},
{
enabled: () => context.isProcessEnabled,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const TaskInboxContainer: React.FC<OUIAProps> = ({ ouiaId, ouiaSafe }) => {

return (
<EmbeddedTaskInbox
{...componentOuiaProps(ouiaId, "task-inbox-container", ouiaSafe)}
{...componentOuiaProps(ouiaId, "tasks-container", ouiaSafe)}
initialState={gatewayApi.taskInboxState}
driver={gatewayApi}
allTaskStates={getAllTaskStates()}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const JobsManagementPage: React.FC<OUIAProps> = ({ ouiaId, ouiaSafe }) => {

return (
<React.Fragment>
<PageSectionHeader titleText="Jobs Management" ouiaId={ouiaId} />
<PageSectionHeader titleText="Jobs" ouiaId={ouiaId} />
<PageSection {...componentOuiaProps(ouiaId, "jobs-management-page-section", ouiaSafe)}>
<Card className="Dev-ui__card-size">
<JobsManagementContainer />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ const TaskDetailsPage: React.FC<RouteComponentProps<Props> & OUIAProps> = ({ oui
details: notificationDetails,
customActions: [
{
label: "Go to Task Inbox",
label: "Go to Tasks",
onClick: () => {
setNotification(null);
goToInbox();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const TaskInboxPage: React.FC<OUIAProps> = (ouiaId, ouiaSafe) => {
const appContext = useDevUIAppContext();
const user: string = appContext.getCurrentUser().id;
useEffect(() => {
return ouiaPageTypeAndObjectId("task-inbox-page");
return ouiaPageTypeAndObjectId("tasks-page");
});

const renderTaskInbox = (): JSX.Element => {
Expand All @@ -46,18 +46,16 @@ const TaskInboxPage: React.FC<OUIAProps> = (ouiaId, ouiaSafe) => {
<React.Fragment>
<PageSection
variant="light"
{...componentOuiaProps("header" + (ouiaId ? "-" + ouiaId : ""), "task-inbox-page", ouiaSafe)}
{...componentOuiaProps("header" + (ouiaId ? "-" + ouiaId : ""), "tasks-page", ouiaSafe)}
>
<Grid>
<GridItem span={10}>
<PageTitle title="Task Inbox" />
<PageTitle title="Tasks" />
</GridItem>
<GridItem span={2}>{user.length > 0 && <TaskInboxSwitchUser user={user} />}</GridItem>
</Grid>
</PageSection>
<PageSection
{...componentOuiaProps("content" + (ouiaId ? "-" + ouiaId : ""), "task-inbox-page-section", ouiaSafe)}
>
<PageSection {...componentOuiaProps("content" + (ouiaId ? "-" + ouiaId : ""), "tasks-page-section", ouiaSafe)}>
<Card className="Dev-ui__card-size">{renderTaskInbox()}</Card>
</PageSection>
</React.Fragment>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ const TaskInboxSwitchUser: React.FC<IOwnProps & OUIAProps> = ({ user, ouiaId, ou
isPlain
dropdownItems={dropdownItems()}
className="DevUI-switchUser-dropdown-styling"
{...componentOuiaProps(ouiaId, "task-inbox-switch-user", ouiaSafe)}
{...componentOuiaProps(ouiaId, "tasks-switch-user", ouiaSafe)}
/>
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import { JobsManagementEnvelopeApiImpl } from "./JobsManagementEnvelopeApiImpl";
/**
* Function that starts an Envelope application.
* @param args.config: This passes envelope div config
* @param args.container: The HTML element in which the Jobs Management View will render
* @param args.container: The HTML element in which the Jobs view will render
* @param args.bus: The implementation of a `bus` that knows how to send messages to the Channel.
*
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@
* specific language governing permissions and limitations
* under the License.
*/

/**
* This is a convenience class that the Envelope view can use.
* Since the Jobs Management View is very simple, it's empty.
* Since the Jobs View is very simple, it's empty.
*/

// eslint-disable-next-line @typescript-eslint/no-empty-interface
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ const JobsManagementTable: React.FC<JobsManagementTableProps & OUIAProps> = ({
actionResolver={checkNotEmpty() ? actionResolver : undefined}
sortBy={sortBy}
onSort={onSort}
aria-label="Jobs management Table"
aria-label="Jobs table"
className="kogito-jobs-management__table"
{...componentOuiaProps(ouiaId, "jobs-management-table", ouiaSafe)}
>
Expand Down
Loading

0 comments on commit e4f35da

Please sign in to comment.