-
Notifications
You must be signed in to change notification settings - Fork 285
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updated readme for webpart sample to inlude testing instructions
- Loading branch information
Showing
1 changed file
with
42 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,59 @@ | ||
## SharePoint webpart using Microsoft Graph Toolkit components | ||
|
||
This sample is a React based SharePoint webpart that uses the Microsoft Graph Toolkit. | ||
|
||
### Building the code | ||
|
||
```bash | ||
git clone the repo | ||
npm i | ||
npm i -g gulp | ||
gulp trust-dev-cert | ||
gulp | ||
``` | ||
|
||
This package produces the following: | ||
### Testing the webpart | ||
|
||
Run the webpart bu running: | ||
|
||
`gulp serve` | ||
|
||
Open the browser to: | ||
|
||
`https://<your-tenant>.sharepoint.com/_layouts/15/Workbench.aspx` | ||
|
||
The webpart will be available to be added | ||
|
||
### Approving permissions | ||
|
||
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`) | ||
|
||
1. Package the web part. First run the following commands: | ||
|
||
``` | ||
gulp build | ||
gulp bundle | ||
gulp package-solution | ||
``` | ||
|
||
This will create a package under `sharepoint/solution`, with the `.sppkg` extension | ||
|
||
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. | ||
|
||
> 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. | ||
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. | ||
|
||
Under *API Management* you should see the permissions that need to be approved. Approve each one by one. | ||
|
||
* lib/* - intermediate-stage commonjs build artifacts | ||
* dist/* - the bundled script, along with other resources | ||
* deploy/* - all resources which should be uploaded to a CDN. | ||
You should now be able to test the webpart | ||
|
||
### Build options | ||
|
||
gulp trust-dev-cert | ||
|
||
gulp clean - TODO | ||
gulp test - TODO | ||
gulp serve - TODO | ||
gulp bundle - TODO | ||
gulp package-solution - TODO | ||
gulp clean | ||
gulp test | ||
gulp serve | ||
gulp bundle | ||
gulp package-solution |