Top Banner
SPFx extensions How does it work and how do we use it?
34

SPUnite17 SPFx Extensions

Jan 28, 2018

Download

Technology

NCCOMMS
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: SPUnite17 SPFx Extensions

SPFxextensions

How does it work

and how do we use it?

Page 2: SPUnite17 SPFx Extensions

SPFx extensions, how does it work and how do we use it?

Martin Lingstuyl / SharePoint & Office 365 Dev

I4-YOU Business Solutions B.V.

LinkedIn https://www.linkedin.com/company/18182907/

Web https://i4-you.com

Digital meeting solution https://easy2meet.nl

Intranet Solution http://socialintranet.nu

Page 3: SPUnite17 SPFx Extensions

SPFx extensions, how does it work and how do we use it?

Sponsors

Page 4: SPUnite17 SPFx Extensions

TheModern

UI

Simplyawesome

Page 5: SPUnite17 SPFx Extensions

SharePointFramework

Only webparts

Page 6: SPUnite17 SPFx Extensions

What about the Gap?

Page 7: SPUnite17 SPFx Extensions

SPFx extensions, how does it work and how do we use it?

Prerequisites

Prerequisite

Node with npm 3.x

YeomanScaffolding tool for modern webapps

@microsoft/generator-sharepoint

GulpTask runner

Visual Studio Code or editor of choice

Page 8: SPUnite17 SPFx Extensions

SPFx extensions, how does it work and how do we use it?

Getting set up

npm install -g [email protected] gulp yeoman @microsoft/generator-sharepoint

yo @microsoft/sharepoint

Page 9: SPUnite17 SPFx Extensions

SPFx extensions, how does it work and how do we use it?

And this is whatit looks like

Page 10: SPUnite17 SPFx Extensions

Application Customizer

extend UI embed JavaScript

across all pages in a scope

1.

Global Navbar by Paolo Pialorsi

Page 11: SPUnite17 SPFx Extensions

Application Customizer

extend UI embed JavaScript

across all pages in a scope

1.

Global Navbar by Paolo Pialorsi

Placeholders

Page 12: SPUnite17 SPFx Extensions

Application Customizer

extend UI embed JavaScript across all pages

in a scope

1.

Page 13: SPUnite17 SPFx Extensions

Notification bar example

Application Customizer

extend UI embed JavaScript across all pages

in a scope

1.

Page 14: SPUnite17 SPFx Extensions

Application Customizer

extend UI embed JavaScript across all pages

in a scope

1.

Notification bar example

Page 15: SPUnite17 SPFx Extensions

Command SetCustomizer

2.

Discuss Now by Paolo Pialorsi

Page 16: SPUnite17 SPFx Extensions

Command SetCustomizer

2.

Page 17: SPUnite17 SPFx Extensions

Command Set

Customizer

2.

Page 18: SPUnite17 SPFx Extensions

Command Set

Customizer

2.

Notification bar example

Page 19: SPUnite17 SPFx Extensions

Command Set

Customizer

2.

Notification bar example

Page 20: SPUnite17 SPFx Extensions

Command Set

Customizer

2.

Don’t forget the manifest file

Page 21: SPUnite17 SPFx Extensions

FieldCustomizer

embed JavaScript for field specific UI rendering

3.

Weather by Waldek Mastykarz

Page 22: SPUnite17 SPFx Extensions

FieldCustomizer

embed JavaScript for field specific UI rendering

3. View

Display Form

New Form

Edit Form

Quick Edit

Page 23: SPUnite17 SPFx Extensions

Field Customizers VS Column formatters

Page 24: SPUnite17 SPFx Extensions

Field

Customizer

embed JavaScript for field specific UI

rendering

3.

…more advanced use cases

Page 25: SPUnite17 SPFx Extensions

Field

Customizer

embed JavaScript for field specific UI

rendering

3.

…more advanced use cases

Page 26: SPUnite17 SPFx Extensions

Field

Customizer

embed JavaScript for field specific UI

rendering

3.

Page 27: SPUnite17 SPFx Extensions

Field

Customizer

embed JavaScript for field specific UI

rendering

3.

Notification bar example

Page 28: SPUnite17 SPFx Extensions

Field

Customizer

embed JavaScript for field specific UI

rendering

3.

Notification bar example

Page 29: SPUnite17 SPFx Extensions

SPFx extensions, how does it work and how do we use it?

Debugging SPFx Extensions

• Starting serving the files with

• No workbench, use QueryStrings when loading a page:

gulp serve --nobrowser

?loadSPFX=true

&debugManifestsFile=https://localhost:4321/temp/manifests.js

&customActions={"<id>":{"location":"ClientSideExtension.ApplicationCustomizer","properties":{}}}

&customActions={"<id>":{"location":"ClientSideExtension.ListViewCommandSet","properties":{}}}

&fieldCustomizers={"<fieldname>":{"id":"<id>","properties":{}}}

Page 30: SPUnite17 SPFx Extensions

SPFx extensions, how does it work and how do we use it?

In our example it looks like this:

?loadSPFX=true&debugManifestsFile=https://localhost:4321/temp/manifests.js&customActions={"d3359529-056c-4575-aab6-ba589bc70dd2":{"location":"ClientSideExtension.ApplicationCustomizer","properties":{}}, "00ba0713-ed47-40f2-951c-d9b7dc9160c8“: {"location":"ClientSideExtension.ListViewCommandSet"}}&fieldCustomizers={"NotificationType":{"id":"ce376f8e-1bc2-467a-baa8-3b76783edabd","properties":{}}}

Page 31: SPUnite17 SPFx Extensions

SPFx extensions, how does it work and how do we use it?

Things to remember

• You can combine debug QueryStrings

• Debugging typescript in Chrome dev tools => webpack(Use Ctrl + P to find the files if you can’t)

• Use ?reset=true to stop the debugging prompts

Page 32: SPUnite17 SPFx Extensions

Some guidance about deployment

Details at https://dev.office.com/blogs/deployment-options-for-sharepoint-framework-solutions

Page 33: SPUnite17 SPFx Extensions

SPFx extensions, how does it work and how do we use it?

Resources

• https://aka.ms/spfx-extensions

• https://github.com/SharePoint/sp-dev-fx-extensions

• https://github.com/martinlingstuyl/Spfx-Extension-Notification-Bar-Sample

• https://dev.office.com/blogs/deployment-options-for-sharepoint-framework-solutions

• Please vote this up! New / Edit mode for the Field Customizer:https://sharepoint.uservoice.com/forums/329220-sharepoint-dev-platform/suggestions/20474935-field-customizer-evolution-forms-quick-edit-mode

• Please vote this up! Additional placeholders for the Application Customizer:https://sharepoint.uservoice.com/forums/329220-sharepoint-dev-platform/suggestions/19536022-extensions-application-customizer-additional-pl

Page 34: SPUnite17 SPFx Extensions

Questions?