public dashboards: check to see if dashboard state is different from persisted on save (#52008)

* public dashboards: check to see if dashboard state is different from persisted on save

Co-authored-by: Ezequiel Victorero <ezequiel.victorero@grafana.com>
This commit is contained in:
Jeff Levin 2022-08-01 04:35:09 -08:00 committed by GitHub
parent 3395981d35
commit 58ff0f07b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -221,7 +221,14 @@ export const SharePublicDashboard = (props: Props) => {
</Field>
)}
</FieldSet>
<Button disabled={!acknowledged()} onClick={onSavePublicConfig}>
{props.dashboard.hasUnsavedChanges() && (
<Alert
title="Please save your dashboard changes before updating the public configuration"
severity="warning"
/>
)}
<Button disabled={!acknowledged() || props.dashboard.hasUnsavedChanges()} onClick={onSavePublicConfig}>
Save Sharing Configuration
</Button>
</div>