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

Add tooltipText param to TopNav and LeftNav #2242

Merged
merged 32 commits into from
Oct 25, 2021
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
2085f8d
Add tooltipText param to TopNav and LeftNav
rafalgamon Aug 31, 2021
7d7b884
Add tooltipText param to TopNav and LeftNav
rafalgamon Aug 31, 2021
fc55dab
Add tooltipText param to TopNav and LeftNav
rafalgamon Aug 31, 2021
bb7b32e
Merge branch 'master' into 2160-tooltiptext-for-navigation
ndricimrr Sep 1, 2021
73babc5
Add defaults.tooltipText param to TopNav and LeftNav
rafalgamon Sep 3, 2021
0b7b219
Merge branch 'master' into 2160-tooltiptext-for-navigation
ndricimrr Sep 6, 2021
7500837
Merge branch 'master' into 2160-tooltiptext-for-navigation
ndricimrr Sep 8, 2021
59441c7
2160 | Implemented changed in logic after Code Review
rafalgamon Sep 9, 2021
829977b
Merge branch 'master' into 2160-tooltiptext-for-navigation
ndricimrr Sep 13, 2021
9cfb610
Merge branch 'master' into 2160-tooltiptext-for-navigation
ndricimrr Sep 15, 2021
ae7f47d
Merge branch 'master' into 2160-tooltiptext-for-navigation
ndricimrr Sep 15, 2021
0d4741a
2160 | Move resolveTooltipText() to navigation-helpers.js
rafalgamon Sep 16, 2021
d5320c6
Update docs/navigation-parameters-reference.md
rafalgamon Sep 17, 2021
e8bcb97
Update docs/navigation-parameters-reference.md
rafalgamon Sep 17, 2021
3870b5c
Merge branch 'master' into 2160-tooltiptext-for-navigation
UlianaMunich Sep 22, 2021
bb9f887
Merge branch 'master' into 2160-tooltiptext-for-navigation
ndricimrr Sep 22, 2021
55cf104
2160 | Fixed tooltipText for <a> in TopNav section
rafalgamon Sep 23, 2021
cc3bc34
2160 | Fixed defaults.tooltipText in docu
rafalgamon Sep 24, 2021
606cae9
Update docs/navigation-parameters-reference.md
rafalgamon Sep 29, 2021
2fa9131
Merge branch 'master' into 2160-tooltiptext-for-navigation
ndricimrr Sep 29, 2021
d45d340
Merge branch 'master' into 2160-tooltiptext-for-navigation
JohannesDoberer Oct 11, 2021
e4c2006
2160 | Changed logic of tooltipText
rafalgamon Oct 12, 2021
f2d6150
Merge branch '2160-tooltiptext-for-navigation' of ssh://github.com/ra…
rafalgamon Oct 12, 2021
256ed6a
2160 | Fixed burgerTooltip
rafalgamon Oct 12, 2021
50d1e46
Merge branch 'master' into 2160-tooltiptext-for-navigation
JohannesDoberer Oct 14, 2021
91d06cf
Merge branch 'master' into 2160-tooltiptext-for-navigation
rafalgamon Oct 18, 2021
fbc9562
Merge branch 'master' into 2160-tooltiptext-for-navigation
hardl Oct 19, 2021
eb954a9
2160 | Changed tooltipText docu
rafalgamon Oct 19, 2021
cb024d6
Merge branch '2160-tooltiptext-for-navigation' of ssh://github.com/ra…
rafalgamon Oct 19, 2021
74621fc
Merge branch 'master' into 2160-tooltiptext-for-navigation
hardl Oct 21, 2021
a44f545
Merge branch 'master' into 2160-tooltiptext-for-navigation
JohannesDoberer Oct 22, 2021
7ccef82
Merge branch 'master' into 2160-tooltiptext-for-navigation
JohannesDoberer Oct 22, 2021
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
47 changes: 39 additions & 8 deletions core/src/navigation/LeftNav.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,14 @@
<div class="lui-nav-title">
<ul class="fd-nested-list">
<li class="fd-nested-list__item">
<a class="fd-nested-list__link" title="{$getTranslation(navHeader.label)}">
<a
class="fd-nested-list__link"
title="{
(navHeader.tooltipText && navHeader.tooltipText.length) ?
$getTranslation(navHeader.tooltipText) :
(navHeader.tooltipText && navHeader.tooltipText === false) ? '' : $getTranslation(navHeader.label)
}"
>
{#if navHeader.icon} {#if isOpenUIiconName(navHeader.icon)}
<i
class="lui-header-icon fd-nested-list__icon sap-icon sap-icon--{navHeader.icon}"
Expand Down Expand Up @@ -56,7 +63,11 @@
<li class="fd-nested-list__item">
<a
href="{getRouteLink(node)}"
title="{$getTranslation(node.label)}"
title="{
(node.tooltipText && node.tooltipText.length) ?
$getTranslation(node.tooltipText) :
(node.tooltipText === false) ? '' : $getTranslation(node.label)
ndricimrr marked this conversation as resolved.
Show resolved Hide resolved
}"
class="fd-nested-list__link {node === selectedNode ? 'is-selected' : ''}"
on:click|preventDefault="{() => handleClick(node)}"
data-testid="{getTestId(node)}"
Expand Down Expand Up @@ -98,7 +109,11 @@
<div class="fd-nested-list__content has-child">
<a
href="javascript:void(null)"
title="{$getTranslation(key)}"
title="{
(nodes.tooltipText && nodes.tooltipText.length) ?
$getTranslation(nodes.tooltipText) :
(nodes.tooltipText && nodes.tooltipText === false) ? '' : $getTranslation(key)
}"
class="fd-nested-list__link {isExpanded(nodes, expandedCategories) ? 'is-expanded' : ''}"
tabindex="-1"
id="collapsible_listnode_{index}"
Expand Down Expand Up @@ -150,7 +165,11 @@
class="fd-nested-list__link {node === selectedNode ? 'is-selected' : ''}"
on:click|preventDefault="{() => handleClick(node)}"
data-testid="{getTestId(node)}"
title="{$getTranslation(node.label)}"
title="{
(node.tooltipText && node.tooltipText.length) ?
$getTranslation(node.tooltipText) :
(node.tooltipText === false) ? '' : $getTranslation(node.label)
}"
>
<span class="fd-nested-list__title">{$getTranslation(node.label)}</span>
{#if node.externalLink && node.externalLink.url}
Expand Down Expand Up @@ -179,7 +198,11 @@
class="fd-nested-list__link {node === selectedNode ? 'is-selected' : ''}"
on:click|preventDefault="{() => handleClick(node)}"
data-testid="{getTestId(node)}"
title="{$getTranslation(node.label)}"
title="{
(node.tooltipText && node.tooltipText.length) ?
$getTranslation(node.tooltipText) :
(node.tooltipText === false) ? '' : $getTranslation(node.label)
}"
>
<span class="fd-nested-list__title"
>{$getTranslation(node.label)}</span
Expand All @@ -201,7 +224,11 @@
<!-- Category nodes -->
<li
class="fd-nested-list__group-header lui-category"
title="{$getTranslation(key)}"
title="{
(nodes.tooltipText && nodes.tooltipText.length) ?
$getTranslation(nodes.tooltipText) :
(nodes.tooltipText === false) ? '' : $getTranslation(key)
}"
data-testid="{getTestIdForCat(nodes.metaInfo, key)}"
id="category_list_level1_{index}"
>
Expand All @@ -223,7 +250,11 @@
{#each nodes as node} {#if !node.hideFromNav} {#if node.label}
<li
class="fd-nested-list__item"
title="{$getTranslation(node.label)}"
title="{
(node.tooltipText && node.tooltipText.length) ?
$getTranslation(node.tooltipText) :
(node.tooltipText === false) ? '' : $getTranslation(node.label)
}"
aria-labelledby="category_list_level1_{index}"
>
<a
Expand Down Expand Up @@ -267,7 +298,7 @@
class="lui-side-nav__footer--icon {isSemiCollapsed ? 'sap-icon--open-command-field' : 'sap-icon--close-command-field'}"
on:click="{() => semiCollapsibleButtonClicked(this)}"
data-testid="semiCollapsibleButton"
title="{burgerTooltip}"
title="burgerTooltip"
Copy link
Contributor

