Skip to content

fix(modal): Fix modal.service:show() buttons to be an array. #150

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

Conversation

stanislavgeorgiev
Copy link
Contributor

fix(modal): Added more documentation.
feat(modal): modal.service:show() can now supports HTML in modalContent.

fix(modal): Added more documentation.
feat(modal): modal.service:show() can now supports HTML in `modalContent`.
Copy link
Contributor

@cal-smith cal-smith left a comment

Choose a reason for hiding this comment

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

Couple comments for thought, but otherwise LGTM

@@ -64,7 +64,7 @@ import Modal from "./modal.decorator";
<p class="bx--modal-header__heading bx--type-beta">{{modalTitle}}</p>
</ibm-modal-header>
<div class="bx--modal-content">
<p>{{modalContent}}</p>
<p [innerHTML]="modalContent"></p>
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is probably okay (I can certainly see some use cases), but a ng-template output should probably be added as the default way to inject complex html content.

That of course could be added as a feature later, what do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yea, makes sense! The use case in my head was if I want to show this as content:
Are you sure you want to delete <strong>this item name</strong>

Copy link
Contributor

Choose a reason for hiding this comment

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

Yep makes sense, and I think we already support that for banners/notifications (which have a similar usage model)

@@ -82,7 +86,7 @@ export class ModalService {
* @returns {ComponentRef<any>}
* @memberof ModalService
*/
show(data: {modalType?: string, modalLabel?: string, modalTitle: string, modalContent: string, buttons?: null}) {
show(data: {modalType?: string, modalLabel?: string, modalTitle?: string, modalContent?: string, buttons?: []}) {
Copy link
Contributor

Choose a reason for hiding this comment

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

nice!

if we wanted to get really fancy we could declare a interface ModalButton and type buttons to buttons?: ModalButton[]

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeap, would definitely add that in the future!
I'm still an Angular NOOB but also really pressed for our project's release in 3 weeks

Copy link
Contributor

Choose a reason for hiding this comment

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

Cool, I'll make an issue to note that 👍

@zvonimirfras zvonimirfras merged commit a505e9a into carbon-design-system:master Oct 4, 2018
@carbon-bot
Copy link
Contributor

🎉 This PR is included in version 1.8.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

@stanislavgeorgiev stanislavgeorgiev deleted the AlertModalComponent branch June 11, 2019 14:07
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.

4 participants