SAP / ui5-webcomponents

UI5 Web Components - the enterprise-flavored sugar on top of native APIs! Build SAP Fiori user interfaces with the technology of your choice.
https://sap.github.io/ui5-webcomponents/
Apache License 2.0
1.47k stars 254 forks source link

[ViewSettingsDialog | ui5-webcomponents] onConfirmEvent uses filter item text as key: #7579

Open 22shubham22 opened 9 months ago

22shubham22 commented 9 months ago

Bug Description

Whenever filter items are selected inside ViewSettingsDialog and OK button is pressed an event is fired in which we see that there is key object pair ,

where key is -> text provided for filter item object is -> an array of all the filter item options selected

We have give text as "Position" to the filter item ->

MicrosoftTeams-image (16)

and as you can see it appears in the view settings dialog

MicrosoftTeams-image (15)

Now when we select, any of the filter item options :

MicrosoftTeams-image (17)

and console log the event details :

MicrosoftTeams-image (19) MicrosoftTeams-image (18)

So basically in our code if we want to pickup the filters we do it by :

event.detail.filters[0]["Position"] , which seems fine if we just work with english , but in our project we support multiple languages, so when we change the language from english to french , then position gets translated to something else and then when pressed OK the event fired contain that translated text as key.

So, event.detail.filters[0]["Position"] this would not work anymore if we try to pick filters from the event, because now the text is translated .

Code Sandbox Link : https://codesandbox.io/s/ui5-webcomponents-forked-jxn5xt?file=/src/index.js

Affected Component

No response

Expected Behaviour

it'd be btter if the even generated would look for 'id' or 'key' as a first option rather than 'text'.

Isolated Example

No response

Steps to Reproduce

1. 2. 3. ...

Log Output, Stack Trace or Screenshots

No response

Priority

Medium

UI5 Web Components Version

1.15.1

Browser

Chrome

Operating System

No response

Additional Context

"@ui5/webcomponents": "1.15.1", "@ui5/webcomponents-base": "1.15.1", "@ui5/webcomponents-fiori": "1.15.1", "@ui5/webcomponents-icons": "1.15.1", "@ui5/webcomponents-icons-business-suite": "1.15.1", "@ui5/webcomponents-localization": "1.15.1", "@ui5/webcomponents-react": "1.17.3", "@ui5/webcomponents-theming": "1.15.1",

Organization

No response

Declaration

NHristov-sap commented 9 months ago

Hello @SAP/ui5-webcomponents-topic-b,

Please take a look of this feature request.

Best Regards, Mikolay Hristov

22shubham22 commented 9 months ago

Hi @hinzzx , By when can we expect this to be done ?

DMihaylova commented 9 months ago

Hello, @22shubham22,

Thank you for the feedback!

We'll need to firstly discus it on our team refinement meeting and then prioritise it among the rest of the requests we have. We'll update you here once those aspects get clear. Have in mind that we're currently overloaded and there may be delay.

Thanks & Regards, Diana