mirror of
https://github.com/pnp/sp-dev-fx-webparts.git
synced 2025-03-06 11:49:23 +00:00
Updated readme and sample.json
This commit is contained in:
parent
cfac4f2c8a
commit
6501721124
@ -20,6 +20,7 @@ This version works only for SharePoint Online. If you want a version for Sharepo
|
||||
**It's important you read and understand the notes on [deployment](#deploy-to-non-script-sites--modern-team-sites).**
|
||||
|
||||
## Summary
|
||||
|
||||
Coming from old classic SharePoint pages you might have existing script solutions you want to re-use on a modern page
|
||||
without having to repackage it as a new SharePoint Framework web part. This web part is similar to the classic
|
||||
Script Editor Web Part, and allows you do drop arbitrary script or html on a modern page.
|
||||
@ -72,6 +73,7 @@ If all you want is to add markup on the page, you can do that as well. Adding th
|
||||
```
|
||||
|
||||
You may add CSS via style tags or `link` tags.
|
||||
|
||||
```html
|
||||
<!-- Latest compiled and minified CSS -->
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
|
||||
@ -95,9 +97,11 @@ You may add CSS via style tags or `link` tags.
|
||||
```
|
||||
|
||||
## Support for Office UI Fabric styles
|
||||
|
||||
By adding the class name `ms-Fabric` to your top element, you can use use fabric CSS classes directly in the web part. See [Fabric Core](https://developer.microsoft.com/en-us/fabric#/get-started/web#fabric-core) for more information on Fabric classes.
|
||||
|
||||
**Sample**
|
||||
### Sample
|
||||
|
||||
```html
|
||||
<div class="ms-Fabric">
|
||||
<span class="ms-font-su ms-fontColor-themePrimary">
|
||||
@ -107,16 +111,19 @@ By adding the class name `ms-Fabric` to your top element, you can use use fabric
|
||||
```
|
||||
|
||||
## Support for classic _spPageContextInfo
|
||||
If your scripts rely on the classic _spPageContextInfo, you can enable that in the web part property pane.
|
||||
|
||||
If your scripts rely on the classic_spPageContextInfo, you can enable that in the web part property pane.
|
||||
|
||||
## Support for Teams tabs
|
||||
|
||||
If you want to use the solution as a Teams tab, perform the changes to deploy to [non-script](#deploy-to-non-script-sites--modern-team-sites) sites and [tenant wide deployment](#deploy-tenant-wide).
|
||||
|
||||
Next see the [Teams tab tutorial](https://docs.microsoft.com/en-us/sharepoint/dev/spfx/web-parts/get-started/using-web-part-as-ms-teams-tab) for steps needed to deploy the solution as a Teams tab.
|
||||
|
||||
You can get access to the Teams context information via the global variable `_teamsContexInfo`. The available properties are documented at [Teams context interface](https://docs.microsoft.com/en-us/javascript/api/@microsoft/teams-js/microsoftteams.context?view=msteams-client-js-latest).
|
||||
|
||||
**Sample**
|
||||
### Sample
|
||||
|
||||
```html
|
||||
<div class="ms-Fabric">
|
||||
<span id="ScriptIt" class="ms-font-xxl ms-fontColor-neutralPrimary">
|
||||
@ -132,29 +139,33 @@ element.innerHTML = "Team: " + _teamsContexInfo.teamName + "<br\>Channel: " + _t
|
||||

|
||||
|
||||
### Deploy to non-script sites / modern team sites
|
||||
|
||||
By default this web part is not allowed on no-script sites, as it allows execution of arbitrary script. This is by design as from a security and governance perspective you might not want arbitrary script added to your pages. This is typically something you want control over.
|
||||
|
||||
If you however want to allow the web part for non-script sites like Office 365 Group modern team sites you have to edit `ScriptEditorWebPart.manifest.json` with the following change:
|
||||
|
||||
```
|
||||
"requiresCustomScript": false
|
||||
```
|
||||
|
||||
### Deploy tenant wide
|
||||
|
||||
By default you have to install this web part per site collection where you want it available. If you want it enabled by default on all sites you have to edit `package-solution.json` with the following change:
|
||||
|
||||
```
|
||||
"skipFeatureDeployment": true
|
||||
```
|
||||
|
||||
In order to make it available to absolutely all sites you need apply the _Deploy to non-script sites / modern team site_ change as well.
|
||||
In order to make it available to absolutely all sites you need apply the *Deploy to non-script sites / modern team site* change as well.
|
||||
|
||||
## Compatibility
|
||||
|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||
-Incompatible-red.svg "SharePoint Server 2016 Feature Pack 2 requires SPFx 1.1")
|
||||

