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 6abd97e648
commit 4d374023e0
No known key found for this signature in database
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 TableCellWithTimeAgoInWords from './TableCellWithTimeAgoInWords';
import CustomForm from './CustomForm';
import InstructionsForEndUser from './InstructionsForEndUser';
const PER_PAGE_FOR_TASKS_ON_HOME_PAGE = 5;
@ -137,6 +138,29 @@ export default function TaskListTable({
const formSubmissionModal = () => {
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 (
<Modal
open={!!formSubmissionTask}
@ -155,11 +179,12 @@ export default function TaskListTable({
</div>
</div>
<hr />
<InstructionsForEndUser task={formSubmissionTask} />
<CustomForm
id={formSubmissionTask.guid}
formData={formSubmissionTask.data}
schema={formSubmissionTask.form_schema}
uiSchema={formSubmissionTask.form_ui_schema}
schema={jsonSchema}
uiSchema={formUiSchema}
disabled
>
{/* this hides the submit button */}