Is it possible to deactivate/remove/uninstall a default client side webpart?
-
01-01-2021 - |
Solution
I dont think so there is any way to remove those OOTB shipped client side web parts. But as a workaround you can inject custom CSS to your page using SPFx Extensions - Application Customizer (still in preview so workaround doesnt apply to production tenant) to hide the element from the page.
The yammer webpart render as button having following code. Use the css selector to hide it.
<button class="CanvasToolboxItem CanvasToolboxItemFloat" title="Display Yammer conversations." data-automation-id="YammerEmbedWebPartToolboxItem" tabindex="0" style="">
<i role="presentation" aria-hidden="true" data-icon-name="YammerLogo" class="ms-Icon css-liugll CanvasToolboxItem-icon"></i>
<div data-automation-id="less-text" title="Yammer feed" class="CanvasToolboxItem-title">Yammer feed</div>
</button>
OTHER TIPS
There is a powershell command to disable web parts that don't connect to Microsoft services, but are shipped by Microsoft.
You'll use Set-SPOTenant with the parameter
DisabledWebpartIds <GUID>
See the documentation here: Set-SPOTenant documentation
Allows administrators prevent certain, specific web parts from being added to pages or rendering on pages on which they were previously added. Currently, only Amazon Kindle, YouTube and Twitter web parts can be disabled in such a manner.
To disable a specific web part you need to enter its GUID as the parameter:
- Amazon Kindle (46698648-fcd5-41fc-9526-c7f7b2ace919)
- YouTube (544dd15b-cf3c-441b-96da-004d5a8cea1d)
- Twitter (f6fdf4f8-4a24-437b-a127-32e66a5dd9b4).
Specifying the Client-Side Web Part icon using a font icon Another way to set the icon of a Client-Side Web Part is by specifying the name of the font icon using the officeFabricIconFontName. Example this code "Sunny", make a filter for the necessary widgets code:
{
"$schema": "../../../node_modules/@microsoft/sp-module-interfaces/lib/manifestSchemas/jsonSchemas/clientSideComponentManifestSchema.json",
"id": "e71c23c5-4ddb-40b6-9e52-d292a4d8300b",
"componentType": "WebPart",
"version": "0.0.1",
"manifestVersion": 2,
"preconfiguredEntries": [{
"groupId": "e71c23c5-4ddb-40b6-9e52-d292a4d8300b",
"group": { "default": "Default" },
"title": { "default": "Weather" },
"description": { "default": "Shows weather in the given location" },
"officeFabricIconFontName": "Sunny",
"properties": {
"location": ""
}
}]
}
Despite its name, the officeFabricIconFontName property doesn't support all icons listed at Office UI Fabric. Here is the list of all icons that you can use with the officeFabricIconFontName property.