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

[FEATURE] sap.m.MessageToast: add controls as toast content #1363

Closed
wants to merge 1 commit into from

Conversation

stu0292
Copy link

@stu0292 stu0292 commented Mar 4, 2017

  • Many front end design frameworks provide MessageToast-like popups with which the user can interact.
    Most common example along the lines of a message "something just happened" with a button to undo the 'something'

  • sap.m.MessageToast could previously not do this

  • This feature enables the developer to display in a MessageToast one or more of sap.ui.core.Control to provide this functionality.

@CLAassistant
Copy link

CLAassistant commented Mar 4, 2017

CLA assistant check
All committers have signed the CLA.

@stu0292
Copy link
Author

stu0292 commented Mar 5, 2017

Having trouble signing the CLA. I've selected the sign button multiple times and the recheck button but the status doesn't seem to update. Any ideas?

image

@akudev
Copy link
Contributor

akudev commented Mar 5, 2017

Hm, strange... but from a legal perspective it's ok to just write here that you agree to the contributor license agreement. A bit old-fashioned, I know, but that's what we did initially. :-)

@stu0292
Copy link
Author

stu0292 commented Mar 5, 2017

Thanks Andreas. In that case, I hereby declare my agreement with the contributor license agreement (copied below)

SAP Individual Contributor License Agreement
Thank you for your interest in contributing to open source software projects (“Projects”) made available by SAP SE or its affiliates (“SAP”). This Individual Contributor License Agreement (“Agreement”) sets out the terms governing any source code, object code, bug fixes, configuration changes, tools, specifications, documentation, data, materials, feedback, information or other works of authorship that you submit or have submitted, in any form and in any manner, to SAP in respect of any of the Projects (collectively “Contributions”). If you have any questions respecting this Agreement, please contact opensource@sap.com.

You agree that the following terms apply to all of your past, present and future Contributions. Except for the licenses granted in this Agreement, you retain all of your right, title and interest in and to your Contributions.

Copyright License. You hereby grant, and agree to grant, to SAP a non-exclusive, perpetual, irrevocable, worldwide, fully-paid, royalty-free, transferable copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, and distribute your Contributions and such derivative works, with the right to sublicense the foregoing rights through multiple tiers of sublicensees.

Patent License. You hereby grant, and agree to grant, to SAP a non-exclusive, perpetual, irrevocable, worldwide, fully-paid, royalty-free, transferable patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer your Contributions, where such license applies only to those patent claims licensable by you that are necessarily infringed by your Contributions alone or by combination of your Contributions with the Project to which such Contributions were submitted, with the right to sublicense the foregoing rights through multiple tiers of sublicensees.

Moral Rights. To the fullest extent permitted under applicable law, you hereby waive, and agree not to assert, all of your “moral rights” in or relating to your Contributions for the benefit of SAP, its assigns, and their respective direct and indirect sublicensees.

Third Party Content/Rights. If your Contribution includes or is based on any source code, object code, bug fixes, configuration changes, tools, specifications, documentation, data, materials, feedback, information or other works of authorship that were not authored by you (“Third Party Content”) or if you are aware of any third party intellectual property or proprietary rights associated with your Contribution (“Third Party Rights”), then you agree to include with the submission of your Contribution full details respecting such Third Party Content and Third Party Rights, including, without limitation, identification of which aspects of your Contribution contain Third Party Content or are associated with Third Party Rights, the owner/author of the Third Party Content and Third Party Rights, where you obtained the Third Party Content, and any applicable third party license terms or restrictions respecting the Third Party Content and Third Party Rights. For greater certainty, the foregoing obligations respecting the identification of Third Party Content and Third Party Rights do not apply to any portion of a Project that is incorporated into your Contribution to that same Project.

Representations. You represent that, other than the Third Party Content and Third Party Rights identified by you in accordance with this Agreement, you are the sole author of your Contributions and are legally entitled to grant the foregoing licenses and waivers in respect of your Contributions. If your Contributions were created in the course of your employment with your past or present employer(s), you represent that such employer(s) has authorized you to make your Contributions on behalf of such employer(s) or such employer (s) has waived all of their right, title or interest in or to your Contributions.

