Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ui5-view-settings-dialog): adjust reset button announcement #10320

Merged
merged 9 commits into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from 7 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
19 changes: 18 additions & 1 deletion packages/fiori/src/ViewSettingsDialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ import ListItemStandard from "@ui5/webcomponents/dist/ListItemStandard.js";
import Title from "@ui5/webcomponents/dist/Title.js";
import SegmentedButton from "@ui5/webcomponents/dist/SegmentedButton.js";
import SegmentedButtonItem from "@ui5/webcomponents/dist/SegmentedButtonItem.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";
import "@ui5/webcomponents-icons/dist/filter.js";
Expand All @@ -36,6 +37,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 @@ -358,6 +362,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 @@ -654,6 +670,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=All settings were reset
unazko marked this conversation as resolved.
Show resolved Hide resolved

#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
Loading