Adds hostProperties option to applicationcustomizer commands. Closes …#7084
Adds hostProperties option to applicationcustomizer commands. Closes …#7084milanholemans merged 3 commits intopnp:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request adds the hostProperties option to all four application customizer commands (add and set variants for both site-level and tenant-level), enabling users to configure host properties for Application Customizers. This addresses issue #6825.
Key Changes
- Added
hostPropertiesoptional parameter to all four application customizer commands - Implemented JSON validation for
hostPropertiesinapplicationcustomizer-add.ts - Added test coverage for the new option across all commands
- Updated documentation to reflect the new parameter and its JSON handling requirements
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/m365/spo/commands/tenant/tenant-applicationcustomizer-add.ts | Adds hostProperties option, telemetry tracking, and sets field value when adding tenant-wide customizers |
| src/m365/spo/commands/tenant/tenant-applicationcustomizer-add.spec.ts | Adds test case verifying hostProperties can be set when adding a tenant-wide customizer |
| src/m365/spo/commands/tenant/tenant-applicationcustomizer-set.ts | Adds hostProperties option, telemetry tracking, validation check, and update logic for tenant-wide customizers |
| src/m365/spo/commands/tenant/tenant-applicationcustomizer-set.spec.ts | Adds test case verifying hostProperties can be updated for existing tenant-wide customizers |
| src/m365/spo/commands/applicationcustomizer/applicationcustomizer-add.ts | Adds hostProperties option with JSON validation, telemetry tracking, and sets field value when adding site-level customizers |
| src/m365/spo/commands/applicationcustomizer/applicationcustomizer-add.spec.ts | Adds test cases for both successful hostProperties usage and validation of invalid JSON input |
| src/m365/spo/commands/applicationcustomizer/applicationcustomizer-set.ts | Adds hostProperties option, telemetry tracking, validation check, and update logic for site-level customizers |
| src/m365/spo/commands/applicationcustomizer/applicationcustomizer-set.spec.ts | Adds test case verifying hostProperties can be updated for existing site-level customizers |
| docs/docs/cmd/spo/tenant/tenant-applicationcustomizer-add.mdx | Documents the new hostProperties option and updates JSON escaping guidance to include it |
| docs/docs/cmd/spo/tenant/tenant-applicationcustomizer-set.mdx | Documents the new hostProperties option with clear/empty string capability and updates remarks for JSON handling |
| docs/docs/cmd/spo/applicationcustomizer/applicationcustomizer-add.mdx | Documents the new hostProperties option and updates JSON escaping guidance to include it |
| docs/docs/cmd/spo/applicationcustomizer/applicationcustomizer-set.mdx | Documents the new hostProperties option with clear/empty string capability and updates remarks for JSON handling |
|
Thanks @Saurabh7019! We'll try to review it soon. |
milanholemans
left a comment
There was a problem hiding this comment.
Nice improvement!
Made a few comments while reviewing.
milanholemans
left a comment
There was a problem hiding this comment.
Apart from two minor comments, looks good!
| requestBody.ClientSideComponentProperties = args.options.clientSideComponentProperties; | ||
| } | ||
|
|
||
| requestBody.HostProperties = args.options.hostProperties || ''; |
There was a problem hiding this comment.
Let's move this to line 130, assigning it directly to the requestBody.
| && opts.data['Name'] === title | ||
| && opts.data['ClientSideComponentProperties'] === undefined) { | ||
| const postStub = sinon.stub(request, 'post').callsFake(async (opts) => { | ||
| if (opts.url === 'https://contoso.sharepoint.com/_api/Web/UserCustomActions') { |
There was a problem hiding this comment.
Much appreciated to update the existing tests as well!
| requestBody.ClientSideComponentProperties = clientSideComponentProperties; | ||
| } | ||
|
|
||
| requestBody.HostProperties = hostProperties; |
There was a problem hiding this comment.
Let's assign it directly to the requestBody on line 160
Closes #6825