Skip to content

Commit

Permalink
Merge pull request #105 from funidata/add-routerlink-to-fudis-link
Browse files Browse the repository at this point in the history
Bump version 0.0.28 & add routerlink to fudis-link
  • Loading branch information
videoeero committed May 25, 2023
2 parents 9094ca0 + 1486d10 commit 2650d0d
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 8 deletions.
4 changes: 2 additions & 2 deletions ngx-fudis/projects/ngx-fudis/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion ngx-fudis/projects/ngx-fudis/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@funidata/ngx-fudis",
"version": "0.0.27",
"version": "0.0.28",
"schematics": "./schematics/collection.json",
"ng-add": {
"save": "dependencies"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
<ng-template #externalLink>
<a
attr.aria-label="{{ linkTitle ? linkTitle : href }}, {{ externalLinkAriaLabel }}"
[href]="href"
[href]="href ? href : null"
[routerLink]="routerLinkUrl"
target="_blank"
rel="noopener noreferrer"
class="fudis-link__anchor fudis-link__anchor__{{ size }} fudis-link__anchor__{{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { ChangeDetectionStrategy } from '@angular/core';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { By } from '@angular/platform-browser';
import { MockComponent } from 'ng-mocks';
import { RouterModule } from '@angular/router';
import { IconComponent } from '../icon/icon.component';
import { LinkComponent } from './link.component';

Expand All @@ -12,6 +13,7 @@ describe('LinkComponent', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [LinkComponent, MockComponent(IconComponent)],
imports: [RouterModule.forRoot([])],
})
.overrideComponent(LinkComponent, {
set: { changeDetection: ChangeDetectionStrategy.Default },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,15 @@ import { ChangeDetectionStrategy, Component, Input, ViewEncapsulation } from '@a
})
export class LinkComponent {
/**
* Link URL
* Link URL using native href
*/
@Input() href: string;

/**
* Link URL using Angular RouterLink
*/
@Input() routerLinkUrl: string | any[];

/**
* Title for the link, if not defined title will be the same as link URL
*/
Expand Down
2 changes: 2 additions & 0 deletions ngx-fudis/projects/ngx-fudis/src/lib/ngx-fudis.module.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { NgModule } from '@angular/core';
import { RouterModule } from '@angular/router';
import { CommonModule } from '@angular/common';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { LayoutModule } from '@angular/cdk/layout';
Expand Down Expand Up @@ -122,6 +123,7 @@ import { InputWithLanguageOptionsComponent } from './components/form/input-with-
MatButtonModule,
MatTooltipModule,
ReactiveFormsModule,
RouterModule,
],

/*
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fudis",
"version": "0.0.27",
"version": "0.0.28",
"description": "Funidata Design System",
"main": "index.js",
"directories": {
Expand Down

0 comments on commit 2650d0d

Please sign in to comment.