Merge branch 'main' into deploy-app-dev

This commit is contained in:
Madhurya Liyanage 2023-07-06 09:43:20 +05:30
commit 175f8f7d66
14 changed files with 197 additions and 135 deletions

View File

@ -75,6 +75,10 @@ PATH_SEGMENTS_FOR_PERMISSION_ALL = [
"path": "/process-instances",
"relevant_permissions": ["create", "read", "delete"],
},
{
"path": "/process-instances/for-me",
"relevant_permissions": ["read"],
},
{"path": "/process-data", "relevant_permissions": ["read"]},
{"path": "/process-data-file-download", "relevant_permissions": ["read"]},
{"path": "/process-instance-suspend", "relevant_permissions": ["create"]},

View File

@ -129,6 +129,7 @@ class TestAuthorizationService(BaseTest):
"/process-instances/some-process-group:some-process-model:*",
"delete",
),
("/process-instances/for-me/some-process-group:some-process-model:*", "read"),
("/process-instances/some-process-group:some-process-model:*", "read"),
("/process-model-natural-language/some-process-group:some-process-model:*", "create"),
("/process-model-publish/some-process-group:some-process-model:*", "create"),
@ -213,6 +214,7 @@ class TestAuthorizationService(BaseTest):
"/process-instances/some-process-group:some-process-model/*",
"delete",
),
("/process-instances/for-me/some-process-group:some-process-model/*", "read"),
("/process-instances/some-process-group:some-process-model/*", "read"),
("/process-model-natural-language/some-process-group:some-process-model/*", "create"),
("/process-model-publish/some-process-group:some-process-model/*", "create"),

View File

