Skip to content

Commit ef97c27

Browse files
committed
DOC Unsaved changes indcator
1 parent 1e13d85 commit ef97c27

File tree

3 files changed

+54
-0
lines changed

3 files changed

+54
-0
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
title: Unsaved changes indicator
3+
summary: Configure and customise the CMS unsaved changes indicator shown on edit forms
4+
icon: icon-clock
5+
---
6+
7+
# Unsaved changes indicator
8+
9+
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.
10+
11+
![Unsaved changes indicator screenshot](../../_images/unsaved-changes-indicator.png)
12+
13+
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.
14+
15+
## Configuration
16+
17+
You can configure the indicator using YAML. The configuration controls the intervals in minutes for the two levels.
18+
Set either level to `0` to disable that level. Set both to `0` to disable the indicator entirely.
19+
20+
Example: change the notice to 10 minutes and the warning to 20 minutes
21+
22+
```yml
23+
SilverStripe\Admin\Forms\UnsavedChangesIndicator:
24+
minutes:
25+
notice: 10
26+
warning: 20
27+
```
28+
29+
To disable the warning level only:
30+
31+
```yml
32+
SilverStripe\Admin\Forms\UnsavedChangesIndicator:
33+
minutes:
34+
warning: 0
35+
```
36+
37+
To disable the indicator entirely:
38+
39+
```yml
40+
SilverStripe\Admin\Forms\UnsavedChangesIndicator:
41+
minutes:
42+
notice: 0
43+
warning: 0
44+
```

en/08_Changelogs/6.2.0.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,16 @@ If your icon is being added to a `FormAction` or `GridField_FormAction`, we reco
8484

8585
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.
8686

87+
### Unsaved changes indicator {#unsaved-changes-indicator}
88+
89+
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.
90+
91+
![Unsaved changes indicator](../_images/unsaved-changes-indicator.png)
92+
93+
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.
94+
95+
See [Unsaved changes indicator](/developer_guides/customising_the_admin_interface/unsaved-changes-indicator/) instructions on how to configure the indicator.
96+
8797
### Pass arbitrary attributes with requirements API {#requirements-attributes}
8898

8999
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.
6.46 KB
Loading

0 commit comments

Comments
 (0)