pass form data into react json form w/ burnettk

This commit is contained in:
jasquat 2022-06-30 17:12:07 -04:00
parent a5671eaa2f
commit c9f37b192d
2 changed files with 16 additions and 3 deletions

View File

@ -1,5 +1,5 @@
import React, { useEffect, useState } from 'react';
import { Table } from 'react-bootstrap';
import { Button, Table } from 'react-bootstrap';
import { Link, useSearchParams } from 'react-router-dom';
import PaginationForTable, {
DEFAULT_PER_PAGE,
@ -45,7 +45,13 @@ export default function TaskList() {
<td>
<Link to={`/tasks/${row.id}`}>{row.id}</Link>
</td>
<td>{row.process_instance_id}</td>
<td>{row.status}</td>
<td>
<Button variant="primary" href={`/tasks/${row.id}`}>
Start
</Button>
</td>
</tr>
);
});
@ -54,7 +60,9 @@ export default function TaskList() {
<thead>
<tr>
<th>Id</th>
<th>Process Instance Id</th>
<th>Status</th>
<th>Actions</th>
</tr>
</thead>
<tbody>{rows}</tbody>

View File

@ -1,6 +1,7 @@
import React, { useEffect, useState } from 'react';
import { useNavigate, useParams } from 'react-router-dom';
import Form from '@rjsf/core';
import { Button } from 'react-bootstrap';
import { BACKEND_BASE_URL, HOT_AUTH_TOKEN } from '../config';
@ -49,11 +50,15 @@ export default function TaskShow() {
// <JSONSchemaForm schema={JSON.parse(task.form_json)} />
return (
<main>
<Button href="/tasks">Go Back</Button>
<h1>Task ID: {task.id}</h1>
<h3>process_instance_id: {task.process_instance_id}</h3>
<h3>status: {task.status}</h3>
<p>form json: {task.form_json}</p>
<Form onSubmit={handleFormSubmit} schema={JSON.parse(task.form_json)} />
<Form
formData={JSON.parse(task.spiffworkflow_task_data)}
onSubmit={handleFormSubmit}
schema={JSON.parse(task.form_json)}
/>
</main>
);
}