Skip to content

Instantly share code, notes, and snippets.

View ypcode's full-sized avatar

Yannick Plenevaux ypcode

View GitHub Profile
Connect-PnPOnline https://contoso.sharepoint.com/sites/dev -Credentials contoso
$page = Add-PnPClientSidePage -Name "three column.aspx"
Add-PnPClientSidePageSection -Page $page -SectionTemplate ThreeColumn
Connect-PnPOnline https://contoso.sharepoint.com/sites/dev -Credentials contoso
Add-PnPClientSidePage -Name test -LayoutType Article -PromoteAs NewsArticle -Publish -PublishMessage "Final version"
git clone https://github.com/ypcode/ypcode-spfx-samples.git
cd ypcode-spfx-samples\content-editor-webpart\
npm install
gulp build
gulp package-solution
gulp serve --nobrowser
import {
IWebPartContext,
} from '@microsoft/sp-webpart-base';
import {
Environment,
EnvironmentType,
ServiceScope
} from '@microsoft/sp-core-library';
import { ServiceScope } from "@microsoft/sp-core-library";
import { firstOrDefault } from "../../helpers/CollectionHelper";
import {
IDataService,
IConfigurationService,
ConfigurationServiceKey,
ChoiceFieldType
} from "../";
import { IFieldInfo, IListInfo, ITask } from "../../models";
import { Version } from '@microsoft/sp-core-library';
import {
BaseClientSideWebPart,
IPropertyPaneConfiguration,
PropertyPaneDropdown,
} from '@microsoft/sp-webpart-base';
import { SPComponentLoader } from '@microsoft/sp-loader';
import styles from './KanbanBoard.module.scss';
import * as strings from 'kanbanBoardStrings';
import { IKanbanBoardWebPartProps } from './IKanbanBoardWebPartProps';
import { ServiceScope, ServiceKey } from "@microsoft/sp-core-library";
import { firstOrDefault } from "../helpers/CollectionHelper";
import { IFieldInfo, IListInfo, ITask } from "../models";
import { IConfigurationService, ConfigurationServiceKey } from "./ConfigurationService";
import pnp from "sp-pnp-js";
export const ChoiceFieldType = "Choice";
// Add this in the imports
import {
IConfigurationService
} from "../../services";
// ....
// Add the following member to the KanbanBoardWebPart class
private config: IConfigurationService = null;
// ....
// Add the following method to the KanbanBoardWebPart class
public onPropertyPaneFieldChanged(propertyName: string, oldValue: string, newValue: string) {
import { ServiceKey} from "@microsoft/sp-core-library";
/**
* The Configuration Service public interface
*/
export interface IConfigurationService {
tasksListId: string;
statusFieldInternalName: string;
}
[CmdletBinding()]
Param (
[Parameter(Mandatory=$True)]
[string]$List,
[Parameter(Mandatory=$True)]
[string]$SourceContentType,
[Parameter(Mandatory=$True)]
[string]$TargetContentType