Skip to content

feat(ui5-user-settings-dialog): add saveMode with Save/Cancel footer - #13845

Merged
dobromiraboycheva merged 9 commits into
mainfrom
user-settings-dialog-footer-save-mode
Jul 21, 2026
Merged

feat(ui5-user-settings-dialog): add saveMode with Save/Cancel footer#13845
dobromiraboycheva merged 9 commits into
mainfrom
user-settings-dialog-footer-save-mode

Conversation

@dobromiraboycheva

@dobromiraboycheva dobromiraboycheva commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Overview

Introducing a new save-mode property to the UserSettingsDialog component, allowing applications to switch the footer from the default "Close" button to explicit Save and Cancel actions.

Structure

  • When save-mode is not set (default false), the footer displays a single "Close" button — the current behavior is unchanged
  • When save-mode is set, the footer displays a Save (Emphasized) and a Cancel button instead of "Close"
  • Clicking Save fires the save event; clicking Cancel fires the cancel event
  • Neither event closes the dialog automatically — the application is responsible for closing it after persisting or discarding the changes (typically after a backend call)

API

UserSettingsDialog new property:

Property Type Default Description
saveMode boolean false When set, the footer renders Save and Cancel buttons instead of the default Close button.

UserSettingsDialog new events:

Event Description
save Fired when the Save button is clicked. The application is responsible for closing the dialog after persisting the changes.
cancel Fired when the Cancel button is clicked. The application is responsible for closing the dialog after discarding the changes.

Usage

Default footer (Close button):

<ui5-user-settings-dialog header-text="Settings">
  <ui5-user-settings-item icon="user-settings" text="User Account" header-text="User Account" selected>
    <ui5-user-settings-view></ui5-user-settings-view>
  </ui5-user-settings-item>
</ui5-user-settings-dialog>
Screenshot 2026-07-20 at 11 27 53

Save mode (Save + Cancel buttons):

<ui5-user-settings-dialog id="settings" header-text="Settings" save-mode>
  <ui5-user-settings-item icon="user-settings" text="User Account" header-text="User Account" selected>
    <ui5-user-settings-view></ui5-user-settings-view>
  </ui5-user-settings-item>
</ui5-user-settings-dialog>

<script>
Screenshot 2026-07-20 at 11 26 41
  const dialog = document.getElementById("settings");
  dialog.addEventListener("save", () => {
    // persist changes, then close
    dialog.open = false;
  });
  dialog.addEventListener("cancel", () => {
    // discard changes, then close
    dialog.open = false;
  });
</script>

Add a boolean `saveMode` property (default false, backward-compatible).
When enabled, the footer renders Save (Emphasized) and Cancel buttons
instead of the default Close button, each firing a corresponding
non-cancelable event. The application is responsible for closing the
dialog after persisting or discarding the changes.

- Add `save` and `cancel` event decorators and handlers
- Add Save/Cancel button i18n keys and getters
- Add SaveMode website sample (HTML, JS, React) with a confirmation dialog
- Document the Save Mode under More Samples
- Add Cypress specs covering the save-mode footer and events
- Demonstrate save-mode in the dev test page
@sap-ui5-webcomponents-release

Copy link
Copy Markdown

…Mode React sample

UI5 component wrappers accept `class`, not `className`. Replace it on
the Panel, Text, Label and Select wrappers to fix the sample typecheck.
…footer-save-mode

# Conflicts:
#	packages/fiori/test/pages/UserSettingsDialog.html
Comment thread packages/fiori/src/UserSettingsDialogTemplate.tsx Outdated
Tooltips should only be used on icon-only buttons. The footer Save,
Cancel and Close buttons all have visible text, so their redundant
tooltip props are removed.
@dobromiraboycheva
dobromiraboycheva merged commit 7a23598 into main Jul 21, 2026
14 checks passed
@dobromiraboycheva
dobromiraboycheva deleted the user-settings-dialog-footer-save-mode branch July 21, 2026 15:56
@sap-ui5-webcomponents-release

Copy link
Copy Markdown

🧹 Preview deployment cleaned up: https://pr-13845--ui5-webcomponents.netlify.app

@sap-ui5-webcomponents-release

Copy link
Copy Markdown

🎉 This PR is included in version v2.25.0 🎉

The release is available on v2.25.0

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants