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): provide additional filters count description #11042

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
5 changes: 5 additions & 0 deletions packages/fiori/src/ViewSettingsDialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import {
VSD_SORT_TOOLTIP,
VSD_FILTER_TOOLTIP,
VSD_RESET_BUTTON_ACTION,
VSD_SELECTED_FILTER_COUNT,
} from "./generated/i18n/i18n-defaults.js";

// Template
Expand Down Expand Up @@ -292,6 +293,10 @@ class ViewSettingsDialog extends UI5Element {
}
}

get _selectedFiltersLabel() {
return ` ${ViewSettingsDialog.i18nBundle.getText(VSD_SELECTED_FILTER_COUNT)}`;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to add it into template literal.

Now, when the item is accessed the screen reader is reading out selected filter criteria instead of item text + counter information.

In OpenUi5 the current when the filter item has selected items inside it it is reading the item's text, counter {number}.

I would suggest you to change this method to function instead of getter that accepts FilterItem and to extract the needed information as follows:

	_selectedFiltersLabel(item: FilterItem) {
		if (item.additionalText) {
			return ViewSettingsDialog.i18nBundle.getText(VSD_SELECTED_FILTER_COUNT, item.text || "", item.additionalText || "");
		}

		return item.text;
	}

}

get shouldBuildSort() {
return !!this.sortItems.length;
}
Expand Down
1 change: 1 addition & 0 deletions packages/fiori/src/ViewSettingsDialogTemplate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ function ViewSettingsDialogTemplateContent(this: ViewSettingsDialog) {
class="ui5-vsd-filterItemList"
// selected={item.selected} TODO
additionalText={item.additionalText}
accessibleName={this._selectedFiltersLabel}
>{item.text}</ListItemStandard>
))}
</ListItemGroup>
Expand Down
3 changes: 3 additions & 0 deletions packages/fiori/src/i18n/messagebundle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,9 @@ VSD_ORDER_ASCENDING=Ascending
#XBLI: View Settings Dialog sort order list Descending text
VSD_ORDER_DESCENDING=Descending

#XBLI: View Settings Dialog sort order list Descending text
VSD_SELECTED_FILTER_COUNT=selected filter criteria

#XTIT: IllustratedMessage's title for the BeforeSearch illustration
IM_TITLE_BEFORESEARCH=Let''s get some results

Expand Down