only load file references when needed to avoid unnecessary xml errors w/ burnettk
This commit is contained in:
parent
51037c47cc
commit
c89c4545c3
|
@ -397,6 +397,12 @@ paths:
|
|||
description: the modified process model id
|
||||
schema:
|
||||
type: string
|
||||
- name: include_file_references
|
||||
in: query
|
||||
required: false
|
||||
description: include all file references in the return
|
||||
schema:
|
||||
type: boolean
|
||||
get:
|
||||
operationId: spiffworkflow_backend.routes.process_models_controller.process_model_show
|
||||
summary: Returns a single process model
|
||||
|
|
|
@ -123,7 +123,7 @@ def process_model_update(
|
|||
return ProcessModelInfoSchema().dump(process_model)
|
||||
|
||||
|
||||
def process_model_show(modified_process_model_identifier: str) -> Any:
|
||||
def process_model_show(modified_process_model_identifier: str, include_file_references: bool = False) -> Any:
|
||||
"""Process_model_show."""
|
||||
process_model_identifier = modified_process_model_identifier.replace(":", "/")
|
||||
process_model = _get_process_model(process_model_identifier)
|
||||
|
@ -132,8 +132,10 @@ def process_model_show(modified_process_model_identifier: str) -> Any:
|
|||
key=lambda f: "" if f.name == process_model.primary_file_name else f.sort_index,
|
||||
)
|
||||
process_model.files = files
|
||||
for file in process_model.files:
|
||||
file.references = SpecFileService.get_references_for_file(file, process_model)
|
||||
|
||||
if include_file_references:
|
||||
for file in process_model.files:
|
||||
file.references = SpecFileService.get_references_for_file(file, process_model)
|
||||
|
||||
process_model.parent_groups = ProcessModelService.get_parent_group_array(
|
||||
process_model.id
|
||||
|
|
|
@ -37,7 +37,9 @@ export default function ProcessModelSearch({
|
|||
const shouldFilterProcessModel = (options: any) => {
|
||||
const processModel: ProcessModel = options.item;
|
||||
const { inputValue } = options;
|
||||
return getFullProcessModelLabel(processModel).includes(inputValue);
|
||||
return getFullProcessModelLabel(processModel)
|
||||
.toLowerCase()
|
||||
.includes((inputValue || '').toLowerCase());
|
||||
};
|
||||
return (
|
||||
<ComboBox
|
||||
|
|
|
@ -134,7 +134,7 @@ export default function ProcessModelEditDiagram() {
|
|||
setProcessModel(result);
|
||||
};
|
||||
HttpService.makeCallToBackend({
|
||||
path: `/${processModelPath}`,
|
||||
path: `/${processModelPath}?include_file_references=true`,
|
||||
successCallback: processResult,
|
||||
});
|
||||
}, [processModelPath]);
|
||||
|
|
Loading…
Reference in New Issue