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.5k stars 258 forks source link

ViewSettingsDialog event detail outcome #6910

Open FRicardi opened 1 year ago

FRicardi commented 1 year ago

Discussed in https://github.com/SAP/ui5-webcomponents/discussions/6907

Originally posted by **FRicardi** April 11, 2023 When I was studying about ViewSettingsDialog, I was wondering how to deal with the event details object. I see that it uses the `text` property to populate the object's keys, which can be troublesome on cases that uses i18n to display the texts. I believe that there's a workaround that involves using the translations as key maps, but I wonder if there's an easier way to manipulate filter and sort keys to avoid these kinds of workarounds. Have someone stumbled upon this problem as well? What are the possible solutions? https://codesandbox.io/s/table-filter-sort-and-grouping-7w389k?file=/src/App.js

On the ViewSettingsDialog component, text of the filter items is used as a key on the event.details.filters object, same with sort and sortOrder. On the sort object, we have a sortItem which allows usage of HTML id keys to sort.

In terms of maintainability of the codebase, it would be really helpful to have the option to use a proper key on the objects.

UI5-webcomponents codesandbox kindly created by @Lukas742 : https://codesandbox.io/s/ui5-webcomponents-forked-bg03lg?file=/index.html

ivoplashkov commented 1 year ago

Hello colleagues,

I couldn't find any documentation that can help me consult the reporter, therefore I am forwarding this to the responsible team. Could you please assist?

Thank you in advance! Best regards, Ivaylo

FRicardi commented 1 year ago

Hello @ivoplashkov (tagging you because you had the last update), do we have any updates on the roadmap for this component?

tsanislavgatev commented 1 year ago

Hello @FRicardi,

This is an events output with language bulgarian: { "sortOrder": "Възходящ", "sortDescending": false, "sortBy": "Name", "sortByItem": { "_changedState": [], "_suppressInvalidation": false, "_inDOM": true, "_fullyConnected": true, "_childChangeListeners": {}, "_slotChangeListeners": {}, "_eventProvider": { "_eventRegistry": {} }, "_domRefReadyPromise": {}, "_doNotSyncAttributes": {}, "_state": { "text": "Name", "selected": true } }, "filters": [{ "Position": ["VP"] }] }

If I understand you correctly, the case you are describing is when you translate the filter items and filter item options you will receive the translated text and not the original one? If that is the case, we currently have no API that provides such information, as the items themselves does not accept a key attribute. If something like this is needed, please submit a developmen request for that. Implementing it might not be a part of the event, but an additional API, as changing the information structure of the event will be an incompatible change to other developers using the control.

Please check if this is the case you are explaining and if so, please follow the suggested path.

FRicardi commented 1 year ago

Hello @tsanislavgatev That is indeed my case. How can I submit a development request for this issue? Can you help me with that?

tsanislavgatev commented 1 year ago

Hello @FRicardi,

I will move it to the feature request section so the team can look trough the case and propose a solution(feature).

@SAP/ui5-webcomponents-topic-b Hello team, this is a feature request regarding the ViewSettingsDialog component. More information about what the request is can be found in the communication above.

Best Regards, Tsanislav

FRicardi commented 1 year ago

Thanks for your support, @tsanislavgatev .

Let me know if further information here is needed.