-
Notifications
You must be signed in to change notification settings - Fork 272
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
feat(ui5-side-navigation): add actions and unselectable items #10482
base: main
Are you sure you want to change the base?
Conversation
…igation_actions_leaves
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As tentative suggestion please consider changing summary sentence "feat(ui5-side-navigation): add actions and unselectable items #10482" to "feat(ui5-side-navigation): adds actions and unselectable items #10482".
Reason for suggestion proposal is: https://github.com/SAP/openui5/blob/master/docs/guidelines/jsdoc.md - JSDoc Guidelines: "For actions, start directly with an appropriate verb in the third person: Adds, allocates, constructs, converts, deallocates, destroys, gets, provides, reads, removes, represents, returns, sets, saves, and so on".
Default = "Default", | ||
|
||
/** | ||
* Design for items that perform an action, such as opening a dialog. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please consider as alternative:
Design for items that trigger an action,
Just a thought: would it be helpful to state that these items should not contain child items?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, sounds better. Please check again
This is the guideline that applies here https://sap.github.io/ui5-webcomponents/docs/contributing/conventions-and-guidelines/#commit-description. It should be in imperative present tense. |
<%COMPONENT_METADATA%> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update the existing sample to include the following:
- all external links must be "unselectable". Also please check the "NavigationLayout" sample and do the same
- better to put the external links in the fixed items area, as those are the guidelines
- add several parent elements which are not selectable. Or even better, make a new sample where all parents are unselecatable - as the guideline is to use only selectable or only unselectable parent items in the same side nav
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- done
- done
- TODO - add new sample
packages/website/docs/_samples/fiori/SideNavigation/QuickAction/main.js
Outdated
Show resolved
Hide resolved
if (this.unselectable) { | ||
this._toggle(); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quick action can not be triggered by pressing "Enter". It is only triggered by click or pressing "Space"
On other hand if you put "unselectable" on an external link it is triggered by "Enter" but not by "Space"
Also add a test for this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unselectable
items are now also activated by Enter
.
Please open separate issue that external links are not opened with Space
. It is working like that on the master branch too.
* | ||
* | ||
* **Guidelines**: | ||
* - External links should not be unselectable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove "not". Text should say "External links should be unselectable"
@property() | ||
design: `${SideNavigationItemDesign}` = "Default"; | ||
|
||
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Stoev please re-check this part of the documentation as it was significantly changed.
@@ -201,6 +225,12 @@ class SideNavigationItem extends SideNavigationSelectableItemBase { | |||
get isSideNavigationItem() { | |||
return true; | |||
} | |||
|
|||
_toggle() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In ui5-side-navigation, in collapsed mode - go to a single click area parent, open the menu with children - press enter or space on the first item (this would be the parent itself) - menu closes. Next time when you open the menu - the child items are gone
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please consider some suggestions.
* | ||
* **Guidelines**: | ||
* - External links should not be unselectable | ||
* - Items that trigger actions (with design "Action") should be unselectable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please place a full stop:
unselectable.
* Indicates whether the navigation item is selectable. By default all items are selectable unless specifically marked as unselectable. | ||
* | ||
* When a parent item is marked as unselectable, clicking it will only expand or collapse its sub-items. | ||
* To achieve better user experience you should not mix unselectable parent items and selectable parent items in the same side navigation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please consider simplifying, for example:
To improve user experience do not mix unselectable parent items with selectable parent items in a single side navigation.
design: `${SideNavigationItemDesign}` = "Default"; | ||
|
||
/** | ||
* Indicates whether the navigation item is selectable. By default all items are selectable unless specifically marked as unselectable. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it add value for the reader if the term here is more accurate: instead of 'navigation item' we use 'ui5-side-navigation-item'?
/** | ||
* Indicates whether the navigation item is selectable. By default all items are selectable unless specifically marked as unselectable. | ||
* | ||
* When a parent item is marked as unselectable, clicking it will only expand or collapse its sub-items. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please consider avoiding the verb "click" whenever possible: (https://help.sap.com/docs/SNG_FOR_UA/e33c591ae4494a659a3f5f983c9d1161/80cf1399d10b47b482e833b6dbe9211c.html?state=DRAFT&q=accessability):
When a parent item is marked as unselectable, selecting it will only expand or collapse its sub-items.
import type SideNavigationItemDesign from "./types/SideNavigationItemDesign.js"; | ||
import type { AccessibilityAttributes } from "@ui5/webcomponents-base/dist/types.js"; | ||
|
||
type SideNavigationItemAccessibilityAttributes = Pick<AccessibilityAttributes, "hasPopup">; | ||
|
||
/** | ||
* Fired when the component is activated either with a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this sentence incomplete?
BGSOFUIRODOPI-3344