Disclaimer. To the fullest extent permitted under applicable law, your Contributions are provided on an "asis" basis, without any warranties or conditions, express or implied, including, without limitation, any implied warranties or conditions of non-infringement, merchantability or fitness for a particular purpose. You are not required to provide support for your Contributions, except to the extent you desire to provide support.

No Obligation. You acknowledge that SAP is under no obligation to use or incorporate your Contributions into any of the Projects. The decision to use or incorporate your Contributions into any of the Projects will be made at the sole discretion of SAP or its authorized delegates.

Disputes. This Agreement shall be governed by and construed in accordance with the laws of the State of New York, United States of America, without giving effect to its principles or rules regarding conflicts of laws, other than such principles directing application of New York law. The parties hereby submit to venue in, and jurisdiction of the courts located in New York, New York for purposes relating to this Agreement. In the event that any of the provisions of this Agreement shall be held by a court or other tribunal of competent jurisdiction to be unenforceable, the remaining portions hereof shall remain in full force and effect.

Assignment. You agree that SAP may assign this Agreement, and all of its rights, obligations and licenses hereunder.

}

// group content into a single container control so the popup instance key can be added later
oContentContainer = new sap.m.FlexBox({
Copy link
Contributor

Choose a reason for hiding this comment

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

all used modules need to be imported using a require/declare statement. Is FlexBox needed?

Copy link
Author

Choose a reason for hiding this comment

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

  • What this is trying to achieve:
    I was trying to find a way to link the 'child' controls (those in the content parameter of MessageToast.show) of the toast to the reference of the toast's popup, for use by MessageToast.close. This 'link' enables us to close the correct MessageToast popup instance in response to an event of one of the controls within the toast.

  • Why FlexBox helps achive this:
    The FlexBox solution provides a single container to store the reference to the popup as a custom data property. I felt this was the most simple approach I could come up with. Open to ideas though, I don't like having to use a different control just for this but I'm unaware of how else to achieve the link from content to popup.

all used modules need to be imported using a require/declare statement - would that be jQuery.sap.require?

Thanks in advance

Copy link
Contributor

Choose a reason for hiding this comment

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

would that be jQuery.sap.require?

It depends... for modules that are always needed or "usually anyway loaded" it would be another entry at the very top of the file in the sap.ui.define arguments list.
For heavyweight stuff that is usually not needed and also not typically used by other modules, it would rather be a lazy require. Could be done synchronously with jQuery.sap.require (but we are getting rid of all sync stuff) or sap.ui.require if possibly async.

But for the moment I'd suggest to first get general feedback before tweaking single issues.

Regards
Andreas

@akudev
Copy link
Contributor

akudev commented Mar 5, 2017

Thanks! But the control owners need to review and also accept the general direction...

@matz3
Copy link
Member

matz3 commented Mar 7, 2017

CLA has been successfully signed with cla-assistant, but the status check doesn't seem to be working. I've opened cla-assistant/cla-assistant#200.

Update: Status is green now (commit was done by another user how needed to sign. So no issue with cla-assistant itself)

 - Many front end design frameworks provide MessageToast-like popups with which the user can interact.
Most common example along the lines of a message "something just happened" with a button to undo the 'something'

 - sap.m.MessageToast could previously not do this

 - This feature enables the developer to display in a MessageToast one or more of sap.ui.core.Control to provide this functionality.
@nikolay-kolarov
Copy link
Contributor

nikolay-kolarov commented May 2, 2017

Hi @stu-b-doo,

Thank you for your feature suggestion and the investment in the pull request!
The initial idea of the MessageToast is to be a really simple control, which can be used to provide non-disruptive messages to the user.
For example: give some additional information or point the attention to people for a potential things that may occur.
In addition, if the MessageToast is opened and accept controls, it will be hard to control its layouting, hiding and the lifecycle of the controls, which are added.
The mentioned behavior can be achieved easily in many different ways, using the available controls (MessageBox, MessageStrip, Popover, etc...).
Therefore we prefer to stay with the current behavior.

Best Regards,
Nikolay

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants