Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for actionClick supporting sky-box addins #61

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# 9.3.0 (2024-08-22)
- Added `actionClick` callback to notify box add-in when action has been clicked.

# 9.2.0 (2024-06-20)
- Added `AddinClientConfigService` abstract service to allow additional host origins to be supplied for the `AddinClientService`.

Expand Down
9 changes: 5 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"@angular/platform-browser": "17.3.6",
"@angular/platform-browser-dynamic": "17.3.6",
"@angular/router": "17.3.6",
"@blackbaud/sky-addin-client": "1.3.0",
"@blackbaud/sky-addin-client": "1.4.0",
"@skyux/assets": "10.7.0",
"@skyux/config": "10.7.0",
"@skyux/core": "10.7.0",
Expand Down
4 changes: 2 additions & 2 deletions projects/addin-client/package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "@blackbaud/skyux-lib-addin-client",
"version": "9.2.0",
"version": "9.3.0",
"peerDependencies": {
"@angular/common": "^17.3.6",
"@angular/core": "^17.3.6",
"@skyux/config": "^10.7.0",
"@skyux/theme": "^10.7.0"
},
"dependencies": {
"@blackbaud/sky-addin-client": "^1.3.0",
"@blackbaud/sky-addin-client": "^1.4.0",
"tslib": "^2.6.2"
}
}
14 changes: 13 additions & 1 deletion projects/addin-client/src/src/addin-client.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,18 @@ describe('Addin Client Service', () => {
addinClientArgs.callbacks.init(initArgs);
});

it('service consumer can subscribe to actionClick', (done) => {
let addinClientArgs = (addinClientService.addinClient as any).args;

spyOn(addinClientService.actionClick, 'emit').and.callThrough();

addinClientArgs.callbacks.actionClick();

expect(addinClientService.actionClick.emit).toHaveBeenCalled();

done();
});

it('service consumer can subscribe to buttonClick', (done) => {
let addinClientArgs = (addinClientService.addinClient as any).args;

Expand Down Expand Up @@ -770,7 +782,7 @@ describe('Addin Client Service', () => {
};
}
}

let addinClientService: AddinClientService;
let addinConfigService: AddinClientConfigService;

Expand Down
8 changes: 8 additions & 0 deletions projects/addin-client/src/src/addin-client.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ export class AddinClientService {
public args: Observable<AddinClientInitArgs> = this._args.asObservable();

// Addin Client Events
/**
* Event emitted for box add-ins indicating that a control action button was clicked.
*/
public actionClick: EventEmitter<string> = new EventEmitter(true);

/**
* Event emitted for button add-ins indicating that the button was clicked.
*/
Expand Down Expand Up @@ -96,6 +101,9 @@ export class AddinClientService {
this._args.next(args);
this._args.complete();
},
actionClick: (action: string) => {
this.actionClick.emit(action);
},
buttonClick: () => {
this.buttonClick.emit();
},
Expand Down
Loading