Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
title: Unsaved changes indicator
summary: Configure and customise the CMS unsaved changes indicator shown on edit forms
icon: icon-clock
---

# Unsaved changes indicator

The CMS shows a small inline indicator on edit forms after a user has started editing the form (contains unsaved changes) after a configurable period of time. The indicator starts as a subtle "notice" and escalates to a more prominent "warning" after a second period. This helps editors remember to save their work and reduces accidental data loss.

![Unsaved changes indicator screenshot](../../_images/unsaved-changes-indicator.png)

The indicator activates only when the form has started editing the form. When the form then changes to a state where there are no unsaved changes, either by saving or reverting the unsaved changes, then its timer resets. By default, a notice appears after 5 minutes, escalating to a warning after 10 minutes. Notice and warning are independent levels; you can disable either or both through configuration.

## Configuration

You can configure the indicator using YAML. The configuration controls the intervals in minutes for the two levels.
Set either level to `0` to disable that level. Set both to `0` to disable the indicator entirely.

Example: change the notice to 10 minutes and the warning to 20 minutes

```yml
SilverStripe\Admin\Forms\UnsavedChangesIndicator:
minutes:
notice: 10
warning: 20
```

To disable the warning level only:

```yml
SilverStripe\Admin\Forms\UnsavedChangesIndicator:
minutes:
warning: 0
```

To disable the indicator entirely:

```yml
SilverStripe\Admin\Forms\UnsavedChangesIndicator:
minutes:
notice: 0
warning: 0
```
10 changes: 10 additions & 0 deletions en/08_Changelogs/6.2.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,16 @@ If your icon is being added to a `FormAction` or `GridField_FormAction`, we reco

Functionality has also been added to allow swapping icons in an accessible way for alternating buttons (e.g. the save and publish buttons). See [how to implement an alternating button](/developer_guides/customising_the_admin_interface/how_tos/cms_alternating_button/) (which has been updated) for details.

### Unsaved changes indicator {#unsaved-changes-indicator}

A new unsaved changes indicator has been introduced to CMS edit forms. The indicator appears after a configurable amount of time after starting to edit a form, providing real-time visual alerts when changes have been made but not yet saved. This helps users keep track of their work and prevent accidental data loss by making unsaved modifications more apparent.

![Unsaved changes indicator](../_images/unsaved-changes-indicator.png)

The indicator appears as a "notice" after a configurable initial period (defaulting to five minutes) and escalates to a more prominent "warning" after a second configurable interval (defaulting to ten minutes). This escalation ensures users are increasingly aware of long-standing unsaved changes.

See [Unsaved changes indicator](/developer_guides/customising_the_admin_interface/unsaved-changes-indicator/) instructions on how to configure the indicator.

### Pass arbitrary attributes with requirements API {#requirements-attributes}

When using [`Requirements_Backend`](api:SilverStripe\View\Requirements_Backend) as your requirements API backend (which is the default), you can now pass arbitrary attributes for JavaScript and CSS (`<script>` and `<link>` tags) using the `$options` argument in various methods.
Expand Down
Binary file added en/_images/unsaved-changes-indicator.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.