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(message): introducing message module. (closes #316) #596

Merged
merged 8 commits into from
May 16, 2017

Conversation

emoralesb05
Copy link
Contributor

@emoralesb05 emoralesb05 commented May 15, 2017

adding CovalentMessageComponent with TdMessageComponent for easy display of inline messages or info boxes

#316

Description

Adding message component to covalent.

This leverages our color styles to set the color and contrast (red,blue, etc), but also can use the material theme colors like primary , warn and accent.

Usage example:

<td-message #message label="Label" sublabel="Sublabel goes here" icon="warning" color="primary | blue | red" [opened]="true">
  <button td-message-actions md-button>View More<button>
  <button td-message-actions md-icon-button (click)="message.close()">
    <md-icon>cancel</md-icon>
  <button>
</td-message>  

API Summary

Properties:

Name Type Description
label? string Sets the label of the message.
sublabel? string Sets the sublabel of the message.
icon? string The icon to be displayed before the title. Defaults to info_outline icon
color? 'primary', 'accent' or 'warn' Sets the color of the message. Can also use any material color: purple, light-blue, etc.
opened? boolean Shows or hiddes the message depending on its value. Defaults to 'true'.
open function() Renders the message on screen.
close function() Removes the message content from screen.
toggle function() Toggles between open and close depending on state.

What's included?

  • CovalentMessageModule and TdMessageComponent
  • Theming for message component
  • Docs and Demo

Test Steps

General Tests for Every PR

  • ng serve --aot still works.
  • npm run lint passes.
  • npm test passes and code coverage is not lower.
  • npm run build still works.
Screenshots or link to CodePen/Plunker/JSfiddle

screen shot 2017-05-15 at 3 31 58 pm

adding CovalentMessageComponent with `TdMessageComponent` for easy display of inline messages or info boxes
@emoralesb05 emoralesb05 added this to the Beta 4 milestone May 15, 2017
@emoralesb05 emoralesb05 changed the title feat(message): introducing message module feat(message): introducing message module. (closes #316) May 15, 2017
@kyleledbetter
Copy link
Contributor

Latest demo updates:

image

when [opened] was initialized as false, the initialized flag was never set to true

added unit test to verify it works
`td-message` element generates an inline message with an icon, color, label and sublabel.

`color` can be either with any theme color (`primary`, `accent` or `warn`)
But you can also set a `color` from our lib can be applied in the component to get any material color not in the theme. (`blue`, `red`, etc)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think you mean:
But you can also set a color from our lib and it can be applied in the component to get any material color not in the theme. (blue, red, etc)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated~

@emoralesb05 emoralesb05 merged commit 8a517fb into develop May 16, 2017
@emoralesb05 emoralesb05 deleted the feature/message branch May 16, 2017 03:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants