Skip to content

Commit

Permalink
Merge branch 'main' into phone-field-standalone
Browse files Browse the repository at this point in the history
  • Loading branch information
Blackbaud-SteveBrush authored Jan 13, 2025
2 parents 75ec0d6 + b06bdcb commit 4b0f76f
Show file tree
Hide file tree
Showing 116 changed files with 2,792 additions and 1,212 deletions.
4 changes: 3 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,7 @@
"prettier.requireConfig": true,
"coverage-gutters.showLineCoverage": true,
"cSpell.enabled": true,
"typescript.tsdk": "node_modules/typescript/lib"
"typescript.tsdk": "node_modules/typescript/lib",
"karmaTestExplorer.enableExtension": false,
"eslint.codeActionsOnSave.rules": ["!@angular-eslint/prefer-standalone", "*"]
}
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,30 @@
# Changelog

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


### Features

* **components/layout:** add harnesses for toolbar ([#3001](https://github.com/blackbaud/skyux/issues/3001)) ([68aee0d](https://github.com/blackbaud/skyux/commit/68aee0d3c9f60b475edf6e6e632bffe0ed0bdc37))


### Bug Fixes

* **components/pages:** hide blocks with hidden `[skyHref]` links ([#3014](https://github.com/blackbaud/skyux/issues/3014)) ([e1bee8b](https://github.com/blackbaud/skyux/commit/e1bee8b4a21f87a323be4c15572ca9011e8a1541))

## [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)


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
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ describe('lists-storybook', () => {
);
});
});
});
}, true);
});
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 4b0f76f

Please sign in to comment.