ui5-webcomponents icon indicating copy to clipboard operation
ui5-webcomponents copied to clipboard

refactor(ui5-shellbar): introducing assistant slot

Open plamenivanov91 opened this issue 1 year ago • 2 comments

Тhe showCoPilot property and the co-pilot-click event of the ui5-shellbar have been removed. In their place we now have a public slot called assistant. We recommend using ui5-toggle-button with sap-icon://da and sap-icon://da-2 icons (see the examples below).

BREAKING CHANGE:

  1. The showCoPilot property of the ui5-shellbar is removed.

If you have previously used the showCoPilot property:

<ui5-shellbar show-co-pilot></ui5-shellbar>

it will no longer work for the component.

  1. The CoPilotAnimation feature of the ui5-shellbar is removed.

If you have previously used the CoPilotAnimation feature:

import CoPilotAnimation from "@ui5/webcomponents-fiori/dist/features/CoPilotAnimation.js"

it will no longer work for the component.

  1. The copilotDomRef getter of the ui5-shellbar is removed.

If you have previously used the copilotDomRef public getter:

shellbar.copilotDomRef

it will no longer work for the component.

  1. The co-pilot-click event of the ui5-shellbar is removed. If you have previously used the co-pilot-click public event:
shellbar.addEventListener("ui5-co-pilot-click", function(event) {
	...
});

it will no longer work for the component.

You can achieve similar functionality with the new slot:

HTML:

<ui5-shellbar>
  <ui5-toggle-button id="assistant" icon="sap-icon://da" slot="assistant"></ui5-toggle-button>
</ui5-shellbar>

JavaScript:

assistant.addEventListener("click", function (event) {
	const toggleButton = event.target;
	toggleButton.icon = toggleButton.pressed ? "sap-icon://da-2" : "sap-icon://da";
});

Related to #8461, #7887

plamenivanov91 avatar Apr 08 '24 19:04 plamenivanov91

Please add instructions in the BREAKING CHANGES section how users can achieve the old behavior or similar.

vladitasev avatar Apr 10 '24 06:04 vladitasev

@IlianaB When I reviewed this change I noticed a test not failing although the used selector for the new test does not match anything on the page. Then I discovered these setTimeout and that tests may fail within them without causing an error because somehow the setTimeout interferes with the lifecycle of the test (probably is not awaited for).

vladitasev avatar Apr 16 '24 06:04 vladitasev

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
2 out of 3 committers have signed the CLA.

:white_check_mark: plamenivanov91
:white_check_mark: PetyaMarkovaBogdanova
:x: Nayden Naydenov


Nayden Naydenov seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

cla-assistant[bot] avatar May 13 '24 16:05 cla-assistant[bot]

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

:white_check_mark: plamenivanov91
:x: PetyaMarkovaBogdanova
You have signed the CLA already but the status is still pending? Let us recheck it.

cla-assistant[bot] avatar May 13 '24 16:05 cla-assistant[bot]

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
2 out of 3 committers have signed the CLA.

:white_check_mark: plamenivanov91
:white_check_mark: PetyaMarkovaBogdanova
:x: Nayden Naydenov


Nayden Naydenov seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

cla-assistant[bot] avatar May 14 '24 09:05 cla-assistant[bot]

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
2 out of 3 committers have signed the CLA.

:white_check_mark: PetyaMarkovaBogdanova
:white_check_mark: plamenivanov91
:x: Nayden Naydenov


Nayden Naydenov seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

cla-assistant[bot] avatar May 14 '24 09:05 cla-assistant[bot]

Superseded by https://github.com/SAP/ui5-webcomponents/pull/8963

plamenivanov91 avatar May 14 '24 14:05 plamenivanov91