Don't show delete button for primary file
This commit is contained in:
parent
2c25e626e1
commit
088826e433
|
@ -68,6 +68,7 @@ type OwnProps = {
|
|||
completedTasksBpmnIds?: string[] | null;
|
||||
saveDiagram?: (..._args: any[]) => any;
|
||||
onDeleteFile?: (..._args: any[]) => any;
|
||||
isPrimaryFile?: boolean;
|
||||
onSetPrimaryFile?: (..._args: any[]) => any;
|
||||
diagramXML?: string | null;
|
||||
fileName?: string;
|
||||
|
@ -92,6 +93,7 @@ export default function ReactDiagramEditor({
|
|||
completedTasksBpmnIds,
|
||||
saveDiagram,
|
||||
onDeleteFile,
|
||||
isPrimaryFile,
|
||||
onSetPrimaryFile,
|
||||
diagramXML,
|
||||
fileName,
|
||||
|
@ -549,7 +551,7 @@ export default function ReactDiagramEditor({
|
|||
a={targetUris.processModelFileShowPath}
|
||||
ability={ability}
|
||||
>
|
||||
{fileName && (
|
||||
{fileName && !isPrimaryFile && (
|
||||
<ButtonWithConfirmation
|
||||
description={`Delete file ${fileName}?`}
|
||||
onConfirmation={handleDelete}
|
||||
|
|
|
@ -819,6 +819,7 @@ export default function ProcessModelEditDiagram() {
|
|||
processModelId={params.process_model_id || ''}
|
||||
saveDiagram={saveDiagram}
|
||||
onDeleteFile={onDeleteFile}
|
||||
isPrimaryFile={params.file_name === processModel?.primary_file_name}
|
||||
onSetPrimaryFile={onSetPrimaryFileCallback}
|
||||
diagramXML={bpmnXmlForDiagramRendering}
|
||||
fileName={params.file_name}
|
||||
|
|
|
@ -264,6 +264,7 @@ export default function ProcessModelShow() {
|
|||
</Can>
|
||||
);
|
||||
|
||||
if (!isPrimaryBpmnFile) {
|
||||
elements.push(
|
||||
<Can
|
||||
I="DELETE"
|
||||
|
@ -283,6 +284,7 @@ export default function ProcessModelShow() {
|
|||
/>
|
||||
</Can>
|
||||
);
|
||||
}
|
||||
if (processModelFile.name.match(/\.bpmn$/) && !isPrimaryBpmnFile) {
|
||||
elements.push(
|
||||
<Can I="PUT" a={targetUris.processModelShowPath} ability={ability}>
|
||||
|
|
Loading…
Reference in New Issue