Choose a reason for hiding this comment

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

i assume removing the curly braces here was not intended, please revert

></i>
{/if}
</span>
Expand Down
18 changes: 15 additions & 3 deletions core/src/navigation/TopNav.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,11 @@
<div class="fd-popover fd-popover--right">
<div class="fd-popover__control" on:click|stopPropagation="{() => {}}">
<button
title="{getNodeLabel(node)}"
title="{
(node.tooltipText && node.tooltipText.length) ?
node.tooltipText :
(node.tooltipText === false) ? '' : getNodeLabel(node)
}"
class="fd-shellbar__button fd-button {node === selectedNode ? 'is-selected' : ''}"
aria-controls="dropDownPopover-{i}"
aria-expanded="{dropDownStates[`dropDownPopover-${i}`] || false}"
Expand Down Expand Up @@ -88,7 +92,11 @@
</a>
{:else}
<button
title="{getNodeLabel(node)}"
title="{
(node.tooltipText && node.tooltipText.length) ?
node.tooltipText :
(node.tooltipText === false) ? '' : getNodeLabel(node)
}"
class="fd-shellbar__button fd-button {node === selectedNode ? 'is-selected' : ''}"
aria-expanded="false"
aria-haspopup="true"
Expand Down Expand Up @@ -191,7 +199,11 @@
<li class="fd-menu__item">
<a
href="{getRouteLink(node)}"
title="{getNodeLabel(node)}"
title="{
(node.tooltipText && node.tooltipText.length) ?
node.tooltipText :
(node.tooltipText === false) ? '' : getNodeLabel(node)
}"
class="fd-menu__link"
on:click|preventDefault="{() => openMobileTopNavDropDown(node)}"
data-e2e="mobile-topnav-dropdown-category"
Expand Down
11 changes: 10 additions & 1 deletion docs/navigation-parameters-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,22 @@ The navigation parameters allow you to configure **global** navigation settings

