mirror of
https://github.com/status-im/spiff-arena.git
synced 2025-01-31 12:15:45 +00:00
Merge pull request #74 from sartography/bug/delete-primary-warning
Don't show delete button for primary file
This commit is contained in:
commit
04fed0c004
@ -70,6 +70,7 @@ type OwnProps = {
|
|||||||
completedProcessInstanceTasks?: ProcessInstanceTask[] | null;
|
completedProcessInstanceTasks?: ProcessInstanceTask[] | null;
|
||||||
saveDiagram?: (..._args: any[]) => any;
|
saveDiagram?: (..._args: any[]) => any;
|
||||||
onDeleteFile?: (..._args: any[]) => any;
|
onDeleteFile?: (..._args: any[]) => any;
|
||||||
|
isPrimaryFile?: boolean;
|
||||||
onSetPrimaryFile?: (..._args: any[]) => any;
|
onSetPrimaryFile?: (..._args: any[]) => any;
|
||||||
diagramXML?: string | null;
|
diagramXML?: string | null;
|
||||||
fileName?: string;
|
fileName?: string;
|
||||||
@ -94,6 +95,7 @@ export default function ReactDiagramEditor({
|
|||||||
completedProcessInstanceTasks,
|
completedProcessInstanceTasks,
|
||||||
saveDiagram,
|
saveDiagram,
|
||||||
onDeleteFile,
|
onDeleteFile,
|
||||||
|
isPrimaryFile,
|
||||||
onSetPrimaryFile,
|
onSetPrimaryFile,
|
||||||
diagramXML,
|
diagramXML,
|
||||||
fileName,
|
fileName,
|
||||||
@ -573,7 +575,7 @@ export default function ReactDiagramEditor({
|
|||||||
a={targetUris.processModelFileShowPath}
|
a={targetUris.processModelFileShowPath}
|
||||||
ability={ability}
|
ability={ability}
|
||||||
>
|
>
|
||||||
{fileName && (
|
{fileName && !isPrimaryFile && (
|
||||||
<ButtonWithConfirmation
|
<ButtonWithConfirmation
|
||||||
description={`Delete file ${fileName}?`}
|
description={`Delete file ${fileName}?`}
|
||||||
onConfirmation={handleDelete}
|
onConfirmation={handleDelete}
|
||||||
|
@ -823,6 +823,7 @@ export default function ProcessModelEditDiagram() {
|
|||||||
processModelId={params.process_model_id || ''}
|
processModelId={params.process_model_id || ''}
|
||||||
saveDiagram={saveDiagram}
|
saveDiagram={saveDiagram}
|
||||||
onDeleteFile={onDeleteFile}
|
onDeleteFile={onDeleteFile}
|
||||||
|
isPrimaryFile={params.file_name === processModel?.primary_file_name}
|
||||||
onSetPrimaryFile={onSetPrimaryFileCallback}
|
onSetPrimaryFile={onSetPrimaryFileCallback}
|
||||||
diagramXML={bpmnXmlForDiagramRendering}
|
diagramXML={bpmnXmlForDiagramRendering}
|
||||||
fileName={params.file_name}
|
fileName={params.file_name}
|
||||||
|
@ -264,6 +264,7 @@ export default function ProcessModelShow() {
|
|||||||
</Can>
|
</Can>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (!isPrimaryBpmnFile) {
|
||||||
elements.push(
|
elements.push(
|
||||||
<Can
|
<Can
|
||||||
I="DELETE"
|
I="DELETE"
|
||||||
@ -283,6 +284,7 @@ export default function ProcessModelShow() {
|
|||||||
/>
|
/>
|
||||||
</Can>
|
</Can>
|
||||||
);
|
);
|
||||||
|
}
|
||||||
if (processModelFile.name.match(/\.bpmn$/) && !isPrimaryBpmnFile) {
|
if (processModelFile.name.match(/\.bpmn$/) && !isPrimaryBpmnFile) {
|
||||||
elements.push(
|
elements.push(
|
||||||
<Can I="PUT" a={targetUris.processModelShowPath} ability={ability}>
|
<Can I="PUT" a={targetUris.processModelShowPath} ability={ability}>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user