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

New command: spo page default get #6493

Open
milanholemans opened this issue Nov 16, 2024 · 10 comments · May be fixed by #6509
Open

New command: spo page default get #6493

milanholemans opened this issue Nov 16, 2024 · 10 comments · May be fixed by #6509

Comments

@milanholemans
Copy link
Contributor

milanholemans commented Nov 16, 2024

In order to get the home page of a specific site, it would be cool to enhance the command spo page get with following options:

Options

Option Description
--default Get the homepage of a specific web. Specify either name or default, but not both.

Example

m365 spo page get --webUrl https://contoso.sharepoint.com/sites/marketing --default

Additional Info

To get to know which page is the current home page, execute this request:

GET https://contoso.sharepoint.com/sites/Playground/_api/Web/RootFolder?$select=WelcomePage

Thereafter, you should retrieve the site page with a GetFileByServerRelativePath request.

@milanholemans milanholemans added new feature needs peer review Needs second pair of eyes to review the spec or PR good first issue labels Nov 16, 2024
@Jwaegebaert Jwaegebaert added help wanted and removed needs peer review Needs second pair of eyes to review the spec or PR labels Nov 19, 2024
@Saurabh7019
Copy link
Contributor

Assign this to me please.

...with a GetFileByServerRelativePath request.

assuming this command will return detailed information about the home page and not just the relative URL.

@milanholemans
Copy link
Contributor Author

Assign this to me please.

...with a GetFileByServerRelativePath request.

assuming this command will return detailed information about the home page and not just the relative URL.

Yes, the response should look the same as spo page get.

Saurabh7019 added a commit to Saurabh7019/cli-microsoft365 that referenced this issue Nov 29, 2024
@Saurabh7019 Saurabh7019 linked a pull request Nov 29, 2024 that will close this issue
@milanholemans
Copy link
Contributor Author

Instead of creating a new command, I'm wondering if we should just enhance spo page get to align it more with other commands where we return default values.
Examples:

What is your stance on this @pnp/cli-for-microsoft-365-maintainers?

@waldekmastykarz
Copy link
Member

Have we considered the alternative of spo page get --default? Also, since pages are web-scopes artifacts, shouldn't we need web URL rather than site URL?

@milanholemans
Copy link
Contributor Author

Have we considered the alternative of spo page get --default? Also, since pages are web-scopes artifacts, shouldn't we need web URL rather than site URL?

Fair point about the webUrl. About the --default, it's something I could support, but currently for other commands we are providing nothing to retrieve the default value. Shouldn't we be more consistent here? It's something we can always change in a major release.

@Jwaegebaert
Copy link
Contributor

Would it be worth exploring the approach you suggested in #5856? If no name is provided, we can simply return the default page, making name optional. This way, when it's not specified, the default is returned.

@martinlingstuyl
Copy link
Contributor

What's the status here @milanholemans, @Jwaegebaert? @Saurabh7019 has already created a PR for this. Should we just continue as planned or rework the specs and ask Saurabh to rework as well?

@milanholemans
Copy link
Contributor Author

Yeah it's really annoying that we have to revisit the issue when the PR has already been made. What is your opinion @martinlingstuyl? Go for consistency (no options), or use --default?

@martinlingstuyl
Copy link
Contributor

Hmmm, I'd think intentionality is important. So I would vote for --default over all the other ways to do it. I would not want to get a page back where I expected another page, because I forgot something.

@milanholemans
Copy link
Contributor Author

Hi @Saurabh7019, sorry for the super late turnaround, but we decided to take a slightly different route. Instead of creating a new command, we decided to enhance an existing command. Are you willing to implement these changes in the new spec? We totally understand if you want to withdraw from this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants