mirror of
https://github.com/pnp/sp-dev-fx-webparts.git
synced 2025-02-09 14:34:58 +00:00
update to SPFx 1.11.0
This commit is contained in:
parent
b919a0a541
commit
106dca584d
@ -1,89 +1,90 @@
|
|||||||
# SPFx Avatar
|
# SPFx Avatar
|
||||||
|
|
||||||
## Summary
|
## Summary
|
||||||
|
|
||||||
This is a sample web part that helps user create their avatar and save as profile picture. User can even download their avatar as PNG file. This webpart can be useful in Intranet to help user create their avatar and save it as profile picture.
|
This is a sample web part that helps user create their avatar and save as profile picture. User can even download their avatar as PNG file. This webpart can be useful in Intranet to help user create their avatar and save it as profile picture.
|
||||||
|
|
||||||
|
|
||||||
##
|
##
|
||||||
![directory](/samples/react-avatar/assets/reactAvatarOutcome.gif)
|
![directory](/samples/react-avatar/assets/reactAvatarOutcome.gif)
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
* Avatar Generator from multiple options available
|
* Avatar Generator from multiple options available
|
||||||
* Set Avatar as Profile Picture.
|
* Set Avatar as Profile Picture.
|
||||||
* Download Avatar as PNG file.
|
* Download Avatar as PNG file.
|
||||||
|
|
||||||
|
|
||||||
## Used SharePoint Framework Version
|
## Used SharePoint Framework Version
|
||||||
![drop](https://img.shields.io/badge/version-1.10.0-green.svg)
|
![drop](https://img.shields.io/badge/version-1.11.0-green.svg)
|
||||||
|
|
||||||
## Applies to
|
## Applies to
|
||||||
|
|
||||||
* [SharePoint Online](https://docs.microsoft.com/sharepoint/dev/spfx/sharepoint-framework-overview)
|
* [SharePoint Online](https://docs.microsoft.com/sharepoint/dev/spfx/sharepoint-framework-overview)
|
||||||
|
|
||||||
## Prerequisites
|
## Prerequisites
|
||||||
|
|
||||||
* SharePoint Online tenant
|
* SharePoint Online tenant
|
||||||
* You have to provide permission in SharePoint admin for accessing Graph API on behalf of your solution. We can do it before deployment as proactive steps, or after deployment. You can refer to [steps about how to do this post-deployment](https://docs.microsoft.com/en-us/sharepoint/dev/spfx/use-aad-tutorial#deploy-the-solution-and-grant-permissions). You have to use API Access Page of SharePoint admin and add below permission for our use case.
|
* You have to provide permission in SharePoint admin for accessing Graph API on behalf of your solution. We can do it before deployment as proactive steps, or after deployment. You can refer to [steps about how to do this post-deployment](https://docs.microsoft.com/en-us/sharepoint/dev/spfx/use-aad-tutorial#deploy-the-solution-and-grant-permissions). You have to use API Access Page of SharePoint admin and add below permission for our use case.
|
||||||
|
|
||||||
```
|
```
|
||||||
"webApiPermissionRequests": [
|
"webApiPermissionRequests": [
|
||||||
{
|
{
|
||||||
"resource": "Microsoft Graph",
|
"resource": "Microsoft Graph",
|
||||||
"scope": "User.ReadWrite"
|
"scope": "User.ReadWrite"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Concepts
|
## Concepts
|
||||||
|
|
||||||
This Web Part illustrates the following concepts on top of the SharePoint Framework:
|
This Web Part illustrates the following concepts on top of the SharePoint Framework:
|
||||||
|
|
||||||
* Using react framework in SPFx webpart
|
* Using react framework in SPFx webpart
|
||||||
* Calling Graph API my Photo to store the image in SPFx webpart
|
* Calling Graph API my Photo to store the image in SPFx webpart
|
||||||
* Usage of Material UI Tab and Dialog
|
* Usage of Material UI Tab and Dialog
|
||||||
* Usage of [avataaars](https://getavataaars.com/)
|
* Usage of [avataaars](https://getavataaars.com/)
|
||||||
|
|
||||||
|
|
||||||
## WebPart Properties
|
## WebPart Properties
|
||||||
|
|
||||||
Property |Type|Required| comments
|
Property |Type|Required| comments
|
||||||
--------------------|----|--------|----------
|
--------------------|----|--------|----------
|
||||||
Web Part Title | Text| no|
|
Web Part Title | Text| no|
|
||||||
|
|
||||||
|
|
||||||
## Solution
|
## Solution
|
||||||
The web part Use avataaars library for creating avatars and MS Graph with User.ReadWrite and User.ReadWriteAll for saving avatar as current users Profile Picture.FileSaver for downloading avatar image as png file.
|
The web part Use avataaars library for creating avatars and MS Graph with User.ReadWrite and User.ReadWriteAll for saving avatar as current users Profile Picture.FileSaver for downloading avatar image as png file.
|
||||||
|
|
||||||
Solution|Author(s)
|
Solution|Author(s)
|
||||||
--------|---------
|
--------|---------
|
||||||
react Avatar|Kunj Sangani
|
react Avatar|Kunj Sangani
|
||||||
|
|
||||||
## Version history
|
## Version history
|
||||||
|
|
||||||
Version|Date|Comments
|
Version|Date|Comments
|
||||||
-------|----|--------
|
-------|----|--------
|
||||||
1.0.0|August 1, 2020|Initial release
|
1.0.0|August 1, 2020|Initial release
|
||||||
|
1.0.1|October 20, 2020|Update to SPFx 1.11.0
|
||||||
|
|
||||||
## Disclaimer
|
|
||||||
**THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.**
|
## Disclaimer
|
||||||
|
**THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.**
|
||||||
---
|
|
||||||
|
---
|
||||||
## Minimal Path to Awesome
|
|
||||||
|
## Minimal Path to Awesome
|
||||||
- Clone this repository
|
|
||||||
- in the command line run:
|
- Clone this repository
|
||||||
- `npm install`
|
- in the command line run:
|
||||||
- `gulp build`
|
- `npm install`
|
||||||
- `gulp bundle --ship`
|
- `gulp build`
|
||||||
- `gulp package-solution --ship`
|
- `gulp bundle --ship`
|
||||||
- `Add to AppCatalog and deploy`
|
- `gulp package-solution --ship`
|
||||||
|
- `Add to AppCatalog and deploy`
|
||||||
<img src="https://telemetry.sharepointpnp.com/sp-dev-fx-webparts/samples/react-avatar" />
|
|
||||||
|
<img src="https://telemetry.sharepointpnp.com/sp-dev-fx-webparts/samples/react-avatar" />
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
"solution": {
|
"solution": {
|
||||||
"name": "react-avatars-client-side-solution",
|
"name": "react-avatars-client-side-solution",
|
||||||
"id": "b96dfed7-ec48-4082-ba50-f6c7b09143c7",
|
"id": "b96dfed7-ec48-4082-ba50-f6c7b09143c7",
|
||||||
"version": "1.0.0.0",
|
"version": "1.0.1.0",
|
||||||
"includeClientSideAssets": true,
|
"includeClientSideAssets": true,
|
||||||
"isDomainIsolated": false,
|
"isDomainIsolated": false,
|
||||||
"webApiPermissionRequests": [
|
"webApiPermissionRequests": [
|
||||||
@ -11,9 +11,16 @@
|
|||||||
"resource": "Microsoft Graph",
|
"resource": "Microsoft Graph",
|
||||||
"scope": "User.ReadWrite"
|
"scope": "User.ReadWrite"
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
"developer": {
|
||||||
|
"name": "Contoso",
|
||||||
|
"privacyUrl": "https://contoso.com/privacy",
|
||||||
|
"termsOfUseUrl": "https://contoso.com/terms-of-use",
|
||||||
|
"websiteUrl": "https://contoso.com/my-app",
|
||||||
|
"mpnId": "000000"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"paths": {
|
"paths": {
|
||||||
"zippedPackage": "solution/react-avatars.sppkg"
|
"zippedPackage": "solution/react-avatars.sppkg"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
2634
samples/react-avatar/package-lock.json
generated
2634
samples/react-avatar/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -13,18 +13,14 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@material-ui/core": "^4.11.0",
|
"@material-ui/core": "^4.11.0",
|
||||||
"@microsoft/sp-core-library": "1.10.0",
|
"@microsoft/sp-core-library": "1.11.0",
|
||||||
"@microsoft/sp-lodash-subset": "1.10.0",
|
"@microsoft/sp-lodash-subset": "1.11.0",
|
||||||
"@microsoft/sp-office-ui-fabric-core": "1.10.0",
|
"@microsoft/sp-office-ui-fabric-core": "1.11.0",
|
||||||
"@microsoft/sp-property-pane": "1.10.0",
|
"@microsoft/sp-property-pane": "1.11.0",
|
||||||
"@microsoft/sp-webpart-base": "1.10.0",
|
"@microsoft/sp-webpart-base": "1.11.0",
|
||||||
"@types/es6-promise": "0.0.33",
|
|
||||||
"@types/react": "16.8.8",
|
|
||||||
"@types/react-dom": "16.8.3",
|
|
||||||
"@types/webpack-env": "1.13.1",
|
|
||||||
"avataaars": "^1.2.1",
|
"avataaars": "^1.2.1",
|
||||||
"file-saver": "^2.0.2",
|
"file-saver": "^2.0.2",
|
||||||
"office-ui-fabric-react": "6.189.2",
|
"office-ui-fabric-react": "6.214.0",
|
||||||
"react": "16.8.5",
|
"react": "16.8.5",
|
||||||
"react-dom": "16.8.5"
|
"react-dom": "16.8.5"
|
||||||
},
|
},
|
||||||
@ -32,14 +28,14 @@
|
|||||||
"@types/react": "16.8.8"
|
"@types/react": "16.8.8"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@microsoft/sp-build-web": "1.10.0",
|
|
||||||
"@microsoft/sp-tslint-rules": "1.10.0",
|
|
||||||
"@microsoft/sp-module-interfaces": "1.10.0",
|
|
||||||
"@microsoft/sp-webpart-workbench": "1.10.0",
|
|
||||||
"@microsoft/rush-stack-compiler-3.3": "0.3.5",
|
"@microsoft/rush-stack-compiler-3.3": "0.3.5",
|
||||||
"gulp": "~3.9.1",
|
"@microsoft/sp-build-web": "1.11.0",
|
||||||
|
"@microsoft/sp-module-interfaces": "1.11.0",
|
||||||
|
"@microsoft/sp-tslint-rules": "1.11.0",
|
||||||
|
"@microsoft/sp-webpart-workbench": "1.11.0",
|
||||||
"@types/chai": "3.4.34",
|
"@types/chai": "3.4.34",
|
||||||
"@types/mocha": "2.2.38",
|
"@types/mocha": "2.2.38",
|
||||||
"ajv": "~5.2.2"
|
"ajv": "~5.2.2",
|
||||||
|
"gulp": "~3.9.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,38 +1,39 @@
|
|||||||
{
|
{
|
||||||
"extends": "./node_modules/@microsoft/rush-stack-compiler-3.3/includes/tsconfig-web.json",
|
"extends": "./node_modules/@microsoft/rush-stack-compiler-3.3/includes/tsconfig-web.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"target": "es5",
|
"target": "es5",
|
||||||
"forceConsistentCasingInFileNames": true,
|
"forceConsistentCasingInFileNames": true,
|
||||||
"module": "esnext",
|
"module": "esnext",
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "node",
|
||||||
"jsx": "react",
|
"jsx": "react",
|
||||||
"declaration": true,
|
"declaration": true,
|
||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
"experimentalDecorators": true,
|
"experimentalDecorators": true,
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
"outDir": "lib",
|
"outDir": "lib",
|
||||||
"inlineSources": false,
|
"inlineSources": false,
|
||||||
"strictNullChecks": false,
|
"strictNullChecks": false,
|
||||||
"noUnusedLocals": false,
|
"noUnusedLocals": false,
|
||||||
"typeRoots": [
|
"typeRoots": [
|
||||||
"./node_modules/@types",
|
"./node_modules/@types",
|
||||||
"./node_modules/@microsoft"
|
"./node_modules/@microsoft"
|
||||||
],
|
],
|
||||||
"types": [
|
"types": [
|
||||||
"es6-promise",
|
"es6-promise",
|
||||||
"webpack-env"
|
"webpack-env"
|
||||||
],
|
],
|
||||||
"lib": [
|
"lib": [
|
||||||
"es5",
|
"es5",
|
||||||
"dom",
|
"dom",
|
||||||
"es2015.collection"
|
"es2015.collection"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"include": [
|
"include": [
|
||||||
"src/**/*.ts"
|
"src/**/*.ts",
|
||||||
],
|
"src/**/*.tsx"
|
||||||
"exclude": [
|
],
|
||||||
"node_modules",
|
"exclude": [
|
||||||
"lib"
|
"node_modules",
|
||||||
]
|
"lib"
|
||||||
}
|
]
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user