diff --git a/management-console/src/main/java/org/kie/kogito/mgmt/VertxRouter.java b/management-console/src/main/java/org/kie/kogito/mgmt/VertxRouter.java index dee1b7c4d1..7fef48ad81 100644 --- a/management-console/src/main/java/org/kie/kogito/mgmt/VertxRouter.java +++ b/management-console/src/main/java/org/kie/kogito/mgmt/VertxRouter.java @@ -40,7 +40,7 @@ public void init() { void setupRouter(@Observes Router router) { router.route("/").handler(ctx -> ctx.response().putHeader("location", "/ProcessInstances/").setStatusCode(302).end()); - router.route("/ProcessInstances*").handler(ctx -> handle(ctx)); + router.route("/Process*").handler(ctx -> handle(ctx)); router.route("/DomainExplorer*").handler(ctx -> handle(ctx)); router.route().handler(StaticHandler.create()); } diff --git a/management-console/src/test/java/org/kie/kogito/mgmt/VertxRouterTest.java b/management-console/src/test/java/org/kie/kogito/mgmt/VertxRouterTest.java index ca8037cda9..4c6c7735c9 100644 --- a/management-console/src/test/java/org/kie/kogito/mgmt/VertxRouterTest.java +++ b/management-console/src/test/java/org/kie/kogito/mgmt/VertxRouterTest.java @@ -14,7 +14,7 @@ public void testHandlePath() { .then() .statusCode(200); - given().when().get("/ProcessInstances/a1e139d5-4e77-48c9-84ae-34578e904e5a") + given().when().get("/Process/a1e139d5-4e77-48c9-84ae-34578e904e5a") .then() .statusCode(200); diff --git a/packages/management-console/src/components/Molecules/DataListItemComponent/DataListItemComponent.tsx b/packages/management-console/src/components/Molecules/DataListItemComponent/DataListItemComponent.tsx index 23962734c8..133c26618d 100755 --- a/packages/management-console/src/components/Molecules/DataListItemComponent/DataListItemComponent.tsx +++ b/packages/management-console/src/components/Molecules/DataListItemComponent/DataListItemComponent.tsx @@ -85,6 +85,8 @@ const DataListItemComponent: React.FC = ({ fetchPolicy: 'network-only' }); + const currentPage = { prev: location.pathname} + window.localStorage.setItem('state', JSON.stringify(currentPage)) const setTitle = (titleStatus, titleText) => { switch (titleStatus) { case 'success': @@ -526,7 +528,7 @@ const DataListItemComponent: React.FC = ({ - +
diff --git a/packages/management-console/src/components/Molecules/NoServerComponent/NoServerComponent.tsx b/packages/management-console/src/components/Molecules/NoServerComponent/NoServerComponent.tsx new file mode 100644 index 0000000000..4b08af1458 --- /dev/null +++ b/packages/management-console/src/components/Molecules/NoServerComponent/NoServerComponent.tsx @@ -0,0 +1,106 @@ +import React, { useState } from 'react'; +import { + PageSection, + Bullseye, + EmptyState, + EmptyStateIcon, + EmptyStateVariant, + Button, + EmptyStateBody, + Title, + Page, + SkipToContent, + PageSidebar, + PageHeader, + Nav, + NavList, + NavItem, + Brand, +} from '@patternfly/react-core'; +import { + ExclamationCircleIcon +} from '@patternfly/react-icons'; +import { BrowserRouter as Router, Link } from 'react-router-dom'; +import Avatar from '../../Atoms/AvatarComponent/AvatarComponent'; +import PageToolbarComponent from '../../Organisms/PageToolbarComponent/PageToolbarComponent'; +import managementConsoleLogo from '../../../static/managementConsoleLogo.svg'; + +const NoServerComponent = (props) => { + const [isNavOpen, setIsNavOpen] = useState(true); + const onNavToggle = () => { + setIsNavOpen(!isNavOpen); + }; + + const Header = ( + } + toolbar={} + avatar={} + showNavToggle + isNavOpen={isNavOpen} + onNavToggle={onNavToggle} + /> + ); + + const PageNav = ( + + ); + const Sidebar = ( + + ); + + const pageId = 'main-content-page-layout-default-nav'; + const PageSkipToContent = ( + Skip to Content + ); + + return ( + <> + + + + + + + Error connecting server + + The management console could not access the server to display content. + + + Try reloading the page, or contact your administrator for more information. + + + + + + + + + ); +}; + +export default NoServerComponent; \ No newline at end of file diff --git a/packages/management-console/src/components/Molecules/ServerErrorsComponent/ServerErrorsComponent.css b/packages/management-console/src/components/Molecules/ServerErrorsComponent/ServerErrorsComponent.css new file mode 100644 index 0000000000..627e44c453 --- /dev/null +++ b/packages/management-console/src/components/Molecules/ServerErrorsComponent/ServerErrorsComponent.css @@ -0,0 +1,4 @@ +.kogito-management-console--Server-Errors__text-color { + color: var(--pf-global--primary-color--100); + cursor: pointer +} \ No newline at end of file diff --git a/packages/management-console/src/components/Molecules/ServerErrorsComponent/ServerErrorsComponent.tsx b/packages/management-console/src/components/Molecules/ServerErrorsComponent/ServerErrorsComponent.tsx new file mode 100644 index 0000000000..a1fcc3e13e --- /dev/null +++ b/packages/management-console/src/components/Molecules/ServerErrorsComponent/ServerErrorsComponent.tsx @@ -0,0 +1,51 @@ +import React,{useState} from 'react'; + +import { + PageSection, + Bullseye, + EmptyState, + EmptyStateIcon, + EmptyStateVariant, + Button, + EmptyStateBody, + Title, + Popover, + ClipboardCopy, + ClipboardCopyVariant +} from '@patternfly/react-core'; +import { + ExclamationCircleIcon +} from '@patternfly/react-icons'; +import './ServerErrorsComponent.css'; +import {useHistory} from 'react-router-dom'; + +const ServerErrorsComponent = (props) => { + const [displayError, setDisplayError] = useState(false) + const history = useHistory(); + + return ( + + + + + Error fetching data + + An error occurred while accessing data. + + {displayError && + {JSON.stringify(props.message)} + } + + + + + + ) +} + +export default ServerErrorsComponent; \ No newline at end of file diff --git a/packages/management-console/src/components/Organisms/DomainExplorerColumnPicker/DomainExplorerColumnPicker.tsx b/packages/management-console/src/components/Organisms/DomainExplorerColumnPicker/DomainExplorerColumnPicker.tsx index 16c78dc2b4..6b6afb5cd5 100644 --- a/packages/management-console/src/components/Organisms/DomainExplorerColumnPicker/DomainExplorerColumnPicker.tsx +++ b/packages/management-console/src/components/Organisms/DomainExplorerColumnPicker/DomainExplorerColumnPicker.tsx @@ -23,6 +23,7 @@ export interface IOwnProps { setSelected: any; data: any; getPicker: any; + setError: any } const DomainExplorerColumnPicker: React.FC = ({ @@ -37,6 +38,7 @@ const DomainExplorerColumnPicker: React.FC = ({ setSelected, data, getPicker, + setError }) => { const [isExpanded, setIsExpanded] = useState(false); const [tempDomain, setTempDomain] = useState(''); @@ -122,7 +124,7 @@ const DomainExplorerColumnPicker: React.FC = ({ } }); } catch (error) { - return error; + setError(error) } } else { setDisplayTable(false); diff --git a/packages/management-console/src/components/Organisms/DomainExplorerTable/DomainExplorerTable.tsx b/packages/management-console/src/components/Organisms/DomainExplorerTable/DomainExplorerTable.tsx index 390a5885e7..f0fe8d1e17 100644 --- a/packages/management-console/src/components/Organisms/DomainExplorerTable/DomainExplorerTable.tsx +++ b/packages/management-console/src/components/Organisms/DomainExplorerTable/DomainExplorerTable.tsx @@ -39,6 +39,8 @@ import ProcessDescriptor from '../../Molecules/ProcessDescriptor/ProcessDescript const DomainExplorerTable = ({ columnFilters, tableLoading, displayTable }) => { const [columns, setColumns] = useState([]); const [rows, setRows] = useState([]); + const currentPage = { prev: location.pathname} + window.localStorage.setItem('state', JSON.stringify(currentPage)) const stateIcon = (state) => { switch (state) { @@ -155,7 +157,7 @@ const DomainExplorerTable = ({ columnFilters, tableLoading, displayTable }) => { const ele = { title: ( <> - + diff --git a/packages/management-console/src/components/Organisms/ProcessDetails/ProcessDetails.tsx b/packages/management-console/src/components/Organisms/ProcessDetails/ProcessDetails.tsx index 75d8c1d96d..9f3b19b19b 100755 --- a/packages/management-console/src/components/Organisms/ProcessDetails/ProcessDetails.tsx +++ b/packages/management-console/src/components/Organisms/ProcessDetails/ProcessDetails.tsx @@ -27,8 +27,9 @@ import ProcessDescriptor from '../../Molecules/ProcessDescriptor/ProcessDescript interface IOwnProps { data: any; + from: any; } -const ProcessDetails: React.FC = ({ data }) => { +const ProcessDetails: React.FC = ({ data, from }) => { const stateIconCreator = state => { switch (state) { case ProcessInstanceState.Active: @@ -139,10 +140,11 @@ const ProcessDetails: React.FC = ({ data }) => {
= ({ data }) => { {data.ProcessInstances[0].childProcessInstances.map( (child, index) => (
- +