Skip to content

Commit 57e2f8a

Browse files
committed
updated readme for webpart sample to inlude testing instructions
1 parent 51fc9ab commit 57e2f8a

File tree

1 file changed

+42
-9
lines changed

1 file changed

+42
-9
lines changed

samples/sp-webpart/README.md

Lines changed: 42 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,59 @@
11
## SharePoint webpart using Microsoft Graph Toolkit components
22

3+
This sample is a React based SharePoint webpart that uses the Microsoft Graph Toolkit.
4+
35
### Building the code
46

57
```bash
68
git clone the repo
79
npm i
810
npm i -g gulp
11+
gulp trust-dev-cert
912
gulp
1013
```
1114

12-
This package produces the following:
15+
### Testing the webpart
16+
17+
Run the webpart bu running:
18+
19+
`gulp serve`
20+
21+
Open the browser to:
22+
23+
`https://<your-tenant>.sharepoint.com/_layouts/15/Workbench.aspx`
24+
25+
The webpart will be available to be added
26+
27+
### Approving permissions
28+
29+
The admin of your tenant will need to approve the graph permissions in the admin portal before you can use any graph APIs. You only need to do these steps once (or if you add additional permissions to `config/package-solution.json`)
30+
31+
1. Package the web part. First run the following commands:
32+
33+
```
34+
gulp build
35+
gulp bundle
36+
gulp package-solution
37+
```
38+
39+
This will create a package under `sharepoint/solution`, with the `.sppkg` extension
40+
41+
2. Upload the package to an app catalog. Navigate to the app catalog url and click on *Distribute apps for SharePoint*. Click on *new* to upload the solution to the app catalog and deploy it.
42+
43+
> If you do not have an app catalog on your tenant, follow [these steps](https://docs.microsoft.com/en-us/sharepoint/use-app-catalog#step-1-create-the-app-catalog-site-collection) to create one.
44+
45+
3. Approve the permissions. Go to the SharePoint admin center (best reached via https://admin.microsoft.com > click **Show All** > SharePoint) and make sure you are signed in as admin.
46+
47+
Under *API Management* you should see the permissions that need to be approved. Approve each one by one.
1348
14-
* lib/* - intermediate-stage commonjs build artifacts
15-
* dist/* - the bundled script, along with other resources
16-
* deploy/* - all resources which should be uploaded to a CDN.
49+
You should now be able to test the webpart
1750
1851
### Build options
1952
2053
gulp trust-dev-cert
2154
22-
gulp clean - TODO
23-
gulp test - TODO
24-
gulp serve - TODO
25-
gulp bundle - TODO
26-
gulp package-solution - TODO
55+
gulp clean
56+
gulp test
57+
gulp serve
58+
gulp bundle
59+
gulp package-solution

0 commit comments

Comments
 (0)