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: (Core) Introduce Message Box component #3902

Merged
merged 20 commits into from
Nov 27, 2020
Merged

Conversation

salarenko
Copy link
Contributor

@salarenko salarenko commented Nov 19, 2020

Please provide a link to the associated issue.

Closes: #2430
Issues found: #3903, #3887, #3886, #3926

Please provide a brief summary of this pull request.

This PR:

  • Removes fd-dialog-title directive in favor of universal fd-title
  • Renames DefaultDialogObject to DialogDefaultContent
  • Moves basic Dialog behavior to DialogBase
  • Moves basic DialogRef to DialogRefBase
  • Moves basic DialogConfig to DialogConfigBase
  • Moves basic DialogFooter behavior to DialogFooterBase
  • Moves basic DialogService behavior to DialogBaseService
  • Moves basic DialogHeader behavior to DialogHeaderBase
  • Moves Dialog directives to separate files
  • Updates DialogCloseButtonDirective to DialogCloseButtonComponent
  • Adds generic typing to DialogService.open method
  • Moves basic DefaultDialogObject to DialogContentBase
  • Creates InitialFocusModule
  • Creates DynamicComponentContainer base class
  • Adds generic typing to DialogConfig and DialogRef to specify data type
  • Introduces Message Box component with all required building blocks and mechanisms

BREAKING CHANGE

  • Removed fd-dialog-title, fd-title should be used instead.

Please check whether the PR fulfills the following requirements

Documentation checklist:

@salarenko salarenko added this to the Sprint 50 - Tulum milestone Nov 19, 2020
@salarenko salarenko requested a review from a team November 19, 2020 16:50
@salarenko salarenko self-assigned this Nov 19, 2020
@netlify
Copy link

netlify bot commented Nov 19, 2020

Deploy preview for fundamental-ngx ready!

Built with commit 9ceb959

https://deploy-preview-3902--fundamental-ngx.netlify.app

@InnaAtanasova InnaAtanasova changed the title fix: (Core) Introduce Message Box component feat: (Core) Introduce Message Box component Nov 19, 2020
Comment on lines 32 to 46
/** @hidden */
closeButtonClicked(): void {
this.defaultDialogConfig.closeButtonCallback();
}

/** @hidden */
approveButtonClicked(): void {
this.defaultDialogConfig.approveButtonCallback();
}

/** @hidden */
cancelButtonClicked(): void {
this.defaultDialogConfig.cancelButtonCallback();
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

hey, didn't we discuss to add _ prefix for public but hidden props and methods?

Copy link
Contributor

@InnaAtanasova InnaAtanasova left a comment

Choose a reason for hiding this comment

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

  1. Template based Message Box does not close from the Close button

Screen Shot 2020-11-19 at 3 32 26 PM

  1. Complex template - is it intentional that the content in the Bar is not centered vertically?

Screen Shot 2020-11-19 at 3 37 09 PM

  1. Semantic icons: I checked fund-styles and the issue is coming from there but the semantic icons are missing in the Message Box header. In styles we have additional class that removes the icon. I think you are missing this directive (or input prop in case you want to go this way)

Screen Shot 2020-11-19 at 3 39 45 PM

@salarenko
Copy link
Contributor Author

@InnaAtanasova Thanks for the review, comments addressed. I've created separate issues for semantic state icons in Fundamental Styles and NGX Core #3886, #3887. I think it will be better to introduce the API when the feature is available.

@mikerodonnell89
Copy link
Member

Object based dialog example is broken

Screen Shot 2020-11-23 at 12 22 39 PM

Copy link
Member

@mikerodonnell89 mikerodonnell89 left a comment

Choose a reason for hiding this comment

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

Dialog refactor seems great! I just have questions about two small things, see comments

@@ -2,16 +2,14 @@ import { Component } from '@angular/core';
import { BarElementDirective } from '../../bar/directives/bar-element.directive';

/**
* Applies fundamental layout and styling to the contents of a dialog body.
* Building block of the dialog used to create message box button.
Copy link
Member

Choose a reason for hiding this comment

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

Is this component necessary? Not adding any classes or functionality, I think the developer could just use the button component here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, this sucks. I think perfect solution would be putting buttons and stuff into the footer like:

<footer>
    <fd-button></fd-button>
    <fd-button></fd-button>
<footer>

and some general styling coming from the footer would add the spacing between footer direct children.
The problem is we need to use BarComponent for the implementation of the dialog header and footer. BarComponent enforces following structure:

<div fd-bar>
    <div fd-bar-right>
        <fd-bar-element>
            <fd-button></fd-button>
        </fd-bar-element>
        <fd-bar-element>
            <fd-button></fd-button>
        </fd-bar-element>
    </div>
</div>   

so every bar element needs to be wrapped inside fd-bar-element which is responsible for creating spacing between bar elements.
The easiest solution is telling the user to wrap footer elements into fd-bar-element by himself. To make this more user-friendly I created fd-dialog-footer-button which is exactly the same as fd-bar-element but with more clear name. However I believe this can and should be simplified, but I wanted to tackle this separately.
Here is a separate issue for this: #3926

@salarenko
Copy link
Contributor Author

@mikerodonnell89 Object based dialog fixed.

Copy link
Contributor

@JKMarkowski JKMarkowski left a comment

Choose a reason for hiding this comment

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

LGTM - Chapeau bas

@salarenko salarenko force-pushed the fix/2430-message-box branch from 23e61e2 to 9ceb959 Compare November 27, 2020 09:06
@salarenko salarenko merged commit fb1bd78 into master Nov 27, 2020
@salarenko salarenko deleted the fix/2430-message-box branch November 27, 2020 09:20
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.

new component - Message Box
4 participants