Merge pull request #128 from sartography/feature/bug_fixes
Feature/bug fixes
This commit is contained in:
commit
be34d6990f
|
@ -2,6 +2,7 @@
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
import uuid
|
import uuid
|
||||||
|
from sys import exc_info
|
||||||
from typing import Any
|
from typing import Any
|
||||||
from typing import Dict
|
from typing import Dict
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
@ -559,9 +560,21 @@ def _render_jinja_template(unprocessed_template: str, spiff_task: SpiffTask) ->
|
||||||
template_error.lineno - 1
|
template_error.lineno - 1
|
||||||
]
|
]
|
||||||
wfe.add_note(
|
wfe.add_note(
|
||||||
"Jinja2 template errors can happen when trying to displaying task data"
|
"Jinja2 template errors can happen when trying to display task data"
|
||||||
)
|
)
|
||||||
raise wfe from template_error
|
raise wfe from template_error
|
||||||
|
except Exception as error:
|
||||||
|
type, value, tb = exc_info()
|
||||||
|
wfe = WorkflowTaskException(str(error), task=spiff_task, exception=error)
|
||||||
|
while tb:
|
||||||
|
if tb.tb_frame.f_code.co_filename == "<template>":
|
||||||
|
wfe.line_number = tb.tb_lineno
|
||||||
|
wfe.error_line = unprocessed_template.split("\n")[tb.tb_lineno - 1]
|
||||||
|
tb = tb.tb_next
|
||||||
|
wfe.add_note(
|
||||||
|
"Jinja2 template errors can happen when trying to displaying task data"
|
||||||
|
)
|
||||||
|
raise wfe from error
|
||||||
|
|
||||||
|
|
||||||
def _get_spiff_task_from_process_instance(
|
def _get_spiff_task_from_process_instance(
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
"@types/node": "^18.6.5",
|
"@types/node": "^18.6.5",
|
||||||
"@types/react": "^18.0.17",
|
"@types/react": "^18.0.17",
|
||||||
"@types/react-dom": "^18.0.6",
|
"@types/react-dom": "^18.0.6",
|
||||||
"@uiw/react-md-editor": "^3.19.5",
|
"@uiw/react-md-editor": "^3.20.2",
|
||||||
"autoprefixer": "10.4.8",
|
"autoprefixer": "10.4.8",
|
||||||
"axios": "^0.27.2",
|
"axios": "^0.27.2",
|
||||||
"bootstrap": "^5.2.0",
|
"bootstrap": "^5.2.0",
|
||||||
|
@ -58,11 +58,9 @@
|
||||||
"react-dom": "^18.2.0",
|
"react-dom": "^18.2.0",
|
||||||
"react-icons": "^4.4.0",
|
"react-icons": "^4.4.0",
|
||||||
"react-jsonschema-form": "^1.8.1",
|
"react-jsonschema-form": "^1.8.1",
|
||||||
"react-markdown": "^8.0.3",
|
|
||||||
"react-router": "^6.3.0",
|
"react-router": "^6.3.0",
|
||||||
"react-router-dom": "^6.3.0",
|
"react-router-dom": "^6.3.0",
|
||||||
"react-scripts": "^5.0.1",
|
"react-scripts": "^5.0.1",
|
||||||
"remark-gfm": "^3.0.1",
|
|
||||||
"serve": "^14.0.0",
|
"serve": "^14.0.0",
|
||||||
"timepicker": "^1.13.18",
|
"timepicker": "^1.13.18",
|
||||||
"typescript": "^4.7.4",
|
"typescript": "^4.7.4",
|
||||||
|
@ -6473,9 +6471,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@uiw/react-md-editor": {
|
"node_modules/@uiw/react-md-editor": {
|
||||||
"version": "3.19.5",
|
"version": "3.20.2",
|
||||||
"resolved": "https://registry.npmjs.org/@uiw/react-md-editor/-/react-md-editor-3.19.5.tgz",
|
"resolved": "https://registry.npmjs.org/@uiw/react-md-editor/-/react-md-editor-3.20.2.tgz",
|
||||||
"integrity": "sha512-uhFGLOrKEtADM8QUauTdG5x8wqNS15ry2jCYMBr/E1Or3njvg7jpB0KRv+QTgZDnglevCTjuQxZPH7I7hG2uKw==",
|
"integrity": "sha512-L3sp3dsbpTOcVX+mzkmwwDl2Jl/UEgrySTun4XCMck1QF1WX53z0sHbN6XET+veHOML9Tw8TUUECR7IqajYjDw==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/runtime": "^7.14.6",
|
"@babel/runtime": "^7.14.6",
|
||||||
"@uiw/react-markdown-preview": "^4.1.5",
|
"@uiw/react-markdown-preview": "^4.1.5",
|
||||||
|
@ -36996,9 +36994,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@uiw/react-md-editor": {
|
"@uiw/react-md-editor": {
|
||||||
"version": "3.19.5",
|
"version": "3.20.2",
|
||||||
"resolved": "https://registry.npmjs.org/@uiw/react-md-editor/-/react-md-editor-3.19.5.tgz",
|
"resolved": "https://registry.npmjs.org/@uiw/react-md-editor/-/react-md-editor-3.20.2.tgz",
|
||||||
"integrity": "sha512-uhFGLOrKEtADM8QUauTdG5x8wqNS15ry2jCYMBr/E1Or3njvg7jpB0KRv+QTgZDnglevCTjuQxZPH7I7hG2uKw==",
|
"integrity": "sha512-L3sp3dsbpTOcVX+mzkmwwDl2Jl/UEgrySTun4XCMck1QF1WX53z0sHbN6XET+veHOML9Tw8TUUECR7IqajYjDw==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@babel/runtime": "^7.14.6",
|
"@babel/runtime": "^7.14.6",
|
||||||
"@uiw/react-markdown-preview": "^4.1.5",
|
"@uiw/react-markdown-preview": "^4.1.5",
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
"@types/node": "^18.6.5",
|
"@types/node": "^18.6.5",
|
||||||
"@types/react": "^18.0.17",
|
"@types/react": "^18.0.17",
|
||||||
"@types/react-dom": "^18.0.6",
|
"@types/react-dom": "^18.0.6",
|
||||||
"@uiw/react-md-editor": "^3.19.5",
|
"@uiw/react-md-editor": "^3.20.2",
|
||||||
"autoprefixer": "10.4.8",
|
"autoprefixer": "10.4.8",
|
||||||
"axios": "^0.27.2",
|
"axios": "^0.27.2",
|
||||||
"bootstrap": "^5.2.0",
|
"bootstrap": "^5.2.0",
|
||||||
|
@ -53,11 +53,9 @@
|
||||||
"react-dom": "^18.2.0",
|
"react-dom": "^18.2.0",
|
||||||
"react-icons": "^4.4.0",
|
"react-icons": "^4.4.0",
|
||||||
"react-jsonschema-form": "^1.8.1",
|
"react-jsonschema-form": "^1.8.1",
|
||||||
"react-markdown": "^8.0.3",
|
|
||||||
"react-router": "^6.3.0",
|
"react-router": "^6.3.0",
|
||||||
"react-router-dom": "^6.3.0",
|
"react-router-dom": "^6.3.0",
|
||||||
"react-scripts": "^5.0.1",
|
"react-scripts": "^5.0.1",
|
||||||
"remark-gfm": "^3.0.1",
|
|
||||||
"serve": "^14.0.0",
|
"serve": "^14.0.0",
|
||||||
"timepicker": "^1.13.18",
|
"timepicker": "^1.13.18",
|
||||||
"typescript": "^4.7.4",
|
"typescript": "^4.7.4",
|
||||||
|
|
|
@ -12,8 +12,7 @@ import {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
} from '@carbon/react';
|
} from '@carbon/react';
|
||||||
|
|
||||||
import ReactMarkdown from 'react-markdown';
|
import MDEditor from '@uiw/react-md-editor';
|
||||||
import remarkGfm from 'remark-gfm';
|
|
||||||
// eslint-disable-next-line import/no-named-as-default
|
// eslint-disable-next-line import/no-named-as-default
|
||||||
import Form from '../themes/carbon';
|
import Form from '../themes/carbon';
|
||||||
import HttpService from '../services/HttpService';
|
import HttpService from '../services/HttpService';
|
||||||
|
@ -263,9 +262,7 @@ export default function TaskShow() {
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<div className="markdown">
|
<div className="markdown">
|
||||||
<ReactMarkdown remarkPlugins={[remarkGfm]}>
|
<MDEditor.Markdown source={instructions} />
|
||||||
{instructions}
|
|
||||||
</ReactMarkdown>
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue