Report URL fixes (#29)

This commit is contained in:
jbirddog 2022-11-11 09:21:30 -05:00 committed by GitHub
parent 5dcdd2c1fb
commit a089626d28
10 changed files with 31 additions and 104 deletions

View File

@ -708,33 +708,6 @@ paths:
type: array
items:
$ref: "#/components/schemas/Workflow"
/process-models/{process_group_id}/{process_model_id}/process-instances/reports:
parameters:
- name: process_group_id
in: path
required: true
description: The unique id of an existing process group
schema:
type: string
- name: process_model_id
in: path
required: true
description: The unique id of an existing process model.
schema:
type: string
- name: page
in: query
required: false
description: The page number to return. Defaults to page 1.
schema:
type: integer
- name: per_page
in: query
required: false
description: The page number to return. Defaults to page 1.
schema:
type: integer
post:
operationId: spiffworkflow_backend.routes.process_api_blueprint.process_instance_report_create
summary: Returns all process instance reports for process model
@ -782,39 +755,6 @@ paths:
type: array
items:
$ref: "#/components/schemas/Workflow"
/process-models/{process_group_id}/{process_model_id}/process-instances/reports/{report_identifier}:
parameters:
- name: process_group_id
in: path
required: true
description: The unique id of an existing process group
schema:
type: string
- name: process_model_id
in: path
required: true
description: The unique id of an existing process model.
schema:
type: string
- name: report_identifier
in: path
required: true
description: The unique id of an existing report
schema:
type: string
- name: page
in: query
required: false
description: The page number to return. Defaults to page 1.
schema:
type: integer
- name: per_page
in: query
required: false
description: The page number to return. Defaults to page 1.
schema:
type: integer
put:
operationId: spiffworkflow_backend.routes.process_api_blueprint.process_instance_report_update
summary: Updates a process instance report

View File

@ -46545,7 +46545,7 @@
"@csstools/postcss-text-decoration-shorthand": "^1.0.0",
"@csstools/postcss-trigonometric-functions": "^1.0.2",
"@csstools/postcss-unset-value": "^1.0.2",
"autoprefixer": "10.4.5",
"autoprefixer": "10.4.8",
"browserslist": "^4.21.3",
"css-blank-pseudo": "^3.0.3",
"css-has-pseudo": "^3.0.4",
@ -46583,8 +46583,7 @@
},
"dependencies": {
"autoprefixer": {
"version": "10.4.5",
"resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.5.tgz",
"version": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.5.tgz",
"integrity": "sha512-Fvd8yCoA7lNX/OUllvS+aS1I7WRBclGXsepbvT8ZaPgrH24rgXpZzF0/6Hh3ZEkwg+0AES/Osd196VZmYoEFtw==",
"requires": {
"browserslist": "^4.20.2",

View File

@ -38,6 +38,10 @@ export default function NavigationBar() {
let newActiveKey = '/admin/process-groups';
if (location.pathname.match(/^\/admin\/messages\b/)) {
newActiveKey = '/admin/messages';
} else if (
location.pathname.match(/^\/admin\/process-instances\/reports\b/)
) {
newActiveKey = '/admin/process-instances/reports';
} else if (location.pathname.match(/^\/admin\/process-instances\b/)) {
newActiveKey = '/admin/process-instances';
} else if (location.pathname.match(/^\/admin\/secrets\b/)) {
@ -119,6 +123,12 @@ export default function NavigationBar() {
>
Authentications
</HeaderMenuItem>
<HeaderMenuItem
href="/admin/process-instances/reports"
isCurrentPage={isActivePage('/admin/process-instances/reports')}
>
Reports
</HeaderMenuItem>
</>
);
};

View File

@ -10,6 +10,10 @@ export default function SubNavigation() {
let newActiveKey = '/admin/process-groups';
if (location.pathname.match(/^\/admin\/messages\b/)) {
newActiveKey = '/admin/messages';
} else if (
location.pathname.match(/^\/admin\/process-instances\/reports\b/)
) {
newActiveKey = '/admin/process-instances/reports';
} else if (location.pathname.match(/^\/admin\/process-instances\b/)) {
newActiveKey = '/admin/process-instances';
} else if (location.pathname.match(/^\/admin\/secrets\b/)) {
@ -45,6 +49,9 @@ export default function SubNavigation() {
<Nav.Item>
<Nav.Link href="/admin/authentications">Authentications</Nav.Link>
</Nav.Item>
<Nav.Item>
<Nav.Link href="/admin/process-instances/reports">Reports</Nav.Link>
</Nav.Item>
</Nav>
);
}

View File

@ -81,19 +81,19 @@ export default function AdminRoutes() {
element={<ProcessInstanceShow />}
/>
<Route
path="process-models/:process_model_id/process-instances/reports"
path="process-instances/reports"
element={<ProcessInstanceReportList />}
/>
<Route
path="process-models/:process_group_id/:process_model_id/process-instances/reports/:report_identifier"
path="process-instances/reports/:report_identifier"
element={<ProcessInstanceReportShow />}
/>
<Route
path="process-models/:process_group_id/:process_model_id/process-instances/reports/new"
path="process-instances/reports/new"
element={<ProcessInstanceReportNew />}
/>
<Route
path="process-models/:process_group_id/:process_model_id/process-instances/reports/:report_identifier/edit"
path="process-instances/reports/:report_identifier/edit"
element={<ProcessInstanceReportEdit />}
/>
<Route

View File

@ -1,6 +1,5 @@
import { useEffect, useState } from 'react';
import { useNavigate, useParams } from 'react-router-dom';
import ProcessBreadcrumb from '../components/ProcessBreadcrumb';
import HttpService from '../services/HttpService';
import ButtonWithConfirmation from '../components/ButtonWithConfirmation';
@ -24,15 +23,11 @@ export default function ProcessInstanceReportEdit() {
const [filterBy, setFilterBy] = useState('');
const navigateToProcessInstanceReport = (_result: any) => {
navigate(
`/admin/process-models/${params.process_group_id}/${params.process_model_id}/process-instances/reports/${params.report_identifier}`
);
navigate(`/admin/process-instances/reports/${params.report_identifier}`);
};
const navigateToProcessInstanceReports = (_result: any) => {
navigate(
`/admin/process-models/${params.process_group_id}/${params.process_model_id}/process-instances/reports`
);
navigate(`/admin/process-instances/reports`);
};
useEffect(() => {
@ -111,7 +106,6 @@ export default function ProcessInstanceReportEdit() {
return (
<>
<ProcessBreadcrumb />
<h1>Edit Process Instance Report: {params.report_identifier}</h1>
<ButtonWithConfirmation
description={`Delete Report ${params.report_identifier}?`}

View File

@ -2,16 +2,11 @@ import { useEffect, useState } from 'react';
// @ts-ignore
import { Button, Table } from '@carbon/react';
import { useParams, Link } from 'react-router-dom';
import ProcessBreadcrumb from '../components/ProcessBreadcrumb';
import HttpService from '../services/HttpService';
import { modifyProcessModelPath } from '../helpers';
export default function ProcessInstanceReportList() {
const params = useParams();
const [processInstanceReports, setProcessInstanceReports] = useState([]);
const modifiedProcessModelId = modifyProcessModelPath(
params.process_model_id || ''
);
useEffect(() => {
HttpService.makeCallToBackend({
@ -27,7 +22,7 @@ export default function ProcessInstanceReportList() {
<tr key={(row as any).id}>
<td>
<Link
to={`/admin/process-models/${modifiedProcessModelId}/process-instances/reports/${rowToUse.identifier}`}
to={`/admin/process-instances/reports/${rowToUse.identifier}`}
>
{rowToUse.identifier}
</Link>
@ -49,15 +44,8 @@ export default function ProcessInstanceReportList() {
const headerStuff = (
<>
<ProcessBreadcrumb
processGroupId={params.process_group_id}
processModelId={params.process_model_id}
linkProcessModel
/>
<h1>Reports for Process Model: {params.process_model_id}</h1>
<Button
href={`/admin/process-models/${modifiedProcessModelId}/process-instances/reports/new`}
>
<h1>Process Instance Reports</h1>
<Button href="/admin/process-instances/reports/new">
Add a process instance report
</Button>
</>

View File

@ -1,10 +1,9 @@
import { useState } from 'react';
import { useNavigate, useParams } from 'react-router-dom';
import { useNavigate } from 'react-router-dom';
import ProcessBreadcrumb from '../components/ProcessBreadcrumb';
import HttpService from '../services/HttpService';
export default function ProcessInstanceReportNew() {
const params = useParams();
const navigate = useNavigate();
const [identifier, setIdentifier] = useState('');
@ -13,9 +12,7 @@ export default function ProcessInstanceReportNew() {
const [filterBy, setFilterBy] = useState('');
const navigateToNewProcessInstance = (_result: any) => {
navigate(
`/admin/process-models/${params.process_group_id}/${params.process_model_id}/process-instances/reports/${identifier}`
);
navigate(`/admin/process-instances/reports/${identifier}`);
};
const addProcessInstanceReport = (event: any) => {

View File

@ -82,7 +82,7 @@ export default function ProcessInstanceReport() {
/>
<h1>Process Instance Report: {params.report_identifier}</h1>
<Button
href={`/admin/process-models/${params.process_group_id}/${params.process_model_id}/process-instances/reports/${params.report_identifier}/edit`}
href={`/admin/process-instances/reports/${params.report_identifier}/edit`}
>
Edit process instance report
</Button>

View File

@ -378,14 +378,6 @@ export default function ProcessModelShow() {
List
</Link>
</li>
<li>
<Link
to={`/admin/process-models/${modifiedProcessModelId}/process-instances/reports`}
data-qa="process-instance-reports-link"
>
Reports
</Link>
</li>
</ul>
);
};