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

feat(ui5-product-switch): initial implementation #971

Merged
merged 39 commits into from
Nov 25, 2019
Merged

feat(ui5-product-switch): initial implementation #971

merged 39 commits into from
Nov 25, 2019

Conversation

nnaydenow
Copy link
Contributor

FIXES: #857

nnaydenow and others added 30 commits November 5, 2019 21:12
BREAKING CHANGE:
@ui5/webcomponents/dist/Icon.js
The src property was renamed to name and accepts icon name (such as "add") instead of icon src (such as "sap-icon://add").
Note: the src property will continue to work until the next release due to the impact of the change, but will produce a warning in the console.

@ui5/webcomponents/dist/Card.js
The avatar property was removed.
Use the avatar slot instead - pass an icon(<ui5-icon) or an image(<img).
Before:
<ui5-card avatar="sap-icon://add"></ui5-card>
After:
<ui5-card><ui5-icon name="add" slot="avatar"></ui5-icon></ui5-card>
and respectively:
<ui5-card avatar="http://url/to/my/image"></ui5-card>
becomes:
<ui5-card><img src="http://url/to/my/image" slot="avatar"/></ui5-card>

@ui5/webcomponents-fiori/dist/ShellBarItem.js
The src property was renamed to icon and accepts icon name (such as "add") instead of icon src (such as "sap-icon://add")
It turns out that in IE, the SVG is always getting focused upon TAB. By setting focusable="false", the SVG is no longer focusable.
- compress the size of animated coPilot SVG from more than 18k to 8.1k
- unused CSS class `svg-box-content` removed
- correctly fallback to non-animated SVG if the feature is not imported (there use to be a bug - throws JS error)
* @class
* <h3 class="comment-api-title">Overview</h3>
*
* The <code>ui5-product-switch</code> is a Fiori specific control that is used in <code>ui5-shellbar</code>
Copy link
Contributor

Choose a reason for hiding this comment

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

wrong word here

* The <code>ui5-product-switch</code> is a Fiori specific control that is used in <code>ui5-shellbar</code>
* <br><br>
* <h3>ES6 Module Import</h3>
* <code>import "@ui5/webcomponents-fiori/dist/ProductSwitch";</code>
Copy link
Contributor

Choose a reason for hiding this comment

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

better end the import with .js

*
* @constructor
* @author SAP SE
* @alias sap.ui.webcomponents.main.ProductSwitch
Copy link
Contributor

Choose a reason for hiding this comment

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

fiori, not main

onEnterDOM() {
this._handleResizeBound = this._handleResize.bind(this);

ResizeHandler.register(document.body, this._handleResizeBound);
Copy link
Contributor

Choose a reason for hiding this comment

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

why on the body?

constructor() {
super();

this.ROW_MIN_WIDTH = {
Copy link
Contributor

Choose a reason for hiding this comment

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

This isn't per component, should be on the constructor function

* <br><br>
* Example:
* <br>
* <pre>ui5-product-switch-item icon="sap-icon://palette"</pre>
Copy link
Contributor

Choose a reason for hiding this comment

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

sap-icon:// should not be written by users any more, we deprecated it

*
* @constructor
* @author SAP SE
* @alias sap.ui.webcomponents.main.ProductSwitchItem
Copy link
Contributor

Choose a reason for hiding this comment

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

fiori, not main.

Overall: please scan all the files for the word "main" to make sure there aren't any other leftovers

@@ -0,0 +1,30 @@
:host {
font-family: var(--sapUiFontFamily);
Copy link
Member

Choose a reason for hiding this comment

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

Usually, we write css regarding the html native 'hidden' attribute, so the user can hide our components, using it.

!-- from Button.css --!
:host(:not([hidden])) {
	display: inline-block;
}

@vladitasev vladitasev merged commit 70d44b1 into SAP:master Nov 25, 2019
/**
* @class
* <h3 class="comment-api-title">Overview</h3>
* The <code>ui5-product-switch-item</code> represents the items displayed in the <code>ui5-product-switch</code> web component
Copy link
Contributor

Choose a reason for hiding this comment

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

missing a full stop at the end

* @class
* <h3 class="comment-api-title">Overview</h3>
*
* The <code>ui5-product-switch</code> is a Fiori specific web component that is used in <code>ui5-shellbar</code> and allows the user easy switching between products.
Copy link
Contributor

Choose a reason for hiding this comment

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

The ui5-product-switch is an SAP Fiori specific web component that is used in ui5-shellbar and allows the user to easily switch between products.

plamenivanov91 pushed a commit to plamenivanov91/ui5-webcomponents that referenced this pull request Nov 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Product Switch component
8 participants