New answers tagged

0

The problem is I tested my webpart at localhost bench. If I test with https://mysharepoint.sharepoint.com/_layouts/15/workbench.aspx, the API access request will be submitted properly.


0

See the below code, Below code is the private AddContentTypeToList = () => { let ctEndpointUrl = `${this.props.context.pageContext.web.absoluteUrl}/_api/web/lists/getbytitle('${this.props.list}')/ContentTypes/AddAvailableContentType`; let options: ISPHttpClientOptions = { headers: { 'Accept': 'application/json;odata=nometadata', '...


0

I think you are missing the webpart context in your react component. First of all you need to pass the webpart context from your main webpart file to react component like below: public render(): void { const element: React.ReactElement<any > = React.createElement( HelloWorld, { description: this.properties.description, ...


0

Try my test code,this works well in my environment.Remember to change the contentTypeId. update() { const requestHeaders: Headers = new Headers(); requestHeaders.append('Content-type', 'application/json;odata=verbose'); requestHeaders.append('Accept', 'application/json;odata=verbose'); const body: ISPHttpClientOptions = { body: JSON....


0

'CommandUI.Ribbon' user custom action is still supported in SP online. Please take a reference of below doc to get started: CommandUI.Ribbon user custom actions Of course SPFx extension is also a good option. BR


0

As you are using SharePoint Online, I will suggest you to create a ListView Command Set for your document library using SPFx extensions. Check below official documentations for same: Overview of SharePoint Framework Extensions Build your first ListView Command Set extension


1

As Genesh says, for development and local workbench testing no permissions required. The account used for granting the requested permissions will need to be a tenant administrator. The SharePoint administrator permission isn't sufficient as the operation is actually performed on the tenant's associated Azure Active Directory tenant.


1

If you are capable of using SharePoint Framework, here is one SpFx Extension that might be helpful: Banner for Modern Team Site – SpFx Extension. This extension will show up a message on the top of the modern page, which will be retrieved from a separate json file.


0

You could get picture url this way: item.pictureColumnName.Url get date column: item.dateColumnName


1

You could make the site read only while it is being migrated. This will show a banner at the top of the page and will ensure that users cannot make changes while content is being migrated. For more information, see the below article: https://www.sharepointdiary.com/2017/01/sharepoint-online-make-site-collection-read-only.html Alternatively, you could deploy ...


0

Try below code inside forEach: let imageUrl = item.Picture.Url OR let imageUrl = item["Picture"].Url Then pass this image URL inside src attribute of img tag.


1

For development and local workbench testing no permissions required. To deploy SPFx package to App catalog, you should have site collection administrator permissions on App catalog.


0

Check if the request has this problem. You could know how to solve this problem here: https://github.com/SharePoint/PnP-JS-Core/wiki/Using-sp-pnp-js-in-SharePoint-Framework My test code for your reference: import { Version } from '@microsoft/sp-core-library'; import { IPropertyPaneConfiguration, PropertyPaneTextField } from '@microsoft/sp-property-pane';...


0

Some programs need a specific version of node for their work and while you install them, they silently install node of the version they need. To prevent it in the future, I'd recommend using nvm - Node Version Manager. It allows you having multiple versions of node in your computer and switch between them easily. Installing node v.12.14.1: $ nvm install 12....


0

After several days of investigations, finally solved this problem. This issue is always when you setup webpart as domain isolated. If webpart is not domain isolated, everything is ok. Hope someone will help this.


0

This is the work around we did. It sets a Group as the Owner of another group. private SetOwner = (groupId,ownerGroupId) : Promise<SPHttpClientResponse> => { var siteUrl //set this var siteId //set this var endpoint = siteUrl + `/_vti_bin/client.svc/ProcessQuery`; const body = `<...


1

I tested your code in a spfx extension and it works well in IE, the click event get triggered. Test demo: https://github.com/kongmengfei/SharedSPFx/blob/master/app-extension/README.md BR


0

You need to modify the code as below, we are adding slightly modified headers for SPFx as it uses OData v4 behind the scenes: const headers = new Headers(); headers.append("Accept", "application/json;odata.metadata=full"); headers.append("Content-type", "application/json;odata.metadata=full"); const ...


0

You can try using this pnp spfx control. It provides a file picker for the modern UI https://pnp.github.io/sp-dev-fx-controls-react/controls/FilePicker/


0

IE11 doesn't support arrow functions. Use function instead. var settingIcon = document.getElementsByClassName(SETTINGS_ICON)[0]; if (settingIcon != null) { settingIcon.addEventListener("click", function () { alert('Hi'); }); }


3

Try using something like: const dropdownStyles: Partial<IDropdownStyles> = { dropdownItemSelected: { backgroundColor: "red" }, };


0

Figured out how to do. Just have to add a React.createElement() and it renders with a hyperlink. protected getPropertyPaneConfiguration(): IPropertyPaneConfiguration { if(this.properties.listOrDocument==="3"){ this.isList=false; } return { pages: [ { header:{ description:React.createElement(...


0

If you are looking for hosting your client-side web part from Microsoft 365 CDN then check below references: Host your client-side web part from Microsoft 365 CDN SharePoint Framework - Deploy SPFx WebParts To Office 365 Public CDN


2

Resolution You should either fix all warnings or if it's not possible, you can ignore them. For that purpose, you should modify your gulpfile.js. There is one out of the box build suppression method call in gulpfile. You can add your own one using the same build.addSuppression method. The method also accepts regexp, which is very convenient for us. Just add ...


0

You can use @pnp/spfx-property-controls which has PropertyFieldLinkWithCallout control. This control generates a link control with a callout. Example code: Import the following modules to your component: import { CalloutTriggers } from '@pnp/spfx-property-controls/lib/Callout'; import { PropertyFieldLinkWithCallout } from '@pnp/spfx-property-controls/lib/...


2

You can create a .ts file with necessary information and import it anywhere in your web-part project. Reference: AppSettings in your SPFx solutions OR You can create a property pane field to pass the Result Source GUID and use it in your web-part. Reference: Make your SharePoint client-side web part configurable


1

There's a lot of noise in the console from Microsoft's own crap. It's super frustrating and definitely can cause confusion while developing your own stuff. Not sure what they're calling there. Looks like it might be a transparent gif used for tracking, but that is just a guess. Regardless, I don't think it's related to the issue you're seeing. For the icon ...


1

Solution 1: Use Highlighted content web part: You can use Highlighted content web part for such scenarios and query your SharePoint site like ContentClass:"STS_List_DocumentLibrary" to get the list of document libraries in your site. Use the Highlighted content web part Solution 2: Create your own SPFx webpart: You can create a custom SPFx webpart ...


Top 50 recent answers are included