### nodeChangeHook
- **type**: function
- **description**: allows you to invoke and execute a specific function on the global level when a request to navigate to the node occurs. The function receives two node objects as input parameters: the previous node and current node, as described in the configuration.
- **description**: allows you to invoke and execute a specific function on the global level when a request to navigate to the node occurs. The function receives two node objects as input parameters: the previous node and current node, as described in the configuration.

### defaults.isolateView
- **type**: boolean
- **description**: renders all views in new frames. This setting overrides the same-domain frame reuse.
- **default**: the parameter **defaults.isolateView** is `false` by default, and you can overwrite it using the **isolateView** value on a single node level.
rafalgamon marked this conversation as resolved.
Show resolved Hide resolved

### tooltipText
Copy link
Contributor

Choose a reason for hiding this comment

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

"tooltipText" docu should be under "Node Parameters", defaults.tooltipText can stay here

- **type**: string
- **description**: allows you to add a tooltip to any of the links and buttons of the left side navigation and top navigation. You can set the parameter with the text that will appear on the tooltip.
- **default**: it is `null` by default, and you can overwrite it using the **tooltipText** value on a single node level.
- **example**:
```javascript
tooltipText: 'Useful links'
```

### defaults.pageErrorHandler
<!-- add-attribute:class:warning -->
> **NOTE**: The **pageErrorHandler** only works if the [loading indicator](#loadingindicatorenabled) is not disabled.
Expand Down
Loading