Skip to content

Commit

Permalink
fix(ui5-view-settings-dialog): adjust reset button announcement (#10320)
Browse files Browse the repository at this point in the history
Related to: #10191
  • Loading branch information
unazko authored Jan 15, 2025
1 parent 5493f68 commit 42b29f3
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
18 changes: 18 additions & 0 deletions packages/fiori/src/ViewSettingsDialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import type { ChangeInfo } from "@ui5/webcomponents-base/dist/UI5Element.js";
import type Dialog from "@ui5/webcomponents/dist/Dialog.js";
import type List from "@ui5/webcomponents/dist/List.js";
import type { ListItemClickEventDetail } from "@ui5/webcomponents/dist/List.js";
import announce from "@ui5/webcomponents-base/dist/util/InvisibleMessage.js";
import InvisibleMessageMode from "@ui5/webcomponents-base/dist/types/InvisibleMessageMode.js";

import ViewSettingsDialogMode from "./types/ViewSettingsDialogMode.js";
import "@ui5/webcomponents-icons/dist/sort.js";
Expand All @@ -29,6 +31,9 @@ import {
VSD_ORDER_ASCENDING,
VSD_ORDER_DESCENDING,
VSD_FILTER_BY,
VSD_SORT_TOOLTIP,
VSD_FILTER_TOOLTIP,
VSD_RESET_BUTTON_ACTION,
} from "./generated/i18n/i18n-defaults.js";

// Template
Expand Down Expand Up @@ -340,6 +345,18 @@ class ViewSettingsDialog extends UI5Element {
return ViewSettingsDialog.i18nBundle.getText(VSD_SORT_BY);
}

get _sortButtonTooltip() {
return ViewSettingsDialog.i18nBundle.getText(VSD_SORT_TOOLTIP);
}

get _filterButtonTooltip() {
return ViewSettingsDialog.i18nBundle.getText(VSD_FILTER_TOOLTIP);
}

get _resetButtonAction() {
return ViewSettingsDialog.i18nBundle.getText(VSD_RESET_BUTTON_ACTION);
}

get _isPhone() {
return isPhone();
}
Expand Down Expand Up @@ -636,6 +653,7 @@ class ViewSettingsDialog extends UI5Element {
this._restoreSettings(this._initialSettings);
this._recentlyFocused = this._sortOrder!;
this._focusRecentlyUsedControl();
announce(this._resetButtonAction, InvisibleMessageMode.Polite);
}

/**
Expand Down
2 changes: 2 additions & 0 deletions packages/fiori/src/ViewSettingsDialogTemplate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,13 @@ function ViewSettingsDialogTemplateHeader(this: ViewSettingsDialog) {
selected={this.isModeSort}
icon={sortIcon}
data-mode="Sort"
tooltip={this._sortButtonTooltip}
/>
<SegmentedButtonItem
selected={this.isModeFilter}
icon={filterIcon}
data-mode="Filter"
tooltip={this._filterButtonTooltip}
/>
</SegmentedButton>
</div>
Expand Down
9 changes: 9 additions & 0 deletions packages/fiori/src/i18n/messagebundle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,15 @@ VSD_CANCEL_BUTTON=Cancel
#XFLD: View Settings Dialog Reset button text
VSD_RESET_BUTTON=Reset

#XMSG: View Settings Dialog Reset button invisible message text
VSD_RESET_BUTTON_ACTION=Reset has reverted all settings to initial state

#XTOL View Settings Dialog Sort button tooltop text
VSD_SORT_TOOLTIP=Sort

#XTOL View Settings Dialog Filter button tooltop text
VSD_FILTER_TOOLTIP=Filter

#XBLI: View Settings Dialog Sort Order group header text
VSD_SORT_ORDER=Sort Order

Expand Down

0 comments on commit 42b29f3

Please sign in to comment.