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 preferred_username: dan
groups: groups:
admin: admin:
users: [admin@spiffworkflow.org, nelson@spiffworkflow.org] users: [admin@example.com, nelson@example.com]
group1: group1:
users: [jason@sartography.com, kevin@sartography.com] users: [jason@example.com, kevin@example.com]
group2: group2:
users: [dan@sartography.com] users: [dan@example.com]
group3: group3:
users: [jon@sartography.com] users: [jon@example.com]
spiff_public: spiff_public:
users: [] users: []

View File

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