allow view completed manual task forms and show the instructions w/ burnettk

This commit is contained in:
jasquat 2023-09-13 10:31:34 -04:00
parent e95b3b03f3
commit 9b1377fb6a
1 changed files with 27 additions and 2 deletions

View File

@ -17,6 +17,7 @@ import HttpService from '../services/HttpService';
import { PaginationObject, ProcessInstanceTask, Task } from '../interfaces'; import { PaginationObject, ProcessInstanceTask, Task } from '../interfaces';
import TableCellWithTimeAgoInWords from './TableCellWithTimeAgoInWords'; import TableCellWithTimeAgoInWords from './TableCellWithTimeAgoInWords';
import CustomForm from './CustomForm'; import CustomForm from './CustomForm';
import InstructionsForEndUser from './InstructionsForEndUser';
const PER_PAGE_FOR_TASKS_ON_HOME_PAGE = 5; const PER_PAGE_FOR_TASKS_ON_HOME_PAGE = 5;
@ -137,6 +138,29 @@ export default function TaskListTable({
const formSubmissionModal = () => { const formSubmissionModal = () => {
if (formSubmissionTask) { if (formSubmissionTask) {
// TODO: move this and the code from TaskShow to new component to handle instructions and manual tasks
let formUiSchema;
let jsonSchema = formSubmissionTask.form_schema;
if (formSubmissionTask.typename === 'ManualTask') {
jsonSchema = {
type: 'object',
required: [],
properties: {
isManualTask: {
type: 'boolean',
title: 'Is ManualTask',
default: true,
},
},
};
formUiSchema = {
isManualTask: {
'ui:widget': 'hidden',
},
};
} else if (formSubmissionTask.form_ui_schema) {
formUiSchema = formSubmissionTask.form_ui_schema;
}
return ( return (
<Modal <Modal
open={!!formSubmissionTask} open={!!formSubmissionTask}
@ -155,11 +179,12 @@ export default function TaskListTable({
</div> </div>
</div> </div>
<hr /> <hr />
<InstructionsForEndUser task={formSubmissionTask} />
<CustomForm <CustomForm
id={formSubmissionTask.guid} id={formSubmissionTask.guid}
formData={formSubmissionTask.data} formData={formSubmissionTask.data}
schema={formSubmissionTask.form_schema} schema={jsonSchema}
uiSchema={formSubmissionTask.form_ui_schema} uiSchema={formUiSchema}
disabled disabled
> >
{/* this hides the submit button */} {/* this hides the submit button */}