|
||||

|
||||

|
||||

|
||||
|
||||
@ -168,6 +179,8 @@ In order to make it available to absolutely all sites you need apply the _Deploy
|
||||
Solution|Author(s)
|
||||
--------|---------
|
||||
react-script-editor | [Mikael Svenson](https://github.com/wobba) ([@mikaelsvenson](http://www.twitter.com/mikaelsvenson), [techmikael.com](techmikael.com))
|
||||
react-script-editor | [Felix Bohnacker](https://github.com/felixbohnackerfelixbohnacker)
|
||||
|
||||
|
||||
## Version history
|
||||
|
||||
@ -194,27 +207,30 @@ Version|Date|Comments
|
||||
1.0.18.0|June 14, 2022|Upgrade to SPFx v1.13.1
|
||||
|
||||
## Minimal Path to Awesome
|
||||
|
||||
### Local testing
|
||||
|
||||
- Clone this repository
|
||||
- In the command line run:
|
||||
- `npm install`
|
||||
- `gulp serve`
|
||||
* Clone this repository
|
||||
* In the command line run:
|
||||
* `npm install`
|
||||
* `gulp serve`
|
||||
|
||||
### Deploy
|
||||
|
||||
* `gulp clean`
|
||||
* `gulp bundle --ship`
|
||||
* `gulp package-solution --ship`
|
||||
* Upload `.sppkg` file from `sharepoint\solution` to your tenant App Catalog
|
||||
* E.g.: https://<tenant>.sharepoint.com/sites/AppCatalog/AppCatalog
|
||||
* E.g.: https://<tenant>.sharepoint.com/sites/AppCatalog/AppCatalog
|
||||
* Add the web part to a site collection, and test it on a page
|
||||
|
||||
## Features
|
||||
|
||||
This web part illustrates the following concepts on top of the SharePoint Framework:
|
||||
|
||||
- Re-use existing JavaScript solutions on a modern page
|
||||
- Office UI Fabric
|
||||
- React
|
||||
|
||||
* Re-use existing JavaScript solutions on a modern page
|
||||
* Office UI Fabric
|
||||
* React
|
||||
|
||||
## Help
|
||||
|
||||
@ -236,5 +252,4 @@ Finally, if you have an idea for improvement, [make a suggestion](https://github
|
||||
|
||||
**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.**
|
||||
|
||||
|
||||
<img src="https://pnptelemetry.azurewebsites.net/sp-dev-fx-webparts/samples/react-script-editor" />
|
||||
|
@ -9,7 +9,7 @@
|
||||
"Coming from old classic SharePoint pages you might have existing script solutions you want to re-use on a modern page without having to repackage it as a new SharePoint Framework web part."
|
||||
],
|
||||
"creationDateTime": "2019-10-13",
|
||||
"updateDateTime": "2019-10-13",
|
||||
"updateDateTime": "2022-06-14",
|
||||
"products": [
|
||||
"SharePoint"
|
||||
],
|
||||
@ -20,7 +20,7 @@
|
||||
},
|
||||
{
|
||||
"key": "SPFX-VERSION",
|
||||
"value": "1.4.1"
|
||||
"value": "1.13.1"
|
||||
},
|
||||
{
|
||||
"key": "SPFX-FULLPAGEAPP",
|
||||
@ -52,6 +52,11 @@
|
||||
"pictureUrl": "https://github.com/waldekmastykarz.png",
|
||||
"name": "Waldek Mastykarz",
|
||||
"twitter": "waldekm"
|
||||
},
|
||||
{
|
||||
"gitHubAccount": "felixbohnacker",
|
||||
"pictureUrl": "https://github.com/felixbohnacker.png",
|
||||
"name": "Felix Bohnacker"
|
||||
}
|
||||
],
|
||||
"references": [
|
||||
|
Loading…
x
Reference in New Issue
Block a user