get callers & pass to diagram editor
This commit is contained in:
parent
431fde71bc
commit
9922b99f64
|
@ -85,6 +85,7 @@ type OwnProps = {
|
||||||
onSearchProcessModels?: (..._args: any[]) => any;
|
onSearchProcessModels?: (..._args: any[]) => any;
|
||||||
onElementsChanged?: (..._args: any[]) => any;
|
onElementsChanged?: (..._args: any[]) => any;
|
||||||
url?: string;
|
url?: string;
|
||||||
|
callers?: any;
|
||||||
};
|
};
|
||||||
|
|
||||||
// https://codesandbox.io/s/quizzical-lake-szfyo?file=/src/App.js was a handy reference
|
// https://codesandbox.io/s/quizzical-lake-szfyo?file=/src/App.js was a handy reference
|
||||||
|
@ -110,6 +111,7 @@ export default function ReactDiagramEditor({
|
||||||
onSearchProcessModels,
|
onSearchProcessModels,
|
||||||
onElementsChanged,
|
onElementsChanged,
|
||||||
url,
|
url,
|
||||||
|
callers,
|
||||||
}: OwnProps) {
|
}: OwnProps) {
|
||||||
const [diagramXMLString, setDiagramXMLString] = useState('');
|
const [diagramXMLString, setDiagramXMLString] = useState('');
|
||||||
const [diagramModelerState, setDiagramModelerState] = useState(null);
|
const [diagramModelerState, setDiagramModelerState] = useState(null);
|
||||||
|
@ -125,6 +127,8 @@ export default function ReactDiagramEditor({
|
||||||
const { ability } = usePermissionFetcher(permissionRequestData);
|
const { ability } = usePermissionFetcher(permissionRequestData);
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
|
||||||
|
console.log(callers);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (diagramModelerState) {
|
if (diagramModelerState) {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -197,6 +197,7 @@ export interface ProcessModel {
|
||||||
description: string;
|
description: string;
|
||||||
display_name: string;
|
display_name: string;
|
||||||
primary_file_name: string;
|
primary_file_name: string;
|
||||||
|
primary_process_id: string;
|
||||||
files: ProcessFile[];
|
files: ProcessFile[];
|
||||||
parent_groups?: ProcessGroupLite[];
|
parent_groups?: ProcessGroupLite[];
|
||||||
metadata_extraction_paths?: MetadataExtractionPath[];
|
metadata_extraction_paths?: MetadataExtractionPath[];
|
||||||
|
|
|
@ -147,6 +147,7 @@ export default function MyTasks() {
|
||||||
description: '',
|
description: '',
|
||||||
display_name: '',
|
display_name: '',
|
||||||
primary_file_name: '',
|
primary_file_name: '',
|
||||||
|
primary_process_id: '',
|
||||||
files: [],
|
files: [],
|
||||||
};
|
};
|
||||||
const modifiedProcessModelId = modifyProcessIdentifierForPathParam(
|
const modifiedProcessModelId = modifyProcessIdentifierForPathParam(
|
||||||
|
|
|
@ -119,6 +119,8 @@ export default function ProcessModelEditDiagram() {
|
||||||
|
|
||||||
const processModelPath = `process-models/${modifiedProcessModelId}`;
|
const processModelPath = `process-models/${modifiedProcessModelId}`;
|
||||||
|
|
||||||
|
const [callers, setCallers] = useState<Array<string>>([]);
|
||||||
|
|
||||||
usePrompt('Changes you made may not be saved.', diagramHasChanges);
|
usePrompt('Changes you made may not be saved.', diagramHasChanges);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
@ -162,6 +164,18 @@ export default function ProcessModelEditDiagram() {
|
||||||
}
|
}
|
||||||
}, [processModelPath, params]);
|
}, [processModelPath, params]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const getCallerIds = (result: any) => {
|
||||||
|
setCallers(result.map((r: any) => r.process_model_id));
|
||||||
|
}
|
||||||
|
if (processModel !== null) {
|
||||||
|
HttpService.makeCallToBackend({
|
||||||
|
path: `/processes/${processModel.primary_process_id}/callers`,
|
||||||
|
successCallback: getCallerIds,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}, [processModel]);
|
||||||
|
|
||||||
const handleFileNameCancel = () => {
|
const handleFileNameCancel = () => {
|
||||||
setShowFileNameEditor(false);
|
setShowFileNameEditor(false);
|
||||||
setNewFileName('');
|
setNewFileName('');
|
||||||
|
@ -958,6 +972,7 @@ export default function ProcessModelEditDiagram() {
|
||||||
onDmnFilesRequested={onDmnFilesRequested}
|
onDmnFilesRequested={onDmnFilesRequested}
|
||||||
onSearchProcessModels={onSearchProcessModels}
|
onSearchProcessModels={onSearchProcessModels}
|
||||||
onElementsChanged={onElementsChanged}
|
onElementsChanged={onElementsChanged}
|
||||||
|
callers={callers}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
|
@ -12,6 +12,7 @@ export default function ProcessModelNew() {
|
||||||
display_name: '',
|
display_name: '',
|
||||||
description: '',
|
description: '',
|
||||||
primary_file_name: '',
|
primary_file_name: '',
|
||||||
|
primary_process_id: '',
|
||||||
files: [],
|
files: [],
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue