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 applicationcustomizer get #4244

Closed
Tracked by #4219
martinlingstuyl opened this issue Dec 17, 2022 · 7 comments
Closed
Tracked by #4219

New command: spo applicationcustomizer get #4244

martinlingstuyl opened this issue Dec 17, 2022 · 7 comments

Comments

@martinlingstuyl
Copy link
Contributor

martinlingstuyl commented Dec 17, 2022

Usage

spo applicationcustomizer get

Description

Get an application customizer that is added to a site.

Options

Option Description
-u, --webUrl <webUrl> The url of the site.
-t, --title [title] The title of the Application Customizer. Specify either title, id or clientSideComponentId.
-i, --id [id] The id of the Application Customizer. Specify either title, id or clientSideComponentId.
-c, --clientSideComponentId [clientSideComponentId] The Client Side Component Id (GUID) of the application customizer. Specify either title, id or clientSideComponentId.
-s, --scope [scope] Scope of the application customizer. Allowed values: Site, Web, All. Defaults to All.

Examples

Retrieves an application customizer by title.

m365 spo applicationcustomizer get --title "Some customizer" --webUrl https://contoso.sharepoint.com/sites/sales

Retrieves an application customizer by id.

m365 spo applicationcustomizer get --id 14125658-a9bc-4ddf-9c75-1b5767c9a337 --webUrl https://contoso.sharepoint.com/sites/sales

Retrieves an application customizer by clientSideComponentId.

m365 spo applicationcustomizer get --clientSideComponentId 7096cded-b83d-4eab-96f0-df477ed7c0bc --webUrl https://contoso.sharepoint.com/sites/sales

Additional Info

While developing we want to reuse the getCustomActions and getCustomActionById functions of the spo util class.

  • If the found custom action is not an Application Customizer: throw an error.
  • If two or more Application Customizer custom actions are found: prompt the user to disambiguate.

We can use the shared code to only query the right type of customaction with a location value of ClientSideExtension.ApplicationCustomizer.

@waldekmastykarz
Copy link
Member

We should extend the spec with the logic to determine that the retrieved custom action actually represents an app customizer rather than something else.

@waldekmastykarz waldekmastykarz added needs design and removed needs peer review Needs second pair of eyes to review the spec or PR labels Dec 20, 2022
@martinlingstuyl martinlingstuyl added on hold good first issue needs peer review Needs second pair of eyes to review the spec or PR and removed needs design labels Jan 10, 2023
@martinlingstuyl martinlingstuyl changed the title New command: spo web applicationcustomizer get New command: spo applicationcustomizer get Jan 11, 2023
@martinlingstuyl martinlingstuyl added help wanted and removed needs peer review Needs second pair of eyes to review the spec or PR on hold labels Feb 21, 2023
@nanddeepn
Copy link
Contributor

Can I work on this?

@milanholemans
Copy link
Contributor

Yes please!

@nanddeepn
Copy link
Contributor

Hi @martinlingstuyl
The filter with clientSideComponentId does not seem to work.

For e.g. below request does not return the expected result.
https://contoso.sharepoint.com/sites/spdemo/_api/Web/UserCustomActions?$filter=ClientSideComponentId eq '27799883f5-7962-4384-a10a-105adaec6ffc'

Please correct, if I misunderstood the spec.

@martinlingstuyl
Copy link
Contributor Author

Hi @nanddeepn, because the value is a guid, you need to compare with a guid value. Try prefixing the word 'guid':

https://contoso.sharepoint.com/sites/spdemo/_api/Web/UserCustomActions?$filter=ClientSideComponentId eq guid'27799883f5-7962-4384-a10a-105adaec6ffc'

@nanddeepn
Copy link
Contributor

Thanks @martinlingstuyl
Oops! My bad. Missing the guid part. Thanks for correcting 😊

@martinlingstuyl
Copy link
Contributor Author

It's easy to miss :)

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