avoid prompt to save if no save button (#1806)

Co-authored-by: burnettk <burnettk@users.noreply.github.com>
This commit is contained in:
Kevin Burnett 2024-06-25 14:36:49 +00:00 committed by GitHub
parent 5e3831f4d6
commit ce6dc339c8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 15 additions and 12 deletions

View File

@ -16,13 +16,13 @@ users:
preferred_username: dan
groups:
admin:
users: [admin@spiffworkflow.org, nelson@spiffworkflow.org]
users: [admin@example.com, nelson@example.com]
group1:
users: [jason@sartography.com, kevin@sartography.com]
users: [jason@example.com, kevin@example.com]
group2:
users: [dan@sartography.com]
users: [dan@example.com]
group3:
users: [jon@sartography.com]
users: [jon@example.com]
spiff_public:
users: []

View File

@ -31,6 +31,7 @@ import {
} from '@carbon/icons-react';
import { gray } from '@carbon/colors';
import { Can } from '@casl/react';
import Editor, { DiffEditor } from '@monaco-editor/react';
import MDEditor from '@uiw/react-md-editor';
import HttpService from '../services/HttpService';
@ -1372,14 +1373,16 @@ export default function ProcessModelEditDiagram() {
const unsavedChangesMessage = () => {
if (diagramHasChanges) {
return (
<Notification
title="Unsaved changes."
type="error"
hideCloseButton
data-qa="process-model-file-changed"
>
Please save to avoid losing your work.
</Notification>
<Can I="PUT" a={targetUris.processModelFileShowPath} ability={ability}>
<Notification
title="Unsaved changes."
type="error"
hideCloseButton
data-qa="process-model-file-changed"
>
Please save to avoid losing your work.
</Notification>
</Can>
);
}
return null;