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 toastr-fromscratch
Browse files Browse the repository at this point in the history
  • Loading branch information
Blackbaud-SteveBrush authored May 7, 2018
2 parents 57bfe9c + 7219b77 commit 6e766de
Show file tree
Hide file tree
Showing 13 changed files with 145 additions and 81 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions skyux-spa-visual-tests/src/app/flyout/flyout-demo.component.html
Original file line number Diff line number Diff line change
@@ -1 +1,15 @@
<b>Flyout component</b>
<sky-dropdown buttonType="context-menu">
<sky-dropdown-menu>
<sky-dropdown-item>
<button type="button">
Option 1
</button>
</sky-dropdown-item>
<sky-dropdown-item>
<button type="button">
Option 2
</button>
</sky-dropdown-item>
</sky-dropdown-menu>
</sky-dropdown>
19 changes: 18 additions & 1 deletion skyux-spa-visual-tests/src/app/flyout/flyout.visual-spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { SkyVisualTest } from '../../../config/utils/visual-test-commands';

import { element, by } from 'protractor';
import { element, by, browser } from 'protractor';

describe('Flyout', () => {

Expand Down Expand Up @@ -31,4 +31,21 @@ describe('Flyout', () => {
});
});
});

it('should handle absolutely positioned items inside the flyout', () => {
return SkyVisualTest.setupTest('flyout')
.then(() => {
element(by.css('.sky-btn-primary')).click();
browser.sleep(250);
element(by.css('.sky-flyout .sky-dropdown-button')).click();
SkyVisualTest.moveCursorOffScreen();
return SkyVisualTest
.compareScreenshot({
screenshotName: 'flyout-open-dropdown',
selector: 'body'
}).then(() => {
element(by.css('.sky-flyout .sky-flyout-btn-close')).click();
});
});
});
});
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
2 changes: 1 addition & 1 deletion src/modules/flyout/flyout.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const FLYOUT_CLOSED_STATE = 'flyoutClosed';
styleUrls: ['./flyout.component.scss'],
animations: [
trigger('flyoutState', [
state(FLYOUT_OPEN_STATE, style({ transform: 'translateX(0)' })),
state(FLYOUT_OPEN_STATE, style({ transform: 'initial' })),
state(FLYOUT_CLOSED_STATE, style({ transform: 'translateX(100%)' })),
transition('void => *', [
style({ transform: 'translateX(100%)' }),
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 6e766de

Please sign in to comment.