@ -16,6 +16,7 @@ import UserService from './services/UserService';
import ErrorDisplay from './components/ErrorDisplay';
import APIErrorProvider from './contexts/APIErrorContext';
import ScrollToTop from './components/ScrollToTop';
import EditorRoutes from './routes/EditorRoutes';
export default function App() {
if (!UserService.isLoggedIn()) {
@ -41,6 +42,7 @@ export default function App() {
<Route path="/about" element={<About />} />
<Route path="/tasks/*" element={<HomePageRoutes />} />
<Route path="/admin/*" element={<AdminRoutes />} />
<Route path="/editor/*" element={<EditorRoutes />} />
</Routes>
</ErrorBoundary>
</Content>

View File

@ -179,7 +179,6 @@ export default function MessageInstanceList({ processInstanceId }: OwnProps) {
return (
<>
{breadcrumbElement}
<h1>Messages</h1>
{correlationsDisplayModal()}
<PaginationForTable
page={page}

View File

@ -1778,18 +1778,13 @@ export default function ProcessInstanceListTable({
}
return (
<>
<div className="process-instance-list-table">
{reportColumnForm()}
{advancedOptionsModal()}
{processInstanceReportSaveTag()}
<Grid fullWidth condensed>
{tableTitleLine()}
<Column
sm={{ span: 4 }}
md={{ span: 8 }}
lg={{ span: 16 }}
style={{ maxWidth: 'fit-content' }}
>
<Column sm={{ span: 4 }} md={{ span: 8 }} lg={{ span: 16 }}>
<Filters
filterOptions={filterOptions}
showFilterOptions={showFilterOptions}
@ -1798,15 +1793,10 @@ export default function ProcessInstanceListTable({
filtersEnabled={filtersEnabled}
/>
</Column>
<Column
sm={{ span: 4 }}
md={{ span: 8 }}
lg={{ span: 16 }}
style={{ maxWidth: 'fit-content', margin: 'auto' }}
>
<Column sm={{ span: 4 }} md={{ span: 8 }} lg={{ span: 16 }}>
{resultsTable}
</Column>
</Grid>
</>
</div>
);
}

View File

@ -430,11 +430,11 @@ export default function ReactDiagramEditor({
// a Modeler and not an Editor which is what it will be when we are
// actively editing a decision table
if ((modeler as any).constructor.name === 'Modeler') {
canvas.zoom(FitViewport);
canvas.zoom(FitViewport, 'auto');
}
if ((modeler as any).constructor.name === 'Viewer') {
canvas.zoom(FitViewport);
canvas.zoom(FitViewport, 'auto');
}
// highlighting a field
@ -497,7 +497,7 @@ export default function ReactDiagramEditor({
ref.element.set(ref.property, elem);
});
diagramModelerToUse.importDefinitions(result.rootElement);
diagramModelerToUse.get('canvas').zoom(FitViewport);
diagramModelerToUse.get('canvas').zoom(FitViewport, 'auto');
});
} else {
diagramModelerToUse.importXML(diagramXMLToDisplay);

View File

@ -199,7 +199,7 @@ dt {
.diagram-editor-canvas {
border:1px solid #000000;
height:70vh;
height:78vh;
width:90vw;
margin: 0 auto;
}
@ -298,7 +298,6 @@ dt {
.markdown table {
color: #333;
background: white;
border: 1px solid grey;
font-size: 12pt;
border-collapse: collapse;
}
@ -396,6 +395,13 @@ td.actions-cell {
width: 1em;
}
.process-instance-list-table {
margin: 0;
padding: 0;
width: fit-content;
}
.process-instance-table-header {
margin-bottom: 1em;
}

View File

@ -20,8 +20,25 @@
// tweaks the markdown styles.
main {
max-width: 1440px;
margin: auto;
}
.fixed-width-container {
padding-left: 0px;
overflow: visible;
}
@media (min-width: 1400px) {
.fixed-width-container {
max-width: 1280px;
padding-right: 0;
}
}
@media (min-width: 1056px) {
.fixed-width-container {
padding-left: 180px;
padding-right: 2rem;
}
}
p, li, h1, h2, h3, h4, h5, h6, blockquote {
@ -35,6 +52,17 @@ div.show-page, div.markdown, div.markdown-collapsed, div.markdown-collapsable {
margin: 0 auto;
max-width: 1000px;
padding: 15px 0 15px 0;
overflow: visible;
}
.cds--data-table-content {
width: fit-content;
min-width: 100%;
overflow-x: visible;
}
.wmde-markdown table {
width: fit-content;
}
.wmde-markdown ol {

View File

@ -6,7 +6,6 @@ import ProcessGroupShow from './ProcessGroupShow';
import ProcessGroupNew from './ProcessGroupNew';
import ProcessGroupEdit from './ProcessGroupEdit';
import ProcessModelShow from './ProcessModelShow';
import ProcessModelEditDiagram from './ProcessModelEditDiagram';
import ProcessInstanceList from './ProcessInstanceList';
import ProcessModelNew from './ProcessModelNew';
import ProcessModelEdit from './ProcessModelEdit';
@ -30,110 +29,104 @@ export default function AdminRoutes() {
if (UserService.hasRole(['admin'])) {
return (
<Routes>
<Route path="/" element={<ProcessGroupList />} />
<Route path="process-groups" element={<ProcessGroupList />} />
<Route
path="process-groups/:process_group_id"
element={<ProcessGroupShow />}
/>
<Route path="process-groups/new" element={<ProcessGroupNew />} />
<Route
path="process-groups/:process_group_id/edit"
element={<ProcessGroupEdit />}
/>
<div className="fixed-width-container">
<Routes>
<Route path="/" element={<ProcessGroupList />} />
<Route path="process-groups" element={<ProcessGroupList />} />
<Route
path="process-groups/:process_group_id"
element={<ProcessGroupShow />}
/>
<Route path="process-groups/new" element={<ProcessGroupNew />} />
<Route
path="process-groups/:process_group_id/edit"
element={<ProcessGroupEdit />}
/>
<Route
path="process-models/:process_group_id/new"
element={<ProcessModelNew />}
/>
<Route
path="process-models/:process_group_id/new-e"
element={<ProcessModelNewExperimental />}
/>
<Route
path="process-models/:process_model_id"
element={<ProcessModelShow />}
/>
<Route
path="process-models/:process_model_id/files"
element={<ProcessModelEditDiagram />}
/>
<Route
path="process-models/:process_model_id/files/:file_name"
element={<ProcessModelEditDiagram />}
/>
<Route
path="process-models/:process_model_id/edit"
element={<ProcessModelEdit />}
/>
<Route
path="process-instances/for-me/:process_model_id/:process_instance_id"
element={<ProcessInstanceShow variant="for-me" />}
/>
<Route
path="process-instances/for-me/:process_model_id/:process_instance_id/:to_task_guid"
element={<ProcessInstanceShow variant="for-me" />}
/>
<Route
path="process-instances/for-me/:process_model_id/:process_instance_id/interstitial"
element={<ProcessInterstitialPage variant="for-me" />}
/>
<Route
path="process-instances/:process_model_id/:process_instance_id/interstitial"
element={<ProcessInterstitialPage variant="all" />}
/>
<Route
path="process-instances/:process_model_id/:process_instance_id"
element={<ProcessInstanceShow variant="all" />}
/>
<Route
path="process-instances/:process_model_id/:process_instance_id/:to_task_guid"
element={<ProcessInstanceShow variant="all" />}
/>
<Route
path="process-instances/reports"
element={<ProcessInstanceReportList />}
/>
<Route
path="process-instances/reports/new"
element={<ProcessInstanceReportNew />}
/>
<Route
path="process-instances/reports/:report_identifier/edit"
element={<ProcessInstanceReportEdit />}
/>
<Route
path="process-models/:process_model_id/form"
element={<ReactFormEditor />}
/>
<Route
path="process-models/:process_model_id/form/:file_name"
element={<ReactFormEditor />}
/>
<Route
path="process-instances"
element={<ProcessInstanceList variant="for-me" />}
/>
<Route
path="process-instances/for-me"
element={<ProcessInstanceList variant="for-me" />}
/>
<Route
path="process-instances/all"
element={<ProcessInstanceList variant="all" />}
/>
<Route path="configuration/*" element={<Configuration />} />
<Route
path="process-models/:process_model_id/form-builder"
element={<JsonSchemaFormBuilder />}
/>
<Route
path="process-instances/find-by-id"
element={<ProcessInstanceFindById />}
/>
<Route path="messages" element={<MessageListPage />} />
</Routes>
<Route
path="process-models/:process_group_id/new"
element={<ProcessModelNew />}
/>
<Route
path="process-models/:process_group_id/new-e"
element={<ProcessModelNewExperimental />}
/>
<Route
path="process-models/:process_model_id"
element={<ProcessModelShow />}
/>
<Route
path="process-models/:process_model_id/edit"
element={<ProcessModelEdit />}
/>
<Route
path="process-instances/for-me/:process_model_id/:process_instance_id"
element={<ProcessInstanceShow variant="for-me" />}
/>
<Route
path="process-instances/for-me/:process_model_id/:process_instance_id/:to_task_guid"
element={<ProcessInstanceShow variant="for-me" />}
/>
<Route
path="process-instances/for-me/:process_model_id/:process_instance_id/interstitial"
element={<ProcessInterstitialPage variant="for-me" />}
/>
<Route
path="process-instances/:process_model_id/:process_instance_id/interstitial"
element={<ProcessInterstitialPage variant="all" />}
/>
<Route
path="process-instances/:process_model_id/:process_instance_id"
element={<ProcessInstanceShow variant="all" />}
/>
<Route
path="process-instances/:process_model_id/:process_instance_id/:to_task_guid"
element={<ProcessInstanceShow variant="all" />}
/>
<Route
path="process-instances/reports"
element={<ProcessInstanceReportList />}
/>
<Route
path="process-instances/reports/new"
element={<ProcessInstanceReportNew />}
/>
<Route
path="process-instances/reports/:report_identifier/edit"
element={<ProcessInstanceReportEdit />}
/>
<Route
path="process-models/:process_model_id/form"
element={<ReactFormEditor />}
/>
<Route
path="process-models/:process_model_id/form/:file_name"
element={<ReactFormEditor />}
/>
<Route
path="process-instances"
element={<ProcessInstanceList variant="for-me" />}
/>
<Route
path="process-instances/for-me"
element={<ProcessInstanceList variant="for-me" />}
/>
<Route
path="process-instances/all"
element={<ProcessInstanceList variant="all" />}
/>
<Route path="configuration/*" element={<Configuration />} />
<Route
path="process-models/:process_model_id/form-builder"
element={<JsonSchemaFormBuilder />}
/>
<Route
path="process-instances/find-by-id"
element={<ProcessInstanceFindById />}
/>
<Route path="messages" element={<MessageListPage />} />
</Routes>
</div>
);
}
return (

View File

@ -0,0 +1,33 @@
import { Routes, Route, useLocation } from 'react-router-dom';
import React, { useEffect } from 'react';
import ProcessModelEditDiagram from './ProcessModelEditDiagram';
import UserService from '../services/UserService';
export default function EditorRoutes() {
const location = useLocation();
useEffect(() => {}, [location]);
if (UserService.hasRole(['admin'])) {
return (
<div className="full-width-container">
<Routes>
<Route
path="process-models/:process_model_id/files"
element={<ProcessModelEditDiagram />}
/>
<Route
path="process-models/:process_model_id/files/:file_name"
element={<ProcessModelEditDiagram />}
/>
</Routes>
</div>
);
}
return (
<main>
<h1>404</h1>
</main>
);
}

View File

@ -47,7 +47,7 @@ export default function HomePageRoutes() {
};
return (
<>
<div className="fixed-width-container">
{renderTabs()}
<Routes>
<Route path="/" element={<InProgressInstances />} />
@ -57,6 +57,6 @@ export default function HomePageRoutes() {
<Route path="completed-instances" element={<CompletedInstances />} />
<Route path="create-new-instance" element={<CreateNewInstance />} />
</Routes>
</>
</div>
);
}

View File

@ -1,5 +1,10 @@
import MessageInstanceList from '../components/MessageInstanceList';
export default function MessageListPage() {
return <MessageInstanceList />;
return (
<>
<h1>Messages</h1>
<MessageInstanceList />
</>
);
}

View File

@ -196,7 +196,7 @@ export default function ProcessModelEditDiagram() {
'file_type'
)}`;
navigate(
`/admin/process-models/${modifiedProcessModelId}/files/${fileNameWithExtension}`
`/editor/process-models/${modifiedProcessModelId}/files/${fileNameWithExtension}`
);
}
};
@ -909,7 +909,7 @@ export default function ProcessModelEditDiagram() {
processReference: ProcessReference
) => {
const path = generatePath(
'/admin/process-models/:process_model_path/files/:file_name',
'/editor/process-models/:process_model_path/files/:file_name',
{
process_model_path: modifyProcessIdentifierForPathParam(
processReference.process_model_id
@ -962,7 +962,7 @@ export default function ProcessModelEditDiagram() {
const file = findFileNameForReferenceId(processId, 'dmn');
if (file) {
const path = generatePath(
'/admin/process-models/:process_model_id/files/:file_name',
'/editor/process-models/:process_model_id/files/:file_name',
{
process_model_id: params.process_model_id,
file_name: file.name,

View File

@ -193,7 +193,7 @@ export default function ProcessModelShow() {
const profileModelFileEditUrl = (processModelFile: ProcessFile) => {
if (processModel) {
if (processModelFile.name.match(/\.(dmn|bpmn)$/)) {
return `/admin/process-models/${modifiedProcessModelId}/files/${processModelFile.name}`;
return `/editor/process-models/${modifiedProcessModelId}/files/${processModelFile.name}`;
}
if (processModelFile.name.match(/\.(json|md)$/)) {
return `/admin/process-models/${modifiedProcessModelId}/form/${processModelFile.name}`;
@ -530,13 +530,13 @@ export default function ProcessModelShow() {
onChange={(a: any) => {
if (a.selectedItem.text === 'New BPMN File') {
navigate(
`/admin/process-models/${modifiedProcessModelId}/files?file_type=bpmn`
`/editor/process-models/${modifiedProcessModelId}/files?file_type=bpmn`
);
} else if (a.selectedItem.text === 'Upload File') {
setShowFileUploadModal(true);
} else if (a.selectedItem.text === 'New DMN File') {
navigate(
`/admin/process-models/${modifiedProcessModelId}/files?file_type=dmn`
`/editor/process-models/${modifiedProcessModelId}/files?file_type=dmn`
);
} else if (a.selectedItem.text === 'New JSON File') {
navigate(