Skip to content

Commit

Permalink
Merge branch 'main' into add-disabled-vertical-tab-to-playground
Browse files Browse the repository at this point in the history
  • Loading branch information
Blackbaud-TrevorBurch authored Jan 10, 2025
2 parents b03f313 + 8efaa5e commit 16b1306
Show file tree
Hide file tree
Showing 44 changed files with 1,165 additions and 231 deletions.
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
# Changelog

## [11.33.0](https://github.com/blackbaud/skyux/compare/11.32.0...11.33.0) (2025-01-10)


### Features

* **components/pages:** create testing harness for action hub ([#2962](https://github.com/blackbaud/skyux/issues/2962)) ([736e0a3](https://github.com/blackbaud/skyux/commit/736e0a30bf2f511fda4e3467e6186e1984c41997))
* update `@skyux/icons` to 7.10.0 ([#3008](https://github.com/blackbaud/skyux/issues/3008)) ([fc355a3](https://github.com/blackbaud/skyux/commit/fc355a3aa3be7669b33826a591b5914ddc8eb98c))


### Bug Fixes

* **components/ag-grid:** handle focus for adjacent editor cells ([#2993](https://github.com/blackbaud/skyux/issues/2993)) ([c5d3171](https://github.com/blackbaud/skyux/commit/c5d31714fb40a6c55e46f79aa267f172f5d743a6))

## [11.32.0](https://github.com/blackbaud/skyux/compare/11.31.0...11.32.0) (2025-01-08)


### Features

* **components/forms:** add method to `SkyFormErrorHarness` to get error text ([#2992](https://github.com/blackbaud/skyux/issues/2992)) ([#2994](https://github.com/blackbaud/skyux/issues/2994)) ([65aa2e8](https://github.com/blackbaud/skyux/commit/65aa2e8eda1d5f58d6156080f5c46dddeb8a19db))
* **components/layout:** tokenize toolbar component ([#2980](https://github.com/blackbaud/skyux/issues/2980)) ([3c04ba0](https://github.com/blackbaud/skyux/commit/3c04ba0e105c6c50f917b85746efee7fab9e5e21))

## [10.44.3](https://github.com/blackbaud/skyux/compare/10.44.2...10.44.3) (2025-01-08)


Expand Down
3 changes: 2 additions & 1 deletion apps/code-examples/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@
],
"styles": [
"libs/components/theme/src/lib/styles/sky.scss",
"libs/components/theme/src/lib/styles/themes/modern/styles.scss"
"libs/components/theme/src/lib/styles/themes/modern/styles.scss",
"libs/components/ag-grid/src/lib/styles/ag-grid-styles.scss"
],
"scripts": [],
"assets": [],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<sky-action-hub
data-sky-id="action-hub"
[needsAttention]="needsAttention"
[recentLinks]="recentLinks"
[relatedLinks]="relatedLinks"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
import { HarnessLoader } from '@angular/cdk/testing';
import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
import { ApplicationRef } from '@angular/core';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import {
SkyModalTestingController,
SkyModalTestingModule,
} from '@skyux/modals/testing';
import { SkyActionHubHarness } from '@skyux/pages/testing';

import { DemoComponent } from './demo.component';
import { SettingsModalComponent } from './settings-modal.component';

describe('Action hub', () => {
async function setupTest(): Promise<{
actionHubHarness: SkyActionHubHarness;
fixture: ComponentFixture<DemoComponent>;
loader: HarnessLoader;
}> {
const fixture = TestBed.createComponent(DemoComponent);
const loader = TestbedHarnessEnvironment.loader(fixture);
const actionHubHarness = await loader.getHarness(
SkyActionHubHarness.with({
dataSkyId: 'action-hub',
}),
);

return { actionHubHarness, fixture, loader };
}

beforeEach(() => {
TestBed.configureTestingModule({
imports: [DemoComponent, SkyModalTestingModule],
});
});

it('should have correct page title', async () => {
const { actionHubHarness } = await setupTest();

expect(await actionHubHarness.getTitle()).toBe('Active accounts');
});

it('should show needs-attention items', async () => {
const { actionHubHarness } = await setupTest();

expect(
await actionHubHarness
.getNeedsAttentionItems()
.then(
async (items) =>
await Promise.all(items.map((item) => item.getText())),
),
).toEqual([
'9 updates from portal',
'8 new messages from online donation',
'7 possible duplicates from constituent lists',
'6 updates from portal',
'5 new messages from online donation',
'4 possible duplicates from constituent lists',
'3 update from portal',
'2 new messages from online donation',
'1 possible duplicate from constituent lists',
]);
});

it('should show recent links', async () => {
const { actionHubHarness } = await setupTest();

const linkListHarness = await actionHubHarness.getRecentLinks();
const listItems = await linkListHarness.getListItems();
expect(await Promise.all(listItems.map((item) => item.getText()))).toEqual([
'Recent 1',
'Recent 2',
'Recent 3',
'Recent 4',
'Recent 5',
]);
});

it('should show related links', async () => {
const { actionHubHarness } = await setupTest();

const linkListHarness = await actionHubHarness.getRelatedLinks();
const listItems = await linkListHarness.getListItems();
expect(await Promise.all(listItems.map((item) => item.getText()))).toEqual([
'Link 1',
'Link 2',
'Link 3',
]);
});

it('should show settings links', async () => {
const { actionHubHarness } = await setupTest();

const linkListHarness = await actionHubHarness.getSettingsLinks();
const listItems = await linkListHarness.getListItems();
expect(await Promise.all(listItems.map((item) => item.getText()))).toEqual([
'Number',
'Color',
]);
const modalController = TestBed.inject(SkyModalTestingController);
modalController.expectNone();
await listItems[0].click();
const app = TestBed.inject(ApplicationRef);
app.tick();
await app.whenStable();
modalController.expectCount(1);
modalController.expectOpen(SettingsModalComponent);
});
});
Original file line number Diff line number Diff line change
@@ -1,49 +1,41 @@
<sky-modal [headingText]="title">
<sky-modal-content>
<form [formGroup]="formGroup" (submit)="modalInstance.save()">
<form [formGroup]="formGroup" (submit)="modalInstance.save()">
<sky-modal data-sky-id="settings-modal" [headingText]="title">
<sky-modal-content>
@for (field of fields; track field) {
<ng-container class="row">
@switch (title) {
@case ('Color') {
<div class="sky-margin-stacked-sm">
<label class="sky-control-label" [for]="input.id">{{
field
}}</label>
<sky-colorpicker #colorPicker>
<input
#input="skyId"
skyId
type="text"
[formControlName]="field"
[skyColorpickerInput]="colorPicker"
/>
</sky-colorpicker>
</div>
<sky-colorpicker #colorPicker stacked [labelText]="field">
<input
type="text"
[formControlName]="field"
[skyColorpickerInput]="colorPicker"
/>
</sky-colorpicker>
}
@default {
<sky-input-box [labelText]="field">
<sky-input-box stacked [labelText]="field">
<input type="text" [formControlName]="field" />
</sky-input-box>
}
}
</ng-container>
}
</form>
</sky-modal-content>
<sky-modal-footer>
<button
class="sky-btn sky-btn-primary sky-margin-inline-sm"
type="button"
(click)="modalInstance.save()"
>
Save
</button>
<button
class="sky-btn sky-btn-link"
type="button"
(click)="modalInstance.close()"
>
Close
</button>
</sky-modal-footer>
</sky-modal>
</sky-modal-content>
<sky-modal-footer>
<button
class="sky-btn sky-btn-primary sky-margin-inline-sm"
type="submit"
>
Save
</button>
<button
class="sky-btn sky-btn-link"
type="button"
(click)="modalInstance.close()"
>
Close
</button>
</sky-modal-footer>
</sky-modal>
</form>
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
import { HarnessLoader } from '@angular/cdk/testing';
import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
import { SkyModalHarness } from '@skyux/modals/testing';
import { SkyActionHubHarness } from '@skyux/pages/testing';

import { DemoComponent } from './demo.component';
import { MODAL_TITLE } from './modal-title-token';

describe('SettingsModalComponent', () => {
async function setupTest(): Promise<{
actionHubHarness: SkyActionHubHarness;
fixture: ComponentFixture<DemoComponent>;
loader: HarnessLoader;
rootLoader: HarnessLoader;
}> {
const fixture = TestBed.createComponent(DemoComponent);
const loader = TestbedHarnessEnvironment.loader(fixture);
const rootLoader = TestbedHarnessEnvironment.documentRootLoader(fixture);
const actionHubHarness = await loader.getHarness(
SkyActionHubHarness.with({
dataSkyId: 'action-hub',
}),
);

return { actionHubHarness, rootLoader, fixture, loader };
}

beforeEach(() => {
TestBed.configureTestingModule({
imports: [DemoComponent, NoopAnimationsModule],
providers: [
{
provide: MODAL_TITLE,
useValue: 'Settings Modal Test',
},
],
});
});

it('should show settings modal', async () => {
const { actionHubHarness, rootLoader } = await setupTest();
const settingsLinksHarness = await actionHubHarness.getSettingsLinks();
const settingsLinks = await settingsLinksHarness.getListItems();
expect(settingsLinks).toHaveSize(2);
await settingsLinks[1].click();
const modalHarness = await rootLoader.getHarness(
SkyModalHarness.with({
dataSkyId: 'settings-modal',
}),
);
expect(await modalHarness.getHeadingText()).toBe('Color');
const consoleSpy = spyOn(console, 'log').and.stub();
const modalElement = TestbedHarnessEnvironment.getNativeElement(
await modalHarness.host(),
);
const submit = modalElement.querySelector('button[type="submit"]');
expect(submit).toBeTruthy();
expect(submit?.textContent?.trim()).toBe('Save');
(submit as HTMLButtonElement).click();
expect(consoleSpy).toHaveBeenCalledWith({
'Color 1': '',
'Color 2': '',
'Color 3': '',
'Color 4': '',
'Color 5': '',
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
ReactiveFormsModule,
} from '@angular/forms';
import { SkyColorpickerModule } from '@skyux/colorpicker';
import { SkyIdModule } from '@skyux/core';
import { SkyInputBoxModule } from '@skyux/forms';
import { SkyModalInstance, SkyModalModule } from '@skyux/modals';

Expand All @@ -20,7 +19,6 @@ import { MODAL_TITLE } from './modal-title-token';
FormsModule,
ReactiveFormsModule,
SkyColorpickerModule,
SkyIdModule,
SkyInputBoxModule,
SkyModalModule,
],
Expand Down
30 changes: 29 additions & 1 deletion apps/e2e/lists-storybook/src/app/filter/filter.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,20 @@ <h2>Filter button</h2>
[showButtonText]="false"
(filterButtonClick)="filtersActive = !filtersActive"
/>
{{ ' ' }}
<sky-filter-button
[active]="filtersActive"
[disabled]="true"
[showButtonText]="false"
(filterButtonClick)="filtersActive = !filtersActive"
/>
{{ ' ' }}
<sky-filter-button
[active]="!filtersActive"
[disabled]="true"
[showButtonText]="false"
(filterButtonClick)="filtersActive = !filtersActive"
/>
</div>

<h2>Filter button with text</h2>
Expand All @@ -29,6 +43,20 @@ <h2>Filter button with text</h2>
[showButtonText]="true"
(filterButtonClick)="filtersActive = !filtersActive"
/>
{{ ' ' }}
<sky-filter-button
[active]="filtersActive"
[disabled]="true"
[showButtonText]="true"
(filterButtonClick)="filtersActive = !filtersActive"
/>
{{ ' ' }}
<sky-filter-button
[active]="!filtersActive"
[disabled]="true"
[showButtonText]="true"
(filterButtonClick)="filtersActive = !filtersActive"
/>
</div>

<h2>Filter summary</h2>
Expand Down Expand Up @@ -61,7 +89,7 @@ <h2>Inline filter</h2>
<div class="app-screenshot" id="screenshot-filter-inline">
<sky-filter-inline>
<sky-filter-inline-item>
<sky-input-box stacked="true" labelText="Fruit type">
<sky-input-box labelText="Fruit type">
<select>
<option value="any">Any fruit</option>
<option value="citrus">Citrus</option>
Expand Down
Loading

0 comments on commit 16b1306

Please sign in to comment.