Merge remote-tracking branch 'origin/main' into feature/fix_process_instance_rewind

This commit is contained in:
jasquat 2023-03-28 15:07:36 -04:00
commit d08ce856ec
No known key found for this signature in database
10 changed files with 32 additions and 20 deletions

View File

@ -19,8 +19,6 @@ from spiffworkflow_backend.services.process_instance_service import (
)
from spiffworkflow_backend.services.process_model_service import ProcessModelService
# from tests.spiffworkflow_backend.helpers.test_data import load_test_spec
# We need to call this before importing spiffworkflow_backend
# otherwise typeguard cannot work. hence the noqa: E402

View File

@ -1895,7 +1895,7 @@ lxml = "*"
type = "git"
url = "https://github.com/sartography/SpiffWorkflow"
reference = "main"
resolved_reference = "3c3345c85dd7f3b7112ad04aaa6487abbd2e9414"
resolved_reference = "62454c99c3a711c38f4249a3b5e7215d42037d72"
[[package]]
name = "SQLAlchemy"

View File

@ -2,7 +2,7 @@
margin: 0;
padding: 0;
background-color:white;
font-family: 'Arial';
font-family: 'Arial, sans-serif';
}
header {
width: 100%;

View File

@ -1,12 +1,12 @@
<!DOCTYPE html>
<html>
<html lang="en">
<head>
<title>Login Form</title>
<link rel="stylesheet" type="text/css" href="{{ url_for('openid.static', filename='login.css') }}">
</head>
<body>
<header>
<img class="logo_small" src="{{ url_for('openid.static', filename='logo_small.png') }}"/>
<img class="logo_small" src="{{ url_for('openid.static', filename='logo_small.png') }}" alt="Small SpiffWorkflow logo" />
</header>
<h2>Login</h2>

View File

@ -1795,7 +1795,7 @@ class ProcessInstanceProcessor:
)
task_model.start_in_seconds = time.time()
self.bpmn_process_instance.complete_task_from_id(spiff_task.id)
self.bpmn_process_instance.run_task_from_id(spiff_task.id)
task_model.end_in_seconds = time.time()
human_task.completed_by_user_id = user.id

View File

@ -157,8 +157,7 @@ class ProcessInstanceService:
# navigation = processor.bpmn_process_instance.get_deep_nav_list()
# ProcessInstanceService.update_navigation(navigation, processor)
process_model_service = ProcessModelService()
process_model = process_model_service.get_process_model(processor.process_model_identifier)
process_model.display_name if process_model else ""
process_model_service.get_process_model(processor.process_model_identifier)
process_instance_api = ProcessInstanceApi(
id=processor.get_process_instance_id(),
status=processor.get_status(),

View File

@ -36,6 +36,8 @@ import {
getProcessModelFullIdentifierFromSearchParams,
modifyProcessIdentifierForPathParam,
refreshAtInterval,
REFRESH_INTERVAL_SECONDS,
REFRESH_TIMEOUT_SECONDS,
} from '../helpers';
import { useUriListForPermissions } from '../hooks/UriListForPermissions';
@ -68,9 +70,6 @@ import useAPIError from '../hooks/UseApiError';
import { usePermissionFetcher } from '../hooks/PermissionService';
import { Can } from '../contexts/Can';
const REFRESH_INTERVAL = 5;
const REFRESH_TIMEOUT = 600;
type OwnProps = {
filtersEnabled?: boolean;
processModelFullIdentifier?: string;
@ -389,8 +388,8 @@ export default function ProcessInstanceListTable({
checkFiltersAndRun();
if (autoReload) {
return refreshAtInterval(
REFRESH_INTERVAL,
REFRESH_TIMEOUT,
REFRESH_INTERVAL_SECONDS,
REFRESH_TIMEOUT_SECONDS,
checkFiltersAndRun
);
}

View File

@ -9,14 +9,14 @@ import {
getPageInfoFromSearchParams,
modifyProcessIdentifierForPathParam,
refreshAtInterval,
REFRESH_INTERVAL_SECONDS,
REFRESH_TIMEOUT_SECONDS,
} from '../helpers';
import HttpService from '../services/HttpService';
import { PaginationObject, ProcessInstanceTask } from '../interfaces';
import TableCellWithTimeAgoInWords from './TableCellWithTimeAgoInWords';
const PER_PAGE_FOR_TASKS_ON_HOME_PAGE = 5;
const REFRESH_INTERVAL = 5;
const REFRESH_TIMEOUT = 600;
type OwnProps = {
apiPath: string;
@ -89,7 +89,11 @@ export default function TaskListTable({
};
getTasks();
if (autoReload) {
return refreshAtInterval(REFRESH_INTERVAL, REFRESH_TIMEOUT, getTasks);
return refreshAtInterval(
REFRESH_INTERVAL_SECONDS,
REFRESH_TIMEOUT_SECONDS,
getTasks
);
}
return undefined;
}, [

View File

@ -270,3 +270,11 @@ export const encodeBase64 = (data: string) => {
export const decodeBase64 = (data: string) => {
return Buffer.from(data, 'base64').toString('ascii');
};
const MINUTES_IN_HOUR = 60;
const SECONDS_IN_MINUTE = 60;
const SECONDS_IN_HOUR = MINUTES_IN_HOUR * SECONDS_IN_MINUTE;
const FOUR_HOURS_IN_SECONDS = SECONDS_IN_HOUR * 4;
export const REFRESH_INTERVAL_SECONDS = 5;
export const REFRESH_TIMEOUT_SECONDS = FOUR_HOURS_IN_SECONDS;

View File

@ -8,6 +8,8 @@ import {
getPageInfoFromSearchParams,
modifyProcessIdentifierForPathParam,
refreshAtInterval,
REFRESH_INTERVAL_SECONDS,
REFRESH_TIMEOUT_SECONDS,
} from '../helpers';
import HttpService from '../services/HttpService';
import {
@ -19,8 +21,6 @@ import {
import ProcessInstanceRun from '../components/ProcessInstanceRun';
const PER_PAGE_FOR_TASKS_ON_HOME_PAGE = 5;
const REFRESH_INTERVAL = 5;
const REFRESH_TIMEOUT = 600;
export default function MyTasks() {
const [searchParams] = useSearchParams();
@ -46,7 +46,11 @@ export default function MyTasks() {
};
getTasks();
refreshAtInterval(REFRESH_INTERVAL, REFRESH_TIMEOUT, getTasks);
refreshAtInterval(
REFRESH_INTERVAL_SECONDS,
REFRESH_TIMEOUT_SECONDS,
getTasks
);
}, [searchParams]);
const processInstanceRunResultTag = () => {