+
@@ -151,7 +114,7 @@ export default function NavigationBar() {
-
+
);
}
return null;
diff --git a/spiffworkflow-frontend/src/components/PaginationForTable.tsx b/spiffworkflow-frontend/src/components/PaginationForTable.tsx
index c1cde1ab..44edff63 100644
--- a/spiffworkflow-frontend/src/components/PaginationForTable.tsx
+++ b/spiffworkflow-frontend/src/components/PaginationForTable.tsx
@@ -1,8 +1,9 @@
import React from 'react';
-import { Link } from 'react-router-dom';
+import { Link, useNavigate } from 'react-router-dom';
// @ts-ignore
-import { Dropdown, Stack } from '@carbon/react';
+import { Dropdown, Stack, Pagination } from '@carbon/react';
+import { PaginationObject } from '../interfaces';
export const DEFAULT_PER_PAGE = 50;
export const DEFAULT_PAGE = 1;
@@ -11,9 +12,7 @@ type OwnProps = {
page: number;
perPage: number;
perPageOptions?: number[];
- pagination: {
- [key: string]: number;
- };
+ pagination: PaginationObject | null;
tableToDisplay: any;
queryParamString?: string;
path: string;
@@ -29,141 +28,28 @@ export default function PaginationForTable({
path,
}: OwnProps) {
const PER_PAGE_OPTIONS = [2, 10, 50, 100];
+ const navigate = useNavigate();
- // const buildPerPageDropdown = () => {
- // const perPageDropdownRows = (perPageOptions || PER_PAGE_OPTIONS).map(
- // (perPageOption) => {
- // if (perPageOption === perPage) {
- // return (
- //
- // {perPageOption}
- //
- // );
- // }
- // return (
- //
- // {perPageOption}
- //
- // );
- // }
- // );
- // return (
- //
- //
- //
- // );
- // };
- //
- // const buildPaginationNav = () => {
- // let previousPageTag = null;
- // if (page === 1) {
- // previousPageTag = (
- //
- //
- // «
- //
- //
- // );
- // } else {
- // previousPageTag = (
- //
- //
- // «
- //
- //
- // );
- // }
- //
- // let nextPageTag = null;
- // if (page >= pagination.pages) {
- // nextPageTag = (
- //
- //
- // »
- //
- //
- // );
- // } else {
- // nextPageTag = (
- //
- //
- // »
- //
- //
- // );
- // }
- //
- // let startingNumber = (page - 1) * perPage + 1;
- // let endingNumber = page * perPage;
- // if (endingNumber > pagination.total) {
- // endingNumber = pagination.total;
- // }
- // if (startingNumber > pagination.total) {
- // startingNumber = pagination.total;
- // }
- //
- // return (
- //
- //
- // {startingNumber}-{endingNumber} of{' '}
- // {pagination.total}
- //
- //
- //
- // );
- // };
- //
- // return (
- //
- // {buildPaginationNav()}
- // {tableToDisplay}
- // {buildPerPageDropdown()}
- //
- // );
- return null;
+ const updateRows = (args: any) => {
+ const newPage = args.page;
+ const { pageSize } = args;
+ navigate(`${path}?page=${newPage}&per_page=${pageSize}${queryParamString}`);
+ };
+
+ return (
+ <>
+ {tableToDisplay}
+
+ >
+ );
}
diff --git a/spiffworkflow-frontend/src/helpers.tsx b/spiffworkflow-frontend/src/helpers.tsx
index 59922acf..e9bb100a 100644
--- a/spiffworkflow-frontend/src/helpers.tsx
+++ b/spiffworkflow-frontend/src/helpers.tsx
@@ -90,3 +90,11 @@ export const getProcessModelFullIdentifierFromSearchParams = (
}
return processModelFullIdentifier;
};
+
+// https://stackoverflow.com/a/71352046/6090676
+export const truncateString = (text: string, len: number) => {
+ if (text.length > len && text.length > 0) {
+ return `${text.split(' ').slice(0, len).join(' ')} ...`;
+ }
+ return text;
+};
diff --git a/spiffworkflow-frontend/src/index.css b/spiffworkflow-frontend/src/index.css
index 32a712d5..763200df 100644
--- a/spiffworkflow-frontend/src/index.css
+++ b/spiffworkflow-frontend/src/index.css
@@ -26,6 +26,10 @@ span.bjs-crumb {
margin-bottom: 1em;
}
+.spiffworkflow-header-container {
+ margin-bottom: 2em;
+}
+
.active-task-highlight:not(.djs-connection) .djs-visual > :nth-child(1) {
fill: yellow !important;
@@ -44,6 +48,17 @@ span.bjs-crumb {
margin:auto;
}
+.cds--btn.button-white-background {
+ color: #393939;
+ background: #FFFFFF;
+ background-blend-mode: multiply;
+ border: 1px solid #393939;
+}
+
+.with-bottom-margin {
+ margin-bottom: 1em;
+}
+
.diagram-viewer-canvas {
border:1px solid #000000;
height:70vh;
diff --git a/spiffworkflow-frontend/src/index.scss b/spiffworkflow-frontend/src/index.scss
index 61228e3b..c9671651 100644
--- a/spiffworkflow-frontend/src/index.scss
+++ b/spiffworkflow-frontend/src/index.scss
@@ -1,2 +1,3 @@
@use '@carbon/react';
-
+@use '@carbon/styles';
+// @include grid.flex-grid();
diff --git a/spiffworkflow-frontend/src/interfaces.ts b/spiffworkflow-frontend/src/interfaces.ts
index 8e153c80..16e1491b 100644
--- a/spiffworkflow-frontend/src/interfaces.ts
+++ b/spiffworkflow-frontend/src/interfaces.ts
@@ -41,3 +41,9 @@ export interface AuthenticationItem {
id: string;
parameters: AuthenticationParam[];
}
+
+export interface PaginationObject {
+ count: number;
+ total: number;
+ pages: number;
+}
diff --git a/spiffworkflow-frontend/src/routes/HomePage.tsx b/spiffworkflow-frontend/src/routes/HomePage.tsx
index da39e205..a66ded5c 100644
--- a/spiffworkflow-frontend/src/routes/HomePage.tsx
+++ b/spiffworkflow-frontend/src/routes/HomePage.tsx
@@ -54,7 +54,7 @@ export default function HomePage() {
data-qa="process-instance-show-link"
to={`/admin/process-models/${rowToUse.process_group_identifier}/${rowToUse.process_model_identifier}/process-instances/${rowToUse.process_instance_id}`}
>
- View
+ View {rowToUse.process_instance_id}
(null);
const oneHourInSeconds = 3600;
const oneMonthInSeconds = oneHourInSeconds * 24 * 30;
@@ -47,13 +61,17 @@ export default function ProcessInstanceList() {
const setErrorMessage = (useContext as any)(ErrorContext)[1];
- const [processStatuseSelectionOptions, setProcessStatusSelectionOptions] =
+ const [processStatusSelectionOptions, setProcessStatusSelectionOptions] =
useState([]);
const [processStatusSelection, setProcessStatusSelection] = useState<
Option[]
>([]);
- const [processModeleSelectionOptions, setProcessModelSelectionOptions] =
- useState([]);
+ const [processModelAvailableItems, setProcessModelAvailableItems] = useState<
+ ProcessModel[]
+ >([]);
+ const [processModelFilteredItems, setProcessModelFilteredItems] = useState<
+ ProcessModel[]
+ >([]);
const [processModelSelection, setProcessModelSelection] = useState |