Add data stores API (#949)
This commit is contained in:
parent
007facc9d5
commit
15cec29680
|
@ -84,6 +84,7 @@ type OwnProps = {
|
|||
onLaunchDmnEditor?: (..._args: any[]) => any;
|
||||
onElementClick?: (..._args: any[]) => any;
|
||||
onServiceTasksRequested?: (..._args: any[]) => any;
|
||||
onDataStoresRequested?: (..._args: any[]) => any;
|
||||
onJsonSchemaFilesRequested?: (..._args: any[]) => any;
|
||||
onDmnFilesRequested?: (..._args: any[]) => any;
|
||||
onSearchProcessModels?: (..._args: any[]) => any;
|
||||
|
@ -113,6 +114,7 @@ export default function ReactDiagramEditor({
|
|||
onLaunchDmnEditor,
|
||||
onElementClick,
|
||||
onServiceTasksRequested,
|
||||
onDataStoresRequested,
|
||||
onJsonSchemaFilesRequested,
|
||||
onDmnFilesRequested,
|
||||
onSearchProcessModels,
|
||||
|
@ -325,6 +327,12 @@ export default function ReactDiagramEditor({
|
|||
}
|
||||
}
|
||||
|
||||
function handleDataStoresRequested(event: any) {
|
||||
if (onDataStoresRequested) {
|
||||
onDataStoresRequested(event);
|
||||
}
|
||||
}
|
||||
|
||||
setDiagramModelerState(diagramModeler);
|
||||
|
||||
diagramModeler.on('spiff.script.edit', (event: any) => {
|
||||
|
@ -384,6 +392,10 @@ export default function ReactDiagramEditor({
|
|||
handleServiceTasksRequested(event);
|
||||
});
|
||||
|
||||
diagramModeler.on('spiff.data_stores.requested', (event: any) => {
|
||||
handleDataStoresRequested(event);
|
||||
});
|
||||
|
||||
diagramModeler.on('spiff.json_schema_files.requested', (event: any) => {
|
||||
if (onJsonSchemaFilesRequested) {
|
||||
onJsonSchemaFilesRequested(event);
|
||||
|
@ -415,6 +427,7 @@ export default function ReactDiagramEditor({
|
|||
onLaunchJsonSchemaEditor,
|
||||
onElementClick,
|
||||
onServiceTasksRequested,
|
||||
onDataStoresRequested,
|
||||
onJsonSchemaFilesRequested,
|
||||
onDmnFilesRequested,
|
||||
onSearchProcessModels,
|
||||
|
|
|
@ -367,6 +367,14 @@ export default function ProcessModelEditDiagram() {
|
|||
};
|
||||
};
|
||||
|
||||
const makeDataStoresApiHandler = (event: any) => {
|
||||
return function fireEvent(results: any) {
|
||||
event.eventBus.fire('spiff.data_stores.returned', {
|
||||
options: results,
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
const onServiceTasksRequested = (event: any) => {
|
||||
HttpService.makeCallToBackend({
|
||||
path: `/service-tasks`,
|
||||
|
@ -374,6 +382,13 @@ export default function ProcessModelEditDiagram() {
|
|||
});
|
||||
};
|
||||
|
||||
const onDataStoresRequested = (event: any) => {
|
||||
HttpService.makeCallToBackend({
|
||||
path: `/data-stores`,
|
||||
successCallback: makeDataStoresApiHandler(event),
|
||||
});
|
||||
};
|
||||
|
||||
const onJsonSchemaFilesRequested = (event: any) => {
|
||||
setFileEventBus(event.eventBus);
|
||||
const re = /.*[-.]schema.json/;
|
||||
|
@ -1095,6 +1110,7 @@ export default function ProcessModelEditDiagram() {
|
|||
diagramType="bpmn"
|
||||
onLaunchScriptEditor={onLaunchScriptEditor}
|
||||
onServiceTasksRequested={onServiceTasksRequested}
|
||||
onDataStoresRequested={onDataStoresRequested}
|
||||
onLaunchMarkdownEditor={onLaunchMarkdownEditor}
|
||||
onLaunchBpmnEditor={onLaunchBpmnEditor}
|
||||
onLaunchJsonSchemaEditor={onLaunchJsonSchemaEditor}
|
||||
|
|
Loading…
Reference in New Issue