Updates 'spo page set' with isRetired option#7096
Merged
Conversation
e10c1d2 to
4541766
Compare
There was a problem hiding this comment.
Pull request overview
This PR adds a new --isRetired option to the spo page set command to mark SharePoint Online pages as retired (showing a warning banner). Additionally, it includes a bug fix for updating pages with only --content and --publish options, and performance improvements by reducing redundant API calls to getFileAsListItemByUrl.
Key changes:
- Added
isRetiredboolean option to mark/unmark pages as retired using the_SPIsRetiredSharePoint field - Fixed bug where
needsToSavePagelogic didn't include content option, preventing proper updates - Improved performance by using
pageIdfrom checkout instead of making additionalgetFileAsListItemByUrlcalls - Changed
systemUpdateListItemsignature to acceptnumberinstead ofstringforitemIdparameter
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/utils/spo.ts | Changed systemUpdateListItem parameter type from string to number for itemId, removing unnecessary type conversion |
| src/utils/spo.spec.ts | Updated test calls to pass numbers instead of strings to systemUpdateListItem |
| src/m365/spo/commands/page/page-set.ts | Added isRetired option, fixed needsToSavePage to include content, and optimized by removing redundant getFileAsListItemByUrl calls |
| src/m365/spo/commands/page/page-set.spec.ts | Added test for isRetired functionality and updated existing test expectations |
| src/m365/spo/commands/listitem/listitem-set.ts | Updated to convert string ID to number when calling systemUpdateListItem |
| docs/docs/cmd/spo/page/page-set.mdx | Added documentation for isRetired option, permissions section, and minor formatting improvements |
Co-authored-by: Copilot <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #7095
Remarks
--contentand--publishoptions.