Skip to content

Commit

Permalink
Feature/treat blank task as manual (#598)
Browse files Browse the repository at this point in the history
* adds basic support to use certain components in extensions w/ burnettk

* treat a blank Task as a manual task on the frontend w/ burnettk

* updated remaining references for ManualTask vs UserTask w/ burnettk

---------

Co-authored-by: jasquat <[email protected]>
  • Loading branch information
jasquat and jasquat authored Oct 27, 2023
1 parent 64682af commit cc625ac
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion spiffworkflow-frontend/src/components/TaskListTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ export default function TaskListTable({
// 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') {
if (formSubmissionTask.typename !== 'UserTask') {
jsonSchema = {
type: 'object',
required: [],
Expand Down
1 change: 1 addition & 0 deletions spiffworkflow-frontend/src/helpers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export const HUMAN_TASK_TYPES = [
'Manual Task',
'UserTask',
'ManualTask',
'Task',
];

export const underscorizeString = (inputString: string) => {
Expand Down
4 changes: 2 additions & 2 deletions spiffworkflow-frontend/src/routes/TaskShow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export default function TaskShow() {
// https://github.com/sartography/spiff-arena/blob/182f56a1ad23ce780e8f5b0ed00efac3e6ad117b/spiffworkflow-frontend/src/routes/TaskShow.tsx#L329
const autoSaveTaskData = (formData: any, successCallback?: Function) => {
// save-draft gets called when a manual task form loads but there's no data to save so don't do it
if (taskWithTaskData?.typename === 'ManualTask') {
if (['ManualTask', 'Task'].includes(taskWithTaskData?.typename || '')) {
return undefined;
}
let successCallbackToUse = successCallback;
Expand Down Expand Up @@ -240,7 +240,7 @@ export default function TaskShow() {
let formUiSchema;
let jsonSchema = taskWithTaskData.form_schema;
let reactFragmentToHideSubmitButton = null;
if (taskWithTaskData.typename === 'ManualTask') {
if (taskWithTaskData.typename !== 'UserTask') {
jsonSchema = {
type: 'object',
required: [],
Expand Down

0 comments on commit cc625ac

Please sign in to comment.