`;
34 | }
35 |
36 | protected get dataVersion(): Version {
37 | return Version.parse('1.0');
38 | }
39 |
40 | protected getPropertyPaneConfiguration(): IPropertyPaneConfiguration {
41 | return {
42 | pages: [
43 | {
44 | header: {
45 | description: strings.PropertyPaneDescription
46 | },
47 | groups: [
48 | {
49 | groupName: strings.BasicGroupName,
50 | groupFields: [
51 | PropertyPaneTextField('description', {
52 | label: strings.DescriptionFieldLabel
53 | })
54 | ]
55 | }
56 | ]
57 | }
58 | ]
59 | };
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/samples/site-designs-flow-azure-functions-pnp-hubsites/Office365.SiteDesigns.SPFx/src/webparts/helloWorld/loc/en-us.js:
--------------------------------------------------------------------------------
1 | define([], function() {
2 | return {
3 | "PropertyPaneDescription": "Description",
4 | "BasicGroupName": "Group Name",
5 | "DescriptionFieldLabel": "Description Field"
6 | }
7 | });
--------------------------------------------------------------------------------
/samples/site-designs-flow-azure-functions-pnp-hubsites/Office365.SiteDesigns.SPFx/src/webparts/helloWorld/loc/mystrings.d.ts:
--------------------------------------------------------------------------------
1 | declare interface IHelloWorldWebPartStrings {
2 | PropertyPaneDescription: string;
3 | BasicGroupName: string;
4 | DescriptionFieldLabel: string;
5 | }
6 |
7 | declare module 'HelloWorldWebPartStrings' {
8 | const strings: IHelloWorldWebPartStrings;
9 | export = strings;
10 | }
11 |
--------------------------------------------------------------------------------
/samples/site-designs-flow-azure-functions-pnp-hubsites/Office365.SiteDesigns.SPFx/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "es5",
4 | "forceConsistentCasingInFileNames": true,
5 | "module": "esnext",
6 | "moduleResolution": "node",
7 | "jsx": "react",
8 | "declaration": true,
9 | "sourceMap": true,
10 | "experimentalDecorators": true,
11 | "skipLibCheck": true,
12 | "typeRoots": [
13 | "./node_modules/@types",
14 | "./node_modules/@microsoft"
15 | ],
16 | "types": [
17 | "es6-promise",
18 | "webpack-env"
19 | ],
20 | "lib": [
21 | "es5",
22 | "dom",
23 | "es2015.collection"
24 | ]
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/samples/site-designs-flow-azure-functions-pnp-hubsites/README.md:
--------------------------------------------------------------------------------
1 | # SharePoint Online Site Designs code samples
2 |
3 | ## Summary
4 |
5 | ### 1. Out of the box Site Scripts and Site Designs
6 |
7 | PowerShell scripts which use the `Add-SPOSiteScript` cmdlet to deploy site scripts to the tenant and the `Add-SPOSiteDesign` cmdlet to combine site scripts to deploy them as Site Designs
8 |
9 | ### 2. Extend Site Designs with Microsoft Flow, Azure Functions and PnP Schema
10 |
11 | Code for using the `triggerFlow` action in a Site Design to call a Flow and pass parameters to it. Flow passes the parameters to an Azure Function which then applies PnP schema to the site which executes the Site Design.
12 |
13 | ### 3. Apply Site Design to existing modern site
14 |
15 | Using the `Invoke-SPOSiteDesign` cmdlet to apply a Site Design to an existing modern site.
16 |
17 | ### 4. Join site to a Hub site using a Site Design
18 |
19 | Configure a Hub site on the tenant using the `Register-SPOHubSite` cmdlet and join the current site to a Hub site using the `joinHubSite` site design action
20 |
21 | ### 5. Sample SPFx solutions used to deploy from Site Designs
22 |
23 | Hello world SPFx web part and Application Customizer (for footer) which is deployed to a site using the `installSolution` and `associateExtension` actions in a Site Design.
24 |
25 | ### 6. Modern themes
26 |
27 | Creating and deploying modern themes with the `Add-SPOTheme` cmdlet
28 |
29 | ## Sample
30 |
31 | Solution|Author(s)
32 | --------|---------
33 | site-designs-flow-azure-functions-pnp-hubsites | Vardhaman Deshpande ([@vrdmn](https://twitter.com/vrdmn)), Content and Code
34 |
35 | ## Version history
36 |
37 | Version|Date|Comments
38 | -------|----|--------
39 | 1.0|July 22, 2018|Initial release
40 |
41 | ## Disclaimer
42 | **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.**
43 |
44 |
--------------------------------------------------------------------------------
/samples/site-register-spfx-extension/README.md:
--------------------------------------------------------------------------------
1 | # Associate SharePoint Framework extension to a site
2 |
3 | ## Summary
4 |
5 | Use the associateExtension action to register a deployed SharePoint Framework extension from the tenant app catalog.
6 |
7 | For more details on how to create and configure a SharePoint Framework extension, check out: [Overview of SharePoint Framework Extensions](https://docs.microsoft.com/en-us/sharepoint/dev/spfx/extensions/overview-extensions).
8 |
9 | 
10 |
11 | ## Sample
12 |
13 | Solution|Author(s)
14 | --------|---------
15 | site-register-spfx-extension | Sean Squires
16 |
17 | ## Version history
18 |
19 | Version|Date|Comments
20 | -------|----|--------
21 | 1.0| August 7, 2018 |Initial release
22 |
23 | ## Disclaimer
24 | **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.**
25 |
26 | ---
27 |
28 |
--------------------------------------------------------------------------------
/samples/site-register-spfx-extension/readme.txt:
--------------------------------------------------------------------------------
1 | Use the associateExtension action to register a deployed SharePoint Framework extension from the tenant app catalog.
2 |
3 | For more details on how to create and configure a SharePoint Framework extension, check out: Overview of SharePoint Framework Extensions (https://docs.microsoft.com/en-us/sharepoint/dev/spfx/extensions/overview-extensions).
4 |
5 |
--------------------------------------------------------------------------------
/samples/site-register-spfx-extension/register_extension.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "schema.json",
3 | "actions": [
4 | {
5 | "verb": "installSolution",
6 | "id": "c59e2c4a-e7ef-4a88-ae8f-c770abfc150a",
7 | "name": "Application Customizer for Page Header Footer"
8 | },
9 | {
10 | "verb": "associateExtension",
11 | "title": "SPFXApplicationCustomizer Example",
12 | "location": "ClientSideExtension.ApplicationCustomizer",
13 | "clientSideComponentId": "40d64749-a6e5-4691-b440-1e32fb6bfea5",
14 | "scope": "Web"
15 | }
16 | ],
17 | "bindata": { },
18 | "version": 1
19 | }
--------------------------------------------------------------------------------
/samples/site-register-spfx-extension/screenshot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pnp/sp-dev-site-scripts/e84c224e16ffac6ebf74ec5fc415d9e9fe49dd5e/samples/site-register-spfx-extension/screenshot.png
--------------------------------------------------------------------------------
/samples/triggerFlow-write-back-site-properties-to-splist/README.md:
--------------------------------------------------------------------------------
1 | # Additional site information with triggerFlow action
2 |
3 | ## Summary
4 |
5 | We have amended the `triggerFlow` site action to pass additional site information. These properties can be associated to variables in the JSON request body of a HTTP request Flow action and then used as dynamic content in other Flow actions like email and list objects.
6 | These properties are automatically sent from the site provisioning engine. In other words: you don't have to explicitly write these properties in the sitescript-file.
7 |
8 | The properties that you can use are the following:
9 | - webUrl
10 | - creatorName
11 | - creatorEmail
12 | - webDescription
13 | - createdTimeUTC
14 |
15 | In this example you can use the included JSON in your HTTP Request action request body and then insert a new step like create SharePoint list item. First create the SharePoint list so you can reference it in the create item Flow action. Your list should include fields for each of the triggerFlow properties you'd like to capture. For this example you need to create a list to capture all sites created with this site design and script using a triggerFlow):
16 |
17 | - Create a list with the following properties:
18 | - *Web Url* (maps to webUrl)
19 | - *CreatedBy* (maps to creatorName)
20 | - *CreatorEmail* (maps to creatorEmail)
21 | - *webDescription* (maps to webDescription)
22 | - *creationTimeUTC* (maps to createdTimeUTC)
23 |
24 | - create a Flow that includes two steps:
25 | - When a HTTP Request is received (this action will use the include JSON for the request body. You can get the HTTP Post Url for your triggerFlow action after saving the flow)
26 | - Create item - SharePoint (this action will allow you to specify the list you created above. after you point it to the correct list you'll be able to map the list columns to the site properties as dynamic content.
27 |
28 | After you save your Flow and update your triggerFlow action subsequent uses of this script will write back the site information as illustrated in the sample screenshot.
29 |
30 | 
31 |
32 | ## Sample
33 |
34 | Solution|Author(s)
35 | --------|---------
36 | request-body-json-schema.json | SharePoint Team
37 |
38 | ## Version history
39 |
40 | Version|Date|Comments
41 | -------|----|--------
42 | 1.0|April 10, 2018|Initial release
43 |
44 | ## Disclaimer
45 | **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.**
46 |
47 | ---
48 |
49 | ## Additional notes
50 |
51 | This sample is covered in the main documentation on the Site Designs and Site Scripts.
52 |
53 | - [SharePoint site design and site script overview](https://docs.microsoft.com/en-us/sharepoint/dev/declarative-customization/site-design-overview)
54 |
55 |
56 |
57 |
--------------------------------------------------------------------------------
/samples/triggerFlow-write-back-site-properties-to-splist/request-body-json-schema.json:
--------------------------------------------------------------------------------
1 | {
2 | "type": "object",
3 | "properties": {
4 | "webUrl": {
5 | "type": "string"
6 | },
7 | "webDescription": {
8 | "type": "string"
9 | },
10 | "creatorName": {
11 | "type": "string"
12 | },
13 | "creatorEmail": {
14 | "type": "string"
15 | },
16 | "createdTimeUTC": {
17 | "type": "string"
18 | },
19 | "parameters": {
20 | "type": "object",
21 | "properties": {
22 | "event": {
23 | "type": "string"
24 | },
25 | "product": {
26 | "type": "string"
27 | }
28 | }
29 | }
30 | }
31 | }
--------------------------------------------------------------------------------
/samples/triggerFlow-write-back-site-properties-to-splist/updated_triggerFlow_properties.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/pnp/sp-dev-site-scripts/e84c224e16ffac6ebf74ec5fc415d9e9fe49dd5e/samples/triggerFlow-write-back-site-properties-to-splist/updated_triggerFlow_properties.png
--------------------------------------------------------------------------------