Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Phillip Demro
committed
Jan 10, 2018
1 parent
1a6513d
commit 2a84ee8
Showing
27 changed files
with
639 additions
and
3 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
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
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
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
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Elements xmlns="http://schemas.microsoft.com/sharepoint/"> | ||
<CustomAction | ||
Title="HelloWorldExtension" | ||
Location="ClientSideExtension.ApplicationCustomizer" | ||
ClientSideComponentId="59ecf2f4-974d-4974-a341-d83c27f0fd62" | ||
ClientSideComponentProperties="{"testMessage":"Test message"}"> | ||
</CustomAction> | ||
</Elements> |
17 changes: 17 additions & 0 deletions
17
src/extensions/helloWorld2Extension/HelloWorld2ExtensionApplicationCustomizer.manifest.json
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"$schema": "https://dev.office.com/json-schemas/spfx/client-side-extension-manifest.schema.json", | ||
|
||
"id": "512b1a0a-1300-421d-b99c-c5ceffb7e921", | ||
"alias": "HelloWorld2ExtensionApplicationCustomize", | ||
"componentType": "Extension", | ||
"extensionType": "ApplicationCustomizer", | ||
|
||
// The "*" signifies that the version should be taken from the package.json | ||
"version": "*", | ||
"manifestVersion": 2, | ||
|
||
// If true, the component can only be installed on sites where Custom Script is allowed. | ||
// Components that allow authors to embed arbitrary script code should set this to true. | ||
// https://support.office.com/en-us/article/Turn-scripting-capabilities-on-or-off-1f2c515f-5d7e-448a-9fd7-835da935584f | ||
"requiresCustomScript": false | ||
} |
39 changes: 39 additions & 0 deletions
39
src/extensions/helloWorld2Extension/HelloWorld2ExtensionApplicationCustomizer.ts
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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { override } from '@microsoft/decorators'; | ||
import { Log } from '@microsoft/sp-core-library'; | ||
import { | ||
BaseApplicationCustomizer | ||
} from '@microsoft/sp-application-base'; | ||
import { Dialog } from '@microsoft/sp-dialog'; | ||
|
||
import * as strings from 'HelloWorld2ExtensionApplicationCustomizerStrings'; | ||
|
||
const LOG_SOURCE: string = 'HelloWorld2ExtensionApplicationCustomizer'; | ||
|
||
/** | ||
* If your command set uses the ClientSideComponentProperties JSON input, | ||
* it will be deserialized into the BaseExtension.properties object. | ||
* You can define an interface to describe it. | ||
*/ | ||
export interface IHelloWorld2ExtensionApplicationCustomizerProperties { | ||
// This is an example; replace with your own property | ||
testMessage: string; | ||
} | ||
|
||
/** A Custom Action which can be run during execution of a Client Side Application */ | ||
export default class HelloWorld2ExtensionApplicationCustomizer | ||
extends BaseApplicationCustomizer<IHelloWorld2ExtensionApplicationCustomizerProperties> { | ||
|
||
@override | ||
public onInit(): Promise<void> { | ||
Log.info(LOG_SOURCE, `Initialized ${strings.Title}`); | ||
|
||
let message: string = this.properties.testMessage; | ||
if (!message) { | ||
message = '(No properties were provided.)'; | ||
} | ||
|
||
Dialog.alert(`Hello from ${strings.Title}:\n\n${message}`); | ||
|
||
return Promise.resolve(); | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
define([], function() { | ||
return { | ||
"Title": "HelloWorld2ExtensionApplicationCustomizer" | ||
} | ||
}); |
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
declare interface IHelloWorld2ExtensionApplicationCustomizerStrings { | ||
Title: string; | ||
} | ||
|
||
declare module 'HelloWorld2ExtensionApplicationCustomizerStrings' { | ||
const strings: IHelloWorld2ExtensionApplicationCustomizerStrings; | ||
export = strings; | ||
} |
17 changes: 17 additions & 0 deletions
17
src/extensions/helloWorldExtension/HelloWorldExtensionApplicationCustomizer.manifest.json
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"$schema": "https://dev.office.com/json-schemas/spfx/client-side-extension-manifest.schema.json", | ||
|
||
"id": "59ecf2f4-974d-4974-a341-d83c27f0fd62", | ||
"alias": "HelloWorldExtensionApplicationCustomizer", | ||
"componentType": "Extension", | ||
"extensionType": "ApplicationCustomizer", | ||
|
||
// The "*" signifies that the version should be taken from the package.json | ||
"version": "*", | ||
"manifestVersion": 2, | ||
|
||
// If true, the component can only be installed on sites where Custom Script is allowed. | ||
// Components that allow authors to embed arbitrary script code should set this to true. | ||
// https://support.office.com/en-us/article/Turn-scripting-capabilities-on-or-off-1f2c515f-5d7e-448a-9fd7-835da935584f | ||
"requiresCustomScript": false | ||
} |
39 changes: 39 additions & 0 deletions
39
src/extensions/helloWorldExtension/HelloWorldExtensionApplicationCustomizer.ts
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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { override } from '@microsoft/decorators'; | ||
import { Log } from '@microsoft/sp-core-library'; | ||
import { | ||
BaseApplicationCustomizer | ||
} from '@microsoft/sp-application-base'; | ||
import { Dialog } from '@microsoft/sp-dialog'; | ||
|
||
import * as strings from 'HelloWorldExtensionApplicationCustomizerStrings'; | ||
|
||
const LOG_SOURCE: string = 'HelloWorldExtensionApplicationCustomizer'; | ||
|
||
/** | ||
* If your command set uses the ClientSideComponentProperties JSON input, | ||
* it will be deserialized into the BaseExtension.properties object. | ||
* You can define an interface to describe it. | ||
*/ | ||
export interface IHelloWorldExtensionApplicationCustomizerProperties { | ||
// This is an example; replace with your own property | ||
testMessage: string; | ||
} | ||
|
||
/** A Custom Action which can be run during execution of a Client Side Application */ | ||
export default class HelloWorldExtensionApplicationCustomizer | ||
extends BaseApplicationCustomizer<IHelloWorldExtensionApplicationCustomizerProperties> { | ||
|
||
@override | ||
public onInit(): Promise<void> { | ||
Log.info(LOG_SOURCE, `Initialized ${strings.Title}`); | ||
|
||
let message: string = this.properties.testMessage; | ||
if (!message) { | ||
message = '(No properties were provided.)'; | ||
} | ||
|
||
Dialog.alert(`Hello from ${strings.Title}:\n\n${message}`); | ||
|
||
return Promise.resolve(); | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
define([], function() { | ||
return { | ||
"Title": "HelloWorldExtensionApplicationCustomizer" | ||
} | ||
}); |
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
declare interface IHelloWorldExtensionApplicationCustomizerStrings { | ||
Title: string; | ||
} | ||
|
||
declare module 'HelloWorldExtensionApplicationCustomizerStrings' { | ||
const strings: IHelloWorldExtensionApplicationCustomizerStrings; | ||
export = strings; | ||
} |
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"$schema": "https://dev.office.com/json-schemas/spfx/client-side-web-part-manifest.schema.json", | ||
"id": "7ef3fa53-d0d6-4922-a090-d459fbe742b7", | ||
"alias": "HelloWorld2WebPart", | ||
"componentType": "WebPart", | ||
|
||
// The "*" signifies that the version should be taken from the package.json | ||
"version": "*", | ||
"manifestVersion": 2, | ||
|
||
// If true, the component can only be installed on sites where Custom Script is allowed. | ||
// Components that allow authors to embed arbitrary script code should set this to true. | ||
// https://support.office.com/en-us/article/Turn-scripting-capabilities-on-or-off-1f2c515f-5d7e-448a-9fd7-835da935584f | ||
"requiresCustomScript": false, | ||
|
||
"preconfiguredEntries": [{ | ||
"groupId": "5c03119e-3074-46fd-976b-c60198311f70", // Other | ||
"group": { "default": "Other" }, | ||
"title": { "default": "HelloWorld2" }, | ||
"description": { "default": "HelloWorld2 description" }, | ||
"officeFabricIconFontName": "Page", | ||
"properties": { | ||
"description": "HelloWorld2" | ||
} | ||
}] | ||
} |
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 |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import * as React from 'react'; | ||
import * as ReactDom from 'react-dom'; | ||
import { Version } from '@microsoft/sp-core-library'; | ||
import { | ||
BaseClientSideWebPart, | ||
IPropertyPaneConfiguration, | ||
PropertyPaneTextField | ||
} from '@microsoft/sp-webpart-base'; | ||
|
||
import * as strings from 'HelloWorld2WebPartStrings'; | ||
import HelloWorld2 from './components/HelloWorld2'; | ||
import { IHelloWorld2Props } from './components/IHelloWorld2Props'; | ||
|
||
export interface IHelloWorld2WebPartProps { | ||
description: string; | ||
} | ||
|
||
export default class HelloWorld2WebPart extends BaseClientSideWebPart<IHelloWorld2WebPartProps> { | ||
|
||
public render(): void { | ||
const element: React.ReactElement<IHelloWorld2Props > = React.createElement( | ||
HelloWorld2, | ||
{ | ||
description: this.properties.description | ||
} | ||
); | ||
|
||
ReactDom.render(element, this.domElement); | ||
} | ||
|
||
protected get dataVersion(): Version { | ||
return Version.parse('1.0'); | ||
} | ||
|
||
protected getPropertyPaneConfiguration(): IPropertyPaneConfiguration { | ||
return { | ||
pages: [ | ||
{ | ||
header: { | ||
description: strings.PropertyPaneDescription | ||
}, | ||
groups: [ | ||
{ | ||
groupName: strings.BasicGroupName, | ||
groupFields: [ | ||
PropertyPaneTextField('description', { | ||
label: strings.DescriptionFieldLabel | ||
}) | ||
] | ||
} | ||
] | ||
} | ||
] | ||
}; | ||
} | ||
} |
Oops, something went wrong.