-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(toast-message): Addon test support (#110)
* feat(toast-message): added addon-test-support * fix(toast-message): removed title margin * fix: removed wormhole usage * feat: initialize helper * Approved Toast Co-authored-by: Sharath Sriram <[email protected]>
- Loading branch information
1 parent
79ed2f5
commit 5bbb30a
Showing
7 changed files
with
36 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import FlashObject from 'ember-cli-flash/flash/object'; | ||
|
||
FlashObject.reopen({ init() {} }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,6 +46,10 @@ | |
padding-right: 16px; | ||
flex-grow: 2; | ||
|
||
.title { | ||
margin: 0; | ||
} | ||
|
||
.link { | ||
color: $text-info; | ||
} | ||
|
58 changes: 28 additions & 30 deletions
58
packages/toast-message/addon/templates/components/nucleus-toast-message.hbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,28 @@ | ||
{{#ember-wormhole to="nucleus-toast-messages-wormhole"}} | ||
<div class="nucleus-toast-messages {{position}}"> | ||
{{#each flashMessages.queue as |flash|}} | ||
{{#transition-group transitionClass="slide-down"}} | ||
{{#flash-message flash=flash class="nucleus-toast-message" as |component flash close|}} | ||
<div class="nucleus-toast-message__icon">{{nucleus-icon name=(get _iconMap component.flashType) size="medium"}}</div> | ||
<div class="nucleus-toast-message__content"> | ||
<p>{{flash.message}}</p> | ||
{{#if flash.content}} | ||
<a role="button" | ||
class="link" | ||
aria-label={{flash.content.linkText}} | ||
onClick={{action flash.content.linkAction}}> | ||
{{flash.content.linkText}} | ||
</a> | ||
{{/if}} | ||
</div> | ||
<div class="nucleus-toast-message__close"> | ||
{{nucleus-button | ||
variant="text" | ||
size="mini" | ||
customClass=(concat "flash-message-close") | ||
icon="nucleus-cross" | ||
onClick=(action close)}} | ||
</div> | ||
{{/flash-message}} | ||
{{/transition-group}} | ||
{{/each}} | ||
</div> | ||
{{/ember-wormhole}} | ||
<div class="nucleus-toast-messages {{position}}"> | ||
{{#each flashMessages.queue as |flash|}} | ||
{{#transition-group transitionClass="slide-down"}} | ||
{{#flash-message flash=flash class="nucleus-toast-message" as |component flash close|}} | ||
<div class="nucleus-toast-message__icon">{{nucleus-icon name=(get _iconMap component.flashType) size="medium"}}</div> | ||
<div class="nucleus-toast-message__content"> | ||
<p class="title">{{flash.message}}</p> | ||
{{#if flash.content}} | ||
<a role="button" | ||
class="link" | ||
aria-label={{flash.content.linkText}} | ||
onClick={{action flash.content.linkAction}}> | ||
{{flash.content.linkText}} | ||
</a> | ||
{{/if}} | ||
</div> | ||
<div class="nucleus-toast-message__close"> | ||
{{nucleus-button | ||
variant="text" | ||
size="mini" | ||
customClass=(concat "flash-message-close") | ||
icon="nucleus-cross" | ||
onClick=(action close)}} | ||
</div> | ||
{{/flash-message}} | ||
{{/transition-group}} | ||
{{/each}} | ||
</div> |
Binary file modified
BIN
-326 Bytes
(98%)
...st-message__it_passes_visual_regression_tests__assert0_0_document_0_webview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 0 additions & 13 deletions
13
packages/toast-message/tests/helpers/setup-toast-message.js
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters