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
import * as React from 'react'; | |
import { ChildComponentState } from './ChildComponentState'; | |
import { WebPartContext } from '@microsoft/sp-webpart-base'; | |
export interface ChildComponentProps | |
{ | |
context : WebPartContext; | |
childoutput?: (item: any) => void; | |
} |
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
[Reflection.Assembly]::LoadWithPartialName("System.Web.Script.Serialization") | |
$resourceName = "<Resource Group Name>" | |
$azureStorage = "<Storage Container Name>" | |
$azureTable = "<Azure Storage Table>" | |
$Credential = Get-Credential | |
function UploadDataToAzureTableStorage { | |
param ( | |
[Parameter(Mandatory = $true, HelpMessage = 'Please provide the FileName')][ValidateNotNullOrEmpty()][String]$fileName | |
) |
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
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $Credential -Authentication Basic -AllowRedirection | |
Import-PSSession $Session -AllowClobber |
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
public render(): React.ReactElement<IProps> { | |
return ( | |
<div> | |
{ | |
this.props.properties ? ( | |
<TooltipHost content={this.props.tooltipMessage || strings.message} | |
id='pntp' | |
calloutProps={{ gapSpace: 0 }} | |
directionalHint={this.props.tooltipDirectional || DirectionalHint.leftTopEdge}> | |
{componentHTML} |
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
// Check the component properties and state for changes | |
public componentDidUpdate(prevProps : IProps, prevState : IState) : void | |
{ | |
// If properties have changed bind it | |
if(this.props.properties !== prevProps.properties || this.state.stateValue !== prevState.stateValue) | |
{ | |
//Do more things here | |
} | |
} |
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
// Using pnpjs to get items and | |
public componentDidMount() | |
{ | |
sp.web.lists.getByTitle(listTitle).items.get().then((items: Item[]) => { | |
this.setState({ | |
stateValue : items | |
}); | |
}); | |
} |
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
// Do a REST Query to get data from REST using spHttpClient | |
public componentWillMount() | |
{ | |
const items: any = await this.props.context.spHttpClient.get(restApi, SPHttpClient.configurations.v1, { | |
headers: { | |
'Accept': 'application/json;odata.metadata=none' | |
} | |
}).then(resp => resp.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
// SPFx context init below | |
public onInit(): Promise<void> { | |
return super.onInit().then(_ => { | |
// other init code may be present | |
sp.setup({ | |
spfxContext: this.context | |
}); | |
}); | |
} |
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
Set-PnPTraceLog -On -LogFile "<Location in hard drive>" -Level Debug | |
Apply-PnPProvisioningTemplate -Path "<Folder location>" -ClearNavigation -IgnoreDuplicateDataRowErrors |