Skip to content

Commit

Permalink
[rc] Upgrade dependencies; merge master (#55)
Browse files Browse the repository at this point in the history
* Bump acorn from 6.4.0 to 6.4.1 (#40)

Bumps [acorn](https://github.com/acornjs/acorn) from 6.4.0 to 6.4.1.
- [Release notes](https://github.com/acornjs/acorn/releases)
- [Commits](acornjs/acorn@6.4.0...6.4.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Assorted fixes; unit tests (#42)

* Updated changelog/package.json for 3.2.0 release (#43)

* Adding license (#47)

Added license to address blackbaud/skyux2-docs#894

* Fixed href generator for lowercase type names (#49)

* Updated changelog/package.json for 3.2.1 release (#50)

* Added theme picker control panel to demo (#52)

* Added theme picker control panel to demo

* Added tests

* Added theme switcher to sample page.

* Addressed PR feedback

* Fixed import paths

* Updated CHANGELOG and package.json for 3.3.0 release (#53)

* [rc] Upgrade dependencies

* Added restricted view

* Added to peers

* Remove dev bundle

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Denise Pena <Denise.Pena@blackbaud.me>
Co-authored-by: Paul Crowder <paul.crowder@blackbaud.com>
  • Loading branch information
4 people committed May 1, 2020
1 parent 0158443 commit 2c23c47
Show file tree
Hide file tree
Showing 23 changed files with 996 additions and 349 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 3.3.0 (2020-04-30)

- Added a theme switcher control panel to the demo component. [#52](https://github.com/blackbaud/skyux-docs-tools/pull/52)

# 4.0.0-rc.3 (2020-04-28)

- Added bug fixes and features from the `master` branch. [#51](https://github.com/blackbaud/skyux-docs-tools/pull/51)
Expand Down
755 changes: 447 additions & 308 deletions package-lock.json

Large diffs are not rendered by default.

46 changes: 24 additions & 22 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
"scripts": {
"build": "skyux build-public-library && node ./scripts/prepare-package.js",
"build:ci": "npm run build",
"build:dev-bundle": "npm run build && node ./scripts/dev-bundle.js",
"start": "npm run build:dev-bundle && skyux serve",
"test": "npm run build:dev-bundle && skyux test --coverage library --logFormat none",
"test:ci": "npm run build:dev-bundle && skyux test --platform travis --coverage library --logFormat none && skyux e2e --platform travis --logFormat none",
"visual": "npm run build:dev-bundle && skyux e2e"
"test": "skyux test --coverage library",
"test:watch": "skyux watch --coverage library",
"start": "skyux serve",
"e2e": "skyux e2e",
"lint": "skyux lint"
},
"keywords": [],
"author": "Blackbaud",
Expand All @@ -26,6 +26,7 @@
"@blackbaud/skyux-lib-code-block": "^2.0.0-rc.3",
"@blackbaud/skyux-lib-clipboard": "^2.0.0-rc.0",
"@blackbaud/skyux-lib-media": "^2.0.0-rc.0",
"@blackbaud/skyux-lib-restricted-view": "^2.0.0-rc.0",
"@blackbaud/skyux-lib-stache": "^4.0.0-rc.2",
"@skyux/forms": "^4.0.0-rc.0",
"@skyux/i18n": "^4.0.0-rc.5",
Expand All @@ -41,45 +42,46 @@
"marked": "0.8.2"
},
"devDependencies": {
"@angular/animations": "9.1.3",
"@angular/common": "9.1.3",
"@angular/compiler": "9.1.3",
"@angular/compiler-cli": "9.1.3",
"@angular/core": "9.1.3",
"@angular/forms": "9.1.3",
"@angular/platform-browser": "9.1.3",
"@angular/platform-browser-dynamic": "9.1.3",
"@angular/router": "9.1.3",
"@angular/animations": "9.1.4",
"@angular/common": "9.1.4",
"@angular/compiler": "9.1.4",
"@angular/compiler-cli": "9.1.4",
"@angular/core": "9.1.4",
"@angular/forms": "9.1.4",
"@angular/platform-browser": "9.1.4",
"@angular/platform-browser-dynamic": "9.1.4",
"@angular/router": "9.1.4",
"@blackbaud/auth-client": "2.24.0",
"@blackbaud/skyux-builder-plugin-code-block": "1.1.0",
"@blackbaud/skyux-lib-clipboard": "2.0.0-rc.0",
"@blackbaud/skyux-lib-code-block": "2.0.0-rc.3",
"@blackbaud/skyux-lib-media": "2.0.0-rc.0",
"@blackbaud/skyux-lib-restricted-view": "2.0.0-rc.0",
"@blackbaud/skyux-lib-stache": "4.0.0-rc.2",
"@skyux-sdk/builder": "4.0.0-rc.7",
"@skyux-sdk/builder-plugin-skyux": "1.3.3",
"@skyux-sdk/builder-plugin-skyux": "4.0.0-rc.0",
"@skyux-sdk/e2e": "4.0.0-rc.0",
"@skyux-sdk/testing": "4.0.0-rc.1",
"@skyux-sdk/testing": "4.0.0-rc.2",
"@skyux/animations": "4.0.0-rc.0",
"@skyux/assets": "4.0.0-rc.1",
"@skyux/avatar": "4.0.0-rc.0",
"@skyux/avatar": "4.0.0-rc.2",
"@skyux/config": "4.0.0-rc.3",
"@skyux/core": "4.0.0-rc.4",
"@skyux/errors": "4.0.0-rc.0",
"@skyux/errors": "4.0.0-rc.1",
"@skyux/forms": "4.0.0-rc.0",
"@skyux/http": "4.0.0-rc.3",
"@skyux/i18n": "4.0.0-rc.5",
"@skyux/indicators": "4.0.0-rc.4",
"@skyux/indicators": "4.0.0-rc.5",
"@skyux/inline-form": "4.0.0-rc.0",
"@skyux/layout": "4.0.0-rc.3",
"@skyux/layout": "4.0.0-rc.4",
"@skyux/lists": "4.0.0-rc.2",
"@skyux/lookup": "4.0.0-rc.2",
"@skyux/lookup": "4.0.0-rc.3",
"@skyux/modals": "4.0.0-rc.4",
"@skyux/navbar": "4.0.0-rc.0",
"@skyux/omnibar-interop": "4.0.0-rc.0",
"@skyux/popovers": "4.0.0-rc.3",
"@skyux/router": "4.0.0-rc.0",
"@skyux/tabs": "4.0.0-rc.0",
"@skyux/tabs": "4.0.0-rc.1",
"@skyux/theme": "4.0.0-rc.5",
"codelyzer": "5.2.2",
"node-sass-tilde-importer": "1.0.2",
Expand Down
10 changes: 0 additions & 10 deletions scripts/dev-bundle.js

This file was deleted.

6 changes: 5 additions & 1 deletion skyuxconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@
"app": {
"styles": [
"src/app/public/styles/docs-tools.scss"
]
],
"theming": {
"supportedThemes": ["default", "modern"],
"theme": "default"
}
},
"librarySettings": {
"whitelistedNonPeerDependencies": [
Expand Down
4 changes: 3 additions & 1 deletion src/app/docs/sample/sample.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
Sample descriptionn.
</sky-docs-demo-page-summary>

<sky-docs-demo>
<sky-docs-demo
[supportsTheming]="true"
>
<sky-docs-demo-control-panel
(reset)="onDemoReset()"
(selectionChange)="onDemoSelectionChange($event)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
>
<ng-content select="sky-docs-demo-control-panel-radio-group"></ng-content>
<ng-content select="sky-docs-demo-control-panel-checkbox"></ng-content>
</div>
<ng-content select="sky-docs-demo-control-panel-theme"></ng-content>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<strong>Theme</strong>
<sky-radio-group
name="theme"
[(ngModel)]="theme"
>
<ul
class="sky-list-unstyled"
>
<li *ngFor="let themeOption of themeOptions">
<sky-radio
[value]="themeOption.value"
>
<sky-radio-label>{{ themeOption.label }}</sky-radio-label>
</sky-radio>
</li>
</ul>
</sky-radio-group>

<strong>Mode</strong>
<sky-radio-group
name="mode"
[(ngModel)]="mode"
>
<ul
class="sky-list-unstyled"
>
<li *ngFor="let modeOption of modeOptions">
<sky-radio
[value]="modeOption.value"
>
<sky-radio-label>{{ modeOption.label }}</sky-radio-label>
</sky-radio>
</li>
</ul>
</sky-radio-group>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ul {
margin: 0;
}
158 changes: 158 additions & 0 deletions src/app/public/modules/demo/demo-control-panel-theme.component.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
import {
DebugElement
} from '@angular/core';

import {
ComponentFixture,
TestBed
} from '@angular/core/testing';

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

import {
SkyTheme,
SkyThemeMode,
SkyThemeSettings
} from '@skyux/theme';

import {
expect
} from '@skyux-sdk/testing';

import {
SkyDocsDemoModule
} from './demo.module';

import {
SkyDocsDemoControlPanelThemeComponent
} from './demo-control-panel-theme.component';

describe('Demo control panel theme', () => {

function getRadioEls(
fixture: ComponentFixture<SkyDocsDemoControlPanelThemeComponent>,
name: string
): DebugElement[] {
return fixture.debugElement.queryAll(By.css(`sky-radio-group[name="${name}"] sky-radio`));
}

function getRadioLabelEl(radioEl: DebugElement): DebugElement {
return radioEl.query(By.css('.sky-switch-label'));
}

function getRadioInputEl(radioEl: DebugElement): DebugElement {
return radioEl.query(By.css('input[type="radio"]'));
}

function validateRadioItem(
radioEl: DebugElement,
expectedLabel: string,
expectedValue: string
): void {
const labelEl = getRadioLabelEl(radioEl);
const inputEl = getRadioInputEl(radioEl);

expect(labelEl.nativeElement).toHaveText(expectedLabel);
expect(inputEl.nativeElement.value).toBe(expectedValue);
}

beforeEach(() => {
TestBed.configureTestingModule({
imports: [
SkyDocsDemoModule
]
});
});

it('should render the expected radio buttons', () => {
const fixture = TestBed.createComponent(SkyDocsDemoControlPanelThemeComponent);

fixture.detectChanges();

const themeRadioEls = getRadioEls(fixture, 'theme');

validateRadioItem(
themeRadioEls[0],
'Default',
'default'
);

validateRadioItem(
themeRadioEls[1],
'Modern',
'modern'
);

const modeRadioEls = getRadioEls(fixture, 'mode');

expect(modeRadioEls.length).toBe(1);

validateRadioItem(
modeRadioEls[0],
'Light',
'light'
);
});

it('should update the mode options based on the selected theme\'s supported modes', () => {
const fixture = TestBed.createComponent(SkyDocsDemoControlPanelThemeComponent);

fixture.detectChanges();

const themeRadioEls = getRadioEls(fixture, 'theme');

getRadioInputEl(themeRadioEls[1]).nativeElement.click();

fixture.detectChanges();

const modeRadioEls = getRadioEls(fixture, 'mode');

expect(modeRadioEls.length).toBe(2);

validateRadioItem(
modeRadioEls[0],
'Light',
'light'
);

validateRadioItem(
modeRadioEls[1],
'Dark',
'dark'
);
});

it('should fire the settings change event when a theme or mode is selected', () => {
const fixture = TestBed.createComponent(SkyDocsDemoControlPanelThemeComponent);

const themeSettingsChangeEmitSpy = spyOn(fixture.componentInstance.themeSettingsChange, 'emit').and.callThrough();

fixture.detectChanges();

const themeRadioEls = getRadioEls(fixture, 'theme');

getRadioInputEl(themeRadioEls[1]).nativeElement.click();

fixture.detectChanges();

expect(themeSettingsChangeEmitSpy).toHaveBeenCalledWith(
new SkyThemeSettings(
SkyTheme.presets.modern,
SkyThemeMode.presets.light
)
);

const modeRadioEls = getRadioEls(fixture, 'mode');

getRadioInputEl(modeRadioEls[1]).nativeElement.click();

expect(themeSettingsChangeEmitSpy).toHaveBeenCalledWith(
new SkyThemeSettings(
SkyTheme.presets.modern,
SkyThemeMode.presets.dark
)
);
});
});
Loading

0 comments on commit 2c23c47

Please sign in to comment.