Skip to content
This repository has been archived by the owner on Dec 8, 2022. It is now read-only.

Commit

Permalink
Merge branch 'master' into icon-checkbox
Browse files Browse the repository at this point in the history
  • Loading branch information
Blackbaud-SteveBrush authored May 7, 2018
2 parents df79073 + 7219b77 commit 9ce9d5a
Show file tree
Hide file tree
Showing 10 changed files with 112 additions and 79 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions src/locales/resources_en_US.json
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,10 @@
"_description": "Placeholder text in grid search box",
"message": "Find in this list"
},
"help_inline_button_title": {
"_description": "The title for the help button.",
"message": "Show help content"
},
"link_records_item_info_match": {
"_description": "",
"message": "A possible match has been identified for this record. Would you like to link it?"
Expand Down
31 changes: 18 additions & 13 deletions src/modules/help-inline/fixtures/help-inline-fixtures.module.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import {
NgModule
} from '@angular/core';

import { SkyHelpInlineModule } from '../';
import {
CommonModule
} from '@angular/common';

import { SkyHelpInlineModule } from '../help-inline.module';
import { HelpInlineTestComponent } from './help-inline.component.fixture';

@NgModule({
declarations: [
HelpInlineTestComponent
],
imports: [
CommonModule,
SkyHelpInlineModule
],
exports: [
HelpInlineTestComponent
]
declarations: [
HelpInlineTestComponent
],
imports: [
CommonModule,
SkyHelpInlineModule
],
exports: [
HelpInlineTestComponent
]
})
export class SkyInlineHlpeFixturesModule { }
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<sky-help-inline
(actionClick)="buttonClicked()">
(actionClick)="buttonClicked()">
</sky-help-inline>
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import { Component } from '@angular/core';
import {
Component
} from '@angular/core';

@Component({
selector: 'sky-test-cmp',
templateUrl: './help-inline.component.fixture.html'
selector: 'sky-test-cmp',
templateUrl: './help-inline.component.fixture.html'
})
export class HelpInlineTestComponent {
public buttonIsClicked: boolean = false;
public buttonIsClicked = false;

public buttonClicked() {
this.buttonIsClicked = true;
}
public buttonClicked() {
this.buttonIsClicked = true;
}
}
11 changes: 6 additions & 5 deletions src/modules/help-inline/help-inline.component.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<button
class="sky-help-inline fa fa-info-circle"
(click)="buttonClicked()"
[attr.aria-label]="'show_help_content' | skyResources"
>
</button>
class="sky-help-inline"
type="button"
(click)="onClick()"
[attr.title]="'help_inline_button_title' | skyResources">
<i class="fa fa-info-circle" aria-hidden="true"></i>
</button>
2 changes: 2 additions & 0 deletions src/modules/help-inline/help-inline.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
background-color: transparent;
border: none;
display: inline-block;

&:hover {
color: darken($sky-text-color-action-primary, 10%);
transition: color $sky-transition-time-short;
cursor: pointer;
}
}
69 changes: 38 additions & 31 deletions src/modules/help-inline/help-inline.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,39 +1,46 @@
import { TestBed, ComponentFixture } from '@angular/core/testing';
import { DebugElement } from '@angular/core';
import {
DebugElement
} from '@angular/core';

import { BrowserModule, By } from '@angular/platform-browser';
import {
ComponentFixture,
TestBed
} from '@angular/core/testing';

import {
BrowserModule,
By
} from '@angular/platform-browser';

import { HelpInlineTestComponent } from './fixtures/help-inline.component.fixture';
import { SkyHelpInlineModule } from '../help-inline/help-inline.module';
import { HelpInlineTestComponent } from './fixtures/help-inline.component.fixture';

describe('Help inline component', () => {
let fixture: ComponentFixture<HelpInlineTestComponent>;
let cmp: HelpInlineTestComponent;
let el: HTMLElement;
let debugElement: DebugElement;

beforeEach(() => {
TestBed.configureTestingModule({
declarations: [
HelpInlineTestComponent
],
imports: [
BrowserModule,
SkyHelpInlineModule
]
});

fixture = TestBed.createComponent(HelpInlineTestComponent);
cmp = fixture.componentInstance as HelpInlineTestComponent;
el = fixture.nativeElement as HTMLElement;
debugElement = fixture.debugElement;

fixture.detectChanges();
});
let fixture: ComponentFixture<HelpInlineTestComponent>;
let cmp: HelpInlineTestComponent;
let debugElement: DebugElement;

it('should emit a click event on button click', () => {
debugElement.query(By.css('.sky-help-inline')).triggerEventHandler('click', undefined);
fixture.detectChanges();
expect(cmp.buttonIsClicked).toBe(true);
beforeEach(() => {
TestBed.configureTestingModule({
declarations: [
HelpInlineTestComponent
],
imports: [
BrowserModule,
SkyHelpInlineModule
]
});

fixture = TestBed.createComponent(HelpInlineTestComponent);
cmp = fixture.componentInstance as HelpInlineTestComponent;
debugElement = fixture.debugElement;

fixture.detectChanges();
});

it('should emit a click event on button click', () => {
debugElement.query(By.css('.sky-help-inline')).triggerEventHandler('click', undefined);
fixture.detectChanges();
expect(cmp.buttonIsClicked).toBe(true);
});
});
22 changes: 13 additions & 9 deletions src/modules/help-inline/help-inline.component.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
import { Component, EventEmitter, Output } from '@angular/core';
import {
Component,
EventEmitter,
Output
} from '@angular/core';

@Component({
selector: 'sky-help-inline',
styleUrls: ['./help-inline.component.scss'],
templateUrl: './help-inline.component.html'
selector: 'sky-help-inline',
templateUrl: './help-inline.component.html',
styleUrls: ['./help-inline.component.scss']
})
export class SkyHelpInlineComponent {
@Output()
public actionClick = new EventEmitter<any>();
@Output()
public actionClick = new EventEmitter<any>();

public buttonClicked() {
this.actionClick.emit();
}
public onClick() {
this.actionClick.emit();
}
}
34 changes: 21 additions & 13 deletions src/modules/help-inline/help-inline.module.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,27 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import {
NgModule
} from '@angular/core';

import {
CommonModule
} from '@angular/common';

import {
SkyResourcesModule
} from '../resources';

import { SkyHelpInlineComponent } from './help-inline.component';
import { SkyResourcesModule } from '../resources';

@NgModule({
declarations: [
SkyHelpInlineComponent
],
imports: [
CommonModule,
SkyResourcesModule
],
exports: [
SkyHelpInlineComponent
]
declarations: [
SkyHelpInlineComponent
],
imports: [
CommonModule,
SkyResourcesModule
],
exports: [
SkyHelpInlineComponent
]
})
export class SkyHelpInlineModule { }

0 comments on commit 9ce9d5a

Please sign in to comment.