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

ui5-shellbar profile button title override #4009

Closed
1 of 4 tasks
JarrettChan opened this issue Sep 27, 2021 · 4 comments · Fixed by #4342 or #4377
Closed
1 of 4 tasks

ui5-shellbar profile button title override #4009

JarrettChan opened this issue Sep 27, 2021 · 4 comments · Fixed by #4342 or #4377

Comments

@JarrettChan
Copy link

JarrettChan commented Sep 27, 2021

Feature Request Description

We currently can not provide the profile button with our title.
https://github.com/SAP/ui5-webcomponents/blob/master/packages/fiori/src/ShellBar.hbs#L163
SuccessFactors header has been providing a title for the profile button such as Account Navigation for Alan Chin ‎(achin)‎ by passing along a parameter for the user, so we can't just replace it in the messagebundle.

The other button titles are either new or not significantly different from the SF ones.

Please provide a hook on the ui5-shellbar for this.

Priority

  • Low
  • Medium
  • High
  • Very High

Stakeholder Info (if applicable)

  • Organization: SuccessFactors
@Todor-ads Todor-ads self-assigned this Sep 28, 2021
@Todor-ads Todor-ads removed their assignment Oct 4, 2021
@ilhan007
Copy link
Member

ilhan007 commented Oct 26, 2021

Hello @JarrettChan

would providing a template hook be sufficient - we can extract the profile button in a Handlebars partial, that can be overwritten?

This means you have to extend the ShellBar web component (ShellBarSF.js) and provide a template (ShellBarSF.hbs) and the only thing in the template would be the overwritten Handlebars partial, the rest will come from the base ShellBar.hbs.
And you can make use of the partial to change the profile button, in your case to provide different title.

Let's say this is the ShellBarSF.hbs and the partial is called "profileBtn":

{{>include "../ShelllBar.hbs"}}

{{#*inline "profileBtn"}}
    <ui5-button title="Account Navigation for Alan Chin"></ui5-button>
{{/inline}}

Some of your colleagues already used this approach, we did the same for the FlexibleColumnLayout arrows #2242 by SF request in the past.

What do you think?

@JarrettChan
Copy link
Author

JarrettChan commented Nov 1, 2021

Hi @ilhan007

That would work. Can you provide an estimate of when this could be completed?

@codefactor
Copy link
Contributor

codefactor commented Nov 16, 2021

This can work for the short term, but wouldn't all users of Shellbar WC need to customize the tooltip for the Profile button?

It would seem the tooltip should always have at least the name of the user there as part of accessibility, just having the word "Profile" seems unusual to me, and unintuitive for a blind person.

Is there any problem accepting the tooltip as an optional attribute on the shellbar?

@codefactor
Copy link
Contributor

On second thought, being able to override the button entirely might be beneficial if we ever needed to customize the button for other reasons. In know our customers have been complaining a lot about not showing any visual indicator when they are a proxy. I suspect we might want to add something to the button to show that.

So maybe we could use the online thing in the future for other reasons but for now we only need to customize the title. But I feel this would be something lots of users might benefit from being able to do that without extending the shellbar.

We have no problem from our end, though, to extend the shellbar, if that's what we need to do.

ilhan007 added a commit that referenced this issue Nov 18, 2021
The stakeholders can't provide own 'title' for the ShellBar's profile button. We show "profile", which is not what the stakeholders need. As currently, it's not possible to replace a specific text in the i18n bundle, we would need to provide either a HBS template hook, or an API to allow developers set their own text. The template hook is the simplest solution without any change in the APIs.
Extract the profile button mark up as Handlebars partial to allow custom component developers to overwrite the Handlebars partial and change the profile button "title" to the desired one.

Fixes: #4009
@ilhan007 ilhan007 reopened this Nov 18, 2021
@ilhan007 ilhan007 self-assigned this Nov 18, 2021
@ilhan007 ilhan007 added this to the 1.1.0 milestone Nov 18, 2021
ilhan007 added a commit that referenced this issue Nov 23, 2021
New property from type Object, called accessibilityTexts is introduced to allow customization of some internal parts of the ShellBar web component via stable API. Currently the only thing available on the object is the profileButtonTitle to define the profile button tooltip, showing up on hover.

Fixes: #4009
ilhan007 added a commit that referenced this issue Nov 23, 2021
New property from type Object, called accessibilityTexts is introduced to allow customization of some internal parts of the ShellBar web component via stable API. Currently the only thing available on the object is the profileButtonTitle to define the profile button tooltip, showing up on hover.

Fixes: #4009
ndeshev pushed a commit to ndeshev/ui5-webcomponents that referenced this issue Dec 13, 2021
The stakeholders can't provide own 'title' for the ShellBar's profile button. We show "profile", which is not what the stakeholders need. As currently, it's not possible to replace a specific text in the i18n bundle, we would need to provide either a HBS template hook, or an API to allow developers set their own text. The template hook is the simplest solution without any change in the APIs.
Extract the profile button mark up as Handlebars partial to allow custom component developers to overwrite the Handlebars partial and change the profile button "title" to the desired one.

Fixes: SAP#4009
ndeshev pushed a commit to ndeshev/ui5-webcomponents that referenced this issue Dec 13, 2021
New property from type Object, called accessibilityTexts is introduced to allow customization of some internal parts of the ShellBar web component via stable API. Currently the only thing available on the object is the profileButtonTitle to define the profile button tooltip, showing up on hover.

Fixes: SAP#4009
dobrinyonkov added a commit to dobrinyonkov/ui5-webcomponents that referenced this issue Jun 28, 2022
dobrinyonkov added a commit to dobrinyonkov/ui5-webcomponents that referenced this issue Jun 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment