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(action): provide new attributes for link and title #1046

Merged
merged 5 commits into from
Jan 31, 2019

Conversation

Tom4U
Copy link
Contributor

@Tom4U Tom4U commented Dec 4, 2018

Please read and mark the following check list before creating a pull request:

Short description of what this resolves:

Provides the ability to use a link and title (if icon is set) for action component:

Using [routerLink] with link attribute:
<nb-action link="/" icon="nb-home" title="Home"></nb-action>

Using href for links other than [routerLink]:
<nb-action href="http:https://somesite.com" icon="nb-paper-plane" title="Some Site"></nb-action>

Closes #814

yggg
yggg previously requested changes Jan 18, 2019
Copy link
Contributor

@yggg yggg left a comment

Choose a reason for hiding this comment

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

Hi @Tom4U! Thanks a lot for the contribution! Could you please, address the comments.
And probably, to simplify *ngIf conditions it's better to move icon check to ng-container. Something like this:

<ng-container *ngIf="icon; else projectedContent">
  <a *ngIf="link" ...>...</a>
  <a *ngIf="href" ...>...</a>
  <a *ngIf="!link && !href" ...>...</a>
</ng-container>

<ng-template #projectedContent>
  <ng-content></ng-content>
</ng-template>
...

What do you think?

@codecov
Copy link

codecov bot commented Jan 22, 2019

Codecov Report

Merging #1046 into master will decrease coverage by 0.67%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master    #1046      +/-   ##
==========================================
- Coverage   79.52%   78.85%   -0.68%     
==========================================
  Files         202      200       -2     
  Lines        6243     6073     -170     
  Branches      495      469      -26     
==========================================
- Hits         4965     4789     -176     
- Misses       1162     1169       +7     
+ Partials      116      115       -1
Impacted Files Coverage Δ
...work/theme/components/actions/actions.component.ts 78.78% <100%> (+2.12%) ⬆️
...work/theme/components/tooltip/tooltip.directive.ts 95.08% <0%> (-4.92%) ⬇️
...work/theme/components/popover/popover.directive.ts 86.88% <0%> (-4.3%) ⬇️
...mework/theme/components/layout/layout.component.ts 76.16% <0%> (ø) ⬆️
...work/theme/components/popover/popover.component.ts 100% <0%> (ø) ⬆️
...work/theme/components/tooltip/tooltip.component.ts 100% <0%> (ø) ⬆️
...rc/framework/theme/components/cdk/overlay/index.ts 100% <0%> (ø) ⬆️
.../theme/components/cdk/overlay/overlay-container.ts 100% <0%> (ø) ⬆️
...nts/cdk/overlay/dynamic/dynamic-overlay-handler.ts
.../components/cdk/overlay/dynamic/dynamic-overlay.ts
... and 1 more

@yggg yggg requested review from nnixaa and yggg and removed request for yggg January 22, 2019 11:59
@yggg yggg dismissed their stale review January 22, 2019 12:00

outdated

@nnixaa nnixaa merged commit 30bd394 into akveo:master Jan 31, 2019
@nnixaa
Copy link
Collaborator

nnixaa commented Jan 31, 2019

@Tom4U thanks for your contribution!

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.

How to link mailto to the nb-action in the header?
3 participants