Repository: pnp/sp-starter-kit Branch: master Commit: 6215f3e02e20 Files: 894 Total size: 24.8 MB Directory structure: gitextract_4xefdc4j/ ├── .deployment ├── .github/ │ ├── CONTRIBUTING.md │ ├── ISSUE_TEMPLATE/ │ │ ├── ---bug.md │ │ ├── ---enhancement.md │ │ └── --question.md │ ├── ISSUE_TEMPLATE.md │ └── PULL_REQUEST_TEMPLATE.md ├── .gitignore ├── .tours/ │ └── spo-solution-overview.tour ├── LICENSE ├── README.md ├── assets/ │ ├── designs/ │ │ ├── portalsitescript.js │ │ └── portaltheme.xml │ ├── documents/ │ │ └── Contoso_Report.pptx │ ├── functions/ │ │ ├── applyportaltemplate/ │ │ │ ├── function.json │ │ │ ├── modules/ │ │ │ │ └── SharePointPnPPowerShellOnline/ │ │ │ │ ├── SharePointPnP.PowerShell.Online.Commands.Format.ps1xml │ │ │ │ ├── SharePointPnP.PowerShell.Online.Commands.dll-help.xml │ │ │ │ ├── SharePointPnPPowerShellOnline.psd1 │ │ │ │ └── SharePointPnPPowerShellOnlineAliases.psm1 │ │ │ ├── portal.xml │ │ │ └── run.ps1 │ │ └── host.json │ └── readme.md ├── changelog.md ├── documentation/ │ ├── README.md │ ├── api-management.md │ ├── common-provision-results.md │ ├── components/ │ │ ├── ext-alert.md │ │ ├── ext-classification.md │ │ ├── ext-collab-discussnow.md │ │ ├── ext-collab-footer.md │ │ ├── ext-portal-footer.md │ │ ├── ext-redirect.md │ │ ├── lib-shared.md │ │ ├── wp-banner.md │ │ ├── wp-followed-sites.md │ │ ├── wp-links.md │ │ ├── wp-lob-integration.md │ │ ├── wp-people-directory.md │ │ ├── wp-personal-calendar.md │ │ ├── wp-personal-contacts.md │ │ ├── wp-personal-email.md │ │ ├── wp-personal-tasks.md │ │ ├── wp-recent-contacts.md │ │ ├── wp-recently-used-documents.md │ │ ├── wp-recently-visited-sites.md │ │ ├── wp-site-information.md │ │ ├── wp-stock-information.md │ │ ├── wp-tiles.md │ │ ├── wp-weather-information.md │ │ └── wp-world-time.md │ ├── manual-deploy-sppkg-solution.md │ ├── modifying-spfx-solutions.md │ ├── tenant-settings.md │ └── term-store.md ├── lerna.json ├── package/ │ ├── readme.md │ └── sharepoint-starter-kit.sppkg ├── package.json ├── provisioning/ │ ├── .vscode/ │ │ └── launch.json │ ├── readme-sp2019.md │ ├── readme-spfx-only.md │ ├── readme.md │ ├── starterkit-spfx-only.pnp │ └── starterkit.pnp ├── sample-lob-service/ │ └── SharePointPnP.LobScenario/ │ ├── .gitignore │ ├── Controllers/ │ │ └── CustomersController.cs │ ├── Models/ │ │ ├── Customer.cs │ │ └── LobResponse.cs │ ├── Program.cs │ ├── README.md │ ├── SharePointPnP.LobScenario.csproj │ ├── SharePointPnP.LobScenario.sln │ ├── Startup.cs │ └── appsettings.json └── source/ ├── README.md ├── js-application-redirect/ │ ├── .editorconfig │ ├── .eslintrc.js │ ├── .gitignore │ ├── .npmignore │ ├── .vscode/ │ │ ├── launch.json │ │ └── settings.json │ ├── .yo-rc.json │ ├── README.md │ ├── config/ │ │ ├── config.json │ │ ├── deploy-azure-storage.json │ │ ├── package-solution.json │ │ ├── sass.json │ │ ├── serve.json │ │ └── write-manifests.json │ ├── gulpfile.js │ ├── package.json │ ├── sharepoint/ │ │ └── assets/ │ │ ├── ClientSideInstance.xml │ │ └── elements.xml │ ├── src/ │ │ ├── extensions/ │ │ │ └── redirect/ │ │ │ ├── IRedirectApplicationCustomizerProperties.ts │ │ │ ├── IRedirection.ts │ │ │ ├── RedirectApplicationCustomizer.manifest.json │ │ │ ├── RedirectApplicationCustomizer.ts │ │ │ └── loc/ │ │ │ ├── en-us.js │ │ │ ├── fr-fr.js │ │ │ └── myStrings.d.ts │ │ └── index.ts │ └── tsconfig.json ├── library-starter-kit-shared/ │ ├── .editorconfig │ ├── .eslintrc.js │ ├── .gitignore │ ├── .npmignore │ ├── .vscode/ │ │ ├── extensions.json │ │ ├── launch.json │ │ └── settings.json │ ├── .yo-rc.json │ ├── README.md │ ├── config/ │ │ ├── config.json │ │ ├── deploy-azure-storage.json │ │ ├── package-solution.json │ │ ├── sass.json │ │ ├── serve.json │ │ └── write-manifests.json │ ├── gulpfile.generatelocalkeys.js │ ├── gulpfile.js │ ├── package.json │ ├── sharepoint/ │ │ └── solution/ │ │ └── library-starter-kit-shared.sppkg │ ├── src/ │ │ ├── index.ts │ │ └── libraries/ │ │ └── spStarterKitShared/ │ │ ├── SpStarterKitSharedLibrary.manifest.json │ │ ├── SpStarterKitSharedLibrary.ts │ │ └── loc/ │ │ ├── LocaleKeys.ts │ │ ├── de-de.js │ │ ├── en-us.js │ │ ├── es-es.js │ │ ├── fr-fr.js │ │ ├── mystrings.d.ts │ │ ├── nb-no.js │ │ ├── nl-nl.js │ │ ├── sv-se.js │ │ └── tr-tr.js │ └── tsconfig.json ├── mgt-spfx/ │ ├── README.md │ ├── mgt-spfx-2.2.1.sppkg │ └── mgt-spfx-v2.9.0.sppkg ├── react-application-alerts/ │ ├── .editorconfig │ ├── .eslintrc.js │ ├── .gitignore │ ├── .npmignore │ ├── .vscode/ │ │ ├── launch.json │ │ └── settings.json │ ├── .yo-rc.json │ ├── README.md │ ├── config/ │ │ ├── config.json │ │ ├── deploy-azure-storage.json │ │ ├── package-solution.json │ │ ├── sass.json │ │ ├── serve.json │ │ └── write-manifests.json │ ├── gulpfile.js │ ├── package.json │ ├── sharepoint/ │ │ └── assets/ │ │ ├── ClientSideInstance.xml │ │ └── elements.xml │ ├── src/ │ │ ├── extensions/ │ │ │ └── hubOrSiteAlerts/ │ │ │ ├── HubOrSiteAlertsApplicationCustomizer.manifest.json │ │ │ ├── HubOrSiteAlertsApplicationCustomizer.ts │ │ │ ├── IAlert.ts │ │ │ ├── IHubSiteData.ts │ │ │ ├── components/ │ │ │ │ ├── AlertNotifications.tsx │ │ │ │ ├── IAlertNotificationsProps.ts │ │ │ │ └── index.ts │ │ │ └── loc/ │ │ │ ├── de-de.js │ │ │ ├── en-us.js │ │ │ ├── es-es.js │ │ │ ├── fr-fr.js │ │ │ ├── myStrings.d.ts │ │ │ ├── nb-no.js │ │ │ ├── nl-nl.js │ │ │ ├── sv-se.js │ │ │ └── tr-tr.js │ │ └── index.ts │ └── tsconfig.json ├── react-application-collab-footer/ │ ├── .editorconfig │ ├── .eslintrc.js │ ├── .gitignore │ ├── .npmignore │ ├── .vscode/ │ │ ├── launch.json │ │ └── settings.json │ ├── .yo-rc.json │ ├── README.md │ ├── config/ │ │ ├── config.json │ │ ├── deploy-azure-storage.json │ │ ├── package-solution.json │ │ ├── sass.json │ │ ├── serve.json │ │ └── write-manifests.json │ ├── gulpfile.js │ ├── package.json │ ├── sharepoint/ │ │ └── assets/ │ │ ├── ClientSideInstance.xml │ │ └── elements.xml │ ├── src/ │ │ ├── extensions/ │ │ │ └── collaborationFooter/ │ │ │ ├── CollaborationFooterApplicationCustomizer.manifest.json │ │ │ ├── CollaborationFooterApplicationCustomizer.ts │ │ │ ├── components/ │ │ │ │ ├── CollabFooter.module.scss │ │ │ │ ├── CollabFooter.tsx │ │ │ │ ├── ICollabFooterEditResult.ts │ │ │ │ ├── ICollabFooterProps.ts │ │ │ │ ├── ICollabFooterState.ts │ │ │ │ └── myLinks/ │ │ │ │ ├── IMyLink.ts │ │ │ │ ├── MyLinks.module.scss │ │ │ │ ├── MyLinksDialog.tsx │ │ │ │ └── loc/ │ │ │ │ ├── de-de.js │ │ │ │ ├── en-us.js │ │ │ │ ├── es-es.js │ │ │ │ ├── fr-fr.js │ │ │ │ ├── mystrings.d.ts │ │ │ │ ├── nb-no.js │ │ │ │ ├── nl-nl.js │ │ │ │ ├── sv-se.js │ │ │ │ └── tr-tr.js │ │ │ └── loc/ │ │ │ ├── de-de.js │ │ │ ├── en-us.js │ │ │ ├── es-es.js │ │ │ ├── fr-fr.js │ │ │ ├── myStrings.d.ts │ │ │ ├── nb-no.js │ │ │ ├── nl-nl.js │ │ │ ├── sv-se.js │ │ │ └── tr-tr.js │ │ ├── index.ts │ │ └── services/ │ │ ├── SPTaxonomyService.ts │ │ ├── SPTaxonomyTypes.ts │ │ ├── SPUserProfileService.ts │ │ └── SPUserProfileTypes.ts │ └── tsconfig.json ├── react-application-portal-footer/ │ ├── .editorconfig │ ├── .eslintrc.js │ ├── .gitignore │ ├── .npmignore │ ├── .vscode/ │ │ ├── launch.json │ │ └── settings.json │ ├── .yo-rc.json │ ├── README.md │ ├── config/ │ │ ├── config.json │ │ ├── deploy-azure-storage.json │ │ ├── package-solution.json │ │ ├── sass.json │ │ ├── serve.json │ │ └── write-manifests.json │ ├── gulpfile.js │ ├── package.json │ ├── sharepoint/ │ │ └── assets/ │ │ ├── ClientSideInstance.xml │ │ └── elements.xml │ ├── src/ │ │ ├── extensions/ │ │ │ └── portalFooter/ │ │ │ ├── IHubSiteData.ts │ │ │ ├── ILinkListItem.ts │ │ │ ├── PortalFooterApplicationCustomizer.manifest.json │ │ │ ├── PortalFooterApplicationCustomizer.ts │ │ │ ├── components/ │ │ │ │ ├── Links/ │ │ │ │ │ ├── ILinksProps.ts │ │ │ │ │ ├── Links.module.scss │ │ │ │ │ ├── Links.tsx │ │ │ │ │ └── index.ts │ │ │ │ ├── PortalFooter/ │ │ │ │ │ ├── ILinkGroup.ts │ │ │ │ │ ├── IPortalFooterEditResult.ts │ │ │ │ │ ├── IPortalFooterProps.ts │ │ │ │ │ ├── IPortalFooterState.ts │ │ │ │ │ ├── PortalFooter.module.scss │ │ │ │ │ ├── PortalFooter.tsx │ │ │ │ │ └── index.ts │ │ │ │ └── myLinks/ │ │ │ │ ├── IMyLink.ts │ │ │ │ ├── MyLinks.module.scss │ │ │ │ ├── MyLinksDialog.tsx │ │ │ │ └── loc/ │ │ │ │ ├── de-de.js │ │ │ │ ├── en-us.js │ │ │ │ ├── es-es.js │ │ │ │ ├── fr-fr.js │ │ │ │ ├── mystrings.d.ts │ │ │ │ ├── nb-no.js │ │ │ │ ├── nl-nl.js │ │ │ │ ├── sv-se.js │ │ │ │ └── tr-tr.js │ │ │ └── loc/ │ │ │ ├── de-de.js │ │ │ ├── en-us.js │ │ │ ├── es-es.js │ │ │ ├── fr-fr.js │ │ │ ├── myStrings.d.ts │ │ │ ├── nb-no.js │ │ │ ├── nl-nl.js │ │ │ ├── sv-se.js │ │ │ └── tr-tr.js │ │ ├── index.ts │ │ └── services/ │ │ ├── SPUserProfileService.ts │ │ └── SPUserProfileTypes.ts │ └── tsconfig.json ├── react-banner/ │ ├── .editorconfig │ ├── .eslintrc.js │ ├── .gitignore │ ├── .npmignore │ ├── .vscode/ │ │ ├── launch.json │ │ └── settings.json │ ├── .yo-rc.json │ ├── README.md │ ├── config/ │ │ ├── config.json │ │ ├── deploy-azure-storage.json │ │ ├── package-solution.json │ │ ├── sass.json │ │ ├── serve.json │ │ └── write-manifests.json │ ├── gulpfile.js │ ├── package.json │ ├── src/ │ │ ├── index.ts │ │ └── webparts/ │ │ └── banner/ │ │ ├── BannerWebPart.manifest.json │ │ ├── BannerWebPart.ts │ │ ├── components/ │ │ │ ├── Banner.module.scss │ │ │ ├── Banner.tsx │ │ │ ├── IBannerProps.ts │ │ │ └── index.ts │ │ └── loc/ │ │ ├── de-de.js │ │ ├── en-us.js │ │ ├── es-es.js │ │ ├── fr-fr.js │ │ ├── mystrings.d.ts │ │ ├── nb-no.js │ │ ├── nl-nl.js │ │ ├── sv-se.js │ │ └── tr-tr.js │ └── tsconfig.json ├── react-command-discuss-now/ │ ├── .editorconfig │ ├── .eslintrc.js │ ├── .gitignore │ ├── .npmignore │ ├── .vscode/ │ │ ├── launch.json │ │ └── settings.json │ ├── .yo-rc.json │ ├── README.md │ ├── config/ │ │ ├── config.json │ │ ├── deploy-azure-storage.json │ │ ├── package-solution.json │ │ ├── sass.json │ │ ├── serve.json │ │ └── write-manifests.json │ ├── gulpfile.js │ ├── package.json │ ├── sharepoint/ │ │ └── assets/ │ │ ├── ClientSideInstance.xml │ │ └── elements.xml │ ├── src/ │ │ ├── extensions/ │ │ │ └── discussNow/ │ │ │ ├── DiscussNowCommandSet.manifest.json │ │ │ ├── DiscussNowCommandSet.ts │ │ │ ├── components/ │ │ │ │ ├── DateTimePicker.tsx │ │ │ │ ├── IDateTimePickerProps.ts │ │ │ │ ├── IDateTimePickerState.ts │ │ │ │ ├── ScheduleMeetingDialog.module.scss │ │ │ │ └── ScheduleMeetingDialog.tsx │ │ │ └── loc/ │ │ │ ├── de-de.js │ │ │ ├── en-us.js │ │ │ ├── es-es.js │ │ │ ├── fr-fr.js │ │ │ ├── myStrings.d.ts │ │ │ ├── nb-no.js │ │ │ ├── nl-nl.js │ │ │ ├── sv-se.js │ │ │ └── tr-tr.js │ │ └── index.ts │ └── tsconfig.json ├── react-followed-sites/ │ ├── .editorconfig │ ├── .gitignore │ ├── .npmignore │ ├── .vscode/ │ │ ├── launch.json │ │ └── settings.json │ ├── .yo-rc.json │ ├── README.md │ ├── config/ │ │ ├── config.json │ │ ├── deploy-azure-storage.json │ │ ├── package-solution.json │ │ ├── sass.json │ │ ├── serve.json │ │ └── write-manifests.json │ ├── gulpfile.js │ ├── package.json │ ├── src/ │ │ ├── index.ts │ │ └── webparts/ │ │ └── followedSites/ │ │ ├── FollowedSitesWebPart.manifest.json │ │ ├── FollowedSitesWebPart.ts │ │ └── components/ │ │ ├── FollowedSites.module.scss │ │ ├── FollowedSites.tsx │ │ ├── IFollowedResult.ts │ │ ├── IFollowedSitesProps.ts │ │ ├── IFollowedSitesState.ts │ │ ├── index.ts │ │ └── paging/ │ │ ├── IPagingProps.ts │ │ ├── IPagingState.ts │ │ ├── Paging.module.scss │ │ ├── Paging.tsx │ │ └── index.ts │ └── tsconfig.json ├── react-links/ │ ├── .editorconfig │ ├── .eslintrc.js │ ├── .gitignore │ ├── .npmignore │ ├── .vscode/ │ │ ├── launch.json │ │ └── settings.json │ ├── .yo-rc.json │ ├── README.md │ ├── config/ │ │ ├── config.json │ │ ├── deploy-azure-storage.json │ │ ├── package-solution.json │ │ ├── sass.json │ │ ├── serve.json │ │ └── write-manifests.json │ ├── gulpfile.js │ ├── package.json │ ├── src/ │ │ ├── index.ts │ │ └── webparts/ │ │ └── links/ │ │ ├── ILink.ts │ │ ├── LinksWebPart.manifest.json │ │ ├── LinksWebPart.ts │ │ ├── components/ │ │ │ ├── ILinksProps.ts │ │ │ ├── ILinksState.ts │ │ │ ├── Links.module.scss │ │ │ └── Links.tsx │ │ └── loc/ │ │ ├── de-de.js │ │ ├── en-us.js │ │ ├── es-es.js │ │ ├── fr-fr.js │ │ ├── mystrings.d.ts │ │ ├── nb-no.js │ │ ├── nl-nl.js │ │ ├── sv-se.js │ │ └── tr-tr.js │ └── tsconfig.json ├── react-lob-integration/ │ ├── .editorconfig │ ├── .eslintrc.js │ ├── .gitignore │ ├── .npmignore │ ├── .vscode/ │ │ ├── launch.json │ │ └── settings.json │ ├── .yo-rc.json │ ├── README.md │ ├── config/ │ │ ├── config.json │ │ ├── deploy-azure-storage.json │ │ ├── package-solution.json │ │ ├── sass.json │ │ ├── serve.json │ │ └── write-manifests.json │ ├── gulpfile.js │ ├── package.json │ ├── src/ │ │ ├── index.ts │ │ └── webparts/ │ │ └── lobIntegration/ │ │ ├── ICustomer.ts │ │ ├── ILobIntegrationWebPartProps.ts │ │ ├── ILobServiceResponse.ts │ │ ├── LobIntegrationWebPart.manifest.json │ │ ├── LobIntegrationWebPart.ts │ │ ├── components/ │ │ │ ├── ILobIntegrationProps.ts │ │ │ ├── ILobIntegrationState.ts │ │ │ ├── LobIntegration.module.scss │ │ │ ├── LobIntegration.module.scss.ts │ │ │ └── LobIntegration.tsx │ │ └── loc/ │ │ ├── de-de.js │ │ ├── en-us.js │ │ ├── es-es.js │ │ ├── fr-fr.js │ │ ├── mystrings.d.ts │ │ ├── nb-no.js │ │ ├── sv-se.js │ │ └── tr-tr.js │ └── tsconfig.json ├── react-people-directory/ │ ├── .eslintrc.js │ ├── .gitignore │ ├── .npmignore │ ├── .vscode/ │ │ ├── launch.json │ │ └── settings.json │ ├── .yo-rc.json │ ├── README.md │ ├── config/ │ │ ├── config.json │ │ ├── deploy-azure-storage.json │ │ ├── package-solution.json │ │ ├── sass.json │ │ ├── serve.json │ │ └── write-manifests.json │ ├── gulpfile.js │ ├── package.json │ ├── src/ │ │ ├── index.ts │ │ └── webparts/ │ │ └── peopleDirectory/ │ │ ├── PeopleDirectoryWebPart.manifest.json │ │ ├── PeopleDirectoryWebPart.ts │ │ ├── components/ │ │ │ ├── IndexNavigation/ │ │ │ │ ├── IIndexNavigationProps.ts │ │ │ │ ├── IndexNavigation.module.scss │ │ │ │ ├── IndexNavigation.tsx │ │ │ │ └── index.ts │ │ │ ├── PeopleCallout/ │ │ │ │ ├── IPeopleCalloutProps.ts │ │ │ │ ├── IPeopleCalloutState.ts │ │ │ │ ├── PeopleCallout.module.scss │ │ │ │ ├── PeopleCallout.tsx │ │ │ │ └── index.ts │ │ │ ├── PeopleDirectory/ │ │ │ │ ├── IPeopleDirectoryProps.ts │ │ │ │ ├── IPeopleDirectoryState.ts │ │ │ │ ├── IPeopleSearchResults.ts │ │ │ │ ├── IPerson.ts │ │ │ │ ├── PeopleDirectory.module.scss │ │ │ │ ├── PeopleDirectory.tsx │ │ │ │ └── index.ts │ │ │ ├── PeopleDirectory.module.scss │ │ │ ├── PeopleList/ │ │ │ │ ├── IPeopleListProps.ts │ │ │ │ ├── IPeopleListState.ts │ │ │ │ ├── PeopleList.module.scss │ │ │ │ ├── PeopleList.tsx │ │ │ │ └── index.ts │ │ │ └── Search/ │ │ │ ├── ISearchProps.ts │ │ │ ├── Search.module.scss │ │ │ ├── Search.tsx │ │ │ └── index.ts │ │ └── loc/ │ │ ├── de-de.js │ │ ├── en-us.js │ │ ├── es-es.js │ │ ├── fr-fr.js │ │ ├── mystrings.d.ts │ │ ├── nb-no.js │ │ ├── nl-nl.js │ │ ├── sv-se.js │ │ └── tr-tr.js │ └── tsconfig.json ├── react-personal-calendar/ │ ├── .editorconfig │ ├── .eslintrc.js │ ├── .gitignore │ ├── .npmignore │ ├── .vscode/ │ │ ├── launch.json │ │ └── settings.json │ ├── .yo-rc.json │ ├── README.md │ ├── config/ │ │ ├── config.json │ │ ├── deploy-azure-storage.json │ │ ├── package-solution.json │ │ ├── sass.json │ │ ├── serve.json │ │ └── write-manifests.json │ ├── gulpfile.js │ ├── package.json │ ├── src/ │ │ ├── index.ts │ │ └── webparts/ │ │ └── personalCalendar/ │ │ ├── PersonalCalendarWebPart.manifest.json │ │ ├── PersonalCalendarWebPart.ts │ │ ├── components/ │ │ │ ├── IMeeting.ts │ │ │ ├── IPersonalCalendarProps.ts │ │ │ ├── IPersonalCalendarState.ts │ │ │ ├── PersonalCalendar.module.scss │ │ │ ├── PersonalCalendar.tsx │ │ │ ├── SimpleCalendar.module.scss │ │ │ ├── SimpleCalendar.tsx │ │ │ └── index.ts │ │ └── loc/ │ │ ├── de-de.js │ │ ├── en-us.js │ │ ├── es-es.js │ │ ├── fr-fr.js │ │ ├── mystrings.d.ts │ │ ├── nb-no.js │ │ ├── nl-nl.js │ │ ├── sv-se.js │ │ └── tr-tr.js │ └── tsconfig.json ├── react-personal-contacts/ │ ├── .eslintrc.js │ ├── .gitignore │ ├── .npmignore │ ├── .vscode/ │ │ ├── launch.json │ │ └── settings.json │ ├── .yo-rc.json │ ├── README.md │ ├── config/ │ │ ├── config.json │ │ ├── deploy-azure-storage.json │ │ ├── package-solution.json │ │ ├── sass.json │ │ ├── serve.json │ │ └── write-manifests.json │ ├── gulpfile.js │ ├── package.json │ ├── src/ │ │ ├── index.ts │ │ └── webparts/ │ │ └── personalContacts/ │ │ ├── PersonalContactsWebPart.manifest.json │ │ ├── PersonalContactsWebPart.ts │ │ ├── components/ │ │ │ ├── IContacts.ts │ │ │ ├── Person/ │ │ │ │ ├── IPersonProps.ts │ │ │ │ ├── IPersonState.ts │ │ │ │ ├── Person.module.scss │ │ │ │ ├── Person.tsx │ │ │ │ └── index.ts │ │ │ ├── PersonalContacts/ │ │ │ │ ├── IPersonalContactsProps.ts │ │ │ │ ├── IPersonalContactsState.ts │ │ │ │ ├── PersonalContacts.module.scss │ │ │ │ ├── PersonalContacts.tsx │ │ │ │ └── index.ts │ │ │ └── index.ts │ │ └── loc/ │ │ ├── de-de.js │ │ ├── en-us.js │ │ ├── es-es.js │ │ ├── fr-fr.js │ │ ├── mystrings.d.ts │ │ ├── nb-no.js │ │ ├── nl-nl.js │ │ ├── sv-se.js │ │ └── tr-tr.js │ └── tsconfig.json ├── react-personal-email/ │ ├── .editorconfig │ ├── .eslintrc.js │ ├── .gitignore │ ├── .npmignore │ ├── .vscode/ │ │ ├── launch.json │ │ └── settings.json │ ├── .yo-rc.json │ ├── README.md │ ├── config/ │ │ ├── config.json │ │ ├── deploy-azure-storage.json │ │ ├── package-solution.json │ │ ├── sass.json │ │ ├── serve.json │ │ └── write-manifests.json │ ├── gulpfile.js │ ├── package.json │ ├── src/ │ │ ├── index.ts │ │ └── webparts/ │ │ └── personalEmail/ │ │ ├── PersonalEmailWebPart.manifest.json │ │ ├── PersonalEmailWebPart.ts │ │ ├── components/ │ │ │ ├── IMessage.ts │ │ │ ├── IPersonalEmailProps.ts │ │ │ ├── IPersonalEmailState.ts │ │ │ ├── PersonalEmail.module.scss │ │ │ ├── PersonalEmail.tsx │ │ │ └── index.ts │ │ └── loc/ │ │ ├── de-de.js │ │ ├── en-us.js │ │ ├── es-es.js │ │ ├── fr-fr.js │ │ ├── mystrings.d.ts │ │ ├── nb-no.js │ │ ├── nl-nl.js │ │ ├── sv-se.js │ │ └── tr-tr.js │ └── tsconfig.json ├── react-personal-tasks/ │ ├── .editorconfig │ ├── .gitignore │ ├── .npmignore │ ├── .vscode/ │ │ ├── launch.json │ │ └── settings.json │ ├── .yo-rc.json │ ├── README.md │ ├── config/ │ │ ├── config.json │ │ ├── deploy-azure-storage.json │ │ ├── package-solution.json │ │ ├── sass.json │ │ ├── serve.json │ │ └── write-manifests.json │ ├── gulpfile.js │ ├── package.json │ ├── src/ │ │ ├── index.ts │ │ └── webparts/ │ │ └── personalTasks/ │ │ ├── PersonalTasksWebPart.manifest.json │ │ ├── PersonalTasksWebPart.ts │ │ ├── components/ │ │ │ ├── IPersonalTasksProps.ts │ │ │ ├── PersonalTasks.module.scss │ │ │ └── PersonalTasks.tsx │ │ └── loc/ │ │ ├── en-us.js │ │ └── mystrings.d.ts │ └── tsconfig.json ├── react-recent-contacts/ │ ├── .editorconfig │ ├── .eslintrc.js │ ├── .gitignore │ ├── .vscode/ │ │ ├── launch.json │ │ └── settings.json │ ├── .yo-rc.json │ ├── README.md │ ├── config/ │ │ ├── config.json │ │ ├── deploy-azure-storage.json │ │ ├── package-solution.json │ │ ├── sass.json │ │ ├── serve.json │ │ └── write-manifests.json │ ├── gulpfile.js │ ├── package.json │ ├── src/ │ │ ├── index.ts │ │ └── webparts/ │ │ └── recentContacts/ │ │ ├── RecentContactsWebPart.manifest.json │ │ ├── RecentContactsWebPart.ts │ │ ├── components/ │ │ │ ├── IContacts.ts │ │ │ ├── IRecentContactsProps.ts │ │ │ ├── IRecentContactsState.ts │ │ │ ├── RecentContacts.module.scss │ │ │ ├── RecentContacts.tsx │ │ │ ├── index.ts │ │ │ └── person/ │ │ │ ├── IPersonProps.ts │ │ │ ├── IPersonState.ts │ │ │ ├── Person.tsx │ │ │ └── index.ts │ │ └── loc/ │ │ ├── de-de.js │ │ ├── en-us.js │ │ ├── es-es.js │ │ ├── fr-fr.js │ │ ├── mystrings.d.ts │ │ ├── nb-no.js │ │ ├── nl-nl.js │ │ ├── sv-se.js │ │ └── tr-tr.js │ └── tsconfig.json ├── react-recently-used-documents/ │ ├── .editorconfig │ ├── .eslintrc.js │ ├── .gitignore │ ├── .npmignore │ ├── .vscode/ │ │ ├── launch.json │ │ └── settings.json │ ├── .yo-rc.json │ ├── README.md │ ├── config/ │ │ ├── config.json │ │ ├── deploy-azure-storage.json │ │ ├── package-solution.json │ │ ├── sass.json │ │ ├── serve.json │ │ └── write-manifests.json │ ├── gulpfile.js │ ├── package.json │ ├── src/ │ │ ├── index.ts │ │ └── webparts/ │ │ └── recentlyUsedDocuments/ │ │ ├── RecentlyUsedDocumentsWebPart.manifest.json │ │ ├── RecentlyUsedDocumentsWebPart.ts │ │ ├── components/ │ │ │ ├── BrandIcons.ts │ │ │ ├── IRecentDocuments.ts │ │ │ ├── IRecentlyUsedDocumentsProps.ts │ │ │ ├── IRecentlyUsedDocumentsState.ts │ │ │ ├── RecentlyUsedDocuments.module.scss │ │ │ ├── RecentlyUsedDocuments.tsx │ │ │ └── index.ts │ │ └── loc/ │ │ ├── de-de.js │ │ ├── en-us.js │ │ ├── es-es.js │ │ ├── fr-fr.js │ │ ├── mystrings.d.ts │ │ ├── nb-no.js │ │ ├── nl-nl.js │ │ ├── sv-se.js │ │ └── tr-tr.js │ └── tsconfig.json ├── react-recently-visited-sites/ │ ├── .editorconfig │ ├── .eslintrc.js │ ├── .gitignore │ ├── .npmignore │ ├── .vscode/ │ │ ├── launch.json │ │ └── settings.json │ ├── .yo-rc.json │ ├── README.md │ ├── config/ │ │ ├── config.json │ │ ├── deploy-azure-storage.json │ │ ├── package-solution.json │ │ ├── sass.json │ │ ├── serve.json │ │ └── write-manifests.json │ ├── gulpfile.js │ ├── package.json │ ├── src/ │ │ ├── index.ts │ │ └── webparts/ │ │ └── recentlyVisitedSites/ │ │ ├── RecentlyVisitedSitesWebPart.manifest.json │ │ ├── RecentlyVisitedSitesWebPart.ts │ │ ├── components/ │ │ │ ├── IRecentWebs.ts │ │ │ ├── IRecentlyVisitedSitesProps.ts │ │ │ ├── IRecentlyVisitedSitesState.ts │ │ │ ├── IWebs.ts │ │ │ ├── RecentlyVisitedSites.module.scss │ │ │ ├── RecentlyVisitedSites.tsx │ │ │ └── index.ts │ │ └── loc/ │ │ ├── de-de.js │ │ ├── en-us.js │ │ ├── es-es.js │ │ ├── fr-fr.js │ │ ├── mystrings.d.ts │ │ ├── nb-no.js │ │ ├── nl-nl.js │ │ ├── sv-se.js │ │ └── tr-tr.js │ └── tsconfig.json ├── react-site-information/ │ ├── .editorconfig │ ├── .eslintrc.js │ ├── .gitignore │ ├── .npmignore │ ├── .vscode/ │ │ ├── launch.json │ │ └── settings.json │ ├── .yo-rc.json │ ├── README.md │ ├── config/ │ │ ├── config.json │ │ ├── deploy-azure-storage.json │ │ ├── package-solution.json │ │ ├── sass.json │ │ ├── serve.json │ │ └── write-manifests.json │ ├── gulpfile.js │ ├── package.json │ ├── src/ │ │ ├── index.ts │ │ └── webparts/ │ │ └── siteInformation/ │ │ ├── ISiteInformationWebPartProps.ts │ │ ├── SiteInformationWebPart.manifest.json │ │ ├── SiteInformationWebPart.ts │ │ ├── components/ │ │ │ ├── ISiteInformationProps.ts │ │ │ ├── SiteInformation.module.scss │ │ │ └── SiteInformation.tsx │ │ └── loc/ │ │ ├── de-de.js │ │ ├── en-us.js │ │ ├── es-es.js │ │ ├── fr-fr.js │ │ ├── mystrings.d.ts │ │ ├── nb-no.js │ │ ├── nl-nl.js │ │ ├── sv-se.js │ │ └── tr-tr.js │ └── tsconfig.json ├── react-tiles/ │ ├── .editorconfig │ ├── .eslintrc.js │ ├── .gitignore │ ├── .npmignore │ ├── .vscode/ │ │ ├── launch.json │ │ └── settings.json │ ├── .yo-rc.json │ ├── README.md │ ├── config/ │ │ ├── config.json │ │ ├── deploy-azure-storage.json │ │ ├── package-solution.json │ │ ├── sass.json │ │ ├── serve.json │ │ └── write-manifests.json │ ├── gulpfile.js │ ├── package.json │ ├── src/ │ │ ├── index.ts │ │ └── webparts/ │ │ └── tiles/ │ │ ├── ITileInfo.ts │ │ ├── TilesWebPart.manifest.json │ │ ├── TilesWebPart.ts │ │ ├── components/ │ │ │ ├── ITilesProps.ts │ │ │ ├── Tile/ │ │ │ │ ├── ITileProps.ts │ │ │ │ ├── Tile.module.scss │ │ │ │ └── Tile.tsx │ │ │ ├── Tiles.module.scss │ │ │ └── Tiles.tsx │ │ └── loc/ │ │ ├── de-de.js │ │ ├── en-us.js │ │ ├── es-es.js │ │ ├── fr-fr.js │ │ ├── mystrings.d.ts │ │ ├── nb-no.js │ │ ├── nl-nl.js │ │ ├── sv-se.js │ │ └── tr-tr.js │ └── tsconfig.json ├── react-weather/ │ ├── .editorconfig │ ├── .eslintrc.js │ ├── .gitignore │ ├── .npmignore │ ├── .vscode/ │ │ ├── launch.json │ │ └── settings.json │ ├── .yo-rc.json │ ├── README.md │ ├── config/ │ │ ├── config.json │ │ ├── copy-assets.json │ │ ├── deploy-azure-storage.json │ │ ├── package-solution.json │ │ ├── sass.json │ │ ├── serve.json │ │ └── write-manifests.json │ ├── gulpfile.js │ ├── package.json │ ├── src/ │ │ ├── index.ts │ │ └── webparts/ │ │ └── weather/ │ │ ├── WeatherWebPart.manifest.json │ │ ├── WeatherWebPart.ts │ │ ├── components/ │ │ │ ├── IWeatherData.ts │ │ │ ├── IWeatherProps.ts │ │ │ ├── IWeatherState.ts │ │ │ ├── Weather.module.scss │ │ │ ├── Weather.tsx │ │ │ └── index.ts │ │ └── loc/ │ │ ├── en-us.js │ │ └── mystrings.d.ts │ └── tsconfig.json ├── react-world-clock/ │ ├── .editorconfig │ ├── .eslintrc.js │ ├── .gitignore │ ├── .npmignore │ ├── .vscode/ │ │ ├── launch.json │ │ └── settings.json │ ├── .yo-rc.json │ ├── README.md │ ├── config/ │ │ ├── config.json │ │ ├── deploy-azure-storage.json │ │ ├── package-solution.json │ │ ├── sass.json │ │ ├── serve.json │ │ └── write-manifests.json │ ├── gulpfile.js │ ├── package.json │ ├── src/ │ │ ├── index.ts │ │ └── webparts/ │ │ └── worldClock/ │ │ ├── IWorldClockWebPartProps.ts │ │ ├── WorldClockWebPart.manifest.json │ │ ├── WorldClockWebPart.ts │ │ ├── components/ │ │ │ ├── Clock.module.scss │ │ │ ├── Clock.tsx │ │ │ ├── IWorldClockProps.ts │ │ │ ├── Timezones.ts │ │ │ ├── WorldClock.module.scss │ │ │ └── WorldClock.tsx │ │ └── loc/ │ │ ├── en-us.js │ │ └── mystrings.d.ts │ └── tsconfig.json └── templates/ ├── resources/ │ ├── collabcommunicationsite.json │ ├── collabteamsite.json │ ├── documents/ │ │ └── Contoso_Report.pptx │ ├── resources-core.de-de.resx │ ├── resources-core.en-us.resx │ ├── resources-core.es-es.resx │ ├── resources-core.fr-fr.resx │ ├── resources-core.nb-no.resx │ ├── resources-core.nl-nl.resx │ ├── resources-core.sv-se.resx │ └── resources-core.tr-tr.resx ├── starterkit-spfx-only.xml └── starterkit.xml ================================================ FILE CONTENTS ================================================ ================================================ FILE: .deployment ================================================ [config] project = assets/functions ================================================ FILE: .github/CONTRIBUTING.md ================================================ # Contribute to SharePoint Starter Kit Solution Below instructions explain how you can prepare your environment to contribute to SharePoint Portal Showcase Solution. ## SP Starter Kit repo structure TBD ## Forking SharePoint Starter Kit repository The first step is registering yourself on GitHub. Go to https://github.com/ and click on the "Sign up for GitHub" button. Once you're registered ensure you're logged on with your new account and navigate to the Office 365 Developer Patterns and Practices repository at https://github.com/sharepoint/sp-starter-kit. The right top side of the page contains a button called "Fork": ![Fork the sp-dev-docs github repository](../images/contribute-fork-docs-repo.png) Clicking on this button will Fork the SharePoint developer documentation repository to your GitHub account. It's actually like taking a copy. Select your personal GitHub account you registered earlier as the account to for this repository. Once the forking has been done you'll find the docs repo under your account with an URL: https://github.com/YOUR-USERNAME/YOUR-REPOSITORY ## Clone the forked repository Now that you have forked the docs repository, to sync this forked repository to your local machine, you will need to clone the repository. You can find the clone URL in the `Clone or download` dropdown in the repo page. ![Clone the forked SharePoint developer docs repository](../images/contribute-docs-clone-options.png) If you have any Git Desktop or any git source control installed, you can click the `Open is Desktop`, else follow the steps below: In the Clone with HTTPs section, click to copy the clone URL for the repository. * Open your favorite console terminal. * Change the current working directory to the location where you want to clone the docs repository. * Type the following command to clone the repository: ``` git clone https://github.com/YOUR-USERNAME/YOUR-REPOSITORY ``` Press Enter and your local clone will be created. ``` git clone https://github.com/YOUR-USERNAME/YOUR-REPOSITORY Cloning into 'sp-dev-docs'... remote: Counting objects: 10, done. remote: Compressing objects: 100% (8/8), done. remove: Total 10 (delta 1), reused 10 (delta 1) Unpacking objects: 100% (10/10), done. ``` ## Switch to `master` branch In order to add your changes, you will need to do those in the `master` branch. Type the following command in the console to switch to `master` branch: ``` git checkout master ``` Now, you can update existing docs or add new docs to the docs repo. ### Adding new docs Make sure you upload your doc in the right folders. For instance, web part docs should be in the following folder: ``` docs\spfx\web-parts ``` Depending on the doc's intent, you can choose to add your doc into `basics` or `get-started` folder. ## Submit a pull request Once you have completed adding your changes, you can submit a pull request. Navigate to the forked sp-dev-docs repo in your account. Make sure your current branch is `master` branch. Once you are in the `master` branch, you should see a message to `Compare & pull request` ![Submit a pull request to sp-dev-docs repo](../images/contribute-docs-submit-pr.png) This will start a new pull request. Make sure you use the following [template]() to fill in your changes. Make sure you are creating this pull request against the `master` branch. Once you have all the information, click the `Create pull request` to submit your pull request. ## Syncing your forked repository to keep it up-to-date with the upstream repository In order to keep your forked sp-dev-docs repo up-to-date with the parent repository, you will need to first [configure a remote that points to upstream repository](https://help.github.com/articles/configuring-a-remote-for-a-fork). Once you have configured the upstream repository, follow the steps [here](https://help.github.com/articles/configuring-a-remote-for-a-fork) to sync your fork to keep it up-to-date with the upstream repository. ================================================ FILE: .github/ISSUE_TEMPLATE/---bug.md ================================================ --- name: "\U0001F41E Bug" about: Report an anomaly or unexpected behavior from this repository. title: '' labels: '' assignees: '' --- > Please note that issues that do not follow this template will automatically be rejected. > > Use the following form to submit an issue only if it's related to samples in this repo. If you have an issue related to the SharePoint Framework or its documentation, please submit the issue at [https://github.com/SharePoint/sp-dev-docs/issues/new](https://github.com/SharePoint/sp-dev-docs/issues/new). This will help us respond to your issue faster. > > ---- > > Thank you for reporting an issue. We appreciate your feedback - to help the team to understand your needs, please complete the below template to ensure we have the necessary details to assist you. > > _(DELETE THIS PARAGRAPH AFTER READING)_ ## Category - [x] Bug ## Describe the bug #### Expected or Desired Behavior > When reporting a bug, please describe the behavior you expected to occur when performing the action. > > _(DELETE THIS PARAGRAPH AFTER READING)_ > #### Observed Behavior >When reporting a bug, please describe the behavior you are observing when performing the action. > > _(DELETE THIS PARAGRAPH AFTER READING)_ > #### Steps to Reproduce > When reporting a bug please describe the steps to reproduce the bug in sufficient detail to allow testing. Only way to fix things properly, is to have sufficient details to reproduce it. If you are making a suggestion, you can delete this section. > > _(DELETE THIS PARAGRAPH AFTER READING)_ > ## Environment Details (*Development & Target environment*) > **DELETE THIS LINE BEFORE SUBMITTING** - Complete the following (*if ignored you'll be prompted for it before we can address your issue... save the time and provide it in your initial submission*). - **Starter kit version**: [e.g. v2 for current version, v1 for legacy solution] - **OS**: [e.g. Windows 10 | MacOS 10.15.x] - **Target Environment**:[SharePoint Server 2019 | SharePoint Online] - **Framework**: [Node.js v6/v8/v10/v12] - **PnPPowerShell Version** : [e.g 3.22.2006.2.] - **Browser(s)**: [e.g. Chrome v79 | Safari v22 | FireFox v31 | IE v11 | Edge | Chromium Edge v79] - **Additional details**: *The more context you can provide, the easier it is (and therefore quicker) to help.* ## Guidelines for issue creator (DELETE AFTER READING) > - All bug reports are welcome, please let us know what's on your mind. > - Remember that this repository is maintained by community members who volunteer their time to help. Be courteous and patient. > - If you have technical questions about the framework, we’ll be monitoring #spfx, #spfx-webparts, and #spfx-tooling on (SharePoint StackExchange)> [http://sharepoint.stackexchange.com/]. You can also alternatively submit your question to (SharePoint Developer group)> [https://techcommunity.microsoft.com/t5/sharepoint-developer/bd-p/SharePointDev] in the Microsoft Tech Community. > - Remember to include sufficient details and context. > - If you have multiple suggestions or bugs please submit them in separate bugs so we can track resolution. > _(DELETE THIS SECTION AFTER READING)_ Thanks for your contribution! Sharing is caring. ================================================ FILE: .github/ISSUE_TEMPLATE/---enhancement.md ================================================ --- name: "\U0001F4A1 Enhancement" about: Suggest an enhancement to this repository title: '' labels: '' assignees: '' --- ## Category - [x] Feature request ## Is your feature request related to a problem? > **DELETE THIS LINE BEFORE SUBMITTING** - Provide clear & concise description of what the problem is. ## Describe the solution you'd like > **DELETE THIS LINE BEFORE SUBMITTING** - Provide a clear and concise description of what you want to happen. ## Describe alternatives you've considered > **DELETE THIS LINE BEFORE SUBMITTING** - Provide a clear and concise description of any alternative solutions or features you've considered. ## Additional context > **DELETE THIS LINE BEFORE SUBMITTING** - Provide any other context or screenshots about the feature request here. *Thanks for your contribution! Sharing is caring.* ================================================ FILE: .github/ISSUE_TEMPLATE/--question.md ================================================ --- name: "❓ Question" about: Ask a question regarding the PnP Starter Kit title: '' labels: '' assignees: '' --- > Please note that issues that do not follow this template will automatically be rejected. > > Use the following form to submit ask a question related to this repo. If you have an issue related to the SharePoint Framework or its documentation, please submit the issue at [https://github.com/SharePoint/sp-dev-docs/issues/new](https://github.com/SharePoint/sp-dev-docs/issues/new). This will help us respond to your issue faster. > > ---- > > Thank you for asking a question. We appreciate your feedback - to help the team to understand your needs, please complete the below template to ensure we have the necessary details to assist you. > > _(DELETE THIS PARAGRAPH AFTER READING)_ ## Category - [x] Question ## Question > _Provide as many details as possible to help the community answer your question._ > > _(DELETE THIS PARAGRAPH AFTER READING)_ ## Guidelines for issue creator (DELETE AFTER READING) > - All questions are welcome, please let us know what's on your mind. > - Remember that this repository is maintained by community members who volunteer their time to help. Be courteous and patient. > - If you have technical questions about the framework, we’ll be monitoring #spfx, #spfx-webparts, and #spfx-tooling on (SharePoint StackExchange)> [http://sharepoint.stackexchange.com/]. You can also alternatively submit your question to (SharePoint Developer group)> [https://techcommunity.microsoft.com/t5/sharepoint-developer/bd-p/SharePointDev] in the Microsoft Tech Community. > - Remember to include sufficient details and context. > - If you have multiple suggestions or bugs please submit them in separate bugs so we can track resolution. > _(DELETE THIS SECTION AFTER READING)_ Thanks for your contribution! Sharing is caring. ================================================ FILE: .github/ISSUE_TEMPLATE.md ================================================ > Thank you for reporting an issue or suggesting an enhancement. We appreciate your feedback - to help the team to understand your needs, please complete the below template to ensure we have the necessary details to assist you. > > _(DELETE THIS PARAGRAPH AFTER READING)_ > #### Category - [ ] Question - [ ] Bug - [ ] Enhancement > For the above list, an empty checkbox is [ ] as in [SPACE]. A checked checkbox is [x] with no space between the brackets. Use the `PREVIEW` tab at the top right to preview the rendering before submitting your issue. > > _(DELETE THIS PARAGRAPH AFTER READING)_ > #### Expected or Desired Behavior > If you are reporting a bug, please describe the expected behavior. If you are suggesting an enhancement please describe thoroughly the enhancement, how it can be achieved, and expected benefit. > > _(DELETE THIS PARAGRAPH AFTER READING)_ > #### Observed Behavior > If you are reporting a bug, please describe the behavior you expected to occur when performing the action. If you are making a suggestion, you can delete this section. > > _(DELETE THIS PARAGRAPH AFTER READING)_ > #### Steps to Reproduce > If you are reporting a bug please describe the steps to reproduce the bug in sufficient detail to allow testing. Only way to fix things properly, is to have sufficient details to reproduce it. If you are making a suggestion, you can delete this section. > > _(DELETE THIS PARAGRAPH AFTER READING)_ > #### Submission Guidelines > - All suggestions or bugs are welcome, please let us know what's on your mind. > - If you are reporting an issue on generic SharePoint topic or dev documentation, please use the (sp-dev-docs Issue list)[http://aka.ms/spdev-issues] > - If you have technical questions about the framework, we’ll be monitoring #spfx, #spfx-webparts, and > #spfx-tooling on (SharePoint StackExchange)[http://sharepoint.stackexchange.com/]. You can also > alternatively submit your question to (SharePoint Developer group)> [https://network.office.com/t5/SharePoint-Developer/bd-p/SharePointDev] at Office Network. > - Remember to include sufficient details and context. > - If you have multiple suggestions or bugs please submit them in separate bugs so we can track resolution. > > _(DELETE THIS PARAGRAPH AFTER READING)_ > Thanks for your contribution! Sharing is caring. ================================================ FILE: .github/PULL_REQUEST_TEMPLATE.md ================================================ #### Category - [ ] Bug Fix - [ ] New Feature - Related issues: fixes #X, partially #Y, mentioned in #Z > For the above list, an empty checkbox is [ ] as in [SPACE]. A checked checkbox is [x] with no space between the brackets. Use the `PREVIEW` tab at the top right to preview the rendering before submitting your issue. > > _(DELETE THIS PARAGRAPH AFTER READING)_ #### What's in this Pull Request? > Please describe the changes in this PR. Sample description or details around bugs which are being fixed. > > _(DELETE THIS PARAGRAPH AFTER READING)_ #### Guidance > *Please update this PR information accordingly. We'll use this as part of our release notes in monthly communications.* > > *Please target your PR to 'dev' branch and it will be merged to `master` by the people in the core team together with the other possible changes.* > > _(DELETE THIS PARAGRAPH AFTER READING)_ ================================================ FILE: .gitignore ================================================ # Logs logs *.log npm-debug.log* yarn-debug.log* yarn-error.log* # Runtime data pids *.pid *.seed *.pid.lock # Directory for instrumented libs generated by jscoverage/JSCover lib-cov # Coverage directory used by tools like istanbul coverage # nyc test coverage .nyc_output # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) .grunt # Bower dependency directory (https://bower.io/) bower_components # node-waf configuration .lock-wscript # Compiled binary addons (http://nodejs.org/api/addons.html) build/Release # Dependency directories node_modules/ jspm_packages/ # Typescript v1 declaration files typings/ # Optional npm cache directory .npm # Optional eslint cache .eslintcache # Optional REPL history .node_repl_history # Output of 'npm pack' *.tgz # Yarn Integrity file .yarn-integrity # dotenv environment variables file .env .DS_Store # Visual Studio Ignore files # Exclude NuGets, obj, debug of sample-lob-service sample-lob-service/SharePointPnP.LobScenario/packages sample-lob-service/SharePointPnP.LobScenario/SharePointPnP.LobScenario.Data/obj sample-lob-service/SharePointPnP.LobScenario/SharePointPnP.LobScenario.Data/bin sample-lob-service/SharePointPnP.LobScenario/SharePointPnP.LobScenario.Web/obj sample-lob-service/SharePointPnP.LobScenario/SharePointPnP.LobScenario.Web/bin # User-specific files *.suo *.user *.userosscache *.sln.docstates # User-specific files (MonoDevelop/Xamarin Studio) *.userprefs # Build results [Dd]ebug/ [Dd]ebugPublic/ [Rr]elease/ [Rr]eleases/ x64/ x86/ bld/ [Bb]in/ [Oo]bj/ [Ll]og/ # Visual Studio 2015/2017 cache/options directory .vs/ # Uncomment if you have tasks that create the project's static files in wwwroot #wwwroot/ # Visual Studio 2017 auto generated files Generated\ Files/ # MSTest test Results [Tt]est[Rr]esult*/ [Bb]uild[Ll]og.* # NUNIT *.VisualState.xml TestResult.xml # Files built by Visual Studio *_i.c *_p.c *_i.h *.ilk *.meta *.obj *.iobj *.pch *.pdb *.ipdb *.pgc *.pgd *.rsp *.sbr *.tlb *.tli *.tlh *.tmp *.tmp_proj *.log *.vspscc *.vssscc .builds *.pidb *.svclog *.scc # Visual Studio profiler *.psess *.vsp *.vspx *.sap # Visual Studio Trace Files *.e2e # Publish Web Output *.[Pp]ublish.xml *.azurePubxml # Note: Comment the next line if you want to checkin your web deploy settings, # but database connection strings (with potential passwords) will be unencrypted *.pubxml *.publishproj # Microsoft Azure Web App publish settings. Comment the next line if you want to # checkin your Azure Web App publish settings, but sensitive information contained # in these scripts will be unencrypted PublishScripts/ # NuGet Packages *.nupkg # The packages folder can be ignored because of Package Restore **/[Pp]ackages/* # except build/, which is used as an MSBuild target. !**/[Pp]ackages/build/ # Uncomment if necessary however generally it will be regenerated when needed #!**/[Pp]ackages/repositories.config # NuGet v3's project.json files produces more ignorable files *.nuget.props *.nuget.targets # Microsoft Azure Build Output csx/ *.build.csdef # Microsoft Azure Emulator ecf/ rcf/ # Others ClientBin/ ~$* *~ *.dbmdl *.dbproj.schemaview *.jfm *.pfx *.publishsettings orleans.codegen.cs package-lock.json # SQL Server files *.mdf *.ldf *.ndf # MSBuild Binary and Structured Log *.binlog *.yaml package-lock.json package-lock.json ================================================ FILE: .tours/spo-solution-overview.tour ================================================ { "title": "Solution Overview", "steps": [ { "directory": ".", "description": "# Welcome to the SharePoint Starter Kit Solution Overview\r\n\r\n![Parker](data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAACDCAYAAAB7o75uAAAACXBIWXMAAAXYAAAF2AEJGiq9AAAAB3RJTUUH5AYaAR4ngWxR7AAAIABJREFUeJzUnXd0VVX69z/73H5vOklIgVQg9N47KIhYALuMXeyOXceZsY1dERVFEERFBbEBAhZQkd47ofeSQkhC2u3n3r3fP24ICWngODO/97vWzVo5Z5/dnrP3fvoR/H8EKWVLoCvQE+gItBVCJJ25r5QKAMeArZW/lcA2TdMq/gfd/f8XUsrBUsrVSqm7zr2nlOokpXxZSrldShlUFwgp5Skp5Uwp5aX/i7H9fwkp5YRqE7hYStlOStlfSvm9lDJwoURogDjrpJTX/a/H+38eUsofz5k477858Y3dXyWlHPy/Hvf/SSilNCnlTqWU8vv9yufz/Tu0UAUn81VxUeH5Eu4DpVTk/3oOqkP7X3cAEEBTAJ/Px84d2/+tyg4d2H/+DQtxv1JqtZSy77/V6J+I/zlBlFKPANEAYWFh+P06BSfz/1Bduq6Tn59PZGTU+bQLgBCiHbBESnnfH2r0T8b/jCBKKYOU8gMhxFtCCMOZ62kZGezaufMP1VmQn09ZaSkGo7HBcocPHsDv81X9L4SwCiEmSynf/kMN/4n4nxBEKRWhlJovhLj/3HsJCQk4nS5KTp++4Hr37tmNyWxusExR4SmOHD6ExWqtdU8I8aiUcrZSynLBjf9J+K8TRCnVVCn1sxDisvrKpGdksGXLlguue2f2DmKaNGmwzO+//UKz5in13hdC3KCUmvu/Isp/lSBSykSl1GIhRIOHaFbr1hw7dgy/339B9R86eICwsPB67+fmnGDf3r20bNW6wXqEECOVUnP+F0T5rxFEShkL/CyE6HTmmq7r+Krt5WdgNpuJjolh29ZtDda5c8c2pAwC4Ha5yM3JoUlsbL3lv5o1k5atstAMdQ9739497NgWWplCiMuUUt8qpf6rL+1/pTGllAP4vjoxKq+zZ2d2nc9069aNzVs2N1jv5o0bOXH8OBA6G4pPF9Gkni0rNzeHlcuXctGwS2q0fwa/LPqJL2Z8Qmp6ZtU1IcQVSqkZDXbiT0bD7MifAKWUUEp9KYTod+49s9lMRUUF+Xm5JCYl17iXkpKCx+0hJyeHZs2a1arX5/VyYP8+Nm3aQLfuPTh86BBer48tmzYxYNBgwiMiapT/8P33SE1LJy4+HoBjRw4TFh5Bk9hYvpr1BZ9O/4iPP59JZGRNOVEIcbOUMl/TtL/925PxfwFSykkNScsH9u1T8777ps57P//0s5oxY0aNazu2bVUT3nhNXXXFSNWne2fVuW0r1T4rU3Vul6X6dO+sundqpy4bPlQ98/STauWypUoppQ4dPKDatUxXi38KaWjcbrf6aubnSimlvvj0Y9WieaJa9vtvjUn1d/435us/ukKklH8VQjzQUJn0zAzmfvs1ZWWltQS6vn37MOHtt/F4PKxdvYpvvvqSLZs24nK7MJvNGI0mNIMBkxAITeD3+xBCIz8/n2Pz5vDDgvn06t2H8ooKYmJi6Nm7DwA/zJ9HfNMEFsybwz+efop77nuAQUMuamw4k6WUezRNW/PvzElj+I8RpFJ5905j5QwGIzFNmvDjgvmMvfnWGvciIiOx2+1ce9UY8nOO4fF60TQNo8GI3e4gKiqKyMgozBYLgUAA3e+jtKSU0yWnQYHQBOvXr8XlcnHV1dcQFR1NSclpli/9nc5du/LOW+Np36EjDz/2RI12/X4/xUVFJCZVmVoQQpiVUrOVUj2FEAV/yiTVgf8IQSpljS+qS+DVcezIEZqnpqJpIZ6i/6DBvPjcP7n6uhuwWM5yml/N/JyF8+ZwqrgEuxGSk5Pp0bM3PXr2omVWFvFNm2Kz2QlKydGjR8lIT8flrOD4sWNs27qZpUuWsH/fXswmM337DQTgyy8+Z9fOHezevQspJY89+RRh4TVZ5SOHD+NwOGr1WwiRopT6FBj5Z83VfwXnqtPPxa4d29XWzZtqXLtm1GXqq1lfKKWUCgYCavxrr6g2LVJVm8xU1bZNW/XuhPEqNzenqnxQSuXz+5XX61Vuj0etXbdeef1+pQfOmk+8Xq+aMmmi6tW1ozp1qkCVlZaqoQP6qK4d2qj2WZnq4QfurdU3t9ullvz6S4MqfCnl0/+pufvT2V4p5WNCiAbfoBatsli3ZjVul6vqWv+Bg5k+9UOKi4p49cUX+GDSe5jNFu65736uvvZaUjOzSEpKxuV24XK78Xg86LpOIBgEpSguKsLjdqPrOm6PB7fHg8VioX2HjrTOak1cXDzTp07h+PFjWCwWLBYzd91TS3PDpg0bSUlJQwjR0BBelFL2rOuGUkpTSjX4cEP4UwkipewAvNpYObPFQmxcHN9+/WXVtYsuHsbp08XcdcctzJr1Belpabw2fgIPP/4Uo0eP5scffwxJ7goq/1TBaDJSXl6Os6Kiahs8g9OnT9On/wDKykpxu120apWFx+NGKVi5YhllpaX4/SHhtLioiIKCAlq0atlg/4UQJuBjKeW9Usp3pZTfSCmXSCnXKqV2KKW2VxrBXj6viftPQIUMTRsa2qqqo6TktBp7zRiVmxPahvx+n7pm1GUqo1mCGjXyErVn9y6llFIut0u53W510823qfXrN6hAQFcVFRWqwulUTpdLOV0uFZRBNeXDqWrf/gPK7/crl9utXG63CiqlVi5fqnZs26p+XfSTysvNVbt37VRD+vVSXdpnqW4d2qhLhg5UG9auUUopNfvLWerQoYPnO4RGIaVccaHz+GeukCeFED3Ot3BUVDRt2rVj4oTxAJhMZjp07EzzlBQmfjCF1m3aUlFRTjAYxGaz0bFjexYtXozBUMmHKFUlaWtCw+fzcfJkPkajESqvB3SdtPRMwiMisFqtNE1IoE3bdrzyxngsFit6IIDb7aZzt24cPHAAv89PRkZmnf1tDMFgkF3Z2WzeuKH6VjzpQuv5UwgipWyllHr+Qp8be/OtLF/2O5s2rAega/cetGjZiuapaVQ4nYAABYGAzpAhg9m8ZStlZWUYDJXMm1Kc2b4MmoHTp0vO7v1Koes6CUlJWCwW2nboSDAYpKioiD79BvDMCy+iCUFZWSkzP5vBb0uWMHzEiD80/s2bNrFg/vcgoEOnztgdDpRSh4QQ8y+0rj9rhbwrhLBd6EMZmS1oEhvHm6+9AkCv3n2wWiyUnC7GZDZB5eT6fH7at2+H0Whkzdp12GwhW4amaVittqqROCvfTLPFUnWWCKBJbByRUdGcOHGCvNw8pJRcdvmV3PvAg8hAkFdeeZmoqCgSEhIuqP9Hjx5l2tSp5ObmMvySEbRr3wHzWXvMe0KI2prTRvBvE0RKeZUQ4g/5PH339Wzy8nLZtXMHMz/7lLj4eNIzMjh58iQ7s3ditphRoTawWqz07tWTH3/8CRCEhYUBkL1jBz/8+BObNm5mxYqVLF+xkqNHj2E0GnHY7RgMBqSUBAIBsrN3ktwsGV3X8ft17rn/Qa4YfRVlFW42rll1QX3/5puv+frrrxgydChXjhpVQ25RSh0DPvkjc/JvCYZKKZtS6o3q13Q9ZBO32x0NGosK8vN5/dWXueHGv9Czd2/eePVlLh5+Cd169MRsNrNtRzYul4uBAwdQUV5BIKAzbNjFPPnU0xw4cIBNm7fw3Zy57N23H6fLhcVsQQj4bcnvxERH0zori1GjruCKy0ZitdnYvWcPSimaNGmCx+MhtNWZSErLJD2lOQvnz+OiYcMZecWVDY65oKCAiRMnkpGRwRNPPHl2+6wGIcTzQgjnH5nTP8wvA0gpnxZCvFb9WjAYpPDUKXJzcygtKcHucJDZoiXxlVrWM3j8oQfYsnkTX3+/kPi4eH5d/DPbt27hmutuxOlyEhsfz9N/f4aXXnyB+Lg4DAYNKRXXXH8jubm5lJSUAgKrzYqhGqurlCIYDOLxekEp2rRuzd133YnT6aRfv76kpqTg8/mw2+0sW7GCxYt/4bJLLub+u8eRkJDInIU/Eh5eU1N8BitXrmT69OnccsstXHRR3bovpdRSIcTQRuSYelGnauN8IKVMAL489+zQNI2w8HCSkpJJTErC5XKydetWtm3dSjAYJCExkU3r1/Hqyy/y3Euv0LlbN8rLymjdph1KKiwWM0nJzYmNjeXAwYN88+23XH3VVZSUlPLCv15i46bNeDw+rFYrZrMZ7ZyBCyHQNA2L2YzZbKag4BQ//byIY8eOM2LEcOLj4gDweDy8+trrjL3xenr37Yvu15k351scdge9+9ayFDBjxgxmz57Niy++SLdu3eqcE6WUHxitaVrhH53XP7xCpJQThRAPnW/548ePs3rVKsrKK/h+zte0bNGC96dMo6y8HKkkGgKTyYRSCpPJRCCgU+F0ct31f6Fz507k5OayYcNGIiMjG5Oia0EphdfrJSY6muefe4bLRl7KhAlv43K7efyxR3G6XYDisQfuZ/vWrSxc/Cvp1djfl195hd279/D+exPrNYBVthMAxmia9sMFdbAa/tChLqVMA2o5RjeElJQUbhw7FpMBdu3egz2yCVu2biMsPAyj0YiqZFMDgUDlL0jT+KZ06dKZz7+YxY4d2URHR18wMSC0aux2OyWlpTzx1NM8+/y/OHDwELffdgtOl5OArmO12njw0ccIBoO89/aEqmcff+JJsndk8/H0jxokRmU7RuBNpZTpgjtZiT/KZT3zR9hct8vFVzM/59677+KWW25m1sxZvDX+bXw+H47wsKpyuq4TERHBr7/+xqrVa0hIaIrVaq1hcr1QKKWw2WwITWPyh1OJiAinaXw8SiqEELicTjp06swdd9/Dwvnz2LR+Hc89/wLHjx3js89mYLOd33CFEG2UUjf90X5e8OtWGaOxUwjRsANUHZg2+QOmT5vCN/N/IDUlBbfHw2effcGatet48IH76N2rF2VlZURGRrB69Vruf/Ah3B4PNpvt3yLGuQgGA/h8Pu4Zdyf3338vfl3H6/ViNBrRdZ2nHv4rG7dn06NXH6ZP/RCb3X5B9Suljggh2gkhPBfatz+yQh75I8Q4XVzMJ9OncvPtd9A8NZXS0lICgSD333cv99w9jldfe4MvvphFZGQk2dk7eeSxJ3C63I0Sw6/rOJ1OKioqqKhw4nK7CQQC9ZZXhFaEyWRi0pQPmTrtI4oKQ2dwMBgkNjaWxLRMjufkcfMN110wMQCEEOlKqdsu+EEucIVIKVOA3UKI2tabRjBxwni++/Zrvp3/A2FhYQR0HVXZfERkOEePHuMff3+WLl06s279erbvyCY8PLxOYiilcLncBINBUlOa06lTB+Ji4/D6fJzIyWHv3r0UFRVjs9mqGIWzz8qq/6WUeDweMjIy+PTjaSQmJjB9+ifM+HwWzZvGYEAxe873dcoajUEpdVAI0VYIoV/IcxcqGN7/R4hxMj+fmZ/P4P6HHiYuPp6KsrIa98vKyslIz2D8G68y8orRuL3eOomhlMLpdBITE8OQQQOJiYnh2muvJikpCSkVUgbRdZ3jJ07w88+LmL/gB5xOJ/Zqb3n1OjVNw2KxkJeXR3FxMYcOH+a1N8bz9oTxtGnVkuvHjGLh93MZffW1FzpkhBAtlFI3Ap9f0HPnW1ApFaWUOiCEqN8TrR688epL/LLoZ76etwCLxUIwEKhaHYgQFxQZHsFbb7/D1GnTsVqttbgpKRVWq4Ue3buxdOlyPpwyiYED+lNUXIzX60MqhZLBkPxtNGGxmNm+fQcT3n6Xvfv3Y7NaK7k5Wat/Pp+fNm2yKDhZwMCBA/jXC88B8OJzz7Bl00Z+XPw7ZssF79IopXYIIboIIWo3Wg/O+wxRSt30R4hxuriYed99y8233U5MTAzBc/Z3pRQRERH89PMiPvxwGmazuU7WVtf9OBwO3njtFa677ho+/uRTyssr0HW9Vn0+n4/S0jLatm3Da6+9RL/evUlKSgQUStaeG6vVwrZt27HabDzx2CO43W68Xi+33H4HRYVFLPh+zoUOGwAhREelVL0+zHXhvAiilDIAte2d54FZn8/AYrEw8rIr8LjdofqqrQ6b3cbxY8d49bU3EJpW737t9/vp3asHZouFRx95iKSkRPbt24fJVD/LX1FRQWREBK+9+hID+/ejrKwcYx3llVI4HA5KTp9mR/ZOwsPDQ7aUjEzGXH0NMz6eTjAY/CPDB3j0QgqfL0GGCyHaXGhPKsrL+OrLmVw/9iZi45vir3aQI0JuOkbNwIQJ73L8RE6Nvf4MhBCUlZXRv38//vn3v+NyuZBS8dBfHyQhKRHNaCI8MoqwiEjCI6NwhEdUxYcIIQgGJeVlZfz48yI6d+pIVlarOv2JDQYDTpeLCe+8S3Z2NoFgEIOmcff9D1BaWsoP8+dd6PDP9GGIlLJuXUsdON9D/e4/0pl5c74jEAxw+agxuD0eQlQI3VNKERUeybx537Pwx5+IjIyok6Py+/1EhIdz7z13YbFa8JZ50TQDdruD04UFHDx6iGU/zMVZXg4GA1kdu9Bz0DDCIqNxlpdit9n46adF+P1+Hn/sET7+dAa6rtdwNzoDh8PB4cNHGHf3fURFRpKensaoUaMYecWVvPnqKxw9coRevfvQrmPHehWQ9eB+4Lw8HxslSKWa5JLGyp2LnBMn+OjDyYy66hqapTSnrKysBgthtVo5mXeS9yZNxmg01XluKKXweDy88Nwz9O3dm+LTJVisNnZtXo/BoLFy0QK++3gKPo8foYE/CIpPyWzTmtsf/Qd9Lr6UirJSli1fzj13j6N582Z0aNeOFStWopSq1aZSCqPRiN/vZ9CgARQVFTP+rQnoup/CwtMsXDAfg6axcvkyoqKjSU1PJzm5GU0TEzGbzBhNRmw2e11juUZK+U9N0042Nm/ns0JuuhA1ia7rzJ87h6lTJuH1ehlz9bX4fDXjPAyaAbvVxviPJ3Dw0GGio6I515NECEFpaRlXjbmS22+7FQVExTTBpEHxqXy+nDSeG+55BKNRw9YkAqFp6EFFUCmOH9zHK4/exXV33k/L7gMYMGgwl40cyenTJQwZOoTtO3awavUawsPDOHdRappGhdOJphmYPOl9jh47xqbNm/nyy9ls3rwZzWrniUceJS8nl7y8XE4VnKS8ohy73U5ERCQpqWm1zkEhRIRS6i/ABBpBg2yvUsqolMoWQjQc4UJoa9m4bi3ZO7YTGRXF+xPfoU/ffrzx9kRcLleV44EQArPZxLJlK3jib38nGJQYjbUPco/HQ7NmycyfNxdNBfn2y1kcP7AHh9XAtrUr2J+9nTG33MWWNcsoPnUSg9GILhVSKpQCn8+LyWyhz0Uj8ekSS1Qs/QcMpHWnLhw9cpjnnv8XpaWl1U2uVQgGgwgh+GjqZDp16ozFYubQwYPccestHD6ey9ChQ5n03ns0iW1Y2XjOXO4UQnRqjAVukCBSysFCiKUNNEJ5WRlHjxwm58Rx7HYHXXv0oLS0lDGXj2DCu5MYOHgITudZ41lEeDjfzZnLU39/BoslZLM49+yQUuL1eJk+fRqRms6428ex49ARmhsgJhxsDis2u51AQMdcaSkE0CUElUJJhax0jvA4K3B64IgHwmxWHn/4Qa697U5++ulnJn3wITZbbZkHQsLqqCsv5/VXX8HpchEeEc7Lzz3D3t27yerQhU2bNvPmm6/XaxupZ76GappW73xC41zW2IZuSikpOX2aJrGxjBh5OUMuHkZkZBTTJk+iWbPmdO/ZC7f7rH5N0wRC09ixcydSBmupNSC0gsorKrjuumvo2bUjT919M4XHjtCruYNmiRYiYyIxW8zoPi8WS8haaDAYKn9a6H+jgWDADyqIIzKKyAgT3ZMdhCkfU996i63rVjFs+HB69eqBu5IVPxdhYQ6WLV/Brt17sFmtBAIBLr38Snw+H6++8hL//Oc/eOzxJ1i+fHkjU1gDtzdWoF6CSCnDgSsaethgMJCWkUGz5ilVrGZxUSG/LPqZK8dcTXh4eFXIGUB4eASffz6Tb76dU+WkcC58Ph9JCQk89NcHKTldzFU3j6Nn1xYEvG6GXHk942cv4p+TZtJv2EgCfg9Go4bBoGGs9gv4vGRmteXJNyYz8aufufWhvxGUQZKirfTp2xUpQzqtq68aE5I56lBGGgwGysrKmL9gASaTCa/HQ8cuXYiKjmb6tKkMHTqEDya9x5vj32LdurWNzTNQFZHV4D5XL0Eq7cIX5BezZtVK7r7jNswWCxcPvwSv31e1HURERvDbb0v4bckSYqKj69Xgut0ext1xO4kJTYlNaMa14+7HWVZOp179ufWJF5n80Wd88MlXtL/oOjp070VA92EwiMqfhlKS+IRERtx0Hwt+W88LL73BwCtu4PLrbqKk2EO3/oNp27UnZSWlpGekc/FFQ/F6vXX2xWa3s2TJUk6cOIHJZMJoNHLF6NH8tHABwWCQ9u078M7bE3j77Xc5dPjQ+UxRlFKqQS+KegmilLr6fFoA8LjdvPbSC0x+/12OHD5E/4GDSElNDQXnC3CEOdi1axerVq2ma9cuFBUX1ymRu91uOnZozw03XHc2AlcIpApw5dg7+Gj6p3wy/UPatm7FxA+mktWlDwahqlaGwSAI6j669B3A7Dk/4HVVkJefz9133cewK6/BZBZIpRCaFlKxeL0MG34xiYmJtVQwAGaTibz8fJYtX47NZsPjdjNgcIiAa1auBKBVq1Y8+eQTvPH6m7ic5+VocmNDN+skSOV2Nfx8as/esZ2/3nc3UdExPPbk0wghGHrxMBChqo1GI6WlpSxc+CM3jr2eVWvWImXdqyMQDHL3XXcSHh6O369jtZjJXr8KZ2kFsUnJVQ4Nb7/zDi6XC02oaqsjtEIMRg0VDBIeFsbXX89k65YtWCwWopvE4ggzsXf7FvxeD5rBgK7rxMXGcdHQIXVK7wAmk5HFv/6Gzxda7TExTejVty9zvv2qqkyPHj249NIRfDB58vlM2YBK2a5O1LdCBgshmjZW84J5c/jw/Ync+8Bfue/Bh/j1l5+JiIykR8/eeD0ehNAQQmPhwh8YM2YUp04Vsnnz1irPw+pwuVx069KFEZcMx+/3YzKbcDqdfPHeGwQCOru2b+WxJx7j7nv/yoCBA3nq4XvZu2k5JrM5RAiDhtEgsDsc7NiwghGDe3H9TbczavRoPv3sU44dPgiaxs7Na9myehk2uwMQeLwe+vfvR3JSUp2rxGazsX17NpM+mIzFYiYYDDBi5GXs2L6NwlOnqsqNGTMGk8nEysqVUx+EEFZgdH336yPI5Q3WCnw87UN27tjB6xPepXvPXnjcbn7+8QeGXnRxlVbXarGwccNG0tMzaJ3Vmq+++hYpg3VKyH6/zi03/yWkng8GsZjNLJw5nT3bNxHdJJofPp/Ctx++ye3XXsqjt11F9i9fcHD3DjQBUvchA35kwA9K4iwv5dfZHzBqYEeeuP9WNvw6lylvvIDVakPTNH77/mu8HjeaphEMBGjSJIYBA/rVmagg5FYkWLlyNXPnfo9Ukjbt2hPTJJaff1xYo+y4ceNYuXIlFRWNZhS8qr4btRhwKaUZ2CuESK/rAb/fz8fTphAVGcWN1WICly9dwr3j7uCTL2bRs09ffF4vpwpOceL4CfoP6M/hQ4e4buxNuN2ekId6NThdLkZfeQXj33g95BKkGXCWl3LL0C6Ul54OuWmqILrPgwzqKKkTl5BM88wswiKjKrcyhU8P4vb6cDvLKTyZS2FeLmhGJBpGkxVhCNnMXRVO7vnHK3QdMBRXRTlGo5GiwiJeevlVXB4PxnPON4/HQ69ePblmzBikkowaNYqPpnzAgu/n8sPiJTU0zuvXrePEiRNcc239Rq1K/622mqbV4gTqWiFd6yOG1+vlk2lTaN26bQ1iAPz4w0LS0tJo174jPq83pBcyGenQqQNCCJatWElhYXEtYkCI1e3VswdGowEpQ4f0rA/eouhkPhZLaHvTdT+aptG+Rz/ufPpNRt/+EOmt22My2ygvq6DwVDFFp4rwun3YHDF07DOc4WPvJa11B8xmExASkIWmoYDlP36P7tcRQkPXdRITE+jcpRO+Ojgus9nMzp27aJXVktjYWLKzsxlx2eXk5uTw1uuv1rCx9OrdG6/Xy8mT9autKn0S6nS1r4sgdR7muq7z7Vez6Nm7L0MuHlbjXkV5OatXrmDAoMFEREQggxIpJdHR0ZjNZvy6n2XLV9TJWXm9Xlq3asXgQYOQUmExm1ixaCHfffIBZqsVUFSUlZDWojVPjJ/OazMXExvXhF++msyKhbPZunIRR3Zv5fiBXeQc3MPhnVvYsWYZy+fNRiiNsU+8zoi/PEBsYjN8HicohcVqJe/EUY4f3IvJEjKISano07s3FoulFktuMBgoLS1l46bN9OvXF00I4uLi+ezLr4lpElPjLAEYMHAgWxtPnlOnjFeLIEKIIedeCwaD/PzDAjp37U7X7rVjcjZtWE9R4Sn6Dxx8NjEYAiUVZpOZQ4cOk529s87D3Ovz8chDfyUhoWkotFkPkNAsheTUTAIBHVd5OZfdcBvjv1zExaOuY/ua35k18TkEEqvNgcXmwGSxYjJbQj+LFYvNhtFo4OeZH7Fn4xo6DRjO1Q88Q+d+F+P3evD7vCQ2aw4oAoEASik0IWjVqiXp6em1OC4FGIxGFi3+hZKSEpKbNcPpcmE2W7j9zruJPyeMITU1FZvV0liKqb5KqVqMUw2CqFA4cy3lzKb1a2nVKosOHTudewuAJb/+QmJSMu06dMR3zsFoNBrZuHETp0tLa60Qt9vNoAH9GdC/H0ePHg3FoJuMRDWJo7jwJB6nl+vuepC/jZ+KxRZGIKj49INJfL4qh4MnyjEY6lbFaQLyS/2sznWzYO48ZMCH0Wzm4hvG0Xv4aIK6TlnJaeKTU7CaLXw/fyGzZs8mLCyMPr171bAOnlkrdrudNevW8+xzLxAIBDBbLOTl5fLAPXdRUV5eqw9t27Xn6NGjdfYPQAgRrpQaVKvv1f9RoaD48Gr/c+jgfmKaxNG6Xfs6K3ZWlLN82e/06t3Wmst0AAAgAElEQVSHmCZNCAbPqiFCW4Fk3br1tZyiIaTq7ti+A/945llycnIxGg1oQrBy8UKOHcxn8MjLeeC5N9EDQfxeD26Xi3v/9iwP3TWO/ILSKq1szYGG+p1f5GZovz5cc9PN+LxegrqO3+ul/+XX0qH3QPKPH6cwPxeDyUT3bl1Z8vsy3nzzLZKSEomKikRKWcMgoJTCYbeTmJiI3+/H5/XSrmNHcvNyufPWm2qlJYxv2pTwMAeBQINeQLXsTOduWQOr/xNiXa20zMqqt8aN69eTl5dLn379K1k2AZUe6EaTiaLCQnbt2VOnhc5mszFl2jQyMzPp378feuX2sfSHuQR0uPHeRzEYjOj+kMSv+31ktm7PS2+/y213XE9FaUnVCyCEQAiQQYmrvJwRQ3vw+D+fo0W7DgR0HSEESgaRUtLn0qsISsn8zz/C5/PRpk1rHnvkYTZs2MSUD6chVejwPxeBQIC+fXsTERGBrutYbTb6DRjI6lWrGHfbzRw9fLhG+RatstC0Bn26Bp3rB3xuqzUSixlNJpIbyL4GsGzpEsLDI+jYqQsQ0gBbzGY0TcNsMnHg0CFO5hfU6Yzg9XpJTUnh3nsq/bZViK2+6ta76d6/EymZleHJlatACIHH5cTtcjP2sde56NpxBHQ/Hlc5+fmFlJeWEvD76HPpVdz05L8wGI14XC40zYAmNISmEQzqhEVEER0Xx9H9ezm4ewe6HqRTxw7ccMN1nCosrFNAFELg13X27NmLVAqT2YwQGm3btSc2NpbcnBwef/hBdmzbWuO5c8O0z6kzUylVY+up4kErz4+ODc7+OTh69DDLly6lU5cupGdm8tsvi0hJScVsthAeFYXVamXnzl14vJ46/Zo8Hg8DBvQLeTJWrg6lYOgVV6PrOicOHSA+qXmt5wK6H4PJzKi7/kZ6u25s/G0+GzbtITUtie6Dh9Oicx98Xi8+nxdNE0jFmYWLJgzofj+u8jKuufMBXOXleL1udIPG8OEXs3X7Dvbv34+1jpyMKEXhqUI8zgr27t1LXNME2rbvQHzTeIoKC+nWvQfTp07hngf+Srv2Hc53GgcSylMP1CRIJyFE3TrxatD9fnJyTrB7ZzarV63kZMFJLr9yFONffYnU1DRatsxi+7atjLxyFEop9u7dX6cBKOT4ZuWSYRdXXdM0DbPZhK4H6DX0EtYsXojH7UIznCO7CEEwEMpG17r7IFp26sMoVwVev46UErfLiQzole2Kyu3s7CoLD3Nw5U130rnvwNCq9Hkxmy2YLVauuHwk7048VKfNPRgM4tMDNGueQkVFBYt//onjx4+h+3W8Xh/79u/j+X+9xLQpH3D3/Q+SkdnifAgyCJhYNQfVbnRv6Cmf18v+vXvYtGE9Rw8fpkOnzmRmtsBkMjJv7neA4Pq/3Mznn35Mh06dEELg9fk4cvRIndtVIKDTLDmJvn36Vk2U0Wjgo48+Zv36dURFRRMV15Rta5ZXcmd1cFRK4fO48PtCgmhQ9+H3hgxOQgvp0TRNoKFVOlhbOH5gD7vWr+TKm8YRFR1DRFQUZrMVWelQ0a5tG9q3b1enSl4zGCgtDYVet23XnkefeIpLL72M+KYJSCVZvWoV27Zu5al/PMvXX86kqKiocXJAd6VUlc9CdYI0GPRvNptJSUunT/8BDLl4GCmpaaxftxan00mXrt146h/PMHXyJCw2K+kZmRg0jWNHj3H02PE6U7eGDEDlvPf+JKSUGAwGpnw4lSlTPyItLQ2/rtO1/xAy2nZE93kwm4zUrSMOcUBKypDZXmi1OToRslbaLGaSk5tRXnqa04Wn+G7OPIqLizGajCgFQRnEaDJy8UVD0CpV9BBifRUKk8lITk4OBdUEweGXjmTm19/y0MOPYjabef7Zf1JeVsZtd9zFgnlz8PsaTuQphGiulGpbgyCVJ33dfO2ZBzWtxr56Mj+PbVu30KZNW157cwKHDh7k26++5PobQ7EqPp+PN94cT3l5RS3dEFQSpKKCb+fORdM01q5dx3MvvMTdd91Js2bN0P06FoOgaVIip0tcnMgvwmYx1fISsVgs2Gw2rDYr4RERhIWFI1VoEoUQILTK0Gg4eeo0Ldt2YOw9fyUqKgKHw86Mz75A0wxYLBaMBgN5uXn4vD5aZGag6zpnSVIJBSWlJRQUFFRdN5vNPPDwo/QfMACr1cKD991DYnIy/QcOYtWKZQ0SpBJVu5OxkiDNgYbZqXOwZfMmysvLmPrJDMIjIrh33O307teP1LQ0AL6bMxejyYTD0UB8hVKkpaRSVFjEU3//B8nJSVw1ZhQADoeV9dsP8953K8lKjCE50sKA3m1IiI2krOIsq7srOxuX04nQIHtHNvv27qVDxw4MGHIRPp8Pg6ZhMhn58Zfl/PzrKqxhMQzt342LBnRh7PXX8G5BAV999TUDBvQnLS2VtWvXMfPLr4iKiqw0S1cS40zSCCHQhEZpWSnFhYW0bX/2Pe7ZqzfXXncDc+Z8wxuvvMjf/vkcwUCAI4cP1YhZrAN9gKlwdstqfaFBOCuWLeWOcXfTpWt3Fv30A9u3beUvN98GwObNW6ioqODSS0c0qIoOBoM0a9aM+QsWsm3bdi4ZNoz4+HgKi8t4ZMIchj4+jS9/2cI7C9djtNtZv/kAuadKsFlDZ5LBYKCiopw533zN+FdfY/nvv9OxUyf69B+AUqFt0Gaz8tMvK9iycT0lngD79h5lypSvuPXBl3lp/McMG34Jhw4d4Lnn/8Wu3bs5eOgwHo+H0rLysyxr9QWiFFJJrDYbRcVFVWlBIJSZwmQ2MXnqx2zdsoWN69eFVPUxjboLdTqzPZ5hX9pdAC04fOggzopyXnj5NXRdZ+LbbzFg4CBat22H2+1m2bLljLvrTmbNmt1g9JOmaQRlkF+XLCEsLIyrrhzBtv153Pjcp+w9VoAtzEZETDhOr5+/f7aEyfeNZMfuY7RtlUx8TBjlFW769h9Aj569KK84O4HlFRWgJEaThe8X/saWDWso9wnK3RLhsKKUBZfHz5dfLGDlumwG9m7FkaPHmDptOroewG63I7SQSv+c3QqTyYimaQQCOs1T01i1fClRUdG0aNWKFi1bsnXzJjRN4/GnnuaZv/+ND6d/0tjqAMhUSiUAJ8+skPNmmgFmTJ/GjTfditVq5aeFC9i7Zw9XX3c9Ali6dBldu3YhMiICZyOGGrvdzspVq8neuYuWac3YeLCU4U9OY29eMeGRDoyG0MFqt5ooKHXy+EeLiY0OZ9e+HLL3Hici3I7P58Pv92MwGPD7/bhcLhw2C4EgfD57AVs2rkUJI4cKPJWTXAmjASLDOXE0ly/nrMIj7ZSVleByu8+WO+ddCgaDREZGYLNYqjTa7Tt1ZvasL3BWVBAXH1+lkejRqzd9+/Vn7rffNDqfleqqNnB2y8o4H0IArF6xHJvdTr8BAwkGAnzx2Se0ysqid9/+FBYWVqXDCLXUaEeoqKhAkzqnZRhPz1xNqdNNhKOmmkUpCLOZOVxYxoOTfyapaQzHc4uY8+NqjBqEhUdgNluwORzEREWy+8AJXnnnEw7s3k6Yw8rOE070oEQgUTIIZ35KgtWMUpLjOR48fiMmozh7XpxpnxCXdcakYDSZkFKi6zqxsXE0T0tj4jtvYbPZSUlNq9oV7nvwrxw6dPB8LIhQyVRplbEfqefzREDXWbzoJ26+7Q4A1q1ZzZbNm+nbrz9hYWFk79xJr149qwSq/JMFNEYVowaYw8gLa4fUDFhNhlqcFISIEmE3szfvNOPeWUC7VikYjCaeeuFdfp0/m9xjB9i7eTWvTZjC069NQ/hO07RJODuOlnG63INRKDSTFWNEHMbIpmhh0QiT9WyKJ6XIPRXEpyuqL6QaXJaA5MTEKo0CKNwuJwMGDWb71q38/ONCWrdtVzX++KYJ9OrdlznffMV5oCOAUSkVB8SdzxO///YrmS1aVn1dYP73c5FS0qlrN5wuFw6Hg5TUFILBIBXlTnbv3oOlwVCwkPxQ3KQ9PmM4Rtkwz64URDgsHCgoZexrc5nx5Giaxozh2aefwnV4C7rZRklkRwZ1SSHSqrFx/ylyir1Yo2LBFgHmSs90GSQgg6iAjvI4kRWnUc5ygt4AeQUaqUmmUKquc9MJKsXR48crLYShBGoSsJpMjLj8Cia8+ToDBw3BUc0J8Nrrb+CFZ/9BaUkJUdHRDQ2vJYS2rAQhRKNfAQjoOtu3bWHUmJC7Vm5ODmtXryIqOppmyc2oqHCSkZFOIBDAaDBy8NBBjh8/UW+EkxACFfDjsjen1JKIQZ1fsOqZlXK4uJzrXvkWzWLji5mf0W7kOPSm3bmoayoxdhNbjrk55ovE1rw1hrh0hCMKNC0UhyiDICUgEDYHhthkDPHNEHY77rIABUU65+5bUkpiY+M4cuQoO3ftPmtZVAq3202/AQMBweT3J9bor93hoG+/Afyw4PvGhpahlDJoVH7/qTFsWLeOlllZVVRe9NMPFBYWEh4WhsMRRkLTeCIjIgkEQsadDRs24nS76tV2+n0+mjZN5O+PPYwmgwSD5x0XGSKKzUyhy8df3pzP0m1HePe1p/h0wpNktW7N+tMRHDU0wxKfgjDZQJ05M87dCxVIBVIiLHZEfDOIbsLp0wFkUKM6Qbw+H1mtWnDbLTexaPEvVcY2ETLAYLFZuWL0aD6f8Sk5J47XaOXSy6/g8OFDdRqyqiEeiNWA2urUWhOg2L0rm0GDQymJArrOb78swmQ2Y7XbaRIXB0KETJ2VCcPWrdtQFQeu63oNRZ0ipGYfe+MN3HX9cK7v1xq388KSHigFDrMRXcFTny3niWm/sHhvOfMOwHGvBbPJdPbgbqgef2W7sjJ+3RHFRcP7kJWeikHTqg7zYCBAm6zWXDJ8OJqmsWvXLiwWCy6nE5/PiwoqevTqi6ZpfDxtao02LBYLHTt2ZsXy+h3fhRAWpVSiBtT+9MA5OHhgH3Hx8UTHxACwZdMm9u7di8ViwVyZBumMN6LJZCInJ5f1GzaSlpJC+3ZtSUpKrFo5AEIGEdZIzLEhbei/7hxGVvM4nF4dYwP2g1qTCZiNGlazifkbjzBxwWbyTpdjMZy52wg0DaX7QkTRNJTHT482SVwzshdtOnai3GVCSYnNasVmtdG3T290XWfIkEFs3bINo9GE1+/j4w+nkJ+fR2p6Gl26d2fu3O8oOMfrZOiw4RzYv7/BLBNAogYkNtbvPbt21XBuWPLbYnTdj4AqY9SZCRDAL7/+RnR0FDM+mc5338xm3B2343Kd9XvVkOhhidw9dTkz5q2gWXIiUx4bQ5hBgN9bZZA6XwgBYVYT4XYLpno+1lInlEIz25AVpQS8Oi3T4rhlZBcqnG4WrDpATpmdUhe0a92K8LAw1m/YgB4I0DorC7vDwZEjR0hpnoLb7eGZpx4nLzeX3n36kZ+Xx/zv59ZoKiIigqTkZHbV872USqQ2SpCK8jKEEDRPCXHGPq+XDevWVSkaq3uZQEh4ateuLTM/n0HLli0wGk0cPXqshsQexEAip0jQT3D7u4v5+6T59G6XwuMjWiFkkHpcf1GAxx/ApwcJ1leoGputFEilCEpVt8ZAKbDYUB4fCTbJg9f3w+vTmfLdBvbuO0VYOFhNiuKSMsaMHsWs2V9z4kQONmsobW1ubg6aptGnf3/MZjMvP/8sLpeT5GbJLPrpRwLnWB779O3HruwdDU13c43QYVIvjhw6RFr6Wb+5XTuzOX7iOGazpXJM6my4GoJAMEif3r3IzMhADwSQUrJ33/6z+XaBoDBgk07GWFbS3XqI12evYvC4NzBJP4mxMQTrCO5XgFETtGseR7OYcMxCUOHxEZSqXknHX9m+1aARCEj8gWCtxacUmKKi6JZiosLp5s0v13HkeCmp9kI6in0Q8GJ3hHHT2BtJad6c995/n9zcE6RnZOBwOCgqKqJ5ahp9+vUnq3VrJr8/kcyMFigl2bRpY83ZTkkNxU6WlNTZXyFEkpFGuKyy0lK69Tyb5nzD+nV4vd5Q+gtNw+v1IqVE0864OIiQj6wQmE0mCguLOHLkSKX34NlJsJsFmggwyLiBZEcev+yO50huMRGx8Rjq2LKCQYnVYGTS/aNp3jSaCreXL37ZxKQf1hKsbgMRoVVh0gSPj+5H67Q4IiwG9h0/xaTvV1NQUh4SRs9ABjFHx3D4RB6L35uPZrUxJPEo4e48TpaDPSqWW276C2FhYVx68RAmTp7CDwvSaNWqFV169CSgB0hKSqa8rJzb7xzHls2bcLpcXDlqNKtXrqB3n5rfP8ts2Yo9u3fRp1//WmNUSiVpQL2fNXM6ndjsduyOs4LO1i2bMGgh90tN0/B5vZSVhih+Zk40gxFNaBTk53PgwAFycvOqDjMFmDRFvC1AQGn4lJEWphOMTdhDikPHrwzUdyArwGY1s+f4KRZv2seztwznjmHdcbl9IemZM9rYkONb/w5p2MxGft9+hG5ZzbhxSEcCerBG7UKAL6ixNz9InOcol8dmk2YuQJhM+NxuLh3Yj65du1JWXkbrrCxaZmZisNhx2O18++UsjAYD4eER2MPCOHnyJK++8RYVFRUMHnoxhadO1Uol0rpNW4qL67UkJmpCiHp1wyXFRVXfbILQh7f279tHZFQUmRmZSClxud0UFxcDIQ7LbDZhNGj8tngRhw8eIHvXbhKaxjNi+DCcTidSCWIsQRxGiSRk8/YpM9FGJ/F2SbDBj6IJzEYDWw7k8MTrs/l9+yFG9GqNALx6ALfHj18P4vOHJkEqxbpdx5j06S+s25dDanxUKH7kXKWhlETERTOkhQs7brzSiNEoECis6EglCQaC2BwO+vXqwfIVKxhx2RW0bduO6VMn4/V56dCpM0uX/EbPXr25+ZZbSUxMJDYurpaPb0REBDarjbKy0roG2KRBlsTtdtf4DN2e3bs4fuwYV1w5mtFXX4PH48Hj8VBUFEoAVnjqFF/M+IQH7rmTNSuX0bVHT9Zv2ECP7t0Z/+brtGzZArfLSUBpeAIaWtW7qtCx4CEMQWMCosKgCZCSEpcXGZAM6pjBvOdv5b27L+erf47lyp5ZePWQF4tBE6CFIqfq4wM0JG5ho0yGVy1OgwYmi5kDBw7iLC1BKkl0bCxRkRE0S0rko+kfc92NY+neoycT33qDtPR0Ck6dorS0hHsfeJDomBhatmzF0SOHa7WX1KwZ+Xl5dXUlpkGCGI1GwqqlkNiyeRNGo5Ebb7qFzJYt0YTAbDazcP73vP7Ki4y97ipefP5ZVq9axbARI9EMBg4eOEjXrp2x2+2Mf/01Yps04bTTh8WoqvKeCBQBTHiFvc70SdXhD0hS46O5ZEgX+mQ153BBCQ67hRE929C1dSqZybHcMqwrdpMRPSgJt1vo2zOLHi2T2H3sFMGArKE8DLUPujRQEIhCExJUSAI3CIknqNCDQZRShIWFoYSga6cOrF27Dl3X+cvNtyIIpS+0Wixs3rSRM5xeRmZmnXJHUnJynVK7EMLaUIwhCYlJNa5t27KFjMxMmqekkJCQRERkJGazmbVrVvPZp5/gcrno168/Iy4dSbv27Tl16hQej4dOHUPuXp06dWTIkMEYUDi9Ac6ew4qAMOMT5jrUGzV6hcvrZ2i3Vnz76jikUkxbsAahabhcXu5+62tmL9mK3WrGaNBwevxc1L0Vb95/BQeOFzJ39S6MpvqSV0hOBiJRlamMReVSiW/aFKvDQVAGCeg6Sc1S8Hk9JCYmsHTZMgCuvWEsS5f8xoYN69m0YUNVjed+CvAMIiOjQsa5OjIMNRSFW0NrWVpawu7du+jcpWtlY0kkJSeHws9MJkxGI/945jkuvexyBg0egs/vIzcvD5vNRkZGiG12uVw0iY7m1Zf/hc0RcfbAUxJd2FGYqiainl4RbrPw45pdDH1iCpc/8zG7j+TjsJpD6o3Kn6w84O1WExt2H+fut+fwz89+pdjlxWSse8hCSIqDDtzSihASKYPYI6NpEtcUs9GIDIaivDJbtOT4sWN07tihKka9Z89epGdkUFBwknVrV1fJH+EREXV+ywpCZ0ldq+S8xdqD+/djEIJu3UMssMFgoH2Hjvh9PsrLy7nl9ju4fNQYOnXpSnh4BJrQyD9ZQFJSIhERIUauvLwcR5iDy6+4gjZZLULpwAENhVfY0DE2QpCQLFJU7mbT9kOcKC4Hy9nkA5oWckA4A5NBI6ewlN0H8tClwmw01Fu7AYUnaOZ0MByjCCXvj2uaiBRGnE5nZaqnIJGRUQgtFM8IoS/4OMLC6Na9O3a7nf3797Nnz24gpMNqVY9fdHRMkzoDTTWlVN2pDM7Byfw8evTsRWaLs954vXr1wevz0qlTZx569HEAWrdtx4H9+2gSG8exo8dIad4cUTlJHq+HhPh4NJM15G9b7ZMSfuGgfhGPqnJWiwmb2QQ2C5Zq20/V9idEtVoEZpMRLKbQ4d4oBAV6JKJS8+6wWVAmMxUVrpC5QIUSDmS2aMnundm0atWKdevWAdC9R0+yKr91teS3X6tqjDjn24xnEBsbW+fHCjSg0ZRBSimaNk0ko0ULmiac1bQkJScT5nDw4EOPVEnuJ44do/BUAUaTiVOnTpGenlZVvry0nJTU5qigTlxiCtFNmlbmXwRvI16sQggCUrLtQC5FZc4qQRQFRoNGmCWUB95iMmI1mxCEVoi4oHy/koJAODpGNE2QmJKBw26v9GIUgET3+2nZKoudO3eSmZ7O4UqP9y5du2OxWvnLTbewYunSxvMMV6aqrQ6lVFAD6uS/zkVWmzYYDMYackl5eTkdOnam74CzUQzr162pSrPh9Xoqcx2e6QQkJiQSCARo3bUfzVq0RfeHBusSDefHNWiCgFTc/u53vL9wDQ5b6AWw2Uxs3HOc29+YTbHLy+KN+xg/eykePchzX/zG1yt2YrWcZ+ZvISkJWCnXrTgcNlp37k5MdBSlpSWhFaZCsfRNExIpKioiGNAxmc2hVLOZmSgp6d6zJ82aNyd7x/bza7MmijSg0ZwQQgjcHjd2h6MGVcvLy2h6TjjX8mVLSat0e5EKoqp97DcqKpqo6CiUgvjkdBxRiciAjhQmApodkMgGzpAz25K3mirfZDRyoricmSt3UOb1s+nISRZvP0xAKbYfPklOcTnG89quQtuFlEZOeizExieQ3q4r4TYLfp+/csuSWK1Wjhw+RH5+LkePHiY9Lb0q+is1NY3cnBzuuudetpyjxzpPnNKA2pJLHTiZl0fiOWywEIKwalyE0+lk+7atVZ/UtlosNGlyRrBUNG+eDFJiMJlJymhNWYUX3a8TFEZ8WBs90CF0cFc/D5RSmAwa4XYrmhBYTUYcVjMCsFlMDR7k9SHHZaV5q67EJqfRPD0DpSRBGcRstlBaUsKn06fi9/s5cGA/mZkZnMwPRU916NiRLZs30aFTZ5o2bYrXc8GZxo9qwN7zKVlRUU5MpYHqDATgqKbn2rljO2Wlpcz64jO2b9lMwv/r7syj5KqrPP65772qerX2ku7q7nSShmwQwxaBkCCEfYBx8AAqcBAFAT1ymDkzKoOOOqOoI8dBGZVFGGDABR0GBwQOixwVHJVV0AARQtYmTZJO713VVfW232/+eK8qvVR3J0zjUb7n9Kmu31uq6nff7/e79/7u/d6OvRoWCDd+63q6t2/FNE0M0yKWyNLa2UXFExxJYMxqpc+G/e36erfwGLHyHHjU6ejAI9fQgArCQG4xDf7ztlvYsGED8USCTRtfp6mxsZa2tmz5QQxHfr1TTju9NnXvB7YZIrJxX86slCu0d0zdOhnPJPrS+t+HtkAQ8IXPf4Y3tm+jsSkU4re+8W88+MBPWbpsee38lrYOTj33ElwdR739pd33DQJlP0a/m0K0TyKeIJvLEovHuPt7d/LYow/zkYs/yrJly+np6SGeiNeqXC9ZtpxKpYLrusQTiRkpbKfBJkNrvUVrPTLbmZVyqY4KF3KLVNHd3Q2EZSG2btnCr574BTrweeLnj3Prd29k5cpDSKbSNQ0km8uw9q/O4eB151Asu/s0Zc0G/f+9iyFQrvDMH17DNA0M02TRokXc/b07ue8n95JKZ1ixYgU333I7TqVCf18fra2tFIsF5s2bRyqZ2tfAuCkQkVcNwzCKwCuznWynUmQnVVUOA8Z07f9dO3cSj8VJJBJ86tNX09DQwOWXfJhrv/pl1q59Txg6M27zKd+xADuZYeERZ0TDfg6mnLmAafDcS5tw3YBk0ubB++/jv3/8I77+jeu56KIP8/zzz7N4yRJaWlro6elhUVcXtp3ENE2aW+YxFHm/9wdaa6W13lI1a38508nlchnLtKawQscT8VqWqVKK4aFBjjp6NQsXLeKSyz/Ouee+n61btxAoxV+f9T42vPIKw0N7iz82t+YxTJMt3bvxlUJmMQz3CXNwC+IxXu/uY8fuAe687Rb+49abueDCD3H2Oe/n5FNOYzDq8M6FixgcHMQ0zRplSDaTZc+et1RuvVtE3qgK5JGZziyXS6TqVJixI4J7ABUE5HI51hz7HrKZLKZpMr+zk1Wr3s3Rq49h+fKD2Lx5E7/4+eMAaKVYuHgZ8XQDx61aTL4xh+M6+HW2b//0MFjWkeb2m67nwQd+im3bxGJhBObKQw+jsTGcuhcsWEDfpM5fsGDhBNLP/cBzIqIMABF5Xms9rbalAkWucaoLIJXKhBU5CeOsjlmzlo6ODrK50GXf3NREoBQnnXwqVhQudOt3b6J7+3bEMCIuEzhpzUqOOfYkWtsPxDJjoW0SeLO64utD9jtqZe91RhSIXcIb7WHTay8TTyQxxKh1ckNDA8uWL8dxKixZuow9vRMFkmvIod/C1Csij0LkXBSRALhnpgvq8ds2NTeRTIZaVsK2+eD5F6K0piEyBufl87S3t3PYEUfgOg4JO0FfXx8fv/Qj41K9hI07him4MRYvP5zWg9eSO+BQko3tmFY8DFdmsXcAAA7gSURBVP2sCkgFb1FIdbsALQa66owMHIzKCAlc4k15ZNFaPnX1FxEVTHGDHHr44fh+QGdnJ44zMTk0kUjOvINQB1rrAvAYjEuLFpE7tdZX12OxdiqVCa74Kmw7WYsMtCyLlnyeocEh2iN/V8wyWXzgYto6OhgaHIzqephYpsUnLr+U9571Pv7hk59k254kZccFTBzLJtW2GCN/AIFbJigX8EojBJUx/EoR5bkotxQqFGIghhk+2eO8vIiBFo2ODEitBESHAdSiEK3AdzC9CuI7mCjMRBKzaQGSbkQp2LSjn3jbCo5dewz3PTCxCt6RRx5NMpmksbFpClNDS74V1bt/D42IPCoivZMF0q21vge4ZOoVEw3AKhKJ+BT+q7FigY7OMBiyuamZVUcdjSEG+fZ27GQSFShuu+v7vLx+Pdd+9Ro+8MTPeNfZXyGTWYzjlPFUgNYBCpCYTSyRItbUjmiNCnwIPNTYIP7IHnShD79cQPkOQRCNHg2ifFTgo3wvCs7yIXDRQfjeNCT0NqfTGHYrRiqHtmx0EOD7LmgfrTzueug3XHrqmfzP/Q9MoNqoTsn5tjbikyhDcrkcI8N198tnQo2scUJv6rCu7YWT8w3ntbRgWVONnHQ6Q2aSKhyLxbCjL5lKp2vpXA0NjeRyOUSEjvmdzO9cwLHHHc8Pv/8DntgdI5kK8Cbve2uFjoKwNYRrg5XAbFqA2bwQCXy0V0Y7RZzSGOJVcMdGKI+NIUGFVKWPuAmICaaBWAnEjCMxG2XGUSKoIIjoAT104Nd2LNNJmyefXc8HT1jB8qUH1iVes22b5CTGB0PCKqP7gSdFpMbGPOFTDMN4TSl1E5OKkNRKZE+CFYuRTKWjuKzwCRrvLkilUjVLPhaL0d4xnyDwa2pvNpfjg5dcyVM3P4sOPCpK42uNNd2iHCXXVIXkYeKbWTLZJJ0tTajhHSxd8x5WrFzJwHCF1196jk3dPYxVAuyECb6L8n1U4KF8Hx34kRCmTjEiguM6PPLMJlYduZp0Ha6vRCJR07jGX1ePuWI6aK0/P/59PQKza7TWb0xunw52IkGpNFZ7P6+lZVpbYPHiJVMyUl/ZvIdixcMQwQv2bTXUCL5h02y6XL2umXVD93Ou/Rznt71B44u38N7UBo5zniC/7X6Wjz7NpScsRor9FEsOnucSUVvP+jmZVIInf7eBeHMXq1ZN5QpLZzK05ttm3/uY7ndo/V3DMJ4a3zZlHIrIiFLq40Sr/mxobGoiGOcOt217Wtts5SGH8NL6P0xo27KrSNVCL08br7sXSoOPScvup2jc9AC/fNpj07Zu1v3LV2ia18otd9zFE799Ftu2aW5upqkhy0XrDuDZe79NbuVp/L4/xmihQMKa/Sk2DYPBgUFe7+vky+umEO1hmmZtGq61WWZ94ppJiMyMz0xur+vRMwzjZ0qpa0Tki7PduCXfNmF+TafT0/pyFi9dRt+ePVQcB8918DyfbbtHw2xboDKLQLQGZdqs4XW2P30Dh51wCoceeQyF0REOP2o1e3bvJh6Ps3jJUj5/zVdoaWnlqV//mjEf2tvmccEpy/Cbl3L1zY/QO1zAjs8eUmAnYvxm/WY27hhgxZI4Y6UKxrgCAFbMwg+CGluFnbCn5bXf+zv0NuADhmFM6ahpXayGYXxJKbVMRGaskDD5aehcsJAXnnuOIErWcRwH1/NC9jfTorOri929vajAo1BW7B6qEDMNlNb4Ss/oPik4io8dN4+DBwt8x0xw0eVXcNC7VuJWHAIV4LouVizG8SeexJJlyxkZGeH4k07GilkctPJQAivBiYcv4jtXnsHf3vAIvSMFbHNmD1osFmNouMhVX/gaV19xPou6umhuasTzPCqOw8joKDt6erAsi5hlEY/HaWiaN0FIdfCKYRgb6h2Y0ectIpdorZMics5M51UR0uIJQ8ND7Ny1i0qlErJRhDcjYdssXX5wSJQcMxnqDyi7YdarrzWOnj7MoexrDp5ncdmRCe7/r0HWHH8iDY3NbN64sZa55Xk++XyezoWL6OnpwY3owW07yfKDVpBOZ+nZ3c8hi1v4ykdP5u9ufBjPd5mGujGs2uMrmuJjFIs+P3n0V2RTSTKZFCccu5pDVyyjo6ODIAjwfZ+qiSgimGbIn5JJp8lmMhOmNRE5Syl1mWEYd0z+zNkE4mmtz9Na/1BEzp/pXD/weXPnLiqui2GalEqlaeuDVFlAB4oax4dUHJwgFEo9BaWaDHvBSotKoR/XhxNPOY3BwUFcNwylMQwD3/Nozbdhp1IMDw/X4r5GR0dpbs2DCLt7e9nTC++an+bCE1Zw2+MvkYoZkeEYvRqCiIlXHCI59iZrj1hMtq2TjQPDbHhhA0Pd2/jOnT/ijBOP42Mf+gCHze+kUBybmAMTBIyNjVEoFChmM8xvn7KX9CWl1D2Rt72GWSdREfENw7hAa33tjOcR8iwmbJtkMkVxdLQub2HVZR+PxxkpOhimRTxm4yFMl/dZ8eGwvMnR802Gx1yOXL2Gjs4F+H4YgW8YRsS3ZdHQ2IhphGSa1WPVOb8aIqS0ZqhQ4qzVXSxpCKgUBtFuGe1VQi9AsQ9v1wa8nS9gyxgDI0V2bd/GM089jTvQRzZp4wUB9zz0GGdf/vfceMfdtfuP67fa58bq2HAisgA4c3L7Pm/TGYbxOa31i1rrb4nIlBhJ0zRZMH8+ZcdhUVcXY2NFWtvaoyLE4bRV/cLpVIodO/dww7e/yICXYcWqU3HS7QRGkphlImIQriYRBxaKk7o0CQtcF3KNjah6XmERGhsb647M8e9FBI0QM4H+Vylu3U7KtsOkXN9D69BWSmQzFHzYsCmMA7EFxKuAGFiWRTabodDXz+0/vo8Pvf9vSCTiE3IpAdrz+ZkW+ROBe8c37Ne+qYj8RCn1W631tSJycZ3jpGybQw45lM2bXqe9LV/b0vQ8LyrWKBSLY1zxT19l09ZtrDnqcPz+p3F7Y8Rcm0pgILE02kpilAdwikNk48Jhp55HOQjpkurFxGodirClrT1MQq1jG4wXigoCLMuitbUV/8WXGQ0CEok4sZiFacSJ+GYJo3/2PvmBUrieg1epIJbFcccfy9e/cBXzmpsYHBqekAaulKJUKc8kkAMmN+z3RrZhGLuAS5RSdwGfFZEp3LPZXA47kcAUITfOteI4DqOjI/zzdTfw7IvrOfPkdbTN78QyBN9zWep7vPLqq/xx40bikSrtBwo/EWOseAatzTn8wKml0U1MvBFc1yGVSmNaFioS2niuRcMImUnN6M9OJvnBjddx74OP8dDjT/Da1u30DQxSHCtFxAITIaZJJpViaddC1r77CM4763ROPyWMSevesaOuhe66MxIiTOn/txxZYBjGk8CTSqnjCSuBnjk++Wf+goV4nldzpTiuy9hYkR/d/zD3PPgYmWyGF1/dRKZ/lGzSpn1eE0nRDA4XiNmZkDMRCBwXT1u05dvI5/OUyyG/YnXKqr4K4Pke6XSKTDasGlp9WqtrzPj1pqpcmJbBlZddxJWXXcTQ8Ahbt++gf3iYXbv3MDQ0guO6JOJxGhtzzG9vo6O1hWVLDphAm943MDAlFx/CEZlKzVgCcs/khrnY8ARAKfVNEflUvWNaa3bv6aW/f5DzPvFpNnf3kEqGxJOWnQQrjlcpk7aESsRRKCI4jovjOFz/pc9y4Tlnhk9ueHDaL24YxpT1JdTS9o6nCVNX5IezbZtsOk02m6nFIs+EcqVCqVwOiQNcdwpjRRAEJJNJOjs6pmWz0Fr/o2EY3xjfNpexN9Ny/o6MjIDW/OGV13ht8zayUayWIUJQKYEuYQiUvOrTDIWxEjHD4M5//xoXn38OW7dvRylVo7KYzpiru9jPgGpnlUolSqUSvX19E0ZTdUSNv38QhAzZ1VzGCetGRMiZTqdpy+dnEoYCHp/cPicCiYrA1OXc0lozWiggIiw5YCEd+VZ29bxJLJOJuN6N6j0IAhVm8DouXQd2cet113D6ScfzRs8OAqXq8sfPFSZ3nFKqJtzJGlr11YymvXAKDW2oeDxOQy5HwyQf12SIyP+KyJSk9Tn5hUqpJmCLiEzhH/J9nzd6evB9n7bWVnbs7OW6m+7gufUvMzA0TCXKkbATCRpzWZZ0LeLEY1dz8Xln097Wyq7eXgqFwrR11t8OjA9tqrVFr+M7rDqSLMvCTtikUklSydTeyPyZP2OdYRhTClbNlUAywCapU/dQKUX3jh2hqirC0oiEoFJx2Lm7l+GRAgLkchna860TWEx79/QxUhgNSWD03i55qwNlOtuk5t4hevINA9OyQi6XWMidpSKrtTqFmaaJZZpYsRjWJKNwH77HNw3DuKresTkRiNZatNYviMiqesd39/YyWihEVOJx2vP5ukET0b0oFIuMjI5SqVT2akPRCJkcnDcbxk8xoaUuiCHh3G+atc6PWVYUexb+P9nynitorR8UkXNkmiLFc7KGiIhWSm0A6gqkubmZSkRW6TgOO958k3g8TiK+d08+UArP9XBcJyQw1mEByJhl0dCQI5MKQ1ari6aG2utMqKm+UhXERNX3Twmt9T0icvF0woC5VXvPF5FpyQVdz6O/v59SuRx6hSdPH1HXGpFbIpFIkM1kyKTTM5Z8+EuA1rokIl8Wka/Pdu5cCiRDWG6vfi5whIrjUC6XcV03VB8jl7thmsQiQdhvLXL8zxJa63tF5F9FZJ9SquZ0zCqlrhCRfao/+k6G1roHeAi40zCM/UqlmlOBRAvuY/X8W+9UaK0rQD/wKmFhll+KyDMiMmuKRz3M+aqmlGoBfiEi+1Wt588JWusxoJcwu2wDYdpf1U83CHjAEDAAvCkiO0VkrN699hdvi5qhlGoF7haR02Y9eT8R5dXbsi8Op4nXuYQd6QBjwDBhp/ZHf28A3UCPiGzTWvcahlG/0PrbiLdN74tsk6uAq0WkZdYLZsYw8FPgdqBHa90kIobWuoHZf8MoEIhICSgBo1prT0QqM6mf71horRcqpT6nlPqdUsrT+wilVJ9S6mGl1CeUUvtV2+QvGX9Sy0hrfaDWegVheYwuQr7H6obBACGJwR8J5+6N9eKW3un4P+rss3BrKgjPAAAAAElFTkSuQmCC)\r\n\r\nThe SharePoint Starter Kit (starter kit) is a comprehensive solution designed for SharePoint Online and SharePoint 2019 which provides numerous SharePoint Framework (SPFx) web parts, extensions, and other components, as well as PnP PowerShell driven provisioning which you can use as an example and inspiration for your own customizations.\r\n\r\nIf you'd like to help with this initiative, look at our issues list for issues marked as [Bugs](https://github.com/pnp/sp-starter-kit/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3Atype%3Abug) and [Enhancements](https://github.com/pnp/sp-starter-kit/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3Atype%3Aenhancement)\r\n" }, { "directory": "assets", "title": "Assets Folder", "description": "# Assets\r\n\r\nThe `assets` folder contains all the required components to deploy the toolkit:\r\n\r\n- `designs`: contains the site scripts that will be deployed with the site design, along with the associated custom theme \r\n- `documents`: contains a sample PowerPoint document that will get deployed to make your site look more \"lived in\"\r\n- `images`: All the images used by our documentation. These files will not get deployed\r\n- `pictures`: contains all the stock images used by the pages in the starter kit. " }, { "directory": "documentation", "title": "Documentation Folder", "description": "# Documentation\r\n\r\nThe `documentation` folder contains all the up-to-date information about this solution.\r\n\r\nIt includes the following instructions:\r\n- How to set up your term store\r\n- Common errors and recommended resolutions\r\n- Manual deployment instructions\r\n- Preparing your tenant for PnP starter kit\r\n- Term store considerations for non-English speaking tenants\r\n- Detailed requirements and dependencies for each starter kit component" }, { "directory": "package", "title": "Package Folder", "description": "# Package\r\n\r\nThe `package` folder contains an archived version of the **V1** starter kit. \r\n\r\nYou can safely ignore this folder for version 2 and later of the starter kit." }, { "directory": "provisioning", "title": "Provisioning Folder", "description": "# Provisioning\r\n\r\nThe `provisioning` folder contains all the documentation you'll need to successfully deploy the Starter Kit.\r\n\r\nFollow the **Table of contents** to ensure a successful deployment." }, { "directory": "sample-lob-service", "title": "Sample Line of Business Service Folder", "description": "# Sample Line of Business Service\r\n\r\nThe `sample-lob-service` contains an example showing how to call a 3rd-party API.\r\n\r\nIt is a full C# server-side application that you can customize and deploy to suit your own needs.\r\n\r\nThe [`react-lob-integration`](....//source/react-lob-integration) web part uses this service to demonstrate how to call an external API from a SharePoint web part." }, { "title": "Solution Folder", "directory": "solution", "description": "# Solution\r\n\r\nThe `solution` folder contains the **V1** version of the Starter Kit solution.\r\n\r\nYou can safely ignore this folder. It will be removed in future versions of the Starter Kit." }, { "directory": "source", "description": "# Source\r\n\r\nThe `source` folder contains the source code for every web part included in the Starter Kit.\r\n\r\nThere is a sub-folder for each web part." } ] } ================================================ FILE: LICENSE ================================================ MIT License Copyright (c) Microsoft Corporation. All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE ================================================ FILE: README.md ================================================ # SharePoint Starter Kit v3 The SharePoint Starter Kit (starter kit) is a comprehensive solution designed for SharePoint Online which provides numerous SharePoint Framework (SPFx) web parts, extensions, and other components, as well as [PnP PowerShell](https://github.com/pnp/powershell) driven provisioning which you can use as an example and inspiration for your own customizations. ![PnP Starter Pack Front Page](./assets/images/default-front-page-v2.png) > Starter Kit V3 **does not** support SharePoint 2019 and SharePoint Server Subscription Edition. > Starter Kit Version 1 includes a comprenshive strategy for only SharePoint Online, as well as a single SPFx solution that encapsulates all webparts and extensions into a single package. Version 1 may be accessed via the [v1 branch](https://github.com/pnp/sp-starter-kit/tree/v1) for legacy purposes and will not be maintained beyond April 2020. > Notice: There currently **is not** a direct path for upgrading an existing SharePoint Online tenant with the starter kit v1 to v3. V3 may be installed into a tenant with v1 already installed, by default, this will add a tenant wide duplicate all of webparts and extensions. It is recommended that the starter kit v1 be removed from a tenant before adding v3, or creating a custom installation of v3. > Starter Kit Version 2 includes a strategy for SharePoint Online and SharePoint 2019 and includes individual SPFx solutions for each webpart and application customizer. Version 2 may be accessed via the [v2 branch](https://github.com/pnp/sp-starter-kit/tree/v2) for legacy purposes and will not be maintained beyond February 2023. Starter Kit Version 2 is the only version that supports SharePoint 2019. > Notice: The direct path for upgrading an existing SharePoint Online tenant with the starter kit v2 to v3 is to only install / invoke the [starterkit-spfx-only.pnp](./provisioning/starterkit-spfx-only.pnp) provisioning template found in the [./provisioning](./provisioning) folder. This provisioning template will only upgrade the existing SPFx solutions to V3 (SPFx version 1.16.1), and will not recreate the sample sites. > Notice: the starter kit adds **tenant level settings** including themes, site designs, taxonomy term sets, and other adjustments. Therefore, it is recommended to test the starter kit in an **isolated test tenant and not immediately execute it within your production environment**. # Table of contents - [Objectives of this solution](#objectives-of-this-solution) - [SharePoint Starter Kit v3 objectives](#sharepoint-starter-kit-v3-has-following-objectives) - [Pre-requirements](#pre-requirements) - [Getting started](#getting-started) - [Learn more](#learn-more) - [Custom Web Parts](#custom-web-parts) - [SharePoint Framework Extensions](#sharepoint-framework-extensions) - [SharePoint Framework Libraries](#sharepoint-framework-libraries) - [Support and SLA for this project](#support-and-sla-for-this-project) - [Contributing](#contributing) ## Objectives of this solution SharePoint Communication Sites and Team Sites have great out-of-the-box capabilities, although the out-of-the-box capabilities may not always be sufficient for your scenarios. This is exactly why SharePoint may be extended and you are able to include your own customizations. This solution addresses common scenarios and tasks you may encounter when introducing those customizations, and provides examples and guidance on how you might address and provision them including: - Automated provisioning of simple demo content within a communication site - Automated provisioning of multiple team sites with pre-configuration and hub site association - Automated provisioning of the whole solution to any tenant within minutes - Automated configuration of Site Scripts and Site Designs at the tenant level using the PnP Remote Provisioning engine (SharePoint Online only) - Implementation of different customizations for SharePoint - Usage of Fluent UI and reusable PnP SPFx controls within the customizations > Additional high resolution screenshots are also available: [front page](./assets/images/default-front-page-v2.png). ## SharePoint Starter Kit v3 has following objectives * Extend the success of v1 and v2 by providing developers a customization and provisioning strategy for SharePoint Online * Demonstrate new SharePoint Online UX design and layout capabilities including: * Full height vertical columns * Compact headers * Mega menus * Background theming * Support web parts, extensions, and libraries to be deployed one-by-one to tenants or farms * Demonstrate teams tab development with SharePoint Framework for suitable web parts in SharePoint Online * Demonstrate Microsoft Graph API and Graph Toolkit (current version mgt-react 2.9.0) usage in SharePoint Online ## Pre-requirements Here are current pre-requirements for making this solution work in your tenant. 1. You will need to be a tenant administrator to be able to deploy this solution - Notice that you can get free developer tenant from [Microsoft 365 Developer Program](https://developer.microsoft.com/en-us/microsoft-365/dev-program), if needed. 1. Automatic end-to-end provisioning only works with English tenants - All solutions and web parts are also English in the current implementation - For tenants that have English but have a different default language, the [term set provisioning may be modified to assist with installation](./documentation/term-store.md#non-english-tenants) 1. Add the tenant administrator account used during provisioning as Term Store Administrator in the Taxonomy Term Store through the SharePoint Admin Center. 1. A tenant 'App Catalog' must have been created within the 'Apps' option of the SharePoint Admin Center. > **It is recommended that you wait up to 24 hours before attempting to provision this solution if any of the following are true** > - Your SharePoint tenant was just created > - You just created your SharePoint tenant app catalog > **This project will install [Microsoft Graph Toolkit for SPFx version 2.9.0](https://github.com/microsoftgraph/microsoft-graph-toolkit/releases) into the app catalog. If you have another version already installed, you will want to remove that package before installing the Starter Kit** ## Getting started Shortest path to success for SharePoint Online - The following steps will help you get started in any SharePoint Online tenant as fast as possible. > Starter Kit v3 no longer supports SharePoint 2019, [refer to the SharePoint 2019 installation instructions for v2](https://github.com/pnp/sp-starter-kit/blob/v2/provisioning/readme-sp2019.md) - Ensure you meet the [Pre-requirements](#Pre-requirements) - Ensure that you meet the [requirements for SharePoint Framework development](https://learn.microsoft.com/en-us/sharepoint/dev/spfx/set-up-your-development-environment) and are using the latest version of [PnP PowerShell](https://pnp.github.io/powershell/articles/installation.html). **Latest confirmed version of PnP PowerShell: 1.12.0**. - Prepare your tenant, by accomplishing the tasks highlighted in document [Preparing your tenant for the PnP SharePoint Starter Kit](./documentation/tenant-settings.md) - Open PowerShell, and use PnP PowerShell to connect to any site in your tenant with the [`Connect-PnPOnline` cmdlet](https://pnp.github.io/powershell/cmdlets/Connect-PnPOnline.html) using your own tenant url. For more information on authenticating with PnP PowerShell, see [documentation](https://pnp.github.io/powershell/articles/authentication.html) ```powershell Connect-PnPOnline https://contosodemosk.sharepoint.com ``` - Change to the `provisioning` folder found in this solution's root and execute the following command (using your own tenant url and the prefix of your choosing): ```powershell Invoke-PnPTenantTemplate -Path .\starterkit.pnp ``` This will provision three site collections with urls of `/sites/demoportal`, `/sites/demohr`, and `/sites/demomarketing`. Your urls may vary depending on the managed path you selected for team sites in your tenant administration (this defaults to 'sites'). - Refer to the ['provisioning documentation'](./provisioning) for advanced provisioning options and guidance - If you run into errors during provisioning, refer to ['Common SP Starter Kit Provisioning results'](./documentation/common-provision-results.md) for additional suggestions and common mistakes - This solution will automatically install multiple SPFx webparts that require API permissisons to the Graph API. **After installing this solution**, access your API Management page in your SharePoint Admin Center and approve the pending requests. > Notice that the starter kit also adds tenant level settings including themes, site designs, taxonomy term sets, and other adjustments. Therefore, it is recommended you test the starter kit in an **isolated test tenant and not immediately execute it within your production environment**. ## Learn more - [Detailed provisioning instructions for SharePoint Online](./provisioning/readme.md) - [Additional documentation and how-tos](./documentation/README.md) ## Custom Web Parts Here are the custom web parts currently included in the solution package. Screenshot | Web Part | Description | Compatibility | Code ------------ | ----------- | ----------- | ----------- | ----------- ![](assets/images/components/part-banner.png) | [Banner](documentation/components/wp-banner.md) | Creates a banner with an image and overlaid text. | SPO only | [code](./source/react-banner) ![](assets/images/components/part-followed-sites.png) | [Followed Sites](documentation/components/wp-followed-sites.md) | Shows the list of sites which particular user is following | SPO only | [code](./source/react-followed-sites) ![](assets/images/components/part-links.png) | [Links](documentation/components/wp-links.md) | Link list web part which is using collection data editor and stores the links in web part properties | SPO only | [code](./source/react-links) ![](assets/images/components/part-lob-integration.png) | [LOB integration](documentation/components/wp-lob-integration.md) | Sample web part to surface LOB information from API hosted in Azure. | SPO only | [code](./source/react-lob-integration) ![](assets/images/components/part-people-directory.png) | [People Directory](documentation/components/wp-people-directory.md) | People directory web part uses the people search API to get list of people to show. | SPO only | [code](./source/react-people-directory) ![](assets/images/components/part-personal-calendar.png) | [Personal Calendar](documentation/components/wp-personal-calendar.md) | Shows upcoming calendar meetings for the particular user using Microsoft Graph. | SPO only | [code](./source/react-personal-calendar) ![](assets/images/components/part-personal-contacts.png) | [Personal Contacts](documentation/components/wp-personal-contacts.md) | Personal contacts for particular user using Microsoft Graph. | SPO only |[code](./source/react-personal-contacts) ![](assets/images/components/part-personal-email.png) | [Personal Email](documentation/components/wp-personal-email.md) | List latest personal emails for the current user using Microsoft Graph. | SPO only | [code](./source/react-personal-email) ![](assets/images/components/part-personal-tasks.png) | [Personal Tasks](documentation/components/wp-personal-tasks.md) | Show personal tasks for the current user using Microsoft Graph. | SPO only | [code](./source/react-personal-tasks) ![](assets/images/components/part-recent-contacts.png) | [Recent Contacts](documentation/components/wp-recent-contacts.md) | Show recent contacts for the current user using Microsoft Graph. | SPO only | [code](./source/react-recent-contacts) ![](assets/images/components/part-recently-used-documents.png) | [Recently Used Documents](documentation/components/wp-recently-used-documents.md) | Show recently used documents for the current user using Microsoft Graph. | SPO only | [code](./source/react-recently-used-documents) ![](assets/images/components/part-recently-visited-sites.png) | [Recently Visited Sites](documentation/components/wp-recently-visited-sites.md) | Show recently visited sites for current user using Microsoft Graph. | SPO only | [code](./source/react-recently-visited-sites) ![](assets/images/components/part-site-information.png) | [Site Information](documentation/components/wp-site-information.md) | Intended to collect and present additional metadata for group associated team sites. | SPO only | [code](./source/react-site-information) ![](assets/images/components/part-stock.png) | [Stock Information (deprecated)](documentation/components/wp-stock-information.md) | Display stock information by using the live stocks service provided by [Alpha Advantage](https://www.alphavantage.co/). You will need to register for a custom key for this to work at the Alpha Advantage site and then include the key in the tenant properties. | SPO ony| [code](solution/src/webparts/stockInformation/StockInformationWebPart.ts) ![](assets/images/components/part-tiles.png) | [Tiles](documentation/components/wp-tiles.md) | Renders set of tiles. Icons are from Office UI Fabric and you can configure tiles using collection editor in web part properties. | SPO only |[code](./source/react-tiles) ![](assets/images/components/part-weather.png) | [Weather Information](documentation/components/wp-weather-information.md) | Weather information web part which is using Yahoo Weather APIs to get the forecast information. | SPO only | [code](./source/react-weather) ![](assets/images/components/part-world-time.png) | [World Time](documentation/components/wp-world-time.md) | Clock web part to show the time in specific time zone. | SPO only | [code](./source/react-world-clock) ## SharePoint Framework Extensions Screenshot | Extension | Description | Compatibility | Code ------------ | ----------- | ----------- | ----------- | ----------- ![](assets/images/components/ext-alert.png) | [Alert Notification](documentation/components/ext-alert.md) | Shows informational or important messages in the header section of pages based on a custom list information in the hub site. | SPO only | [code](./source/react-application-alerts) ![](assets/images/components/ext-collab-footer.png) | [Collaboration Footer](documentation/components/ext-collab-footer.md) | Shows company wide links which are configured using Taxonomy service. Includes also personalized links which are stored in user profile property if set. By default associated to group associated team sites when a custom Site Design is selected for new sites. | SPO only | [code](./source/react-application-collab-footer) ![](assets/images/components/ext-collab-discussnow.png) | [Discuss Now](documentation/components/ext-collab-discussnow.md) | Custom list view command set to add new custom dialog for document library that utilizes the Graph API. | SPO only | [code](./source/react-command-discuss-now) ![](assets/images/components/ext-portal-footer.png) | [Portal Footer](documentation/components/ext-portal-footer.md) | Expanding footer for communication site. Show standard company links and also supports personalized links for the current user which are stored in User Profile. | SPO only | [code](./source/react-appication-portal-footer) Not available | Redirect | Can be used to perform automatic redirections of URLs in the site based on a custom list. | SPO only | [code](./source/react-application-portal-footer) ![](assets/images/components/ext-classification.png) | [Site Classification (deprecated)](documentation/components/ext-classification.md) | Renders a header with site classification information. This has been replaced by out-of-the-box SharePoint Online header functionality | SPO only | [code](./solution/src/extensions/siteClassification/SiteClassificationApplicationCustomizer.ts) Not available | Tab Page (deprecated) | Renders a header with links between two different pages in the site. | SPO only | [code](./solution/src/extensions/tabPage/TabPageApplicationCustomizer.ts) ## SharePoint Framework Libraries Extension | Description | Compatibility | Code ------------ | ----------- | ----------- | ----------- [Shared library](./documentation/components/lib-shared.md) | A shared library that includes shared locatization strings, consumabled by any other SPFx webpart or extension. | SPO only | [code](./source/library-starter-kit-shared) ## Support and SLA for this project The following statements apply across all of the PnP samples and solutions, including samples, core component(s) and solutions, including the SharePoint Starter Kit. - PnP guidance and samples are created by Microsoft & by the community - PnP guidance and samples are maintained by Microsoft & by the community - PnP uses supported and recommended techniques - PnP is an open-source initiative by the community – people who work on the initiative for the benefit of others, have their normal day job as well - PnP is NOT a product and therefore it’s not supported by Premier Support or other official support channels - PnP is supported in similar ways as other open source projects offered by Microsoft with support from the community, by the community - There are numerous partners that utilize PnP within their solutions for customers. Support for this is provided by the Partner. When PnP material is used in deployments, we recommend being clear with your customer/deployment owner on the support model ## Contributing This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com. When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA. This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. ================================================ FILE: assets/designs/portalsitescript.js ================================================ { "$schema": "schema.json", "actions": [ { "verb":"createSPList", "listName":"Assets", "templateType": 101, "subactions": [ { "verb": "setTitle", "title": "Assets" }, { "verb": "setDescription", "description": "Portal Site Assets" } ] } ], "bindata": {}, "version": 1 } ================================================ FILE: assets/designs/portaltheme.xml ================================================ System.Collections.Hashtable System.Object neutralPrimaryAlt #2f2f2f themeLighterAlt #fffbed black #0b0b0b themeTertiary #ffcf3f primaryBackground #fff neutralQuaternaryAlt #dadada themePrimary #ffbe00 neutralSecondary #373737 themeLighter #fff4d1 themeDark #a37a00 neutralPrimary #000000 neutralLighterAlt #f8f8f8 neutralLighter #f4f4f4 neutralDark #151515 neutralQuaternary #d0d0d0 neutralLight #eaeaea primaryText #000000 themeDarker #8c6900 neutralTertiaryAlt #c8c8c8 themeDarkAlt #e6ac00 white #fff bodyBackground #fff themeSecondary #ffc20b bodyText #000000 disabledBackground #f4f4f4 neutralTertiary #595959 themeLight #ffe390 disabledText #c8c8c8 ================================================ FILE: assets/functions/applyportaltemplate/function.json ================================================ { "bindings": [ { "name": "triggerInput", "type": "queueTrigger", "direction": "in", "queueName": "pnpspportalshowcasequeue" } ], "disabled": false } ================================================ FILE: assets/functions/applyportaltemplate/modules/SharePointPnPPowerShellOnline/SharePointPnP.PowerShell.Online.Commands.Format.ps1xml ================================================ Feature Microsoft.SharePoint.Client.Feature 38 left left DisplayName DefinitionId AppInstance Microsoft.SharePoint.Client.AppInstance 38 left left Title Id Web Microsoft.SharePoint.Client.Web left 38 left left Title ServerRelativeUrl Id Site Microsoft.SharePoint.Client.Site 55 left left Url CompatibilityLevel View Microsoft.SharePoint.Client.View 30 left 38 left 7 left 8 left Title Id DefaultView PersonalView List Microsoft.SharePoint.Client.List left 38 left left Title Id $_.RootFolder.ServerRelativeUrl ContentType Microsoft.SharePoint.Client.ContentType 30 left 30 left 30 left 30 left Name Id Group Description WebPartDefinition Microsoft.SharePoint.Client.WebParts.WebPartDefinition 30 left 36 left $_.WebPart.Title Id Field Microsoft.SharePoint.Client.Field left left 36 left Title InternalName Id Group Microsoft.SharePoint.Client.Group 5 left 30 left 36 left Id Title LoginName PersonProperties Microsoft.SharePoint.Client.UserProfiles.PersonProperties left left left DisplayName AccountName PersonalUrl SiteProperties Microsoft.Online.SharePoint.TenantAdministration.SiteProperties left 20 left 5 left Url Template Lcid ListItem Microsoft.SharePoint.Client.ListItem 5 left 50 left left Id $_["Title"] $_["GUID"] UserCustomAction Microsoft.SharePoint.Client.UserCustomAction left left 5 left left Name Location Scope Id WebTemplate Microsoft.Online.SharePoint.TenantAdministration.SPOTenantWebTemplate left 40 left 15 left 18 left Name Title DisplayCategory CompatibilityLevel FolderItems Microsoft.SharePoint.Client.File Microsoft.SharePoint.Client.Folder left left right left if($_.Name -eq ""){ $_.ServerRelativeUrl.TrimEnd("/").Substring($_.ServerRelativeUrl.TrimEnd("/").LastIndexof("/") + 1) } else{ $_.Name } if($_.GetType().Name -eq "Folder" -and $_.Name -eq ""){ "Subweb" } else{ $_.GetType().Name } if($_.GetType().Name -eq "File"){ $_.Length } else{ $_.ItemCount } TimeLastModified File Microsoft.SharePoint.Client.File 30 left 10 left Name Length Folder Microsoft.SharePoint.Client.Folder 30 left Name ExtensibilityHandler OfficeDevPnP.Core.Framework.Provisioning.Model.ExtensibilityHandler 30 left 30 left 7 left Assembly Type Enabled TermGroup Microsoft.SharePoint.Client.Taxonomy.TermGroup 30 left 36 left Name Id TermSet Microsoft.SharePoint.Client.Taxonomy.TermSet 30 left 36 left Name Id Term Microsoft.SharePoint.Client.Taxonomy.Term 30 left 36 left Name Id ProvisioningTemplateInformation SharePointPnP.PowerShell.Commands.Components.ProvisioningTemplateInformation 30 left 36 left DisplayName Id UnifiedGroupEntity OfficeDevPnP.Core.Entities.UnifiedGroupEntity 30 left 38 left 38 left DisplayName GroupId SiteUrl RecycleBinItem Microsoft.SharePoint.Client.RecycleBinItem left 38 left 10 left left left Title Id ItemType LeafName DirName ImageRendition Microsoft.SharePoint.Client.Publishing.ImageRendition Right left Right Right Id Name Height Width DeletedSiteProperties Microsoft.Online.SharePoint.TenantAdministration.DeletedSiteProperties right left left DaysRemaining DeletionTime Url TermStore Microsoft.SharePoint.Client.Taxonomy.Termstore left left left left Name Id if($_.IsObjectPropertyInstantiated("Groups")){ $_.Groups.Name } else{ "Not loaded" } if($_.IsObjectPropertyInstantiated("KeywordsTermSet")){ $_.KeywordsTermSet.Name } else{ "Not loaded" } SitePolicyEntity OfficeDevPnP.Core.Entities.SitePolicyEntity left left Name Description EventReceiverDefinition Microsoft.SharePoint.Client.EventReceiverDefinition left left left left left ReceiverName ReceiverId SequenceNumber EventType Synchronization RoleDefinition Microsoft.SharePoint.Client.RoleDefinition left left left right Name RoleTypeKind Hidden Order Audit Microsoft.SharePoint.Client.Audit left AuditFlags User Microsoft.SharePoint.Client.User right left left left Id Title LoginName Email ClientSideComponent OfficeDevPnP.Core.Pages.ClientSideComponent left left left Id Name (ConvertFrom-Json $_.Manifest).alias AppMetadata OfficeDevPnP.Core.ALM.AppMetadata left left left left left Id Title Deployed AppCatalogVersion InstalledVersion TenantSiteDesign Microsoft.Online.SharePoint.TenantAdministration.TenantSiteDesign left left left Id Title SiteScriptIds TenantSiteScript Microsoft.Online.SharePoint.TenantAdministration.TenantSiteScript left left left left Id Title Version Content TenantSiteDesignPrincipal Microsoft.Online.SharePoint.TenantAdministration.TenantSiteDesignPrincipal left left left DisplayName PrincipalName Rights CanvasControl OfficeDevPnP.Core.Pages.CanvasControl left left left left left left left InstanceId $_.Type.Name Title $_.Section.Page.Sections.IndexOf($_.Section) + 1 $_.Section.Columns.IndexOf($_.Column) + 1 Order PropertiesJson NavigationNode Microsoft.SharePoint.Client.NavigationNode left left left left Id Title IsVisible Url SPOTheme SharePointPnP.PowerShell.Commands.Model.SPOTheme left left Name Palette HubSiteProperties Microsoft.Online.SharePoint.TenantAdministration.HubSiteProperties left left left SiteId Title SiteUrl TenantSiteScriptActionResult Microsoft.Online.SharePoint.TenantAdministration.TenantSiteScriptActionResult left left left Title OutcomeText Outcome ================================================ FILE: assets/functions/applyportaltemplate/modules/SharePointPnPPowerShellOnline/SharePointPnP.PowerShell.Online.Commands.dll-help.xml ================================================  Add-PnPApp * Supported in: SharePoint Online. Add/uploads an available app to the app catalog Add PnPApp Add-PnPApp Path Specifies the Id or an actual app metadata instance String Overwrite Overwrites the existing app package if it already exists SwitchParameter Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Add-PnPApp Publish This will deploy/trust an app into the app catalog SwitchParameter Path Specifies the Id or an actual app metadata instance String SkipFeatureDeployment SwitchParameter Overwrite Overwrites the existing app package if it already exists SwitchParameter Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Overwrite Overwrites the existing app package if it already exists SwitchParameter SwitchParameter Path Specifies the Id or an actual app metadata instance String String Publish This will deploy/trust an app into the app catalog SwitchParameter SwitchParameter SkipFeatureDeployment SwitchParameter SwitchParameter Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection OfficeDevPnP.Core.ALM.AppMetadata ------------------EXAMPLE 1--------------------- PS:> Add-PnPApp -Path ./myapp.sppkg This will upload the specified app package to the app catalog ------------------EXAMPLE 2--------------------- PS:> Add-PnPApp -Path ./myapp.sppkg -Publish This will upload the specified app package to the app catalog and deploy/trust it at the same time. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Add-PnPClientSidePage * Supported in: SharePoint Online. Adds a Client-Side Page Add PnPClientSidePage Add-PnPClientSidePage Name Specifies the name of the page. String LayoutType Specifies the layout type of the page. ClientSidePageLayoutType PromoteAs Allows to promote the page for a specific purpose (HomePage | NewsPage) ClientSidePagePromoteType CommentsEnabled Enables or Disables the comments on the page SwitchParameter Publish Publishes the page once it is saved. Applicable to libraries set to create major and minor versions. SwitchParameter Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection CommentsEnabled Enables or Disables the comments on the page SwitchParameter SwitchParameter LayoutType Specifies the layout type of the page. ClientSidePageLayoutType ClientSidePageLayoutType Name Specifies the name of the page. String String PromoteAs Allows to promote the page for a specific purpose (HomePage | NewsPage) ClientSidePagePromoteType ClientSidePagePromoteType Publish Publishes the page once it is saved. Applicable to libraries set to create major and minor versions. SwitchParameter SwitchParameter Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Add-PnPClientSidePage -Name "NewPage" Creates a new Client-Side page named 'NewPage' ------------------EXAMPLE 2--------------------- PS:> Add-PnPClientSidePage "NewPage" Creates a new Client-Side page named 'NewPage' SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Add-PnPClientSidePageSection * Supported in: SharePoint Online. Adds a new section to a Client-Side page Add PnPClientSidePageSection Add-PnPClientSidePageSection SectionTemplate Specifies the columns template to use for the section. CanvasSectionTemplate Page The name of the page ClientSidePagePipeBind Order Sets the order of the section. (Default = 1) Int32 Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Order Sets the order of the section. (Default = 1) Int32 Int32 Page The name of the page ClientSidePagePipeBind ClientSidePagePipeBind SectionTemplate Specifies the columns template to use for the section. CanvasSectionTemplate CanvasSectionTemplate Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Add-PnPClientSidePageSection -Page "MyPage" -SectionTemplate OneColumn Adds a new one-column section to the Client-Side page 'MyPage' ------------------EXAMPLE 2--------------------- PS:> Add-PnPClientSidePageSection -Page "MyPage" -SectionTemplate ThreeColumn -Order 10 Adds a new Three columns section to the Client-Side page 'MyPage' with an order index of 10 ------------------EXAMPLE 3--------------------- PS:> $page = Add-PnPClientSidePage -Name "MyPage" PS> Add-PnPClientSidePageSection -Page $page -SectionTemplate OneColumn Adds a new one column section to the Client-Side page 'MyPage' SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Add-PnPClientSideText * Supported in: SharePoint Online. Adds a text element to a client-side page. Add PnPClientSideText Adds a new text element to a section on a client-side page. Add-PnPClientSideText Text Specifies the text to display in the text area. String Page The name of the page. ClientSidePagePipeBind Order Sets the order of the text control. (Default = 1) Int32 Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Add-PnPClientSideText Text Specifies the text to display in the text area. String Section Sets the section where to insert the text control. Int32 Column Sets the column where to insert the text control. Int32 Page The name of the page. ClientSidePagePipeBind Order Sets the order of the text control. (Default = 1) Int32 Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Column Sets the column where to insert the text control. Int32 Int32 Order Sets the order of the text control. (Default = 1) Int32 Int32 Page The name of the page. ClientSidePagePipeBind ClientSidePagePipeBind Section Sets the section where to insert the text control. Int32 Int32 Text Specifies the text to display in the text area. String String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Add-PnPClientSideText -Page "MyPage" -Text "Hello World!" Adds the text 'Hello World!' to the Client-Side Page 'MyPage' SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Add-PnPClientSideWebPart * Supported in: SharePoint Online. Adds a Client-Side Web Part to a client-side page Add PnPClientSideWebPart Adds a client-side web part to an existing client-side page. Add-PnPClientSideWebPart DefaultWebPartType Defines a default WebPart type to insert. DefaultClientSideWebParts Page The name of the page. ClientSidePagePipeBind WebPartProperties The properties of the WebPart PropertyBagPipeBind Order Sets the order of the WebPart control. (Default = 1) Int32 Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Add-PnPClientSideWebPart Component Specifies the component instance or Id to add. ClientSideComponentPipeBind Page The name of the page. ClientSidePagePipeBind WebPartProperties The properties of the WebPart PropertyBagPipeBind Order Sets the order of the WebPart control. (Default = 1) Int32 Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Add-PnPClientSideWebPart DefaultWebPartType Defines a default WebPart type to insert. DefaultClientSideWebParts Section Sets the section where to insert the WebPart control. Int32 Column Sets the column where to insert the WebPart control. Int32 Page The name of the page. ClientSidePagePipeBind WebPartProperties The properties of the WebPart PropertyBagPipeBind Order Sets the order of the WebPart control. (Default = 1) Int32 Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Add-PnPClientSideWebPart Component Specifies the component instance or Id to add. ClientSideComponentPipeBind Section Sets the section where to insert the WebPart control. Int32 Column Sets the column where to insert the WebPart control. Int32 Page The name of the page. ClientSidePagePipeBind WebPartProperties The properties of the WebPart PropertyBagPipeBind Order Sets the order of the WebPart control. (Default = 1) Int32 Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Column Sets the column where to insert the WebPart control. Int32 Int32 Component Specifies the component instance or Id to add. ClientSideComponentPipeBind ClientSideComponentPipeBind DefaultWebPartType Defines a default WebPart type to insert. DefaultClientSideWebParts DefaultClientSideWebParts Order Sets the order of the WebPart control. (Default = 1) Int32 Int32 Page The name of the page. ClientSidePagePipeBind ClientSidePagePipeBind Section Sets the section where to insert the WebPart control. Int32 Int32 WebPartProperties The properties of the WebPart PropertyBagPipeBind PropertyBagPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Add-PnPClientSideWebPart -Page "MyPage" -DefaultWebPartType BingMap Adds a built-in Client-Side component 'BingMap' to the page called 'MyPage' ------------------EXAMPLE 2--------------------- PS:> Add-PnPClientSideWebPart -Page "MyPage" -Component "HelloWorld" Adds a Client-Side component 'HelloWorld' to the page called 'MyPage' ------------------EXAMPLE 3--------------------- PS:> Add-PnPClientSideWebPart -Page "MyPage" -Component "HelloWorld" -Section 1 -Column 2 Adds a Client-Side component 'HelloWorld' to the page called 'MyPage' in section 1 and column 2 SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Add-PnPContentType Adds a new content type Add PnPContentType Add-PnPContentType Name Specify the name of the new content type String ContentTypeId If specified, in the format of 0x0100233af432334r434343f32f3, will create a content type with the specific ID String Description Specifies the description of the new content type String Group Specifies the group of the new content type String ParentContentType Specifies the parent of the new content type ContentType Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection ContentTypeId If specified, in the format of 0x0100233af432334r434343f32f3, will create a content type with the specific ID String String Description Specifies the description of the new content type String String Group Specifies the group of the new content type String String Name Specify the name of the new content type String String ParentContentType Specifies the parent of the new content type ContentType ContentType Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind Microsoft.SharePoint.Client.ContentType ------------------EXAMPLE 1--------------------- PS:> Add-PnPContentType -Name "Project Document" -Description "Use for Contoso projects" -Group "Contoso Content Types" -ParentContentType $ct This will add a new content type based on the parent content type stored in the $ct variable. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Add-PnPContentTypeToDocumentSet Adds a content type to a document set Add PnPContentTypeToDocumentSet Add-PnPContentTypeToDocumentSet ContentType The content type object, name or id to add. Either specify name, an id, or a content type object. ContentTypePipeBind[] DocumentSet The document set object or id to add the content type to. Either specify a name, a document set template object, an id, or a content type object DocumentSetPipeBind Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection ContentType The content type object, name or id to add. Either specify name, an id, or a content type object. ContentTypePipeBind[] ContentTypePipeBind[] DocumentSet The document set object or id to add the content type to. Either specify a name, a document set template object, an id, or a content type object DocumentSetPipeBind DocumentSetPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Add-PnPContentTypeToDocumentSet -ContentType "Test CT" -DocumentSet "Test Document Set" This will add the content type called 'Test CT' to the document set called ''Test Document Set' ------------------EXAMPLE 2--------------------- PS:> $docset = Get-PnPDocumentSetTemplate -Identity "Test Document Set" PS:> $ct = Get-PnPContentType -Identity "Test CT" PS:> Add-PnPContentTypeToDocumentSet -ContentType $ct -DocumentSet $docset This will add the content type called 'Test CT' to the document set called ''Test Document Set' ------------------EXAMPLE 3--------------------- PS:> Add-PnPContentTypeToDocumentSet -ContentType 0x0101001F1CEFF1D4126E4CAD10F00B6137E969 -DocumentSet 0x0120D520005DB65D094035A241BAC9AF083F825F3B This will add the content type called 'Test CT' to the document set called ''Test Document Set' SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Add-PnPContentTypeToList Adds a new content type to a list Add PnPContentTypeToList Add-PnPContentTypeToList List Specifies the list to which the content type needs to be added ListPipeBind ContentType Specifies the content type that needs to be added to the list ContentTypePipeBind DefaultContentType Specify if the content type needs to be the default content type or not SwitchParameter Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection ContentType Specifies the content type that needs to be added to the list ContentTypePipeBind ContentTypePipeBind DefaultContentType Specify if the content type needs to be the default content type or not SwitchParameter SwitchParameter List Specifies the list to which the content type needs to be added ListPipeBind ListPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Add-PnPContentTypeToList -List "Documents" -ContentType "Project Document" -DefaultContentType This will add an existing content type to a list and sets it as the default content type SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Add-PnPCustomAction Adds a custom action Add PnPCustomAction Adds a user custom action to a web or sitecollection. Add-PnPCustomAction Name The name of the custom action String Title The title of the custom action String Location The actual location where this custom action need to be added like 'CommandUI.Ribbon' String ClientSideComponentId The Client Side Component Id of the custom action GuidPipeBind RegistrationId The identifier of the object associated with the custom action. String RegistrationType Specifies the type of object associated with the custom action UserCustomActionRegistrationType Scope The scope of the CustomAction to add to. Either Web or Site; defaults to Web. 'All' is not valid for this command. CustomActionScope ClientSideComponentProperties The Client Side Component Properties of the custom action. Specify values as a json string : "{Property1 : 'Value1', Property2: 'Value2'}" String Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Add-PnPCustomAction Name The name of the custom action String Title The title of the custom action String Description The description of the custom action String Group The group where this custom action needs to be added like 'SiteActions' String Location The actual location where this custom action need to be added like 'CommandUI.Ribbon' String Sequence Sequence of this CustomAction being injected. Use when you have a specific sequence with which to have multiple CustomActions being added to the page. Int32 Url The URL, URI or ECMAScript (JScript, JavaScript) function associated with the action String ImageUrl The URL of the image associated with the custom action String CommandUIExtension XML fragment that determines user interface properties of the custom action String RegistrationId The identifier of the object associated with the custom action. String Rights A string array that contain the permissions needed for the custom action PermissionKind[] RegistrationType Specifies the type of object associated with the custom action UserCustomActionRegistrationType Scope The scope of the CustomAction to add to. Either Web or Site; defaults to Web. 'All' is not valid for this command. CustomActionScope Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection ClientSideComponentId The Client Side Component Id of the custom action GuidPipeBind GuidPipeBind ClientSideComponentProperties The Client Side Component Properties of the custom action. Specify values as a json string : "{Property1 : 'Value1', Property2: 'Value2'}" String String CommandUIExtension XML fragment that determines user interface properties of the custom action String String Description The description of the custom action String String Group The group where this custom action needs to be added like 'SiteActions' String String ImageUrl The URL of the image associated with the custom action String String Location The actual location where this custom action need to be added like 'CommandUI.Ribbon' String String Name The name of the custom action String String RegistrationId The identifier of the object associated with the custom action. String String RegistrationType Specifies the type of object associated with the custom action UserCustomActionRegistrationType UserCustomActionRegistrationType Rights A string array that contain the permissions needed for the custom action PermissionKind[] PermissionKind[] Scope The scope of the CustomAction to add to. Either Web or Site; defaults to Web. 'All' is not valid for this command. CustomActionScope CustomActionScope Sequence Sequence of this CustomAction being injected. Use when you have a specific sequence with which to have multiple CustomActions being added to the page. Int32 Int32 Title The title of the custom action String String Url The URL, URI or ECMAScript (JScript, JavaScript) function associated with the action String String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- $cUIExtn = "<CommandUIExtension><CommandUIDefinitions><CommandUIDefinition Location=""Ribbon.List.Share.Controls._children""><Button Id=""Ribbon.List.Share.GetItemsCountButton"" Alt=""Get list items count"" Sequence=""11"" Command=""Invoke_GetItemsCountButtonRequest"" LabelText=""Get Items Count"" TemplateAlias=""o1"" Image32by32=""_layouts/15/images/placeholder32x32.png"" Image16by16=""_layouts/15/images/placeholder16x16.png"" /></CommandUIDefinition></CommandUIDefinitions><CommandUIHandlers><CommandUIHandler Command=""Invoke_GetItemsCountButtonRequest"" CommandAction=""javascript: alert('Total items in this list: '+ ctx.TotalListItems);"" EnabledScript=""javascript: function checkEnable() { return (true);} checkEnable();""/></CommandUIHandlers></CommandUIExtension>" Add-PnPCustomAction -Name 'GetItemsCount' -Title 'Invoke GetItemsCount Action' -Description 'Adds custom action to custom list ribbon' -Group 'SiteActions' -Location 'CommandUI.Ribbon' -CommandUIExtension $cUIExtn Adds a new custom action to the custom list template, and sets the Title, Name and other fields with the specified values. On click it shows the number of items in that list. Notice: escape quotes in CommandUIExtension. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp UserCustomAction: https://msdn.microsoft.com/en-us/library/office/microsoft.sharepoint.client.usercustomaction.aspx BasePermissions: https://msdn.microsoft.com/en-us/library/office/microsoft.sharepoint.client.basepermissions.aspx Add-PnPDataRowsToProvisioningTemplate Adds datarows to a list inside a PnP Provisioning Template Add PnPDataRowsToProvisioningTemplate Add-PnPDataRowsToProvisioningTemplate List The list to query ListPipeBind Query The CAML query to execute against the list String Path Filename of the .PNP Open XML provisioning template to read from, optionally including full path. String Fields The fields to retrieve. If not specified all fields will be loaded in the returned list object. String[] TokenizeUrls If set, this switch will try to tokenize the values with web and site related tokens SwitchParameter TemplateProviderExtensions Allows you to specify ITemplateProviderExtension to execute while loading the template. ITemplateProviderExtension[] IncludeSecurity A switch to include ObjectSecurity information. SwitchParameter Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Fields The fields to retrieve. If not specified all fields will be loaded in the returned list object. String[] String[] IncludeSecurity A switch to include ObjectSecurity information. SwitchParameter SwitchParameter List The list to query ListPipeBind ListPipeBind Path Filename of the .PNP Open XML provisioning template to read from, optionally including full path. String String Query The CAML query to execute against the list String String TemplateProviderExtensions Allows you to specify ITemplateProviderExtension to execute while loading the template. ITemplateProviderExtension[] ITemplateProviderExtension[] TokenizeUrls If set, this switch will try to tokenize the values with web and site related tokens SwitchParameter SwitchParameter Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Add-PnPDataRowsToProvisioningTemplate -Path template.pnp -List 'PnPTestList' -Query '<View></View>' -Fields 'Title','Choice' Adds datarows to a list in an in-memory PnP Provisioning Template ------------------EXAMPLE 2--------------------- PS:> Add-PnPDataRowsToProvisioningTemplate -Path template.pnp -List 'PnPTestList' -Query '<View></View>' -Fields 'Title','Choice' -IncludeSecurity Adds datarows to a list in an in-memory PnP Provisioning Template SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Add-PnPDocumentSet Creates a new document set in a library. Add PnPDocumentSet Add-PnPDocumentSet List The name of the list, its ID or an actual list object from where the document set needs to be added ListPipeBind Name The name of the document set String ContentType The name of the content type, its ID or an actual content object referencing to the document set. ContentTypePipeBind Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection ContentType The name of the content type, its ID or an actual content object referencing to the document set. ContentTypePipeBind ContentTypePipeBind List The name of the list, its ID or an actual list object from where the document set needs to be added ListPipeBind ListPipeBind Name The name of the document set String String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind System.String ------------------EXAMPLE 1--------------------- PS:> Add-PnPDocumentSet -List "Documents" -ContentType "Test Document Set" -Name "Test" This will add a new document set based upon the 'Test Document Set' content type to a list called 'Documents'. The document set will be named 'Test' SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Add-PnPEventReceiver Adds a new remote event receiver Add PnPEventReceiver Add-PnPEventReceiver Name The name of the remote event receiver String Url The URL of the remote event receiver web service String EventReceiverType The type of the event receiver like ItemAdded, ItemAdding. See https://msdn.microsoft.com/en-us/library/microsoft.sharepoint.client.eventreceivertype.aspx for the full list of available types. EventReceiverType Synchronization The synchronization type: Asynchronous or Synchronous EventReceiverSynchronization List The list object or name where the remote event receiver needs to be added. If omitted, the remote event receiver will be added to the web. ListPipeBind SequenceNumber The sequence number where this remote event receiver should be placed Int32 Force Overwrites the output file if it exists. SwitchParameter Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection EventReceiverType The type of the event receiver like ItemAdded, ItemAdding. See https://msdn.microsoft.com/en-us/library/microsoft.sharepoint.client.eventreceivertype.aspx for the full list of available types. EventReceiverType EventReceiverType Force Overwrites the output file if it exists. SwitchParameter SwitchParameter List The list object or name where the remote event receiver needs to be added. If omitted, the remote event receiver will be added to the web. ListPipeBind ListPipeBind Name The name of the remote event receiver String String SequenceNumber The sequence number where this remote event receiver should be placed Int32 Int32 Synchronization The synchronization type: Asynchronous or Synchronous EventReceiverSynchronization EventReceiverSynchronization Url The URL of the remote event receiver web service String String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind Microsoft.SharePoint.Client.EventReceiverDefinition ------------------EXAMPLE 1--------------------- PS:> Add-PnPEventReceiver -List "ProjectList" -Name "TestEventReceiver" -Url https://yourserver.azurewebsites.net/eventreceiver.svc -EventReceiverType ItemAdded -Synchronization Asynchronous This will add a new remote event receiver that is executed after an item has been added to the ProjectList list ------------------EXAMPLE 2--------------------- PS:> Add-PnPEventReceiver -Name "TestEventReceiver" -Url https://yourserver.azurewebsites.net/eventreceiver.svc -EventReceiverType WebAdding -Synchronization Synchronous This will add a new remote event receiver that is executed while a new subsite is being created SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Add-PnPField Add a field Add PnPField Adds a field to a list or as a site column Add-PnPField AddToDefaultView Switch Parameter if this field must be added to the default view SwitchParameter Required Switch Parameter if the field is a required field SwitchParameter Group The group name to where this field belongs to String Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Add-PnPField List The name of the list, its ID or an actual list object where this field needs to be added ListPipeBind Field The name of the field, its ID or an actual field object that needs to be added FieldPipeBind Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Add-PnPField DisplayName The display name of the field String InternalName The internal name of the field String Type The type of the field like Choice, Note, MultiChoice FieldType List The name of the list, its ID or an actual list object where this field needs to be added ListPipeBind Id The ID of the field, must be unique GuidPipeBind AddToDefaultView Switch Parameter if this field must be added to the default view SwitchParameter Required Switch Parameter if the field is a required field SwitchParameter Group The group name to where this field belongs to String ClientSideComponentId The Client Side Component Id to set to the field GuidPipeBind ClientSideComponentProperties The Client Side Component Properties to set to the field String Choices Specify choices, only valid if the field type is Choice String[] Formula Specify the formula. Only available if the field type is Calculated String Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Add-PnPField DisplayName The display name of the field String InternalName The internal name of the field String Type The type of the field like Choice, Note, MultiChoice FieldType Id The ID of the field, must be unique GuidPipeBind ClientSideComponentId The Client Side Component Id to set to the field GuidPipeBind ClientSideComponentProperties The Client Side Component Properties to set to the field String Choices Specify choices, only valid if the field type is Choice String[] Formula Specify the formula. Only avialable if the field type is Calculated String Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection AddToDefaultView Switch Parameter if this field must be added to the default view SwitchParameter SwitchParameter Choices Specify choices, only valid if the field type is Choice String[] String[] ClientSideComponentId The Client Side Component Id to set to the field GuidPipeBind GuidPipeBind ClientSideComponentProperties The Client Side Component Properties to set to the field String String DisplayName The display name of the field String String Field The name of the field, its ID or an actual field object that needs to be added FieldPipeBind FieldPipeBind Formula Specify the formula. Only available if the field type is Calculated String String Group The group name to where this field belongs to String String Id The ID of the field, must be unique GuidPipeBind GuidPipeBind InternalName The internal name of the field String String List The name of the list, its ID or an actual list object where this field needs to be added ListPipeBind ListPipeBind Required Switch Parameter if the field is a required field SwitchParameter SwitchParameter Type The type of the field like Choice, Note, MultiChoice FieldType FieldType Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind Microsoft.SharePoint.Client.Field ------------------EXAMPLE 1--------------------- PS:> Add-PnPField -Type Calculated -InternalName "C1" -DisplayName "C1" -Formula ="[Title]" Adds a new calculated site column with the formula specified ------------------EXAMPLE 2--------------------- PS:> Add-PnPField -List "Demo list" -DisplayName "Location" -InternalName "SPSLocation" -Type Choice -Group "Demo Group" -AddToDefaultView -Choices "Stockholm","Helsinki","Oslo" This will add a field of type Choice to the list "Demo List". ------------------EXAMPLE 3--------------------- PS:>Add-PnPField -List "Demo list" -DisplayName "Speakers" -InternalName "SPSSpeakers" -Type MultiChoice -Group "Demo Group" -AddToDefaultView -Choices "Obiwan Kenobi","Darth Vader", "Anakin Skywalker" This will add a field of type Multiple Choice to the list "Demo List". (you can pick several choices for the same item) SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Add-PnPFieldFromXml Adds a field to a list or as a site column based upon a CAML/XML field definition Add PnPFieldFromXml Add-PnPFieldFromXml FieldXml CAML snippet containing the field definition. See http://msdn.microsoft.com/en-us/library/office/ms437580(v=office.15).aspx String List The name of the list, its ID or an actual list object where this field needs to be added ListPipeBind Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection FieldXml CAML snippet containing the field definition. See http://msdn.microsoft.com/en-us/library/office/ms437580(v=office.15).aspx String String List The name of the list, its ID or an actual list object where this field needs to be added ListPipeBind ListPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind Microsoft.SharePoint.Client.Field ------------------EXAMPLE 1--------------------- PS:> $xml = '<Field Type="Text" Name="PSCmdletTest" DisplayName="PSCmdletTest" ID="{27d81055-f208-41c9-a976-61c5473eed4a}" Group="Test" Required="FALSE" StaticName="PSCmdletTest" />' PS:> Add-PnPFieldFromXml -FieldXml $xml Adds a field with the specified field CAML code to the site. ------------------EXAMPLE 2--------------------- PS:> $xml = '<Field Type="Text" Name="PSCmdletTest" DisplayName="PSCmdletTest" ID="{27d81055-f208-41c9-a976-61c5473eed4a}" Group="Test" Required="FALSE" StaticName="PSCmdletTest" />' PS:> Add-PnPFieldFromXml -List "Demo List" -FieldXml $xml Adds a field with the specified field CAML code to the list "Demo List". SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Field CAML: http://msdn.microsoft.com/en-us/library/office/ms437580(v=office.15).aspx Add-PnPFieldToContentType Adds an existing site column to a content type Add PnPFieldToContentType Add-PnPFieldToContentType Field Specifies the field that needs to be added to the content type FieldPipeBind ContentType Specifies which content type a field needs to be added to ContentTypePipeBind Required Specifies whether the field is required or not SwitchParameter Hidden Specifies whether the field should be hidden or not SwitchParameter Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection ContentType Specifies which content type a field needs to be added to ContentTypePipeBind ContentTypePipeBind Field Specifies the field that needs to be added to the content type FieldPipeBind FieldPipeBind Hidden Specifies whether the field should be hidden or not SwitchParameter SwitchParameter Required Specifies whether the field is required or not SwitchParameter SwitchParameter Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Add-PnPFieldToContentType -Field "Project_Name" -ContentType "Project Document" This will add an existing site column with an internal name of "Project_Name" to a content type called "Project Document" SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Add-PnPFile Uploads a file to Web Add PnPFile Add-PnPFile Path The local file path. String Folder The destination folder in the site String Checkout If versioning is enabled, this will check out the file first if it exists, upload the file, then check it in again. SwitchParameter CheckInComment The comment added to the checkin. String Approve Will auto approve the uploaded file. SwitchParameter ApproveComment The comment added to the approval. String Publish Will auto publish the file. SwitchParameter PublishComment The comment added to the publish action. String UseWebDav SwitchParameter Values Use the internal names of the fields when specifying field names. Single line of text: -Values @{"Title" = "Title New"} Multiple lines of text: -Values @{"MultiText" = "New text\n\nMore text"} Rich text: -Values @{"MultiText" = "<strong>New</strong> text"} Choice: -Values @{"Choice" = "Value 1"} Number: -Values @{"Number" = "10"} Currency: -Values @{"Number" = "10"} Currency: -Values @{"Currency" = "10"} Date and Time: -Values @{"DateAndTime" = "03/10/2015 14:16"} Lookup (id of lookup value): -Values @{"Lookup" = "2"} Multi value lookup (id of lookup values as array 1): -Values @{"MultiLookupField" = "1","2"} Multi value lookup (id of lookup values as array 2): -Values @{"MultiLookupField" = 1,2} Multi value lookup (id of lookup values as string): -Values @{"MultiLookupField" = "1,2"} Yes/No: -Values @{"YesNo" = $false} Person/Group (id of user/group in Site User Info List or email of the user, seperate multiple values with a comma): -Values @{"Person" = "user1@domain.com","21"} Managed Metadata (single value with path to term): -Values @{"MetadataField" = "CORPORATE|DEPARTMENTS|FINANCE"} Managed Metadata (single value with id of term): -Values @{"MetadataField" = "fe40a95b-2144-4fa2-b82a-0b3d0299d818"} with Id of term Managed Metadata (multiple values with paths to terms): -Values @{"MetadataField" = "CORPORATE|DEPARTMENTS|FINANCE","CORPORATE|DEPARTMENTS|HR"} Managed Metadata (multiple values with ids of terms): -Values @{"MetadataField" = "fe40a95b-2144-4fa2-b82a-0b3d0299d818","52d88107-c2a8-4bf0-adfa-04bc2305b593"} Hyperlink or Picture: -Values @{"Hyperlink" = "https://github.com/OfficeDev/, OfficePnp"} Hashtable ContentType Use to assign a ContentType to the file. ContentTypePipeBind Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Add-PnPFile FileName Name for file String Stream Stream with the file contents Stream Folder The destination folder in the site String Checkout If versioning is enabled, this will check out the file first if it exists, upload the file, then check it in again. SwitchParameter CheckInComment The comment added to the checkin. String Approve Will auto approve the uploaded file. SwitchParameter ApproveComment The comment added to the approval. String Publish Will auto publish the file. SwitchParameter PublishComment The comment added to the publish action. String UseWebDav SwitchParameter Values Use the internal names of the fields when specifying field names. Single line of text: -Values @{"Title" = "Title New"} Multiple lines of text: -Values @{"MultiText" = "New text\n\nMore text"} Rich text: -Values @{"MultiText" = "<strong>New</strong> text"} Choice: -Values @{"Choice" = "Value 1"} Number: -Values @{"Number" = "10"} Currency: -Values @{"Number" = "10"} Currency: -Values @{"Currency" = "10"} Date and Time: -Values @{"DateAndTime" = "03/10/2015 14:16"} Lookup (id of lookup value): -Values @{"Lookup" = "2"} Multi value lookup (id of lookup values as array 1): -Values @{"MultiLookupField" = "1","2"} Multi value lookup (id of lookup values as array 2): -Values @{"MultiLookupField" = 1,2} Multi value lookup (id of lookup values as string): -Values @{"MultiLookupField" = "1,2"} Yes/No: -Values @{"YesNo" = $false} Person/Group (id of user/group in Site User Info List or email of the user, seperate multiple values with a comma): -Values @{"Person" = "user1@domain.com","21"} Managed Metadata (single value with path to term): -Values @{"MetadataField" = "CORPORATE|DEPARTMENTS|FINANCE"} Managed Metadata (single value with id of term): -Values @{"MetadataField" = "fe40a95b-2144-4fa2-b82a-0b3d0299d818"} with Id of term Managed Metadata (multiple values with paths to terms): -Values @{"MetadataField" = "CORPORATE|DEPARTMENTS|FINANCE","CORPORATE|DEPARTMENTS|HR"} Managed Metadata (multiple values with ids of terms): -Values @{"MetadataField" = "fe40a95b-2144-4fa2-b82a-0b3d0299d818","52d88107-c2a8-4bf0-adfa-04bc2305b593"} Hyperlink or Picture: -Values @{"Hyperlink" = "https://github.com/OfficeDev/, OfficePnp"} Hashtable ContentType Use to assign a ContentType to the file. ContentTypePipeBind Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Approve Will auto approve the uploaded file. SwitchParameter SwitchParameter ApproveComment The comment added to the approval. String String CheckInComment The comment added to the checkin. String String Checkout If versioning is enabled, this will check out the file first if it exists, upload the file, then check it in again. SwitchParameter SwitchParameter ContentType Use to assign a ContentType to the file. ContentTypePipeBind ContentTypePipeBind FileName Name for file String String Folder The destination folder in the site String String Path The local file path. String String Publish Will auto publish the file. SwitchParameter SwitchParameter PublishComment The comment added to the publish action. String String Stream Stream with the file contents Stream Stream UseWebDav SwitchParameter SwitchParameter Values Use the internal names of the fields when specifying field names. Single line of text: -Values @{"Title" = "Title New"} Multiple lines of text: -Values @{"MultiText" = "New text\n\nMore text"} Rich text: -Values @{"MultiText" = "<strong>New</strong> text"} Choice: -Values @{"Choice" = "Value 1"} Number: -Values @{"Number" = "10"} Currency: -Values @{"Number" = "10"} Currency: -Values @{"Currency" = "10"} Date and Time: -Values @{"DateAndTime" = "03/10/2015 14:16"} Lookup (id of lookup value): -Values @{"Lookup" = "2"} Multi value lookup (id of lookup values as array 1): -Values @{"MultiLookupField" = "1","2"} Multi value lookup (id of lookup values as array 2): -Values @{"MultiLookupField" = 1,2} Multi value lookup (id of lookup values as string): -Values @{"MultiLookupField" = "1,2"} Yes/No: -Values @{"YesNo" = $false} Person/Group (id of user/group in Site User Info List or email of the user, seperate multiple values with a comma): -Values @{"Person" = "user1@domain.com","21"} Managed Metadata (single value with path to term): -Values @{"MetadataField" = "CORPORATE|DEPARTMENTS|FINANCE"} Managed Metadata (single value with id of term): -Values @{"MetadataField" = "fe40a95b-2144-4fa2-b82a-0b3d0299d818"} with Id of term Managed Metadata (multiple values with paths to terms): -Values @{"MetadataField" = "CORPORATE|DEPARTMENTS|FINANCE","CORPORATE|DEPARTMENTS|HR"} Managed Metadata (multiple values with ids of terms): -Values @{"MetadataField" = "fe40a95b-2144-4fa2-b82a-0b3d0299d818","52d88107-c2a8-4bf0-adfa-04bc2305b593"} Hyperlink or Picture: -Values @{"Hyperlink" = "https://github.com/OfficeDev/, OfficePnp"} Hashtable Hashtable Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind Microsoft.SharePoint.Client.File ------------------EXAMPLE 1--------------------- PS:> Add-PnPFile -Path c:\temp\company.master -Folder "_catalogs/masterpage" This will upload the file company.master to the masterpage catalog ------------------EXAMPLE 2--------------------- PS:> Add-PnPFile -Path .\displaytemplate.html -Folder "_catalogs/masterpage/display templates/test" This will upload the file displaytemplate.html to the test folder in the display templates folder. If the test folder does not exist it will create it. ------------------EXAMPLE 3--------------------- PS:> Add-PnPFile -Path .\sample.doc -Folder "Shared Documents" -Values @{Modified="1/1/2016"} This will upload the file sample.doc to the Shared Documnets folder. After uploading it will set the Modified date to 1/1/2016. ------------------EXAMPLE 4--------------------- PS:> Add-PnPFile -FileName sample.doc -Folder "Shared Documents" -Stream $fileStream -Values @{Modified="1/1/2016"} This will add a file sample.doc with the contents of the stream into the Shared Documents folder. After adding it will set the Modified date to 1/1/2016. ------------------EXAMPLE 5--------------------- PS:> Add-PnPFile -FileName sample.doc -Folder "Shared Documents" -ContentType "Document" -Values @{Modified="1/1/2016"} This will add a file sample.doc to the Shared Documents folder, with a ContentType of 'Documents'. After adding it will set the Modified date to 1/1/2016. ------------------EXAMPLE 6--------------------- PS:> Add-PnPFile -FileName sample.docx -Folder "Documents" -Values @{Modified="1/1/2016"; Created="1/1/2017"; Editor=23} This will add a file sample.docx to the Documents folder and will set the Modified date to 1/1/2016, Created date to 1/1/2017 and the Modified By field to the user with ID 23. To find out about the proper user ID to relate to a specific user, use Get-PnPUser. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Add-PnPFileToProvisioningTemplate Adds a file to a PnP Provisioning Template Add PnPFileToProvisioningTemplate Add-PnPFileToProvisioningTemplate Path Filename of the .PNP Open XML provisioning template to read from, optionally including full path. String Source The file to add to the in-memory template, optionally including full path. String Folder The target Folder for the file to add to the in-memory template. String Container The target Container for the file to add to the in-memory template, optional argument. String FileLevel The level of the files to add. Defaults to Published FileLevel TemplateProviderExtensions Allows you to specify ITemplateProviderExtension to execute while loading the template. ITemplateProviderExtension[] FileOverwrite Set to overwrite in site, Defaults to true SwitchParameter Container The target Container for the file to add to the in-memory template, optional argument. String String FileLevel The level of the files to add. Defaults to Published FileLevel FileLevel FileOverwrite Set to overwrite in site, Defaults to true SwitchParameter SwitchParameter Folder The target Folder for the file to add to the in-memory template. String String Path Filename of the .PNP Open XML provisioning template to read from, optionally including full path. String String Source The file to add to the in-memory template, optionally including full path. String String TemplateProviderExtensions Allows you to specify ITemplateProviderExtension to execute while loading the template. ITemplateProviderExtension[] ITemplateProviderExtension[] ------------------EXAMPLE 1--------------------- PS:> Add-PnPFileToProvisioningTemplate -Path template.pnp -Source $sourceFilePath -Folder $targetFolder Adds a file to a PnP Provisioning Template ------------------EXAMPLE 2--------------------- PS:> Add-PnPFileToProvisioningTemplate -Path template.xml -Source $sourceFilePath -Folder $targetFolder Adds a file reference to a PnP Provisioning XML Template ------------------EXAMPLE 3--------------------- PS:> Add-PnPFileToProvisioningTemplate -Path template.pnp -Source "./myfile.png" -Folder "folderinsite" -FileLevel Published -FileOverwrite:$false Adds a file to a PnP Provisioning Template, specifies the level as Published and defines to not overwrite the file if it exists in the site. ------------------EXAMPLE 4--------------------- PS:> Add-PnPFileToProvisioningTemplate -Path template.pnp -Source $sourceFilePath -Folder $targetFolder -Container $container Adds a file to a PnP Provisioning Template with a custom container for the file SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Add-PnPFolder Creates a folder within a parent folder Add PnPFolder Add-PnPFolder Name The folder name String Folder The parent folder in the site String Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Folder The parent folder in the site String String Name The folder name String String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Add-PnPFolder -Name NewFolder -Folder _catalogs/masterpage This will create the folder NewFolder in the masterpage catalog SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Add-PnPHtmlPublishingPageLayout Adds a HTML based publishing page layout Add PnPHtmlPublishingPageLayout Add-PnPHtmlPublishingPageLayout SourceFilePath Path to the file which will be uploaded String Title Title for the page layout String Description Description for the page layout String AssociatedContentTypeID Associated content type ID String DestinationFolderHierarchy Folder hierarchy where the HTML page layouts will be deployed String Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection AssociatedContentTypeID Associated content type ID String String Description Description for the page layout String String DestinationFolderHierarchy Folder hierarchy where the HTML page layouts will be deployed String String SourceFilePath Path to the file which will be uploaded String String Title Title for the page layout String String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Add-PnPHtmlPublishingPageLayout -Title 'Our custom page layout' -SourceFilePath 'customlayout.aspx' -Description 'A custom page layout' -AssociatedContentTypeID 0x01010901 Uploads the pagelayout 'customlayout.aspx' from the current location to the current site as a 'web part page' pagelayout SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Add-PnPHubSiteAssociation * Supported in: SharePoint Online. Connects a site to a hubsite. Add PnPHubSiteAssociation Connects an existing site to a hubsite Add-PnPHubSiteAssociation Site The site to connect to the hubsite SitePipeBind HubSite The hubsite to connect the site to SitePipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection HubSite The hubsite to connect the site to SitePipeBind SitePipeBind Site The site to connect to the hubsite SitePipeBind SitePipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection ------------------EXAMPLE 1--------------------- PS:> Add-PnPHubSiteAssociation -Site https://tenant.sharepoint.com/sites/mysite -HubSite https://tenant.sharepoint.com/sites/hubsite This example adds the specified site to the hubsite. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Add-PnPIndexedProperty Marks the value of the propertybag key specified to be indexed by search. Add PnPIndexedProperty Add-PnPIndexedProperty Key Key of the property bag value to be indexed String Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Key Key of the property bag value to be indexed String String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Add-PnPJavaScriptBlock Adds a link to a JavaScript snippet/block to a web or site collection Add PnPJavaScriptBlock Specify a scope as 'Site' to add the custom action to all sites in a site collection. Add-PnPJavaScriptBlock Name The name of the script block. Can be used to identify the script with other cmdlets or coded solutions String Script The javascript block to add to the specified scope String Sequence A sequence number that defines the order on the page Int32 Scope The scope of the script to add to. Either Web or Site, defaults to Web. 'All' is not valid for this command. CustomActionScope Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Name The name of the script block. Can be used to identify the script with other cmdlets or coded solutions String String Scope The scope of the script to add to. Either Web or Site, defaults to Web. 'All' is not valid for this command. CustomActionScope CustomActionScope Script The javascript block to add to the specified scope String String Sequence A sequence number that defines the order on the page Int32 Int32 Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Add-PnPJavaScriptBlock -Name myAction -script '<script>Alert("This is my Script block");</script>' -Sequence 9999 -Scope Site Add a JavaScript code block to all pages within the current site collection under the name myAction and at order 9999 ------------------EXAMPLE 2--------------------- PS:> Add-PnPJavaScriptBlock -Name myAction -script '<script>Alert("This is my Script block");</script>' Add a JavaScript code block to all pages within the current web under the name myAction SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Add-PnPJavaScriptLink Adds a link to a JavaScript file to a web or sitecollection Add PnPJavaScriptLink Creates a custom action that refers to a JavaScript file Add-PnPJavaScriptLink Name Name under which to register the JavaScriptLink String Url URL to the JavaScript file to inject String[] Sequence Sequence of this JavaScript being injected. Use when you have a specific sequence with which to have JavaScript files being added to the page. I.e. jQuery library first and then jQueryUI. Int32 Scope Defines if this JavaScript file will be injected to every page within the current site collection or web. All is not allowed in for this command. Default is web. CustomActionScope Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Name Name under which to register the JavaScriptLink String String Scope Defines if this JavaScript file will be injected to every page within the current site collection or web. All is not allowed in for this command. Default is web. CustomActionScope CustomActionScope Sequence Sequence of this JavaScript being injected. Use when you have a specific sequence with which to have JavaScript files being added to the page. I.e. jQuery library first and then jQueryUI. Int32 Int32 Url URL to the JavaScript file to inject String[] String[] Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Add-PnPJavaScriptLink -Name jQuery -Url https://code.jquery.com/jquery.min.js -Sequence 9999 -Scope Site Injects a reference to the latest v1 series jQuery library to all pages within the current site collection under the name jQuery and at order 9999 ------------------EXAMPLE 2--------------------- PS:> Add-PnPJavaScriptLink -Name jQuery -Url https://code.jquery.com/jquery.min.js Injects a reference to the latest v1 series jQuery library to all pages within the current web under the name jQuery SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Add-PnPListFoldersToProvisioningTemplate Adds folders to a list in a PnP Provisioning Template Add PnPListFoldersToProvisioningTemplate Add-PnPListFoldersToProvisioningTemplate Path Filename of the .PNP Open XML provisioning template to read from, optionally including full path. String List The list to query ListPipeBind Recursive A switch parameter to include all folders in the list, or just top level folders. SwitchParameter IncludeSecurity A switch to include ObjectSecurity information. SwitchParameter TemplateProviderExtensions Allows you to specify ITemplateProviderExtension to execute while loading the template. ITemplateProviderExtension[] Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection IncludeSecurity A switch to include ObjectSecurity information. SwitchParameter SwitchParameter List The list to query ListPipeBind ListPipeBind Path Filename of the .PNP Open XML provisioning template to read from, optionally including full path. String String Recursive A switch parameter to include all folders in the list, or just top level folders. SwitchParameter SwitchParameter TemplateProviderExtensions Allows you to specify ITemplateProviderExtension to execute while loading the template. ITemplateProviderExtension[] ITemplateProviderExtension[] Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Add-PnPListFoldersToProvisioningTemplate -Path template.pnp -List 'PnPTestList' Adds top level folders from a list to an existing template and returns an in-memory PnP Provisioning Template ------------------EXAMPLE 2--------------------- PS:> Add-PnPListFoldersToProvisioningTemplate -Path template.pnp -List 'PnPTestList' -Recursive Adds all folders from a list to an existing template and returns an in-memory PnP Provisioning Template ------------------EXAMPLE 3--------------------- PS:> Add-PnPListFoldersToProvisioningTemplate -Path template.pnp -List 'PnPTestList' -Recursive -IncludeSecurity Adds all folders from a list with unique permissions to an in-memory PnP Provisioning Template SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Add-PnPListItem Adds an item to a list Add PnPListItem Add-PnPListItem List The ID, Title or Url of the list. ListPipeBind ContentType Specify either the name, ID or an actual content type. ContentTypePipeBind Values Use the internal names of the fields when specifying field names. Single line of text: -Values @{"Title" = "Title New"} Multiple lines of text: -Values @{"MultiText" = "New text\n\nMore text"} Rich text: -Values @{"MultiText" = "<strong>New</strong> text"} Choice: -Values @{"Choice" = "Value 1"} Number: -Values @{"Number" = "10"} Currency: -Values @{"Number" = "10"} Currency: -Values @{"Currency" = "10"} Date and Time: -Values @{"DateAndTime" = "03/10/2015 14:16"} Lookup (id of lookup value): -Values @{"Lookup" = "2"} Multi value lookup (id of lookup values as array 1): -Values @{"MultiLookupField" = "1","2"} Multi value lookup (id of lookup values as array 2): -Values @{"MultiLookupField" = 1,2} Multi value lookup (id of lookup values as string): -Values @{"MultiLookupField" = "1,2"} Yes/No: -Values @{"YesNo" = $false} Person/Group (id of user/group in Site User Info List or email of the user, seperate multiple values with a comma): -Values @{"Person" = "user1@domain.com","21"} Managed Metadata (single value with path to term): -Values @{"MetadataField" = "CORPORATE|DEPARTMENTS|FINANCE"} Managed Metadata (single value with id of term): -Values @{"MetadataField" = "fe40a95b-2144-4fa2-b82a-0b3d0299d818"} with Id of term Managed Metadata (multiple values with paths to terms): -Values @{"MetadataField" = "CORPORATE|DEPARTMENTS|FINANCE","CORPORATE|DEPARTMENTS|HR"} Managed Metadata (multiple values with ids of terms): -Values @{"MetadataField" = "fe40a95b-2144-4fa2-b82a-0b3d0299d818","52d88107-c2a8-4bf0-adfa-04bc2305b593"} Hyperlink or Picture: -Values @{"Hyperlink" = "https://github.com/OfficeDev/, OfficePnp"} Hashtable Folder The list relative URL of a folder. E.g. "MyFolder" for a folder located in the root of the list, or "MyFolder/SubFolder" for a folder located in the MyFolder folder which is located in the root of the list. String Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection ContentType Specify either the name, ID or an actual content type. ContentTypePipeBind ContentTypePipeBind Folder The list relative URL of a folder. E.g. "MyFolder" for a folder located in the root of the list, or "MyFolder/SubFolder" for a folder located in the MyFolder folder which is located in the root of the list. String String List The ID, Title or Url of the list. ListPipeBind ListPipeBind Values Use the internal names of the fields when specifying field names. Single line of text: -Values @{"Title" = "Title New"} Multiple lines of text: -Values @{"MultiText" = "New text\n\nMore text"} Rich text: -Values @{"MultiText" = "<strong>New</strong> text"} Choice: -Values @{"Choice" = "Value 1"} Number: -Values @{"Number" = "10"} Currency: -Values @{"Number" = "10"} Currency: -Values @{"Currency" = "10"} Date and Time: -Values @{"DateAndTime" = "03/10/2015 14:16"} Lookup (id of lookup value): -Values @{"Lookup" = "2"} Multi value lookup (id of lookup values as array 1): -Values @{"MultiLookupField" = "1","2"} Multi value lookup (id of lookup values as array 2): -Values @{"MultiLookupField" = 1,2} Multi value lookup (id of lookup values as string): -Values @{"MultiLookupField" = "1,2"} Yes/No: -Values @{"YesNo" = $false} Person/Group (id of user/group in Site User Info List or email of the user, seperate multiple values with a comma): -Values @{"Person" = "user1@domain.com","21"} Managed Metadata (single value with path to term): -Values @{"MetadataField" = "CORPORATE|DEPARTMENTS|FINANCE"} Managed Metadata (single value with id of term): -Values @{"MetadataField" = "fe40a95b-2144-4fa2-b82a-0b3d0299d818"} with Id of term Managed Metadata (multiple values with paths to terms): -Values @{"MetadataField" = "CORPORATE|DEPARTMENTS|FINANCE","CORPORATE|DEPARTMENTS|HR"} Managed Metadata (multiple values with ids of terms): -Values @{"MetadataField" = "fe40a95b-2144-4fa2-b82a-0b3d0299d818","52d88107-c2a8-4bf0-adfa-04bc2305b593"} Hyperlink or Picture: -Values @{"Hyperlink" = "https://github.com/OfficeDev/, OfficePnp"} Hashtable Hashtable Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind Microsoft.SharePoint.Client.ListItem ------------------EXAMPLE 1--------------------- Add-PnPListItem -List "Demo List" -Values @{"Title" = "Test Title"; "Category"="Test Category"} Adds a new list item to the "Demo List", and sets both the Title and Category fields with the specified values. Notice, use the internal names of fields. ------------------EXAMPLE 2--------------------- Add-PnPListItem -List "Demo List" -ContentType "Company" -Values @{"Title" = "Test Title"; "Category"="Test Category"} Adds a new list item to the "Demo List", sets the content type to "Company" and sets both the Title and Category fields with the specified values. Notice, use the internal names of fields. ------------------EXAMPLE 3--------------------- Add-PnPListItem -List "Demo List" -Values @{"MultiUserField"="user1@domain.com","user2@domain.com"} Adds a new list item to the "Demo List" and sets the user field called MultiUserField to 2 users. Separate multiple users with a comma. ------------------EXAMPLE 4--------------------- Add-PnPListItem -List "Demo List" -Values @{"Title"="Sales Report"} -Folder "projects/europe" Adds a new list item to the "Demo List". It will add the list item to the europe folder which is located in the projects folder. Folders will be created if needed. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Add-PnPMasterPage Adds a Masterpage Add PnPMasterPage Add-PnPMasterPage SourceFilePath Path to the file which will be uploaded String Title Title for the Masterpage String Description Description for the Masterpage String DestinationFolderHierarchy Folder hierarchy where the MasterPage will be deployed String UIVersion UIVersion of the Masterpage. Default = 15 String DefaultCssFile Default CSS file for the MasterPage, this Url is SiteRelative String Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection DefaultCssFile Default CSS file for the MasterPage, this Url is SiteRelative String String Description Description for the Masterpage String String DestinationFolderHierarchy Folder hierarchy where the MasterPage will be deployed String String SourceFilePath Path to the file which will be uploaded String String Title Title for the Masterpage String String UIVersion UIVersion of the Masterpage. Default = 15 String String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind Microsoft.SharePoint.Client.File ------------------EXAMPLE 1--------------------- PS:> Add-PnPMasterPage -SourceFilePath "page.master" -Title "MasterPage" -Description "MasterPage for Web" -DestinationFolderHierarchy "SubFolder" Adds a MasterPage from the local file "page.master" to the folder "SubFolder" in the Masterpage gallery. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Add-PnPNavigationNode Adds an item to a navigation element Add PnPNavigationNode Adds a menu item to either the quicklaunch or top navigation Add-PnPNavigationNode Location The location of the node to add. Either TopNavigationBar, QuickLaunch, SearchNav NavigationType Title The title of the node to add String Url The url to navigate to when clicking the new menu item. This can either be absolute or relative to the Web. Fragments are not supported. String Header Optionally value of a header entry to add the menu item to. String First Add the new menu item to beginning of the collection. SwitchParameter External Indicates the destination URL is outside of the site collection. SwitchParameter Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection External Indicates the destination URL is outside of the site collection. SwitchParameter SwitchParameter First Add the new menu item to beginning of the collection. SwitchParameter SwitchParameter Header Optionally value of a header entry to add the menu item to. String String Location The location of the node to add. Either TopNavigationBar, QuickLaunch, SearchNav NavigationType NavigationType Title The title of the node to add String String Url The url to navigate to when clicking the new menu item. This can either be absolute or relative to the Web. Fragments are not supported. String String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind Microsoft.SharePoint.Client.NavigationNode ------------------EXAMPLE 1--------------------- PS:> Add-PnPNavigationNode -Title "Contoso" -Url "http://contoso.sharepoint.com/sites/contoso/" -Location "QuickLaunch" Adds a navigation node to the quicklaunch. The navigation node will have the title "Contoso" and will link to the url "http://contoso.sharepoint.com/sites/contoso/" ------------------EXAMPLE 2--------------------- PS:> Add-PnPNavigationNode -Title "Contoso USA" -Url "http://contoso.sharepoint.com/sites/contoso/usa/" -Location "QuickLaunch" -Header "Contoso" Adds a navigation node to the quicklaunch. The navigation node will have the title "Contoso USA", will link to the url "http://contoso.sharepoint.com/sites/contoso/usa/" and will have "Contoso" as a parent navigation node. ------------------EXAMPLE 3--------------------- PS:> Add-PnPNavigationNode -Title "Contoso" -Url "http://contoso.sharepoint.com/sites/contoso/" -Location "QuickLaunch" -First Adds a navigation node to the quicklaunch, as the first item. The navigation node will have the title "Contoso" and will link to the url "http://contoso.sharepoint.com/sites/contoso/" ------------------EXAMPLE 4--------------------- PS:> Add-PnPNavigationNode -Title "Contoso Pharmaceuticals" -Url "http://contoso.sharepoint.com/sites/contosopharma/" -Location "QuickLaunch" -External Adds a navigation node to the quicklaunch. The navigation node will have the title "Contoso Pharmaceuticals" and will link to the external url "http://contoso.sharepoint.com/sites/contosopharma/" ------------------EXAMPLE 5--------------------- PS:> Add-PnPNavigationNode -Title "Wiki" -Location "QuickLaunch" -Url "wiki/" Adds a navigation node to the quicklaunch. The navigation node will have the title "Wiki" and will link to Wiki library on the selected Web. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Test-PnPOffice365GroupAliasIsUsed * Supported in: SharePoint Online. Tests if a given alias is already used used Test PnPOffice365GroupAliasIsUsed This command allows you to test if a provided alias is used or free, helps decide if it can be used as part of connecting an Office 365 Unified group to an existing classic site collection. Test-PnPOffice365GroupAliasIsUsed Alias Specifies the alias of the group. Cannot contain spaces. String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Alias Specifies the alias of the group. Cannot contain spaces. String String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection ------------------EXAMPLE 1--------------------- PS:> Test-PnPOffice365GroupAliasIsUsed -Alias "MyGroup" This will test if the alias MyGroup is already used SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Add-PnPOffice365GroupToSite * Supported in: SharePoint Online. Groupifies a classic team site by creating an Office 365 group for it and connecting the site with the newly created group Add PnPOffice365GroupToSite This command allows you to add an Office 365 Unified group to an existing classic site collection. Add-PnPOffice365GroupToSite Url Url of the site to be connected to an Office 365 Group. String Alias Specifies the alias of the group. Cannot contain spaces. String DisplayName The display name of the group. String Description The optional description of the group. String Classification Specifies the classification of the group. String IsPublic Specifies if the group is public. Defaults to false. SwitchParameter KeepOldHomePage Specifies if the current site home page is kept. Defaults to false. SwitchParameter Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Alias Specifies the alias of the group. Cannot contain spaces. String String Classification Specifies the classification of the group. String String Description The optional description of the group. String String DisplayName The display name of the group. String String IsPublic Specifies if the group is public. Defaults to false. SwitchParameter SwitchParameter KeepOldHomePage Specifies if the current site home page is kept. Defaults to false. SwitchParameter SwitchParameter Url Url of the site to be connected to an Office 365 Group. String String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection ------------------EXAMPLE 1--------------------- PS:> Add-PnPOffice365GroupToSite -Url "https://contoso.sharepoint.com/sites/FinanceTeamsite" -Alias "FinanceTeamsite" -DisplayName = "My finance team site group" This will add a group called MyGroup to the current site collection SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Add-PnPPublishingImageRendition Adds an Image Rendition if the Name of the Image Rendition does not already exist. This prevents creating two Image Renditions that share the same name. Add PnPPublishingImageRendition Add-PnPPublishingImageRendition Name The display name of the Image Rendition. String Width The width of the Image Rendition. Int32 Height The height of the Image Rendition. Int32 Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Height The height of the Image Rendition. Int32 Int32 Name The display name of the Image Rendition. String String Width The width of the Image Rendition. Int32 Int32 Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Add-PnPPublishingImageRendition -Name "MyImageRendition" -Width 800 -Height 600 SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Add-PnPPublishingPage Adds a publishing page Add PnPPublishingPage Add-PnPPublishingPage PageName The name of the page to be added as an aspx file String PageTemplateName The name of the page layout you want to use. Specify without the .aspx extension. So 'ArticleLeft' or 'BlankWebPartPage' String Title The title of the page String FolderPath The site relative folder path of the page to be added String Publish Publishes the page. Also Approves it if moderation is enabled on the Pages library. SwitchParameter Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection FolderPath The site relative folder path of the page to be added String String PageName The name of the page to be added as an aspx file String String PageTemplateName The name of the page layout you want to use. Specify without the .aspx extension. So 'ArticleLeft' or 'BlankWebPartPage' String String Publish Publishes the page. Also Approves it if moderation is enabled on the Pages library. SwitchParameter SwitchParameter Title The title of the page String String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Add-PnPPublishingPage -PageName 'OurNewPage' -Title 'Our new page' -PageTemplateName 'ArticleLeft' Creates a new page based on the pagelayout 'ArticleLeft' ------------------EXAMPLE 2--------------------- PS:> Add-PnPPublishingPage -PageName 'OurNewPage' -Title 'Our new page' -PageTemplateName 'ArticleLeft' -Folder '/Pages/folder' Creates a new page based on the pagelayout 'ArticleLeft' with a site relative folder path SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Add-PnPPublishingPageLayout Adds a publishing page layout Add PnPPublishingPageLayout Add-PnPPublishingPageLayout SourceFilePath Path to the file which will be uploaded String Title Title for the page layout String Description Description for the page layout String AssociatedContentTypeID Associated content type ID String DestinationFolderHierarchy Folder hierarchy where the html page layouts will be deployed String Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection AssociatedContentTypeID Associated content type ID String String Description Description for the page layout String String DestinationFolderHierarchy Folder hierarchy where the html page layouts will be deployed String String SourceFilePath Path to the file which will be uploaded String String Title Title for the page layout String String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Add-PnPPublishingPageLayout -Title 'Our custom page layout' -SourceFilePath 'customlayout.aspx' -Description 'A custom page layout' -AssociatedContentTypeID 0x01010901 Uploads the pagelayout 'customlayout.aspx' to the current site as a 'web part page' pagelayout SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Add-PnPRoleDefinition Adds a Role Defintion (Permission Level) to the site collection in the current context Add PnPRoleDefinition This command allows adding a custom Role Defintion (Permission Level) to the site collection in the current context. It does not replace or remove existing Role Definitions. Add-PnPRoleDefinition RoleName Name of new permission level. String Clone An existing permission level or the name of an permission level to clone as base template. RoleDefinitionPipeBind Include Specifies permission flags(s) to enable. PermissionKind[] Exclude Specifies permission flags(s) to disable. PermissionKind[] Description Optional description for the new permission level. String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Clone An existing permission level or the name of an permission level to clone as base template. RoleDefinitionPipeBind RoleDefinitionPipeBind Description Optional description for the new permission level. String String Exclude Specifies permission flags(s) to disable. PermissionKind[] PermissionKind[] Include Specifies permission flags(s) to enable. PermissionKind[] PermissionKind[] RoleName Name of new permission level. String String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection ------------------EXAMPLE 1--------------------- PS:> Add-PnPRoleDefinition -RoleName "CustomPerm" Creates additional permission level with no permission flags enabled. ------------------EXAMPLE 2--------------------- PS:> Add-PnPRoleDefinition -RoleName "NoDelete" -Clone "Contribute" -Exclude DeleteListItems Creates additional permission level by cloning "Contribute" and removes flags DeleteListItems ------------------EXAMPLE 3--------------------- PS:> Add-PnPRoleDefinition -RoleName "AddOnly" -Clone "Contribute" -Exclude DeleteListItems, EditListItems Creates additional permission level by cloning "Contribute" and removes flags DeleteListItems and EditListItems ------------------EXAMPLE 4--------------------- PS> $roleDefinition = Get-PnPRoleDefinition -Identity "Contribute" PS:> Add-PnPRoleDefinition -RoleName "AddOnly" -Clone $roleDefinition -Exclude DeleteListItems, EditListItems Creates additional permission level by cloning "Contribute" and removes flags DeleteListItems and EditListItems SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Add-PnPSiteClassification * Supported in: SharePoint Online. Adds one ore more site classification values to the list of possible values. Requires a connection to the Microsoft Graph. Add PnPSiteClassification Add-PnPSiteClassification Classifications String Classifications String String ------------------EXAMPLE 1--------------------- PS:> Connect-PnPOnline -Scopes "Directory.ReadWrite.All" PS:> Add-PnPSiteClassification -Classifications "Top Secret" Adds the "Top Secret" classification to the already existing classification values. ------------------EXAMPLE 2--------------------- PS:> Connect-PnPOnline -Scopes "Directory.ReadWrite.All" PS:> Add-PnPSiteClassification -Classifications "Top Secret","HBI" Adds the "Top Secret" and the "For Your Eyes Only" classification to the already existing classification values. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Add-PnPSiteCollectionAdmin Adds one or more users as site collection administrators to the site collection in the current context Add PnPSiteCollectionAdmin This command allows adding one to many users as site collection administrators to the site collection in the current context. It does not replace or remove exisitng site collection administrators. Add-PnPSiteCollectionAdmin Owners Specifies owner(s) to add as site collection adminstrators. They will be added as additional site collection administrators to the site in the current context. Existing administrators will stay. Can be both users and groups. UserPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Owners Specifies owner(s) to add as site collection adminstrators. They will be added as additional site collection administrators to the site in the current context. Existing administrators will stay. Can be both users and groups. UserPipeBind UserPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection ------------------EXAMPLE 1--------------------- PS:> Add-PnPSiteCollectionAdmin -Owners "user@contoso.onmicrosoft.com" This will add user@contoso.onmicrosoft.com as an additional site collection owner to the site collection in the current context ------------------EXAMPLE 2--------------------- PS:> Add-PnPSiteCollectionAdmin -Owners @("user1@contoso.onmicrosoft.com", "user2@contoso.onmicrosoft.com") This will add user1@contoso.onmicrosoft.com and user2@contoso.onmicrosoft.com as additional site collection owners to the site collection in the current context ------------------EXAMPLE 3--------------------- PS:> Get-PnPUser | ? Title -Like "*Doe" | Add-PnPSiteCollectionAdmin This will add all users with their title ending with "Doe" as additional site collection owners to the site collection in the current context SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Add-PnPSiteCollectionAppCatalog * Supported in: SharePoint Online. Adds a Site Collection scoped App Catalog to a site Add PnPSiteCollectionAppCatalog Add-PnPSiteCollectionAppCatalog Site Url of the site to add the app catalog to. SitePipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Site Url of the site to add the app catalog to. SitePipeBind SitePipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection ------------------EXAMPLE 1--------------------- PS:> Add-PnPOffice365GroupToSite -Site "https://contoso.sharepoint.com/sites/FinanceTeamsite" This will add a SiteCollection app catalog to the specified site SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Add-PnPSiteDesign * Supported in: SharePoint Online. Creates a new Site Design on the current tenant. Add PnPSiteDesign Add-PnPSiteDesign Title The title of the site design String SiteScriptIds An array of guids of site scripts GuidPipeBind[] WebTemplate Specifies the type of site to which this design applies SiteWebTemplate Description The description of the site design String IsDefault Specifies if the site design is a default site design SwitchParameter PreviewImageAltText Sets the text for the preview image String PreviewImageUrl Sets the url to the preview image String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Description The description of the site design String String IsDefault Specifies if the site design is a default site design SwitchParameter SwitchParameter PreviewImageAltText Sets the text for the preview image String String PreviewImageUrl Sets the url to the preview image String String SiteScriptIds An array of guids of site scripts GuidPipeBind[] GuidPipeBind[] Title The title of the site design String String WebTemplate Specifies the type of site to which this design applies SiteWebTemplate SiteWebTemplate Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection ------------------EXAMPLE 1--------------------- PS:> Add-PnPSiteDesign -Title "My Company Design" -SiteScriptIds "e84dcb46-3ab9-4456-a136-66fc6ae3d3c5","6def687f-0e08-4f1e-999c-791f3af9a600" -Description "My description" -WebTemplate TeamSite Adds a new Site Design, with the specified title and description. When applied it will run the scripts as referenced by the IDs. Use Get-PnPSiteScript to receive Site Scripts. The WebTemplate parameter specifies that this design applies to Team Sites. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Add-PnPSiteScript * Supported in: SharePoint Online. Creates a new Site Script on the current tenant. Add PnPSiteScript Add-PnPSiteScript Title The title of the site script String Content A JSON string containing the site script String Description The description of the site script String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Content A JSON string containing the site script String String Description The description of the site script String String Title The title of the site script String String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection ------------------EXAMPLE 1--------------------- PS:> Add-PnPSiteScript -Title "My Site Script" -Description "A more detailed description" -Content $script Adds a new Site Script, where $script variable contains the script. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Add-PnPStoredCredential Adds a credential to the Windows Credential Manager Add PnPStoredCredential Adds an entry to the Windows Credential Manager. If you add an entry in the form of the URL of your tenant/server PnP PowerShell will check if that entry is available when you connect using Connect-PnPOnline. If it finds a matching URL it will use the associated credentials. If you add a Credential with a name of "https://yourtenant.sharepoint.com" it will find a match when you connect to "https://yourtenant.sharepoint.com" but also when you connect to "https://yourtenant.sharepoint.com/sites/demo1". Of course you can specify more granular entries, allow you to automatically provide credentials for different URLs. Add-PnPStoredCredential Name The credential to set String Username String Password If not specified you will be prompted to enter your password. If you want to specify this value use ConvertTo-SecureString -String 'YourPassword' -AsPlainText -Force SecureString Name The credential to set String String Password If not specified you will be prompted to enter your password. If you want to specify this value use ConvertTo-SecureString -String 'YourPassword' -AsPlainText -Force SecureString SecureString Username String String ------------------EXAMPLE 1--------------------- PS:> Add-PnPStoredCredential -Name https://tenant.sharepoint.com -Username yourname@tenant.onmicrosoft.com You will be prompted to specify the password and a new entry will be added with the specified values ------------------EXAMPLE 2--------------------- PS:> Add-PnPStoredCredential -Name https://tenant.sharepoint.com -Username yourname@tenant.onmicrosoft.com -Password (ConvertTo-SecureString -String "YourPassword" -AsPlainText -Force) A new entry will be added with the specified values ------------------EXAMPLE 3--------------------- PS:> Add-PnPStoredCredential -Name https://tenant.sharepoint.com -Username yourname@tenant.onmicrosoft.com -Password (ConvertTo-SecureString -String "YourPassword" -AsPlainText -Force) Connect-PnPOnline -Url https://tenant.sharepoint.com/sites/mydemosite A new entry will be added with the specified values, and a subsequent connection to a sitecollection starting with the entry name will be made. Notice that no password prompt will occur. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Add-PnPTaxonomyField Add a taxonomy field Add PnPTaxonomyField Adds a taxonomy/managed metadata field to a list or as a site column. Add-PnPTaxonomyField DisplayName The display name of the field String InternalName The internal name of the field String TaxonomyItemId The ID of the Taxonomy item GuidPipeBind List The list object or name where this field needs to be added ListPipeBind Group The group name to where this field belongs to String Id The ID for the field, must be unique GuidPipeBind AddToDefaultView Switch Parameter if this field must be added to the default view SwitchParameter MultiValue Switch Parameter if this Taxonomy field can hold multiple values SwitchParameter Required Switch Parameter if the field is a required field SwitchParameter FieldOptions Specifies the control settings while adding a field. See https://msdn.microsoft.com/en-us/library/microsoft.sharepoint.client.addfieldoptions.aspx for details AddFieldOptions Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Add-PnPTaxonomyField TermSetPath The path to the term that this needs be be bound String DisplayName The display name of the field String InternalName The internal name of the field String TermPathDelimiter The path delimiter to be used, by default this is '|' String List The list object or name where this field needs to be added ListPipeBind Group The group name to where this field belongs to String Id The ID for the field, must be unique GuidPipeBind AddToDefaultView Switch Parameter if this field must be added to the default view SwitchParameter MultiValue Switch Parameter if this Taxonomy field can hold multiple values SwitchParameter Required Switch Parameter if the field is a required field SwitchParameter FieldOptions Specifies the control settings while adding a field. See https://msdn.microsoft.com/en-us/library/microsoft.sharepoint.client.addfieldoptions.aspx for details AddFieldOptions Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection AddToDefaultView Switch Parameter if this field must be added to the default view SwitchParameter SwitchParameter DisplayName The display name of the field String String FieldOptions Specifies the control settings while adding a field. See https://msdn.microsoft.com/en-us/library/microsoft.sharepoint.client.addfieldoptions.aspx for details AddFieldOptions AddFieldOptions Group The group name to where this field belongs to String String Id The ID for the field, must be unique GuidPipeBind GuidPipeBind InternalName The internal name of the field String String List The list object or name where this field needs to be added ListPipeBind ListPipeBind MultiValue Switch Parameter if this Taxonomy field can hold multiple values SwitchParameter SwitchParameter Required Switch Parameter if the field is a required field SwitchParameter SwitchParameter TaxonomyItemId The ID of the Taxonomy item GuidPipeBind GuidPipeBind TermPathDelimiter The path delimiter to be used, by default this is '|' String String TermSetPath The path to the term that this needs be be bound String String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind Microsoft.SharePoint.Client.Field ------------------EXAMPLE 1--------------------- PS:> Add-PnPTaxonomyField -DisplayName "Test" -InternalName "Test" -TermSetPath "TestTermGroup|TestTermSet" Adds a new taxonomy field called "Test" that points to the TestTermSet which is located in the TestTermGroup SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Add-PnPTenantCdnOrigin * Supported in: SharePoint Online. Adds a new origin to the public or private content delivery network (CDN). Add PnPTenantCdnOrigin Add a new origin to the public or private CDN, on either Tenant level or on a single Site level. Effectively, a tenant admin points out to a document library, or a folder in the document library and requests that content in that library should be retrievable by using a CDN. You must be a SharePoint Online global administrator and a site collection administrator to run the cmdlet. Add-PnPTenantCdnOrigin OriginUrl Specifies a path to the doc library to be configured. It can be provided in two ways: relative path, or a mask. Relative-Relative path depends on the OriginScope. If the originScope is Tenant, a path must be a relative path under the tenant root. If the originScope is Site, a path must be a relative path under the given Site. The path must point to the valid Document Library or a folder with a document library. String CdnType Specifies the CDN type. The valid values are: public or private. SPOTenantCdnType Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection CdnType Specifies the CDN type. The valid values are: public or private. SPOTenantCdnType SPOTenantCdnType OriginUrl Specifies a path to the doc library to be configured. It can be provided in two ways: relative path, or a mask. Relative-Relative path depends on the OriginScope. If the originScope is Tenant, a path must be a relative path under the tenant root. If the originScope is Site, a path must be a relative path under the given Site. The path must point to the valid Document Library or a folder with a document library. String String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection ------------------EXAMPLE 1--------------------- PS:> Add-PnPTenantCdnOrigin -Url /sites/site/subfolder -CdnType Public This example configures a public CDN on site level. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Add-PnPTenantTheme * Supported in: SharePoint Online. Adds or updates a theme to the tenant. Add PnPTenantTheme Adds or updates atheme to the tenant. Add-PnPTenantTheme Identity The name of the theme to add or update ThemePipeBind Palette The palette to add. See examples for more information. ThemePalettePipeBind IsInverted If the theme is inverted or not Boolean Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Identity The name of the theme to add or update ThemePipeBind ThemePipeBind IsInverted If the theme is inverted or not Boolean Boolean Palette The palette to add. See examples for more information. ThemePalettePipeBind ThemePalettePipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection ------------------EXAMPLE 1--------------------- PS:> $themepalette = @{ "themePrimary" = "#00ffff"; "themeLighterAlt" = "#f3fcfc"; "themeLighter" = "#daffff"; "themeLight" = "#affefe"; "themeTertiary" = "#76ffff"; "themeSecondary" = "#39ffff"; "themeDarkAlt" = "#00c4c4"; "themeDark" = "#009090"; "themeDarker" = "#005252"; "neutralLighterAlt" = "#f8f8f8"; "neutralLighter" = "#f4f4f4"; "neutralLight" = "#eaeaea"; "neutralQuaternaryAlt" = "#dadada"; "neutralQuaternary" = "#d0d0d0"; "neutralTertiaryAlt" = "#c8c8c8"; "neutralTertiary" = "#a6a6a6"; "neutralSecondaryAlt" = "#767676"; "neutralSecondary" = "#666666"; "neutralPrimary" = "#333"; "neutralPrimaryAlt" = "#3c3c3c"; "neutralDark" = "#212121"; "black" = "#000000"; "white" = "#fff"; "primaryBackground" = "#fff"; "primaryText" = "#333" } PS:>Add-PnPTenantTheme -Identity "MyCompanyTheme" -Palette $themepalette -IsInverted $false This example adds a theme to the current tenant. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Add-PnPUserToGroup Adds a user to a group Add PnPUserToGroup Add-PnPUserToGroup LoginName The login name of the user String Identity The group id, group name or group object to add the user to. GroupPipeBind Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Add-PnPUserToGroup Identity The group id, group name or group object to add the user to. GroupPipeBind EmailAddress The email address of the user String SendEmail SwitchParameter EmailBody String Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection EmailAddress The email address of the user String String EmailBody String String Identity The group id, group name or group object to add the user to. GroupPipeBind GroupPipeBind LoginName The login name of the user String String SendEmail SwitchParameter SwitchParameter Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Add-PnPUserToGroup -LoginName user@company.com -Identity 'Marketing Site Members' Add the specified user to the group "Marketing Site Members" ------------------EXAMPLE 2--------------------- PS:> Add-PnPUserToGroup -LoginName user@company.com -Identity 5 Add the specified user to the group with Id 5 SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Add-PnPView Adds a view to a list Add PnPView Add-PnPView Title The title of the view. String Fields A list of fields to add. String[] List The ID or Url of the list. ListPipeBind Query A valid CAML Query. String ViewType The type of view to add. ViewType RowLimit The row limit for the view. Defaults to 30. UInt32 Personal If specified, a personal view will be created. SwitchParameter SetAsDefault If specified, the view will be set as the default view for the list. SwitchParameter Paged If specified, the view will have paging. SwitchParameter Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Fields A list of fields to add. String[] String[] List The ID or Url of the list. ListPipeBind ListPipeBind Paged If specified, the view will have paging. SwitchParameter SwitchParameter Personal If specified, a personal view will be created. SwitchParameter SwitchParameter Query A valid CAML Query. String String RowLimit The row limit for the view. Defaults to 30. UInt32 UInt32 SetAsDefault If specified, the view will be set as the default view for the list. SwitchParameter SwitchParameter Title The title of the view. String String ViewType The type of view to add. ViewType ViewType Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind Microsoft.SharePoint.Client.View ------------------EXAMPLE 1--------------------- Add-PnPView -List "Demo List" -Title "Demo View" -Fields "Title","Address" Adds a view named "Demo view" to the "Demo List" list. ------------------EXAMPLE 2--------------------- Add-PnPView -List "Demo List" -Title "Demo View" -Fields "Title","Address" -Paged Adds a view named "Demo view" to the "Demo List" list and makes sure there's paging on this view. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Add-PnPWebhookSubscription * Supported in: SharePoint Online. Adds a new Webhook subscription Add PnPWebhookSubscription Add-PnPWebhookSubscription NotificationUrl The URL of the Webhook endpoint that will be notified of the change String List The list object or name where the Webhook subscription will be added to ListPipeBind ExpirationDate The date at which the Webhook subscription will expire. (Default: 6 months from today) DateTime ClientState A client state information that will be passed through notifications String Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection ClientState A client state information that will be passed through notifications String String ExpirationDate The date at which the Webhook subscription will expire. (Default: 6 months from today) DateTime DateTime List The list object or name where the Webhook subscription will be added to ListPipeBind ListPipeBind NotificationUrl The URL of the Webhook endpoint that will be notified of the change String String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind OfficeDevPnP.Core.Entities.WebhookSubscription ------------------EXAMPLE 1--------------------- PS:> Add-PnPWebhookSubscription -List MyList -NotificationUrl https://my-func.azurewebsites.net/webhook Add a Webhook subscription for the specified notification Url on the list MyList ------------------EXAMPLE 2--------------------- PS:> Add-PnPWebhookSubscription -List MyList -NotificationUrl https://my-func.azurewebsites.net/webhook -ExpirationDate "2017-09-01" Add a Webhook subscription for the specified notification Url on the list MyList with an expiration date set on September 1st, 2017 ------------------EXAMPLE 3--------------------- PS:> Add-PnPWebhookSubscription -List MyList -NotificationUrl https://my-func.azurewebsites.net/webhook -ExpirationDate "2017-09-01" -ClientState "Hello State!" Add a Webhook subscription for the specified notification Url on the list MyList with an expiration date set on September 1st, 2017 with a specific client state SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Add-PnPWebPartToWebPartPage Adds a webpart to a web part page in a specified zone Add PnPWebPartToWebPartPage Add-PnPWebPartToWebPartPage Xml A string containing the XML for the webpart. String ServerRelativePageUrl Server Relative Url of the page to add the webpart to. String ZoneId The Zone Id where the webpart must be placed String ZoneIndex The Zone Index where the webpart must be placed Int32 Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Add-PnPWebPartToWebPartPage Path A path to a webpart file on a the file system. String ServerRelativePageUrl Server Relative Url of the page to add the webpart to. String ZoneId The Zone Id where the webpart must be placed String ZoneIndex The Zone Index where the webpart must be placed Int32 Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Path A path to a webpart file on a the file system. String String ServerRelativePageUrl Server Relative Url of the page to add the webpart to. String String Xml A string containing the XML for the webpart. String String ZoneId The Zone Id where the webpart must be placed String String ZoneIndex The Zone Index where the webpart must be placed Int32 Int32 Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Add-PnPWebPartToWebPartPage -ServerRelativePageUrl "/sites/demo/sitepages/home.aspx" -Path "c:\myfiles\listview.webpart" -ZoneId "Header" -ZoneIndex 1 This will add the webpart as defined by the XML in the listview.webpart file to the specified page in the specified zone and with the order index of 1 ------------------EXAMPLE 2--------------------- PS:> Add-PnPWebPartToWebPartPage -ServerRelativePageUrl "/sites/demo/sitepages/home.aspx" -XML $webpart -ZoneId "Header" -ZoneIndex 1 This will add the webpart as defined by the XML in the $webpart variable to the specified page in the specified zone and with the order index of 1 SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Add-PnPWebPartToWikiPage Adds a webpart to a wiki page in a specified table row and column Add PnPWebPartToWikiPage Add-PnPWebPartToWikiPage Xml A string containing the XML for the webpart. String ServerRelativePageUrl Full server relative url of the webpart page, e.g. /sites/demo/sitepages/home.aspx String Row Row number where the webpart must be placed Int32 Column Column number where the webpart must be placed Int32 AddSpace Must there be a extra space between the webpart SwitchParameter Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Add-PnPWebPartToWikiPage Path A path to a webpart file on a the file system. String ServerRelativePageUrl Full server relative url of the webpart page, e.g. /sites/demo/sitepages/home.aspx String Row Row number where the webpart must be placed Int32 Column Column number where the webpart must be placed Int32 AddSpace Must there be a extra space between the webpart SwitchParameter Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection AddSpace Must there be a extra space between the webpart SwitchParameter SwitchParameter Column Column number where the webpart must be placed Int32 Int32 Path A path to a webpart file on a the file system. String String Row Row number where the webpart must be placed Int32 Int32 ServerRelativePageUrl Full server relative url of the webpart page, e.g. /sites/demo/sitepages/home.aspx String String Xml A string containing the XML for the webpart. String String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Add-PnPWebPartToWikiPage -ServerRelativePageUrl "/sites/demo/sitepages/home.aspx" -Path "c:\myfiles\listview.webpart" -Row 1 -Column 1 This will add the webpart as defined by the XML in the listview.webpart file to the specified page in the first row and the first column of the HTML table present on the page ------------------EXAMPLE 2--------------------- PS:> Add-PnPWebPartToWikiPage -ServerRelativePageUrl "/sites/demo/sitepages/home.aspx" -XML $webpart -Row 1 -Column 1 This will add the webpart as defined by the XML in the $webpart variable to the specified page in the first row and the first column of the HTML table present on the page SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Add-PnPWikiPage Adds a wiki page Add PnPWikiPage Add-PnPWikiPage Content String ServerRelativePageUrl The server relative page URL String Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Add-PnPWikiPage Layout WikiPageLayout ServerRelativePageUrl The server relative page URL String Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Content String String Layout WikiPageLayout WikiPageLayout ServerRelativePageUrl The server relative page URL String String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Add-PnPWikiPage -PageUrl '/sites/demo1/pages/wikipage.aspx' -Content 'New WikiPage' Creates a new wiki page '/sites/demo1/pages/wikipage.aspx' and sets the content to 'New WikiPage' SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Add-PnPWorkflowDefinition Adds a workflow definition Add PnPWorkflowDefinition Add-PnPWorkflowDefinition Definition The workflow definition to add. WorkflowDefinition DoNotPublish Overrides the default behaviour, which is to publish workflow definitions. SwitchParameter Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Definition The workflow definition to add. WorkflowDefinition WorkflowDefinition DoNotPublish Overrides the default behaviour, which is to publish workflow definitions. SwitchParameter SwitchParameter Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind System.Guid Returns the Id of the workflow definition ------------------EXAMPLE 1--------------------- PS:> Add-PnPWorkflowDefinition -Definition $wfdef Adds an existing workflow definition, retrieved by Get-PnPWorkflowDefinition, to a site. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Add-PnPWorkflowSubscription Adds a workflow subscription to a list Add PnPWorkflowSubscription Add-PnPWorkflowSubscription Name The name of the subscription String DefinitionName The name of the workflow definition String List The list to add the workflow to ListPipeBind HistoryListName The name of the History list String TaskListName The name of the task list String StartManually Switch if the workflow should be started manually, default value is 'true' SwitchParameter StartOnCreated Should the workflow run when an new item is created SwitchParameter StartOnChanged Should the workflow run when an item is changed SwitchParameter AssociationValues String Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection AssociationValues String String DefinitionName The name of the workflow definition String String HistoryListName The name of the History list String String List The list to add the workflow to ListPipeBind ListPipeBind Name The name of the subscription String String StartManually Switch if the workflow should be started manually, default value is 'true' SwitchParameter SwitchParameter StartOnChanged Should the workflow run when an item is changed SwitchParameter SwitchParameter StartOnCreated Should the workflow run when an new item is created SwitchParameter SwitchParameter TaskListName The name of the task list String String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Add-PnPWorkflowSubscription -Name MyWorkflow -DefinitionName SendMessageWf -list $list Adds an Workflow with the name 'SendMessageWf' to the list $list. ------------------EXAMPLE 2--------------------- PS:> $list | Add-PnPWorkflowSubscription -Name MyWorkflow -DefinitionName SendMessageWf Adds an Workflow with the name "SendMessageWf" to the list $list. ------------------EXAMPLE 3--------------------- PS:> Get-PnPList -Identity "MyCustomList" | Add-PnPWorkflowSubscription -Name MyWorkflow -DefinitionName SendMessageWf Adds an Workflow with the name "SendMessageWf" to the list "MyCustomList". SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Apply-PnPProvisioningTemplate Applies a provisioning template to a web Apply PnPProvisioningTemplate Apply-PnPProvisioningTemplate InputInstance Allows you to provide an in-memory instance of the ProvisioningTemplate type of the PnP Core Component. When using this parameter, the -Path parameter refers to the path of any supporting file for the template. ProvisioningTemplate ResourceFolder Root folder where resources/files that are being referenced in the template are located. If not specified the same folder as where the provisioning template is located will be used. String OverwriteSystemPropertyBagValues Specify this parameter if you want to overwrite and/or create properties that are known to be system entries (starting with vti_, dlc_, etc.) SwitchParameter IgnoreDuplicateDataRowErrors Ignore duplicate data row errors when the data row in the template already exists. SwitchParameter ProvisionContentTypesToSubWebs If set content types will be provisioned if the target web is a subweb. SwitchParameter ProvisionFieldsToSubWebs If set fields will be provisioned if the target web is a subweb. SwitchParameter ClearNavigation Override the RemoveExistingNodes attribute in the Navigation elements of the template. If you specify this value the navigation nodes will always be removed before adding the nodes in the template SwitchParameter Parameters Allows you to specify parameters that can be referred to in the template by means of the {parameter:<Key>} token. See examples on how to use this parameter. Hashtable Handlers Allows you to only process a specific part of the template. Notice that this might fail, as some of the handlers require other artifacts in place if they are not part of what your applying. Handlers ExcludeHandlers Allows you to run all handlers, excluding the ones specified. Handlers ExtensibilityHandlers Allows you to specify ExtensbilityHandlers to execute while applying a template ExtensibilityHandler[] TemplateProviderExtensions Allows you to specify ITemplateProviderExtension to execute while applying a template. ITemplateProviderExtension[] Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Apply-PnPProvisioningTemplate GalleryTemplateId Guid ResourceFolder Root folder where resources/files that are being referenced in the template are located. If not specified the same folder as where the provisioning template is located will be used. String OverwriteSystemPropertyBagValues Specify this parameter if you want to overwrite and/or create properties that are known to be system entries (starting with vti_, dlc_, etc.) SwitchParameter IgnoreDuplicateDataRowErrors Ignore duplicate data row errors when the data row in the template already exists. SwitchParameter ProvisionContentTypesToSubWebs If set content types will be provisioned if the target web is a subweb. SwitchParameter ProvisionFieldsToSubWebs If set fields will be provisioned if the target web is a subweb. SwitchParameter ClearNavigation Override the RemoveExistingNodes attribute in the Navigation elements of the template. If you specify this value the navigation nodes will always be removed before adding the nodes in the template SwitchParameter Parameters Allows you to specify parameters that can be referred to in the template by means of the {parameter:<Key>} token. See examples on how to use this parameter. Hashtable Handlers Allows you to only process a specific part of the template. Notice that this might fail, as some of the handlers require other artifacts in place if they are not part of what your applying. Handlers ExcludeHandlers Allows you to run all handlers, excluding the ones specified. Handlers ExtensibilityHandlers Allows you to specify ExtensbilityHandlers to execute while applying a template ExtensibilityHandler[] TemplateProviderExtensions Allows you to specify ITemplateProviderExtension to execute while applying a template. ITemplateProviderExtension[] Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Apply-PnPProvisioningTemplate Path Path to the xml or pnp file containing the provisioning template. String ResourceFolder Root folder where resources/files that are being referenced in the template are located. If not specified the same folder as where the provisioning template is located will be used. String OverwriteSystemPropertyBagValues Specify this parameter if you want to overwrite and/or create properties that are known to be system entries (starting with vti_, dlc_, etc.) SwitchParameter IgnoreDuplicateDataRowErrors Ignore duplicate data row errors when the data row in the template already exists. SwitchParameter ProvisionContentTypesToSubWebs If set content types will be provisioned if the target web is a subweb. SwitchParameter ProvisionFieldsToSubWebs If set fields will be provisioned if the target web is a subweb. SwitchParameter ClearNavigation Override the RemoveExistingNodes attribute in the Navigation elements of the template. If you specify this value the navigation nodes will always be removed before adding the nodes in the template SwitchParameter Parameters Allows you to specify parameters that can be referred to in the template by means of the {parameter:<Key>} token. See examples on how to use this parameter. Hashtable Handlers Allows you to only process a specific part of the template. Notice that this might fail, as some of the handlers require other artifacts in place if they are not part of what your applying. Handlers ExcludeHandlers Allows you to run all handlers, excluding the ones specified. Handlers ExtensibilityHandlers Allows you to specify ExtensbilityHandlers to execute while applying a template ExtensibilityHandler[] TemplateProviderExtensions Allows you to specify ITemplateProviderExtension to execute while applying a template. ITemplateProviderExtension[] Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection ClearNavigation Override the RemoveExistingNodes attribute in the Navigation elements of the template. If you specify this value the navigation nodes will always be removed before adding the nodes in the template SwitchParameter SwitchParameter ExcludeHandlers Allows you to run all handlers, excluding the ones specified. Handlers Handlers ExtensibilityHandlers Allows you to specify ExtensbilityHandlers to execute while applying a template ExtensibilityHandler[] ExtensibilityHandler[] GalleryTemplateId Guid Guid Handlers Allows you to only process a specific part of the template. Notice that this might fail, as some of the handlers require other artifacts in place if they are not part of what your applying. Handlers Handlers IgnoreDuplicateDataRowErrors Ignore duplicate data row errors when the data row in the template already exists. SwitchParameter SwitchParameter InputInstance Allows you to provide an in-memory instance of the ProvisioningTemplate type of the PnP Core Component. When using this parameter, the -Path parameter refers to the path of any supporting file for the template. ProvisioningTemplate ProvisioningTemplate OverwriteSystemPropertyBagValues Specify this parameter if you want to overwrite and/or create properties that are known to be system entries (starting with vti_, dlc_, etc.) SwitchParameter SwitchParameter Parameters Allows you to specify parameters that can be referred to in the template by means of the {parameter:<Key>} token. See examples on how to use this parameter. Hashtable Hashtable Path Path to the xml or pnp file containing the provisioning template. String String ProvisionContentTypesToSubWebs If set content types will be provisioned if the target web is a subweb. SwitchParameter SwitchParameter ProvisionFieldsToSubWebs If set fields will be provisioned if the target web is a subweb. SwitchParameter SwitchParameter ResourceFolder Root folder where resources/files that are being referenced in the template are located. If not specified the same folder as where the provisioning template is located will be used. String String TemplateProviderExtensions Allows you to specify ITemplateProviderExtension to execute while applying a template. ITemplateProviderExtension[] ITemplateProviderExtension[] Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Apply-PnPProvisioningTemplate -Path template.xml Applies a provisioning template in XML format to the current web. ------------------EXAMPLE 2--------------------- PS:> Apply-PnPProvisioningTemplate -Path template.xml -ResourceFolder c:\provisioning\resources Applies a provisioning template in XML format to the current web. Any resources like files that are referenced in the template will be retrieved from the folder as specified with the ResourceFolder parameter. ------------------EXAMPLE 3--------------------- PS:> Apply-PnPProvisioningTemplate -Path template.xml -Parameters @{"ListTitle"="Projects";"parameter2"="a second value"} Applies a provisioning template in XML format to the current web. It will populate the parameter in the template the values as specified and in the template you can refer to those values with the {parameter:<key>} token. For instance with the example above, specifying {parameter:ListTitle} in your template will translate to 'Projects' when applying the template. These tokens can be used in most string values in a template. ------------------EXAMPLE 4--------------------- PS:> Apply-PnPProvisioningTemplate -Path template.xml -Handlers Lists, SiteSecurity Applies a provisioning template in XML format to the current web. It will only apply the lists and site security part of the template. ------------------EXAMPLE 5--------------------- PS:> Apply-PnPProvisioningTemplate -Path template.pnp Applies a provisioning template from a pnp package to the current web. ------------------EXAMPLE 6--------------------- PS:> Apply-PnPProvisioningTemplate -Path https://tenant.sharepoint.com/sites/templatestorage/Documents/template.pnp Applies a provisioning template from a pnp package stored in a library to the current web. ------------------EXAMPLE 7--------------------- PS:> $handler1 = New-PnPExtensibilityHandlerObject -Assembly Contoso.Core.Handlers -Type Contoso.Core.Handlers.MyExtensibilityHandler1 PS:> $handler2 = New-PnPExtensibilityHandlerObject -Assembly Contoso.Core.Handlers -Type Contoso.Core.Handlers.MyExtensibilityHandler1 PS:> Apply-PnPProvisioningTemplate -Path NewTemplate.xml -ExtensibilityHandlers $handler1,$handler2 This will create two new ExtensibilityHandler objects that are run while provisioning the template ------------------EXAMPLE 8--------------------- PS:> Apply-PnPProvisioningTemplate -Path .\ -InputInstance $template Applies a provisioning template from an in-memory instance of a ProvisioningTemplate type of the PnP Core Component, reading the supporting files, if any, from the current (.\) path. The syntax can be used together with any other supported parameters. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Set-PnPSitePolicy Sets a site policy Set PnPSitePolicy Set-PnPSitePolicy Name The name of the site policy to apply String Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Name The name of the site policy to apply String String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Set-PnPSitePolicy -Name "Contoso HBI" This applies a site policy with the name "Contoso HBI" to the current site. The policy needs to be available in the site. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Clear-PnPListItemAsRecord * Supported in: SharePoint Online. Undeclares a list item as a record Clear PnPListItemAsRecord Clear-PnPListItemAsRecord Identity The ID of the listitem, or actual ListItem object ListItemPipeBind List The ID, Title or Url of the list. ListPipeBind Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Identity The ID of the listitem, or actual ListItem object ListItemPipeBind ListItemPipeBind List The ID, Title or Url of the list. ListPipeBind ListPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Clear-PnPListItemAsRecord -List "Documents" -Identity 4 Undeclares the document in the documents library with id 4 as a record SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Clear-PnPRecycleBinItem Permanently deletes all or a specific recycle bin item Clear PnPRecycleBinItem Clear-PnPRecycleBinItem All Clears all items SwitchParameter SecondStageOnly If provided, only all the items in the second stage recycle bin will be cleared SwitchParameter Force If provided, no confirmation will be asked to permanently delete the recycle bin item SwitchParameter Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Clear-PnPRecycleBinItem Identity Id of the recycle bin item or the recycle bin item itself to permanently delete RecycleBinItemPipeBind Force If provided, no confirmation will be asked to permanently delete the recycle bin item SwitchParameter Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection All Clears all items SwitchParameter SwitchParameter Force If provided, no confirmation will be asked to permanently delete the recycle bin item SwitchParameter SwitchParameter Identity Id of the recycle bin item or the recycle bin item itself to permanently delete RecycleBinItemPipeBind RecycleBinItemPipeBind SecondStageOnly If provided, only all the items in the second stage recycle bin will be cleared SwitchParameter SwitchParameter Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection ------------------EXAMPLE 1--------------------- PS:> Get-PnPRecycleBinItems | ? FileLeafName -like "*.docx" | Clear-PnpRecycleBinItem Permanently deletes all the items in the first and second stage recycle bins of which the file names have the .docx extension ------------------EXAMPLE 2--------------------- PS:> Clear-PnpRecycleBinItem -Identity 72e4d749-d750-4989-b727-523d6726e442 Permanently deletes the recycle bin item with Id 72e4d749-d750-4989-b727-523d6726e442 from the recycle bin ------------------EXAMPLE 3--------------------- PS:> Clear-PnpRecycleBinItem -Identity $item -Force Permanently deletes the recycle bin item stored under variable $item from the recycle bin without asking for confirmation from the end user first SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Clear-PnPTenantRecycleBinItem Permanently deletes a site collection from the tenant scoped recycle bin Clear PnPTenantRecycleBinItem The Clear-PnPTenantRecycleBinItem cmdlet allows a site collection that has been deleted and still exists in the tenant recycle bin to be permanently deleted from the recycle bin as well. Clear-PnPTenantRecycleBinItem Url Url of the site collection to permanently delete from the tenant recycle bin String Wait If provided, the PowerShell execution will halt until the operation has completed SwitchParameter Force If provided, no confirmation will be asked to permanently delete the site collection from the tenant recycle bin SwitchParameter Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Force If provided, no confirmation will be asked to permanently delete the site collection from the tenant recycle bin SwitchParameter SwitchParameter Url Url of the site collection to permanently delete from the tenant recycle bin String String Wait If provided, the PowerShell execution will halt until the operation has completed SwitchParameter SwitchParameter Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection ------------------EXAMPLE 1--------------------- PS:> Clear-PnPTenantRecycleBinItem -Url https://tenant.sharepoint.com/sites/contoso This will permanently delete site collection with the url 'https://tenant.sharepoint.com/sites/contoso' from the tenant recycle bin ------------------EXAMPLE 2--------------------- PS:> Clear-PnPTenantRecycleBinItem -Url https://tenant.sharepoint.com/sites/contoso -Wait This will permanently delete site collection with the url 'https://tenant.sharepoint.com/sites/contoso' from the tenant recycle bin and will wait with executing further PowerShell commands until the operation has completed SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Connect-PnPOnline Connect to a SharePoint site Connect PnPOnline If no credentials have been specified, and the CurrentCredentials parameter has not been specified, you will be prompted for credentials. Connect-PnPOnline Url The Url of the site collection to connect to. String ReturnConnection Returns the connection for use with the -Connection parameter on cmdlets. SwitchParameter Credentials Credentials of the user to connect with. Either specify a PSCredential object or a string. In case of a string value a lookup will be done to the Windows Credential Manager for the correct credentials. CredentialPipeBind CurrentCredentials If you want to connect with the current user credentials SwitchParameter UseAdfs If you want to connect to your on-premises SharePoint farm using ADFS SwitchParameter MinimalHealthScore Specifies a minimal server healthscore before any requests are executed. Int32 RetryCount Defines how often a retry should be executed if the server healthscore is not sufficient. Default is 10 times. Int32 RetryWait Defines how many seconds to wait before each retry. Default is 1 second. Int32 RequestTimeout The request timeout. Default is 180000 Int32 AuthenticationMode Specify to use for instance use forms based authentication (FBA) ClientAuthenticationMode CreateDrive If you want to create a PSDrive connected to the URL SwitchParameter DriveName Name of the PSDrive to create (default: SPO) String Scopes The array of permission scopes for the Microsoft Graph API. String[] TenantAdminUrl The url to the Tenant Admin site. If not specified, the cmdlets will assume to connect automatically to https://<tenantname>-admin.sharepoint.com where appropriate. String SkipTenantAdminCheck Should we skip the check if this site is the Tenant admin site. Default is false SwitchParameter IgnoreSslErrors Ignores any SSL errors. To be used i.e. when connecting to a SharePoint farm using self signed certificates or using a certificate authority not trusted by this machine. SwitchParameter Connect-PnPOnline AccessToken Connect with an existing Access Token String ReturnConnection Returns the connection for use with the -Connection parameter on cmdlets. SwitchParameter MinimalHealthScore Specifies a minimal server healthscore before any requests are executed. Int32 RetryCount Defines how often a retry should be executed if the server healthscore is not sufficient. Default is 10 times. Int32 RetryWait Defines how many seconds to wait before each retry. Default is 1 second. Int32 RequestTimeout The request timeout. Default is 180000 Int32 CreateDrive If you want to create a PSDrive connected to the URL SwitchParameter DriveName Name of the PSDrive to create (default: SPO) String SkipTenantAdminCheck Should we skip the check if this site is the Tenant admin site. Default is false SwitchParameter Url The Url of the site collection to connect to. String Connect-PnPOnline Graph Log in using the PnP O365 Management Shell application towards the Graph. You will be asked to consent to: * Read and write managed metadata * Have full control of all site collections * Read user profiles * Invite guest users to the organization * Read and write all groups * Read and write directory data * Access the directory as you * Read and write identity providers * Access the directory as you SwitchParameter LaunchBrowser Launch a browser automatically and copy the code to enter to the clipboard SwitchParameter Connect-PnPOnline Scopes The array of permission scopes for the Microsoft Graph API. String[] Connect-PnPOnline UseWebLogin If you want to connect to SharePoint with browser based login SwitchParameter Url The Url of the site collection to connect to. String ReturnConnection Returns the connection for use with the -Connection parameter on cmdlets. SwitchParameter MinimalHealthScore Specifies a minimal server healthscore before any requests are executed. Int32 RetryCount Defines how often a retry should be executed if the server healthscore is not sufficient. Default is 10 times. Int32 RetryWait Defines how many seconds to wait before each retry. Default is 1 second. Int32 RequestTimeout The request timeout. Default is 180000 Int32 CreateDrive If you want to create a PSDrive connected to the URL SwitchParameter DriveName Name of the PSDrive to create (default: SPO) String Scopes The array of permission scopes for the Microsoft Graph API. String[] TenantAdminUrl The url to the Tenant Admin site. If not specified, the cmdlets will assume to connect automatically to https://<tenantname>-admin.sharepoint.com where appropriate. String SkipTenantAdminCheck Should we skip the check if this site is the Tenant admin site. Default is false SwitchParameter IgnoreSslErrors Ignores any SSL errors. To be used i.e. when connecting to a SharePoint farm using self signed certificates or using a certificate authority not trusted by this machine. SwitchParameter Connect-PnPOnline SPOManagementShell Log in using the SharePoint Online Management Shell application SwitchParameter Url The Url of the site collection to connect to. String ReturnConnection Returns the connection for use with the -Connection parameter on cmdlets. SwitchParameter MinimalHealthScore Specifies a minimal server healthscore before any requests are executed. Int32 RetryCount Defines how often a retry should be executed if the server healthscore is not sufficient. Default is 10 times. Int32 RetryWait Defines how many seconds to wait before each retry. Default is 1 second. Int32 RequestTimeout The request timeout. Default is 180000 Int32 CreateDrive If you want to create a PSDrive connected to the URL SwitchParameter DriveName Name of the PSDrive to create (default: SPO) String ClearTokenCache Clears the token cache. SwitchParameter Scopes The array of permission scopes for the Microsoft Graph API. String[] TenantAdminUrl The url to the Tenant Admin site. If not specified, the cmdlets will assume to connect automatically to https://<tenantname>-admin.sharepoint.com where appropriate. String SkipTenantAdminCheck Should we skip the check if this site is the Tenant admin site. Default is false SwitchParameter IgnoreSslErrors Ignores any SSL errors. To be used i.e. when connecting to a SharePoint farm using self signed certificates or using a certificate authority not trusted by this machine. SwitchParameter Connect-PnPOnline PnPO365ManagementShell Log in using the PnP O365 Management Shell application. You will be asked to consent to: * Read and write managed metadata * Have full control of all site collections * Read user profiles * Invite guest users to the organization * Read and write all groups * Read and write directory data * Access the directory as you * Read and write identity providers * Access the directory as you SwitchParameter Url The Url of the site collection to connect to. String ReturnConnection Returns the connection for use with the -Connection parameter on cmdlets. SwitchParameter LaunchBrowser Launch a browser automatically and copy the code to enter to the clipboard SwitchParameter Connect-PnPOnline AppId The Application Client ID to use. String AppSecret The Application Client Secret to use. String Url The Url of the site collection to connect to. String ReturnConnection Returns the connection for use with the -Connection parameter on cmdlets. SwitchParameter MinimalHealthScore Specifies a minimal server healthscore before any requests are executed. Int32 RetryCount Defines how often a retry should be executed if the server healthscore is not sufficient. Default is 10 times. Int32 RetryWait Defines how many seconds to wait before each retry. Default is 1 second. Int32 RequestTimeout The request timeout. Default is 180000 Int32 Realm Authentication realm. If not specified will be resolved from the url specified. String CreateDrive If you want to create a PSDrive connected to the URL SwitchParameter DriveName Name of the PSDrive to create (default: SPO) String Scopes The array of permission scopes for the Microsoft Graph API. String[] TenantAdminUrl The url to the Tenant Admin site. If not specified, the cmdlets will assume to connect automatically to https://<tenantname>-admin.sharepoint.com where appropriate. String SkipTenantAdminCheck Should we skip the check if this site is the Tenant admin site. Default is false SwitchParameter IgnoreSslErrors Ignores any SSL errors. To be used i.e. when connecting to a SharePoint farm using self signed certificates or using a certificate authority not trusted by this machine. SwitchParameter Connect-PnPOnline ClientId The Client ID of the Azure AD Application String RedirectUri The Redirect URI of the Azure AD Application String Url The Url of the site collection to connect to. String ReturnConnection Returns the connection for use with the -Connection parameter on cmdlets. SwitchParameter MinimalHealthScore Specifies a minimal server healthscore before any requests are executed. Int32 RetryCount Defines how often a retry should be executed if the server healthscore is not sufficient. Default is 10 times. Int32 RetryWait Defines how many seconds to wait before each retry. Default is 1 second. Int32 RequestTimeout The request timeout. Default is 180000 Int32 CreateDrive If you want to create a PSDrive connected to the URL SwitchParameter DriveName Name of the PSDrive to create (default: SPO) String ClearTokenCache Clears the token cache. SwitchParameter AzureEnvironment The Azure environment to use for authentication, the defaults to 'Production' which is the main Azure environment. AzureEnvironment Scopes The array of permission scopes for the Microsoft Graph API. String[] TenantAdminUrl The url to the Tenant Admin site. If not specified, the cmdlets will assume to connect automatically to https://<tenantname>-admin.sharepoint.com where appropriate. String SkipTenantAdminCheck Should we skip the check if this site is the Tenant admin site. Default is false SwitchParameter IgnoreSslErrors Ignores any SSL errors. To be used i.e. when connecting to a SharePoint farm using self signed certificates or using a certificate authority not trusted by this machine. SwitchParameter Connect-PnPOnline AppId The client id of the app which gives you access to the Microsoft Graph API. String AppSecret The app key of the app which gives you access to the Microsoft Graph API. String AADDomain The AAD where the O365 app is registred. Eg.: contoso.com, or contoso.onmicrosoft.com. String Connect-PnPOnline ClientId The Client ID of the Azure AD Application String Tenant The Azure AD Tenant name,e.g. mycompany.onmicrosoft.com String CertificatePath Path to the certificate (*.pfx) String Url The Url of the site collection to connect to. String ReturnConnection Returns the connection for use with the -Connection parameter on cmdlets. SwitchParameter MinimalHealthScore Specifies a minimal server healthscore before any requests are executed. Int32 RetryCount Defines how often a retry should be executed if the server healthscore is not sufficient. Default is 10 times. Int32 RetryWait Defines how many seconds to wait before each retry. Default is 1 second. Int32 RequestTimeout The request timeout. Default is 180000 Int32 CreateDrive If you want to create a PSDrive connected to the URL SwitchParameter DriveName Name of the PSDrive to create (default: SPO) String CertificatePassword Password to the certificate (*.pfx) SecureString AzureEnvironment The Azure environment to use for authentication, the defaults to 'Production' which is the main Azure environment. AzureEnvironment Scopes The array of permission scopes for the Microsoft Graph API. String[] TenantAdminUrl The url to the Tenant Admin site. If not specified, the cmdlets will assume to connect automatically to https://<tenantname>-admin.sharepoint.com where appropriate. String SkipTenantAdminCheck Should we skip the check if this site is the Tenant admin site. Default is false SwitchParameter IgnoreSslErrors Ignores any SSL errors. To be used i.e. when connecting to a SharePoint farm using self signed certificates or using a certificate authority not trusted by this machine. SwitchParameter Connect-PnPOnline ClientId The Client ID of the Azure AD Application String Tenant The Azure AD Tenant name,e.g. mycompany.onmicrosoft.com String PEMCertificate PEM encoded certificate String PEMPrivateKey PEM encoded private key for the certificate String Url The Url of the site collection to connect to. String ReturnConnection Returns the connection for use with the -Connection parameter on cmdlets. SwitchParameter MinimalHealthScore Specifies a minimal server healthscore before any requests are executed. Int32 RetryCount Defines how often a retry should be executed if the server healthscore is not sufficient. Default is 10 times. Int32 RetryWait Defines how many seconds to wait before each retry. Default is 1 second. Int32 RequestTimeout The request timeout. Default is 180000 Int32 CreateDrive If you want to create a PSDrive connected to the URL SwitchParameter DriveName Name of the PSDrive to create (default: SPO) String CertificatePassword Password to the certificate (*.pfx) SecureString AzureEnvironment The Azure environment to use for authentication, the defaults to 'Production' which is the main Azure environment. AzureEnvironment TenantAdminUrl The url to the Tenant Admin site. If not specified, the cmdlets will assume to connect automatically to https://<tenantname>-admin.sharepoint.com where appropriate. String SkipTenantAdminCheck Should we skip the check if this site is the Tenant admin site. Default is false SwitchParameter IgnoreSslErrors Ignores any SSL errors. To be used i.e. when connecting to a SharePoint farm using self signed certificates or using a certificate authority not trusted by this machine. SwitchParameter AADDomain The AAD where the O365 app is registred. Eg.: contoso.com, or contoso.onmicrosoft.com. String String AccessToken Connect with an existing Access Token String String AppId The Application Client ID to use. String String AppSecret The Application Client Secret to use. String String AuthenticationMode Specify to use for instance use forms based authentication (FBA) ClientAuthenticationMode ClientAuthenticationMode AzureEnvironment The Azure environment to use for authentication, the defaults to 'Production' which is the main Azure environment. AzureEnvironment AzureEnvironment CertificatePassword Password to the certificate (*.pfx) SecureString SecureString CertificatePath Path to the certificate (*.pfx) String String ClearTokenCache Clears the token cache. SwitchParameter SwitchParameter ClientId The Client ID of the Azure AD Application String String CreateDrive If you want to create a PSDrive connected to the URL SwitchParameter SwitchParameter Credentials Credentials of the user to connect with. Either specify a PSCredential object or a string. In case of a string value a lookup will be done to the Windows Credential Manager for the correct credentials. CredentialPipeBind CredentialPipeBind CurrentCredentials If you want to connect with the current user credentials SwitchParameter SwitchParameter DriveName Name of the PSDrive to create (default: SPO) String String Graph Log in using the PnP O365 Management Shell application towards the Graph. You will be asked to consent to: * Read and write managed metadata * Have full control of all site collections * Read user profiles * Invite guest users to the organization * Read and write all groups * Read and write directory data * Access the directory as you * Read and write identity providers * Access the directory as you SwitchParameter SwitchParameter IgnoreSslErrors Ignores any SSL errors. To be used i.e. when connecting to a SharePoint farm using self signed certificates or using a certificate authority not trusted by this machine. SwitchParameter SwitchParameter LaunchBrowser Launch a browser automatically and copy the code to enter to the clipboard SwitchParameter SwitchParameter MinimalHealthScore Specifies a minimal server healthscore before any requests are executed. Int32 Int32 PEMCertificate PEM encoded certificate String String PEMPrivateKey PEM encoded private key for the certificate String String PnPO365ManagementShell Log in using the PnP O365 Management Shell application. You will be asked to consent to: * Read and write managed metadata * Have full control of all site collections * Read user profiles * Invite guest users to the organization * Read and write all groups * Read and write directory data * Access the directory as you * Read and write identity providers * Access the directory as you SwitchParameter SwitchParameter Realm Authentication realm. If not specified will be resolved from the url specified. String String RedirectUri The Redirect URI of the Azure AD Application String String RequestTimeout The request timeout. Default is 180000 Int32 Int32 RetryCount Defines how often a retry should be executed if the server healthscore is not sufficient. Default is 10 times. Int32 Int32 RetryWait Defines how many seconds to wait before each retry. Default is 1 second. Int32 Int32 ReturnConnection Returns the connection for use with the -Connection parameter on cmdlets. SwitchParameter SwitchParameter Scopes The array of permission scopes for the Microsoft Graph API. String[] String[] SkipTenantAdminCheck Should we skip the check if this site is the Tenant admin site. Default is false SwitchParameter SwitchParameter SPOManagementShell Log in using the SharePoint Online Management Shell application SwitchParameter SwitchParameter Tenant The Azure AD Tenant name,e.g. mycompany.onmicrosoft.com String String TenantAdminUrl The url to the Tenant Admin site. If not specified, the cmdlets will assume to connect automatically to https://<tenantname>-admin.sharepoint.com where appropriate. String String Url The Url of the site collection to connect to. String String UseAdfs If you want to connect to your on-premises SharePoint farm using ADFS SwitchParameter SwitchParameter UseWebLogin If you want to connect to SharePoint with browser based login SwitchParameter SwitchParameter ------------------EXAMPLE 1--------------------- PS:> Connect-PnPOnline -Url https://contoso.sharepoint.com This will prompt for username and password and creates a context for the other PowerShell commands to use. When a generic credential is added to the Windows Credential Manager with https://contoso.sharepoint.com, PowerShell will not prompt for username and password. ------------------EXAMPLE 2--------------------- PS:> Connect-PnPOnline -Url https://contoso.sharepoint.com -Credentials (Get-Credential) This will prompt for username and password and creates a context for the other PowerShell commands to use. ------------------EXAMPLE 3--------------------- PS:> Connect-PnPOnline -Url http://yourlocalserver -CurrentCredentials This will use the current user credentials and connects to the server specified by the Url parameter. ------------------EXAMPLE 4--------------------- PS:> Connect-PnPOnline -Url http://yourlocalserver -Credentials 'O365Creds' This will use credentials from the Windows Credential Manager, as defined by the label 'O365Creds'. ------------------EXAMPLE 5--------------------- PS:> Connect-PnPOnline -Url http://yourlocalserver -Credentials (Get-Credential) -UseAdfs This will prompt for username and password and creates a context using ADFS to authenticate. ------------------EXAMPLE 6--------------------- PS:> Connect-PnPOnline -Url https://yourserver -Credentials (Get-Credential) -CreateDrive PS:> cd SPO:\\ PS:> dir This will prompt you for credentials and creates a context for the other PowerShell commands to use. It will also create a SPO:\\ drive you can use to navigate around the site ------------------EXAMPLE 7--------------------- PS:> Connect-PnPOnline -Url https://yourserver -Credentials (Get-Credential) -AuthenticationMode FormsAuthentication This will prompt you for credentials and creates a context for the other PowerShell commands to use. It assumes your server is configured for Forms Based Authentication (FBA) ------------------EXAMPLE 8--------------------- PS:> Connect-PnPOnline -Url https://contoso.sharepoint.de -AppId 344b8aab-389c-4e4a-8fa1-4c1ae2c0a60d -AppSecret a3f3faf33f3awf3a3sfs3f3ss3f4f4a3fawfas3ffsrrffssfd -AzureEnvironment Germany This will authenticate you to the German Azure environment using the German Azure endpoints for authentication ------------------EXAMPLE 9--------------------- PS:> Connect-PnPOnline -Url https://contoso.sharepoint.com -SPOManagementShell This will authenticate you using the SharePoint Online Management Shell application ------------------EXAMPLE 10--------------------- PS:> Connect-PnPOnline -Url https://contoso.sharepoint.com -PnPO365ManagementShell This will authenticate you using the PnP O365 Management Shell Multi-Tenant application. A browser window will have to be opened where you have to enter a code that is shown in your PowerShell window. ------------------EXAMPLE 11--------------------- PS:> Connect-PnPOnline -Url https://contoso.sharepoint.com -PnPO365ManagementShell -LaunchBrowser This will authenticate you using the PnP O365 Management Shell Multi-Tenant application. A browser window will automatically open and the code you need to enter will be automatically copied to your clipboard. ------------------EXAMPLE 12--------------------- PS:> Connect-PnPOnline -Url https://contoso.sharepoint.com -AccessToken $myaccesstoken This will authenticate you using the provided access token ------------------EXAMPLE 13--------------------- PS:> Connect-PnPOnline -Scopes $arrayOfScopes Connects to Azure AD and gets and OAuth 2.0 Access Token to consume the Microsoft Graph API including the declared permission scopes. The available permission scopes are defined at the following URL: https://graph.microsoft.io/en-us/docs/authorization/permission_scopes ------------------EXAMPLE 14--------------------- PS:> Connect-PnPOnline -AppId '<id>' -AppSecret '<secret>' -AADDomain 'contoso.onmicrosoft.com' Connects to the Microsoft Graph API using application permissions via an app's declared permission scopes. See https://github.com/SharePoint/PnP-PowerShell/tree/master/Samples/Graph.ConnectUsingAppPermissions for a sample on how to get started. ------------------EXAMPLE 15--------------------- PS:> Connect-PnPOnline -Url https://contoso.sharepoint.com -ClientId '<id>' -Tenant 'contoso.onmicrosoft.com' -PEMCertificate <PEM string> -PEMPrivateKey <PEM string> Connects to SharePoint using app-only tokens via an app's declared permission scopes. See https://github.com/SharePoint/PnP-PowerShell/tree/master/Samples/SharePoint.ConnectUsingAppPermissions for a sample on how to get started. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Connect-PnPMicrosoftGraph Connect to the Microsoft Graph Connect PnPMicrosoftGraph Uses the Microsoft Authentication Library (Preview) to connect to Azure AD and to get an OAuth 2.0 Access Token to consume the Microsoft Graph API Connect-PnPMicrosoftGraph Scopes The array of permission scopes for the Microsoft Graph API. String[] Connect-PnPMicrosoftGraph AppId The client id of the app which gives you access to the Microsoft Graph API. String AppSecret The app key of the app which gives you access to the Microsoft Graph API. String AADDomain The AAD where the O365 app is registred. Eg.: contoso.com, or contoso.onmicrosoft.com. String AADDomain The AAD where the O365 app is registred. Eg.: contoso.com, or contoso.onmicrosoft.com. String String AppId The client id of the app which gives you access to the Microsoft Graph API. String String AppSecret The app key of the app which gives you access to the Microsoft Graph API. String String Scopes The array of permission scopes for the Microsoft Graph API. String[] String[] ------------------EXAMPLE 1--------------------- PS:> Connect-PnPMicrosoftGraph -Scopes $arrayOfScopes Connects to Azure AD and gets and OAuth 2.0 Access Token to consume the Microsoft Graph API including the declared permission scopes. The available permission scopes are defined at the following URL: https://graph.microsoft.io/en-us/docs/authorization/permission_scopes ------------------EXAMPLE 2--------------------- PS:> Connect-PnPMicrosoftGraph -AppId '<id>' -AppSecret '<secret>' -AADDomain 'contoso.onmicrosoft.com' Connects to the Microsoft Graph API using application permissions via an app's declared permission scopes. See https://github.com/SharePoint/PnP-PowerShell/tree/master/Samples/Graph.ConnectUsingAppPermissions for a sample on how to get started. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Convert-PnPProvisioningTemplate Converts a provisioning template to an other schema version Convert PnPProvisioningTemplate Convert-PnPProvisioningTemplate Path Path to the xml file containing the provisioning template String Out Filename to write to, optionally including full path String Encoding The encoding type of the XML file, Unicode is default Encoding Force Overwrites the output file if it exists SwitchParameter ToSchema The schema of the output to use, defaults to the latest schema XMLPnPSchemaVersion Encoding The encoding type of the XML file, Unicode is default Encoding Encoding Force Overwrites the output file if it exists SwitchParameter SwitchParameter Out Filename to write to, optionally including full path String String Path Path to the xml file containing the provisioning template String String ToSchema The schema of the output to use, defaults to the latest schema XMLPnPSchemaVersion XMLPnPSchemaVersion ------------------EXAMPLE 1--------------------- PS:> Convert-PnPProvisioningTemplate -Path template.xml Converts a provisioning template to the latest schema and outputs the result to current console. ------------------EXAMPLE 2--------------------- PS:> Convert-PnPProvisioningTemplate -Path template.xml -Out newtemplate.xml Converts a provisioning template to the latest schema and outputs the result the newtemplate.xml file. ------------------EXAMPLE 3--------------------- PS:> Convert-PnPProvisioningTemplate -Path template.xml -Out newtemplate.xml -ToSchema V201512 Converts a provisioning template to the latest schema using the 201512 schema and outputs the result the newtemplate.xml file. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Encoding: https://msdn.microsoft.com/en-us/library/system.text.encoding_properties.aspx Convert-PnPFolderToProvisioningTemplate Creates a pnp package file of an existing template xml, and includes all files in the current folder Convert PnPFolderToProvisioningTemplate Convert-PnPFolderToProvisioningTemplate Out Filename to write to, optionally including full path. String Force Overwrites the output file if it exists. SwitchParameter Folder Folder to process. If not specified the current folder will be used. String Folder Folder to process. If not specified the current folder will be used. String String Force Overwrites the output file if it exists. SwitchParameter SwitchParameter Out Filename to write to, optionally including full path. String String ------------------EXAMPLE 1--------------------- PS:> Convert-PnPFolderToProvisioningTemplate -Out template.pnp Creates a pnp package file of an existing template xml, and includes all files in the current folder ------------------EXAMPLE 2--------------------- PS:> Convert-PnPFolderToProvisioningTemplate -Out template.pnp -Folder c:\temp Creates a pnp package file of an existing template xml, and includes all files in the c:\temp folder SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Copy-PnPFile Copies a file or folder to a different location Copy PnPFile Copy-PnPFile SourceUrl Site relative Url specifying the file or folder to copy. String TargetUrl Server relative Url where to copy the file or folder to. String OverwriteIfAlreadyExists If provided, if a file already exists at the TargetUrl, it will be overwritten. If ommitted, the copy operation will be canceled if the file already exists at the TargetUrl location. SwitchParameter Force If provided, no confirmation will be requested and the action will be performed SwitchParameter SkipSourceFolderName If the source is a folder, the source folder name will not be created, only the contents within it. SwitchParameter Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Force If provided, no confirmation will be requested and the action will be performed SwitchParameter SwitchParameter OverwriteIfAlreadyExists If provided, if a file already exists at the TargetUrl, it will be overwritten. If ommitted, the copy operation will be canceled if the file already exists at the TargetUrl location. SwitchParameter SwitchParameter SkipSourceFolderName If the source is a folder, the source folder name will not be created, only the contents within it. SwitchParameter SwitchParameter SourceUrl Site relative Url specifying the file or folder to copy. String String TargetUrl Server relative Url where to copy the file or folder to. String String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:>Copy-PnPFile -SourceUrl Documents/company.docx -TargetUrl /sites/otherproject/Documents/company.docx Copies a file named company.docx located in a document library called Documents in the current site to the site collection otherproject. If a file named company.docx already exists, it won't perform the copy. ------------------EXAMPLE 2--------------------- PS:>Copy-PnPFile -SourceUrl Documents/company.docx -TargetUrl Documents/company2.docx Copies a file named company.docx located in a document library called Documents to a new document named company2.docx in the same library. ------------------EXAMPLE 3--------------------- PS:>Copy-PnPFile -SourceUrl Documents/company.docx -TargetUrl Documents2/company.docx Copies a file named company.docx located in a document library called Documents to a document library called Documents2 in the same site. ------------------EXAMPLE 4--------------------- PS:>Copy-PnPFile -SourceUrl Documents/company.docx -TargetUrl Subsite/Documents/company2.docx Copies a file named company.docx located in a document library called Documents to the document library named Document in a subsite named Subsite as a new document named company2.docx. ------------------EXAMPLE 5--------------------- PS:>Copy-PnPFile -SourceUrl Documents/company.docx -TargetUrl Subsite/Documents Copies a file named company.docx located in a document library called Documents to the document library named Document in a subsite named Subsite keeping the file name. ------------------EXAMPLE 6--------------------- PS:>Copy-PnPFile -SourceUrl Documents/company.docx -TargetUrl /sites/otherproject/Documents/company.docx -OverwriteIfAlreadyExists Copies a file named company.docx located in a document library called Documents in the current site to the site collection otherproject. If a file named company.docx already exists, it will still perform the copy and replace the original company.docx file. ------------------EXAMPLE 7--------------------- PS:>Copy-PnPFile -SourceUrl Documents/MyDocs -TargetUrl /sites/otherproject/Documents -OverwriteIfAlreadyExists Copies a folder named MyDocs in the document library called Documents located in the current site to the site collection otherproject. If the MyDocs folder exist it will copy into it, if not it will be created. ------------------EXAMPLE 8--------------------- PS:>Copy-PnPFile -SourceUrl Documents/MyDocs -TargetUrl /sites/otherproject/Documents -SkipSourceFolderName -OverwriteIfAlreadyExists Copies a folder named MyDocs in the document library called Documents located in the current site to the root folder of the library named Documents in the site collection otherproject. ------------------EXAMPLE 9--------------------- PS:>Copy-PnPFile -SourceUrl Documents/MyDocs -TargetUrl /sites/otherproject/Documents/MyDocs -SkipSourceFolderName -OverwriteIfAlreadyExists Copies a folder named MyDocs in the MyDocs folder of the library named Documents. If the MyDocs folder does not exists, it will be created. ------------------EXAMPLE 10--------------------- PS:>Copy-PnPFile -SourceUrl Documents/MyDocs -TargetUrl /sites/otherproject/Documents/MyDocs -OverwriteIfAlreadyExists Copies a folder named MyDocs in the root of the library named Documents. If the MyDocs folder exists in the target, a subfolder also named MyDocs is created. ------------------EXAMPLE 11--------------------- PS:>Copy-PnPFile -SourceUrl SubSite1/Documents/company.docx -TargetUrl SubSite2/Documents Copies a file named company.docx in the library named Documents in SubSite1 to the library named Documents in SubSite2. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Disable-PnPFeature Disables a feature Disable PnPFeature Deactives a feature that was active on a site Disable-PnPFeature Identity The id of the feature to disable. GuidPipeBind Force Specifies whether to continue if an error occurs when deactivating the feature. SwitchParameter Scope Specify the scope of the feature to deactivate, either Web or Site. Defaults to Web. FeatureScope Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Force Specifies whether to continue if an error occurs when deactivating the feature. SwitchParameter SwitchParameter Identity The id of the feature to disable. GuidPipeBind GuidPipeBind Scope Specify the scope of the feature to deactivate, either Web or Site. Defaults to Web. FeatureScope FeatureScope Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Disable-PnPFeature -Identity 99a00f6e-fb81-4dc7-8eac-e09c6f9132fe This will disable the feature with the id "99a00f6e-fb81-4dc7-8eac-e09c6f9132fe" ------------------EXAMPLE 2--------------------- PS:> Disable-PnPFeature -Identity 99a00f6e-fb81-4dc7-8eac-e09c6f9132fe -Force This will disable the feature with the id "99a00f6e-fb81-4dc7-8eac-e09c6f9132fe" with force. ------------------EXAMPLE 3--------------------- PS:> Disable-PnPFeature -Identity 99a00f6e-fb81-4dc7-8eac-e09c6f9132fe -Scope Web This will disable the feature with the id "99a00f6e-fb81-4dc7-8eac-e09c6f9132fe" with the web scope. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Disable-PnPInPlaceRecordsManagementForSite Disables in place records management for a site. Disable PnPInPlaceRecordsManagementForSite Disable-PnPInPlaceRecordsManagementForSite Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection ------------------EXAMPLE 1--------------------- PS:> Disable-PnPInPlaceRecordsManagementForSite The in place records management feature will be disabled SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Disable-PnPResponsiveUI Deactive the PnP Response UI add-on Disable PnPResponsiveUI Disables the PnP Responsive UI implementation on a classic SharePoint Site Disable-PnPResponsiveUI Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Disable-PnPResponsiveUI If enabled previously, this will remove the PnP Responsive UI from a site. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Disable-PnPSiteClassification * Supported in: SharePoint Online. Disables Site Classifications for the tenant. Requires a connection to the Microsoft Graph. Disable PnPSiteClassification ------------------EXAMPLE 1--------------------- PS:> Connect-PnPOnline -Scopes "Directory.ReadWrite.All" PS:> Disable-PnPSiteClassification Disables Site Classifications for your tenant. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Disconnect-PnPOnline Disconnects the context Disconnect PnPOnline Disconnects the current context and requires you to build up a new connection in order to use the Cmdlets again. Using Connect-PnPOnline to connect to a different site has the same effect. Disconnect-PnPOnline Connection Connection to be used by cmdlet SPOnlineConnection Connection Connection to be used by cmdlet SPOnlineConnection SPOnlineConnection ------------------EXAMPLE 1--------------------- PS:> Disconnect-PnPOnline This will disconnect you from the server. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Enable-PnPFeature Enables a feature Enable PnPFeature Enable-PnPFeature Identity The id of the feature to enable. GuidPipeBind Force Specifies whether to overwrite an existing feature with the same feature identifier. This parameter is ignored if there are no errors. SwitchParameter Scope Specify the scope of the feature to activate, either Web or Site. Defaults to Web. FeatureScope Sandboxed Specify this parameter if the feature you're trying to activate is part of a sandboxed solution. SwitchParameter Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Force Specifies whether to overwrite an existing feature with the same feature identifier. This parameter is ignored if there are no errors. SwitchParameter SwitchParameter Identity The id of the feature to enable. GuidPipeBind GuidPipeBind Sandboxed Specify this parameter if the feature you're trying to activate is part of a sandboxed solution. SwitchParameter SwitchParameter Scope Specify the scope of the feature to activate, either Web or Site. Defaults to Web. FeatureScope FeatureScope Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Enable-PnPFeature -Identity 99a00f6e-fb81-4dc7-8eac-e09c6f9132fe This will enable the feature with the id "99a00f6e-fb81-4dc7-8eac-e09c6f9132fe" ------------------EXAMPLE 2--------------------- PS:> Enable-PnPFeature -Identity 99a00f6e-fb81-4dc7-8eac-e09c6f9132fe -Force This will enable the feature with the id "99a00f6e-fb81-4dc7-8eac-e09c6f9132fe" with force. ------------------EXAMPLE 3--------------------- PS:> Enable-PnPFeature -Identity 99a00f6e-fb81-4dc7-8eac-e09c6f9132fe -Scope Web This will enable the feature with the id "99a00f6e-fb81-4dc7-8eac-e09c6f9132fe" with the web scope. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Enable-PnPInPlaceRecordsManagementForSite Enables in place records management for a site. Enable PnPInPlaceRecordsManagementForSite Enable-PnPInPlaceRecordsManagementForSite Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection ------------------EXAMPLE 1--------------------- PS:> Enable-PnPInPlaceRecordsManagementForSite The in place records management feature will be enabled and the in place record management will be enabled in all locations with record declaration allowed by all contributors and undeclaration by site admins SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Enable-PnPResponsiveUI Activates the PnP Response UI Add-on Enable PnPResponsiveUI Enables the PnP Responsive UI implementation on a classic SharePoint Site Enable-PnPResponsiveUI InfrastructureSiteUrl A full URL pointing to an infrastructure site. If specified, it will add a custom action pointing to the responsive UI JS code in that site. String Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection InfrastructureSiteUrl A full URL pointing to an infrastructure site. If specified, it will add a custom action pointing to the responsive UI JS code in that site. String String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Enable-PnPResponsiveUI Will upload a CSS file, a JavaScript file and adds a custom action to the root web of the current site collection, enabling the responsive UI on the site collection. The CSS and JavaScript files are located in the style library, in a folder called SP.Responsive.UI. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Enable-PnPSiteClassification * Supported in: SharePoint Online. Enables Site Classifications for the tenant. Requires a connection to the Microsoft Graph. Enable PnPSiteClassification Enable-PnPSiteClassification Classifications String DefaultClassification String UsageGuidelinesUrl String Classifications String String DefaultClassification String String UsageGuidelinesUrl String String ------------------EXAMPLE 1--------------------- PS:> Connect-PnPOnline -Scopes "Directory.ReadWrite.All" PS:> Enable-PnPSiteClassification -Classifications "HBI","LBI","Top Secret" -DefaultClassification "LBI" Enables Site Classifications for your tenant and provides three classification values. The default value will be set to "LBI" ------------------EXAMPLE 2--------------------- PS:> Connect-PnPOnline -Scopes "Directory.ReadWrite.All" PS:> Enable-PnPSiteClassification -Classifications "HBI","LBI","Top Secret" -UsageGuidelinesUrl http://aka.ms/sppnp Enables Site Classifications for your tenant and provides three classification values. The usage guideliness will be set to the specified URL. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Get-PnPProperty Returns a previously not loaded property of a ClientObject Get PnPProperty Will populate properties of an object and optionally, if needed, load the value from the server. If one property is specified its value will be returned to the output. Get-PnPProperty ClientObject Specifies the object where the properties of should be retrieved ClientObject Property The properties to load. If one property is specified its value will be returned to the output. String[] Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection ClientObject Specifies the object where the properties of should be retrieved ClientObject ClientObject Property The properties to load. If one property is specified its value will be returned to the output. String[] String[] Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Microsoft.SharePoint.Client.ClientObject ------------------EXAMPLE 1--------------------- PS:> $web = Get-PnPWeb PS:> Get-PnPProperty -ClientObject $web -Property Id, Lists PS:> $web.Lists Will load both the Id and Lists properties of the specified Web object. ------------------EXAMPLE 2--------------------- PS:> $list = Get-PnPList -Identity 'Site Assets' PS:> Get-PnPProperty -ClientObject $list -Property Views Will load the views object of the specified list object and return its value to the output. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Export-PnPTaxonomy Exports a taxonomy to either the output or to a file. Export PnPTaxonomy Export-PnPTaxonomy TermSetId If specified, will export the specified termset only GuidPipeBind TermStoreName Term store to export; if not specified the default term store is used. String IncludeID If specified will include the ids of the taxonomy items in the output. Format: <label>;#<guid> SwitchParameter Path File to export the data to. String Force Overwrites the output file if it exists. SwitchParameter Delimiter The path delimiter to be used, by default this is '|' String Encoding Defaults to Unicode Encoding Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Delimiter The path delimiter to be used, by default this is '|' String String Encoding Defaults to Unicode Encoding Encoding Force Overwrites the output file if it exists. SwitchParameter SwitchParameter IncludeID If specified will include the ids of the taxonomy items in the output. Format: <label>;#<guid> SwitchParameter SwitchParameter Path File to export the data to. String String TermSetId If specified, will export the specified termset only GuidPipeBind GuidPipeBind TermStoreName Term store to export; if not specified the default term store is used. String String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection ------------------EXAMPLE 1--------------------- PS:> Export-PnPTaxonomy Exports the full taxonomy to the standard output ------------------EXAMPLE 2--------------------- PS:> Export-PnPTaxonomy -Path c:\output.txt Exports the full taxonomy the file output.txt ------------------EXAMPLE 3--------------------- PS:> Export-PnPTaxonomy -Path c:\output.txt -TermSet f6f43025-7242-4f7a-b739-41fa32847254 Exports the term set with the specified id SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Export-PnPTermGroupToXml Exports a taxonomy TermGroup to either the output or to an XML file. Export PnPTermGroupToXml Export-PnPTermGroupToXml Identity The ID or name of the termgroup Id, Title or TermGroup Out File to export the data to. String FullTemplate If specified, a full provisioning template structure will be returned SwitchParameter Encoding Defaults to Unicode Encoding Force Overwrites the output file if it exists. SwitchParameter Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Encoding Defaults to Unicode Encoding Encoding Force Overwrites the output file if it exists. SwitchParameter SwitchParameter FullTemplate If specified, a full provisioning template structure will be returned SwitchParameter SwitchParameter Identity The ID or name of the termgroup Id, Title or TermGroup Id, Title or TermGroup Out File to export the data to. String String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection ------------------EXAMPLE 1--------------------- PS:> Export-PnPTermGroupToXml Exports all term groups in the default site collection term store to the standard output ------------------EXAMPLE 2--------------------- PS:> Export-PnPTermGroupToXml -Out output.xml Exports all term groups in the default site collection term store to the file 'output.xml' in the current folder ------------------EXAMPLE 3--------------------- PS:> Export-PnPTermGroupToXml -Out c:\output.xml -Identity "Test Group" Exports the term group with the specified name to the file 'output.xml' located in the root folder of the C: drive. ------------------EXAMPLE 4--------------------- PS:> $termgroup = Get-PnPTermGroup -GroupName Test PS:> $termgroup | Export-PnPTermGroupToXml -Out c:\output.xml Retrieves a termgroup and subsequently exports that term group to a the file named 'output.xml' SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Find-PnPFile Finds a file in the virtual file system of the web. Find PnPFile Find-PnPFile Match Wildcard query String Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Find-PnPFile List List title, url or an actual List object to query ListPipeBind Match Wildcard query String Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Find-PnPFile Folder Folder object or relative url of a folder to query FolderPipeBind Match Wildcard query String Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Folder Folder object or relative url of a folder to query FolderPipeBind FolderPipeBind List List title, url or an actual List object to query ListPipeBind ListPipeBind Match Wildcard query String String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind Microsoft.SharePoint.Client.File ------------------EXAMPLE 1--------------------- PS:> Find-PnPFile -Match *.master Will return all masterpages located in the current web. ------------------EXAMPLE 2--------------------- PS:> Find-PnPFile -List "Documents" -Match *.pdf Will return all pdf files located in given list. ------------------EXAMPLE 3--------------------- PS:> Find-PnPFile -Folder "Shared Documents/Sub Folder" -Match *.docx Will return all docx files located in given folder. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Get-PnPApp * Supported in: SharePoint Online. Returns the available apps from the app catalog Get PnPApp Get-PnPApp Identity Specifies the Id of an app which is available in the app catalog AppMetadataPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Identity Specifies the Id of an app which is available in the app catalog AppMetadataPipeBind AppMetadataPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection List<OfficeDevPnP.Core.ALM.AppMetadata> ------------------EXAMPLE 1--------------------- PS:> Get-PnPApp This will return all available app metadata from the tenant app catalog. It will list the installed version in the current site. ------------------EXAMPLE 2--------------------- PS:> Get-PnPApp -Identity 2646ccc3-6a2b-46ef-9273-81411cbbb60f This will the specific app metadata from the app catalog. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Get-PnPAppInstance Returns a SharePoint AddIn Instance Get PnPAppInstance Returns a SharePoint App/Addin that has been installed in the current site Get-PnPAppInstance Web The web to apply the command to. Omit this parameter to use the current web. WebPipeBind Includes Specify properties to include when retrieving objects from the server. String[] Identity Specifies the Id of the App Instance AppPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Identity Specifies the Id of the App Instance AppPipeBind AppPipeBind Includes Specify properties to include when retrieving objects from the server. String[] String[] Web The web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection List<Microsoft.SharePoint.Client.AppInstance> ------------------EXAMPLE 1--------------------- PS:> Get-PnPAppInstance This will return all addin instances in the site. ------------------EXAMPLE 2--------------------- PS:> Get-PnPAppInstance -Identity 99a00f6e-fb81-4dc7-8eac-e09c6f9132fe This will return an addin instance with the specified id. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Get-PnPAuditing Get the Auditing setting of a site Get PnPAuditing Get-PnPAuditing Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Microsoft.SharePoint.Client.Audit ------------------EXAMPLE 1--------------------- PS:> Get-PnPAuditing Gets the auditing settings of the current site SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Get-PnPAuthenticationRealm Returns the authentication realm Get PnPAuthenticationRealm Gets the authentication realm for the current web Get-PnPAuthenticationRealm Url Specifies the URL of the site String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Url Specifies the URL of the site String String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection System.String ------------------EXAMPLE 1--------------------- PS:> Get-PnPAuthenticationRealm This will get the authentication realm for the current connected site ------------------EXAMPLE 2--------------------- PS:> Get-PnPAuthenticationRealm -Url https://contoso.sharepoint.com This will get the authentication realm for https://contoso.sharepoint.com SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Get-PnPAvailableClientSideComponents * Supported in: SharePoint Online. Gets the available client side components on a particular page Get PnPAvailableClientSideComponents Get-PnPAvailableClientSideComponents Page The name of the page. ClientSidePagePipeBind Component Specifies the component instance or Id to look for. ClientSideComponentPipeBind Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Component Specifies the component instance or Id to look for. ClientSideComponentPipeBind ClientSideComponentPipeBind Page The name of the page. ClientSidePagePipeBind ClientSidePagePipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Get-PnPAvailableClientSideComponents -Page "MyPage.aspx" Gets the list of available client side components on the page 'MyPage.aspx' ------------------EXAMPLE 2--------------------- PS:> Get-PnPAvailableClientSideComponents $page Gets the list of available client side components on the page contained in the $page variable ------------------EXAMPLE 3--------------------- PS:> Get-PnPAvailableClientSideComponents -Page "MyPage.aspx" -ComponentName "HelloWorld" Gets the client side component 'HelloWorld' if available on the page 'MyPage.aspx' SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Get-PnPAzureADManifestKeyCredentials Return the JSON Manifest snippet for Azure Apps Get PnPAzureADManifestKeyCredentials Creates the JSON snippet that is required for the manifest JSON file for Azure WebApplication / WebAPI apps Get-PnPAzureADManifestKeyCredentials CertPath Specifies the path to the certificate like .\mycert.cer String CertPath Specifies the path to the certificate like .\mycert.cer String String System.String Outputs a JSON formatted string ------------------EXAMPLE 1--------------------- PS:> Get-PnPAzureADManifestKeyCredentials -CertPath .\mycert.cer Output the JSON snippet which needs to be replaced in the application manifest file ------------------EXAMPLE 2--------------------- PS:> Get-PnPAzureADManifestKeyCredentials -CertPath .\mycert.cer | Set-Clipboard Output the JSON snippet which needs to be replaced in the application manifest file and copies it to the clipboard SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Get-PnPClientSideComponent * Supported in: SharePoint Online. Retrieve one or more Client-Side components from a page Get PnPClientSideComponent Get-PnPClientSideComponent Page The name of the page ClientSidePagePipeBind InstanceId The instance id of the component GuidPipeBind Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection InstanceId The instance id of the component GuidPipeBind GuidPipeBind Page The name of the page ClientSidePagePipeBind ClientSidePagePipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Get-PnPClientSideComponent -Page Home Returns all controls defined on the given page. ------------------EXAMPLE 2--------------------- PS:> Get-PnPClientSideComponent -Page Home -Identity a2875399-d6ff-43a0-96da-be6ae5875f82 Returns a specific control defined on the given page. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Get-PnPClientSidePage * Supported in: SharePoint Online. Gets a Client-Side Page Get PnPClientSidePage Get-PnPClientSidePage Identity The name of the page ClientSidePagePipeBind Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Identity The name of the page ClientSidePagePipeBind ClientSidePagePipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Get-PnPClientSidePage -Identity "MyPage.aspx" Gets the Modern Page (Client-Side) named 'MyPage.aspx' in the current SharePoint site ------------------EXAMPLE 2--------------------- PS:> Get-PnPClientSidePage "MyPage" Gets the Modern Page (Client-Side) named 'MyPage.aspx' in the current SharePoint site SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Get-PnPContentType Retrieves a content type Get PnPContentType Get-PnPContentType List List to query ListPipeBind InSiteHierarchy Search site hierarchy for content types SwitchParameter Identity Name or ID of the content type to retrieve ContentTypePipeBind Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Identity Name or ID of the content type to retrieve ContentTypePipeBind ContentTypePipeBind InSiteHierarchy Search site hierarchy for content types SwitchParameter SwitchParameter List List to query ListPipeBind ListPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind Microsoft.SharePoint.Client.ContentType ------------------EXAMPLE 1--------------------- PS:> Get-PnPContentType This will get a listing of all available content types within the current web ------------------EXAMPLE 2--------------------- PS:> Get-PnPContentType -InSiteHierarchy This will get a listing of all available content types within the site collection ------------------EXAMPLE 3--------------------- PS:> Get-PnPContentType -Identity "Project Document" This will get the content type with the name "Project Document" within the current context ------------------EXAMPLE 4--------------------- PS:> Get-PnPContentType -List "Documents" This will get a listing of all available content types within the list "Documents" SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Get-PnPContentTypePublishingHubUrl Returns the url to Content Type Publishing Hub Get PnPContentTypePublishingHubUrl Get-PnPContentTypePublishingHubUrl Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection ------------------EXAMPLE 1--------------------- PS:> $url = Get-PnPContentTypePublishingHubUrl PS:> Connect-PnPOnline -Url $url PS:> Get-PnPContentType This will retrieve the url to the content type hub, connect to it, and then retrieve the content types form that site SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Get-PnPCustomAction Return user custom actions Get PnPCustomAction Returns all or a specific user custom action Get-PnPCustomAction Identity Identity of the CustomAction to return. Omit to return all CustomActions. GuidPipeBind Scope Scope of the CustomAction, either Web, Site or All to return both CustomActionScope ThrowExceptionIfCustomActionNotFound Switch parameter if an exception should be thrown if the requested CustomAction does not exist (true) or if omitted, nothing will be returned in case the CustomAction does not exist SwitchParameter Web The web to apply the command to. Omit this parameter to use the current web. WebPipeBind Includes Specify properties to include when retrieving objects from the server. String[] Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Identity Identity of the CustomAction to return. Omit to return all CustomActions. GuidPipeBind GuidPipeBind Includes Specify properties to include when retrieving objects from the server. String[] String[] Scope Scope of the CustomAction, either Web, Site or All to return both CustomActionScope CustomActionScope ThrowExceptionIfCustomActionNotFound Switch parameter if an exception should be thrown if the requested CustomAction does not exist (true) or if omitted, nothing will be returned in case the CustomAction does not exist SwitchParameter SwitchParameter Web The web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection List<Microsoft.SharePoint.Client.UserCustomAction> ------------------EXAMPLE 1--------------------- PS:> Get-PnPCustomAction Returns all custom actions of the current site. ------------------EXAMPLE 2--------------------- PS:> Get-PnPCustomAction -Identity aa66f67e-46c0-4474-8a82-42bf467d07f2 Returns the custom action with the id 'aa66f67e-46c0-4474-8a82-42bf467d07f2'. ------------------EXAMPLE 3--------------------- PS:> Get-PnPCustomAction -Scope web Returns all custom actions for the current web object. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Get-PnPDefaultColumnValues Gets the default column values for all folders in document library Get PnPDefaultColumnValues Gets the default column values for a document library, per folder. Supports both text, people and taxonomy fields. Get-PnPDefaultColumnValues List The ID, Name or Url of the list. ListPipeBind Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection List The ID, Name or Url of the list. ListPipeBind ListPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Get-PnPDocumentSetTemplate Retrieves a document set template Get PnPDocumentSetTemplate Get-PnPDocumentSetTemplate Identity Either specify a name, an id, a document set template object or a content type object DocumentSetPipeBind Web The web to apply the command to. Omit this parameter to use the current web. WebPipeBind Includes Specify properties to include when retrieving objects from the server. String[] Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Identity Either specify a name, an id, a document set template object or a content type object DocumentSetPipeBind DocumentSetPipeBind Includes Specify properties to include when retrieving objects from the server. String[] String[] Web The web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Microsoft.SharePoint.Client.DocumentSet.DocumentSetTemplate ------------------EXAMPLE 1--------------------- PS:> Get-PnPDocumentSetTemplate -Identity "Test Document Set" This will get the document set template with the name "Test Document Set" ------------------EXAMPLE 2--------------------- PS:> Get-PnPDocumentSetTemplate -Identity "0x0120D520005DB65D094035A241BAC9AF083F825F3B" This will get the document set template with the id "0x0120D520005DB65D094035A241BAC9AF083F825F3B" SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Get-PnPEventReceiver Return registered eventreceivers Get PnPEventReceiver Returns all registered or a specific eventreceiver Get-PnPEventReceiver List The list object from which to get the event receiver object ListPipeBind Identity The Guid of the event receiver EventReceiverPipeBind Web The web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Get-PnPEventReceiver Identity The Guid of the event receiver EventReceiverPipeBind Web The web to apply the command to. Omit this parameter to use the current web. WebPipeBind Includes Specify properties to include when retrieving objects from the server. String[] Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Identity The Guid of the event receiver EventReceiverPipeBind EventReceiverPipeBind Includes Specify properties to include when retrieving objects from the server. String[] String[] List The list object from which to get the event receiver object ListPipeBind ListPipeBind Web The web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Microsoft.SharePoint.Client.EventReceiverDefinition ------------------EXAMPLE 1--------------------- PS:> Get-PnPEventReceiver This will return all registered event receivers on the current web ------------------EXAMPLE 2--------------------- PS:> Get-PnPEventReceiver -Identity fb689d0e-eb99-4f13-beb3-86692fd39f22 This will return the event receiver with the provided ReceiverId "fb689d0e-eb99-4f13-beb3-86692fd39f22" from the current web ------------------EXAMPLE 3--------------------- PS:> Get-PnPEventReceiver -Identity MyReceiver This will return the event receiver with the provided ReceiverName "MyReceiver" from the current web ------------------EXAMPLE 4--------------------- PS:> Get-PnPEventReceiver -List "ProjectList" This will return all registered event receivers in the provided "ProjectList" list ------------------EXAMPLE 5--------------------- PS:> Get-PnPEventReceiver -List "ProjectList" -Identity fb689d0e-eb99-4f13-beb3-86692fd39f22 This will return the event receiver in the provided "ProjectList" list with with the provided ReceiverId "fb689d0e-eb99-4f13-beb3-86692fd39f22" ------------------EXAMPLE 6--------------------- PS:> Get-PnPEventReceiver -List "ProjectList" -Identity MyReceiver This will return the event receiver in the "ProjectList" list with the provided ReceiverName "MyReceiver" SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Get-PnPFeature Returns all activated or a specific activated feature Get PnPFeature Get-PnPFeature Scope The scope of the feature. Defaults to Web. FeatureScope Web The web to apply the command to. Omit this parameter to use the current web. WebPipeBind Includes Specify properties to include when retrieving objects from the server. String[] Identity The feature ID or name to query for, Querying by name is not supported in version 15 of the Client Side Object Model FeaturePipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Identity The feature ID or name to query for, Querying by name is not supported in version 15 of the Client Side Object Model FeaturePipeBind FeaturePipeBind Includes Specify properties to include when retrieving objects from the server. String[] String[] Scope The scope of the feature. Defaults to Web. FeatureScope FeatureScope Web The web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection List<Microsoft.SharePoint.Client.Feature> ------------------EXAMPLE 1--------------------- PS:> Get-PnPFeature This will return all activated web scoped features ------------------EXAMPLE 2--------------------- PS:> Get-PnPFeature -Scope Site This will return all activated site scoped features ------------------EXAMPLE 3--------------------- PS:> Get-PnPFeature -Identity fb689d0e-eb99-4f13-beb3-86692fd39f22 This will return a specific activated web scoped feature ------------------EXAMPLE 4--------------------- PS:> Get-PnPFeature -Identity fb689d0e-eb99-4f13-beb3-86692fd39f22 -Scope Site This will return a specific activated site scoped feature SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Get-PnPField Returns a field from a list or site Get PnPField Get-PnPField List The list object or name where to get the field from ListPipeBind Group Filter to the specified group String Web The web to apply the command to. Omit this parameter to use the current web. WebPipeBind Includes Specify properties to include when retrieving objects from the server. String[] Identity The field object or name to get FieldPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Group Filter to the specified group String String Identity The field object or name to get FieldPipeBind FieldPipeBind Includes Specify properties to include when retrieving objects from the server. String[] String[] List The list object or name where to get the field from ListPipeBind ListPipeBind Web The web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Microsoft.SharePoint.Client.Field ------------------EXAMPLE 1--------------------- PS:> Get-PnPField Gets all the fields from the current site ------------------EXAMPLE 2--------------------- PS:> Get-PnPField -List "Demo list" -Identity "Speakers" Gets the speakers field from the list Demo list SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Get-PnPFile Downloads a file. Get PnPFile Get-PnPFile Url The URL (server or site relative) to the file String Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Get-PnPFile Url The URL (server or site relative) to the file String AsListItem Returns the file as a listitem showing all its properties SwitchParameter ThrowExceptionIfFileNotFound If provided in combination with -AsListItem, a Sytem.ArgumentException will be thrown if the file specified in the -Url argument does not exist. Otherwise it will return nothing instead. SwitchParameter Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Get-PnPFile Url The URL (server or site relative) to the file String AsString Retrieve the file contents as a string SwitchParameter Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Get-PnPFile AsFile SwitchParameter Url The URL (server or site relative) to the file String Path Local path where the file should be saved String Filename Name for the local file String Force Overwrites the file if it exists. SwitchParameter Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection AsFile SwitchParameter SwitchParameter AsListItem Returns the file as a listitem showing all its properties SwitchParameter SwitchParameter AsString Retrieve the file contents as a string SwitchParameter SwitchParameter Filename Name for the local file String String Force Overwrites the file if it exists. SwitchParameter SwitchParameter Path Local path where the file should be saved String String ThrowExceptionIfFileNotFound If provided in combination with -AsListItem, a Sytem.ArgumentException will be thrown if the file specified in the -Url argument does not exist. Otherwise it will return nothing instead. SwitchParameter SwitchParameter Url The URL (server or site relative) to the file String String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind Microsoft.SharePoint.Client.File ------------------EXAMPLE 1--------------------- PS:> Get-PnPFile -Url /sites/project/_catalogs/themes/15/company.spcolor Retrieves the file and downloads it to the current folder ------------------EXAMPLE 2--------------------- PS:> Get-PnPFile -Url /sites/project/_catalogs/themes/15/company.spcolor -Path c:\temp -FileName company.spcolor -AsFile Retrieves the file and downloads it to c:\temp\company.spcolor ------------------EXAMPLE 3--------------------- PS:> Get-PnPFile -Url /sites/project/_catalogs/themes/15/company.spcolor -AsString Retrieves the file and outputs its contents to the console ------------------EXAMPLE 4--------------------- PS:> Get-PnPFile -Url /sites/project/_catalogs/themes/15/company.spcolor -AsFile Retrieves the file and returns it as a File object ------------------EXAMPLE 5--------------------- PS:> Get-PnPFile -Url /sites/project/_catalogs/themes/15/company.spcolor -AsListItem Retrieves the file and returns it as a ListItem object ------------------EXAMPLE 6--------------------- PS:> Get-PnPFile -Url _catalogs/themes/15/company.spcolor -Path c:\temp -FileName company.spcolor -AsFile Retrieves the file by site relative URL and downloads it to c:\temp\company.spcolor SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Get-PnPFolder Return a folder object Get PnPFolder Retrieves a folder if it exists. Use Ensure-PnPFolder to create the folder if it does not exist. Get-PnPFolder Url Site or server relative URL of the folder to retrieve. In the case of a server relative url, make sure that the url starts with the managed path as the current web. String Web The web to apply the command to. Omit this parameter to use the current web. WebPipeBind Includes Specify properties to include when retrieving objects from the server. String[] Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Includes Specify properties to include when retrieving objects from the server. String[] String[] Url Site or server relative URL of the folder to retrieve. In the case of a server relative url, make sure that the url starts with the managed path as the current web. String String Web The web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Microsoft.SharePoint.Client.Folder ------------------EXAMPLE 1--------------------- PS:> Get-PnPFolder -Url "Shared Documents" Returns the folder called 'Shared Documents' which is located in the root of the current web ------------------EXAMPLE 2--------------------- PS:> Get-PnPFolder -Url "/sites/demo/Shared Documents" Returns the folder called 'Shared Documents' which is located in the root of the current web SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Ensure-PnPFolder: https://github.com/OfficeDev/PnP-PowerShell/blob/master/Documentation/EnsureSPOFolder.md Get-PnPFolderItem List content in folder Get PnPFolderItem Get-PnPFolderItem ItemType The type of contents to retrieve, either File, Folder or All (default) String ItemName Optional name of the item to retrieve String FolderSiteRelativeUrl The site relative folder to retrieve String Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection FolderSiteRelativeUrl The site relative folder to retrieve String String ItemName Optional name of the item to retrieve String String ItemType The type of contents to retrieve, either File, Folder or All (default) String String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Get-PnPFolderItem -FolderSiteRelativeUrl "SitePages" Returns the contents of the folder SitePages which is located in the root of the current web ------------------EXAMPLE 2--------------------- PS:> Get-PnPFolderItem -FolderSiteRelativeUrl "SitePages" -ItemName "Default.aspx" Returns the file 'Default.aspx' which is located in the folder SitePages which is located in the root of the current web ------------------EXAMPLE 3--------------------- PS:> Get-PnPFolderItem -FolderSiteRelativeUrl "SitePages" -ItemType Folder Returns all folders in the folder SitePages which is located in the root of the current web ------------------EXAMPLE 4--------------------- PS:> Get-PnPFolderItem -FolderSiteRelativeUrl "SitePages" -ItemType File Returns all files in the folder SitePages which is located in the root of the current web SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Get-PnPGroup Returns a specific group or all groups. Get PnPGroup Get-PnPGroup Web The web to apply the command to. Omit this parameter to use the current web. WebPipeBind Identity Get a specific group by name GroupPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Get-PnPGroup AssociatedMemberGroup Retrieve the associated member group SwitchParameter Web The web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Get-PnPGroup AssociatedVisitorGroup Retrieve the associated visitor group SwitchParameter Web The web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Get-PnPGroup AssociatedOwnerGroup Retrieve the associated owner group SwitchParameter Web The web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Get-PnPGroup Web The web to apply the command to. Omit this parameter to use the current web. WebPipeBind Includes Specify properties to include when retrieving objects from the server. String[] Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection AssociatedMemberGroup Retrieve the associated member group SwitchParameter SwitchParameter AssociatedOwnerGroup Retrieve the associated owner group SwitchParameter SwitchParameter AssociatedVisitorGroup Retrieve the associated visitor group SwitchParameter SwitchParameter Identity Get a specific group by name GroupPipeBind GroupPipeBind Includes Specify properties to include when retrieving objects from the server. String[] String[] Web The web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection List<Microsoft.SharePoint.Client.Group> ------------------EXAMPLE 1--------------------- PS:> Get-PnPGroup Returns all groups ------------------EXAMPLE 2--------------------- PS:> Get-PnPGroup -Identity 'My Site Users' This will return the group called 'My Site Users' if available ------------------EXAMPLE 3--------------------- PS:> Get-PnPGroup -AssociatedMemberGroup This will return the current members group for the site SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Get-PnPGroupMembers Retrieves all members of a group Get PnPGroupMembers This command will return all the users that are a member of the provided SharePoint Group Get-PnPGroupMembers Identity A group object, an ID or a name of a group GroupPipeBind Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Identity A group object, an ID or a name of a group GroupPipeBind GroupPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind Microsoft.SharePoint.Client.User ------------------EXAMPLE 1--------------------- PS:> Get-PnPGroupMembers -Identity 'Marketing Site Members' Returns all the users that are a member of the group 'Marketing Site Members' in the current sitecollection ------------------EXAMPLE 2--------------------- PS:> Get-PnPGroup | Get-PnPGroupMembers Returns all the users that are a member of any of the groups in the current sitecollection ------------------EXAMPLE 3--------------------- PS:> Get-PnPGroup | ? Title -Like 'Marketing*' | Get-PnPGroupMembers Returns all the users that are a member of any of the groups of which their name starts with the word 'Marketing' in the current sitecollection SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Get-PnPGroupPermissions Returns the permissions for a specific SharePoint group Get PnPGroupPermissions Get-PnPGroupPermissions Identity Get the permissions of a specific group by name GroupPipeBind Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Identity Get the permissions of a specific group by name GroupPipeBind GroupPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind Microsoft.SharePoint.Client.RoleDefinitionBindingCollection ------------------EXAMPLE 1--------------------- PS:> Get-PnPGroupPermissions -Identity 'My Site Members' Returns the permissions for the SharePoint group with the name 'My Site Members' SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Get-PnPHealthScore Retrieves the healthscore Get PnPHealthScore Retrieves the current health score value of the server which is a value between 0 and 10. Lower is better. System.Int32 Returns a int value representing the current health score value of the server. ------------------EXAMPLE 1--------------------- PS:> Get-PnPHealthScore This will retrieve the current health score of the server. ------------------EXAMPLE 2--------------------- PS:> Get-PnPHealthScore -Url https://contoso.sharepoint.com This will retrieve the current health score for the url https://contoso.sharepoint.com. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Get-PnPHideDefaultThemes * Supported in: SharePoint Online. Returns if the default / OOTB themes should be visible to users or not. Get PnPHideDefaultThemes Returns if the default themes are visible. Use Set-PnPHideDefaultThemes to change this value. You must be a SharePoint Online global administrator to run the cmdlet. Get-PnPHideDefaultThemes Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection ------------------EXAMPLE 1--------------------- PS:> Get-PnPHideDefaultThemes This example returns the current setting if the default themes should be visible SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Get-PnPHomePage Return the homepage Get PnPHomePage Returns the URL to the page set as home page Get-PnPHomePage Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind System.String ------------------EXAMPLE 1--------------------- PS:> Get-PnPHomePage Will return the URL of the home page of the web. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Get-PnPHubSite * Supported in: SharePoint Online. Retrieve all or a specific hubsite. Get PnPHubSite Get-PnPHubSite Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection ------------------EXAMPLE 1--------------------- PS:> Get-PnPStorageEntity Returns all site storage entities/farm properties ------------------EXAMPLE 2--------------------- PS:> Get-PnPTenantSite -Key MyKey Returns the storage entity/farm property with the given key. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Get-PnPHubSiteNavigation * Supported in: SharePoint Online. Retrieve all or a specific hubsite. Get PnPHubSiteNavigation Get-PnPHubSiteNavigation Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Get-PnPStorageEntity Returns all site storage entities/farm properties ------------------EXAMPLE 2--------------------- PS:> Get-PnPTenantSite -Key MyKey Returns the storage entity/farm property with the given key. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Get-PnPIndexedPropertyKeys Returns the keys of the property bag values that have been marked for indexing by search Get PnPIndexedPropertyKeys Get-PnPIndexedPropertyKeys Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Get-PnPInPlaceRecordsManagement Returns if the place records management feature is enabled. Get PnPInPlaceRecordsManagement Get-PnPInPlaceRecordsManagement Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Get-PnPInPlaceRecordsManagement Returns if $true if in place records management is active SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Get-PnPJavaScriptLink Returns all or a specific custom action(s) with location type ScriptLink Get PnPJavaScriptLink Get-PnPJavaScriptLink Scope Scope of the action, either Web, Site or All to return both, defaults to Web CustomActionScope ThrowExceptionIfJavaScriptLinkNotFound Switch parameter if an exception should be thrown if the requested JavaScriptLink does not exist (true) or if omitted, nothing will be returned in case the JavaScriptLink does not exist SwitchParameter Name Name of the Javascript link. Omit this parameter to retrieve all script links String Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Name Name of the Javascript link. Omit this parameter to retrieve all script links String String Scope Scope of the action, either Web, Site or All to return both, defaults to Web CustomActionScope CustomActionScope ThrowExceptionIfJavaScriptLinkNotFound Switch parameter if an exception should be thrown if the requested JavaScriptLink does not exist (true) or if omitted, nothing will be returned in case the JavaScriptLink does not exist SwitchParameter SwitchParameter Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind Microsoft.SharePoint.Client.UserCustomAction ------------------EXAMPLE 1--------------------- PS:> Get-PnPJavaScriptLink Returns all web scoped JavaScript links ------------------EXAMPLE 2--------------------- PS:> Get-PnPJavaScriptLink -Scope All Returns all web and site scoped JavaScript links ------------------EXAMPLE 3--------------------- PS:> Get-PnPJavaScriptLink -Scope Web Returns all Web scoped JavaScript links ------------------EXAMPLE 4--------------------- PS:> Get-PnPJavaScriptLink -Scope Site Returns all Site scoped JavaScript links ------------------EXAMPLE 5--------------------- PS:> Get-PnPJavaScriptLink -Name Test Returns the web scoped JavaScript link named Test SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Get-PnPList Returns a List object Get PnPList Get-PnPList ThrowExceptionIfListNotFound Switch parameter if an exception should be thrown if the requested list does not exist (true) or if omitted, nothing will be returned in case the list does not exist SwitchParameter Web The web to apply the command to. Omit this parameter to use the current web. WebPipeBind Includes Specify properties to include when retrieving objects from the server. String[] Identity The ID, name or Url (Lists/MyList) of the list. ListPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Identity The ID, name or Url (Lists/MyList) of the list. ListPipeBind ListPipeBind Includes Specify properties to include when retrieving objects from the server. String[] String[] ThrowExceptionIfListNotFound Switch parameter if an exception should be thrown if the requested list does not exist (true) or if omitted, nothing will be returned in case the list does not exist SwitchParameter SwitchParameter Web The web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Microsoft.SharePoint.Client.List ------------------EXAMPLE 1--------------------- PS:> Get-PnPList Returns all lists in the current web ------------------EXAMPLE 2--------------------- PS:> Get-PnPList -Identity 99a00f6e-fb81-4dc7-8eac-e09c6f9132fe Returns a list with the given id. ------------------EXAMPLE 3--------------------- PS:> Get-PnPList -Identity Lists/Announcements Returns a list with the given url. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Get-PnPListInformationRightsManagement Get the site closure status of the site which has a site policy applied Get PnPListInformationRightsManagement Get-PnPListInformationRightsManagement List ListPipeBind Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection List ListPipeBind ListPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Get-PnPListInformationRightsManagement -List "Documents" Returns Information Rights Management (IRM) settings for the list. See 'Get-Help Set-PnPListInformationRightsManagement -Detailed' for more information about the various values. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Get-PnPListItem Retrieves list items Get PnPListItem Get-PnPListItem List The list to query ListPipeBind Id The ID of the item to retrieve Int32 Fields The fields to retrieve. If not specified all fields will be loaded in the returned list object. String[] Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Get-PnPListItem List The list to query ListPipeBind UniqueId The unique id (GUID) of the item to retrieve GuidPipeBind Fields The fields to retrieve. If not specified all fields will be loaded in the returned list object. String[] Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Get-PnPListItem List The list to query ListPipeBind Query The CAML query to execute against the list String PageSize The number of items to retrieve per page request. Int32 ScriptBlock The script block to run after every page request. ScriptBlock Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Get-PnPListItem List The list to query ListPipeBind Fields The fields to retrieve. If not specified all fields will be loaded in the returned list object. String[] PageSize The number of items to retrieve per page request. Int32 ScriptBlock The script block to run after every page request. ScriptBlock Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Fields The fields to retrieve. If not specified all fields will be loaded in the returned list object. String[] String[] Id The ID of the item to retrieve Int32 Int32 List The list to query ListPipeBind ListPipeBind PageSize The number of items to retrieve per page request. Int32 Int32 Query The CAML query to execute against the list String String ScriptBlock The script block to run after every page request. ScriptBlock ScriptBlock UniqueId The unique id (GUID) of the item to retrieve GuidPipeBind GuidPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind Microsoft.SharePoint.Client.ListItem ------------------EXAMPLE 1--------------------- PS:> Get-PnPListItem -List Tasks Retrieves all list items from the Tasks list ------------------EXAMPLE 2--------------------- PS:> Get-PnPListItem -List Tasks -Id 1 Retrieves the list item with ID 1 from from the Tasks list ------------------EXAMPLE 3--------------------- PS:> Get-PnPListItem -List Tasks -UniqueId bd6c5b3b-d960-4ee7-a02c-85dc6cd78cc3 Retrieves the list item with unique id bd6c5b3b-d960-4ee7-a02c-85dc6cd78cc3 from from the tasks lists ------------------EXAMPLE 4--------------------- PS:> (Get-PnPListItem -List Tasks -Fields "Title","GUID").FieldValues Retrieves all list items, but only includes the values of the Title and GUID fields in the list item object ------------------EXAMPLE 5--------------------- PS:> Get-PnPListItem -List Tasks -Query "<View><Query><Where><Eq><FieldRef Name='GUID'/><Value Type='Guid'>bd6c5b3b-d960-4ee7-a02c-85dc6cd78cc3</Value></Eq></Where></Query></View>" Retrieves all list items based on the CAML query specified ------------------EXAMPLE 6--------------------- PS:> Get-PnPListItem -List Tasks -PageSize 1000 Retrieves all list items from the Tasks list in pages of 1000 items ------------------EXAMPLE 7--------------------- PS:> Get-PnPListItem -List Tasks -PageSize 1000 -ScriptBlock { Param($items) $items.Context.ExecuteQuery() } | % { $_.BreakRoleInheritance($true, $true) } Retrieves all list items from the Tasks list in pages of 1000 items and breaks permission inheritance on each item SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Get-PnPListRecordDeclaration * Supported in: SharePoint Online. Returns the manual record declaration settings for a list Get PnPListRecordDeclaration Get-PnPListRecordDeclaration List The list to retrieve the record declaration settings for ListPipeBind Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection List The list to retrieve the record declaration settings for ListPipeBind ListPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Get-PnPListRecordDeclaration -List "Documents" Returns the record declaration setting for the list "Documents" SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Get-PnPMasterPage Returns the URLs of the default Master Page and the custom Master Page. Get PnPMasterPage Get-PnPMasterPage Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Get-PnPNavigationNode Returns all or a specific navigation node Get PnPNavigationNode Get-PnPNavigationNode Location The location of the nodes to retrieve. Either TopNavigationBar, QuickLaunch NavigationType Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Get-PnPNavigationNode Id The Id of the node to retrieve Int32 Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Id The Id of the node to retrieve Int32 Int32 Location The location of the nodes to retrieve. Either TopNavigationBar, QuickLaunch NavigationType NavigationType Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Get-PnPNavigationNode Returns all navigation nodes in the quicklaunch navigation ------------------EXAMPLE 2--------------------- PS:> Get-PnPNavigationNode -QuickLaunch Returns all navigation nodes in the quicklaunch navigation ------------------EXAMPLE 3--------------------- PS:> Get-PnPNavigationNode -TopNavigationBar Returns all navigation nodes in the top navigation bar ------------------EXAMPLE 4--------------------- PS:> $node = Get-PnPNavigationNode -Id 2030 PS> $children = $node.Children Returns the selected navigation node and retrieves any children SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Get-PnPAccessToken Returns the current OAuth Access token Get PnPAccessToken Gets the OAuth 2.0 Access Token to consume the Microsoft Graph API Get-PnPAccessToken Decoded Returns the access token in a decoded manner SwitchParameter Decoded Returns the access token in a decoded manner SwitchParameter SwitchParameter ------------------EXAMPLE 1--------------------- PS:> Get-PnPAccessToken Gets the OAuth 2.0 Access Token to consume the Microsoft Graph API SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Get-PnPAzureCertificate Get PEM values and manifest settings for an existing certificate (.pfx) for use when using CSOM via an app-only ADAL application. See https://github.com/SharePoint/PnP-PowerShell/tree/master/Samples/SharePoint.ConnectUsingAppPermissions for a sample on how to get started. KeyCredentials contains the ADAL app manifest sections. Certificate contains the PEM encoded certificate. PrivateKey contains the PEM encoded private key of the certificate. Get PnPAzureCertificate Get-PnPAzureCertificate CertificatePath Path to the certificate (*.pfx) String CertificatePassword Password to the certificate (*.pfx) SecureString CertificatePassword Password to the certificate (*.pfx) SecureString SecureString CertificatePath Path to the certificate (*.pfx) String String ------------------EXAMPLE 1--------------------- PS:> Get-PnPAzureCertificate -CertificatePath "mycert.pfx" This will output PEM values and ADAL app manifest settings for the certificate mycert.pfx. ------------------EXAMPLE 2--------------------- PS:> Get-PnPAzureCertificate -CertificatePath "mycert.pfx" -CertificatePassword (ConvertTo-SecureString -String "YourPassword" -AsPlainText -Force) This will output PEM values and ADAL app manifest settings for the certificate mycert.pfx which has the password YourPassword. ------------------EXAMPLE 3--------------------- PS:> Get-PnPAzureCertificate -CertificatePath "mycert.cer" | clip Output the JSON snippet which needs to be replaced in the application manifest file and copies it to the clipboard SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Get-PnPAppAuthAccessToken Returns the access token Get PnPAppAuthAccessToken Returns the access token from the current client context (only works with App-Only authentication) Get-PnPAppAuthAccessToken Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection System.String ------------------EXAMPLE 1--------------------- PS:> $accessToken = Get-PnPAppAuthAccessToken This will put the access token from current context in the $accessToken variable. Will only work in App authentication flow (App+user or App-Only) SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Get-PnPConnection Returns the current context Get PnPConnection Returns a PnP PowerShell Connection for use with the -Connection parameter on other cmdlets. ------------------EXAMPLE 1--------------------- PS:> $ctx = Get-PnPConnection This will put the current connection for use with the -Connection parameter on other cmdlets. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Get-PnPSiteCollectionTermStore Returns the site collection term store Get PnPSiteCollectionTermStore Get-PnPSiteCollectionTermStore Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Microsoft.SharePoint.Client.Taxonomy.TermStore ------------------EXAMPLE 1--------------------- PS:> Get-PnPSiteCollectionTermStore Returns the site collection term store. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Get-PnPStorageEntity * Supported in: SharePoint Online. Retrieve Storage Entities / Farm Properties. Get PnPStorageEntity Get-PnPStorageEntity Key The key of the value to retrieve. String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Key The key of the value to retrieve. String String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection ------------------EXAMPLE 1--------------------- PS:> Get-PnPStorageEntity Returns all site storage entities/farm properties ------------------EXAMPLE 2--------------------- PS:> Get-PnPStorageEntity -Key MyKey Returns the storage entity/farm property with the given key. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Get-PnPPropertyBag Returns the property bag values. Get PnPPropertyBag Get-PnPPropertyBag Folder Site relative url of the folder. See examples for use. String Key Key that should be looked up String Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Folder Site relative url of the folder. See examples for use. String String Key Key that should be looked up String String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind SharePointPnP.PowerShell.Commands.PropertyBagValue ------------------EXAMPLE 1--------------------- PS:> Get-PnPPropertyBag This will return all web property bag values ------------------EXAMPLE 2--------------------- PS:> Get-PnPPropertyBag -Key MyKey This will return the value of the key MyKey from the web property bag ------------------EXAMPLE 3--------------------- PS:> Get-PnPPropertyBag -Folder /MyFolder This will return all property bag values for the folder MyFolder which is located in the root of the current web ------------------EXAMPLE 4--------------------- PS:> Get-PnPPropertyBag -Folder /MyFolder -Key vti_mykey This will return the value of the key vti_mykey from the folder MyFolder which is located in the root of the current web ------------------EXAMPLE 5--------------------- PS:> Get-PnPPropertyBag -Folder / -Key vti_mykey This will return the value of the key vti_mykey from the root folder of the current web SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Get-PnPProvisioningTemplate Generates a provisioning template from a web Get PnPProvisioningTemplate Get-PnPProvisioningTemplate IncludeAllTermGroups If specified, all term groups will be included. Overrides IncludeSiteCollectionTermGroup. SwitchParameter IncludeSiteCollectionTermGroup If specified, all the site collection term groups will be included. Overridden by IncludeAllTermGroups. SwitchParameter IncludeSiteGroups If specified all site groups will be included. SwitchParameter IncludeTermGroupsSecurity If specified all the managers and contributors of term groups will be included. SwitchParameter IncludeSearchConfiguration If specified the template will contain the current search configuration of the site. SwitchParameter PersistBrandingFiles If specified the files used for masterpages, sitelogo, alternate CSS and the files that make up the composed look will be saved. SwitchParameter PersistPublishingFiles If specified the files used for the publishing feature will be saved. SwitchParameter IncludeNativePublishingFiles If specified, out of the box / native publishing files will be saved. SwitchParameter SkipVersionCheck During extraction the version of the server will be checked for certain actions. If you specify this switch, this check will be skipped. SwitchParameter PersistMultiLanguageResources If specified, resource values for applicable artifacts will be persisted to a resource file SwitchParameter ResourceFilePrefix If specified, resource files will be saved with the specified prefix instead of using the template name specified. If no template name is specified the files will be called PnP-Resources.<language>.resx. See examples for more info. String Handlers Allows you to only process a specific type of artifact in the site. Notice that this might result in a non-working template, as some of the handlers require other artifacts in place if they are not part of what your extracting. Handlers ExcludeHandlers Allows you to run all handlers, excluding the ones specified. Handlers ExtensibilityHandlers Allows you to specify ExtensbilityHandlers to execute while extracting a template. ExtensibilityHandler[] TemplateProviderExtensions Allows you to specify ITemplateProviderExtension to execute while extracting a template. ITemplateProviderExtension[] ContentTypeGroups Allows you to specify from which content type group(s) the content types should be included into the template. String[] Force Overwrites the output file if it exists. SwitchParameter Encoding The encoding type of the XML file, Unicode is default Encoding TemplateDisplayName It can be used to specify the DisplayName of the template file that will be extracted. String TemplateImagePreviewUrl It can be used to specify the ImagePreviewUrl of the template file that will be extracted. String TemplateProperties It can be used to specify custom Properties for the template file that will be extracted. Hashtable OutputInstance Returns the template as an in-memory object, which is an instance of the ProvisioningTemplate type of the PnP Core Component. It cannot be used together with the -Out parameter. SwitchParameter ExcludeContentTypesFromSyndication Specify whether or not content types issued from a content hub should be exported. By default, these content types are included. SwitchParameter Out Filename to write to, optionally including full path String Schema The schema of the output to use, defaults to the latest schema XMLPnPSchemaVersion Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection ContentTypeGroups Allows you to specify from which content type group(s) the content types should be included into the template. String[] String[] Encoding The encoding type of the XML file, Unicode is default Encoding Encoding ExcludeContentTypesFromSyndication Specify whether or not content types issued from a content hub should be exported. By default, these content types are included. SwitchParameter SwitchParameter ExcludeHandlers Allows you to run all handlers, excluding the ones specified. Handlers Handlers ExtensibilityHandlers Allows you to specify ExtensbilityHandlers to execute while extracting a template. ExtensibilityHandler[] ExtensibilityHandler[] Force Overwrites the output file if it exists. SwitchParameter SwitchParameter Handlers Allows you to only process a specific type of artifact in the site. Notice that this might result in a non-working template, as some of the handlers require other artifacts in place if they are not part of what your extracting. Handlers Handlers IncludeAllTermGroups If specified, all term groups will be included. Overrides IncludeSiteCollectionTermGroup. SwitchParameter SwitchParameter IncludeNativePublishingFiles If specified, out of the box / native publishing files will be saved. SwitchParameter SwitchParameter IncludeSearchConfiguration If specified the template will contain the current search configuration of the site. SwitchParameter SwitchParameter IncludeSiteCollectionTermGroup If specified, all the site collection term groups will be included. Overridden by IncludeAllTermGroups. SwitchParameter SwitchParameter IncludeSiteGroups If specified all site groups will be included. SwitchParameter SwitchParameter IncludeTermGroupsSecurity If specified all the managers and contributors of term groups will be included. SwitchParameter SwitchParameter Out Filename to write to, optionally including full path String String OutputInstance Returns the template as an in-memory object, which is an instance of the ProvisioningTemplate type of the PnP Core Component. It cannot be used together with the -Out parameter. SwitchParameter SwitchParameter PersistBrandingFiles If specified the files used for masterpages, sitelogo, alternate CSS and the files that make up the composed look will be saved. SwitchParameter SwitchParameter PersistMultiLanguageResources If specified, resource values for applicable artifacts will be persisted to a resource file SwitchParameter SwitchParameter PersistPublishingFiles If specified the files used for the publishing feature will be saved. SwitchParameter SwitchParameter ResourceFilePrefix If specified, resource files will be saved with the specified prefix instead of using the template name specified. If no template name is specified the files will be called PnP-Resources.<language>.resx. See examples for more info. String String Schema The schema of the output to use, defaults to the latest schema XMLPnPSchemaVersion XMLPnPSchemaVersion SkipVersionCheck During extraction the version of the server will be checked for certain actions. If you specify this switch, this check will be skipped. SwitchParameter SwitchParameter TemplateDisplayName It can be used to specify the DisplayName of the template file that will be extracted. String String TemplateImagePreviewUrl It can be used to specify the ImagePreviewUrl of the template file that will be extracted. String String TemplateProperties It can be used to specify custom Properties for the template file that will be extracted. Hashtable Hashtable TemplateProviderExtensions Allows you to specify ITemplateProviderExtension to execute while extracting a template. ITemplateProviderExtension[] ITemplateProviderExtension[] Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Get-PnPProvisioningTemplate -Out template.pnp Extracts a provisioning template in Office Open XML from the current web. ------------------EXAMPLE 2--------------------- PS:> Get-PnPProvisioningTemplate -Out template.xml Extracts a provisioning template in XML format from the current web. ------------------EXAMPLE 3--------------------- PS:> Get-PnPProvisioningTemplate -Out template.pnp -Schema V201503 Extracts a provisioning template in Office Open XML from the current web and saves it in the V201503 version of the schema. ------------------EXAMPLE 4--------------------- PS:> Get-PnPProvisioningTemplate -Out template.pnp -IncludeAllTermGroups Extracts a provisioning template in Office Open XML from the current web and includes all term groups, term sets and terms from the Managed Metadata Service Taxonomy. ------------------EXAMPLE 5--------------------- PS:> Get-PnPProvisioningTemplate -Out template.pnp -IncludeSiteCollectionTermGroup Extracts a provisioning template in Office Open XML from the current web and includes the term group currently (if set) assigned to the site collection. ------------------EXAMPLE 6--------------------- PS:> Get-PnPProvisioningTemplate -Out template.pnp -PersistComposedLookFiles Extracts a provisioning template in Office Open XML from the current web and saves the files that make up the composed look to the same folder as where the template is saved. ------------------EXAMPLE 7--------------------- PS:> Get-PnPProvisioningTemplate -Out template.pnp -Handlers Lists, SiteSecurity Extracts a provisioning template in Office Open XML from the current web, but only processes lists and site security when generating the template. ------------------EXAMPLE 8--------------------- PS:> $handler1 = New-PnPExtensibilityHandlerObject -Assembly Contoso.Core.Handlers -Type Contoso.Core.Handlers.MyExtensibilityHandler1 PS:> $handler2 = New-PnPExtensibilityHandlerObject -Assembly Contoso.Core.Handlers -Type Contoso.Core.Handlers.MyExtensibilityHandler1 PS:> Get-PnPProvisioningTemplate -Out NewTemplate.xml -ExtensibilityHandlers $handler1,$handler2 This will create two new ExtensibilityHandler objects that are run during extraction of the template ------------------EXAMPLE 9--------------------- Only supported on SP2016 and SP Online PS:> Get-PnPProvisioningTemplate -Out template.pnp -PersistMultiLanguageResources Extracts a provisioning template in Office Open XML from the current web, and for supported artifacts it will create a resource file for each supported language (based upon the language settings of the current web). The generated resource files will be named after the value specified in the Out parameter. For instance if the Out parameter is specified as -Out 'template.xml' the generated resource file will be called 'template.en-US.resx'. ------------------EXAMPLE 10--------------------- Only supported on SP2016 and SP Online PS:> Get-PnPProvisioningTemplate -Out template.pnp -PersistMultiLanguageResources -ResourceFilePrefix MyResources Extracts a provisioning template in Office Open XML from the current web, and for supported artifacts it will create a resource file for each supported language (based upon the language settings of the current web). The generated resource files will be named 'MyResources.en-US.resx' etc. ------------------EXAMPLE 11--------------------- PS:> $template = Get-PnPProvisioningTemplate -OutputInstance Extracts an instance of a provisioning template object from the current web. This syntax cannot be used together with the -Out parameter, but it can be used together with any other supported parameters. ------------------EXAMPLE 12--------------------- PS:> Get-PnPProvisioningTemplate -Out template.pnp -ContentTypeGroups "Group A","Group B" Extracts a provisioning template in Office Open XML from the current web, but only processes content types from the to given content type groups. ------------------EXAMPLE 13--------------------- PS:> Get-PnPProvisioningTemplate -Out template.pnp -ExcludeContentTypesFromSyndication Extracts a provisioning template in Office Open XML from the current web, excluding content types provisioned through content type syndication (content type hub), in order to prevent provisioning errors if the target also provision the content type using syndication. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Encoding: https://msdn.microsoft.com/en-us/library/system.text.encoding_properties.aspx Get-PnPProvisioningTemplateFromGallery Retrieves or searches provisioning templates from the PnP Template Gallery Get PnPProvisioningTemplateFromGallery Get-PnPProvisioningTemplateFromGallery Identity Guid Path String Force SwitchParameter Get-PnPProvisioningTemplateFromGallery Search String TargetPlatform TargetPlatform TargetScope TargetScope Force SwitchParameter SwitchParameter Identity Guid Guid Path String String Search String String TargetPlatform TargetPlatform TargetPlatform TargetScope TargetScope TargetScope ------------------EXAMPLE 1--------------------- Get-PnPProvisioningTemplateFromGallery Retrieves all templates from the gallery ------------------EXAMPLE 2--------------------- Get-PnPProvisioningTemplateFromGallery -Search "Data" Searches for a templates containing the word 'Data' in the Display Name ------------------EXAMPLE 3--------------------- Get-PnPProvisioningTemplateFromGallery -Identity ae925674-8aa6-438b-acd0-d2699a022edd Retrieves a template with the specified ID ------------------EXAMPLE 4--------------------- $template = Get-PnPProvisioningTemplateFromGallery -Identity ae925674-8aa6-438b-acd0-d2699a022edd Apply-PnPProvisioningTemplate -InputInstance $template Retrieves a template with the specified ID and applies it to the site. ------------------EXAMPLE 5--------------------- $template = Get-PnPProvisioningTemplateFromGallery -Identity ae925674-8aa6-438b-acd0-d2699a022edd -Path c:\temp Retrieves a template with the specified ID and saves the template to the specified path SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Get-PnPPublishingImageRendition Returns all image renditions or if Identity is specified a specific one Get PnPPublishingImageRendition Get-PnPPublishingImageRendition Identity Id or name of an existing image rendition ImageRenditionPipeBind Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Identity Id or name of an existing image rendition ImageRenditionPipeBind ImageRenditionPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind Microsoft.SharePoint.Client.Publishing.ImageRendition ------------------EXAMPLE 1--------------------- PS:> Get-PnPPublishingImageRendition Returns all Image Renditions ------------------EXAMPLE 2--------------------- PS:> Get-PnPPublishingImageRendition -Identity "Test" Returns the image rendition named "Test" ------------------EXAMPLE 3--------------------- PS:> Get-PnPPublishingImageRendition -Identity 2 Returns the image rendition where its id equals 2 SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Get-PnPRecycleBinItem Returns the items in the recycle bin from the context Get PnPRecycleBinItem Get-PnPRecycleBinItem Identity Returns a recycle bin item with a specific identity GuidPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Get-PnPRecycleBinItem FirstStage Return all items in the first stage recycle bin SwitchParameter Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Get-PnPRecycleBinItem SecondStage Return all items in the second stage recycle bin SwitchParameter Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Get-PnPRecycleBinItem Includes Specify properties to include when retrieving objects from the server. String[] Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection FirstStage Return all items in the first stage recycle bin SwitchParameter SwitchParameter Identity Returns a recycle bin item with a specific identity GuidPipeBind GuidPipeBind Includes Specify properties to include when retrieving objects from the server. String[] String[] SecondStage Return all items in the second stage recycle bin SwitchParameter SwitchParameter Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Microsoft.SharePoint.Client.RecycleBinItem ------------------EXAMPLE 1--------------------- PS:> Get-PnPRecycleBinItem Returns all items in both the first and the second stage recycle bins in the current site collection ------------------EXAMPLE 2--------------------- PS:> Get-PnPRecycleBinItem -Identity f3ef6195-9400-4121-9d1c-c997fb5b86c2 Returns all a specific recycle bin item by id ------------------EXAMPLE 3--------------------- PS:> Get-PnPRecycleBinItem -FirstStage Returns all items in only the first stage recycle bin in the current site collection ------------------EXAMPLE 4--------------------- PS:> Get-PnPRecycleBinItem -SecondStage Returns all items in only the second stage recycle bin in the current site collection SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Get-PnPRequestAccessEmails * Supported in: SharePoint Online. Returns the request access e-mail addresses Get PnPRequestAccessEmails Get-PnPRequestAccessEmails Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind List<System.String> ------------------EXAMPLE 1--------------------- PS:> Get-PnPRequestAccessEmails This will return all the request access e-mail addresses for the current web SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Get-PnPRoleDefinition Retrieves a Role Definitions of a site Get PnPRoleDefinition Get-PnPRoleDefinition Identity The name of a role definition to retrieve. RoleDefinitionPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Identity The name of a role definition to retrieve. RoleDefinitionPipeBind RoleDefinitionPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Microsoft.SharePoint.Client.RoleDefinition ------------------EXAMPLE 1--------------------- PS:> Get-PnPRoleDefinition Retrieves the Role Definitions (Permission Levels) settings of the current site ------------------EXAMPLE 2--------------------- PS:> Get-PnPRoleDefinition -Identity Read Retrieves the specified Role Definition (Permission Level) settings of the current site SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Get-PnPSearchConfiguration Returns the search configuration Get PnPSearchConfiguration Get-PnPSearchConfiguration Path Local path where the search configuration will be saved String Scope Scope to use. Either Web, Site, or Subscription. Defaults to Web SearchConfigurationScope Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Get-PnPSearchConfiguration OutputFormat Output format for of the configuration. Defaults to complete XML OutputFormat Scope Scope to use. Either Web, Site, or Subscription. Defaults to Web SearchConfigurationScope Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection OutputFormat Output format for of the configuration. Defaults to complete XML OutputFormat OutputFormat Path Local path where the search configuration will be saved String String Scope Scope to use. Either Web, Site, or Subscription. Defaults to Web SearchConfigurationScope SearchConfigurationScope Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind System.String Does not return a string when the -Path parameter has been specified. ------------------EXAMPLE 1--------------------- PS:> Get-PnPSearchConfiguration Returns the search configuration for the current web ------------------EXAMPLE 2--------------------- PS:> Get-PnPSearchConfiguration -Scope Site Returns the search configuration for the current site collection ------------------EXAMPLE 3--------------------- PS:> Get-PnPSearchConfiguration -Scope Subscription Returns the search configuration for the current tenant ------------------EXAMPLE 4--------------------- PS:> Get-PnPSearchConfiguration -Path searchconfig.xml -Scope Subscription Returns the search configuration for the current tenant and saves it to the specified file ------------------EXAMPLE 5--------------------- PS:> Get-PnPSearchConfiguration -Scope Site -OutputFormat ManagedPropertyMappings Returns all custom managed properties and crawled property mapping at the current site collection SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Get-PnPSite Returns the current site collection from the context. Get PnPSite Get-PnPSite Includes Specify properties to include when retrieving objects from the server. String[] Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Includes Specify properties to include when retrieving objects from the server. String[] String[] Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Microsoft.SharePoint.Client.Site ------------------EXAMPLE 1--------------------- PS:> Get-PnPSite Gets the current site SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Get-PnPSiteClassification * Supported in: SharePoint Online. Returns the defined Site Classifications for the tenant. Requires a connection to the Microsoft Graph. Get PnPSiteClassification ------------------EXAMPLE 1--------------------- PS:> Connect-PnPOnline -Scopes "Directory.ReadWrite.All" PS:> Get-PnPSiteClassification Returns the currently set site classifications for the tenant. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Get-PnPSiteClosure Get the site closure status of the site which has a site policy applied Get PnPSiteClosure Get-PnPSiteClosure Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Get-PnPSiteClosure Get the site closure status of the site. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Get-PnPSiteCollectionAdmin Returns the current site collection administrators of the site colleciton in the current context Get PnPSiteCollectionAdmin This command will return all current site collection administrators of the site collection in the current context Get-PnPSiteCollectionAdmin Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Get-PnPSiteCollectionAdmin This will return all the current site collection administrators of the site collection in the current context SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Get-PnPSiteDesign * Supported in: SharePoint Online. Retrieve Site Designs that have been registered on the current tenant. Get PnPSiteDesign Get-PnPSiteDesign Identity If specified will retrieve the specified site design TenantSiteDesignPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Identity If specified will retrieve the specified site design TenantSiteDesignPipeBind TenantSiteDesignPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection ------------------EXAMPLE 1--------------------- PS:> Get-PnPSiteDesign Returns all registered site designs ------------------EXAMPLE 2--------------------- PS:> Get-PnPSiteDesign -Identity 5c73382d-9643-4aa0-9160-d0cba35e40fd Returns a specific registered site designs SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Get-PnPSiteDesignRights * Supported in: SharePoint Online. Returns the principals with design rights on a specific Site Design Get PnPSiteDesignRights Get-PnPSiteDesignRights Identity The ID of the Site Design to receive the rights for TenantSiteDesignPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Identity The ID of the Site Design to receive the rights for TenantSiteDesignPipeBind TenantSiteDesignPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection ------------------EXAMPLE 1--------------------- PS:> Get-PnPSiteDesignRights -Identity 5c73382d-9643-4aa0-9160-d0cba35e40fd Returns the principals with rights on a specific site design SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Get-PnPSitePolicy Retrieves all or a specific site policy Get PnPSitePolicy Get-PnPSitePolicy AllAvailable Retrieve all available site policies SwitchParameter Name Retrieves a site policy with a specific name String Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection AllAvailable Retrieve all available site policies SwitchParameter SwitchParameter Name Retrieves a site policy with a specific name String String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind OfficeDevPnP.Core.Entities.SitePolicyEntity ------------------EXAMPLE 1--------------------- PS:> Get-PnPSitePolicy Retrieves the current applied site policy. ------------------EXAMPLE 2--------------------- PS:> Get-PnPSitePolicy -AllAvailable Retrieves all available site policies. ------------------EXAMPLE 3--------------------- PS:> Get-PnPSitePolicy -Name "Contoso HBI" Retrieves an available site policy with the name "Contoso HBI". SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Get-PnPSiteScript * Supported in: SharePoint Online. Retrieve Site Scripts that have been registered on the current tenant. Get PnPSiteScript Get-PnPSiteScript Identity If specified will retrieve the specified site script TenantSiteScriptPipeBind SiteDesign If specified will retrieve the site scripts for this design TenantSiteDesignPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Identity If specified will retrieve the specified site script TenantSiteScriptPipeBind TenantSiteScriptPipeBind SiteDesign If specified will retrieve the site scripts for this design TenantSiteDesignPipeBind TenantSiteDesignPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection ------------------EXAMPLE 1--------------------- PS:> Get-PnPSiteScript Returns all registered site scripts ------------------EXAMPLE 2--------------------- PS:> Get-PnPSiteScript -Identity 5c73382d-9643-4aa0-9160-d0cba35e40fd Returns a specific registered site script SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Get-PnPSiteSearchQueryResults Executes a search query to retrieve indexed site collections Get PnPSiteSearchQueryResults Get-PnPSiteSearchQueryResults StartRow Search result item to start returning the results from. Useful for paging. Leave at 0 to return all results. Int32 MaxResults Maximum amount of search results to return. Default and max is 500 search results. Int32 Query Search query in Keyword Query Language (KQL) to execute to refine the returned sites. If omitted, all indexed sites will be returned. String Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Get-PnPSiteSearchQueryResults All Automatically page results until the end to get more than 500 sites. Use with caution! SwitchParameter Query Search query in Keyword Query Language (KQL) to execute to refine the returned sites. If omitted, all indexed sites will be returned. String Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection All Automatically page results until the end to get more than 500 sites. Use with caution! SwitchParameter SwitchParameter MaxResults Maximum amount of search results to return. Default and max is 500 search results. Int32 Int32 Query Search query in Keyword Query Language (KQL) to execute to refine the returned sites. If omitted, all indexed sites will be returned. String String StartRow Search result item to start returning the results from. Useful for paging. Leave at 0 to return all results. Int32 Int32 Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind List<System.Object> ------------------EXAMPLE 1--------------------- PS:> Get-PnPSiteSearchQueryResults Returns the top 500 site collections indexed by SharePoint Search ------------------EXAMPLE 2--------------------- PS:> Get-PnPSiteSearchQueryResults -Query "WebTemplate:STS" Returns the top 500 site collections indexed by SharePoint Search which have are based on the STS (Team Site) template ------------------EXAMPLE 3--------------------- PS:> Get-PnPSiteSearchQueryResults -Query "WebTemplate:SPSPERS" Returns the top 500 site collections indexed by SharePoint Search which have are based on the SPSPERS (MySite) template, up to the MaxResult limit ------------------EXAMPLE 4--------------------- PS:> Get-PnPSiteSearchQueryResults -Query "Title:Intranet*" Returns the top 500 site collections indexed by SharePoint Search of which the title starts with the word Intranet ------------------EXAMPLE 5--------------------- PS:> Get-PnPSiteSearchQueryResults -MaxResults 10 Returns the top 10 site collections indexed by SharePoint Search ------------------EXAMPLE 6--------------------- PS:> Get-PnPSiteSearchQueryResults -All Returns absolutely all site collections indexed by SharePoint Search SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Get-PnPContext Returns the current context Get PnPContext Returns a Client Side Object Model context Microsoft.SharePoint.Client.ClientContext ------------------EXAMPLE 1--------------------- PS:> $ctx = Get-PnPContext This will put the current context in the $ctx variable. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Get-PnPStoredCredential Get a credential Get PnPStoredCredential Returns a stored credential from the Windows Credential Manager Get-PnPStoredCredential Name The credential to retrieve. String Type The object type of the credential to return from the Credential Manager. Possible valus are 'O365', 'OnPrem' or 'PSCredential' CredentialType Name The credential to retrieve. String String Type The object type of the credential to return from the Credential Manager. Possible valus are 'O365', 'OnPrem' or 'PSCredential' CredentialType CredentialType ------------------EXAMPLE 1--------------------- PS:> Get-PnPStoredCredential -Name O365 Returns the credential associated with the specified identifier ------------------EXAMPLE 2--------------------- PS:> Get-PnPStoredCredential -Name testEnvironment -Type OnPrem Gets the credential associated with the specified identifier from the credential manager and then will return a credential that can be used for on-premises authentication SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Get-PnPSubWebs Returns the subwebs of the current web Get PnPSubWebs Get-PnPSubWebs Recurse If provided, recursion through all subsites and their childs will take place to return them as well SwitchParameter Web The web to apply the command to. Omit this parameter to use the current web. WebPipeBind Includes Specify properties to include when retrieving objects from the server. String[] Identity If provided, only the subsite with the provided Id, GUID or the Web instance will be returned WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Identity If provided, only the subsite with the provided Id, GUID or the Web instance will be returned WebPipeBind WebPipeBind Includes Specify properties to include when retrieving objects from the server. String[] String[] Recurse If provided, recursion through all subsites and their childs will take place to return them as well SwitchParameter SwitchParameter Web The web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Microsoft.SharePoint.Client.Web ------------------EXAMPLE 1--------------------- PS:> Get-PnPSubWebs Retrieves all subsites of the current context returning the Id, Url, Title and ServerRelativeUrl of each subsite in the output ------------------EXAMPLE 2--------------------- PS:> Get-PnPSubWebs -Recurse Retrieves all subsites of the current context and all of their nested child subsites returning the Id, Url, Title and ServerRelativeUrl of each subsite in the output ------------------EXAMPLE 3--------------------- PS:> Get-PnPSubWebs -Recurse -Includes "WebTemplate","Description" | Select ServerRelativeUrl, WebTemplate, Description Retrieves all subsites of the current context and shows the ServerRelativeUrl, WebTemplate and Description properties in the resulting output ------------------EXAMPLE 4--------------------- PS:> Get-PnPSubWebs -Identity Team1 -Recurse Retrieves all subsites of the subsite Team1 and all of its nested child subsites returning the Id, Url, Title and ServerRelativeUrl of each subsite in the output SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Get-PnPTaxonomyItem Returns a taxonomy item Get PnPTaxonomyItem Get-PnPTaxonomyItem TermPath The path, delimited by | of the taxonomy item to retrieve, alike GROUPLABEL|TERMSETLABEL|TERMLABEL String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection TermPath The path, delimited by | of the taxonomy item to retrieve, alike GROUPLABEL|TERMSETLABEL|TERMLABEL String String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Microsoft.SharePoint.Client.Taxonomy.TaxonomyItem SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Get-PnPTaxonomySession Returns a taxonomy session Get PnPTaxonomySession Get-PnPTaxonomySession Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind Microsoft.SharePoint.Client.Taxonomy.TaxonomySession SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Get-PnPTenant * Supported in: SharePoint Online. Returns organization-level site collection properties Get PnPTenant Returns organization-level site collection properties such as StorageQuota, StorageQuotaAllocated, ResourceQuota, ResourceQuotaAllocated, and SiteCreationMode. Currently, there are no parameters for this cmdlet. You must be a SharePoint Online global administrator to run the cmdlet. Get-PnPTenant Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection ------------------EXAMPLE 1--------------------- PS:> Get-PnPTenant This example returns all tenant settings SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Get-PnPTenantAppCatalogUrl * Supported in: SharePoint Online. Retrieves the url of the tenant scoped app catalog. Get PnPTenantAppCatalogUrl Get-PnPTenantAppCatalogUrl Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection ------------------EXAMPLE 1--------------------- PS:> Get-PnPTenantAppCatalogUrl Returns the url of the tenant scoped app catalog site collection SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Get-PnPTenantCdnEnabled * Supported in: SharePoint Online. Retrieves if the Office 365 Content Delivery Network has been enabled. Get PnPTenantCdnEnabled Enables or disabled the public or private Office 365 Content Delivery Network (CDN). Get-PnPTenantCdnEnabled CdnType The type of cdn to retrieve the origins from SPOTenantCdnType Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection CdnType The type of cdn to retrieve the origins from SPOTenantCdnType SPOTenantCdnType Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection ------------------EXAMPLE 1--------------------- PS:> Get-PnPTenantCdnEnabled -CdnType Public Returns the enabled status of the specified CDN SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Get-PnPTenantCdnOrigin * Supported in: SharePoint Online. Returns the current registered origins from the public or private content delivery network (CDN). Get PnPTenantCdnOrigin Returns the current registered origins from the public or private content delivery network (CDN). Get-PnPTenantCdnOrigin CdnType The type of cdn to retrieve the origins from SPOTenantCdnType Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection CdnType The type of cdn to retrieve the origins from SPOTenantCdnType SPOTenantCdnType Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection ------------------EXAMPLE 1--------------------- PS:> Get-PnPTenantCdnOrigin -CdnType Public Returns the configured CDN origins for the specified CDN type SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Get-PnPTenantCdnPolicies * Supported in: SharePoint Online. Returns the CDN Policies for the specified CDN (Public | Private). Get PnPTenantCdnPolicies Enables or disabled the public or private Office 365 Content Delivery Network (CDN). Get-PnPTenantCdnPolicies CdnType The type of cdn to retrieve the policies from SPOTenantCdnType Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection CdnType The type of cdn to retrieve the policies from SPOTenantCdnType SPOTenantCdnType Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection ------------------EXAMPLE 1--------------------- PS:> Get-PnPTenantCdnPolicies -CdnType Public Returns the policies for the specified CDN type SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Get-PnPTenantRecycleBinItem * Supported in: SharePoint Online. Returns the items in the tenant scoped recycle bin Get PnPTenantRecycleBinItem This command will return all the items in the tenant recycle bin for the Office 365 tenant you are connected to. Be sure to connect to the SharePoint Online Admin endpoint (https://yourtenantname-admin.sharepoint.com) in order for this command to work. Get-PnPTenantRecycleBinItem Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Microsoft.Online.SharePoint.TenantAdministration.DeletedSiteProperties ------------------EXAMPLE 1--------------------- PS:> Get-PnPTenantRecycleBinItem Returns all site collections in the tenant scoped recycle bin SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Get-PnPTenantSite * Supported in: SharePoint Online. Retrieve site information. Get PnPTenantSite Use this cmdlet to retrieve site information from your tenant administration. Get-PnPTenantSite Template By default, all sites will be returned. Specify a template value alike "STS#0" here to filter on the template String Detailed By default, not all returned attributes are populated. This switch populates all attributes. It can take several seconds to run. Without this, some attributes will show default values that may not be correct. SwitchParameter IncludeOneDriveSites By default, the OneDrives are not returned. This switch includes all OneDrives. SwitchParameter Filter Specifies the script block of the server-side filter to apply. See https://technet.microsoft.com/en-us/library/fp161380.aspx String Url The URL of the site String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Detailed By default, not all returned attributes are populated. This switch populates all attributes. It can take several seconds to run. Without this, some attributes will show default values that may not be correct. SwitchParameter SwitchParameter Filter Specifies the script block of the server-side filter to apply. See https://technet.microsoft.com/en-us/library/fp161380.aspx String String IncludeOneDriveSites By default, the OneDrives are not returned. This switch includes all OneDrives. SwitchParameter SwitchParameter Template By default, all sites will be returned. Specify a template value alike "STS#0" here to filter on the template String String Url The URL of the site String String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Microsoft.Online.SharePoint.TenantAdministration.SiteProperties ------------------EXAMPLE 1--------------------- PS:> Get-PnPTenantSite Returns all site collections ------------------EXAMPLE 2--------------------- PS:> Get-PnPTenantSite -Url http://tenant.sharepoint.com/sites/projects Returns information about the project site ------------------EXAMPLE 3--------------------- PS:> Get-PnPTenantSite -Detailed Returns all sites with the full details of these sites ------------------EXAMPLE 4--------------------- PS:> Get-PnPTenantSite -IncludeOneDriveSites Returns all sites including all OneDrive for Business sites ------------------EXAMPLE 5--------------------- PS:> Get-PnPTenantSite -IncludeOneDriveSites -Filter "Url -like '-my.sharepoint.com/personal/'" Returns all OneDrive for Business sites ------------------EXAMPLE 6--------------------- PS:> Get-PnPTenantSite -Template SITEPAGEPUBLISHING#0 Returns all Communication sites ------------------EXAMPLE 7--------------------- PS:> Get-PnPTenantSite -Filter "Url -like 'sales'" Returns all sites including 'sales' in the url SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Get-PnPTenantTheme * Supported in: SharePoint Online. Returns all or a specific theme Get PnPTenantTheme Returns all or a specific tenant theme. Get-PnPTenantTheme Name The name of the theme to retrieve String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Name The name of the theme to retrieve String String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection ------------------EXAMPLE 1--------------------- PS:> Get-PnPTenantTheme Returns all themes ------------------EXAMPLE 2--------------------- PS:> Get-PnPTenantTheme -Name "MyCompanyTheme" Returns the specified theme SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Get-PnPTerm Returns a taxonomy term Get PnPTerm Get-PnPTerm TermSet Name of the termset to check. Id, Title or TaxonomyItem TermGroup Name of the termgroup to check. Id, Title or TermGroup Identity The Id or Name of a Term Id, Name or Object TermStore Term store to check; if not specified the default term store is used. Id, Name or Object Recursive Find the first term recursivly matching the label in a term hierarchy. SwitchParameter Includes Specify properties to include when retrieving objects from the server. String[] Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Identity The Id or Name of a Term Id, Name or Object Id, Name or Object Includes Specify properties to include when retrieving objects from the server. String[] String[] Recursive Find the first term recursivly matching the label in a term hierarchy. SwitchParameter SwitchParameter TermGroup Name of the termgroup to check. Id, Title or TermGroup Id, Title or TermGroup TermSet Name of the termset to check. Id, Title or TaxonomyItem Id, Title or TaxonomyItem TermStore Term store to check; if not specified the default term store is used. Id, Name or Object Id, Name or Object Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Microsoft.SharePoint.Client.Taxonomy.Term ------------------EXAMPLE 1--------------------- PS:> Get-PnPTerm -TermSet "Departments" -TermGroup "Corporate" Returns all term in the termset "Departments" which is in the group "Corporate" from the site collection termstore ------------------EXAMPLE 2--------------------- PS:> Get-PnPTerm -Identity "Finance" -TermSet "Departments" -TermGroup "Corporate" Returns the term named "Finance" in the termset "Departments" from the termgroup called "Corporate" from the site collection termstore ------------------EXAMPLE 3--------------------- PS:> Get-PnPTerm -Identity ab2af486-e097-4b4a-9444-527b251f1f8d -TermSet "Departments" -TermGroup "Corporate" Returns the term named with the given id, from the "Departments" termset in a term group called "Corporate" from the site collection termstore ------------------EXAMPLE 4--------------------- PS:> Get-PnPTerm -Identity "Small Finance" -TermSet "Departments" -TermGroup "Corporate" -Recursive Returns the term named "Small Finance", from the "Departments" termset in a term group called "Corporate" from the site collection termstore even if it's a subterm below "Finance" SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Get-PnPTermGroup Returns a taxonomy term group Get PnPTermGroup Get-PnPTermGroup TermStore Term store to check; if not specified the default term store is used. Id, Name or Object Includes Specify properties to include when retrieving objects from the server. String[] Identity Name of the taxonomy term group to retrieve. Id, Title or TaxonomyItem Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Identity Name of the taxonomy term group to retrieve. Id, Title or TaxonomyItem Id, Title or TaxonomyItem Includes Specify properties to include when retrieving objects from the server. String[] String[] TermStore Term store to check; if not specified the default term store is used. Id, Name or Object Id, Name or Object Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Microsoft.SharePoint.Client.Taxonomy.TermGroup ------------------EXAMPLE 1--------------------- PS:> Get-PnPTermGroup Returns all Term Groups in the site collection termstore ------------------EXAMPLE 2--------------------- PS:> Get-PnPTermGroup -Identity "Departments" Returns the termgroup named "Departments" from the site collection termstore ------------------EXAMPLE 3--------------------- PS:> Get-PnPTermGroup -Identity ab2af486-e097-4b4a-9444-527b251f1f8d Returns the termgroup with the given ID from the site collection termstore SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Get-PnPTermSet Returns a taxonomy term set Get PnPTermSet Get-PnPTermSet TermGroup Name of the term group to check. Id, Title or TermGroup Identity The Id or Name of a termset Id, Name or Object TermStore Term store to check; if not specified the default term store is used. Id, Name or Object Includes Specify properties to include when retrieving objects from the server. String[] Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Identity The Id or Name of a termset Id, Name or Object Id, Name or Object Includes Specify properties to include when retrieving objects from the server. String[] String[] TermGroup Name of the term group to check. Id, Title or TermGroup Id, Title or TermGroup TermStore Term store to check; if not specified the default term store is used. Id, Name or Object Id, Name or Object Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Microsoft.SharePoint.Client.Taxonomy.TermSet ------------------EXAMPLE 1--------------------- PS:> Get-PnPTermSet -TermGroup "Corporate" Returns all termsets in the group "Corporate" from the site collection termstore ------------------EXAMPLE 2--------------------- PS:> Get-PnPTermSet -Identity "Departments" -TermGroup "Corporate" Returns the termset named "Departments" from the termgroup called "Corporate" from the site collection termstore ------------------EXAMPLE 3--------------------- PS:> Get-PnPTermSet -Identity ab2af486-e097-4b4a-9444-527b251f1f8d -TermGroup "Corporate Returns the termset with the given id from the termgroup called "Corporate" from the site collection termstore SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Get-PnPTheme Returns the current theme/composed look of the current web. Get PnPTheme Get-PnPTheme DetectCurrentComposedLook Specify this switch to not use the PnP Provisioning engine based composed look information but try to detect the current composed look as is. SwitchParameter Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection DetectCurrentComposedLook Specify this switch to not use the PnP Provisioning engine based composed look information but try to detect the current composed look as is. SwitchParameter SwitchParameter Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind OfficeDevPnP.Core.Entities.ThemeEntity ------------------EXAMPLE 1--------------------- PS:> Get-PnPTheme Returns the current composed look of the current web. ------------------EXAMPLE 2--------------------- PS:> Get-PnPTheme -DetectCurrentComposedLook Returns the current composed look of the current web, and will try to detect the currently applied composed look based upon the actual site. Without this switch the cmdlet will first check for the presence of a property bag variable called _PnP_ProvisioningTemplateComposedLookInfo that contains composed look information when applied through the provisioning engine or the Set-PnPTheme cmdlet. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Get-PnPTimeZoneId Returns a time zone ID Get PnPTimeZoneId In order to create a new classic site you need to specify the timezone this site will use. Use the cmdlet to retrieve a list of possible values. Get-PnPTimeZoneId Match A string to search for like 'Stockholm' String Match A string to search for like 'Stockholm' String String List<SharePointPnP.PowerShell.Commands.GetTimeZoneId+Zone> Returns a list of matching zones. Use the ID property of the object for use in New-SPOTenantSite ------------------EXAMPLE 1--------------------- PS:> Get-PnPTimeZoneId This will return all time zone IDs in use by Office 365. ------------------EXAMPLE 2--------------------- PS:> Get-PnPTimeZoneId -Match Stockholm This will return the time zone IDs for Stockholm SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Get-PnPUnifiedGroup * Supported in: SharePoint Online. Gets one Office 365 Group (aka Unified Group) or a list of Office 365 Groups Get PnPUnifiedGroup Get-PnPUnifiedGroup Identity The Identity of the Office 365 Group. UnifiedGroupPipeBind ExcludeSiteUrl Exclude fetching the site URL for Office 365 Groups. This speeds up large listings. SwitchParameter ExcludeSiteUrl Exclude fetching the site URL for Office 365 Groups. This speeds up large listings. SwitchParameter SwitchParameter Identity The Identity of the Office 365 Group. UnifiedGroupPipeBind UnifiedGroupPipeBind ------------------EXAMPLE 1--------------------- PS:> Get-PnPUnifiedGroup Retrieves all the Office 365 Groups ------------------EXAMPLE 2--------------------- PS:> Get-PnPUnifiedGroup -Identity $groupId Retrieves a specific Office 365 Group based on its ID ------------------EXAMPLE 3--------------------- PS:> Get-PnPUnifiedGroup -Identity $groupDisplayName Retrieves a specific or list of Office 365 Groups that start with the given DisplayName ------------------EXAMPLE 4--------------------- PS:> Get-PnPUnifiedGroup -Identity $groupSiteMailNickName Retrieves a specific or list of Office 365 Groups for which the email starts with the provided mail nickName ------------------EXAMPLE 5--------------------- PS:> Get-PnPUnifiedGroup -Identity $group Retrieves a specific Office 365 Group based on its object instance SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Get-PnPUnifiedGroupMembers * Supported in: SharePoint Online. Gets members of a paricular Office 365 Group (aka Unified Group) Get PnPUnifiedGroupMembers Get-PnPUnifiedGroupMembers Identity The Identity of the Office 365 Group. UnifiedGroupPipeBind Identity The Identity of the Office 365 Group. UnifiedGroupPipeBind UnifiedGroupPipeBind ------------------EXAMPLE 1--------------------- PS:> Get-PnPUnifiedGroupMembers -Identity $groupId Retrieves all the members of a specific Office 365 Group based on its ID ------------------EXAMPLE 2--------------------- PS:> Get-PnPUnifiedGroupMembers -Identity $group Retrieves all the members of a specific Office 365 Group based on the group's object instance SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Get-PnPUnifiedGroupOwners * Supported in: SharePoint Online. Gets owners of a paricular Office 365 Group (aka Unified Group) Get PnPUnifiedGroupOwners Get-PnPUnifiedGroupOwners Identity The Identity of the Office 365 Group. UnifiedGroupPipeBind Identity The Identity of the Office 365 Group. UnifiedGroupPipeBind UnifiedGroupPipeBind ------------------EXAMPLE 1--------------------- PS:> Get-PnPUnifiedGroupOwners -Identity $groupId Retrieves all the owners of a specific Office 365 Group based on its ID ------------------EXAMPLE 2--------------------- PS:> Get-PnPUnifiedGroupOwners -Identity $group Retrieves all the owners of a specific Office 365 Group based on the group's object instance SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Get-PnPUser Returns site users of current web Get PnPUser This command will return all the users that exist in the current site collection its User Information List Get-PnPUser Identity User ID or login name UserPipeBind WithRightsAssigned If provided, only users that currently have any kinds of access rights assigned to the current site collection will be returned. Otherwise all users, even those who previously had rights assigned, but not anymore at the moment, will be returned as the information is pulled from the User Information List. Only works if you don't provide an -Identity. SwitchParameter Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Identity User ID or login name UserPipeBind UserPipeBind WithRightsAssigned If provided, only users that currently have any kinds of access rights assigned to the current site collection will be returned. Otherwise all users, even those who previously had rights assigned, but not anymore at the moment, will be returned as the information is pulled from the User Information List. Only works if you don't provide an -Identity. SwitchParameter SwitchParameter Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind Microsoft.SharePoint.Client.User ------------------EXAMPLE 1--------------------- PS:> Get-PnPUser Returns all users from the User Information List of the current site collection regardless if they currently have rights to access the current site ------------------EXAMPLE 2--------------------- PS:> Get-PnPUser -Identity 23 Returns the user with Id 23 from the User Information List of the current site collection ------------------EXAMPLE 3--------------------- PS:> Get-PnPUser -Identity i:0#.f|membership|user@tenant.onmicrosoft.com Returns the user with LoginName i:0#.f|membership|user@tenant.onmicrosoft.com from the User Information List of the current site collection ------------------EXAMPLE 4--------------------- PS:> Get-PnPUser | ? Email -eq "user@tenant.onmicrosoft.com" Returns the user with e-mail address user@tenant.onmicrosoft.com from the User Information List of the current site collection ------------------EXAMPLE 5--------------------- PS:> Get-PnPUser -WithRightsAssigned Returns only those users from the User Information List of the current site collection who currently have any kind of access rights given either directly to the user or Active Directory Group or given to the user or Active Directory Group via membership of a SharePoint Group to the current site ------------------EXAMPLE 6--------------------- PS:> Get-PnPUser -WithRightsAssigned -Web subsite1 Returns only those users from the User Information List of the current site collection who currently have any kind of access rights given either directly to the user or Active Directory Group or given to the user or Active Directory Group via membership of a SharePoint Group to subsite 'subsite1' SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Get-PnPUserProfileProperty You must connect to the tenant admin website (https://:<tenant>-admin.sharepoint.com) with Connect-PnPOnline in order to use this cmdlet. Get PnPUserProfileProperty Requires a connection to a SharePoint Tenant Admin site. Get-PnPUserProfileProperty Account The account of the user, formatted either as a login name, or as a claims identity, e.g. i:0#.f|membership|user@domain.com String[] Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Account The account of the user, formatted either as a login name, or as a claims identity, e.g. i:0#.f|membership|user@domain.com String[] String[] Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Microsoft.SharePoint.Client.UserProfiles.PersonProperties ------------------EXAMPLE 1--------------------- PS:> Get-PnPUserProfileProperty -Account 'user@domain.com' Returns the profile properties for the specified user ------------------EXAMPLE 2--------------------- PS:> Get-PnPUserProfileProperty -Account 'user@domain.com','user2@domain.com' Returns the profile properties for the specified users SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Get-PnPView Returns one or all views from a list Get PnPView Get-PnPView List The ID or Url of the list. ListPipeBind Identity The ID or name of the view ViewPipeBind Web The web to apply the command to. Omit this parameter to use the current web. WebPipeBind Includes Specify properties to include when retrieving objects from the server. String[] Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Identity The ID or name of the view ViewPipeBind ViewPipeBind Includes Specify properties to include when retrieving objects from the server. String[] String[] List The ID or Url of the list. ListPipeBind ListPipeBind Web The web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Microsoft.SharePoint.Client.View ------------------EXAMPLE 1--------------------- Get-PnPView -List "Demo List" Returns all views associated from the specified list ------------------EXAMPLE 2--------------------- Get-PnPView -List "Demo List" -Identity "Demo View" Returns the view called "Demo View" from the specified list ------------------EXAMPLE 3--------------------- Get-PnPView -List "Demo List" -Identity "5275148a-6c6c-43d8-999a-d2186989a661" Returns the view with the specified ID from the specified list SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Get-PnPWeb Returns the current web object Get PnPWeb Get-PnPWeb Includes Specify properties to include when retrieving objects from the server. String[] Identity The guid of the web or web object WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Identity The guid of the web or web object WebPipeBind WebPipeBind Includes Specify properties to include when retrieving objects from the server. String[] String[] Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Microsoft.SharePoint.Client.Web ------------------EXAMPLE 1--------------------- PS:> Get-PnPWeb This will return the current web SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Get-PnPWebhookSubscriptions * Supported in: SharePoint Online. Gets all the Webhook subscriptions of the resource Get PnPWebhookSubscriptions Get-PnPWebhookSubscriptions List The list object or name to get the Webhook subscriptions from ListPipeBind Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection List The list object or name to get the Webhook subscriptions from ListPipeBind ListPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind OfficeDevPnP.Core.Entities.WebhookSubscription ------------------EXAMPLE 1--------------------- PS:> Get-PnPWebhookSubscriptions -List MyList Gets all Webhook subscriptions of the list MyList SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Get-PnPWebPart Returns a webpart definition object Get PnPWebPart Get-PnPWebPart ServerRelativePageUrl Full server relative URL of the webpart page, e.g. /sites/mysite/sitepages/home.aspx String Identity The identity of the webpart, this can be the webpart guid or an webpart object WebPartPipeBind Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Identity The identity of the webpart, this can be the webpart guid or an webpart object WebPartPipeBind WebPartPipeBind ServerRelativePageUrl Full server relative URL of the webpart page, e.g. /sites/mysite/sitepages/home.aspx String String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind List<Microsoft.SharePoint.Client.WebParts.WebPartDefinition> ------------------EXAMPLE 1--------------------- PS:> Get-PnPWebPart -ServerRelativePageUrl "/sites/demo/sitepages/home.aspx" Returns all webparts defined on the given page. ------------------EXAMPLE 2--------------------- PS:> Get-PnPWebPart -ServerRelativePageUrl "/sites/demo/sitepages/home.aspx" -Identity a2875399-d6ff-43a0-96da-be6ae5875f82 Returns a specific webpart defined on the given page. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Get-PnPWebPartProperty Returns a web part property Get PnPWebPartProperty Get-PnPWebPartProperty ServerRelativePageUrl Full server relative URL of the webpart page, e.g. /sites/mysite/sitepages/home.aspx String Identity The id of the webpart GuidPipeBind Key Name of a single property to be returned String Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Identity The id of the webpart GuidPipeBind GuidPipeBind Key Name of a single property to be returned String String ServerRelativePageUrl Full server relative URL of the webpart page, e.g. /sites/mysite/sitepages/home.aspx String String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Get-PnPWebPartProperty -ServerRelativePageUrl /sites/demo/sitepages/home.aspx -Identity ccd2c98a-c9ae-483b-ae72-19992d583914 Returns all properties of the webpart. ------------------EXAMPLE 2--------------------- PS:> Get-PnPWebPartProperty -ServerRelativePageUrl /sites/demo/sitepages/home.aspx -Identity ccd2c98a-c9ae-483b-ae72-19992d583914 -Key "Title" Returns the title property of the webpart. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Get-PnPWebPartXml Returns the webpart XML of a webpart registered on a site Get PnPWebPartXml Get-PnPWebPartXml ServerRelativePageUrl Full server relative url of the webpart page, e.g. /sites/mysite/sitepages/home.aspx String Identity Id or title of the webpart. Use Get-PnPWebPart to retrieve all webpart Ids WebPartPipeBind Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Identity Id or title of the webpart. Use Get-PnPWebPart to retrieve all webpart Ids WebPartPipeBind WebPartPipeBind ServerRelativePageUrl Full server relative url of the webpart page, e.g. /sites/mysite/sitepages/home.aspx String String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind System.String ------------------EXAMPLE 1--------------------- PS:> Get-PnPWebPartXml -ServerRelativePageUrl "/sites/demo/sitepages/home.aspx" -Identity a2875399-d6ff-43a0-96da-be6ae5875f82 Returns the webpart XML for a given webpart on a page. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Get-PnPWebTemplates * Supported in: SharePoint Online. Returns the available web templates. Get PnPWebTemplates Will list all available templates one can use to create a classic site. Get-PnPWebTemplates Lcid The language ID. For instance: 1033 for English UInt32 CompatibilityLevel The version of SharePoint Int32 Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection CompatibilityLevel The version of SharePoint Int32 Int32 Lcid The language ID. For instance: 1033 for English UInt32 UInt32 Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Microsoft.Online.SharePoint.TenantAdministration.SPOTenantWebTemplateCollection ------------------EXAMPLE 1--------------------- PS:> Get-PnPWebTemplates ------------------EXAMPLE 2--------------------- PS:> Get-PnPWebTemplates -LCID 1033 Returns all webtemplates for the Locale with ID 1033 (English) ------------------EXAMPLE 3--------------------- PS:> Get-PnPWebTemplates -CompatibilityLevel 15 Returns all webtemplates for the compatibility level 15 SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Locale IDs: http://go.microsoft.com/fwlink/p/?LinkId=242911Id=242911 Get-PnPWikiPageContent Gets the contents/source of a wiki page Get PnPWikiPageContent Get-PnPWikiPageContent ServerRelativePageUrl The server relative URL for the wiki page String Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection ServerRelativePageUrl The server relative URL for the wiki page String String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind System.String ------------------EXAMPLE 1--------------------- PS:> Get-PnPWikiPageContent -PageUrl '/sites/demo1/pages/wikipage.aspx' Gets the content of the page '/sites/demo1/pages/wikipage.aspx' SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Get-PnPWorkflowDefinition Returns a workflow definition Get PnPWorkflowDefinition Returns a workflow definition Get-PnPWorkflowDefinition PublishedOnly Return only the published workflows SwitchParameter Name The name of the workflow String Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Name The name of the workflow String String PublishedOnly Return only the published workflows SwitchParameter SwitchParameter Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind Microsoft.SharePoint.Client.WorkflowServices.WorkflowDefinition ------------------EXAMPLE 1--------------------- PS:> Get-PnPWorkflowDefinition -Name MyWorkflow Gets a Workflow with the name "MyWorkflow". ------------------EXAMPLE 2--------------------- PS:> Get-PnPWorkflowDefinition -Name MyWorkflow -PublishedOnly $false Gets a Workflow with the name "MyWorkflow" that is published. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Get-PnPWorkflowInstance Get workflow instances Get PnPWorkflowInstance Gets all workflow instances Get-PnPWorkflowInstance List The List for which workflow instances should be retrieved ListPipeBind ListItem The List Item for which workflow instances should be retrieved ListItemPipeBind Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection List The List for which workflow instances should be retrieved ListPipeBind ListPipeBind ListItem The List Item for which workflow instances should be retrieved ListItemPipeBind ListItemPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Get-PnPWorkflowInstance -List "My Library" -ListItem $ListItem Retrieves workflow instances running against the provided item on list "My Library" ------------------EXAMPLE 2--------------------- PS:> Get-PnPWorkflowInstance -List "My Library" -ListItem 2 Retrieves workflow instances running against the provided item with 2 in the list "My Library" SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Get-PnPWorkflowSubscription Return a workflow subscription Get PnPWorkflowSubscription Returns a workflow subscriptions from a list Get-PnPWorkflowSubscription Name The name of the workflow String List A list to search the association for ListPipeBind Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection List A list to search the association for ListPipeBind ListPipeBind Name The name of the workflow String String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind Microsoft.SharePoint.Client.WorkflowServices.WorkflowSubscription ------------------EXAMPLE 1--------------------- PS:> Get-PnPWorkflowSubscription -Name MyWorkflow Gets an Workflow subscription with the name "MyWorkflow". ------------------EXAMPLE 2--------------------- PS:> Get-PnPWorkflowSubscription -Name MyWorkflow -list $list Gets an Workflow subscription with the name "MyWorkflow" from the list $list. ------------------EXAMPLE 3--------------------- PS:> Get-PnPList -identity "MyList" | Get-PnPWorkflowSubscription -Name MyWorkflow Gets an Workflow subscription with the name "MyWorkflow" from the list "MyList". SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Grant-PnPHubSiteRights * Supported in: SharePoint Online. Retrieve all or a specific hubsite. Grant PnPHubSiteRights Grant-PnPHubSiteRights Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection ------------------EXAMPLE 1--------------------- PS:> Get-PnPStorageEntity Returns all site storage entities/farm properties ------------------EXAMPLE 2--------------------- PS:> Get-PnPTenantSite -Key MyKey Returns the storage entity/farm property with the given key. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Grant-PnPSiteDesignRights * Supported in: SharePoint Online. Grants the specified principals rights to use the site design. Grant PnPSiteDesignRights Grant-PnPSiteDesignRights Principals One or more principals to grant rights to. String[] Identity The site design to use. TenantSiteDesignPipeBind Rights The rights to set. Defaults to 'View' TenantSiteDesignPrincipalRights Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Identity The site design to use. TenantSiteDesignPipeBind TenantSiteDesignPipeBind Principals One or more principals to grant rights to. String[] String[] Rights The rights to set. Defaults to 'View' TenantSiteDesignPrincipalRights TenantSiteDesignPrincipalRights Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection ------------------EXAMPLE 1--------------------- PS:> Grant-PnPSiteDesignRights -Identity 5c73382d-9643-4aa0-9160-d0cba35e40fd -Principals "myuser@mydomain.com","myotheruser@mydomain.com" Grants the specified principals View rights on the site design specified ------------------EXAMPLE 2--------------------- PS:> Get-PnPSiteDesign -Title "MySiteDesign" -SiteScriptIds 438548fd-60dd-42cf-b843-2db506c8e259 -WebTemplate TeamSite | Grant-PnPSiteDesignRights -Principals "myuser@mydomain.com","myotheruser@mydomain.com" Grants the specified principals View rights on the site design specified SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Import-PnPAppPackage Adds a SharePoint Addin to a site Import PnPAppPackage This commands requires that you have an addin package to deploy Import-PnPAppPackage Path Path pointing to the .app file String Force Will forcibly install the app by activating the addin sideloading feature, installing the addin, and deactivating the sideloading feature SwitchParameter LoadOnly Will only upload the addin, but not install it SwitchParameter Locale Will install the addin for the specified locale Int32 Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Force Will forcibly install the app by activating the addin sideloading feature, installing the addin, and deactivating the sideloading feature SwitchParameter SwitchParameter LoadOnly Will only upload the addin, but not install it SwitchParameter SwitchParameter Locale Will install the addin for the specified locale Int32 Int32 Path Path pointing to the .app file String String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind Microsoft.SharePoint.Client.AppInstance ------------------EXAMPLE 1--------------------- PS:> Import-PnPAppPackage -Path c:\files\demo.app -LoadOnly This will load the addin in the demo.app package, but will not install it to the site. ------------------EXAMPLE 2--------------------- PS:> Import-PnPAppPackage -Path c:\files\demo.app -Force This load first activate the addin sideloading feature, upload and install the addin, and deactivate the addin sideloading feature. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Import-PnPTaxonomy Imports a taxonomy from either a string array or a file Import PnPTaxonomy Import-PnPTaxonomy Terms An array of strings describing termgroup, termset, term, subterms using a default delimiter of '|'. String[] Lcid Int32 TermStoreName Term store to import to; if not specified the default term store is used. String Delimiter The path delimiter to be used, by default this is '|' String SynchronizeDeletions If specified, terms that exist in the termset, but are not in the imported data, will be removed. SwitchParameter Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Import-PnPTaxonomy Path Specifies a file containing terms per line, in the format as required by the Terms parameter. String Lcid Int32 TermStoreName Term store to import to; if not specified the default term store is used. String Delimiter The path delimiter to be used, by default this is '|' String SynchronizeDeletions If specified, terms that exist in the termset, but are not in the imported data, will be removed. SwitchParameter Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Delimiter The path delimiter to be used, by default this is '|' String String Lcid Int32 Int32 Path Specifies a file containing terms per line, in the format as required by the Terms parameter. String String SynchronizeDeletions If specified, terms that exist in the termset, but are not in the imported data, will be removed. SwitchParameter SwitchParameter Terms An array of strings describing termgroup, termset, term, subterms using a default delimiter of '|'. String[] String[] TermStoreName Term store to import to; if not specified the default term store is used. String String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection ------------------EXAMPLE 1--------------------- PS:> Import-PnPTaxonomy -Terms 'Company|Locations|Stockholm' Creates a new termgroup, 'Company', a termset 'Locations' and a term 'Stockholm' ------------------EXAMPLE 2--------------------- PS:> Import-PnPTaxonomy -Terms 'Company|Locations|Stockholm|Central','Company|Locations|Stockholm|North' Creates a new termgroup, 'Company', a termset 'Locations', a term 'Stockholm' and two subterms: 'Central', and 'North' SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Import-PnPTermGroupFromXml Imports a taxonomy TermGroup from either the input or from an XML file. Import PnPTermGroupFromXml Import-PnPTermGroupFromXml Xml The XML to process String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Import-PnPTermGroupFromXml Path The XML File to import the data from String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Path The XML File to import the data from String String Xml The XML to process String String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection ------------------EXAMPLE 1--------------------- PS:> Import-PnPTermGroupFromXml -Xml $xml Imports the XML based termgroup information located in the $xml variable ------------------EXAMPLE 2--------------------- PS:> Import-PnPTermGroupFromXml -Path input.xml Imports the XML file specified by the path. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Import-PnPTermSet Imports a taxonomy term set from a file in the standard format. Import PnPTermSet The format of the file is the same as that used by the import function in the web interface. A sample file can be obtained from the web interface. This is a CSV file, with the following headings: Term Set Name,Term Set Description,LCID,Available for Tagging,Term Description,Level 1 Term,Level 2 Term,Level 3 Term,Level 4 Term,Level 5 Term,Level 6 Term,Level 7 Term The first data row must contain the Term Set Name, Term Set Description, and LCID, and should also contain the first term. It is recommended that a fixed GUID be used as the termSetId, to allow the term set to be easily updated (so do not pass Guid.Empty). In contrast to the web interface import, this is not a one-off import but runs synchronisation logic allowing updating of an existing Term Set. When synchronising, any existing terms are matched (with Term Description and Available for Tagging updated as necessary), any new terms are added in the correct place in the hierarchy, and (if synchroniseDeletions is set) any terms not in the imported file are removed. The import file also supports an expanded syntax for the Term Set Name and term names (Level 1 Term, Level 2 Term, etc). These columns support values with the format 'Name | GUID', with the name and GUID separated by a pipe character (note that the pipe character is invalid to use within a taxomony item name). This expanded syntax is not required, but can be used to ensure all terms have fixed IDs. Import-PnPTermSet GroupName Group to import the term set to; an error is returned if the group does not exist. String Path Local path to the file containing the term set to import, in the standard format (as the 'sample import file' available in the Term Store Administration). String TermSetId GUID to use for the term set; if not specified, or the empty GUID, a random GUID is generated and used. Guid SynchronizeDeletions If specified, the import will remove any terms (and children) previously in the term set but not in the import file; default is to leave them. SwitchParameter IsOpen Whether the term set should be marked open; if not specified, then the existing setting is not changed. Boolean Contact Contact for the term set; if not specified, the existing setting is retained. String Owner Owner for the term set; if not specified, the existing setting is retained. String TermStoreName Term store to import into; if not specified the default term store is used. String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Contact Contact for the term set; if not specified, the existing setting is retained. String String GroupName Group to import the term set to; an error is returned if the group does not exist. String String IsOpen Whether the term set should be marked open; if not specified, then the existing setting is not changed. Boolean Boolean Owner Owner for the term set; if not specified, the existing setting is retained. String String Path Local path to the file containing the term set to import, in the standard format (as the 'sample import file' available in the Term Store Administration). String String SynchronizeDeletions If specified, the import will remove any terms (and children) previously in the term set but not in the import file; default is to leave them. SwitchParameter SwitchParameter TermSetId GUID to use for the term set; if not specified, or the empty GUID, a random GUID is generated and used. Guid Guid TermStoreName Term store to import into; if not specified the default term store is used. String String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection ------------------EXAMPLE 1--------------------- PS:> Import-PnPTermSet -GroupName 'Standard Terms' -Path 'C:\\Temp\\ImportTermSet.csv' -SynchronizeDeletions Creates (or updates) the term set specified in the import file, in the group specified, removing any existing terms not in the file. ------------------EXAMPLE 2--------------------- PS:> Import-PnPTermSet -TermStoreName 'My Term Store' -GroupName 'Standard Terms' -Path 'C:\\Temp\\ImportTermSet.csv' -TermSetId '{15A98DB6-D8E2-43E6-8771-066C1EC2B8D8}' Creates (or updates) the term set specified in the import file, in the term store and group specified, using the specified ID. ------------------EXAMPLE 3--------------------- PS:> Import-PnPTermSet -GroupName 'Standard Terms' -Path 'C:\\Temp\\ImportTermSet.csv' -IsOpen $true -Contact 'user@example.org' -Owner 'user@example.org' Creates (or updates) the term set specified in the import file, setting the IsOpen, Contact, and Owner properties as specified. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Install-PnPApp * Supported in: SharePoint Online. Installs an available app from the app catalog Install PnPApp Install-PnPApp Identity Specifies the Id or an actual app metadata instance AppMetadataPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Identity Specifies the Id or an actual app metadata instance AppMetadataPipeBind AppMetadataPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection ------------------EXAMPLE 1--------------------- PS:> Install-PnPApp -Identity 99a00f6e-fb81-4dc7-8eac-e09c6f9132fe This will install an available app, specified by the id, to the current site. ------------------EXAMPLE 2--------------------- PS:> Get-PnPAvailableApp -Identity 99a00f6e-fb81-4dc7-8eac-e09c6f9132fe | Install-PnPApp This will install the given app into the site. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Install-PnPSolution Installs a sandboxed solution to a site collection. WARNING! This method can delete your composed look gallery due to the method used to activate the solution. We recommend you to only to use this cmdlet if you are okay with that. Install PnPSolution Install-PnPSolution PackageId ID of the solution, from the solution manifest GuidPipeBind SourceFilePath Path to the sandbox solution package (.WSP) file String MajorVersion Optional major version of the solution, defaults to 1 Int32 MinorVersion Optional minor version of the solution, defaults to 0 Int32 Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection MajorVersion Optional major version of the solution, defaults to 1 Int32 Int32 MinorVersion Optional minor version of the solution, defaults to 0 Int32 Int32 PackageId ID of the solution, from the solution manifest GuidPipeBind GuidPipeBind SourceFilePath Path to the sandbox solution package (.WSP) file String String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection ------------------EXAMPLE 1--------------------- PS:> Install-PnPSolution -PackageId c2f5b025-7c42-4d3a-b579-41da3b8e7254 -SourceFilePath mypackage.wsp Installs the package to the current site SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Invoke-PnPQuery Executes the currently queued actions Invoke PnPQuery Executes any queued actions / changes on the SharePoint Client Side Object Model Context Invoke-PnPQuery RetryCount Number of times to retry in case of throttling. Defaults to 10. Int32 RetryWait Delay in seconds. Defaults to 1. Int32 Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection RetryCount Number of times to retry in case of throttling. Defaults to 10. Int32 Int32 RetryWait Delay in seconds. Defaults to 1. Int32 Int32 Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection ------------------EXAMPLE 1--------------------- PS:> Invoke-PnPQuery -RetryCount 5 This will execute any queued actions / changes on the SharePoint Client Side Object Model Context and will retry 5 times in case of throttling. ------------------EXAMPLE 2--------------------- PS:> Invoke-PnPQuery -RetryWait 10 This will execute any queued actions / changes on the SharePoint Client Side Object Model Context and delay the execution for 10 seconds before it retries the execution. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Invoke-PnPSiteDesign * Supported in: SharePoint Online. Apply a Site Design to an existing site. * Requires Tenant Administration Rights * Invoke PnPSiteDesign Invoke-PnPSiteDesign Identity The Site Design Id or an actual Site Design object to apply TenantSiteDesignPipeBind WebUrl The URL of the web to apply the site design to. If not specified it will default to the current web based upon the URL specified with Connect-PnPOnline. String Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Identity The Site Design Id or an actual Site Design object to apply TenantSiteDesignPipeBind TenantSiteDesignPipeBind WebUrl The URL of the web to apply the site design to. If not specified it will default to the current web based upon the URL specified with Connect-PnPOnline. String String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Invoke-PnPSiteDesign -Identity 5c73382d-9643-4aa0-9160-d0cba35e40fd Applies the specified site design to the current site. ------------------EXAMPLE 2--------------------- PS:> Invoke-PnPSiteDesign -Identity 5c73382d-9643-4aa0-9160-d0cba35e40fd -WebUrl https://contoso.sharepoint.com/sites/mydemosite Applies the specified site design to the specified site. ------------------EXAMPLE 3--------------------- PS:> Get-PnPSiteDesign | ?{$_.Title -eq "Demo"} | Invoke-PnPSiteDesign Applies the specified site design to the specified site. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Invoke-PnPWebAction Executes operations on web, lists and list items. Invoke PnPWebAction Invoke-PnPWebAction Webs Webs you want to process (for example different site collections), will use Web parameter if not specified Web[] WebAction Function to be executed on the web. There is one input parameter of type Web Web ShouldProcessWebAction Function to be executed on the web that would determine if WebAction should be invoked, There is one input parameter of type Web and the function should return a boolean value Web PostWebAction Function to be executed on the web, this will trigger after lists and list items have been processed. There is one input parameter of type Web Web ShouldProcessPostWebAction Function to be executed on the web that would determine if PostWebAction should be invoked, There is one input parameter of type Web and the function should return a boolean value Web WebProperties The properties to load for web. String[] ListAction Function to be executed on the list. There is one input parameter of type List List ShouldProcessListAction Function to be executed on the web that would determine if ListAction should be invoked, There is one input parameter of type List and the function should return a boolean value List PostListAction Function to be executed on the list, this will trigger after list items have been processed. There is one input parameter of type List List ShouldProcessPostListAction Function to be executed on the web that would determine if PostListAction should be invoked, There is one input parameter of type List and the function should return a boolean value List ListProperties The properties to load for list. String[] ListItemAction Function to be executed on the list item. There is one input parameter of type ListItem ListItem ShouldProcessListItemAction Function to be executed on the web that would determine if ListItemAction should be invoked, There is one input parameter of type ListItem and the function should return a boolean value ListItem ListItemProperties The properties to load for list items. String[] SubWebs Specify if sub webs will be processed SwitchParameter DisableStatisticsOutput Will not output statistics after the operation SwitchParameter SkipCounting Will skip the counting process; by doing this you will not get an estimated time remaining SwitchParameter Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection DisableStatisticsOutput Will not output statistics after the operation SwitchParameter SwitchParameter ListAction Function to be executed on the list. There is one input parameter of type List List List ListItemAction Function to be executed on the list item. There is one input parameter of type ListItem ListItem ListItem ListItemProperties The properties to load for list items. String[] String[] ListProperties The properties to load for list. String[] String[] PostListAction Function to be executed on the list, this will trigger after list items have been processed. There is one input parameter of type List List List PostWebAction Function to be executed on the web, this will trigger after lists and list items have been processed. There is one input parameter of type Web Web Web ShouldProcessListAction Function to be executed on the web that would determine if ListAction should be invoked, There is one input parameter of type List and the function should return a boolean value List List ShouldProcessListItemAction Function to be executed on the web that would determine if ListItemAction should be invoked, There is one input parameter of type ListItem and the function should return a boolean value ListItem ListItem ShouldProcessPostListAction Function to be executed on the web that would determine if PostListAction should be invoked, There is one input parameter of type List and the function should return a boolean value List List ShouldProcessPostWebAction Function to be executed on the web that would determine if PostWebAction should be invoked, There is one input parameter of type Web and the function should return a boolean value Web Web ShouldProcessWebAction Function to be executed on the web that would determine if WebAction should be invoked, There is one input parameter of type Web and the function should return a boolean value Web Web SkipCounting Will skip the counting process; by doing this you will not get an estimated time remaining SwitchParameter SwitchParameter SubWebs Specify if sub webs will be processed SwitchParameter SwitchParameter WebAction Function to be executed on the web. There is one input parameter of type Web Web Web WebProperties The properties to load for web. String[] String[] Webs Webs you want to process (for example different site collections), will use Web parameter if not specified Web[] Web[] Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Invoke-PnPWebAction -ListAction ${function:ListAction} This will call the function ListAction on all the lists located on the current web. ------------------EXAMPLE 2--------------------- PS:> Invoke-PnPWebAction -ShouldProcessListAction ${function:ShouldProcessList} -ListAction ${function:ListAction} This will call the function ShouldProcessList, if it returns true the function ListAction will then be called. This will occur on all lists located on the current web SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Measure-PnPList * Supported in: SharePoint Online, SharePoint 2016. Returns statistics on the list object Measure PnPList Measure-PnPList Identity ListPipeBind ItemLevel Show item level statistics SwitchParameter BrokenPermissions Show items with broken permissions SwitchParameter Web The web to apply the command to. Omit this parameter to use the current web. WebPipeBind Includes Specify properties to include when retrieving objects from the server. String[] Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection BrokenPermissions Show items with broken permissions SwitchParameter SwitchParameter Identity ListPipeBind ListPipeBind Includes Specify properties to include when retrieving objects from the server. String[] String[] ItemLevel Show item level statistics SwitchParameter SwitchParameter Web The web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection ------------------EXAMPLE 1--------------------- PS:> Measure-PnPList "Documents" Gets statistics on Documents document library ------------------EXAMPLE 2--------------------- PS:> Measure-PnPList "Documents" -BrokenPermissions -ItemLevel Displays items and folders with broken permissions inside Documents library SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Measure-PnPWeb * Supported in: SharePoint Online, SharePoint 2016. Returns statistics on the web object Measure PnPWeb Measure-PnPWeb Recursive Iterate all sub webs recursively SwitchParameter IncludeHiddenList Include hidden lists in statistics calculation SwitchParameter Identity WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Identity WebPipeBind WebPipeBind IncludeHiddenList Include hidden lists in statistics calculation SwitchParameter SwitchParameter Recursive Iterate all sub webs recursively SwitchParameter SwitchParameter Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection ------------------EXAMPLE 1--------------------- PS:> Measure-PnPWeb Gets statistics on the current web ------------------EXAMPLE 2--------------------- PS:> Measure-PnPList $web -Recursive Gets statistics on the chosen including all sub webs SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Measure-PnPResponseTime Gets statistics on response time for the specified endpoint by sending probe requests Measure PnPResponseTime Measure-PnPResponseTime Count Number of probe requests to send UInt32 WarmUp Number of warm up requests to send before start calculating statistics UInt32 Timeout Idle timeout between requests to avoid request throttling UInt32 Histogram Number of buckets in histogram in output statistics UInt32 Mode Response time measurement mode. RoundTrip - measures full request round trip. SPRequestDuration - measures server processing time only, based on SPRequestDuration HTTP header. Latency - difference between RoundTrip and SPRequestDuration MeasureResponseTimeMode Url DiagnosticEndpointPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Count Number of probe requests to send UInt32 UInt32 Histogram Number of buckets in histogram in output statistics UInt32 UInt32 Mode Response time measurement mode. RoundTrip - measures full request round trip. SPRequestDuration - measures server processing time only, based on SPRequestDuration HTTP header. Latency - difference between RoundTrip and SPRequestDuration MeasureResponseTimeMode MeasureResponseTimeMode Timeout Idle timeout between requests to avoid request throttling UInt32 UInt32 Url DiagnosticEndpointPipeBind DiagnosticEndpointPipeBind WarmUp Number of warm up requests to send before start calculating statistics UInt32 UInt32 Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection ------------------EXAMPLE 1--------------------- PS:> Measure-PnPResponseTime -Count 100 -Timeout 20 Calculates statistics on sequence of 100 probe requests, sleeps 20ms between probes ------------------EXAMPLE 2--------------------- PS:> Measure-PnPResponseTime "/Pages/Test.aspx" -Count 1000 Calculates statistics on response time of Test.aspx by sending 1000 requests with default sleep time between requests ------------------EXAMPLE 3--------------------- PS:> Measure-PnPResponseTime $web -Count 1000 -WarmUp 10 -Histogram 20 -Timeout 50 | Select -expa Histogram | % {$_.GetEnumerator() | Export-Csv C:\Temp\responsetime.csv -NoTypeInformation} Builds histogram of response time for the home page of the web and exports to CSV for later processing in Excel SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Move-PnPClientSideComponent * Supported in: SharePoint Online. Moves a Client-Side Component to a different section/column Move PnPClientSideComponent Moves a Client-Side Component to a different location on the page. Notice that the sections and or columns need to be present before moving the component. Move-PnPClientSideComponent Section The section to move the webpart to Int32 InstanceId The instance id of the control. Use Get-PnPClientSideControl retrieve the instance ids. GuidPipeBind Page The name of the page ClientSidePagePipeBind Position Change to order of the webpart in the column Int32 Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Move-PnPClientSideComponent Column The column to move the webpart to Int32 InstanceId The instance id of the control. Use Get-PnPClientSideControl retrieve the instance ids. GuidPipeBind Page The name of the page ClientSidePagePipeBind Position Change to order of the webpart in the column Int32 Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Move-PnPClientSideComponent Position Change to order of the webpart in the column Int32 InstanceId The instance id of the control. Use Get-PnPClientSideControl retrieve the instance ids. GuidPipeBind Page The name of the page ClientSidePagePipeBind Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Move-PnPClientSideComponent Section The section to move the webpart to Int32 Column The column to move the webpart to Int32 InstanceId The instance id of the control. Use Get-PnPClientSideControl retrieve the instance ids. GuidPipeBind Page The name of the page ClientSidePagePipeBind Position Change to order of the webpart in the column Int32 Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Column The column to move the webpart to Int32 Int32 InstanceId The instance id of the control. Use Get-PnPClientSideControl retrieve the instance ids. GuidPipeBind GuidPipeBind Page The name of the page ClientSidePagePipeBind ClientSidePagePipeBind Position Change to order of the webpart in the column Int32 Int32 Section The section to move the webpart to Int32 Int32 Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Move-PnPClientSideComponent -Page Home -InstanceId a2875399-d6ff-43a0-96da-be6ae5875f82 -Section 1 Moves the specified component to the first section of the page. ------------------EXAMPLE 2--------------------- PS:> Move-PnPClientSideComponent -Page Home -InstanceId a2875399-d6ff-43a0-96da-be6ae5875f82 -Column 2 Moves the specified component to the second column of the current section. ------------------EXAMPLE 3--------------------- PS:> Move-PnPClientSideComponent -Page Home -InstanceId a2875399-d6ff-43a0-96da-be6ae5875f82 -Section 1 -Column 2 Moves the specified component to the first section of the page into the second column. ------------------EXAMPLE 4--------------------- PS:> Move-PnPClientSideComponent -Page Home -InstanceId a2875399-d6ff-43a0-96da-be6ae5875f82 -Section 1 -Column 2 -Position 2 Moves the specified component to the first section of the page into the second column and sets the column to position 2 in the list of webparts. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Move-PnPFile Moves a file to a different location Move PnPFile Move-PnPFile ServerRelativeUrl Server relative Url specifying the file to move. Must include the file name. String TargetUrl Server relative Url where to move the file to. Must include the file name. String OverwriteIfAlreadyExists If provided, if a file already exists at the TargetUrl, it will be overwritten. If ommitted, the move operation will be canceled if the file already exists at the TargetUrl location. SwitchParameter Force If provided, no confirmation will be requested and the action will be performed SwitchParameter Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Move-PnPFile SiteRelativeUrl Site relative Url specifying the file to move. Must include the file name. String TargetUrl Server relative Url where to move the file to. Must include the file name. String OverwriteIfAlreadyExists If provided, if a file already exists at the TargetUrl, it will be overwritten. If ommitted, the move operation will be canceled if the file already exists at the TargetUrl location. SwitchParameter Force If provided, no confirmation will be requested and the action will be performed SwitchParameter Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Force If provided, no confirmation will be requested and the action will be performed SwitchParameter SwitchParameter OverwriteIfAlreadyExists If provided, if a file already exists at the TargetUrl, it will be overwritten. If ommitted, the move operation will be canceled if the file already exists at the TargetUrl location. SwitchParameter SwitchParameter ServerRelativeUrl Server relative Url specifying the file to move. Must include the file name. String String SiteRelativeUrl Site relative Url specifying the file to move. Must include the file name. String String TargetUrl Server relative Url where to move the file to. Must include the file name. String String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:>Move-PnPFile -ServerRelativeUrl /sites/project/Documents/company.docx -TargetUrl /sites/otherproject/Documents/company.docx Moves a file named company.docx located in the document library called Documents located in the projects sitecollection under the managed path sites to the site collection otherproject located in the managed path sites. If a file named company.aspx already exists, it won't perform the move. ------------------EXAMPLE 2--------------------- PS:>Move-PnPFile -SiteRelativeUrl Documents/company.aspx -TargetUrl /sites/otherproject/Documents/company.docx Moves a file named company.docx located in the document library called Documents located in the current site to the Documents library in the site collection otherproject located in the managed path sites. If a file named company.aspx already exists, it won't perform the move. ------------------EXAMPLE 3--------------------- PS:>Move-PnPFile -ServerRelativeUrl /sites/project/Documents/company.docx -TargetUrl /sites/otherproject/Documents/company.docx -OverwriteIfAlreadyExists Moves a file named company.docx located in the document library called Documents located in the projects sitecollection under the managed path sites to the site collection otherproject located in the managed path sites. If a file named company.aspx already exists, it will still perform the move and replace the original company.aspx file. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Move-PnPFolder Move a folder to another location in the current web Move PnPFolder Move-PnPFolder Folder The folder to move String TargetFolder The new parent location to which the folder should be moved to String Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Folder The folder to move String String TargetFolder The new parent location to which the folder should be moved to String String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind Microsoft.SharePoint.Client.Folder ------------------EXAMPLE 1--------------------- PS:> Move-PnPFolder -Folder Documents/Reports -TargetFolder 'Archived Reports' This will move the folder Reports in the Documents library to the 'Archived Reports' library ------------------EXAMPLE 2--------------------- PS:> Move-PnPFolder -Folder 'Shared Documents/Reports/2016/Templates' -TargetFolder 'Shared Documents/Reports' This will move the folder Templates to the new location in 'Shared Documents/Reports' SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Move-PnPListItemToRecycleBin Moves an item from a list to the Recycle Bin Move PnPListItemToRecycleBin Move-PnPListItemToRecycleBin Identity The ID of the listitem, or actual ListItem object ListItemPipeBind List The ID, Title or Url of the list. ListPipeBind Force Specifying the Force parameter will skip the confirmation question. SwitchParameter Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Force Specifying the Force parameter will skip the confirmation question. SwitchParameter SwitchParameter Identity The ID of the listitem, or actual ListItem object ListItemPipeBind ListItemPipeBind List The ID, Title or Url of the list. ListPipeBind ListPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Move-PnPListItemToRecycleBin -List "Demo List" -Identity "1" -Force Moves the listitem with id "1" from the "Demo List" list to the Recycle Bin. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Move-PnPRecycleBinItem * Supported in: SharePoint Online. Moves all items or a specific item in the first stage recycle bin of the current site collection to the second stage recycle bin Move PnPRecycleBinItem Move-PnPRecycleBinItem Identity If provided, moves the item with the specific ID to the second stage recycle bin RecycleBinItemPipeBind Force If provided, no confirmation will be asked to move the first stage recycle bin items to the second stage SwitchParameter Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Force If provided, no confirmation will be asked to move the first stage recycle bin items to the second stage SwitchParameter SwitchParameter Identity If provided, moves the item with the specific ID to the second stage recycle bin RecycleBinItemPipeBind RecycleBinItemPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection ------------------EXAMPLE 1--------------------- PS:> Move-PnpRecycleBinItem Moves all the items in the first stage recycle bin of the current site collection to the second stage recycle bin ------------------EXAMPLE 2--------------------- PS:> Move-PnpRecycleBinItem -Identity 26ffff29-b526-4451-9b6f-7f0e56ba7125 Moves the item with the provided ID in the first stage recycle bin of the current site collection to the second stage recycle bin without asking for confirmation first ------------------EXAMPLE 3--------------------- PS:> Move-PnpRecycleBinItem -Force Moves all the items in the first stage recycle bin of the current context to the second stage recycle bin without asking for confirmation first SharePoint Developer Patterns and Practices: http://aka.ms/sppnp New-PnPExtensibilityHandlerObject Creates an ExtensibilityHandler Object, to be used by the Get-SPOProvisioningTemplate cmdlet New PnPExtensibilityHandlerObject New-PnPExtensibilityHandlerObject Type The type of the handler String Assembly The full assembly name of the handler String Configuration Any configuration data you want to send to the handler String Disabled If set, the handler will be disabled SwitchParameter Assembly The full assembly name of the handler String String Configuration Any configuration data you want to send to the handler String String Disabled If set, the handler will be disabled SwitchParameter SwitchParameter Type The type of the handler String String OfficeDevPnP.Core.Framework.Provisioning.Model.ExtensibilityHandler ------------------EXAMPLE 1--------------------- PS:> $handler = New-PnPExtensibilityHandlerObject -Assembly Contoso.Core.Handlers -Type Contoso.Core.Handlers.MyExtensibilityHandler PS:> Get-PnPProvisioningTemplate -Out NewTemplate.xml -ExtensibilityHandlers $handler This will create a new ExtensibilityHandler object that is run during extraction of the template SharePoint Developer Patterns and Practices: http://aka.ms/sppnp New-PnPGroup Adds group to the Site Groups List and returns a group object New PnPGroup New-PnPGroup Title The Title of the group String Description The description for the group String Owner The owner for the group, which can be a user or another group String AllowRequestToJoinLeave A switch parameter that specifies whether to allow users to request membership in the group and to allow users to request to leave the group SwitchParameter AutoAcceptRequestToJoinLeave A switch parameter that specifies whether users are automatically added or removed when they make a request SwitchParameter AllowMembersEditMembership A switch parameter that specifies whether group members can modify membership in the group SwitchParameter DisallowMembersViewMembership A switch parameter that disallows group members to view membership. SwitchParameter RequestToJoinEmail The e-mail address to which membership requests are sent String Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection AllowMembersEditMembership A switch parameter that specifies whether group members can modify membership in the group SwitchParameter SwitchParameter AllowRequestToJoinLeave A switch parameter that specifies whether to allow users to request membership in the group and to allow users to request to leave the group SwitchParameter SwitchParameter AutoAcceptRequestToJoinLeave A switch parameter that specifies whether users are automatically added or removed when they make a request SwitchParameter SwitchParameter Description The description for the group String String DisallowMembersViewMembership A switch parameter that disallows group members to view membership. SwitchParameter SwitchParameter Owner The owner for the group, which can be a user or another group String String RequestToJoinEmail The e-mail address to which membership requests are sent String String Title The Title of the group String String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind Microsoft.SharePoint.Client.Group ------------------EXAMPLE 1--------------------- PS:> New-PnPGroup -Title "My Site Users" SharePoint Developer Patterns and Practices: http://aka.ms/sppnp New-PnPList Creates a new list New PnPList New-PnPList Title The Title of the list String Template The type of list to create. ListTemplateType Url If set, will override the url of the list. String Hidden Switch parameter if list should be hidden from the SharePoint UI SwitchParameter EnableVersioning Switch parameter if versioning should be enabled SwitchParameter EnableContentTypes Switch parameter if content types should be enabled on this list SwitchParameter OnQuickLaunch Switch parameter if this list should be visible on the QuickLaunch SwitchParameter Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection EnableContentTypes Switch parameter if content types should be enabled on this list SwitchParameter SwitchParameter EnableVersioning Switch parameter if versioning should be enabled SwitchParameter SwitchParameter Hidden Switch parameter if list should be hidden from the SharePoint UI SwitchParameter SwitchParameter OnQuickLaunch Switch parameter if this list should be visible on the QuickLaunch SwitchParameter SwitchParameter Template The type of list to create. ListTemplateType ListTemplateType Title The Title of the list String String Url If set, will override the url of the list. String String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> New-PnPList -Title Announcements -Template Announcements Create a new announcements list ------------------EXAMPLE 2--------------------- PS:> New-PnPList -Title "Demo List" -Url "DemoList" -Template Announcements Create a list with a title that is different from the url ------------------EXAMPLE 3--------------------- PS:> New-PnPList -Title HiddenList -Template GenericList -Hidden Create a new custom list and hides it from the SharePoint UI. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp New-PnPPersonalSite * Supported in: SharePoint Online. Office365 only: Creates a personal / OneDrive For Business site New PnPPersonalSite New-PnPPersonalSite Email The UserPrincipalName (UPN) of the users String[] Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Email The UserPrincipalName (UPN) of the users String[] String[] Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection ------------------EXAMPLE 1--------------------- PS:> $users = ('katiej@contoso.onmicrosoft.com','garth@contoso.onmicrosoft.com') PS:> New-PnPPersonalSite -Email $users Creates a personal / OneDrive For Business site for the 2 users in the variable $users SharePoint Developer Patterns and Practices: http://aka.ms/sppnp New-PnPAzureCertificate Generate a new 2048bit self-signed certificate and manifest settings for use when using CSOM via an app-only ADAL application. See https://github.com/SharePoint/PnP-PowerShell/tree/master/Samples/SharePoint.ConnectUsingAppPermissions for a sample on how to get started. KeyCredentials contains the ADAL app manifest sections. Certificate contains the PEM encoded certificate. PrivateKey contains the PEM encoded private key of the certificate. New PnPAzureCertificate New-PnPAzureCertificate CommonName Common Name (e.g. server FQDN or YOUR name) [pnp.contoso.com] String Country Country Name (2 letter code) String State State or Province Name (full name) String Locality Locality Name (eg, city) String Organization Organization Name (eg, company) String OrganizationUnit Organizational Unit Name (eg, section) String Out Filename to write to, optionally including full path (.pfx) String ValidYears Number of years until expiration (default is 10, max is 30) Int32 CommonName Common Name (e.g. server FQDN or YOUR name) [pnp.contoso.com] String String Country Country Name (2 letter code) String String Locality Locality Name (eg, city) String String Organization Organization Name (eg, company) String String OrganizationUnit Organizational Unit Name (eg, section) String String Out Filename to write to, optionally including full path (.pfx) String String State State or Province Name (full name) String String ValidYears Number of years until expiration (default is 10, max is 30) Int32 Int32 ------------------EXAMPLE 1--------------------- PS:> Generate-PnPAzureCertificate This will generate a default self-signed certificate named "pnp.contoso.com" valid for 10 years. ------------------EXAMPLE 2--------------------- PS:> Generate-PnPAzureCertificate -CommonName "My Certificate" -ValidYears 30 This will output a certificate named "My Certificate" which expires in 30 years from now. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp New-PnPUnifiedGroup * Supported in: SharePoint Online. Creates a new Office 365 Group (aka Unified Group) New PnPUnifiedGroup New-PnPUnifiedGroup DisplayName The Display Name of the Office 365 Group. String Description The Description of the Office 365 Group. String MailNickname The Mail Nickname of the Office 365 Group. Cannot contain spaces. String Owners The array UPN values of the group's owners. String[] Members The array UPN values of the group's members. String[] IsPrivate Makes the group private when selected. SwitchParameter GroupLogoPath The path to the logo file of to set. String Force Specifying the Force parameter will skip the confirmation question. SwitchParameter Description The Description of the Office 365 Group. String String DisplayName The Display Name of the Office 365 Group. String String Force Specifying the Force parameter will skip the confirmation question. SwitchParameter SwitchParameter GroupLogoPath The path to the logo file of to set. String String IsPrivate Makes the group private when selected. SwitchParameter SwitchParameter MailNickname The Mail Nickname of the Office 365 Group. Cannot contain spaces. String String Members The array UPN values of the group's members. String[] String[] Owners The array UPN values of the group's owners. String[] String[] ------------------EXAMPLE 1--------------------- PS:> New-PnPUnifiedGroup -DisplayName $displayName -Description $description -MailNickname $nickname Creates a public Office 365 Group with all the required properties ------------------EXAMPLE 2--------------------- PS:> New-PnPUnifiedGroup -DisplayName $displayName -Description $description -MailNickname $nickname -Owners $arrayOfOwners -Members $arrayOfMembers Creates a public Office 365 Group with all the required properties, and with a custom list of Owners and a custom list of Members ------------------EXAMPLE 3--------------------- PS:> New-PnPUnifiedGroup -DisplayName $displayName -Description $description -MailNickname $nickname -IsPrivate Creates a private Office 365 Group with all the required properties ------------------EXAMPLE 4--------------------- PS:> New-PnPUnifiedGroup -DisplayName $displayName -Description $description -MailNickname $nickname -Owners $arrayOfOwners -Members $arrayOfMembers -IsPrivate Creates a private Office 365 Group with all the required properties, and with a custom list of Owners and a custom list of Members SharePoint Developer Patterns and Practices: http://aka.ms/sppnp New-PnPProvisioningTemplate Creates a new provisioning template object New PnPProvisioningTemplate New-PnPProvisioningTemplate Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> $template = New-PnPProvisioningTemplate Creates a new instance of a provisioning template object. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp New-PnPProvisioningTemplateFromFolder Generates a provisioning template from a given folder, including only files that are present in that folder New PnPProvisioningTemplateFromFolder New-PnPProvisioningTemplateFromFolder Match Optional wildcard pattern to match filenames against. If empty all files will be included. String ContentType An optional content type to use. ContentTypePipeBind Properties Additional properties to set for every file entry in the generated template. Hashtable AsIncludeFile If specified, the output will only contain the <pnp:Files> element. This allows the output to be included in another template. SwitchParameter Force Overwrites the output file if it exists. SwitchParameter Encoding The encoding type of the XML file, Unicode is default Encoding Out Filename to write to, optionally including full path. String Folder Folder to process. If not specified the current folder will be used. String TargetFolder Target folder to provision to files to. If not specified, the current folder name will be used. String Schema The schema of the output to use, defaults to the latest schema XMLPnPSchemaVersion Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection AsIncludeFile If specified, the output will only contain the <pnp:Files> element. This allows the output to be included in another template. SwitchParameter SwitchParameter ContentType An optional content type to use. ContentTypePipeBind ContentTypePipeBind Encoding The encoding type of the XML file, Unicode is default Encoding Encoding Folder Folder to process. If not specified the current folder will be used. String String Force Overwrites the output file if it exists. SwitchParameter SwitchParameter Match Optional wildcard pattern to match filenames against. If empty all files will be included. String String Out Filename to write to, optionally including full path. String String Properties Additional properties to set for every file entry in the generated template. Hashtable Hashtable Schema The schema of the output to use, defaults to the latest schema XMLPnPSchemaVersion XMLPnPSchemaVersion TargetFolder Target folder to provision to files to. If not specified, the current folder name will be used. String String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> New-PnPProvisioningTemplateFromFolder -Out template.xml Creates an empty provisioning template, and includes all files in the current folder. ------------------EXAMPLE 2--------------------- PS:> New-PnPProvisioningTemplateFromFolder -Out template.xml -Folder c:\temp Creates an empty provisioning template, and includes all files in the c:\temp folder. ------------------EXAMPLE 3--------------------- PS:> New-PnPProvisioningTemplateFromFolder -Out template.xml -Folder c:\temp -Match *.js Creates an empty provisioning template, and includes all files with a JS extension in the c:\temp folder. ------------------EXAMPLE 4--------------------- PS:> New-PnPProvisioningTemplateFromFolder -Out template.xml -Folder c:\temp -Match *.js -TargetFolder "Shared Documents" Creates an empty provisioning template, and includes all files with a JS extension in the c:\temp folder and marks the files in the template to be added to the 'Shared Documents' folder ------------------EXAMPLE 5--------------------- PS:> New-PnPProvisioningTemplateFromFolder -Out template.xml -Folder c:\temp -Match *.js -TargetFolder "Shared Documents" -ContentType "Test Content Type" Creates an empty provisioning template, and includes all files with a JS extension in the c:\temp folder and marks the files in the template to be added to the 'Shared Documents' folder. It will add a property to the item for the content type. ------------------EXAMPLE 6--------------------- PS:> New-PnPProvisioningTemplateFromFolder -Out template.xml -Folder c:\temp -Match *.js -TargetFolder "Shared Documents" -Properties @{"Title" = "Test Title"; "Category"="Test Category"} Creates an empty provisioning template, and includes all files with a JS extension in the c:\temp folder and marks the files in the template to be added to the 'Shared Documents' folder. It will add the specified properties to the file entries. ------------------EXAMPLE 7--------------------- PS:> New-PnPProvisioningTemplateFromFolder -Out template.pnp Creates an empty provisioning template as a pnp package file, and includes all files in the current folder ------------------EXAMPLE 8--------------------- PS:> New-PnPProvisioningTemplateFromFolder -Out template.pnp -Folder c:\temp Creates an empty provisioning template as a pnp package file, and includes all files in the c:\temp folder SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Encoding: https://msdn.microsoft.com/en-us/library/system.text.encoding_properties.aspx New-PnPSite * Supported in: SharePoint Online. BETA: This cmdlet is using early release APIs. Notice that functionality and parameters can change. Creates a new site collection New PnPSite The New-PnPSite cmdlet creates a new site collection for the current tenant. Currently only 'modern' sites like Communication Site and the Modern Team Site are supported. If you want to create a classic site, use New-PnPTenantSite. New-PnPSite Type @Specifies with type of site to create. SiteType Title Specifies the title of the new site collection String Url Specifies the full url of the new site collection String Description Specifies the description of the new site collection String Classification Specifies the classification of the new site collection String AllowFileSharingForGuestUsers Specifies if guest users can share files in the new site collection SwitchParameter SiteDesign Specifies the site design of the new site collection. Defaults to 'Topic' CommunicationSiteDesign Lcid Specifies the language of the new site collection. Defaults to the current language of the web connected to. UInt32 Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection New-PnPSite Type @Specifies with type of site to create. SiteType Title Specifies the title of the new site collection String Alias Specifies the alias of the new site collection String Description Specifies the description of the new site collection String Classification Specifies the classification of the new site collection String IsPublic Specifies if new site collection is public. Defaults to false. String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection New-PnPSite Type @Specifies with type of site to create. SiteType Title Specifies the title of the new site collection String Url Specifies the full url of the new site collection String SiteDesignId Specifies the site design id to use for the new site collection. If specified will override SiteDesign GuidPipeBind Description Specifies the description of the new site collection String Classification Specifies the classification of the new site collection String AllowFileSharingForGuestUsers Specifies if guest users can share files in the new site collection SwitchParameter Lcid Specifies the language of the new site collection. Defaults to the current language of the web connected to. UInt32 Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Alias Specifies the alias of the new site collection String String AllowFileSharingForGuestUsers Specifies if guest users can share files in the new site collection SwitchParameter SwitchParameter Classification Specifies the classification of the new site collection String String Description Specifies the description of the new site collection String String IsPublic Specifies if new site collection is public. Defaults to false. String String Lcid Specifies the language of the new site collection. Defaults to the current language of the web connected to. UInt32 UInt32 SiteDesign Specifies the site design of the new site collection. Defaults to 'Topic' CommunicationSiteDesign CommunicationSiteDesign SiteDesignId Specifies the site design id to use for the new site collection. If specified will override SiteDesign GuidPipeBind GuidPipeBind Title Specifies the title of the new site collection String String Type @Specifies with type of site to create. SiteType SiteType Url Specifies the full url of the new site collection String String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection System.String Returns the url of the newly created site collection ------------------EXAMPLE 1--------------------- PS:> New-PnPSite -Type CommunicationSite -Title Contoso -Url https://tenant.sharepoint.com/sites/contoso This will create a new Communications Site collection with the title 'Contoso' and the url 'https://tenant.sharepoint.com/sites/contoso' ------------------EXAMPLE 2--------------------- PS:> New-PnPSite -Type CommunicationSite -Title Contoso -Url https://tenant.sharepoint.com/sites/contoso -SiteDesign Showcase This will create a new Communications Site collection with the title 'Contoso' and the url 'https://tenant.sharepoint.com/sites/contoso'. It will use the 'Showcase' design for the site. ------------------EXAMPLE 3--------------------- PS:> New-PnPSite -Type CommunicationSite -Title Contoso -Url https://tenant.sharepoint.com/sites/contoso -SiteDesignId ae2349d5-97d6-4440-94d1-6516b72449ac This will create a new Communications Site collection with the title 'Contoso' and the url 'https://tenant.sharepoint.com/sites/contoso'. It will use the specified custom site design for the site. ------------------EXAMPLE 4--------------------- PS:> New-PnPSite -Type CommunicationSite -Title Contoso -Url https://tenant.sharepoint.com/sites/contoso -Classification "HBI" This will create a new Communications Site collection with the title 'Contoso' and the url 'https://tenant.sharepoint.com/sites/contoso'. The classification for the site will be set to "HBI" ------------------EXAMPLE 5--------------------- PS:> New-PnPSite -Type CommunicationSite -Title Contoso -Url https://tenant.sharepoint.com/sites/contoso -AllowFileSharingForGuestUsers This will create a new Communications Site collection with the title 'Contoso' and the url 'https://tenant.sharepoint.com/sites/contoso'. File sharing for guest users will be enabled. ------------------EXAMPLE 6--------------------- PS:> New-PnPSite -Type TeamSite -Title Contoso -Alias contoso This will create a new Modern Team Site collection with the title 'Contoso' and the url 'https://tenant.sharepoint.com/sites/contoso'. ------------------EXAMPLE 7--------------------- PS:> New-PnPSite -Type TeamSite -Title Contoso -Alias contoso -IsPublic This will create a new Modern Team Site collection with the title 'Contoso' and the url 'https://tenant.sharepoint.com/sites/contoso' and sets the site to public. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp New-PnPTenantSite Creates a new site collection for the current tenant New PnPTenantSite The New-PnPTenantSite cmdlet creates a new site collection for the current company. However, creating a new SharePoint Online site collection fails if a deleted site with the same URL exists in the Recycle Bin. If you want to use this command for an on-premises farm, please refer to http://blogs.msdn.com/b/vesku/archive/2014/06/09/provisioning-site-collections-using-sp-app-model-in-on-premises-with-just-csom.aspx New-PnPTenantSite Title Specifies the title of the new site collection String Url Specifies the full URL of the new site collection. It must be in a valid managed path in the company's site. For example, for company contoso, valid managed paths are https://contoso.sharepoint.com/sites and https://contoso.sharepoint.com/teams. String Owner Specifies the user name of the site collection's primary owner. The owner must be a user instead of a security group or an email-enabled security group. String TimeZone Use Get-PnPTimeZoneId to retrieve possible timezone values Int32 Description Specifies the description of the new site collection String Lcid Specifies the language of this site collection. For more information, see Locale IDs Assigned by Microsoft: https://msdn.microsoft.com/en-us/library/microsoft.sharepoint.splanguage.lcid.aspx UInt32 Template Specifies the site collection template type. Use the Get-PnPWebTemplate cmdlet to get the list of valid templates. If no template is specified, one can be added later. The Template and LocaleId parameters must be a valid combination as returned from the Get-PnPWebTemplates cmdlet. String ResourceQuota Specifies the quota for this site collection in Sandboxed Solutions units. This value must not exceed the company's aggregate available Sandboxed Solutions quota. The default value is 0. For more information, see Resource Usage Limits on Sandboxed Solutions in SharePoint 2010 : http://msdn.microsoft.com/en-us/library/gg615462.aspx. Double ResourceQuotaWarningLevel Specifies the warning level for the resource quota. This value must not exceed the value set for the ResourceQuota parameter Double StorageQuota Specifies the storage quota for this site collection in megabytes. This value must not exceed the company's available quota. Int64 StorageQuotaWarningLevel Specifies the warning level for the storage quota in megabytes. This value must not exceed the values set for the StorageQuota parameter Int64 RemoveDeletedSite Specifies if any existing site with the same URL should be removed from the recycle bin SwitchParameter Wait SwitchParameter Force Do not ask for confirmation. SwitchParameter Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Description Specifies the description of the new site collection String String Force Do not ask for confirmation. SwitchParameter SwitchParameter Lcid Specifies the language of this site collection. For more information, see Locale IDs Assigned by Microsoft: https://msdn.microsoft.com/en-us/library/microsoft.sharepoint.splanguage.lcid.aspx UInt32 UInt32 Owner Specifies the user name of the site collection's primary owner. The owner must be a user instead of a security group or an email-enabled security group. String String RemoveDeletedSite Specifies if any existing site with the same URL should be removed from the recycle bin SwitchParameter SwitchParameter ResourceQuota Specifies the quota for this site collection in Sandboxed Solutions units. This value must not exceed the company's aggregate available Sandboxed Solutions quota. The default value is 0. For more information, see Resource Usage Limits on Sandboxed Solutions in SharePoint 2010 : http://msdn.microsoft.com/en-us/library/gg615462.aspx. Double Double ResourceQuotaWarningLevel Specifies the warning level for the resource quota. This value must not exceed the value set for the ResourceQuota parameter Double Double StorageQuota Specifies the storage quota for this site collection in megabytes. This value must not exceed the company's available quota. Int64 Int64 StorageQuotaWarningLevel Specifies the warning level for the storage quota in megabytes. This value must not exceed the values set for the StorageQuota parameter Int64 Int64 Template Specifies the site collection template type. Use the Get-PnPWebTemplate cmdlet to get the list of valid templates. If no template is specified, one can be added later. The Template and LocaleId parameters must be a valid combination as returned from the Get-PnPWebTemplates cmdlet. String String TimeZone Use Get-PnPTimeZoneId to retrieve possible timezone values Int32 Int32 Title Specifies the title of the new site collection String String Url Specifies the full URL of the new site collection. It must be in a valid managed path in the company's site. For example, for company contoso, valid managed paths are https://contoso.sharepoint.com/sites and https://contoso.sharepoint.com/teams. String String Wait SwitchParameter SwitchParameter Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection ------------------EXAMPLE 1--------------------- PS:> New-PnPTenantSite -Title Contoso -Url https://tenant.sharepoint.com/sites/contoso -Owner user@example.org -TimeZone 4 -Template STS#0 This will add a site collection with the title 'Contoso', the url 'https://tenant.sharepoint.com/sites/contoso', the timezone 'UTC+01:00',the owner 'user@example.org' and the template used will be STS#0, a TeamSite ------------------EXAMPLE 2--------------------- PS:> New-PnPTenantSite -Title Contoso -Url /sites/contososite -Owner user@example.org -TimeZone 4 -Template STS#0 This will add a site collection with the title 'Contoso', the url 'https://tenant.sharepoint.com/sites/contososite' of which the base part will be picked up from your current connection, the timezone 'UTC+01:00', the owner 'user@example.org' and the template used will be STS#0, a TeamSite SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Locale IDs: http://go.microsoft.com/fwlink/p/?LinkId=242911Id=242911 Resource Usage Limits on Sandboxed Solutions in SharePoint 2010: http://msdn.microsoft.com/en-us/library/gg615462.aspx. Creating on-premises site collections using CSOM: http://blogs.msdn.com/b/vesku/archive/2014/06/09/provisioning-site-collections-using-sp-app-model-in-on-premises-with-just-csom.aspx New-PnPTerm Creates a taxonomy term New PnPTerm New-PnPTerm Name The name of the term. String TermGroup The termgroup to create the term in. Id, Title or TermGroup TermSet The termset to add the term to. Id, Title or TaxonomyItem Id The Id to use for the term; if not specified, or the empty GUID, a random GUID is generated and used. Guid Lcid The locale id to use for the term. Defaults to the current locale id. Int32 Description Descriptive text to help users understand the intended use of this term. String CustomProperties Custom Properties Hashtable LocalCustomProperties Custom Properties Hashtable TermStore Term store to check; if not specified the default term store is used. Id, Name or Object Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection CustomProperties Custom Properties Hashtable Hashtable Description Descriptive text to help users understand the intended use of this term. String String Id The Id to use for the term; if not specified, or the empty GUID, a random GUID is generated and used. Guid Guid Lcid The locale id to use for the term. Defaults to the current locale id. Int32 Int32 LocalCustomProperties Custom Properties Hashtable Hashtable Name The name of the term. String String TermGroup The termgroup to create the term in. Id, Title or TermGroup Id, Title or TermGroup TermSet The termset to add the term to. Id, Title or TaxonomyItem Id, Title or TaxonomyItem TermStore Term store to check; if not specified the default term store is used. Id, Name or Object Id, Name or Object Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Microsoft.SharePoint.Client.Taxonomy.Term ------------------EXAMPLE 1--------------------- PS:> New-PnPTerm -TermSet "Departments" -TermGroup "Corporate" -Name "Finance" Creates a new taxonomy term named "Finance" in the termset Departments which is located in the "Corporate" termgroup SharePoint Developer Patterns and Practices: http://aka.ms/sppnp New-PnPTermGroup Creates a taxonomy term group New PnPTermGroup New-PnPTermGroup Name Name of the taxonomy term group to create. String Id GUID to use for the term group; if not specified, or the empty GUID, a random GUID is generated and used. Guid Description Description to use for the term group. String TermStore Term store to add the group to; if not specified the default term store is used. Id, Name or Object Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Description Description to use for the term group. String String Id GUID to use for the term group; if not specified, or the empty GUID, a random GUID is generated and used. Guid Guid Name Name of the taxonomy term group to create. String String TermStore Term store to add the group to; if not specified the default term store is used. Id, Name or Object Id, Name or Object Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Microsoft.SharePoint.Client.Taxonomy.TermGroup ------------------EXAMPLE 1--------------------- PS:> New-PnPTermGroup -GroupName "Countries" Creates a new taxonomy term group named "Countries" SharePoint Developer Patterns and Practices: http://aka.ms/sppnp New-PnPTermSet Creates a taxonomy term set New PnPTermSet New-PnPTermSet Name The name of the termset. String TermGroup Name, id or actualy termgroup to create the termset in. Id, Title or TermGroup Id The Id to use for the term set; if not specified, or the empty GUID, a random GUID is generated and used. Guid Lcid The locale id to use for the term set. Defaults to the current locale id. Int32 Contact An e-mail address for term suggestion and feedback. If left blank the suggestion feature will be disabled. String Description Descriptive text to help users understand the intended use of this term set. String IsOpenForTermCreation When a term set is closed, only metadata managers can add terms to this term set. When it is open, users can add terms from a tagging application. Not specifying this switch will make the term set closed. SwitchParameter IsNotAvailableForTagging By default a term set is available to be used by end users and content editors of sites consuming this term set. Specify this switch to turn this off SwitchParameter Owner The primary user or group of this term set. String StakeHolders People and groups in the organization that should be notified before major changes are made to the term set. You can enter multiple users or groups. String[] CustomProperties Hashtable TermStore Term store to check; if not specified the default term store is used. Id, Name or Object Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Contact An e-mail address for term suggestion and feedback. If left blank the suggestion feature will be disabled. String String CustomProperties Hashtable Hashtable Description Descriptive text to help users understand the intended use of this term set. String String Id The Id to use for the term set; if not specified, or the empty GUID, a random GUID is generated and used. Guid Guid IsNotAvailableForTagging By default a term set is available to be used by end users and content editors of sites consuming this term set. Specify this switch to turn this off SwitchParameter SwitchParameter IsOpenForTermCreation When a term set is closed, only metadata managers can add terms to this term set. When it is open, users can add terms from a tagging application. Not specifying this switch will make the term set closed. SwitchParameter SwitchParameter Lcid The locale id to use for the term set. Defaults to the current locale id. Int32 Int32 Name The name of the termset. String String Owner The primary user or group of this term set. String String StakeHolders People and groups in the organization that should be notified before major changes are made to the term set. You can enter multiple users or groups. String[] String[] TermGroup Name, id or actualy termgroup to create the termset in. Id, Title or TermGroup Id, Title or TermGroup TermStore Term store to check; if not specified the default term store is used. Id, Name or Object Id, Name or Object Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Microsoft.SharePoint.Client.Taxonomy.TermSet ------------------EXAMPLE 1--------------------- PS:> New-PnPTermSet -Name "Department" -TermGroup "Corporate" Creates a new termset named "Department" in the group named "Corporate" SharePoint Developer Patterns and Practices: http://aka.ms/sppnp New-PnPUser Adds a user to the built-in Site User Info List and returns a user object New PnPUser New-PnPUser LoginName The users login name (user@company.com) String Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection LoginName The users login name (user@company.com) String String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind Microsoft.SharePoint.Client.User ------------------EXAMPLE 1--------------------- PS:> New-PnPUser -LoginName user@company.com Adds a new user with the login user@company.com to the current site SharePoint Developer Patterns and Practices: http://aka.ms/sppnp New-PnPWeb Creates a new subweb under the current web New PnPWeb New-PnPWeb Title The title of the new web String Url The URL of the new web String Template The site definition template to use for the new web, e.g. STS#0. Use Get-PnPWebTemplates to fetch a list of available templates String Description The description of the new web String Locale The language id of the new web. default = 1033 for English Int32 BreakInheritance By default the subweb will inherit its security from its parent, specify this switch to break this inheritance SwitchParameter InheritNavigation Specifies whether the site inherits navigation. SwitchParameter Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection BreakInheritance By default the subweb will inherit its security from its parent, specify this switch to break this inheritance SwitchParameter SwitchParameter Description The description of the new web String String InheritNavigation Specifies whether the site inherits navigation. SwitchParameter SwitchParameter Locale The language id of the new web. default = 1033 for English Int32 Int32 Template The site definition template to use for the new web, e.g. STS#0. Use Get-PnPWebTemplates to fetch a list of available templates String String Title The title of the new web String String Url The URL of the new web String String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind Microsoft.SharePoint.Client.Web ------------------EXAMPLE 1--------------------- PS:> New-PnPWeb -Title "Project A Web" -Url projectA -Description "Information about Project A" -Locale 1033 -Template "STS#0" Creates a new subweb under the current web with URL projectA SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Publish-PnPApp * Supported in: SharePoint Online. Publishes/Deploys/Trusts an available app in the app catalog Publish PnPApp Publish-PnPApp Identity Specifies the Id of the app AppMetadataPipeBind SkipFeatureDeployment SwitchParameter Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Identity Specifies the Id of the app AppMetadataPipeBind AppMetadataPipeBind SkipFeatureDeployment SwitchParameter SwitchParameter Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection ------------------EXAMPLE 1--------------------- PS:> Publish-PnPApp This will deploy/trust an app into the app catalog. Notice that the app needs to be available in the app catalog SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Read-PnPProvisioningTemplate Loads/Reads a PnP file from the file system Read PnPProvisioningTemplate Read-PnPProvisioningTemplate Path Filename to read from, optionally including full path. String TemplateProviderExtensions Allows you to specify ITemplateProviderExtension to execute while loading the template. ITemplateProviderExtension[] Path Filename to read from, optionally including full path. String String TemplateProviderExtensions Allows you to specify ITemplateProviderExtension to execute while loading the template. ITemplateProviderExtension[] ITemplateProviderExtension[] ------------------EXAMPLE 1--------------------- PS:> Read-PnPProvisioningTemplate -Path template.pnp Loads a PnP file from the file systems ------------------EXAMPLE 2--------------------- PS:> Read-PnPProvisioningTemplate -Path template.pnp -TemplateProviderExtensions $extensions Loads a PnP file from the file systems using some custom template provider extenions while loading the file. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Register-PnPHubSite * Supported in: SharePoint Online. Registers a site as a hubsite Register PnPHubSite Registers a site as a hubsite Register-PnPHubSite Site The site to register as a hubsite SitePipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Site The site to register as a hubsite SitePipeBind SitePipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection ------------------EXAMPLE 1--------------------- PS:> Register-PnPHubSite -Site https://tenant.sharepoint.com/sites/myhubsite This example registers the specified site as a hubsite SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Remove-PnPApp * Supported in: SharePoint Online. Removes an app from the app catalog Remove PnPApp Remove-PnPApp Identity Specifies the Id of the Addin Instance AppMetadataPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Identity Specifies the Id of the Addin Instance AppMetadataPipeBind AppMetadataPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection ------------------EXAMPLE 1--------------------- PS:> Remove-PnPApp -Identity 99a00f6e-fb81-4dc7-8eac-e09c6f9132fe This will remove the specified app from the app catalog SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Remove-PnPClientSideComponent * Supported in: SharePoint Online. Removes a Client-Side component from a page Remove PnPClientSideComponent Remove-PnPClientSideComponent InstanceId The instance id of the component GuidPipeBind Page The name of the page ClientSidePagePipeBind Force If specified you will not receive the confirmation question SwitchParameter Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Force If specified you will not receive the confirmation question SwitchParameter SwitchParameter InstanceId The instance id of the component GuidPipeBind GuidPipeBind Page The name of the page ClientSidePagePipeBind ClientSidePagePipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Remove-PnPClientSideComponent -Page Home -InstanceId a2875399-d6ff-43a0-96da-be6ae5875f82 Removes the control specified from the page. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Remove-PnPClientSidePage * Supported in: SharePoint Online. Removes a Client-Side Page Remove PnPClientSidePage Remove-PnPClientSidePage Identity The name of the page ClientSidePagePipeBind Force Specifying the Force parameter will skip the confirmation question. SwitchParameter Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Force Specifying the Force parameter will skip the confirmation question. SwitchParameter SwitchParameter Identity The name of the page ClientSidePagePipeBind ClientSidePagePipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Remove-PnPClientSidePage -Identity "MyPage" Removes the Client-Side page named 'MyPage.aspx' ------------------EXAMPLE 2--------------------- PS:> Remove-PnPClientSidePage $page Removes the specified Client-Side page which is contained in the $page variable. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Remove-PnPContentType Removes a content type from a web Remove PnPContentType Remove-PnPContentType Identity The name or ID of the content type to remove ContentTypePipeBind Force Specifying the Force parameter will skip the confirmation question. SwitchParameter Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Force Specifying the Force parameter will skip the confirmation question. SwitchParameter SwitchParameter Identity The name or ID of the content type to remove ContentTypePipeBind ContentTypePipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Remove-PnPContentType -Identity "Project Document" This will remove a content type called "Project Document" from the current web ------------------EXAMPLE 2--------------------- PS:> Remove-PnPContentType -Identity "Project Document" -Force This will remove a content type called "Project Document" from the current web with force SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Remove-PnPContentTypeFromDocumentSet Removes a content type from a document set Remove PnPContentTypeFromDocumentSet Remove-PnPContentTypeFromDocumentSet ContentType The content type to remove. Either specify name, an id, or a content type object. ContentTypePipeBind DocumentSet The document set to remove the content type from. Either specify a name, a document set template object, an id, or a content type object DocumentSetPipeBind Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection ContentType The content type to remove. Either specify name, an id, or a content type object. ContentTypePipeBind ContentTypePipeBind DocumentSet The document set to remove the content type from. Either specify a name, a document set template object, an id, or a content type object DocumentSetPipeBind DocumentSetPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Remove-PnPContentTypeFromDocumentSet -ContentType "Test CT" -DocumentSet "Test Document Set" This will remove the content type called 'Test CT' from the document set called ''Test Document Set' ------------------EXAMPLE 2--------------------- PS:> Remove-PnPContentTypeFromDocumentSet -ContentType 0x0101001F1CEFF1D4126E4CAD10F00B6137E969 -DocumentSet 0x0120D520005DB65D094035A241BAC9AF083F825F3B This will remove the content type with ID '0x0101001F1CEFF1D4126E4CAD10F00B6137E969' from the document set with ID '0x0120D520005DB65D094035A241BAC9AF083F825F3B' SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Remove-PnPContentTypeFromList Removes a content type from a list Remove PnPContentTypeFromList Remove-PnPContentTypeFromList List The name of the list, its ID or an actual list object from where the content type needs to be removed from ListPipeBind ContentType The name of a content type, its ID or an actual content type object that needs to be removed from the specified list. ContentTypePipeBind Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection ContentType The name of a content type, its ID or an actual content type object that needs to be removed from the specified list. ContentTypePipeBind ContentTypePipeBind List The name of the list, its ID or an actual list object from where the content type needs to be removed from ListPipeBind ListPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Remove-PnPContentTypeFromList -List "Documents" -ContentType "Project Document" This will remove a content type called "Project Document" from the "Documents" list SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Remove-PnPCustomAction Removes a custom action Remove PnPCustomAction Remove-PnPCustomAction Scope Define if the CustomAction is to be found at the web or site collection scope. Specify All to allow deletion from either web or site collection. CustomActionScope Force Use the -Force flag to bypass the confirmation question SwitchParameter Identity The id or name of the CustomAction that needs to be removed or a CustomAction instance itself UserCustomActionPipeBind Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Force Use the -Force flag to bypass the confirmation question SwitchParameter SwitchParameter Identity The id or name of the CustomAction that needs to be removed or a CustomAction instance itself UserCustomActionPipeBind UserCustomActionPipeBind Scope Define if the CustomAction is to be found at the web or site collection scope. Specify All to allow deletion from either web or site collection. CustomActionScope CustomActionScope Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Remove-PnPCustomAction -Identity aa66f67e-46c0-4474-8a82-42bf467d07f2 Removes the custom action with the id 'aa66f67e-46c0-4474-8a82-42bf467d07f2'. ------------------EXAMPLE 2--------------------- PS:> Remove-PnPCustomAction -Identity aa66f67e-46c0-4474-8a82-42bf467d07f2 -Scope web Removes the custom action with the id 'aa66f67e-46c0-4474-8a82-42bf467d07f2' from the current web. ------------------EXAMPLE 3--------------------- PS:> Remove-PnPCustomAction -Identity aa66f67e-46c0-4474-8a82-42bf467d07f2 -Force Removes the custom action with the id 'aa66f67e-46c0-4474-8a82-42bf467d07f2' without asking for confirmation. ------------------EXAMPLE 4--------------------- PS:> Get-PnPCustomAction -Scope All | ? Location -eq ScriptLink | Remove-PnPCustomAction Removes all custom actions that are ScriptLinks SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Remove-PnPIndexedProperty Removes a key from propertybag to be indexed by search. The key and it's value remain in the propertybag, however it will not be indexed anymore. Remove PnPIndexedProperty Remove-PnPIndexedProperty Key Key of the property bag value to be removed from indexing String Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Key Key of the property bag value to be removed from indexing String String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Remove-PnPIndexedProperty -key "MyIndexProperty" Removes the Indexed property "MyIndexProperty" from the current web SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Remove-PnPEventReceiver Remove an eventreceiver Remove PnPEventReceiver Removes/unregisters a specific eventreceiver Remove-PnPEventReceiver Identity The Guid of the event receiver on the list EventReceiverPipeBind List The list object from where to remove the event receiver object ListPipeBind Force Specifying the Force parameter will skip the confirmation question SwitchParameter Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Force Specifying the Force parameter will skip the confirmation question SwitchParameter SwitchParameter Identity The Guid of the event receiver on the list EventReceiverPipeBind EventReceiverPipeBind List The list object from where to remove the event receiver object ListPipeBind ListPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Remove-PnPEventReceiver -Identity fb689d0e-eb99-4f13-beb3-86692fd39f22 This will remove the event receiver with ReceiverId "fb689d0e-eb99-4f13-beb3-86692fd39f22" from the current web ------------------EXAMPLE 2--------------------- PS:> Remove-PnPEventReceiver -List ProjectList -Identity fb689d0e-eb99-4f13-beb3-86692fd39f22 This will remove the event receiver with ReceiverId "fb689d0e-eb99-4f13-beb3-86692fd39f22" from the "ProjectList" list ------------------EXAMPLE 3--------------------- PS:> Remove-PnPEventReceiver -List ProjectList -Identity MyReceiver This will remove the event receiver with ReceiverName "MyReceiver" from the "ProjectList" list ------------------EXAMPLE 4--------------------- PS:> Remove-PnPEventReceiver -List ProjectList This will remove all event receivers from the "ProjectList" list ------------------EXAMPLE 5--------------------- PS:> Remove-PnPEventReceiver This will remove all event receivers from the current site ------------------EXAMPLE 6--------------------- PS:> Get-PnPEventReceiver | ? ReceiverUrl -Like "*azurewebsites.net*" | Remove-PnPEventReceiver This will remove all event receivers from the current site which are pointing to a service hosted on Azure Websites SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Remove-PnPField Removes a field from a list or a site Remove PnPField Remove-PnPField Identity The field object or name to remove FieldPipeBind Force Specifying the Force parameter will skip the confirmation question. SwitchParameter List The list object or name where to remove the field from ListPipeBind Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Force Specifying the Force parameter will skip the confirmation question. SwitchParameter SwitchParameter Identity The field object or name to remove FieldPipeBind FieldPipeBind List The list object or name where to remove the field from ListPipeBind ListPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Remove-PnPField -Identity "Speakers" Removes the speakers field from the site columns ------------------EXAMPLE 2--------------------- PS:> Remove-PnPField -List "Demo list" -Identity "Speakers" Removes the speakers field from the list Demo list SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Remove-PnPFieldFromContentType Removes a site column from a content type Remove PnPFieldFromContentType Remove-PnPFieldFromContentType Field The field to remove FieldPipeBind ContentType The content type where the field is to be removed from ContentTypePipeBind DoNotUpdateChildren If specified, inherited content types will not be updated SwitchParameter Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection ContentType The content type where the field is to be removed from ContentTypePipeBind ContentTypePipeBind DoNotUpdateChildren If specified, inherited content types will not be updated SwitchParameter SwitchParameter Field The field to remove FieldPipeBind FieldPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Remove-PnPFieldFromContentType -Field "Project_Name" -ContentType "Project Document" This will remove the site column with an internal name of "Project_Name" from a content type called "Project Document" ------------------EXAMPLE 2--------------------- PS:> Remove-PnPFieldFromContentType -Field "Project_Name" -ContentType "Project Document" -DoNotUpdateChildren This will remove the site column with an internal name of "Project_Name" from a content type called "Project Document". It will not update content types that inherit from the "Project Document" content type. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Remove-PnPFile Removes a file. Remove PnPFile Remove-PnPFile ServerRelativeUrl Server relative URL to the file String Recycle SwitchParameter Force SwitchParameter Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Remove-PnPFile SiteRelativeUrl Site relative URL to the file String Recycle SwitchParameter Force SwitchParameter Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Force SwitchParameter SwitchParameter Recycle SwitchParameter SwitchParameter ServerRelativeUrl Server relative URL to the file String String SiteRelativeUrl Site relative URL to the file String String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:>Remove-PnPFile -ServerRelativeUrl /sites/project/_catalogs/themes/15/company.spcolor Removes the file company.spcolor ------------------EXAMPLE 2--------------------- PS:>Remove-PnPFile -SiteRelativeUrl _catalogs/themes/15/company.spcolor Removes the file company.spcolor ------------------EXAMPLE 3--------------------- PS:>Remove-PnPFile -SiteRelativeUrl _catalogs/themes/15/company.spcolor -Recycle Removes the file company.spcolor and saves it to the Recycle Bin SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Remove-PnPFileFromProvisioningTemplate Removes a file from a PnP Provisioning Template Remove PnPFileFromProvisioningTemplate Remove-PnPFileFromProvisioningTemplate Path Filename to read the template from, optionally including full path. String FilePath The relative File Path of the file to remove from the in-memory template String TemplateProviderExtensions Allows you to specify ITemplateProviderExtension to execute while saving the template. ITemplateProviderExtension[] FilePath The relative File Path of the file to remove from the in-memory template String String Path Filename to read the template from, optionally including full path. String String TemplateProviderExtensions Allows you to specify ITemplateProviderExtension to execute while saving the template. ITemplateProviderExtension[] ITemplateProviderExtension[] ------------------EXAMPLE 1--------------------- PS:> Remove-PnPFileFromProvisioningTemplate -Path template.pnp -FilePath filePath Removes a file from an in-memory PnP Provisioning Template SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Remove-PnPFolder Deletes a folder within a parent folder Remove PnPFolder Remove-PnPFolder Name The folder name String Folder The parent folder in the site String Recycle SwitchParameter Force SwitchParameter Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Folder The parent folder in the site String String Force SwitchParameter SwitchParameter Name The folder name String String Recycle SwitchParameter SwitchParameter Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Remove-PnPFolder -Name NewFolder -Folder _catalogs/masterpage Removes the folder 'NewFolder' from '_catalogsmasterpage' ------------------EXAMPLE 2--------------------- PS:> Remove-PnPFolder -Name NewFolder -Folder _catalogs/masterpage -Recycle Removes the folder 'NewFolder' from '_catalogsmasterpage' and is saved in the Recycle Bin SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Remove-PnPGroup Removes a group from a web. Remove PnPGroup Remove-PnPGroup Force Specifying the Force parameter will skip the confirmation question. SwitchParameter Identity A group object, an ID or a name of a group to remove GroupPipeBind Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Force Specifying the Force parameter will skip the confirmation question. SwitchParameter SwitchParameter Identity A group object, an ID or a name of a group to remove GroupPipeBind GroupPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Remove-PnPGroup -Identity "My Users" Removes the group "My Users" SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Remove-PnPHubSiteAssociation * Supported in: SharePoint Online. Disconnects a site from a hubsite. Remove PnPHubSiteAssociation Disconnects an site from a hubsite Remove-PnPHubSiteAssociation Site The site to disconnect from its hubsite SitePipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Site The site to disconnect from its hubsite SitePipeBind SitePipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection ------------------EXAMPLE 1--------------------- PS:> Remove-PnPHubSiteAssociation -Site https://tenant.sharepoint.com/sites/mysite -HubSite https://tenant.sharepoint.com/sites/hubsite This example adds the specified site to the hubsite. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Remove-PnPJavaScriptLink Removes a JavaScript link or block from a web or sitecollection Remove PnPJavaScriptLink Remove-PnPJavaScriptLink Force Use the -Force flag to bypass the confirmation question SwitchParameter Scope Define if the JavaScriptLink is to be found at the web or site collection scope. Specify All to allow deletion from either web or site collection. CustomActionScope Identity Name or id of the JavaScriptLink to remove. Omit if you want to remove all JavaScript Links. UserCustomActionPipeBind Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Force Use the -Force flag to bypass the confirmation question SwitchParameter SwitchParameter Identity Name or id of the JavaScriptLink to remove. Omit if you want to remove all JavaScript Links. UserCustomActionPipeBind UserCustomActionPipeBind Scope Define if the JavaScriptLink is to be found at the web or site collection scope. Specify All to allow deletion from either web or site collection. CustomActionScope CustomActionScope Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Remove-PnPJavaScriptLink -Identity jQuery Removes the injected JavaScript file with the name jQuery from the current web after confirmation ------------------EXAMPLE 2--------------------- PS:> Remove-PnPJavaScriptLink -Identity jQuery -Scope Site Removes the injected JavaScript file with the name jQuery from the current site collection after confirmation ------------------EXAMPLE 3--------------------- PS:> Remove-PnPJavaScriptLink -Identity jQuery -Scope Site -Confirm:$false Removes the injected JavaScript file with the name jQuery from the current site collection and will not ask for confirmation ------------------EXAMPLE 4--------------------- PS:> Remove-PnPJavaScriptLink -Scope Site Removes all the injected JavaScript files from the current site collection after confirmation for each of them ------------------EXAMPLE 5--------------------- PS:> Remove-PnPJavaScriptLink -Identity faea0ce2-f0c2-4d45-a4dc-73898f3c2f2e -Scope All Removes the injected JavaScript file with id faea0ce2-f0c2-4d45-a4dc-73898f3c2f2e from both the Web and Site scopes ------------------EXAMPLE 6--------------------- PS:> Get-PnPJavaScriptLink -Scope All | ? Sequence -gt 1000 | Remove-PnPJavaScriptLink Removes all the injected JavaScript files from both the Web and Site scope that have a sequence number higher than 1000 SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Remove-PnPList Deletes a list Remove PnPList Remove-PnPList Identity The ID or Title of the list. ListPipeBind Recycle SwitchParameter Force Specifying the Force parameter will skip the confirmation question. SwitchParameter Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Force Specifying the Force parameter will skip the confirmation question. SwitchParameter SwitchParameter Identity The ID or Title of the list. ListPipeBind ListPipeBind Recycle SwitchParameter SwitchParameter Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Remove-PnPList -Identity Announcements Removes the list named 'Announcements'. Asks for confirmation. ------------------EXAMPLE 2--------------------- PS:> Remove-PnPList -Identity Announcements -Force Removes the list named 'Announcements' without asking for confirmation. ------------------EXAMPLE 3--------------------- PS:> Remove-PnPList -Title Announcements -Recycle Removes the list named 'Announcements' and saves to the Recycle Bin SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Remove-PnPListItem Deletes an item from a list Remove PnPListItem Remove-PnPListItem Identity The ID of the listitem, or actual ListItem object ListItemPipeBind List The ID, Title or Url of the list. ListPipeBind Recycle SwitchParameter Force Specifying the Force parameter will skip the confirmation question. SwitchParameter Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Force Specifying the Force parameter will skip the confirmation question. SwitchParameter SwitchParameter Identity The ID of the listitem, or actual ListItem object ListItemPipeBind ListItemPipeBind List The ID, Title or Url of the list. ListPipeBind ListPipeBind Recycle SwitchParameter SwitchParameter Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Remove-PnPListItem -List "Demo List" -Identity "1" -Force Removes the listitem with id "1" from the "Demo List" list. ------------------EXAMPLE 2--------------------- PS:> Remove-PnPListItem -List "Demo List" -Identity "1" -Force -Recycle Removes the listitem with id "1" from the "Demo List" list and saves it in the Recycle Bin. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Remove-PnPNavigationNode Removes a menu item from either the quicklaunch or top navigation Remove PnPNavigationNode Remove-PnPNavigationNode Identity The Id or node object to delete NavigationNodePipeBind Force Specifying the Force parameter will skip the confirmation question. SwitchParameter Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Remove-PnPNavigationNode All Specifying the All parameter will remove all the nodes from specifed Location. SwitchParameter Force Specifying the Force parameter will skip the confirmation question. SwitchParameter Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection All Specifying the All parameter will remove all the nodes from specifed Location. SwitchParameter SwitchParameter Force Specifying the Force parameter will skip the confirmation question. SwitchParameter SwitchParameter Identity The Id or node object to delete NavigationNodePipeBind NavigationNodePipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Remove-PnPNavigationNode -Identity 1032 Removes the navigation node with the specified id ------------------EXAMPLE 2--------------------- PS:> $nodes = Get-PnPNavigationNode -QuickLaunch PS:>$nodes | Select-Object -First 1 | Remove-PnPNavigationNode -Force Retrieves all navigation nodes from the Quick Launch navigation, then removes the first node in the list and it will not ask for a confirmation ------------------EXAMPLE 3--------------------- PS:> Remove-PnPNavigationNode -Title Recent -Location QuickLaunch Will remove the recent navigation node from the quick launch in the current web. ------------------EXAMPLE 4--------------------- PS:> Remove-PnPNavigationNode -Title Home -Location TopNavigationBar -Force Will remove the home navigation node from the top navigation bar without prompting for a confirmation in the current web. ------------------EXAMPLE 5--------------------- PS:> Remove-PnPNavigationNode -Location QuickLaunch -All Will remove all the navigation nodes from the quick launch bar in the current web. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Remove-PnPStorageEntity * Supported in: SharePoint Online. Remove Storage Entities / Farm Properties. Remove PnPStorageEntity Remove-PnPStorageEntity Key The key of the value to set. String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Key The key of the value to set. String String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection ------------------EXAMPLE 1--------------------- PS:> Remove-PnPStorageEntity -Key MyKey Removes an existing storage entity / farm property SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Remove-PnPPropertyBagValue Removes a value from the property bag Remove PnPPropertyBagValue Remove-PnPPropertyBagValue Key Key of the property bag value to be removed String Folder Site relative url of the folder. See examples for use. String Force SwitchParameter Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Folder Site relative url of the folder. See examples for use. String String Force SwitchParameter SwitchParameter Key Key of the property bag value to be removed String String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Remove-PnPPropertyBagValue -Key MyKey This will remove the value with key MyKey from the current web property bag ------------------EXAMPLE 2--------------------- PS:> Remove-PnPPropertyBagValue -Key MyKey -Folder /MyFolder This will remove the value with key MyKey from the folder MyFolder which is located in the root folder of the current web ------------------EXAMPLE 3--------------------- PS:> Remove-PnPPropertyBagValue -Key MyKey -Folder / This will remove the value with key MyKey from the root folder of the current web SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Remove-PnPPublishingImageRendition Removes an existing image rendition Remove PnPPublishingImageRendition Remove-PnPPublishingImageRendition Identity The display name or id of the Image Rendition. ImageRenditionPipeBind Force If provided, no confirmation will be asked to remove the Image Rendition. SwitchParameter Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Force If provided, no confirmation will be asked to remove the Image Rendition. SwitchParameter SwitchParameter Identity The display name or id of the Image Rendition. ImageRenditionPipeBind ImageRenditionPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Remove-PnPPublishingImageRendition -Name "MyImageRendition" -Width 800 -Height 600 SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Remove-PnPRoleDefinition Remove a Role Definition from a site Remove PnPRoleDefinition Remove-PnPRoleDefinition Identity The identity of the role definition, either a RoleDefinition object or a the name of roledefinition RoleDefinitionPipeBind Force Do not ask for confirmation to delete the role definition SwitchParameter Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Force Do not ask for confirmation to delete the role definition SwitchParameter SwitchParameter Identity The identity of the role definition, either a RoleDefinition object or a the name of roledefinition RoleDefinitionPipeBind RoleDefinitionPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection ------------------EXAMPLE 1--------------------- PS:> Remove-PnPRoleDefinition -Identity MyRoleDefinition Removes the specified Role Definition (Permission Level) from the current site SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Remove-PnPTenantSite * Supported in: SharePoint Online. Removes a site collection Remove PnPTenantSite Removes a site collection which is listed in your tenant administration site. Remove-PnPTenantSite Url Specifies the full URL of the site collection that needs to be deleted String SkipRecycleBin Do not add to the tenant scoped recycle bin when selected. SwitchParameter Force Do not ask for confirmation. SwitchParameter Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Force Do not ask for confirmation. SwitchParameter SwitchParameter SkipRecycleBin Do not add to the tenant scoped recycle bin when selected. SwitchParameter SwitchParameter Url Specifies the full URL of the site collection that needs to be deleted String String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection ------------------EXAMPLE 1--------------------- PS:> Remove-PnPTenantSite -Url https://tenant.sharepoint.com/sites/contoso This will remove the site collection with the url 'https://tenant.sharepoint.com/sites/contoso' and put it in the recycle bin. ------------------EXAMPLE 2--------------------- PS:> Remove-PnPTenantSite -Url https://tenant.sharepoint.com/sites/contoso -Force -SkipRecycleBin This will remove the site collection with the url 'https://tenant.sharepoint.com/sites/contoso' with force and it will skip the recycle bin. ------------------EXAMPLE 3--------------------- PS:> Remove-PnPTenantSite -Url https://tenant.sharepoint.com/sites/contoso -FromRecycleBin This will remove the site collection with the url 'https://tenant.sharepoint.com/sites/contoso' from the recycle bin. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Remove-PnPSiteClassification * Supported in: SharePoint Online. Removes one or more existing site classification values from the list of available values. Requires a connection to the Microsoft Graph Remove PnPSiteClassification Remove-PnPSiteClassification Classifications String Confirm Specifying the Confirm parameter will allow the confirmation question to be skipped SwitchParameter Classifications String String Confirm Specifying the Confirm parameter will allow the confirmation question to be skipped SwitchParameter SwitchParameter ------------------EXAMPLE 1--------------------- PS:> Connect-PnPOnline -Scopes "Directory.ReadWrite.All" PS:> Remove-PnPSiteClassification -Classifications "HBI" Removes the "HBI" site classification from the list of available values. ------------------EXAMPLE 2--------------------- PS:> Connect-PnPOnline -Scopes "Directory.ReadWrite.All" PS:> Remove-PnPSiteClassification -Classifications "HBI", "Top Secret" Removes the "HBI" site classification from the list of available values. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Remove-PnPSiteCollectionAdmin Removes one or more users as site collection administrators from the site collection in the current context Remove PnPSiteCollectionAdmin This command allows removing one to many users as site collection administrators from the site collection in the current context. All existing site collection administrators not included in this command will remain site collection administrator. Remove-PnPSiteCollectionAdmin Owners Specifies owner(s) to remove as site collection adminstrators. Can be both users and groups. UserPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Owners Specifies owner(s) to remove as site collection adminstrators. Can be both users and groups. UserPipeBind UserPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection ------------------EXAMPLE 1--------------------- PS:> Remove-PnPSiteCollectionAdmin -Owners "user@contoso.onmicrosoft.com" This will remove user@contoso.onmicrosoft.com as a site collection owner from the site collection in the current context ------------------EXAMPLE 2--------------------- PS:> Remove-PnPSiteCollectionAdmin -Owners @("user1@contoso.onmicrosoft.com", "user2@contoso.onmicrosoft.com") This will remove user1@contoso.onmicrosoft.com and user2@contoso.onmicrosoft.com as site collection owners from the site collection in the current context ------------------EXAMPLE 3--------------------- PS:> Get-PnPUser | ? Title -Like "*Doe" | Remove-PnPSiteCollectionAdmin This will remove all users with their title ending with "Doe" as site collection owners from the site collection in the current context ------------------EXAMPLE 4--------------------- PS:> Get-PnPSiteCollectionAdmin | Remove-PnPSiteCollectionAdmin This will remove all existing site collection administrators from the site collection in the current context SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Remove-PnPSiteCollectionAppCatalog * Supported in: SharePoint Online. Removes a Site Collection scoped App Catalog from a site Remove PnPSiteCollectionAppCatalog Notice that this will not remove the App Catalog list and its contents from the site. Remove-PnPSiteCollectionAppCatalog Site Url of the site to remove the app catalog from. SitePipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Site Url of the site to remove the app catalog from. SitePipeBind SitePipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection ------------------EXAMPLE 1--------------------- PS:> Remove-PnPOffice365GroupToSite -Url "https://contoso.sharepoint.com/sites/FinanceTeamsite" This will remove a SiteCollection app catalog from the specified site SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Remove-PnPSiteDesign * Supported in: SharePoint Online. Removes a Site Design Remove PnPSiteDesign Remove-PnPSiteDesign Identity The ID of the site design to remove TenantSiteDesignPipeBind Force If specified you will not be asked to confirm removing the specified Site Design SwitchParameter Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Force If specified you will not be asked to confirm removing the specified Site Design SwitchParameter SwitchParameter Identity The ID of the site design to remove TenantSiteDesignPipeBind TenantSiteDesignPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection ------------------EXAMPLE 1--------------------- PS:> Remove-PnPSiteDesign -Identity 5c73382d-9643-4aa0-9160-d0cba35e40fd Removes the specified site design SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Remove-PnPSiteScript * Supported in: SharePoint Online. Removes a Site Script Remove PnPSiteScript Remove-PnPSiteScript Identity The ID of the Site Script to remove TenantSiteScriptPipeBind Force If specified you will not be asked to confirm removing the specified Site Script SwitchParameter Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Force If specified you will not be asked to confirm removing the specified Site Script SwitchParameter SwitchParameter Identity The ID of the Site Script to remove TenantSiteScriptPipeBind TenantSiteScriptPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection ------------------EXAMPLE 1--------------------- PS:> Remove-PnPSiteScript -Identity 5c73382d-9643-4aa0-9160-d0cba35e40fd Removes the specified site script SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Remove-PnPStoredCredential Removes a credential Remove PnPStoredCredential Removes a stored credential from the Windows Credential Manager Remove-PnPStoredCredential Name The credential to remove String Force If specified you will not be asked for confirmation SwitchParameter Force If specified you will not be asked for confirmation SwitchParameter SwitchParameter Name The credential to remove String String ------------------EXAMPLE 1--------------------- PS:> Remove-PnPStoredCredential -Name https://tenant.sharepoint.com Removes the specified credential from the Windows Credential Manager SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Remove-PnPTaxonomyItem Removes a taxonomy item Remove PnPTaxonomyItem Remove-PnPTaxonomyItem TermPath The path, delimited by | of the taxonomy item to remove, alike GROUPLABEL|TERMSETLABEL|TERMLABEL String Force SwitchParameter Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Force SwitchParameter SwitchParameter TermPath The path, delimited by | of the taxonomy item to remove, alike GROUPLABEL|TERMSETLABEL|TERMLABEL String String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Remove-PnPTenantCdnOrigin * Supported in: SharePoint Online. Removes an origin from the Public or Private content delivery network (CDN). Remove PnPTenantCdnOrigin Removes an origin from the Public or Private content delivery network (CDN). You must be a SharePoint Online global administrator to run the cmdlet. Remove-PnPTenantCdnOrigin OriginUrl The origin to remove. String CdnType The cdn type to remove the origin from. SPOTenantCdnType Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection CdnType The cdn type to remove the origin from. SPOTenantCdnType SPOTenantCdnType OriginUrl The origin to remove. String String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection ------------------EXAMPLE 1--------------------- PS:> Remove-PnPTenantCdnOrigin -Url /sites/site/subfolder -CdnType Public This example removes the specified origin from the public CDN SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Remove-PnPTenantTheme * Supported in: SharePoint Online. Removes a theme Remove PnPTenantTheme Removes the specified theme from the tenant configuration Remove-PnPTenantTheme Identity The name of the theme to retrieve ThemePipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Identity The name of the theme to retrieve ThemePipeBind ThemePipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection ------------------EXAMPLE 1--------------------- PS:> Remove-PnPTenantTheme -Name "MyCompanyTheme" Removes the specified theme. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Remove-PnPTermGroup Removes a taxonomy term group and all its containing termsets Remove PnPTermGroup Remove-PnPTermGroup GroupName Name of the taxonomy term group to delete. String TermStoreName Term store to use; if not specified the default term store is used. String Force SwitchParameter Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Force SwitchParameter SwitchParameter GroupName Name of the taxonomy term group to delete. String String TermStoreName Term store to use; if not specified the default term store is used. String String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Remove-PnPUnifiedGroup * Supported in: SharePoint Online. Removes one Office 365 Group (aka Unified Group) or a list of Office 365 Groups Remove PnPUnifiedGroup Remove-PnPUnifiedGroup Identity The Identity of the Office 365 Group. UnifiedGroupPipeBind Identity The Identity of the Office 365 Group. UnifiedGroupPipeBind UnifiedGroupPipeBind ------------------EXAMPLE 1--------------------- PS:> Remove-PnPUnifiedGroup -Identity $groupId Removes an Office 365 Groups based on its ID ------------------EXAMPLE 2--------------------- PS:> Remove-PnPUnifiedGroup -Identity $group Removes the provided Office 365 Groups SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Remove-PnPUser Removes a specific user from the site collection User Information List Remove PnPUser This command will allow the removal of a specific user from the User Information List Remove-PnPUser Identity User ID or login name UserPipeBind Force Specifying the Force parameter will skip the confirmation question SwitchParameter Confirm Specifying the Confirm parameter will allow the confirmation question to be skipped SwitchParameter Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Confirm Specifying the Confirm parameter will allow the confirmation question to be skipped SwitchParameter SwitchParameter Force Specifying the Force parameter will skip the confirmation question SwitchParameter SwitchParameter Identity User ID or login name UserPipeBind UserPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind Microsoft.SharePoint.Client.User ------------------EXAMPLE 1--------------------- PS:> Remove-PnPUser -Identity 23 Remove the user with Id 23 from the User Information List of the current site collection ------------------EXAMPLE 2--------------------- PS:> Remove-PnPUser -Identity i:0#.f|membership|user@tenant.onmicrosoft.com Remove the user with LoginName i:0#.f|membership|user@tenant.onmicrosoft.com from the User Information List of the current site collection ------------------EXAMPLE 3--------------------- PS:> Get-PnPUser | ? Email -eq "user@tenant.onmicrosoft.com" | Remove-PnPUser Remove the user with e-mail address user@tenant.onmicrosoft.com from the User Information List of the current site collection ------------------EXAMPLE 4--------------------- PS:> Remove-PnPUser -Identity i:0#.f|membership|user@tenant.onmicrosoft.com -Confirm:$false Remove the user with LoginName i:0#.f|membership|user@tenant.onmicrosoft.com from the User Information List of the current site collection without asking to confirm the removal first SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Remove-PnPUserFromGroup Removes a user from a group Remove PnPUserFromGroup Remove-PnPUserFromGroup LoginName A valid login name of a user (user@company.com) String Identity A group object, an ID or a name of a group GroupPipeBind Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Identity A group object, an ID or a name of a group GroupPipeBind GroupPipeBind LoginName A valid login name of a user (user@company.com) String String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Remove-PnPUserFromGroup -LoginName user@company.com -GroupName 'Marketing Site Members' Removes the user user@company.com from the Group 'Marketing Site Members' SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Remove-PnPView Deletes a view from a list Remove PnPView Remove-PnPView Identity The ID or Title of the view. ViewPipeBind List The ID or Url of the list. ListPipeBind Force Specifying the Force parameter will skip the confirmation question. SwitchParameter Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Force Specifying the Force parameter will skip the confirmation question. SwitchParameter SwitchParameter Identity The ID or Title of the view. ViewPipeBind ViewPipeBind List The ID or Url of the list. ListPipeBind ListPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Remove-PnPView -List "Demo List" -Identity "All Items" Removes the view with title "All Items" from the "Demo List" list. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Remove-PnPWeb Removes a subweb in the current web Remove PnPWeb Remove-PnPWeb Url The site relative url of the web, e.g. 'Subweb1' String Force Do not ask for confirmation to delete the subweb SwitchParameter Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Remove-PnPWeb Identity Identity/Id/Web object to delete WebPipeBind Force Do not ask for confirmation to delete the subweb SwitchParameter Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Force Do not ask for confirmation to delete the subweb SwitchParameter SwitchParameter Identity Identity/Id/Web object to delete WebPipeBind WebPipeBind Url The site relative url of the web, e.g. 'Subweb1' String String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Remove-PnPWeb -Url projectA Remove a web ------------------EXAMPLE 2--------------------- PS:> Remove-PnPWeb -Identity 5fecaf67-6b9e-4691-a0ff-518fc9839aa0 Remove a web specified by its ID ------------------EXAMPLE 3--------------------- PS:> Get-PnPSubWebs | Remove-PnPWeb -Force Remove all subwebs and do not ask for confirmation SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Remove-PnPWebhookSubscription * Supported in: SharePoint Online. Removes a Webhook subscription from the resource Remove PnPWebhookSubscription Remove-PnPWebhookSubscription Identity The identity of the Webhook subscription to remove WebhookSubscriptionPipeBind List The list object or name which the Webhook subscription will be removed from ListPipeBind Force Specifying the Force parameter will skip the confirmation question. SwitchParameter Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Force Specifying the Force parameter will skip the confirmation question. SwitchParameter SwitchParameter Identity The identity of the Webhook subscription to remove WebhookSubscriptionPipeBind WebhookSubscriptionPipeBind List The list object or name which the Webhook subscription will be removed from ListPipeBind ListPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind OfficeDevPnP.Core.Entities.WebhookSubscription ------------------EXAMPLE 1--------------------- PS:> Remove-PnPWebhookSubscription -List MyList -Identity ea1533a8-ff03-415b-a7b6-517ee50db8b6 Removes the Webhook subscription with the specified id from the list MyList ------------------EXAMPLE 2--------------------- PS:> $subscriptions = Get-PnPWebhookSubscriptions -List MyList PS:> Remove-PnPWebhookSubscription -Identity $subscriptions[0] -List MyList Removes the first Webhook subscription from the list MyList ------------------EXAMPLE 3--------------------- PS:> $subscriptions = Get-PnPWebhookSubscriptions -List MyList PS:> $subscriptions[0] | Remove-PnPWebhookSubscription -List MyList Removes the first Webhook subscription from the list MyList SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Remove-PnPWebPart Removes a webpart from a page Remove PnPWebPart Remove-PnPWebPart Identity The Guid of the webpart GuidPipeBind ServerRelativePageUrl Full server relative url of the webpart page, e.g. /sites/demo/sitepages/home.aspx String Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Remove-PnPWebPart Title The name of the webpart String ServerRelativePageUrl Full server relative url of the webpart page, e.g. /sites/demo/sitepages/home.aspx String Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Identity The Guid of the webpart GuidPipeBind GuidPipeBind ServerRelativePageUrl Full server relative url of the webpart page, e.g. /sites/demo/sitepages/home.aspx String String Title The name of the webpart String String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Remove-PnPWebPartToWikiPage -ServerRelativePageUrl "/sites/demo/sitepages/home.aspx" -Identity a2875399-d6ff-43a0-96da-be6ae5875f82 This will remove the webpart as defined by the XML in the listview.webpart file to the specified page in the first row and the first column of the HTML table present on the page ------------------EXAMPLE 2--------------------- PS:> Remove-PnPWebPartToWikiPage -ServerRelativePageUrl "/sites/demo/sitepages/home.aspx" -Name MyWebpart This will remove the webpart as defined by the XML in the listview.webpart file to the specified page in the first row and the first column of the HTML table present on the page SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Remove-PnPWikiPage Removes a wiki page Remove PnPWikiPage Remove-PnPWikiPage ServerRelativePageUrl String Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Remove-PnPWikiPage SiteRelativePageUrl String Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection ServerRelativePageUrl String String SiteRelativePageUrl String String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Remove-PnPWikiPage -PageUrl '/pages/wikipage.aspx' Removes the page '/pages/wikipage.aspx' SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Remove-PnPWorkflowDefinition Removes a workflow definition Remove PnPWorkflowDefinition Remove-PnPWorkflowDefinition Identity The definition to remove WorkflowDefinitionPipeBind Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Identity The definition to remove WorkflowDefinitionPipeBind WorkflowDefinitionPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Remove-PnPWorkflowDefinition -Identity $wfDef Removes the workflow, retrieved by Get-PnPWorkflowDefinition, from the site. ------------------EXAMPLE 2--------------------- PS:> Get-PnPWorkflowDefinition -Name MyWorkflow | Remove-PnPWorkflowDefinition Get the workflow MyWorkFlow and remove from the site. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Remove-PnPWorkflowSubscription Remove workflow subscription Remove PnPWorkflowSubscription Removes a previously registered workflow subscription Remove-PnPWorkflowSubscription Identity The subscription to remove WorkflowSubscriptionPipeBind Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Identity The subscription to remove WorkflowSubscriptionPipeBind WorkflowSubscriptionPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Remove-PnPWorkflowSubscription -identity $wfSub Removes the workflowsubscription, retrieved by Get-PnPWorkflowSubscription. ------------------EXAMPLE 2--------------------- PS:> Get-PnPWorkflowSubscription -Name MyWorkflow | Remove-PnPWorkflowSubscription Get the workflowSubscription MyWorkFlow and remove it. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Rename-PnPFile Renames a file in its current location Rename PnPFile Rename-PnPFile ServerRelativeUrl Server relative Url specifying the file to rename. Must include the file name. String TargetFileName File name to rename the file to. Should only be the file name and not include the path to its location. Use Move-PnPFile to move the file to another location. String OverwriteIfAlreadyExists If provided, if a file already exist with the provided TargetFileName, it will be overwritten. If ommitted, the rename operation will be canceled if a file already exists with the TargetFileName file name. SwitchParameter Force If provided, no confirmation will be requested and the action will be performed SwitchParameter Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Rename-PnPFile SiteRelativeUrl Site relative Url specifying the file to rename. Must include the file name. String TargetFileName File name to rename the file to. Should only be the file name and not include the path to its location. Use Move-PnPFile to move the file to another location. String OverwriteIfAlreadyExists If provided, if a file already exist with the provided TargetFileName, it will be overwritten. If ommitted, the rename operation will be canceled if a file already exists with the TargetFileName file name. SwitchParameter Force If provided, no confirmation will be requested and the action will be performed SwitchParameter Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Force If provided, no confirmation will be requested and the action will be performed SwitchParameter SwitchParameter OverwriteIfAlreadyExists If provided, if a file already exist with the provided TargetFileName, it will be overwritten. If ommitted, the rename operation will be canceled if a file already exists with the TargetFileName file name. SwitchParameter SwitchParameter ServerRelativeUrl Server relative Url specifying the file to rename. Must include the file name. String String SiteRelativeUrl Site relative Url specifying the file to rename. Must include the file name. String String TargetFileName File name to rename the file to. Should only be the file name and not include the path to its location. Use Move-PnPFile to move the file to another location. String String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:>Rename-PnPFile -ServerRelativeUrl /sites/project/Documents/company.docx -TargetFileName mycompany.docx Renames a file named company.docx located in the document library called Documents located in the projects sitecollection under the managed path sites to mycompany.docx. If a file named mycompany.aspx already exists, it won't perform the rename. ------------------EXAMPLE 2--------------------- PS:>Rename-PnPFile -SiteRelativeUrl Documents/company.aspx -TargetFileName mycompany.docx Renames a file named company.docx located in the document library called Documents located in the current site to mycompany.aspx. If a file named mycompany.aspx already exists, it won't perform the rename. ------------------EXAMPLE 3--------------------- PS:>Rename-PnPFile -ServerRelativeUrl /sites/project/Documents/company.docx -TargetFileName mycompany.docx -OverwriteIfAlreadyExists Renames a file named company.docx located in the document library called Documents located in the projects sitecollection under the managed path sites to mycompany.aspx. If a file named mycompany.aspx already exists, it will still perform the rename and replace the original mycompany.aspx file. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Rename-PnPFolder Renames a folder Rename PnPFolder Rename-PnPFolder Folder The folder to rename String TargetFolderName The new folder name String Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Folder The folder to rename String String TargetFolderName The new folder name String String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Rename-PnPFolder -Folder Documents/Reports -TargetFolderName 'Archived Reports' This will rename the folder Reports in the Documents library to 'Archived Reports' SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Request-PnPReIndexList Marks the list for full indexing during the next incremental crawl Request PnPReIndexList Request-PnPReIndexList Identity The ID, Title or Url of the list. ListPipeBind Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Identity The ID, Title or Url of the list. ListPipeBind ListPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Request-PnPReIndexList -Identity "Demo List" SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Request-PnPReIndexWeb Marks the web for full indexing during the next incremental crawl Request PnPReIndexWeb Request-PnPReIndexWeb Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Resolve-PnPFolder Returns a folder from a given site relative path, and will create it if it does not exist. Resolve PnPFolder Returns a folder from a given site relative path, and will create it if it does not exist. If you do not want the folder to be created, for instance just to test if a folder exists, use Get-PnPFolder Resolve-PnPFolder SiteRelativePath Site Relative Folder Path String Web The web to apply the command to. Omit this parameter to use the current web. WebPipeBind Includes Specify properties to include when retrieving objects from the server. String[] Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Includes Specify properties to include when retrieving objects from the server. String[] String[] SiteRelativePath Site Relative Folder Path String String Web The web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Microsoft.SharePoint.Client.Folder ------------------EXAMPLE 1--------------------- PS:> Resolve-PnPFolder -SiteRelativePath "demofolder/subfolder" Creates a folder called subfolder in a folder called demofolder located in the root folder of the site. If the folder hierarchy does not exist, it will be created. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Get-PnPFolder: https://github.com/OfficeDev/PnP-PowerShell/blob/master/Documentation/GetPnPFolder.md Restore-PnPRecycleBinItem Restores the provided recycle bin item to its original location Restore PnPRecycleBinItem Restore-PnPRecycleBinItem Identity Id of the recycle bin item or the recycle bin item object itself to restore RecycleBinItemPipeBind Force If provided, no confirmation will be asked to restore the recycle bin item SwitchParameter Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Restore-PnPRecycleBinItem All If provided all items will be stored SwitchParameter Force If provided, no confirmation will be asked to restore the recycle bin item SwitchParameter Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection All If provided all items will be stored SwitchParameter SwitchParameter Force If provided, no confirmation will be asked to restore the recycle bin item SwitchParameter SwitchParameter Identity Id of the recycle bin item or the recycle bin item object itself to restore RecycleBinItemPipeBind RecycleBinItemPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection ------------------EXAMPLE 1--------------------- PS:> Restore-PnpRecycleBinItem -Identity 72e4d749-d750-4989-b727-523d6726e442 Restores the recycle bin item with Id 72e4d749-d750-4989-b727-523d6726e442 to its original location ------------------EXAMPLE 2--------------------- PS:> Get-PnPRecycleBinItems | ? FileLeafName -like "*.docx" | Restore-PnpRecycleBinItem Restores all the items in the first and second stage recycle bins to their original location of which the filename ends with the .docx extension SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Restore-PnPTenantRecycleBinItem * Supported in: SharePoint Online. Restores a site collection from the tenant scoped recycle bin Restore PnPTenantRecycleBinItem The Reset-PnPTenantRecycleBinItem cmdlet allows a site collection that has been deleted and still exists in the tenant recycle bin to be restored to its original location. Restore-PnPTenantRecycleBinItem Url Url of the site collection to restore from the tenant recycle bin String Wait If provided, the PowerShell execution will halt until the site restore process has completed SwitchParameter Force If provided, no confirmation will be asked to restore the site collection from the tenant recycle bin SwitchParameter Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Force If provided, no confirmation will be asked to restore the site collection from the tenant recycle bin SwitchParameter SwitchParameter Url Url of the site collection to restore from the tenant recycle bin String String Wait If provided, the PowerShell execution will halt until the site restore process has completed SwitchParameter SwitchParameter Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection ------------------EXAMPLE 1--------------------- PS:> Reset-PnPTenantRecycleBinItem -Url https://tenant.sharepoint.com/sites/contoso This will restore the deleted site collection with the url 'https://tenant.sharepoint.com/sites/contoso' to its original location ------------------EXAMPLE 2--------------------- PS:> Reset-PnPTenantRecycleBinItem -Url https://tenant.sharepoint.com/sites/contoso -Wait This will restore the deleted site collection with the url 'https://tenant.sharepoint.com/sites/contoso' to its original location and will wait with executing further PowerShell commands until the site collection restore has completed SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Resume-PnPWorkflowInstance Resume a workflow Resume PnPWorkflowInstance Resumes a previously stopped workflow instance Resume-PnPWorkflowInstance Identity The instance to resume WorkflowInstancePipeBind Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Identity The instance to resume WorkflowInstancePipeBind WorkflowInstancePipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Resume-PnPWorkflowInstance -identity $wfInstance Resumes the workflow instance, this can be the Guid of the instance or the instance itself. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Revoke-PnPSiteDesignRights * Supported in: SharePoint Online. Revokes the specified principals rights to use the site design. Revoke PnPSiteDesignRights Revoke-PnPSiteDesignRights Principals One or more principals to revoke. String[] Identity The site design to use. TenantSiteDesignPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Identity The site design to use. TenantSiteDesignPipeBind TenantSiteDesignPipeBind Principals One or more principals to revoke. String[] String[] Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection ------------------EXAMPLE 1--------------------- PS:> Revoke-PnPSiteDesignRights -Identity 5c73382d-9643-4aa0-9160-d0cba35e40fd -Principals "myuser@mydomain.com","myotheruser@mydomain.com" Revokes rights to the specified principals on the site design specified ------------------EXAMPLE 2--------------------- PS:> Get-PnPSiteDesign -Identity 5c73382d-9643-4aa0-9160-d0cba35e40fd | Revoke-PnPSiteDesignRights -Principals "myuser@mydomain.com","myotheruser@mydomain.com" Revokes rights to the specified principals on the site design specified SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Save-PnPProvisioningTemplate Saves a PnP file to the file systems Save PnPProvisioningTemplate Save-PnPProvisioningTemplate InputInstance Allows you to provide an in-memory instance of the ProvisioningTemplate type of the PnP Core Component. When using this parameter, the -Out parameter refers to the path for saving the template and storing any supporting file for the template. ProvisioningTemplate Out Filename to write to, optionally including full path. String Force Specifying the Force parameter will skip the confirmation question. SwitchParameter TemplateProviderExtensions Allows you to specify the ITemplateProviderExtension to execute while saving a template. ITemplateProviderExtension[] Force Specifying the Force parameter will skip the confirmation question. SwitchParameter SwitchParameter InputInstance Allows you to provide an in-memory instance of the ProvisioningTemplate type of the PnP Core Component. When using this parameter, the -Out parameter refers to the path for saving the template and storing any supporting file for the template. ProvisioningTemplate ProvisioningTemplate Out Filename to write to, optionally including full path. String String TemplateProviderExtensions Allows you to specify the ITemplateProviderExtension to execute while saving a template. ITemplateProviderExtension[] ITemplateProviderExtension[] ------------------EXAMPLE 1--------------------- PS:> Save-PnPProvisioningTemplate -InputInstance $template -Out .\template.pnp Saves a PnP file to the file systems SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Send-PnPMail Sends an email using the Office 365 SMTP Service or SharePoint, depending on the parameters specified. See detailed help for more information. Send PnPMail Send-PnPMail To List of recipients String[] Subject Subject of the email String Body Body of the email String Server String From If using from address, you also have to provide a password String Password If using a password, you also have to provide the associated from address String Cc List of recipients on CC String[] Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Body Body of the email String String Cc List of recipients on CC String[] String[] From If using from address, you also have to provide a password String String Password If using a password, you also have to provide the associated from address String String Server String String Subject Subject of the email String String To List of recipients String[] String[] Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Send-PnPMail -To address@tenant.sharepointonline.com -Subject test -Body test Sends an e-mail using the SharePoint SendEmail method using the current context. E-mail is sent from the system account and can only be sent to accounts in the same tenant ------------------EXAMPLE 2--------------------- PS:> Send-PnPMail -To address@contoso.com -Subject test -Body test -From me@tenant.onmicrosoft.com -Password xyz Sends an e-mail via Office 365 SMTP and requires a from address and password. E-mail is sent from the from user and can be sent to both internal and external addresses. ------------------EXAMPLE 3--------------------- PS:> Send-PnPMail -To address@contoso.com -Subject test -Body test -From me@server.net -Password xyz -Server yoursmtp.server.net Sends an e-mail via a custom SMTP server and requires a from address and password. E-mail is sent from the from user. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Set-PnPAppSideLoading Enables the App SideLoading Feature on a site Set PnPAppSideLoading Set-PnPAppSideLoading On SwitchParameter Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Set-PnPAppSideLoading Off SwitchParameter Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Off SwitchParameter SwitchParameter On SwitchParameter SwitchParameter Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection ------------------EXAMPLE 1--------------------- PS:> Set-PnPAppSideLoading -On This will turn on App side loading ------------------EXAMPLE 2--------------------- PS:> Set-PnPAppSideLoading -Off This will turn off App side loading SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Set-PnPAuditing Set Auditing setting for a site Set PnPAuditing Set-PnPAuditing RetentionTime Set the retention time Int32 TrimAuditLog Trim the audit log SwitchParameter EditItems Audit editing items SwitchParameter CheckOutCheckInItems Audit checking out or checking in items SwitchParameter MoveCopyItems Audit moving or copying items to another location in the site. SwitchParameter DeleteRestoreItems Audit deleting or restoring items SwitchParameter EditContentTypesColumns Audit editing content types and columns SwitchParameter SearchContent Audit searching site content SwitchParameter EditUsersPermissions Audit editing users and permissions SwitchParameter Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Set-PnPAuditing EnableAll Enable all audit flags SwitchParameter RetentionTime Set the retention time Int32 TrimAuditLog Trim the audit log SwitchParameter Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Set-PnPAuditing DisableAll Disable all audit flags SwitchParameter Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection CheckOutCheckInItems Audit checking out or checking in items SwitchParameter SwitchParameter DeleteRestoreItems Audit deleting or restoring items SwitchParameter SwitchParameter DisableAll Disable all audit flags SwitchParameter SwitchParameter EditContentTypesColumns Audit editing content types and columns SwitchParameter SwitchParameter EditItems Audit editing items SwitchParameter SwitchParameter EditUsersPermissions Audit editing users and permissions SwitchParameter SwitchParameter EnableAll Enable all audit flags SwitchParameter SwitchParameter MoveCopyItems Audit moving or copying items to another location in the site. SwitchParameter SwitchParameter RetentionTime Set the retention time Int32 Int32 SearchContent Audit searching site content SwitchParameter SwitchParameter TrimAuditLog Trim the audit log SwitchParameter SwitchParameter Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection ------------------EXAMPLE 1--------------------- PS:> Set-PnPAuditing -EnableAll Enables all auditing settings for the current site ------------------EXAMPLE 2--------------------- PS:> Set-PnPAuditing -DisableAll Disables all auditing settings for the current site ------------------EXAMPLE 3--------------------- PS:> Set-PnPAuditing -RetentionTime 7 Sets the audit log trimming to 7 days, this also enables the automatic trimming of the audit log ------------------EXAMPLE 4--------------------- PS:> Set-PnPAuditing -TrimAuditLog Enables the automatic trimming of the audit log ------------------EXAMPLE 5--------------------- PS:> Set-PnPAuditing -RetentionTime 7 -CheckOutCheckInItems -MoveCopyItems -SearchContent Sets the audit log trimming to 7 days, this also enables the automatic trimming of the audit log. Do auditing for: - Checking out or checking in items - Moving or copying items to another location in the site - Searching site content SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Set-PnPAvailablePageLayouts Sets the available page layouts for the current site Set PnPAvailablePageLayouts Set-PnPAvailablePageLayouts PageLayouts An array of page layout files to set as available page layouts for the site. String[] Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Set-PnPAvailablePageLayouts AllowAllPageLayouts An array of page layout files to set as available page layouts for the site. SwitchParameter Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Set-PnPAvailablePageLayouts InheritPageLayouts Set the available page layouts to inherit from the parent site. SwitchParameter Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection AllowAllPageLayouts An array of page layout files to set as available page layouts for the site. SwitchParameter SwitchParameter InheritPageLayouts Set the available page layouts to inherit from the parent site. SwitchParameter SwitchParameter PageLayouts An array of page layout files to set as available page layouts for the site. String[] String[] Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Set-PnPClientSidePage * Supported in: SharePoint Online. Sets parameters of a Client-Side Page Set PnPClientSidePage Set-PnPClientSidePage Identity The name/identity of the page ClientSidePagePipeBind Name Sets the name of the page. String Title Sets the title of the page. String LayoutType Sets the layout type of the page. (Default = Article) ClientSidePageLayoutType PromoteAs Allows to promote the page for a specific purpose (HomePage | NewsPage) ClientSidePagePromoteType CommentsEnabled Enables or Disables the comments on the page SwitchParameter Publish Publishes the page once it is saved. SwitchParameter Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection CommentsEnabled Enables or Disables the comments on the page SwitchParameter SwitchParameter Identity The name/identity of the page ClientSidePagePipeBind ClientSidePagePipeBind LayoutType Sets the layout type of the page. (Default = Article) ClientSidePageLayoutType ClientSidePageLayoutType Name Sets the name of the page. String String PromoteAs Allows to promote the page for a specific purpose (HomePage | NewsPage) ClientSidePagePromoteType ClientSidePagePromoteType Publish Publishes the page once it is saved. SwitchParameter SwitchParameter Title Sets the title of the page. String String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Set-PnPClientSidePage -Identity "MyPage" -LayoutType Home -Title "My Page" Updates the properties of the Client-Side page named 'MyPage' ------------------EXAMPLE 2--------------------- PS:> Set-PnPClientSidePage -Identity "MyPage" -CommentsEnabled Enables the comments on the Client-Side page named 'MyPage' ------------------EXAMPLE 3--------------------- PS:> Set-PnPClientSidePage -Identity "MyPage" -CommentsEnabled:$false Disables the comments on the Client-Side page named 'MyPage' SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Set-PnPClientSideText * Supported in: SharePoint Online. Set Client-Side Text Component properties Set PnPClientSideText Sets the rendered text in existing client side text component Set-PnPClientSideText InstanceId The instance id of the text component GuidPipeBind Text Text to set String Page The name of the page ClientSidePagePipeBind Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection InstanceId The instance id of the text component GuidPipeBind GuidPipeBind Page The name of the page ClientSidePagePipeBind ClientSidePagePipeBind Text Text to set String String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Set-PnPSetClientSideText -Page Home -InstanceId a2875399-d6ff-43a0-96da-be6ae5875f82 -Text "MyText" Sets the text of the client side text component. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Set-PnPClientSideWebPart * Supported in: SharePoint Online. Set Client-Side Web Part properties Set PnPClientSideWebPart Sets specific client side webpart properties. Notice that the title parameter will only set the -internal- title of webpart. The title which is shown in the UI will, if possible, have to be set using the PropertiesJson parameter. Use Get-PnPClientSideComponent to retrieve the instance id and properties of a webpart. Set-PnPClientSideWebPart Identity The identity of the webpart. This can be the webpart instance id or the title of a webpart ClientSideWebPartPipeBind Page The name of the page ClientSidePagePipeBind Title Sets the internal title of the webpart. Notice that this will NOT set a visible title. String PropertiesJson Sets the properties as a JSON string. String Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Identity The identity of the webpart. This can be the webpart instance id or the title of a webpart ClientSideWebPartPipeBind ClientSideWebPartPipeBind Page The name of the page ClientSidePagePipeBind ClientSidePagePipeBind PropertiesJson Sets the properties as a JSON string. String String Title Sets the internal title of the webpart. Notice that this will NOT set a visible title. String String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Set-PnPClientSideWebPart -Page Home -InstanceId a2875399-d6ff-43a0-96da-be6ae5875f82 -PropertiesJson $myproperties Sets the properties of the client side webpart given in the $myproperties variable. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Set-PnPContext Set the ClientContext Set PnPContext Sets the Client Context to use by the cmdlets, which allows easy context switching. See examples for details. Set-PnPContext Context The ClientContext to set ClientContext Context The ClientContext to set ClientContext ClientContext ------------------EXAMPLE 1--------------------- PS:> Connect-PnPOnline -Url $siteAurl -Credentials $credentials PS:> $ctx = Get-PnPContext PS:> Get-PnPList # returns the lists from site specified with $siteAurl PS:> Connect-PnPOnline -Url $siteBurl -Credentials $credentials PS:> Get-PnPList # returns the lists from the site specified with $siteBurl PS:> Set-PnPContext -Context $ctx # switch back to site A PS:> Get-PnPList # returns the lists from site A SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Set-PnPDefaultColumnValues Sets default column values for a document library Set PnPDefaultColumnValues Sets default column values for a document library, per folder, or for the root folder if the folder parameter has not been specified. Supports both text and taxonomy fields. Set-PnPDefaultColumnValues Field The internal name, id or a reference to a field FieldPipeBind Value A list of values. In case of a text field the values will be concatenated, separated by a semi-colon. In case of a taxonomy field multiple values will added. In case of people field multiple values will be added. String[] List The ID, Name or Url of the list. ListPipeBind Folder A library relative folder path, if not specified it will set the default column values on the root folder of the library ('/') String Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Field The internal name, id or a reference to a field FieldPipeBind FieldPipeBind Folder A library relative folder path, if not specified it will set the default column values on the root folder of the library ('/') String String List The ID, Name or Url of the list. ListPipeBind ListPipeBind Value A list of values. In case of a text field the values will be concatenated, separated by a semi-colon. In case of a taxonomy field multiple values will added. In case of people field multiple values will be added. String[] String[] Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Set-PnPDefaultColumnValues -List Documents -Field TaxKeyword -Value "Company|Locations|Stockholm" Sets a default value for the enterprise keywords field on a library to a term called "Stockholm", located in the "Locations" term set, which is part of the "Company" term group ------------------EXAMPLE 2--------------------- PS:> Set-PnPDefaultColumnValues -List Documents -Field TaxKeyword -Value "15c4c4e4-4b67-4894-a1d8-de5ff811c791" Sets a default value for the enterprise keywords field on a library to a term with the id "15c4c4e4-4b67-4894-a1d8-de5ff811c791". You need to ensure the term is valid for the field. ------------------EXAMPLE 3--------------------- PS:> Set-PnPDefaultColumnValues -List Documents -Field MyTextField -Value "DefaultValue" Sets a default value for the MyTextField text field on a library to a value of "DefaultValue" ------------------EXAMPLE 4--------------------- PS:> Set-PnPDefaultColumnValues -List Documents -Field MyPeopleField -Value "1;#Foo Bar" Sets a default value for the MyPeopleField people field on a library to a value of "Foo Bar" using the id from the user information list. ------------------EXAMPLE 5--------------------- PS:> $user = New-PnPUser -LoginName foobar@contoso.com PS:> Set-PnPDefaultColumnValues -List Documents -Field MyPeopleField -Value "$($user.Id);#$($user.LoginName)" Sets a default value for the MyPeopleField people field on a library to a value of "Foo Bar" using the id from the user information list. ------------------EXAMPLE 6--------------------- PS:> $user1 = New-PnPUser -LoginName user1@contoso.com PS:> $user2 = New-PnPUser -LoginName user2@contoso.com PS:> Set-PnPDefaultColumnValues -List Documents -Field MyMultiPeopleField -Value "$($user1.Id);#$($user1.LoginName)","$($user2.Id);#$($user2.LoginName)" Sets a default value for the MyMultiPeopleField people field on a library to a value of "User 1" and "User 2" using the id from the user information list. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Set-PnPDefaultContentTypeToList Sets the default content type for a list Set PnPDefaultContentTypeToList Set-PnPDefaultContentTypeToList List The name of a list, an ID or the actual list object to update ListPipeBind ContentType The content type object that needs to be set as the default content type on the list. Content Type needs to be present on the list. ContentTypePipeBind Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection ContentType The content type object that needs to be set as the default content type on the list. Content Type needs to be present on the list. ContentTypePipeBind ContentTypePipeBind List The name of a list, an ID or the actual list object to update ListPipeBind ListPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Set-PnPDefaultContentTypeToList -List "Project Documents" -ContentType "Project" This will set the Project content type (which has already been added to a list) as the default content type SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Set-PnPDefaultPageLayout Sets a specific page layout to be the default page layout for a publishing site Set PnPDefaultPageLayout Set-PnPDefaultPageLayout Title Title of the page layout String Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Set-PnPDefaultPageLayout InheritFromParentSite Set the default page layout to be inherited from the parent site. SwitchParameter Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection InheritFromParentSite Set the default page layout to be inherited from the parent site. SwitchParameter SwitchParameter Title Title of the page layout String String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Set-PnPDefaultPageLayout -Title projectpage.aspx Sets projectpage.aspx to be the default page layout for the current web ------------------EXAMPLE 2--------------------- PS:> Set-PnPDefaultPageLayout -Title test/testpage.aspx Sets a page layout in a folder in the Master Page & Page Layout gallery, such as _catalog/masterpage/test/testpage.aspx, to be the default page layout for the current web ------------------EXAMPLE 3--------------------- PS:> Set-PnPDefaultPageLayout -InheritFromParentSite Sets the default page layout to be inherited from the parent site SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Set-PnPField Changes one or more properties of a field in a specific list or for the whole web Set PnPField Set-PnPField Values Hashtable of properties to update on the field. Use the syntax @{property1="value";property2="value"}. Hashtable Identity The field object, internal field name (case sensitive) or field id to update FieldPipeBind List The list object, name or id where to update the field. If omited the field will be updated on the web. ListPipeBind UpdateExistingLists If provided, the field will be updated on existing lists that use it as well. If not provided or set to $false, existing lists using the field will remain unchanged but new lists will get the updated field. SwitchParameter Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Identity The field object, internal field name (case sensitive) or field id to update FieldPipeBind FieldPipeBind List The list object, name or id where to update the field. If omited the field will be updated on the web. ListPipeBind ListPipeBind UpdateExistingLists If provided, the field will be updated on existing lists that use it as well. If not provided or set to $false, existing lists using the field will remain unchanged but new lists will get the updated field. SwitchParameter SwitchParameter Values Hashtable of properties to update on the field. Use the syntax @{property1="value";property2="value"}. Hashtable Hashtable Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind Microsoft.SharePoint.Client.Field ------------------EXAMPLE 1--------------------- PS:> Set-PnPField -Identity AssignedTo -Values @{JSLink="customrendering.js";Group="My fields"} Updates the AssignedTo field on the current web to use customrendering.js for the JSLink and sets the group name the field is categorized in to "My Fields". Lists that are already using the AssignedTo field will not be updated. ------------------EXAMPLE 2--------------------- PS:> Set-PnPField -Identity AssignedTo -Values @{JSLink="customrendering.js";Group="My fields"} -UpdateExistingLists Updates the AssignedTo field on the current web to use customrendering.js for the JSLink and sets the group name the field is categorized in to "My Fields". Lists that are already using the AssignedTo field will also be updated. ------------------EXAMPLE 3--------------------- PS:> Set-PnPField -List "Tasks" -Identity "AssignedTo" -Values @{JSLink="customrendering.js"} Updates the AssignedTo field on the Tasks list to use customrendering.js for the JSLink SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Set-PnPDocumentSetField Sets a site column from the available content types to a document set Set PnPDocumentSetField Set-PnPDocumentSetField DocumentSet The document set in which to set the field. Either specify a name, a document set template object, an id, or a content type object DocumentSetPipeBind Field The field to set. The field needs to be available in one of the available content types. Either specify a name, an id or a field object FieldPipeBind SetSharedField Set the field as a Shared Field SwitchParameter SetWelcomePageField Set the field as a Welcome Page field SwitchParameter RemoveSharedField Removes the field as a Shared Field SwitchParameter RemoveWelcomePageField Removes the field as a Welcome Page Field SwitchParameter Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection DocumentSet The document set in which to set the field. Either specify a name, a document set template object, an id, or a content type object DocumentSetPipeBind DocumentSetPipeBind Field The field to set. The field needs to be available in one of the available content types. Either specify a name, an id or a field object FieldPipeBind FieldPipeBind RemoveSharedField Removes the field as a Shared Field SwitchParameter SwitchParameter RemoveWelcomePageField Removes the field as a Welcome Page Field SwitchParameter SwitchParameter SetSharedField Set the field as a Shared Field SwitchParameter SwitchParameter SetWelcomePageField Set the field as a Welcome Page field SwitchParameter SwitchParameter Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Set-PnPDocumentSetField -Field "Test Field" -DocumentSet "Test Document Set" -SetSharedField -SetWelcomePageField This will set the field, available in one of the available content types, as a Shared Field and as a Welcome Page Field. ------------------EXAMPLE 2--------------------- PS:> Set-PnPDocumentSetField -Field "Test Field" -DocumentSet "Test Document Set" -RemoveSharedField -RemoveWelcomePageField This will remove the field, available in one of the available content types, as a Shared Field and as a Welcome Page Field. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Set-PnPFileCheckedIn Checks in a file Set PnPFileCheckedIn Set-PnPFileCheckedIn Url The server relative url of the file to check in String CheckinType The check in type to use. Defaults to Major CheckinType Comment The check in comment String Approve Approve file SwitchParameter Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Approve Approve file SwitchParameter SwitchParameter CheckinType The check in type to use. Defaults to Major CheckinType CheckinType Comment The check in comment String String Url The server relative url of the file to check in String String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:>Set-PnPFileCheckedIn -Url "/Documents/Contract.docx" Checks in the file "Contract.docx" in the "Documents" library ------------------EXAMPLE 2--------------------- PS:>Set-PnPFileCheckedIn -Url "/Documents/Contract.docx" -CheckinType MinorCheckin -Comment "Smaller changes" Checks in the file "Contract.docx" in the "Documents" library as a minor version and adds the check in comment "Smaller changes" SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Set-PnPFileCheckedOut Checks out a file Set PnPFileCheckedOut Set-PnPFileCheckedOut Url The server relative url of the file to check out String Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Url The server relative url of the file to check out String String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:>Set-PnPFileCheckedOut -Url "/sites/testsite/subsite/Documents/Contract.docx" Checks out the file "Contract.docx" in the "Documents" library. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Set-PnPGroup Updates a group Set PnPGroup Set-PnPGroup Identity A group object, an ID or a name of a group GroupPipeBind SetAssociatedGroup One of the associated group types (Visitors, Members, Owners AssociatedGroupType AddRole Name of the permission set to add to this SharePoint group String RemoveRole Name of the permission set to remove from this SharePoint group String Title The title for the group String Owner The owner for the group, which can be a user or another group String Description The description for the group String AllowRequestToJoinLeave A switch parameter that specifies whether to allow users to request membership in the group and to allow users to request to leave the group Boolean AutoAcceptRequestToJoinLeave A switch parameter that specifies whether users are automatically added or removed when they make a request Boolean AllowMembersEditMembership A switch parameter that specifies whether group members can modify membership in the group Boolean OnlyAllowMembersViewMembership A switch parameter that specifies whether only group members are allowed to view the list of members in the group Boolean RequestToJoinEmail The e-mail address to which membership requests are sent String Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection AddRole Name of the permission set to add to this SharePoint group String String AllowMembersEditMembership A switch parameter that specifies whether group members can modify membership in the group Boolean Boolean AllowRequestToJoinLeave A switch parameter that specifies whether to allow users to request membership in the group and to allow users to request to leave the group Boolean Boolean AutoAcceptRequestToJoinLeave A switch parameter that specifies whether users are automatically added or removed when they make a request Boolean Boolean Description The description for the group String String Identity A group object, an ID or a name of a group GroupPipeBind GroupPipeBind OnlyAllowMembersViewMembership A switch parameter that specifies whether only group members are allowed to view the list of members in the group Boolean Boolean Owner The owner for the group, which can be a user or another group String String RemoveRole Name of the permission set to remove from this SharePoint group String String RequestToJoinEmail The e-mail address to which membership requests are sent String String SetAssociatedGroup One of the associated group types (Visitors, Members, Owners AssociatedGroupType AssociatedGroupType Title The title for the group String String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Set-PnPGroup -Identity 'My Site Members' -SetAssociatedGroup Members Sets the SharePoint group with the name 'My Site Members' as the associated members group ------------------EXAMPLE 2--------------------- PS:> Set-PnPGroup -Identity 'My Site Members' -Owner 'site owners' Sets the SharePoint group with the name 'site owners' as the owner of the SharePoint group with the name 'My Site Members' SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Set-PnPGroupPermissions Adds and/or removes permissions of a specific SharePoint group Set PnPGroupPermissions Set-PnPGroupPermissions Identity Get the permissions of a specific group by name GroupPipeBind List The list to apply the command to. ListPipeBind AddRole Name of the permission set to add to this SharePoint group String[] RemoveRole Name of the permission set to remove from this SharePoint group String[] Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection AddRole Name of the permission set to add to this SharePoint group String[] String[] Identity Get the permissions of a specific group by name GroupPipeBind GroupPipeBind List The list to apply the command to. ListPipeBind ListPipeBind RemoveRole Name of the permission set to remove from this SharePoint group String[] String[] Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Set-PnPGroupPermissions -Identity 'My Site Members' -AddRole Contribute Adds the 'Contribute' permission to the SharePoint group with the name 'My Site Members' ------------------EXAMPLE 2--------------------- PS:> Set-PnPGroupPermissions -Identity 'My Site Members' -RemoveRole 'Full Control' -AddRole 'Read' Removes the 'Full Control' from and adds the 'Contribute' permissions to the SharePoint group with the name 'My Site Members' ------------------EXAMPLE 3--------------------- PS:> Set-PnPGroupPermissions -Identity 'My Site Members' -AddRole @('Contribute', 'Design') Adds the 'Contribute' and 'Design' permissions to the SharePoint group with the name 'My Site Members' ------------------EXAMPLE 4--------------------- PS:> Set-PnPGroupPermissions -Identity 'My Site Members' -RemoveRole @('Contribute', 'Design') Removes the 'Contribute' and 'Design' permissions from the SharePoint group with the name 'My Site Members' ------------------EXAMPLE 5--------------------- PS:> Set-PnPGroupPermissions -Identity 'My Site Members' -List 'MyList' -RemoveRole @('Contribute') Removes the 'Contribute' permissions from the list 'MyList' for the group with the name 'My Site Members' SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Set-PnPHideDefaultThemes * Supported in: SharePoint Online. Defines if the default / OOTB themes should be visible to users or not. Set PnPHideDefaultThemes Use this cmdlet to hide or show the default themes to users You must be a SharePoint Online global administrator to run the cmdlet. Set-PnPHideDefaultThemes HideDefaultThemes Defines if the default themes should be visible or hidden Boolean Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection HideDefaultThemes Defines if the default themes should be visible or hidden Boolean Boolean Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection ------------------EXAMPLE 1--------------------- PS:> Set-PnPHideDefaultThemes -HideDefaultThemes $true This example hides the default themes ------------------EXAMPLE 2--------------------- PS:> Set-PnPHideDefaultThemes -HideDefaultThemes $false This example shows the default themes SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Set-PnPHomePage Sets the home page of the current web. Set PnPHomePage Set-PnPHomePage RootFolderRelativeUrl The root folder relative url of the homepage, e.g. 'sitepages/home.aspx' String Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection RootFolderRelativeUrl The root folder relative url of the homepage, e.g. 'sitepages/home.aspx' String String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Set-PnPHomePage -RootFolderRelativeUrl SitePages/Home.aspx Sets the home page to the home.aspx file which resides in the SitePages library SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Set-PnPHubSite * Supported in: SharePoint Online. Sets hubsite properties Set PnPHubSite Set-PnPHubSite Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection ------------------EXAMPLE 1--------------------- PS:> Set-PnPHubSite -Identity https://tenant.sharepoint.com/sites/myhubsite -Title "My New Title" Sets the title of the hubsite SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Set-PnPIndexedProperties Marks values of the propertybag to be indexed by search. Notice that this will overwrite the existing flags, i.e. only the properties you define with the cmdlet will be indexed. Set PnPIndexedProperties Set-PnPIndexedProperties Keys String Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Keys String String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Set-PnPInPlaceRecordsManagement Activates or deactivates in the place records management feature. Set PnPInPlaceRecordsManagement Set-PnPInPlaceRecordsManagement Enabled Boolean Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Enabled Boolean Boolean Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Set-PnPInPlaceRecordsManagement -Enabled $true Activates In Place Records Management ------------------EXAMPLE 2--------------------- PS:> Set-PnPInPlaceRecordsManagement -Enabled $false Deactivates In Place Records Management SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Set-PnPList Updates list settings Set PnPList Set-PnPList Identity The ID, Title or Url of the list. ListPipeBind EnableContentTypes Set to $true to enable content types, set to $false to disable content types Boolean BreakRoleInheritance If used the security inheritance is broken for this list SwitchParameter CopyRoleAssignments If used the roles are copied from the parent web SwitchParameter ClearSubscopes If used the unique permissions are cleared from child objects and they can inherit role assignments from this object SwitchParameter Title The title of the list String Hidden Hide the list from the SharePoint UI. Set to $true to hide, $false to show. Boolean EnableAttachments Enable or disable attachments. Set to $true to enable, $false to disable. Boolean EnableVersioning Enable or disable versioning. Set to $true to enable, $false to disable. Boolean EnableMinorVersions Enable or disable minor versions versioning. Set to $true to enable, $false to disable. Boolean MajorVersions Maximum major versions to keep UInt32 MinorVersions Maximum minor versions to keep UInt32 EnableModeration Enable or disable whether content approval is enabled for the list. Set to $true to enable, $false to disable. Boolean Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection BreakRoleInheritance If used the security inheritance is broken for this list SwitchParameter SwitchParameter ClearSubscopes If used the unique permissions are cleared from child objects and they can inherit role assignments from this object SwitchParameter SwitchParameter CopyRoleAssignments If used the roles are copied from the parent web SwitchParameter SwitchParameter EnableAttachments Enable or disable attachments. Set to $true to enable, $false to disable. Boolean Boolean EnableContentTypes Set to $true to enable content types, set to $false to disable content types Boolean Boolean EnableMinorVersions Enable or disable minor versions versioning. Set to $true to enable, $false to disable. Boolean Boolean EnableModeration Enable or disable whether content approval is enabled for the list. Set to $true to enable, $false to disable. Boolean Boolean EnableVersioning Enable or disable versioning. Set to $true to enable, $false to disable. Boolean Boolean Hidden Hide the list from the SharePoint UI. Set to $true to hide, $false to show. Boolean Boolean Identity The ID, Title or Url of the list. ListPipeBind ListPipeBind MajorVersions Maximum major versions to keep UInt32 UInt32 MinorVersions Maximum minor versions to keep UInt32 UInt32 Title The title of the list String String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- Set-PnPList -Identity "Demo List" -EnableContentTypes $true Switches the Enable Content Type switch on the list ------------------EXAMPLE 2--------------------- Set-PnPList -Identity "Demo List" -Hidden $true Hides the list from the SharePoint UI. ------------------EXAMPLE 3--------------------- Set-PnPList -Identity "Demo List" -EnableVersioning $true Turns on major versions on a list ------------------EXAMPLE 4--------------------- Set-PnPList -Identity "Demo List" -EnableVersioning $true -MajorVersions 20 Turns on major versions on a list and sets the maximum number of Major Versions to keep to 20. ------------------EXAMPLE 5--------------------- Set-PnPList -Identity "Demo Library" -EnableVersioning $true -EnableMinorVersions $true -MajorVersions 20 -MinorVersions 5 Turns on major versions on a document library and sets the maximum number of Major versions to keep to 20 and sets the maximum of Minor versions to 5. ------------------EXAMPLE 6--------------------- Set-PnPList -Identity "Demo List" -EnableAttachments $true Turns on attachments on a list SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Set-PnPListInformationRightsManagement Get the site closure status of the site which has a site policy applied Set PnPListInformationRightsManagement Set-PnPListInformationRightsManagement List The list to set Information Rights Management (IRM) settings for. ListPipeBind Enable Specifies whether Information Rights Management (IRM) is enabled for the list. Boolean EnableExpiration Specifies whether Information Rights Management (IRM) expiration is enabled for the list. Boolean EnableRejection Specifies whether Information Rights Management (IRM) rejection is enabled for the list. Boolean AllowPrint Sets a value indicating whether the viewer can print the downloaded document. Boolean AllowScript Sets a value indicating whether the viewer can run a script on the downloaded document. Boolean AllowWriteCopy Sets a value indicating whether the viewer can write on a copy of the downloaded document. Boolean DisableDocumentBrowserView Sets a value indicating whether to block Office Web Application Companion applications (WACs) from showing this document. Boolean DocumentAccessExpireDays Sets the number of days after which the downloaded document will expire. Int32 DocumentLibraryProtectionExpireDate Sets the date after which the Information Rights Management (IRM) protection of this document library will stop. DateTime EnableDocumentAccessExpire Sets a value indicating whether the downloaded document will expire. Boolean EnableDocumentBrowserPublishingView Sets a value indicating whether to enable Office Web Application Companion applications (WACs) to publishing view. Boolean EnableGroupProtection Sets a value indicating whether the permission of the downloaded document is applicable to a group. Boolean EnableLicenseCacheExpire Sets whether a user must verify their credentials after some interval. Boolean LicenseCacheExpireDays Sets the number of days that the application that opens the document caches the IRM license. When these elapse, the application will connect to the IRM server to validate the license. Int32 GroupName Sets the group name (email address) that the permission is also applicable to. String PolicyDescription Sets the permission policy description. String PolicyTitle Sets the permission policy title. String TemplateId String Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection AllowPrint Sets a value indicating whether the viewer can print the downloaded document. Boolean Boolean AllowScript Sets a value indicating whether the viewer can run a script on the downloaded document. Boolean Boolean AllowWriteCopy Sets a value indicating whether the viewer can write on a copy of the downloaded document. Boolean Boolean DisableDocumentBrowserView Sets a value indicating whether to block Office Web Application Companion applications (WACs) from showing this document. Boolean Boolean DocumentAccessExpireDays Sets the number of days after which the downloaded document will expire. Int32 Int32 DocumentLibraryProtectionExpireDate Sets the date after which the Information Rights Management (IRM) protection of this document library will stop. DateTime DateTime Enable Specifies whether Information Rights Management (IRM) is enabled for the list. Boolean Boolean EnableDocumentAccessExpire Sets a value indicating whether the downloaded document will expire. Boolean Boolean EnableDocumentBrowserPublishingView Sets a value indicating whether to enable Office Web Application Companion applications (WACs) to publishing view. Boolean Boolean EnableExpiration Specifies whether Information Rights Management (IRM) expiration is enabled for the list. Boolean Boolean EnableGroupProtection Sets a value indicating whether the permission of the downloaded document is applicable to a group. Boolean Boolean EnableLicenseCacheExpire Sets whether a user must verify their credentials after some interval. Boolean Boolean EnableRejection Specifies whether Information Rights Management (IRM) rejection is enabled for the list. Boolean Boolean GroupName Sets the group name (email address) that the permission is also applicable to. String String LicenseCacheExpireDays Sets the number of days that the application that opens the document caches the IRM license. When these elapse, the application will connect to the IRM server to validate the license. Int32 Int32 List The list to set Information Rights Management (IRM) settings for. ListPipeBind ListPipeBind PolicyDescription Sets the permission policy description. String String PolicyTitle Sets the permission policy title. String String TemplateId String String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Set-PnPListInformationRightsManagement -List "Documents" -Enabled $true Enables Information Rights Management (IRM) on the list. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Set-PnPListItem Updates a list item Set PnPListItem Set-PnPListItem Identity The ID of the listitem, or actual ListItem object ListItemPipeBind List The ID, Title or Url of the list. ListPipeBind ContentType Specify either the name, ID or an actual content type ContentTypePipeBind Values Use the internal names of the fields when specifying field names. Single line of text: -Values @{"TextField" = "Title New"} Multiple lines of text: -Values @{"MultiTextField" = "New text\n\nMore text"} Rich text: -Values @{"MultiTextField" = "<strong>New</strong> text"} Choice: -Values @{"ChoiceField" = "Value 1"} Number: -Values @{"NumberField" = "10"} Currency: -Values @{"NumberField" = "10"} Currency: -Values @{"CurrencyField" = "10"} Date and Time: -Values @{"DateAndTimeField" = "03/10/2015 14:16"} Lookup (id of lookup value): -Values @{"LookupField" = "2"} Multi value lookup (id of lookup values as array 1): -Values @{"MultiLookupField" = "1","2"} Multi value lookup (id of lookup values as array 2): -Values @{"MultiLookupField" = 1,2} Multi value lookup (id of lookup values as string): -Values @{"MultiLookupField" = "1,2"} Yes/No: -Values @{"YesNoField" = $false} Person/Group (id of user/group in Site User Info List or email of the user, seperate multiple values with a comma): -Values @{"PersonField" = "user1@domain.com","21"} Managed Metadata (single value with path to term): -Values @{"MetadataField" = "CORPORATE|DEPARTMENTS|FINANCE"} Managed Metadata (single value with id of term): -Values @{"MetadataField" = "fe40a95b-2144-4fa2-b82a-0b3d0299d818"} with Id of term Managed Metadata (multiple values with paths to terms): -Values @{"MetadataField" = ("CORPORATE|DEPARTMENTS|FINANCE","CORPORATE|DEPARTMENTS|HR")} Managed Metadata (multiple values with ids of terms): -Values @{"MetadataField" = ("fe40a95b-2144-4fa2-b82a-0b3d0299d818","52d88107-c2a8-4bf0-adfa-04bc2305b593")} Hyperlink or Picture: -Values @{"HyperlinkField" = "https://github.com/OfficeDev/, OfficePnp"} Hashtable SystemUpdate Update the item without creating a new version. SwitchParameter Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection ContentType Specify either the name, ID or an actual content type ContentTypePipeBind ContentTypePipeBind Identity The ID of the listitem, or actual ListItem object ListItemPipeBind ListItemPipeBind List The ID, Title or Url of the list. ListPipeBind ListPipeBind SystemUpdate Update the item without creating a new version. SwitchParameter SwitchParameter Values Use the internal names of the fields when specifying field names. Single line of text: -Values @{"TextField" = "Title New"} Multiple lines of text: -Values @{"MultiTextField" = "New text\n\nMore text"} Rich text: -Values @{"MultiTextField" = "<strong>New</strong> text"} Choice: -Values @{"ChoiceField" = "Value 1"} Number: -Values @{"NumberField" = "10"} Currency: -Values @{"NumberField" = "10"} Currency: -Values @{"CurrencyField" = "10"} Date and Time: -Values @{"DateAndTimeField" = "03/10/2015 14:16"} Lookup (id of lookup value): -Values @{"LookupField" = "2"} Multi value lookup (id of lookup values as array 1): -Values @{"MultiLookupField" = "1","2"} Multi value lookup (id of lookup values as array 2): -Values @{"MultiLookupField" = 1,2} Multi value lookup (id of lookup values as string): -Values @{"MultiLookupField" = "1,2"} Yes/No: -Values @{"YesNoField" = $false} Person/Group (id of user/group in Site User Info List or email of the user, seperate multiple values with a comma): -Values @{"PersonField" = "user1@domain.com","21"} Managed Metadata (single value with path to term): -Values @{"MetadataField" = "CORPORATE|DEPARTMENTS|FINANCE"} Managed Metadata (single value with id of term): -Values @{"MetadataField" = "fe40a95b-2144-4fa2-b82a-0b3d0299d818"} with Id of term Managed Metadata (multiple values with paths to terms): -Values @{"MetadataField" = ("CORPORATE|DEPARTMENTS|FINANCE","CORPORATE|DEPARTMENTS|HR")} Managed Metadata (multiple values with ids of terms): -Values @{"MetadataField" = ("fe40a95b-2144-4fa2-b82a-0b3d0299d818","52d88107-c2a8-4bf0-adfa-04bc2305b593")} Hyperlink or Picture: -Values @{"HyperlinkField" = "https://github.com/OfficeDev/, OfficePnp"} Hashtable Hashtable Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind Microsoft.SharePoint.Client.ListItem ------------------EXAMPLE 1--------------------- Set-PnPListItem -List "Demo List" -Identity 1 -Values @{"Title" = "Test Title"; "Category"="Test Category"} Sets fields value in the list item with ID 1 in the "Demo List". It sets both the Title and Category fields with the specified values. Notice, use the internal names of fields. ------------------EXAMPLE 2--------------------- Set-PnPListItem -List "Demo List" -Identity 1 -ContentType "Company" -Values @{"Title" = "Test Title"; "Category"="Test Category"} Sets fields value in the list item with ID 1 in the "Demo List". It sets the content type of the item to "Company" and it sets both the Title and Category fields with the specified values. Notice, use the internal names of fields. ------------------EXAMPLE 3--------------------- Set-PnPListItem -List "Demo List" -Identity $item -Values @{"Title" = "Test Title"; "Category"="Test Category"} Sets fields value in the list item which has been retrieved by for instance Get-PnPListItem. It sets the content type of the item to "Company" and it sets both the Title and Category fields with the specified values. Notice, use the internal names of fields. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Set-PnPListItemAsRecord * Supported in: SharePoint Online. Declares a list item as a record Set PnPListItemAsRecord Set-PnPListItemAsRecord Identity The ID of the listitem, or actual ListItem object ListItemPipeBind List The ID, Title or Url of the list. ListPipeBind DeclarationDate The declaration date DateTime Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection DeclarationDate The declaration date DateTime DateTime Identity The ID of the listitem, or actual ListItem object ListItemPipeBind ListItemPipeBind List The ID, Title or Url of the list. ListPipeBind ListPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Set-PnPListItemAsRecord -List "Documents" -Identity 4 Declares the document in the documents library with id 4 as a record ------------------EXAMPLE 2--------------------- PS:> Set-PnPListItemAsRecord -List "Documents" -Identity 4 -DeclarationDate $date Declares the document in the documents library with id as a record SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Set-PnPListItemPermission Sets list item permissions Set PnPListItemPermission Set-PnPListItemPermission Identity The ID of the listitem, or actual ListItem object ListItemPipeBind List The ID, Title or Url of the list. ListPipeBind InheritPermissions Inherit permissions from the list, removing unique permissions SwitchParameter Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Set-PnPListItemPermission Group GroupPipeBind Identity The ID of the listitem, or actual ListItem object ListItemPipeBind List The ID, Title or Url of the list. ListPipeBind AddRole The role that must be assigned to the group or user String RemoveRole The role that must be removed from the group or user String ClearExisting Clear all existing permissions SwitchParameter Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Set-PnPListItemPermission User String Identity The ID of the listitem, or actual ListItem object ListItemPipeBind List The ID, Title or Url of the list. ListPipeBind AddRole The role that must be assigned to the group or user String RemoveRole The role that must be removed from the group or user String ClearExisting Clear all existing permissions SwitchParameter Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection AddRole The role that must be assigned to the group or user String String ClearExisting Clear all existing permissions SwitchParameter SwitchParameter Group GroupPipeBind GroupPipeBind Identity The ID of the listitem, or actual ListItem object ListItemPipeBind ListItemPipeBind InheritPermissions Inherit permissions from the list, removing unique permissions SwitchParameter SwitchParameter List The ID, Title or Url of the list. ListPipeBind ListPipeBind RemoveRole The role that must be removed from the group or user String String User String String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Set-PnPListItemPermission -List 'Documents' -Identity 1 -User 'user@contoso.com' -AddRole 'Contribute' Adds the 'Contribute' permission to the user 'user@contoso.com' for listitem with id 1 in the list 'Documents' ------------------EXAMPLE 2--------------------- PS:> Set-PnPListItemPermission -List 'Documents' -Identity 1 -User 'user@contoso.com' -RemoveRole 'Contribute' Removes the 'Contribute' permission to the user 'user@contoso.com' for listitem with id 1 in the list 'Documents' ------------------EXAMPLE 3--------------------- PS:> Set-PnPListItemPermission -List 'Documents' -Identity 1 -User 'user@contoso.com' -AddRole 'Contribute' -ClearExisting Adds the 'Contribute' permission to the user 'user@contoso.com' for listitem with id 1 in the list 'Documents' and removes all other permissions ------------------EXAMPLE 4--------------------- PS:> Set-PnPListItemPermission -List 'Documents' -Identity 1 -InheritPermissions Resets permissions for listitem with id 1 to inherit permissions from the list 'Documents' SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Set-PnPListPermission Sets list permissions Set PnPListPermission Set-PnPListPermission Group GroupPipeBind Identity The ID or Title of the list. ListPipeBind AddRole The role that must be assigned to the group or user String RemoveRole The role that must be removed from the group or user String Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Set-PnPListPermission User String Identity The ID or Title of the list. ListPipeBind AddRole The role that must be assigned to the group or user String RemoveRole The role that must be removed from the group or user String Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection AddRole The role that must be assigned to the group or user String String Group GroupPipeBind GroupPipeBind Identity The ID or Title of the list. ListPipeBind ListPipeBind RemoveRole The role that must be removed from the group or user String String User String String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Set-PnPListPermission -Identity 'Documents' -User 'user@contoso.com' -AddRole 'Contribute' Adds the 'Contribute' permission to the user 'user@contoso.com' for the list 'Documents' ------------------EXAMPLE 2--------------------- PS:> Set-PnPListPermission -Identity 'Documents' -User 'user@contoso.com' -RemoveRole 'Contribute' Removes the 'Contribute' permission to the user 'user@contoso.com' for the list 'Documents' SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Set-PnPListRecordDeclaration * Supported in: SharePoint Online. The RecordDeclaration parameter supports 4 values: AlwaysAllowManualDeclaration NeverAllowManualDeclaration UseSiteCollectionDefaults Set PnPListRecordDeclaration Set-PnPListRecordDeclaration List The List to set the manual record declaration settings for ListPipeBind ManualRecordDeclaration Defines the manual record declaration setting for the lists EcmListManualRecordDeclaration AutoRecordDeclaration Defines if you want to set auto record declaration on the list Boolean Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection AutoRecordDeclaration Defines if you want to set auto record declaration on the list Boolean Boolean List The List to set the manual record declaration settings for ListPipeBind ListPipeBind ManualRecordDeclaration Defines the manual record declaration setting for the lists EcmListManualRecordDeclaration EcmListManualRecordDeclaration Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Set-PnPListRecordDeclaration -List "Documents" -ManualRecordDeclaration NeverAllowManualDeclaration Sets the manual record declaration to never allow ------------------EXAMPLE 2--------------------- PS:> Set-PnPListRecordDeclaration -List "Documents" -AutoRecordDeclaration $true Turns on auto record declaration for the list SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Set-PnPMasterPage Set the masterpage Set PnPMasterPage Sets the default master page of the current web. Set-PnPMasterPage MasterPageServerRelativeUrl Specifies the Master page URL based on the server relative URL String CustomMasterPageServerRelativeUrl Specifies the custom Master page URL based on the server relative URL String Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Set-PnPMasterPage MasterPageSiteRelativeUrl Specifies the Master page URL based on the site relative URL String CustomMasterPageSiteRelativeUrl Specifies the custom Master page URL based on the site relative URL String Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection CustomMasterPageServerRelativeUrl Specifies the custom Master page URL based on the server relative URL String String CustomMasterPageSiteRelativeUrl Specifies the custom Master page URL based on the site relative URL String String MasterPageServerRelativeUrl Specifies the Master page URL based on the server relative URL String String MasterPageSiteRelativeUrl Specifies the Master page URL based on the site relative URL String String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Set-PnPMasterPage -MasterPageServerRelativeUrl /sites/projects/_catalogs/masterpage/oslo.master Sets the master page based on a server relative URL ------------------EXAMPLE 2--------------------- PS:> Set-PnPMasterPage -MasterPageServerRelativeUrl /sites/projects/_catalogs/masterpage/oslo.master -CustomMasterPageServerRelativeUrl /sites/projects/_catalogs/masterpage/oslo.master Sets the master page and custom master page based on a server relative URL ------------------EXAMPLE 3--------------------- PS:> Set-PnPMasterPage -MasterPageSiteRelativeUrl _catalogs/masterpage/oslo.master Sets the master page based on a site relative URL ------------------EXAMPLE 4--------------------- PS:> Set-PnPMasterPage -MasterPageSiteRelativeUrl _catalogs/masterpage/oslo.master -CustomMasterPageSiteRelativeUrl _catalogs/masterpage/oslo.master Sets the master page and custom master page based on a site relative URL SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Set-PnPMinimalDownloadStrategy Activates or deactivates the minimal downloading strategy. Set PnPMinimalDownloadStrategy Activates or deactivates the minimal download strategy feature of a site Set-PnPMinimalDownloadStrategy On Turn minimal download strategy on SwitchParameter Force Specifies whether to overwrite (when activating) or continue (when deactivating) an existing feature with the same feature identifier. This parameter is ignored if there are no errors. SwitchParameter Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Set-PnPMinimalDownloadStrategy Off Turn minimal download strategy off SwitchParameter Force Specifies whether to overwrite (when activating) or continue (when deactivating) an existing feature with the same feature identifier. This parameter is ignored if there are no errors. SwitchParameter Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Force Specifies whether to overwrite (when activating) or continue (when deactivating) an existing feature with the same feature identifier. This parameter is ignored if there are no errors. SwitchParameter SwitchParameter Off Turn minimal download strategy off SwitchParameter SwitchParameter On Turn minimal download strategy on SwitchParameter SwitchParameter Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Set-PnPMinimalDownloadStrategy -Off Will deactivate minimal download strategy (MDS) for the current web. ------------------EXAMPLE 2--------------------- PS:> Set-PnPMinimalDownloadStrategy -On Will activate minimal download strategy (MDS) for the current web. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Set-PnPStorageEntity * Supported in: SharePoint Online. Set Storage Entities / Farm Properties. Set PnPStorageEntity Set-PnPStorageEntity Key The key of the value to set. String Value The value to set. String Comment The comment to set. String Description The description to set. String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Comment The comment to set. String String Description The description to set. String String Key The key of the value to set. String String Value The value to set. String String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection ------------------EXAMPLE 1--------------------- PS:> Set-PnPStorageEntity -Key MyKey -Value "MyValue" -Comment "My Comment" -Description "My Description" Sets an existing or adds a new storage entity / farm property SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Set-PnPPropertyBagValue Sets a property bag value Set PnPPropertyBagValue Set-PnPPropertyBagValue Key String Value String Folder Site relative url of the folder. See examples for use. String Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Set-PnPPropertyBagValue Key String Value String Indexed SwitchParameter Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Folder Site relative url of the folder. See examples for use. String String Indexed SwitchParameter SwitchParameter Key String String Value String String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Set-PnPPropertyBagValue -Key MyKey -Value MyValue This sets or adds a value to the current web property bag ------------------EXAMPLE 2--------------------- PS:> Set-PnPPropertyBagValue -Key MyKey -Value MyValue -Folder / This sets or adds a value to the root folder of the current web ------------------EXAMPLE 3--------------------- PS:> Set-PnPPropertyBagValue -Key MyKey -Value MyValue -Folder /MyFolder This sets or adds a value to the folder MyFolder which is located in the root folder of the current web SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Set-PnPProvisioningTemplateMetadata Sets metadata of a provisioning template Set PnPProvisioningTemplateMetadata Set-PnPProvisioningTemplateMetadata Path Path to the xml or pnp file containing the provisioning template. String TemplateDisplayName It can be used to specify the DisplayName of the template file that will be updated. String TemplateImagePreviewUrl It can be used to specify the ImagePreviewUrl of the template file that will be updated. String TemplateProperties It can be used to specify custom Properties for the template file that will be updated. Hashtable TemplateProviderExtensions Allows you to specify ITemplateProviderExtension to execute while extracting a template. ITemplateProviderExtension[] Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Path Path to the xml or pnp file containing the provisioning template. String String TemplateDisplayName It can be used to specify the DisplayName of the template file that will be updated. String String TemplateImagePreviewUrl It can be used to specify the ImagePreviewUrl of the template file that will be updated. String String TemplateProperties It can be used to specify custom Properties for the template file that will be updated. Hashtable Hashtable TemplateProviderExtensions Allows you to specify ITemplateProviderExtension to execute while extracting a template. ITemplateProviderExtension[] ITemplateProviderExtension[] Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Set-PnPProvisioningTemplateMetadata -Path template.xml -TemplateDisplayName "DisplayNameValue" Sets the DisplayName property of a provisioning template in XML format. ------------------EXAMPLE 2--------------------- PS:> Set-PnPProvisioningTemplateMetadata -Path template.pnp -TemplateDisplayName "DisplayNameValue" Sets the DisplayName property of a provisioning template in Office Open XML format. ------------------EXAMPLE 3--------------------- PS:> Set-PnPProvisioningTemplateMetadata -Path template.xml -TemplateImagePreviewUrl "Full URL of the Image Preview" Sets the Url to the preview image of a provisioning template in XML format. ------------------EXAMPLE 4--------------------- PS:> Set-PnPProvisioningTemplateMetadata -Path template.pnp -TemplateImagePreviewUrl "Full URL of the Image Preview" Sets the to the preview image of a provisioning template in Office Open XML format. ------------------EXAMPLE 5--------------------- PS:> Set-PnPProvisioningTemplateMetadata -Path template.xml -TemplateProperties @{"Property1" = "Test Value 1"; "Property2"="Test Value 2"} Sets the property 'Property1' to the value 'Test Value 1' of a provisioning template in XML format. ------------------EXAMPLE 6--------------------- PS:> Set-PnPProvisioningTemplateMetadata -Path template.pnp -TemplateProperties @{"Property1" = "Test Value 1"; "Property2"="Test Value 2"} Sets the property 'Property1' to the value 'Test Value 1' of a provisioning template in Office Open XML format. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Set-PnPRequestAccessEmails * Supported in: SharePoint Online. Sets Request Access Emails on a web Set PnPRequestAccessEmails Set-PnPRequestAccessEmails Emails Email address(es) to set the RequestAccessEmails to String[] Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Emails Email address(es) to set the RequestAccessEmails to String[] String[] Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Set-PnPRequestAccessEmails -Emails someone@example.com This will update the request access e-mail address ------------------EXAMPLE 2--------------------- PS:> Set-PnPRequestAccessEmails -Emails @( someone@example.com; someoneelse@example.com ) This will update multiple request access e-mail addresses SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Set-PnPSearchConfiguration Sets the search configuration Set PnPSearchConfiguration Set-PnPSearchConfiguration Configuration Search configuration string String Scope SearchConfigurationScope Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Set-PnPSearchConfiguration Path Path to a search configuration String Scope SearchConfigurationScope Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Configuration Search configuration string String String Path Path to a search configuration String String Scope SearchConfigurationScope SearchConfigurationScope Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Set-PnPSearchConfiguration -Configuration $config Sets the search configuration for the current web ------------------EXAMPLE 2--------------------- PS:> Set-PnPSearchConfiguration -Configuration $config -Scope Site Sets the search configuration for the current site collection ------------------EXAMPLE 3--------------------- PS:> Set-PnPSearchConfiguration -Configuration $config -Scope Subscription Sets the search configuration for the current tenant ------------------EXAMPLE 4--------------------- PS:> Set-PnPSearchConfiguration -Path searchconfig.xml -Scope Subscription Reads the search configuration from the specified XML file and sets it for the current tenant SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Set-PnPSite * Supported in: SharePoint Online. Sets Site Collection properties. Set PnPSite Set-PnPSite Classification The classification to set String DisableFlows Disables flows for this site SwitchParameter Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Classification The classification to set String String DisableFlows Disables flows for this site SwitchParameter SwitchParameter Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection ------------------EXAMPLE 1--------------------- PS:> Set-PnPSite -Classification "HBI" Sets the current site classification to HBI ------------------EXAMPLE 2--------------------- PS:> Set-PnPSite -Classification $null Unsets the current site classification ------------------EXAMPLE 3--------------------- PS:> Set-PnPSite -DisableFlows Disables Flows for this site ------------------EXAMPLE 4--------------------- PS:> Set-PnPSite -DisableFlows:$false Enables Flows for this site SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Set-PnPSiteClosure Opens or closes a site which has a site policy applied Set PnPSiteClosure Set-PnPSiteClosure State The state of the site ClosureState Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection State The state of the site ClosureState ClosureState Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Set-PnPSiteClosure -State Open This opens a site which has been closed and has a site policy applied. ------------------EXAMPLE 2--------------------- PS:> Set-PnPSiteClosure -State Closed This closes a site which is open and has a site policy applied. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Set-PnPSiteDesign * Supported in: SharePoint Online. Updates a Site Design on the current tenant. Set PnPSiteDesign Set-PnPSiteDesign Identity The guid or an object representing the site design TenantSiteDesignPipeBind Title The title of the site design String SiteScriptIds An array of guids of site scripts GuidPipeBind[] Description The description of the site design String IsDefault Specifies if the site design is a default site design SwitchParameter PreviewImageAltText Sets the text for the preview image String PreviewImageUrl Sets the url to the preview image String WebTemplate Specifies the type of site to which this design applies SiteWebTemplate Version Specifies the version of the design Int32 Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Description The description of the site design String String Identity The guid or an object representing the site design TenantSiteDesignPipeBind TenantSiteDesignPipeBind IsDefault Specifies if the site design is a default site design SwitchParameter SwitchParameter PreviewImageAltText Sets the text for the preview image String String PreviewImageUrl Sets the url to the preview image String String SiteScriptIds An array of guids of site scripts GuidPipeBind[] GuidPipeBind[] Title The title of the site design String String Version Specifies the version of the design Int32 Int32 WebTemplate Specifies the type of site to which this design applies SiteWebTemplate SiteWebTemplate Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection ------------------EXAMPLE 1--------------------- PS:> Set-PnPSiteDesign -Identity 046e2e76-67ba-46ca-a5f6-8eb418a7821e -Title "My Updated Company Design" Updates an existing Site Design and sets a new title. ------------------EXAMPLE 2--------------------- PS:> $design = Get-PnPSiteDesign -Identity 046e2e76-67ba-46ca-a5f6-8eb418a7821e PS:> Set-PnPSiteDesign -Identity $design -Title "My Updated Company Design" Updates an existing Site Design and sets a new title. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Set-PnPSiteScript * Supported in: SharePoint Online. Updates an existing Site Script on the current tenant. Set PnPSiteScript Set-PnPSiteScript Identity The guid or an object representing the site script TenantSiteScriptPipeBind Title The title of the site script String Description The description of the site script String Content A JSON string containing the site script String Version Specifies the version of the site script Int32 Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Content A JSON string containing the site script String String Description The description of the site script String String Identity The guid or an object representing the site script TenantSiteScriptPipeBind TenantSiteScriptPipeBind Title The title of the site script String String Version Specifies the version of the site script Int32 Int32 Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection ------------------EXAMPLE 1--------------------- PS:> Set-PnPSiteScript -Identity f1d55d9b-b116-4f54-bc00-164a51e7e47f -Title "My Site Script" Updates an existing Site Script and changes the title. ------------------EXAMPLE 2--------------------- PS:> $script = Get-PnPSiteScript -Identity f1d55d9b-b116-4f54-bc00-164a51e7e47f PS:> Set-PnPSiteScript -Identity $script -Title "My Site Script" Updates an existing Site Script and changes the title. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Set-PnPTaxonomyFieldValue Sets a taxonomy term value in a listitem field Set PnPTaxonomyFieldValue Set-PnPTaxonomyFieldValue ListItem The list item to set the field value to ListItem InternalFieldName The internal name of the field String Terms Allows you to specify terms with key value pairs that can be referred to in the template by means of the {id:label} token. See examples on how to use this parameter. Hashtable Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Set-PnPTaxonomyFieldValue TermId The Id of the Term GuidPipeBind ListItem The list item to set the field value to ListItem InternalFieldName The internal name of the field String Label The Label value of the term String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Set-PnPTaxonomyFieldValue TermPath A path in the form of GROUPLABEL|TERMSETLABEL|TERMLABEL String ListItem The list item to set the field value to ListItem InternalFieldName The internal name of the field String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection InternalFieldName The internal name of the field String String Label The Label value of the term String String ListItem The list item to set the field value to ListItem ListItem TermId The Id of the Term GuidPipeBind GuidPipeBind TermPath A path in the form of GROUPLABEL|TERMSETLABEL|TERMLABEL String String Terms Allows you to specify terms with key value pairs that can be referred to in the template by means of the {id:label} token. See examples on how to use this parameter. Hashtable Hashtable Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection ------------------EXAMPLE 1--------------------- PS:> Set-PnPTaxonomyFieldValue -ListItem $item -InternalFieldName 'Department' -TermId 863b832b-6818-4e6a-966d-2d3ee057931c Sets the field called 'Department' to the value of the term with the ID specified ------------------EXAMPLE 2--------------------- PS:> Set-PnPTaxonomyFieldValue -ListItem $item -InternalFieldName 'Department' -TermPath 'CORPORATE|DEPARTMENTS|HR' Sets the field called 'Department' to the term called HR which is located in the DEPARTMENTS termset, which in turn is located in the CORPORATE termgroup. ------------------EXAMPLE 3--------------------- PS:> Set-PnPTaxonomyFieldValue -ListItem $item -InternalFieldName 'Department' -Terms @{"TermId1"="Label1";"TermId2"="Label2"} Sets the field called 'Department' with multiple terms by ID and label. You can refer to those terms with the {ID:label} token. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Set-PnPTenant * Supported in: SharePoint Online. Returns organization-level site collection properties Set PnPTenant Returns organization-level site collection properties such as StorageQuota, StorageQuotaAllocated, ResourceQuota, ResourceQuotaAllocated, and SiteCreationMode. Currently, there are no parameters for this cmdlet. You must be a SharePoint Online global administrator to run the cmdlet. Set-PnPTenant MinCompatibilityLevel Specifies the lower bound on the compatibility level for new sites. Int32 MaxCompatibilityLevel Specifies the upper bound on the compatibility level for new sites. Int32 ExternalServicesEnabled Enables external services for a tenant. External services are defined as services that are not in the Office 365 datacenters. The valid values are: True (default) - External services are enabled for the tenant. False - External services that are outside of the Office 365 datacenters cannot interact with SharePoint. Boolean NoAccessRedirectUrl Specifies the URL of the redirected site for those site collections which have the locked state "NoAccess" The valid values are: ""(default) - Blank by default, this will also remove or clear any value that has been set. Full URL - Example: https://contoso.sharepoint.com/Pages/Locked.aspx String SharingCapability Determines what level of sharing is available for the site. The valid values are: ExternalUserAndGuestSharing (default) - External user sharing (share by email) and guest link sharing are both enabled. Disabled - External user sharing (share by email) and guest link sharing are both disabled. ExternalUserSharingOnly - External user sharing (share by email) is enabled, but guest link sharing is disabled. For more information about sharing, see Manage external sharing for your SharePoint online environment (http://office.microsoft.com/en-us/office365-sharepoint-online-enterprise-help/manage-external-sharing-for-your-sharepoint-online-environment-HA102849864.aspx). SharingCapabilities DisplayStartASiteOption Determines whether tenant users see the Start a Site menu option. The valid values are: True (default) - Tenant users will see the Start a Site menu option. False - Start a Site is hidden from the menu. Boolean StartASiteFormUrl Specifies URL of the form to load in the Start a Site dialog. The valid values are: "" (default) - Blank by default, this will also remove or clear any value that has been set. Full URL - Example: "https://contoso.sharepoint.com/path/to/form" String ShowEveryoneClaim Enables the administrator to hide the Everyone claim in the People Picker. When users share an item with Everyone, it is accessible to all authenticated users in the tenant's Azure Active Directory, including any active external users who have previously accepted invitations. Note, that some SharePoint system resources such as templates and pages are required to be shared to Everyone and this type of sharing does not expose any user data or metadata. The valid values are: True (default) - The Everyone claim group is displayed in People Picker. False - The Everyone claim group is hidden from the People Picker. Boolean ShowAllUsersClaim Enables the administrator to hide the All Users claim groups in People Picker. When users share an item with "All Users (x)", it is accessible to all organization members in the tenant's Azure Active Directory who have authenticated with via this method. When users share an item with "All Users (x)" it is accessible to all organtization members in the tenant that used NTLM to authentication with SharePoint. Note, the All Users(authenticated) group is equivalent to the Everyone claim, and shows as Everyone.To change this, see - ShowEveryoneClaim. The valid values are: True(default) - The All Users claim groups are displayed in People Picker. False - The All Users claim groups are hidden in People Picker. Boolean ShowEveryoneExceptExternalUsersClaim Enables the administrator to hide the "Everyone except external users" claim in the People Picker. When users share an item with "Everyone except external users", it is accessible to all organization members in the tenant's Azure Active Directory, but not to any users who have previously accepted invitations. The valid values are: True(default) - The Everyone except external users is displayed in People Picker. False - The Everyone except external users claim is not visible in People Picker. Boolean SearchResolveExactEmailOrUPN Removes the search capability from People Picker. Note, recently resolved names will still appear in the list until browser cache is cleared or expired. SharePoint Administrators will still be able to use starts with or partial name matching when enabled. The valid values are: False (default) - Starts with / partial name search functionality is available. True - Disables starts with / partial name search functionality for all SharePoint users, except SharePoint Admins. Boolean OfficeClientADALDisabled When set to true this will disable the ability to use Modern Authentication that leverages ADAL across the tenant. The valid values are: False (default) - Modern Authentication is enabled/allowed. True - Modern Authentication via ADAL is disabled. Boolean LegacyAuthProtocolsEnabled By default this value is set to $true. Setting this parameter prevents Office clients using non-modern authentication protocols from accessing SharePoint Online resources. A value of $true - Enables Office clients using non-modern authentication protocols(such as, Forms-Based Authentication (FBA) or Identity Client Runtime Library (IDCRL)) to access SharePoint resources. A value of $false - Prevents Office clients using non-modern authentication protocols from accessing SharePoint Online resources. Note: This may also prevent third-party apps from accessing SharePoint Online resources.Also, this will also block apps using the SharePointOnlineCredentials class to access SharePoint Online resources.For additional information about SharePointOnlineCredentials, see SharePointOnlineCredentials class. Boolean RequireAcceptingAccountMatchInvitedAccount Ensures that an external user can only accept an external sharing invitation with an account matching the invited email address. Administrators who desire increased control over external collaborators should consider enabling this feature. Note, this only applies to new external users accepting new sharing invitations. Also, the resource owner must share with an organizational or Microsoft account or the external user will be unable to access the resource. The valid values are: False (default) - When a document is shared with an external user, bob@contoso.com, it can be accepted by any user with access to the invitation link in the original e-mail. True - User must accept this invitation with bob@contoso.com. Boolean ProvisionSharedWithEveryoneFolder Creates a Shared with Everyone folder in every user's new OneDrive for Business document library. The valid values are: True (default) - The Shared with Everyone folder is created. False - No folder is created when the site and OneDrive for Business document library is created. The default behavior of the Shared with Everyone folder changed in August 2015. For additional information about the change, see Provision the Shared with Everyone folder in OneDrive for Business (https://support.office.com/en-us/article/Provision-the-Shared-with-Everyone-folder-in-OneDrive-for-Business-6bb02c91-fd0b-42ba-9457-3921cb6dc5b2?ui=en-US&rs=en-US&ad=US) Boolean SignInAccelerationDomain Specifies the home realm discovery value to be sent to Azure Active Directory (AAD) during the user sign-in process. When the organization uses a third-party identity provider, this prevents the user from seeing the Azure Active Directory Home Realm Discovery web page and ensures the user only sees their company's Identity Provider's portal. This value can also be used with Azure Active Directory Premium to customize the Azure Active Directory login page. Acceleration will not occur on site collections that are shared externally. This value should be configured with the login domain that is used by your company (that is, example@contoso.com). If your company has multiple third-party identity providers, configuring the sign-in acceleration value will break sign-in for your organization. The valid values are: "" (default) - Blank by default, this will also remove or clear any value that has been set. Login Domain - For example: "contoso.com" String EnableGuestSignInAcceleration Accelerates guest-enabled site collections as well as member-only site collections when the SignInAccelerationDomain parameter is set. Note: If enabled, your identity provider must be capable of authenticating guest users. If it is not, guest users will be unable to log in and access content that was shared with them. Boolean UsePersistentCookiesForExplorerView Lets SharePoint issue a special cookie that will allow this feature to work even when "Keep Me Signed In" is not selected. "Open with Explorer" requires persisted cookies to operate correctly. When the user does not select "Keep Me Signed in" at the time of sign -in, "Open with Explorer" will fail. This special cookie expires after 30 minutes and cannot be cleared by closing the browser or signing out of SharePoint Online.To clear this cookie, the user must log out of their Windows session. The valid values are: False(default) - No special cookie is generated and the normal Office 365 sign -in length / timing applies. True - Generates a special cookie that will allow "Open with Explorer" to function if the "Keep Me Signed In" box is not checked at sign -in. Boolean BccExternalSharingInvitations When the feature is enabled, all external sharing invitations that are sent will blind copy the e-mail messages listed in the BccExternalSharingsInvitationList. The valid values are: False (default) - BCC for external sharing is disabled. True - All external sharing invitations that are sent will blind copy the e-mail messages listed in the BccExternalSharingsInvitationList. Boolean BccExternalSharingInvitationsList Specifies a list of e-mail addresses to be BCC'd when the BCC for External Sharing feature is enabled. Multiple addresses can be specified by creating a comma separated list with no spaces. The valid values are: "" (default) - Blank by default, this will also clear any value that has been set. Single or Multiple e-mail addresses - joe@contoso.com or joe@contoso.com,bob@contoso.com String UserVoiceForFeedbackEnabled Boolean PublicCdnEnabled Boolean PublicCdnAllowedFileTypes String RequireAnonymousLinksExpireInDays Specifies all anonymous links that have been created (or will be created) will expire after the set number of days . To remove the expiration requirement, set the value to zero (0). Int32 SharingAllowedDomainList Specifies a list of email domains that is allowed for sharing with the external collaborators. Use the space character as the delimiter for entering multiple values. For example, "contoso.com fabrikam.com". For additional information about how to restrict a domain sharing, see Restricted Domains Sharing in Office 365 SharePoint Online and OneDrive for Business String SharingBlockedDomainList Specifies a list of email domains that is blocked or prohibited for sharing with the external collaborators. Use space character as the delimiter for entering multiple values. For example, "contoso.com fabrikam.com". For additional information about how to restrict a domain sharing, see Restricted Domains Sharing in Office 365 SharePoint Online and OneDrive for Business String SharingDomainRestrictionMode Specifies the external sharing mode for domains. The following values are: None AllowList BlockList For additional information about how to restrict a domain sharing, see Restricted Domains Sharing in Office 365 SharePoint Online and OneDrive for Business. SharingDomainRestrictionModes OneDriveStorageQuota Sets a default OneDrive for Business storage quota for the tenant. It will be used for new OneDrive for Business sites created. A typical use will be to reduce the amount of storage associated with OneDrive for Business to a level below what the License entitles the users. For example, it could be used to set the quota to 10 gigabytes (GB) by default. If value is set to 0, the parameter will have no effect. If the value is set larger than the Maximum allowed OneDrive for Business quota, it will have no effect. Int64 OneDriveForGuestsEnabled Lets OneDrive for Business creation for administrator managed guest users. Administrator managed Guest users use credentials in the resource tenant to access the resources. The valid values are the following: $true-Administrator managed Guest users can be given OneDrives, provided needed licenses are assigned. $false- Administrator managed Guest users can't be given OneDrives as functionality is turned off. Boolean IPAddressEnforcement Allows access from network locations that are defined by an administrator. The values are $true and $false. The default value is $false which means the setting is disabled. Before the IPAddressEnforcement parameter is set, make sure you add a valid IPv4 or IPv6 address to the IPAddressAllowList parameter. Boolean IPAddressAllowList Configures multiple IP addresses or IP address ranges (IPv4 or IPv6). Use commas to separate multiple IP addresses or IP address ranges. Verify there are no overlapping IP addresses and ensure IP ranges use Classless Inter-Domain Routing (CIDR) notation. For example, 172.16.0.0, 192.168.1.0/27. Note: The IPAddressAllowList parameter only lets administrators set IP addresses or ranges that are recognized as trusted. To only grant access from these IP addresses or ranges, set the IPAddressEnforcement parameter to $true. String IPAddressWACTokenLifetime Int32 UseFindPeopleInPeoplePicker Note: When set to $true, users aren't able to share with security groups or SharePoint groups. Boolean DefaultSharingLinkType Lets administrators choose what type of link appears is selected in the “Get a link” sharing dialog box in OneDrive for Business and SharePoint Online. For additional information about how to change the default link type, see Change the default link type when users get links for sharing. Note: Setting this value to “none” will default “get a link” to the most permissive link available (that is, if anonymous links are enabled, the default link will be anonymous access; if they are disabled then the default link will be internal. The values are: None Direct Internal AnonymousAccess SharingLinkType ODBMembersCanShare Lets administrators set policy on re-sharing behavior in OneDrive for Business. Values: On- Users with edit permissions can re-share. Off- Only OneDrive for Business owner can share. The value of ODBAccessRequests defines whether a request to share gets sent to the owner. Unspecified- Let each OneDrive for Business owner enable or disable re-sharing behavior on their OneDrive. SharingState ODBAccessRequests Lets administrators set policy on access requests and requests to share in OneDrive for Business. Values: On- Users without permission to share can trigger sharing requests to the OneDrive for Business owner when they attempt to share. Also, users without permission to a file or folder can trigger access requests to the OneDrive for Business owner when they attempt to access an item they do not have permissions to. Off- Prevent access requests and requests to share on OneDrive for Business. Unspecified- Let each OneDrive for Business owner enable or disable access requests and requests to share on their OneDrive. SharingState PreventExternalUsersFromResharing Boolean ShowPeoplePickerSuggestionsForGuestUsers Boolean FileAnonymousLinkType AnonymousLinkType FolderAnonymousLinkType AnonymousLinkType NotifyOwnersWhenItemsReshared When this parameter is set to $true and another user re-shares a document from a user’s OneDrive for Business, the OneDrive for Business owner is notified by e-mail. For additional information about how to configure notifications for external sharing, see Configure notifications for external sharing for OneDrive for Business. The values are $true and $false. Boolean NotifyOwnersWhenInvitationsAccepted When this parameter is set to $true and when an external user accepts an invitation to a resource in a user’s OneDrive for Business, the OneDrive for Business owner is notified by e-mail. For additional information about how to configure notifications for external sharing, see Configure notifications for external sharing for OneDrive for Business. The values are $true and $false. Boolean NotificationsInOneDriveForBusinessEnabled Boolean NotificationsInSharePointEnabled Boolean OwnerAnonymousNotification Boolean CommentsOnSitePagesDisabled Boolean SocialBarOnSitePagesDisabled Boolean OrphanedPersonalSitesRetentionPeriod Specifies the number of days after a user's Active Directory account is deleted that their OneDrive for Business content will be deleted. The value range is in days, between 30 and 3650. The default value is 30. Int32 DisallowInfectedFileDownload Prevents the Download button from being displayed on the Virus Found warning page. Accepts a value of true (enabled) to hide the Download button or false (disabled) to display the Download button. By default this feature is set to false. Boolean DefaultLinkPermission SharingPermissionType ConditionalAccessPolicy SPOConditionalAccessPolicyType AllowDownloadingNonWebViewableFiles Boolean AllowEditing Boolean ApplyAppEnforcedRestrictionsToAdHocRecipients Boolean FilePickerExternalImageSearchEnabled Boolean EmailAttestationRequired Boolean EmailAttestationReAuthDays Int32 HideDefaultThemes Defines if the default themes are visible or hidden Boolean Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection AllowDownloadingNonWebViewableFiles Boolean Boolean AllowEditing Boolean Boolean ApplyAppEnforcedRestrictionsToAdHocRecipients Boolean Boolean BccExternalSharingInvitations When the feature is enabled, all external sharing invitations that are sent will blind copy the e-mail messages listed in the BccExternalSharingsInvitationList. The valid values are: False (default) - BCC for external sharing is disabled. True - All external sharing invitations that are sent will blind copy the e-mail messages listed in the BccExternalSharingsInvitationList. Boolean Boolean BccExternalSharingInvitationsList Specifies a list of e-mail addresses to be BCC'd when the BCC for External Sharing feature is enabled. Multiple addresses can be specified by creating a comma separated list with no spaces. The valid values are: "" (default) - Blank by default, this will also clear any value that has been set. Single or Multiple e-mail addresses - joe@contoso.com or joe@contoso.com,bob@contoso.com String String CommentsOnSitePagesDisabled Boolean Boolean ConditionalAccessPolicy SPOConditionalAccessPolicyType SPOConditionalAccessPolicyType DefaultLinkPermission SharingPermissionType SharingPermissionType DefaultSharingLinkType Lets administrators choose what type of link appears is selected in the “Get a link” sharing dialog box in OneDrive for Business and SharePoint Online. For additional information about how to change the default link type, see Change the default link type when users get links for sharing. Note: Setting this value to “none” will default “get a link” to the most permissive link available (that is, if anonymous links are enabled, the default link will be anonymous access; if they are disabled then the default link will be internal. The values are: None Direct Internal AnonymousAccess SharingLinkType SharingLinkType DisallowInfectedFileDownload Prevents the Download button from being displayed on the Virus Found warning page. Accepts a value of true (enabled) to hide the Download button or false (disabled) to display the Download button. By default this feature is set to false. Boolean Boolean DisplayStartASiteOption Determines whether tenant users see the Start a Site menu option. The valid values are: True (default) - Tenant users will see the Start a Site menu option. False - Start a Site is hidden from the menu. Boolean Boolean EmailAttestationReAuthDays Int32 Int32 EmailAttestationRequired Boolean Boolean EnableGuestSignInAcceleration Accelerates guest-enabled site collections as well as member-only site collections when the SignInAccelerationDomain parameter is set. Note: If enabled, your identity provider must be capable of authenticating guest users. If it is not, guest users will be unable to log in and access content that was shared with them. Boolean Boolean ExternalServicesEnabled Enables external services for a tenant. External services are defined as services that are not in the Office 365 datacenters. The valid values are: True (default) - External services are enabled for the tenant. False - External services that are outside of the Office 365 datacenters cannot interact with SharePoint. Boolean Boolean FileAnonymousLinkType AnonymousLinkType AnonymousLinkType FilePickerExternalImageSearchEnabled Boolean Boolean FolderAnonymousLinkType AnonymousLinkType AnonymousLinkType HideDefaultThemes Defines if the default themes are visible or hidden Boolean Boolean IPAddressAllowList Configures multiple IP addresses or IP address ranges (IPv4 or IPv6). Use commas to separate multiple IP addresses or IP address ranges. Verify there are no overlapping IP addresses and ensure IP ranges use Classless Inter-Domain Routing (CIDR) notation. For example, 172.16.0.0, 192.168.1.0/27. Note: The IPAddressAllowList parameter only lets administrators set IP addresses or ranges that are recognized as trusted. To only grant access from these IP addresses or ranges, set the IPAddressEnforcement parameter to $true. String String IPAddressEnforcement Allows access from network locations that are defined by an administrator. The values are $true and $false. The default value is $false which means the setting is disabled. Before the IPAddressEnforcement parameter is set, make sure you add a valid IPv4 or IPv6 address to the IPAddressAllowList parameter. Boolean Boolean IPAddressWACTokenLifetime Int32 Int32 LegacyAuthProtocolsEnabled By default this value is set to $true. Setting this parameter prevents Office clients using non-modern authentication protocols from accessing SharePoint Online resources. A value of $true - Enables Office clients using non-modern authentication protocols(such as, Forms-Based Authentication (FBA) or Identity Client Runtime Library (IDCRL)) to access SharePoint resources. A value of $false - Prevents Office clients using non-modern authentication protocols from accessing SharePoint Online resources. Note: This may also prevent third-party apps from accessing SharePoint Online resources.Also, this will also block apps using the SharePointOnlineCredentials class to access SharePoint Online resources.For additional information about SharePointOnlineCredentials, see SharePointOnlineCredentials class. Boolean Boolean MaxCompatibilityLevel Specifies the upper bound on the compatibility level for new sites. Int32 Int32 MinCompatibilityLevel Specifies the lower bound on the compatibility level for new sites. Int32 Int32 NoAccessRedirectUrl Specifies the URL of the redirected site for those site collections which have the locked state "NoAccess" The valid values are: ""(default) - Blank by default, this will also remove or clear any value that has been set. Full URL - Example: https://contoso.sharepoint.com/Pages/Locked.aspx String String NotificationsInOneDriveForBusinessEnabled Boolean Boolean NotificationsInSharePointEnabled Boolean Boolean NotifyOwnersWhenInvitationsAccepted When this parameter is set to $true and when an external user accepts an invitation to a resource in a user’s OneDrive for Business, the OneDrive for Business owner is notified by e-mail. For additional information about how to configure notifications for external sharing, see Configure notifications for external sharing for OneDrive for Business. The values are $true and $false. Boolean Boolean NotifyOwnersWhenItemsReshared When this parameter is set to $true and another user re-shares a document from a user’s OneDrive for Business, the OneDrive for Business owner is notified by e-mail. For additional information about how to configure notifications for external sharing, see Configure notifications for external sharing for OneDrive for Business. The values are $true and $false. Boolean Boolean ODBAccessRequests Lets administrators set policy on access requests and requests to share in OneDrive for Business. Values: On- Users without permission to share can trigger sharing requests to the OneDrive for Business owner when they attempt to share. Also, users without permission to a file or folder can trigger access requests to the OneDrive for Business owner when they attempt to access an item they do not have permissions to. Off- Prevent access requests and requests to share on OneDrive for Business. Unspecified- Let each OneDrive for Business owner enable or disable access requests and requests to share on their OneDrive. SharingState SharingState ODBMembersCanShare Lets administrators set policy on re-sharing behavior in OneDrive for Business. Values: On- Users with edit permissions can re-share. Off- Only OneDrive for Business owner can share. The value of ODBAccessRequests defines whether a request to share gets sent to the owner. Unspecified- Let each OneDrive for Business owner enable or disable re-sharing behavior on their OneDrive. SharingState SharingState OfficeClientADALDisabled When set to true this will disable the ability to use Modern Authentication that leverages ADAL across the tenant. The valid values are: False (default) - Modern Authentication is enabled/allowed. True - Modern Authentication via ADAL is disabled. Boolean Boolean OneDriveForGuestsEnabled Lets OneDrive for Business creation for administrator managed guest users. Administrator managed Guest users use credentials in the resource tenant to access the resources. The valid values are the following: $true-Administrator managed Guest users can be given OneDrives, provided needed licenses are assigned. $false- Administrator managed Guest users can't be given OneDrives as functionality is turned off. Boolean Boolean OneDriveStorageQuota Sets a default OneDrive for Business storage quota for the tenant. It will be used for new OneDrive for Business sites created. A typical use will be to reduce the amount of storage associated with OneDrive for Business to a level below what the License entitles the users. For example, it could be used to set the quota to 10 gigabytes (GB) by default. If value is set to 0, the parameter will have no effect. If the value is set larger than the Maximum allowed OneDrive for Business quota, it will have no effect. Int64 Int64 OrphanedPersonalSitesRetentionPeriod Specifies the number of days after a user's Active Directory account is deleted that their OneDrive for Business content will be deleted. The value range is in days, between 30 and 3650. The default value is 30. Int32 Int32 OwnerAnonymousNotification Boolean Boolean PreventExternalUsersFromResharing Boolean Boolean ProvisionSharedWithEveryoneFolder Creates a Shared with Everyone folder in every user's new OneDrive for Business document library. The valid values are: True (default) - The Shared with Everyone folder is created. False - No folder is created when the site and OneDrive for Business document library is created. The default behavior of the Shared with Everyone folder changed in August 2015. For additional information about the change, see Provision the Shared with Everyone folder in OneDrive for Business (https://support.office.com/en-us/article/Provision-the-Shared-with-Everyone-folder-in-OneDrive-for-Business-6bb02c91-fd0b-42ba-9457-3921cb6dc5b2?ui=en-US&rs=en-US&ad=US) Boolean Boolean PublicCdnAllowedFileTypes String String PublicCdnEnabled Boolean Boolean RequireAcceptingAccountMatchInvitedAccount Ensures that an external user can only accept an external sharing invitation with an account matching the invited email address. Administrators who desire increased control over external collaborators should consider enabling this feature. Note, this only applies to new external users accepting new sharing invitations. Also, the resource owner must share with an organizational or Microsoft account or the external user will be unable to access the resource. The valid values are: False (default) - When a document is shared with an external user, bob@contoso.com, it can be accepted by any user with access to the invitation link in the original e-mail. True - User must accept this invitation with bob@contoso.com. Boolean Boolean RequireAnonymousLinksExpireInDays Specifies all anonymous links that have been created (or will be created) will expire after the set number of days . To remove the expiration requirement, set the value to zero (0). Int32 Int32 SearchResolveExactEmailOrUPN Removes the search capability from People Picker. Note, recently resolved names will still appear in the list until browser cache is cleared or expired. SharePoint Administrators will still be able to use starts with or partial name matching when enabled. The valid values are: False (default) - Starts with / partial name search functionality is available. True - Disables starts with / partial name search functionality for all SharePoint users, except SharePoint Admins. Boolean Boolean SharingAllowedDomainList Specifies a list of email domains that is allowed for sharing with the external collaborators. Use the space character as the delimiter for entering multiple values. For example, "contoso.com fabrikam.com". For additional information about how to restrict a domain sharing, see Restricted Domains Sharing in Office 365 SharePoint Online and OneDrive for Business String String SharingBlockedDomainList Specifies a list of email domains that is blocked or prohibited for sharing with the external collaborators. Use space character as the delimiter for entering multiple values. For example, "contoso.com fabrikam.com". For additional information about how to restrict a domain sharing, see Restricted Domains Sharing in Office 365 SharePoint Online and OneDrive for Business String String SharingCapability Determines what level of sharing is available for the site. The valid values are: ExternalUserAndGuestSharing (default) - External user sharing (share by email) and guest link sharing are both enabled. Disabled - External user sharing (share by email) and guest link sharing are both disabled. ExternalUserSharingOnly - External user sharing (share by email) is enabled, but guest link sharing is disabled. For more information about sharing, see Manage external sharing for your SharePoint online environment (http://office.microsoft.com/en-us/office365-sharepoint-online-enterprise-help/manage-external-sharing-for-your-sharepoint-online-environment-HA102849864.aspx). SharingCapabilities SharingCapabilities SharingDomainRestrictionMode Specifies the external sharing mode for domains. The following values are: None AllowList BlockList For additional information about how to restrict a domain sharing, see Restricted Domains Sharing in Office 365 SharePoint Online and OneDrive for Business. SharingDomainRestrictionModes SharingDomainRestrictionModes ShowAllUsersClaim Enables the administrator to hide the All Users claim groups in People Picker. When users share an item with "All Users (x)", it is accessible to all organization members in the tenant's Azure Active Directory who have authenticated with via this method. When users share an item with "All Users (x)" it is accessible to all organtization members in the tenant that used NTLM to authentication with SharePoint. Note, the All Users(authenticated) group is equivalent to the Everyone claim, and shows as Everyone.To change this, see - ShowEveryoneClaim. The valid values are: True(default) - The All Users claim groups are displayed in People Picker. False - The All Users claim groups are hidden in People Picker. Boolean Boolean ShowEveryoneClaim Enables the administrator to hide the Everyone claim in the People Picker. When users share an item with Everyone, it is accessible to all authenticated users in the tenant's Azure Active Directory, including any active external users who have previously accepted invitations. Note, that some SharePoint system resources such as templates and pages are required to be shared to Everyone and this type of sharing does not expose any user data or metadata. The valid values are: True (default) - The Everyone claim group is displayed in People Picker. False - The Everyone claim group is hidden from the People Picker. Boolean Boolean ShowEveryoneExceptExternalUsersClaim Enables the administrator to hide the "Everyone except external users" claim in the People Picker. When users share an item with "Everyone except external users", it is accessible to all organization members in the tenant's Azure Active Directory, but not to any users who have previously accepted invitations. The valid values are: True(default) - The Everyone except external users is displayed in People Picker. False - The Everyone except external users claim is not visible in People Picker. Boolean Boolean ShowPeoplePickerSuggestionsForGuestUsers Boolean Boolean SignInAccelerationDomain Specifies the home realm discovery value to be sent to Azure Active Directory (AAD) during the user sign-in process. When the organization uses a third-party identity provider, this prevents the user from seeing the Azure Active Directory Home Realm Discovery web page and ensures the user only sees their company's Identity Provider's portal. This value can also be used with Azure Active Directory Premium to customize the Azure Active Directory login page. Acceleration will not occur on site collections that are shared externally. This value should be configured with the login domain that is used by your company (that is, example@contoso.com). If your company has multiple third-party identity providers, configuring the sign-in acceleration value will break sign-in for your organization. The valid values are: "" (default) - Blank by default, this will also remove or clear any value that has been set. Login Domain - For example: "contoso.com" String String SocialBarOnSitePagesDisabled Boolean Boolean StartASiteFormUrl Specifies URL of the form to load in the Start a Site dialog. The valid values are: "" (default) - Blank by default, this will also remove or clear any value that has been set. Full URL - Example: "https://contoso.sharepoint.com/path/to/form" String String UseFindPeopleInPeoplePicker Note: When set to $true, users aren't able to share with security groups or SharePoint groups. Boolean Boolean UsePersistentCookiesForExplorerView Lets SharePoint issue a special cookie that will allow this feature to work even when "Keep Me Signed In" is not selected. "Open with Explorer" requires persisted cookies to operate correctly. When the user does not select "Keep Me Signed in" at the time of sign -in, "Open with Explorer" will fail. This special cookie expires after 30 minutes and cannot be cleared by closing the browser or signing out of SharePoint Online.To clear this cookie, the user must log out of their Windows session. The valid values are: False(default) - No special cookie is generated and the normal Office 365 sign -in length / timing applies. True - Generates a special cookie that will allow "Open with Explorer" to function if the "Keep Me Signed In" box is not checked at sign -in. Boolean Boolean UserVoiceForFeedbackEnabled Boolean Boolean Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection ------------------EXAMPLE 1--------------------- PS:> Set-PnPTenantSite -Identity https://contoso.sharepoint.com/sites/team1 -LockState NoAccess Set-PnPTenant -NoAcessRedirectUrl 'http://www.contoso.com' This example blocks access to https://contoso.sharepoint.com/sites/team1 and redirects traffic to http://www.contoso.com. ------------------EXAMPLE 2--------------------- PS:> Set-PnPTenant -ShowEveryoneExceptExternalUsersClaim $false This example hides the "Everyone Except External Users" claim in People Picker. ------------------EXAMPLE 3--------------------- PS:> Set-PnPTenant -ShowAllUsersClaim $false This example hides the "All Users" claim group in People Picker. ------------------EXAMPLE 4--------------------- PS:> Set-PnPTenant -UsePersistentCookiesForExplorerView $true This example enables the use of special persisted cookie for Open with Explorer. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Set-PnPTenantCdnEnabled * Supported in: SharePoint Online. Enables or disabled the public or private Office 365 Content Delivery Network (CDN). Set PnPTenantCdnEnabled Enables or disabled the public or private Office 365 Content Delivery Network (CDN). Set-PnPTenantCdnEnabled Enable Specify to enable or disable Boolean CdnType The type of cdn to enable or disable CdnType Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection CdnType The type of cdn to enable or disable CdnType CdnType Enable Specify to enable or disable Boolean Boolean Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection ------------------EXAMPLE 1--------------------- PS:> Set-PnPTenantCdnEnabled -CdnType Public -Enable $true This example sets the Public CDN enabled. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Set-PnPTenantCdnPolicy * Supported in: SharePoint Online. Sets the CDN Policies for the specified CDN (Public | Private). Set PnPTenantCdnPolicy Sets the CDN Policies for the specified CDN (Public | Private). Set-PnPTenantCdnPolicy CdnType The type of cdn to retrieve the policies from SPOTenantCdnType PolicyType The type of the policy to set SPOTenantCdnPolicyType PolicyValue The value of the policy to set String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection CdnType The type of cdn to retrieve the policies from SPOTenantCdnType SPOTenantCdnType PolicyType The type of the policy to set SPOTenantCdnPolicyType SPOTenantCdnPolicyType PolicyValue The value of the policy to set String String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection ------------------EXAMPLE 1--------------------- PS:> Set-PnPTenantCdnPolicy -CdnType Public -PolicyType IncludeFileExtensions -PolicyValue "CSS,EOT,GIF,ICO,JPEG,JPG,JS,MAP,PNG,SVG,TTF,WOFF" This example sets the IncludeFileExtensions policy to the specified value. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Set-PnPTenantSite * Supported in: SharePoint Online. Set site information. Set PnPTenantSite Sets site properties for existing sites. Set-PnPTenantSite Url Specifies the URL of the site String Title Specifies the title of the site String Sharing Specifies what the sharing capablilites are for the site. Possible values: Disabled, ExternalUserSharingOnly, ExternalUserAndGuestSharing, ExistingExternalUserSharingOnly SharingCapabilities StorageMaximumLevel Specifies the storage quota for this site collection in megabytes. This value must not exceed the company's available quota. Int64 StorageWarningLevel Specifies the warning level for the storage quota in megabytes. This value must not exceed the values set for the StorageMaximumLevel parameter Int64 UserCodeMaximumLevel Specifies the quota for this site collection in Sandboxed Solutions units. This value must not exceed the company's aggregate available Sandboxed Solutions quota. The default value is 0. For more information, see Resource Usage Limits on Sandboxed Solutions in SharePoint 2010 : http://msdn.microsoft.com/en-us/library/gg615462.aspx. Double UserCodeWarningLevel Specifies the warning level for the resource quota. This value must not exceed the value set for the UserCodeMaximumLevel parameter Double AllowSelfServiceUpgrade Specifies if the site administrator can upgrade the site collection SwitchParameter Owners Specifies owner(s) to add as site collection adminstrators. They will be added as additional site collection administrators. Existing administrators will stay. Can be both users and groups. String LockState Sets the lockstate of a site SiteLockState NoScriptSite Specifies if a site allows custom script or not. See https://support.office.com/en-us/article/Turn-scripting-capabilities-on-or-off-1f2c515f-5d7e-448a-9fd7-835da935584f for more information. SwitchParameter Wait Wait for the operation to complete SwitchParameter Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection AllowSelfServiceUpgrade Specifies if the site administrator can upgrade the site collection SwitchParameter SwitchParameter LockState Sets the lockstate of a site SiteLockState SiteLockState NoScriptSite Specifies if a site allows custom script or not. See https://support.office.com/en-us/article/Turn-scripting-capabilities-on-or-off-1f2c515f-5d7e-448a-9fd7-835da935584f for more information. SwitchParameter SwitchParameter Owners Specifies owner(s) to add as site collection adminstrators. They will be added as additional site collection administrators. Existing administrators will stay. Can be both users and groups. String String Sharing Specifies what the sharing capablilites are for the site. Possible values: Disabled, ExternalUserSharingOnly, ExternalUserAndGuestSharing, ExistingExternalUserSharingOnly SharingCapabilities SharingCapabilities StorageMaximumLevel Specifies the storage quota for this site collection in megabytes. This value must not exceed the company's available quota. Int64 Int64 StorageWarningLevel Specifies the warning level for the storage quota in megabytes. This value must not exceed the values set for the StorageMaximumLevel parameter Int64 Int64 Title Specifies the title of the site String String Url Specifies the URL of the site String String UserCodeMaximumLevel Specifies the quota for this site collection in Sandboxed Solutions units. This value must not exceed the company's aggregate available Sandboxed Solutions quota. The default value is 0. For more information, see Resource Usage Limits on Sandboxed Solutions in SharePoint 2010 : http://msdn.microsoft.com/en-us/library/gg615462.aspx. Double Double UserCodeWarningLevel Specifies the warning level for the resource quota. This value must not exceed the value set for the UserCodeMaximumLevel parameter Double Double Wait Wait for the operation to complete SwitchParameter SwitchParameter Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection ------------------EXAMPLE 1--------------------- PS:> Set-PnPTenantSite -Url https://contoso.sharepoint.com -Title "Contoso Website" -Sharing Disabled This will set the title of the site collection with the URL 'https://contoso.sharepoint.com' to 'Contoso Website' and disable sharing on this site collection. ------------------EXAMPLE 2--------------------- PS:> Set-PnPTenantSite -Url https://contoso.sharepoint.com -Title "Contoso Website" -StorageWarningLevel 8000 -StorageMaximumLevel 10000 This will set the title of the site collection with the URL 'https://contoso.sharepoint.com' to 'Contoso Website', set the storage warning level to 8GB and set the storage maximum level to 10GB. ------------------EXAMPLE 3--------------------- PS:> Set-PnPTenantSite -Url https://contoso.sharepoint.com/sites/sales -Owners "user@contoso.onmicrosoft.com" This will add user@contoso.onmicrosoft.com as an additional site collection owner at 'https://contoso.sharepoint.com/sites/sales'. ------------------EXAMPLE 4--------------------- PS:> Set-PnPTenantSite -Url https://contoso.sharepoint.com/sites/sales -Owners @("user1@contoso.onmicrosoft.com", "user2@contoso.onmicrosoft.com") This will add user1@contoso.onmicrosoft.com and user2@contoso.onmicrosoft.com as additional site collection owners at 'https://contoso.sharepoint.com/sites/sales'. ------------------EXAMPLE 5--------------------- PS:> Set-PnPTenantSite -Url https://contoso.sharepoint.com/sites/sales -NoScriptSite:$false This will enable script support for the site 'https://contoso.sharepoint.com/sites/sales' if disabled. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Set-PnPTheme Sets the theme of the current web. Set PnPTheme Sets the theme of the current web, if any of the attributes is not set, that value will be set to null Set-PnPTheme ColorPaletteUrl Specifies the Color Palette Url based on the site or server relative url String FontSchemeUrl Specifies the Font Scheme Url based on the site or server relative url String BackgroundImageUrl Specifies the Background Image Url based on the site or server relative url String ResetSubwebsToInherit Resets subwebs to inherit the theme from the rootweb SwitchParameter UpdateRootWebOnly Updates only the rootweb, even if subwebs are set to inherit the theme. SwitchParameter Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection BackgroundImageUrl Specifies the Background Image Url based on the site or server relative url String String ColorPaletteUrl Specifies the Color Palette Url based on the site or server relative url String String FontSchemeUrl Specifies the Font Scheme Url based on the site or server relative url String String ResetSubwebsToInherit Resets subwebs to inherit the theme from the rootweb SwitchParameter SwitchParameter UpdateRootWebOnly Updates only the rootweb, even if subwebs are set to inherit the theme. SwitchParameter SwitchParameter Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Set-PnPTheme Removes the current theme and resets it to the default. ------------------EXAMPLE 2--------------------- PS:> Set-PnPTheme -ColorPaletteUrl _catalogs/theme/15/company.spcolor ------------------EXAMPLE 3--------------------- PS:> Set-PnPTheme -ColorPaletteUrl _catalogs/theme/15/company.spcolor -BackgroundImageUrl 'style library/background.png' ------------------EXAMPLE 4--------------------- PS:> Set-PnPTheme -ColorPaletteUrl _catalogs/theme/15/company.spcolor -BackgroundImageUrl 'style library/background.png' -ResetSubwebsToInherit Sets the theme to the web, and updates all subwebs to inherit the theme from this web. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Set-PnPTraceLog Turn log tracing on or off Set PnPTraceLog Defines if tracing should be turned on. PnP Core, which is the foundation of these cmdlets, uses the standard Trace functionality of .NET. With this cmdlet you can turn capturing of this trace to a log file on or off. Notice that basically only the Provisioning Engine writes to the tracelog which means that cmdlets related to the engine will produce output. Set-PnPTraceLog On Turn on tracing to log file SwitchParameter LogFile The path and filename of the file to write the trace log to. String Level The level of events to capture. Possible values are 'Debug', 'Error', 'Warning', 'Information'. Defaults to 'Information'. LogLevel Delimiter If specified the trace log entries will be delimited with this value. String IndentSize Indents in the tracelog will be with this amount of characters. Defaults to 4. Int32 AutoFlush Auto flush the trace log. Defaults to true. Boolean Set-PnPTraceLog Off Turn off tracing to log file. SwitchParameter AutoFlush Auto flush the trace log. Defaults to true. Boolean Boolean Delimiter If specified the trace log entries will be delimited with this value. String String IndentSize Indents in the tracelog will be with this amount of characters. Defaults to 4. Int32 Int32 Level The level of events to capture. Possible values are 'Debug', 'Error', 'Warning', 'Information'. Defaults to 'Information'. LogLevel LogLevel LogFile The path and filename of the file to write the trace log to. String String Off Turn off tracing to log file. SwitchParameter SwitchParameter On Turn on tracing to log file SwitchParameter SwitchParameter ------------------EXAMPLE 1--------------------- PS:> Set-PnPTraceLog -On -LogFile traceoutput.txt This turns on trace logging to the file 'traceoutput.txt' and will capture events of at least 'Information' level. ------------------EXAMPLE 2--------------------- PS:> Set-PnPTraceLog -On -LogFile traceoutput.txt -Level Debug This turns on trace logging to the file 'traceoutput.txt' and will capture debug events. ------------------EXAMPLE 3--------------------- PS:> Set-PnPTraceLog -On -LogFile traceoutput.txt -Level Debug -Delimiter "," This turns on trace logging to the file 'traceoutput.txt' and will write the entries as comma separated. Debug events are captured. ------------------EXAMPLE 4--------------------- PS:> Set-PnPTraceLog -Off This turns off trace logging. It will flush any remaining messages to the log file. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Set-PnPUnifiedGroup * Supported in: SharePoint Online. Sets Office 365 Group (aka Unified Group) properties Set PnPUnifiedGroup Set-PnPUnifiedGroup Identity The Identity of the Office 365 Group. UnifiedGroupPipeBind DisplayName The DisplayName of the group to set. String Description The Description of the group to set. String Owners The array UPN values of owners to add to the group. String[] Members The array UPN values of members to add to the group. String[] IsPrivate Makes the group private when selected. SwitchParameter GroupLogoPath The path to the logo file of to set. String Description The Description of the group to set. String String DisplayName The DisplayName of the group to set. String String GroupLogoPath The path to the logo file of to set. String String Identity The Identity of the Office 365 Group. UnifiedGroupPipeBind UnifiedGroupPipeBind IsPrivate Makes the group private when selected. SwitchParameter SwitchParameter Members The array UPN values of members to add to the group. String[] String[] Owners The array UPN values of owners to add to the group. String[] String[] ------------------EXAMPLE 1--------------------- PS:> Set-PnPUnifiedGroup -Identity $group -DisplayName "My Displayname" Sets the display name of the group where $group is a Group entity ------------------EXAMPLE 2--------------------- PS:> Set-PnPUnifiedGroup -Identity $groupId -Descriptions "My Description" -DisplayName "My DisplayName" Sets the display name and description of a group based upon its ID ------------------EXAMPLE 3--------------------- PS:> Set-PnPUnifiedGroup -Identity $group -GroupLogoPath ".\MyLogo.png" Sets a specific Office 365 Group logo. ------------------EXAMPLE 4--------------------- PS:> Set-PnPUnifiedGroup -Identity $group -IsPrivate:$false Sets a group to be Public if previously Private. ------------------EXAMPLE 5--------------------- PS:> Set-PnPUnifiedGroup -Identity $group -Owners demo@contoso.com Adds demo@contoso.com as an additional owner to the group. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Set-PnPUserProfileProperty * Supported in: SharePoint Online. Office365 only: Uses the tenant API to retrieve site information. You must connect to the tenant admin website (https://:<tenant>-admin.sharepoint.com) with Connect-PnPOnline in order to use this command. Set PnPUserProfileProperty Requires a connection to a SharePoint Tenant Admin site. Set-PnPUserProfileProperty Value The value to set in the case of a single value property String Account The account of the user, formatted either as a login name, or as a claims identity, e.g. i:0#.f|membership|user@domain.com String PropertyName The property to set, for instance SPS-Skills or SPS-Location String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Set-PnPUserProfileProperty Values The values set in the case of a multi value property, e.g. "Value 1","Value 2" String[] Account The account of the user, formatted either as a login name, or as a claims identity, e.g. i:0#.f|membership|user@domain.com String PropertyName The property to set, for instance SPS-Skills or SPS-Location String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Account The account of the user, formatted either as a login name, or as a claims identity, e.g. i:0#.f|membership|user@domain.com String String PropertyName The property to set, for instance SPS-Skills or SPS-Location String String Value The value to set in the case of a single value property String String Values The values set in the case of a multi value property, e.g. "Value 1","Value 2" String[] String[] Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection ------------------EXAMPLE 1--------------------- PS:> Set-PnPUserProfileProperty -Account 'user@domain.com' -Property 'SPS-Location' -Value 'Stockholm' Sets the SPS-Location property for the user as specified by the Account parameter ------------------EXAMPLE 2--------------------- PS:> Set-PnPUserProfileProperty -Account 'user@domain.com' -Property 'MyProperty' -Values 'Value 1','Value 2' Sets the MyProperty multi value property for the user as specified by the Account parameter SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Set-PnPView Change view properties Set PnPView Sets one or more properties of an existing view. Set-PnPView Identity The Id, Title or instance of the view ViewPipeBind Values Hashtable of properties to update on the view. Use the syntax @{property1="value";property2="value"}. Hashtable List The Id, Title or Url of the list ListPipeBind Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Identity The Id, Title or instance of the view ViewPipeBind ViewPipeBind List The Id, Title or Url of the list ListPipeBind ListPipeBind Values Hashtable of properties to update on the view. Use the syntax @{property1="value";property2="value"}. Hashtable Hashtable Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind Microsoft.SharePoint.Client.Field ------------------EXAMPLE 1--------------------- PS:> Set-PnPView -List "Tasks" -Identity "All Tasks" -Values @{JSLink="hierarchytaskslist.js|customrendering.js";Title="My view"} Updates the "All Tasks" view on list "Tasks" to use hierarchytaskslist.js and customrendering.js for the JSLink and changes the title of the view to "My view" ------------------EXAMPLE 2--------------------- PS:> Get-PnPList -Identity "Tasks" | Get-PnPView | Set-PnPView -Values @{JSLink="hierarchytaskslist.js|customrendering.js"} Updates all views on list "Tasks" to use hierarchytaskslist.js and customrendering.js for the JSLink SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Set-PnPWeb Sets properties on a web Set PnPWeb Sets properties on a web Set-PnPWeb SiteLogoUrl String AlternateCssUrl String Title String Description String MasterUrl String CustomMasterUrl String Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection AlternateCssUrl String String CustomMasterUrl String String Description String String MasterUrl String String SiteLogoUrl String String Title String String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Set-PnPWebhookSubscription * Supported in: SharePoint Online. Updates a Webhook subscription Set PnPWebhookSubscription Set-PnPWebhookSubscription Subscription The identity of the Webhook subscription to update WebhookSubscriptionPipeBind List The list object or name from which the Webhook subscription will be modified ListPipeBind NotificationUrl The URL of the Webhook endpoint that will be notified of the change String ExpirationDate The date at which the Webhook subscription will expire. (Default: 6 months from today) DateTime Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection ExpirationDate The date at which the Webhook subscription will expire. (Default: 6 months from today) DateTime DateTime List The list object or name from which the Webhook subscription will be modified ListPipeBind ListPipeBind NotificationUrl The URL of the Webhook endpoint that will be notified of the change String String Subscription The identity of the Webhook subscription to update WebhookSubscriptionPipeBind WebhookSubscriptionPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind OfficeDevPnP.Core.Entities.WebhookSubscription ------------------EXAMPLE 1--------------------- PS:> Set-PnPWebhookSubscription -List MyList -Subscription ea1533a8-ff03-415b-a7b6-517ee50db8b6 -NotificationUrl https://my-func.azurewebsites.net/webhook Updates an existing Webhook subscription with the specified id on the list MyList with a new Notification Url ------------------EXAMPLE 2--------------------- PS:> Set-PnPWebhookSubscription -List MyList -Subscription ea1533a8-ff03-415b-a7b6-517ee50db8b6 -NotificationUrl https://my-func.azurewebsites.net/webhook -ExpirationDate "2017-09-01" Updates an existing Webhook subscription with the specified id on the list MyList with a new Notification Url and a new expiration date ------------------EXAMPLE 3--------------------- PS:> $subscriptions = Get-PnPWebhookSubscriptions -List MyList PS:> $updated = $subscriptions[0] PS:> $updated.ExpirationDate = "2017-10-01" PS:> Set-PnPWebhookSubscription -List MyList -Subscription $updated Updates the Webhook subscription from the list MyList with a modified subscription object. Note: The date will be converted to Universal Time SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Set-PnPWebPartProperty Sets a web part property Set PnPWebPartProperty Set-PnPWebPartProperty ServerRelativePageUrl Full server relative url of the webpart page, e.g. /sites/demo/sitepages/home.aspx String Identity The Guid of the webpart GuidPipeBind Key Name of a single property to be set String Value Value of the property to be set PSObject Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Identity The Guid of the webpart GuidPipeBind GuidPipeBind Key Name of a single property to be set String String ServerRelativePageUrl Full server relative url of the webpart page, e.g. /sites/demo/sitepages/home.aspx String String Value Value of the property to be set PSObject PSObject Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Set-PnPWebPartProperty -ServerRelativePageUrl /sites/demo/sitepages/home.aspx -Identity ccd2c98a-c9ae-483b-ae72-19992d583914 -Key "Title" -Value "New Title" Sets the title property of the webpart. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Set-PnPWebPermission Set permissions Set PnPWebPermission Sets web permissions Set-PnPWebPermission Group GroupPipeBind AddRole The role that must be assigned to the group or user String[] RemoveRole The role that must be removed from the group or user String[] Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Set-PnPWebPermission User String AddRole The role that must be assigned to the group or user String[] RemoveRole The role that must be removed from the group or user String[] Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Set-PnPWebPermission Identity Identity/Id/Web object WebPipeBind Group GroupPipeBind AddRole The role that must be assigned to the group or user String[] RemoveRole The role that must be removed from the group or user String[] Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Set-PnPWebPermission Identity Identity/Id/Web object WebPipeBind User String AddRole The role that must be assigned to the group or user String[] RemoveRole The role that must be removed from the group or user String[] Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Set-PnPWebPermission Url The site relative url of the web, e.g. 'Subweb1' String Group GroupPipeBind AddRole The role that must be assigned to the group or user String[] RemoveRole The role that must be removed from the group or user String[] Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Set-PnPWebPermission Url The site relative url of the web, e.g. 'Subweb1' String User String AddRole The role that must be assigned to the group or user String[] RemoveRole The role that must be removed from the group or user String[] Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection AddRole The role that must be assigned to the group or user String[] String[] Group GroupPipeBind GroupPipeBind Identity Identity/Id/Web object WebPipeBind WebPipeBind RemoveRole The role that must be removed from the group or user String[] String[] Url The site relative url of the web, e.g. 'Subweb1' String String User String String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Set-PnPWebPermission -Url projectA -User 'user@contoso.com' -AddRole 'Contribute' Adds the 'Contribute' permission to the user 'user@contoso.com' for a web, specified by its site relative url ------------------EXAMPLE 2--------------------- PS:> Set-PnPWebPermission -Identity 5fecaf67-6b9e-4691-a0ff-518fc9839aa0 -User 'user@contoso.com' -RemoveRole 'Contribute' Removes the 'Contribute' permission to the user 'user@contoso.com' for a web, specified by its ID SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Set-PnPWebTheme * Supported in: SharePoint Online. Sets the theme of the current web. Set PnPWebTheme Sets the theme of the current web. * Requires Tenant Administration Rights * Set-PnPWebTheme WebUrl The URL of the web to apply the theme to. If not specified it will default to the current web based upon the URL specified with Connect-PnPOnline. String Theme Specifies the Color Palette Url based on the site or server relative url ThemePipeBind Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Theme Specifies the Color Palette Url based on the site or server relative url ThemePipeBind ThemePipeBind WebUrl The URL of the web to apply the theme to. If not specified it will default to the current web based upon the URL specified with Connect-PnPOnline. String String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Set-PnPWebTheme -Theme MyTheme Sets the theme named "MyTheme" to the current web ------------------EXAMPLE 2--------------------- PS:> Get-PnPTenantTheme -Name "MyTheme" | Set-PnPTheme Sets the theme named "MyTheme" to the current web SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Set-PnPWikiPageContent Sets the contents of a wikipage Set PnPWikiPageContent Set-PnPWikiPageContent Content String ServerRelativePageUrl Site Relative Page Url String Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Set-PnPWikiPageContent Path String ServerRelativePageUrl Site Relative Page Url String Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Content String String Path String String ServerRelativePageUrl Site Relative Page Url String String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Copy-PnPItemProxy Proxy cmdlet for using Copy-Item between SharePoint provider and FileSystem provider Copy PnPItemProxy SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Move-PnPItemProxy Proxy cmdlet for using Move-Item between SharePoint provider and FileSystem provider Move PnPItemProxy SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Start-PnPWorkflowInstance Starts a workflow instance on a list item Start PnPWorkflowInstance Start-PnPWorkflowInstance Subscription The workflow subscription to start WorkflowSubscriptionPipeBind ListItem The list item to start the workflow against ListItemPipeBind Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection ListItem The list item to start the workflow against ListItemPipeBind ListItemPipeBind Subscription The workflow subscription to start WorkflowSubscriptionPipeBind WorkflowSubscriptionPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Start-PnPWorkflowInstance -Name 'WorkflowName' -ListItem $item Starts a workflow instance on the specified list item ------------------EXAMPLE 2--------------------- PS:> Start-PnPWorkflowInstance -Name 'WorkflowName' -ListItem 2 Starts a workflow instance on the specified list item SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Stop-PnPWorkflowInstance Stops a workflow instance Stop PnPWorkflowInstance Stop-PnPWorkflowInstance Identity The instance to stop WorkflowInstancePipeBind Force Forcefully terminate the workflow instead of cancelling. Works on errored and non-responsive workflows. Deletes all created tasks. Does not notify participants. SwitchParameter Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Force Forcefully terminate the workflow instead of cancelling. Works on errored and non-responsive workflows. Deletes all created tasks. Does not notify participants. SwitchParameter SwitchParameter Identity The instance to stop WorkflowInstancePipeBind WorkflowInstancePipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Stop-PnPWorkflowInstance -identity $wfInstance Stops the workflow Instance SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Submit-PnPSearchQuery Executes an arbitrary search query against the SharePoint search index Submit PnPSearchQuery Submit-PnPSearchQuery Query Search query in Keyword Query Language (KQL). String StartRow Search result item to start returning the results from. Useful for paging. Leave at 0 to return all results. Int32 MaxResults Maximum amount of search results to return. Default and max per page is 500 search results. Int32 TrimDuplicates Specifies whether near duplicate items should be removed from the search results. Boolean Properties Extra query properties. Can for example be used for Office Graph queries. Hashtable Refiners The list of refiners to be returned in a search result. String Culture The locale for the query. Int32 QueryTemplate Specifies the query template that is used at run time to transform the query based on user input. String SelectProperties The list of properties to return in the search results. String[] RefinementFilters The set of refinement filters used. String[] SortList The list of properties by which the search results are ordered. Hashtable RankingModelId The identifier (ID) of the ranking model to use for the query. String ClientType Specifies the name of the client which issued the query. String HiddenConstraints The keyword query’s hidden constraints. String TimeZoneId The identifier for the search query time zone. Int32 EnablePhonetic Specifies whether the phonetic forms of the query terms are used to find matches. Boolean EnableStemming Specifies whether stemming is enabled. Boolean EnableQueryRules Specifies whether Query Rules are enabled for this query. Boolean SourceId Specifies the identifier (ID or name) of the result source to be used to run the query. Guid ProcessBestBets Determines whether Best Bets are enabled. Boolean ProcessPersonalFavorites Determines whether personal favorites data is processed or not. Boolean RelevantResults Specifies whether only relevant results are returned SwitchParameter Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Submit-PnPSearchQuery Query Search query in Keyword Query Language (KQL). String All Automatically page results until the end to get more than 500. Use with caution! SwitchParameter TrimDuplicates Specifies whether near duplicate items should be removed from the search results. Boolean Properties Extra query properties. Can for example be used for Office Graph queries. Hashtable Refiners The list of refiners to be returned in a search result. String Culture The locale for the query. Int32 QueryTemplate Specifies the query template that is used at run time to transform the query based on user input. String SelectProperties The list of properties to return in the search results. String[] RefinementFilters The set of refinement filters used. String[] SortList The list of properties by which the search results are ordered. Hashtable RankingModelId The identifier (ID) of the ranking model to use for the query. String ClientType Specifies the name of the client which issued the query. String HiddenConstraints The keyword query’s hidden constraints. String TimeZoneId The identifier for the search query time zone. Int32 EnablePhonetic Specifies whether the phonetic forms of the query terms are used to find matches. Boolean EnableStemming Specifies whether stemming is enabled. Boolean EnableQueryRules Specifies whether Query Rules are enabled for this query. Boolean SourceId Specifies the identifier (ID or name) of the result source to be used to run the query. Guid ProcessBestBets Determines whether Best Bets are enabled. Boolean ProcessPersonalFavorites Determines whether personal favorites data is processed or not. Boolean RelevantResults Specifies whether only relevant results are returned SwitchParameter Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection All Automatically page results until the end to get more than 500. Use with caution! SwitchParameter SwitchParameter ClientType Specifies the name of the client which issued the query. String String Culture The locale for the query. Int32 Int32 EnablePhonetic Specifies whether the phonetic forms of the query terms are used to find matches. Boolean Boolean EnableQueryRules Specifies whether Query Rules are enabled for this query. Boolean Boolean EnableStemming Specifies whether stemming is enabled. Boolean Boolean HiddenConstraints The keyword query’s hidden constraints. String String MaxResults Maximum amount of search results to return. Default and max per page is 500 search results. Int32 Int32 ProcessBestBets Determines whether Best Bets are enabled. Boolean Boolean ProcessPersonalFavorites Determines whether personal favorites data is processed or not. Boolean Boolean Properties Extra query properties. Can for example be used for Office Graph queries. Hashtable Hashtable Query Search query in Keyword Query Language (KQL). String String QueryTemplate Specifies the query template that is used at run time to transform the query based on user input. String String RankingModelId The identifier (ID) of the ranking model to use for the query. String String RefinementFilters The set of refinement filters used. String[] String[] Refiners The list of refiners to be returned in a search result. String String RelevantResults Specifies whether only relevant results are returned SwitchParameter SwitchParameter SelectProperties The list of properties to return in the search results. String[] String[] SortList The list of properties by which the search results are ordered. Hashtable Hashtable SourceId Specifies the identifier (ID or name) of the result source to be used to run the query. Guid Guid StartRow Search result item to start returning the results from. Useful for paging. Leave at 0 to return all results. Int32 Int32 TimeZoneId The identifier for the search query time zone. Int32 Int32 TrimDuplicates Specifies whether near duplicate items should be removed from the search results. Boolean Boolean Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind List<System.Object> ------------------EXAMPLE 1--------------------- PS:> Submit-PnPSearchQuery -Query "finance" Returns the top 500 items with the term finance ------------------EXAMPLE 2--------------------- PS:> Submit-PnPSearchQuery -Query "Title:Intranet*" -MaxResults 10 Returns the top 10 items indexed by SharePoint Search of which the title starts with the word Intranet ------------------EXAMPLE 3--------------------- PS:> Submit-PnPSearchQuery -Query "Title:Intranet*" -All Returns absolutely all items indexed by SharePoint Search of which the title starts with the word Intranet ------------------EXAMPLE 4--------------------- PS:> Submit-PnPSearchQuery -Query "Title:Intranet*" -Refiners "contentclass,FileType(filter=6/0/*)" Returns absolutely all items indexed by SharePoint Search of which the title starts with the word Intranet, and return refiners for contentclass and FileType managed properties SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Test-PnPListItemIsRecord * Supported in: SharePoint Online. Checks if a list item is a record Test PnPListItemIsRecord Test-PnPListItemIsRecord Identity The ID of the listitem, or actual ListItem object ListItemPipeBind List The ID, Title or Url of the list. ListPipeBind Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Identity The ID of the listitem, or actual ListItem object ListItemPipeBind ListItemPipeBind List The ID, Title or Url of the list. ListPipeBind ListPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Test-PnPListItemAsRecord -List "Documents" -Identity 4 Returns true if the document in the documents library with id 4 is a record SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Uninstall-PnPApp Uninstalls an available add-in from the site Uninstall PnPApp Uninstall-PnPApp Identity Specifies the Id of the Addin Instance AppMetadataPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Identity Specifies the Id of the Addin Instance AppMetadataPipeBind AppMetadataPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection ------------------EXAMPLE 1--------------------- PS:> Uninstall-PnPApp -Identity 99a00f6e-fb81-4dc7-8eac-e09c6f9132fe This will uninstall the specified app from the current site. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Uninstall-PnPAppInstance Removes an app from a site Uninstall PnPAppInstance Removes an add-in/app that has been installed to a site. Uninstall-PnPAppInstance Identity Appinstance or Id of the addin to remove. AppPipeBind Force Do not ask for confirmation. SwitchParameter Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Force Do not ask for confirmation. SwitchParameter SwitchParameter Identity Appinstance or Id of the addin to remove. AppPipeBind AppPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection Web This parameter allows you to optionally apply the cmdlet action to a subweb within the current web. In most situations this parameter is not required and you can connect to the subweb using Connect-PnPOnline instead. Specify the GUID, server relative url (i.e. /sites/team1) or web instance of the web to apply the command to. Omit this parameter to use the current web. WebPipeBind WebPipeBind ------------------EXAMPLE 1--------------------- PS:> Uninstall-PnPAppInstance -Identity $appinstance Uninstalls the app instance which was retrieved with the command Get-PnPAppInstance ------------------EXAMPLE 2--------------------- PS:> Uninstall-PnPAppInstance -Identity 99a00f6e-fb81-4dc7-8eac-e09c6f9132fe Uninstalls the app instance with the ID '99a00f6e-fb81-4dc7-8eac-e09c6f9132fe' ------------------EXAMPLE 3--------------------- PS:> Uninstall-PnPAppInstance -Identity 99a00f6e-fb81-4dc7-8eac-e09c6f9132fe -force Uninstalls the app instance with the ID '99a00f6e-fb81-4dc7-8eac-e09c6f9132fe' and do not ask for confirmation SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Uninstall-PnPSolution Uninstalls a sandboxed solution from a site collection Uninstall PnPSolution Uninstall-PnPSolution PackageId ID of the solution, from the solution manifest GuidPipeBind PackageName Filename of the WSP file to uninstall String MajorVersion Optional major version of the solution, defaults to 1 Int32 MinorVersion Optional minor version of the solution, defaults to 0 Int32 Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection MajorVersion Optional major version of the solution, defaults to 1 Int32 Int32 MinorVersion Optional minor version of the solution, defaults to 0 Int32 Int32 PackageId ID of the solution, from the solution manifest GuidPipeBind GuidPipeBind PackageName Filename of the WSP file to uninstall String String Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection ------------------EXAMPLE 1--------------------- PS:> Uninstall-PnPSolution -PackageId c2f5b025-7c42-4d3a-b579-41da3b8e7254 -SourceFilePath mypackage.wsp Removes the package to the current site SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Unpublish-PnPApp * Supported in: SharePoint Online. Unpublishes/retracts an available add-in from the app catalog Unpublish PnPApp Unpublish-PnPApp Identity Specifies the Id of the Addin Instance AppMetadataPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Identity Specifies the Id of the Addin Instance AppMetadataPipeBind AppMetadataPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection ------------------EXAMPLE 1--------------------- PS:> Unpublish-PnPApp -Identity 99a00f6e-fb81-4dc7-8eac-e09c6f9132fe This will retract, but not remove, the specified app from the app catalog SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Unregister-PnPHubSite * Supported in: SharePoint Online. Unregisters a site as a hubsite Unregister PnPHubSite Registers a site as a hubsite Unregister-PnPHubSite Site The site to unregister as a hubsite SitePipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Site The site to unregister as a hubsite SitePipeBind SitePipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection ------------------EXAMPLE 1--------------------- PS:> Unregister-PnPHubSite -Site https://tenant.sharepoint.com/sites/myhubsite This example unregisters the specified site as a hubsite SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Update-PnPApp * Supported in: SharePoint Online. Updates an available app from the app catalog Update PnPApp Update-PnPApp Identity Specifies the Id or an actual app metadata instance AppMetadataPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection Identity Specifies the Id or an actual app metadata instance AppMetadataPipeBind AppMetadataPipeBind Connection Optional connection to be used by the cmdlet. Retrieve the value for this parameter by either specifying -ReturnConnection on Connect-PnPOnline or by executing Get-PnPConnection. SPOnlineConnection SPOnlineConnection ------------------EXAMPLE 1--------------------- PS:> Update-PnPApp -Identity 99a00f6e-fb81-4dc7-8eac-e09c6f9132fe This will update an already installed app if a new version is available. Retrieve a list all available apps and the installed and available versions with Get-PnPApp SharePoint Developer Patterns and Practices: http://aka.ms/sppnp Update-PnPSiteClassification * Supported in: SharePoint Online. Updates Site Classifications for the tenant. Requires a connection to the Microsoft Graph. Update PnPSiteClassification Update-PnPSiteClassification Classifications A list of classifications, separated by commas. E.g. "HBI","LBI","Top Secret" String DefaultClassification The default classification to be used. The value needs to be present in the list of possible classifications String UsageGuidelinesUrl The UsageGuidelinesUrl. Set to "" to clear. String Update-PnPSiteClassification Settings A settings object retrieved by Get-PnPSiteClassification SiteClassificationsSettings Classifications A list of classifications, separated by commas. E.g. "HBI","LBI","Top Secret" String String DefaultClassification The default classification to be used. The value needs to be present in the list of possible classifications String String Settings A settings object retrieved by Get-PnPSiteClassification SiteClassificationsSettings SiteClassificationsSettings UsageGuidelinesUrl The UsageGuidelinesUrl. Set to "" to clear. String String ------------------EXAMPLE 1--------------------- PS:> Connect-PnPOnline -Scopes "Directory.ReadWrite.All" PS:> Update-PnPSiteClassification -Classifications "HBI","Top Secret" Replaces the existing values of the site classification settings ------------------EXAMPLE 2--------------------- PS:> Connect-PnPOnline -Scopes "Directory.ReadWrite.All" PS:> Update-PnPSiteClassification -DefaultClassification "LBI" Sets the default classification value to "LBI". This value needs to be present in the list of classification values. ------------------EXAMPLE 3--------------------- PS:> Connect-PnPOnline -Scopes "Directory.ReadWrite.All" PS:> Update-PnPSiteClassification -UsageGuidelinesUrl http://aka.ms/sppnp sets the usage guideliness URL to the specified URL. SharePoint Developer Patterns and Practices: http://aka.ms/sppnp ================================================ FILE: assets/functions/applyportaltemplate/modules/SharePointPnPPowerShellOnline/SharePointPnPPowerShellOnline.psd1 ================================================ @{ RootModule = 'SharePointPnP.PowerShell.Online.Commands.dll' ModuleVersion = '2.25.1804.0' Description = 'SharePoint Patterns and Practices PowerShell Cmdlets for SharePoint Online' GUID = '8f1147be-a8e4-4bd2-a705-841d5334edc0' Author = 'SharePoint Patterns and Practices' CompanyName = 'SharePoint Patterns and Practices' DotNetFrameworkVersion = '4.5' ProcessorArchitecture = 'None' FunctionsToExport = '*' CmdletsToExport = 'Add-PnPApp','Add-PnPClientSidePage','Add-PnPClientSidePageSection','Add-PnPClientSideText','Add-PnPClientSideWebPart','Add-PnPContentType','Add-PnPContentTypeToDocumentSet','Add-PnPContentTypeToList','Add-PnPCustomAction','Add-PnPDataRowsToProvisioningTemplate','Add-PnPDocumentSet','Add-PnPEventReceiver','Add-PnPField','Add-PnPFieldFromXml','Add-PnPFieldToContentType','Add-PnPFile','Add-PnPFileToProvisioningTemplate','Add-PnPFolder','Add-PnPHtmlPublishingPageLayout','Add-PnPHubSiteAssociation','Add-PnPIndexedProperty','Add-PnPJavaScriptBlock','Add-PnPJavaScriptLink','Add-PnPListFoldersToProvisioningTemplate','Add-PnPListItem','Add-PnPMasterPage','Add-PnPNavigationNode','Test-PnPOffice365GroupAliasIsUsed','Add-PnPOffice365GroupToSite','Add-PnPPublishingImageRendition','Add-PnPPublishingPage','Add-PnPPublishingPageLayout','Add-PnPRoleDefinition','Add-PnPSiteClassification','Add-PnPSiteCollectionAdmin','Add-PnPSiteCollectionAppCatalog','Add-PnPSiteDesign','Add-PnPSiteScript','Add-PnPStoredCredential','Add-PnPTaxonomyField','Add-PnPTenantCdnOrigin','Add-PnPTenantTheme','Add-PnPUserToGroup','Add-PnPView','Add-PnPWebhookSubscription','Add-PnPWebPartToWebPartPage','Add-PnPWebPartToWikiPage','Add-PnPWikiPage','Add-PnPWorkflowDefinition','Add-PnPWorkflowSubscription','Apply-PnPProvisioningTemplate','Set-PnPSitePolicy','Clear-PnPListItemAsRecord','Clear-PnPRecycleBinItem','Clear-PnPTenantRecycleBinItem','Connect-PnPOnline','Connect-PnPMicrosoftGraph','Convert-PnPProvisioningTemplate','Convert-PnPFolderToProvisioningTemplate','Copy-PnPFile','Disable-PnPFeature','Disable-PnPInPlaceRecordsManagementForSite','Disable-PnPResponsiveUI','Disable-PnPSiteClassification','Disconnect-PnPOnline','Enable-PnPFeature','Enable-PnPInPlaceRecordsManagementForSite','Enable-PnPResponsiveUI','Enable-PnPSiteClassification','Get-PnPProperty','Export-PnPTaxonomy','Export-PnPTermGroupToXml','Find-PnPFile','Get-PnPApp','Get-PnPAppInstance','Get-PnPAuditing','Get-PnPAuthenticationRealm','Get-PnPAvailableClientSideComponents','Get-PnPAzureADManifestKeyCredentials','Get-PnPClientSideComponent','Get-PnPClientSidePage','Get-PnPContentType','Get-PnPContentTypePublishingHubUrl','Get-PnPCustomAction','Get-PnPDefaultColumnValues','Get-PnPDocumentSetTemplate','Get-PnPEventReceiver','Get-PnPFeature','Get-PnPField','Get-PnPFile','Get-PnPFolder','Get-PnPFolderItem','Get-PnPGroup','Get-PnPGroupMembers','Get-PnPGroupPermissions','Get-PnPHealthScore','Get-PnPHideDefaultThemes','Get-PnPHomePage','Get-PnPHubSite','Get-PnPHubSiteNavigation','Get-PnPIndexedPropertyKeys','Get-PnPInPlaceRecordsManagement','Get-PnPJavaScriptLink','Get-PnPList','Get-PnPListInformationRightsManagement','Get-PnPListItem','Get-PnPListRecordDeclaration','Get-PnPMasterPage','Get-PnPNavigationNode','Get-PnPAccessToken','Get-PnPAzureCertificate','Get-PnPAppAuthAccessToken','Get-PnPConnection','Get-PnPSiteCollectionTermStore','Get-PnPStorageEntity','Get-PnPPropertyBag','Get-PnPProvisioningTemplate','Get-PnPProvisioningTemplateFromGallery','Get-PnPPublishingImageRendition','Get-PnPRecycleBinItem','Get-PnPRequestAccessEmails','Get-PnPRoleDefinition','Get-PnPSearchConfiguration','Get-PnPSite','Get-PnPSiteClassification','Get-PnPSiteClosure','Get-PnPSiteCollectionAdmin','Get-PnPSiteDesign','Get-PnPSiteDesignRights','Get-PnPSitePolicy','Get-PnPSiteScript','Get-PnPSiteSearchQueryResults','Get-PnPContext','Get-PnPStoredCredential','Get-PnPSubWebs','Get-PnPTaxonomyItem','Get-PnPTaxonomySession','Get-PnPTenant','Get-PnPTenantAppCatalogUrl','Get-PnPTenantCdnEnabled','Get-PnPTenantCdnOrigin','Get-PnPTenantCdnPolicies','Get-PnPTenantRecycleBinItem','Get-PnPTenantSite','Get-PnPTenantTheme','Get-PnPTerm','Get-PnPTermGroup','Get-PnPTermSet','Get-PnPTheme','Get-PnPTimeZoneId','Get-PnPUnifiedGroup','Get-PnPUnifiedGroupMembers','Get-PnPUnifiedGroupOwners','Get-PnPUser','Get-PnPUserProfileProperty','Get-PnPView','Get-PnPWeb','Get-PnPWebhookSubscriptions','Get-PnPWebPart','Get-PnPWebPartProperty','Get-PnPWebPartXml','Get-PnPWebTemplates','Get-PnPWikiPageContent','Get-PnPWorkflowDefinition','Get-PnPWorkflowInstance','Get-PnPWorkflowSubscription','Grant-PnPHubSiteRights','Grant-PnPSiteDesignRights','Import-PnPAppPackage','Import-PnPTaxonomy','Import-PnPTermGroupFromXml','Import-PnPTermSet','Install-PnPApp','Install-PnPSolution','Invoke-PnPQuery','Invoke-PnPSiteDesign','Invoke-PnPWebAction','Measure-PnPList','Measure-PnPWeb','Measure-PnPResponseTime','Move-PnPClientSideComponent','Move-PnPFile','Move-PnPFolder','Move-PnPListItemToRecycleBin','Move-PnPRecycleBinItem','New-PnPExtensibilityHandlerObject','New-PnPGroup','New-PnPList','New-PnPPersonalSite','New-PnPAzureCertificate','New-PnPUnifiedGroup','New-PnPProvisioningTemplate','New-PnPProvisioningTemplateFromFolder','New-PnPSite','New-PnPTenantSite','New-PnPTerm','New-PnPTermGroup','New-PnPTermSet','New-PnPUser','New-PnPWeb','Publish-PnPApp','Read-PnPProvisioningTemplate','Register-PnPHubSite','Remove-PnPApp','Remove-PnPClientSideComponent','Remove-PnPClientSidePage','Remove-PnPContentType','Remove-PnPContentTypeFromDocumentSet','Remove-PnPContentTypeFromList','Remove-PnPCustomAction','Remove-PnPIndexedProperty','Remove-PnPEventReceiver','Remove-PnPField','Remove-PnPFieldFromContentType','Remove-PnPFile','Remove-PnPFileFromProvisioningTemplate','Remove-PnPFolder','Remove-PnPGroup','Remove-PnPHubSiteAssociation','Remove-PnPJavaScriptLink','Remove-PnPList','Remove-PnPListItem','Remove-PnPNavigationNode','Remove-PnPStorageEntity','Remove-PnPPropertyBagValue','Remove-PnPPublishingImageRendition','Remove-PnPRoleDefinition','Remove-PnPTenantSite','Remove-PnPSiteClassification','Remove-PnPSiteCollectionAdmin','Remove-PnPSiteCollectionAppCatalog','Remove-PnPSiteDesign','Remove-PnPSiteScript','Remove-PnPStoredCredential','Remove-PnPTaxonomyItem','Remove-PnPTenantCdnOrigin','Remove-PnPTenantTheme','Remove-PnPTermGroup','Remove-PnPUnifiedGroup','Remove-PnPUser','Remove-PnPUserFromGroup','Remove-PnPView','Remove-PnPWeb','Remove-PnPWebhookSubscription','Remove-PnPWebPart','Remove-PnPWikiPage','Remove-PnPWorkflowDefinition','Remove-PnPWorkflowSubscription','Rename-PnPFile','Rename-PnPFolder','Request-PnPReIndexList','Request-PnPReIndexWeb','Resolve-PnPFolder','Restore-PnPRecycleBinItem','Restore-PnPTenantRecycleBinItem','Resume-PnPWorkflowInstance','Revoke-PnPSiteDesignRights','Save-PnPProvisioningTemplate','Send-PnPMail','Set-PnPAppSideLoading','Set-PnPAuditing','Set-PnPAvailablePageLayouts','Set-PnPClientSidePage','Set-PnPClientSideText','Set-PnPClientSideWebPart','Set-PnPContext','Set-PnPDefaultColumnValues','Set-PnPDefaultContentTypeToList','Set-PnPDefaultPageLayout','Set-PnPField','Set-PnPDocumentSetField','Set-PnPFileCheckedIn','Set-PnPFileCheckedOut','Set-PnPGroup','Set-PnPGroupPermissions','Set-PnPHideDefaultThemes','Set-PnPHomePage','Set-PnPHubSite','Set-PnPIndexedProperties','Set-PnPInPlaceRecordsManagement','Set-PnPList','Set-PnPListInformationRightsManagement','Set-PnPListItem','Set-PnPListItemAsRecord','Set-PnPListItemPermission','Set-PnPListPermission','Set-PnPListRecordDeclaration','Set-PnPMasterPage','Set-PnPMinimalDownloadStrategy','Set-PnPStorageEntity','Set-PnPPropertyBagValue','Set-PnPProvisioningTemplateMetadata','Set-PnPRequestAccessEmails','Set-PnPSearchConfiguration','Set-PnPSite','Set-PnPSiteClosure','Set-PnPSiteDesign','Set-PnPSiteScript','Set-PnPTaxonomyFieldValue','Set-PnPTenant','Set-PnPTenantCdnEnabled','Set-PnPTenantCdnPolicy','Set-PnPTenantSite','Set-PnPTheme','Set-PnPTraceLog','Set-PnPUnifiedGroup','Set-PnPUserProfileProperty','Set-PnPView','Set-PnPWeb','Set-PnPWebhookSubscription','Set-PnPWebPartProperty','Set-PnPWebPermission','Set-PnPWebTheme','Set-PnPWikiPageContent','Copy-PnPItemProxy','Move-PnPItemProxy','Start-PnPWorkflowInstance','Stop-PnPWorkflowInstance','Submit-PnPSearchQuery','Test-PnPListItemIsRecord','Uninstall-PnPApp','Uninstall-PnPAppInstance','Uninstall-PnPSolution','Unpublish-PnPApp','Unregister-PnPHubSite','Update-PnPApp','Update-PnPSiteClassification' VariablesToExport = '*' AliasesToExport = '*' FormatsToProcess = 'SharePointPnP.PowerShell.Online.Commands.Format.ps1xml' PrivateData = @{ PSData = @{ ProjectUri = 'https://aka.ms/sppnp' IconUri = 'https://raw.githubusercontent.com/SharePoint/PnP-PowerShell/master/Commands/Resources/pnp.ico' } } } ================================================ FILE: assets/functions/applyportaltemplate/modules/SharePointPnPPowerShellOnline/SharePointPnPPowerShellOnlineAliases.psm1 ================================================ Set-Alias -Name New-PnPSiteCollection -Value New-PnPTenantSite ================================================ FILE: assets/functions/applyportaltemplate/portal.xml ================================================ Helsinki SP Portal Showcase - Helsinki Style MSFT 30 clienttemplates.js ================================================ FILE: assets/functions/applyportaltemplate/run.ps1 ================================================ $in = Get-Content $triggerInput -Raw Write-Output "Incoming request for '$in'" Connect-PnPOnline -AppId $env:SPO_AppId -AppSecret $env:SPO_AppSecret -Url $in Write-Output "Connected to site" Apply-PnPProvisioningTemplate -Path D:\home\site\wwwroot\applyportaltemplate\portal.xml ================================================ FILE: assets/functions/host.json ================================================ {"swagger":{"enabled":true}} ================================================ FILE: assets/readme.md ================================================ SP Starter Kit Assets folder ================================================ FILE: changelog.md ================================================ # SharePoint Starter Kit Changelog # **2023-02-22** * Release of V3 with all solutions updated to SPFx version 1.16.1 **2019-07-18** * Changed handling of URLs using parameters **2018-04-08** * Upgrade solution to SharePoint Framework v1.8 with Microsoft Teams support for the web parts. **2018-09-11** * Upgrade solution to SharePoint Framework v1.6.0 **2018-06-14** * Release blog post out in Office Dev blog **2018-02-27** * Created repository. It's GO! ================================================ FILE: documentation/README.md ================================================ # SharePoint Starter Kit v3 Additional Documentation # Table of contents - [Tenant API Management](./api-management.md) - [Common SP Starter Kit Provisioning results](./common-provision-results.md) - [Manually deploy the SP Starter Kit .sppkg SPFx solution packages to the tenant App Catalog](./manual-deploy-sppkg-solution.md) - [Preparing your tenant for the PnP SharePoint Starter Kit](./tenant-settings.md) - [Term Store Considerations and non-English tenants](./term-store.md) - [Notes and suggestions when modifying included SPFx solutions](./modifying-spfx-solutions.md) ================================================ FILE: documentation/api-management.md ================================================ # Tenant API Management The SPFx solution included with SP Starter Kit requires access to third party API's. Third party access is controlled via the `API access` page included as a part of the SharePoint admin center. ## Approving pending API requests After installing the starter kit, or after adding the included SPFx [solution packages](../source) from the [`/source/'component'/sharepoint/solution`](../source) folders manually to the tenant app catalog, manually approve the requested permissions. Two methods to approve API requests include: - [Using the SharePoint admin center API access page](#Approve-pending-API-access-with-the-SharePoint-admin-center-API-access-page) - [Using PnP PowerShell](#Approve-pending-API-access-with-PnP-PowerShell) ## Approve pending API access with the SharePoint admin center API access page Navigate to your tenant SharePoint Admin Center ![SharePoint Admin Center](../assets/images/API-Approval-01.png) Navigate to **API access** found in the **advanced** menu, your API access Management Page. The API access menu item will only appear after you have provisioning the starter kit, or if there is at least one pending or approved API access request. ![API Management](../assets/images/API-Approval-03.png) **Approve** the `Microsoft Graph` permission requests by selecting each permission request and clicking `Approve` ![API Approval Panel](../assets/images/API-Approval-04.png) ![API Approval Panel](../assets/images/API-Approval-04-02.png) The pending permissions should now be approved. ![APIs Approved](../assets/images/API-Approval-05.png) **Note** currently the sample LOB service sample is in development and will utilize the SPFx-LOB-*** API permission requests. These requests can be ignored at this time. **Note** if you receive an error when approving a Microsoft Graph permission request, try to approve it again. In batch approvals, some requests may fail the first time. ## Approve pending API access with PnP PowerShell **Advanced approval process - be sure you validate each API access request before approving** Approving pending API access requests may also be accomplished with PnP PowerShell using the commandlet: ```powershell Approve-PnPTenantServicePrincipalPermissionRequest ``` 1. Open PowerShell and ensure you have installed the latest version of PnP PowerShell (validated at version 3.19.2003.0 or higher) 2. Connect to your tenant **using authorization credentials that have tenant administrative rigths**. This level of access is required to approve the API access requests ```powershell Connect-PnPOnline -Url https://[yourtenant].sharepoint.com ``` 3. Execute the following PowerShell commandlets. *Note: This script will search for and approve any API access request made by any SPFx package added to your tenant app catalog that has a package name that begins with 'react-personal-', 'react-recent', or 'react-command-'. Be sure to review each API access request. ```powershell $requests = Get-PnPTenantServicePrincipalPermissionRequests $requestsToApprove = $requests | ? { $_.PackageName -like 'react-personal-*' -or $_.PackageName -like 'react-recent*' -or $_.PackageName -like 'react-commmand-*' } if ($requestsToApprove -ne $null) { foreach($request in $requestsToApprove) { Approve-PnPTenantServicePrincipalPermissionRequest -RequestId $request.Id } } ``` 4. All API access requests for the starter kit should now be approved. ================================================ FILE: documentation/common-provision-results.md ================================================ # Common SP Starter Kit Provisioning results When provisioning SP Starter Kit following the [`deployment process`](../provisioning/readme.md), common outputs including the following. All examples are based on running the following commands in PowerShell, where `[yourtenant]` is replaced with your specific tenant id. ```powershell Connect-PnPOnline https://[yourtenant].sharepoint.com Invoke-PnPTenantTemplate -Path starterkit.pnp ``` # Table of contents - [Successful provisioning](#successful-provisioning) - [ERROR: General cascading errors](#error-general-cascading-errors) - [ERROR: Improper version of PnP PowerShell installed](#error-improper-version-of-pnp-powershell-installed) - [ERROR: App Catalog Required](#error-app-catalog-required) - [ERROR: Term Set Permissions Required](#error-term-set-permissions-required) - [ERROR: Not Targeted Release](#error-not-targeted-release) - [ERROR: Culture is not supported and/or (0x0c00) is an invalid culture identifier.](#error-culture-is-not-supported) - [Invalid App package installation - API Management missing](#invalid-app-package-installation---api-management-missing) - [ERROR: The user or administrator has not consented to use the application](#error-the-user-or-administrator-has-not-consented-to-use-the-application) - [ERROR: Invoke-PnPTenantTemplate : The remote server returned an error: (401) Unauthorized](#error-invoke-pnptenanttemplate-:-the-remote-server-returned-an-error:-401-unauthorized) ## Successful provisioning If all [`pre-requirements`](../#pre-requirements) have been addressed and met, no errors should be generated. ![Successful Deployment](../assets/images/provision-ps-success.png) ## ERROR: General cascading errors `Watch the pre-requirements` If you see many cascading errors, most likely a pre-requirement has not been set. 1. Ensure you are connecting to your tenant site using a tenant admin account. 1. Ensure that you have the latest PnP PowerShell commandlets. You might need to remove the PnP PowerShell commandlets and re-install to ensure you have the latest. [`PnP PowerShell - Recommended 1.12.0 or later`](https://github.com/pnp/powershell/releases). 1. Verify you have already created your `tenant app catalog`. 1. Verify that the account you are using has Admin rights to the Site Collection for tenant app catalog (eg. /sites/appcatalog) 1. Verify the account you are using to connect to your tenant site has already been added as a **term store administrator**. 1. If you believe the error is new and not addressed below or in the [`issues list`](https://github.com/pnp/sp-starter-kit/issues), please submit a [`new issue`](https://github.com/pnp/sp-starter-kit/issues). If the error appears to be an **error reported in PowerShell**, please enable the **PnP Trace Log** before running the deploy.ps1 script and **report those findings** in your new issue. ```powershell Set-PnPTraceLog -On -Level Debug ``` ## ERROR: Improper version of PnP PowerShell installed [`PnP PowerShell - Recommended 1.12.0 or later`](https://github.com/pnp/powershell) is required for SP Starter Kit to properly provision. It is recommended that you have only the latest version of PnP PowerShell installed on your workstation as well. If you do not have the proper version of PnP PowerShell installed, you may receive errors similar to: `Invoke-PnPTenantTemplate : The term 'Invoke-PnPTenantTemplate' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.` ![Invalid PnP PS](../assets/images/provision-ps-failed-invalid-pnpps-version.png) ### Recommended solution Verify you have the latest PnP PowerShell commandlets installed, as well as look for competeting, older versions. If you receive any error that references that a given `term` is not `recognized as the name of a cmdlet, function, script file, or operable program`, you have an issue with how PnP PowerShell is installed on your workstation. ```powershell Get-Module PnP.PowerShell* -ListAvailable | Select-Object Name,Version | Sort-Object Version -Descending ``` ![Multiple PnP PowerShell](../assets/images/provision-ps-failed-invalid-pnpps-multiple.png) `Update PnP PowerShell' ```powershell Update-Module PnP.PowerShell* ``` `Remove older verions(s) of PnP PowerShell' Based on the example above, we can see there are two versions of PnP PowerShell installed. We could remove version 1.6.0 with the following command: ```powershell Get-InstalledModule -Name "PnP.PowerShell" -RequiredVersion 1.6.0 | Uninstall-Module ``` Alternatively you can decide to uninstall all installed version of PnP PowerShell and reinstall the latest module ```powershell Uninstall-Module -Name "PnP.PowerShell" -AllVersions Install-Module -Name "PnP.PowerShell" ``` > Notice - versions of the legacy PnP PowerShell released in 2020 may throw errors related to [permissions](#error-the-user-or-administrator-has-not-consented-to-use-the-application). Recommended versions of PnP PowerShell include: - 1.12.0 - Note: you may have to [grant consent](#error-the-user-or-administrator-has-not-consented-to-use-the-application) ## ERROR: App Catalog Required The SP Starter Kit includes multiple SPFx solution packages, `*.sppkg`. By default these packages will be deployed to the tenant app catalog by the `Invoke-PnPTenantTemplate` cmdlet in to your tenant App Catalog. If you have not completed this task, you might receive an error that includes: ``` WARNING: Tenant app catalog doesn't exist. ALM step will be skipped! Invoke-PnPTenantTemplate : There is no app catalog site for this tenant. ``` ![App catalog required](../assets/images/provision-ps-failed-no-app-catalog.png) ### Recommended solution [`Create a tenant app catalog`](./manual-deploy-sppkg-solution.md) and wait for deployment to complete, which may take minutes, hours, or possibly a day. `Note`: If you recently created a new tenant or an [Microsoft 365 developer tenant](https://learn.microsoft.com/en-us/office/developer-program/microsoft-365-developer-program), you may receive an error similar to: ``` Sorry, something went wrong Updates are currently disallowed on GET requests. To allow updates on a GET, set the 'AllowUnsafeUpdates' property on SPWeb. ``` You may need to wait a few hours, possibly up to 24+ hours, after a new SharePoint tenant is created before creating a tenant app catalog as it takes a while for your SharePoint tenant to fully deploy. ## ERROR: Term Set Permissions Required The deployment script includes a PnP provisioning template that attempts to configure demo terms within the managed metadata service / term store. For this to succeed, the account used to connect to your tenant must have been manually added as a term store administator. If you have not completed this task, you might receive an error that includes: `Apply-PnPProvisioningHierarchy : Access denied. You do not have permissions to perform this action or access this resource.` ![Term store permission required](../assets/images/provision-ps-failed-not-termset-admin.png) ### Recommended solution Verify that the account you are using to provision SP Starter Kit is a term store administrator. ## ERROR: Not Targeted Release SP Starter Kit V2- required that your tenant be set to `Targeted Release` for all users. When the deployment script attempts to provision solution.xml to your tenant, included is an action to upload the included .sppkg SPFx solution to your tenant app catalog as well as approve API permissions. This step could fail if you have a legacy tenant that has not properly configured your tenant to `Targeted Release`. If you encounter an error similar to the following, you might need to set your tenant to targetted release for all users: `Apply-PnPProvisioningHierarchy : {"error":{"code":"-2147024891, System.UnauthorizedAccessException","message":"{"lang","en-us","value":"Access denied. You do not have permissions to perform this action or access this resource."}}}` ![Targeted Release](../assets/images/provision-ps-failed-not-targeted-release.png) `This error can also appear if the login account is not an owner of the 'App Catalog' for the tenant ### Recommended solution Ensure that your tenant is set to targeted release for all users. `NOTE:` You will need to wait at least 24 hours after setting your tenant to targeted release before all required updates are provisioned to your tenant before the deploy script will execute correctly. ## ERROR: Culture is not supported The SP Starter Kit end to end provisioning only works with tenants that are configured with the dafault language set to English, i.e. those with culture code 1033 enabled. It is possible that certain tenants have English available, while the default language is not set to 1033. This can cause issues when the provisioning process adds terms to to the term store. You may receive an error in PowerShell similar to the following: ```powershell Culture is not supported ``` ```powershell (0x0c00) is an invalid culture identifier. ``` ### Recommended solution Check to see that the current culture for your instance of PowerShell is ready for the template. Run "Get-Culture" in PowerShell ```powershell Get-Culture ``` The expected output should be ```powershell LCID Name DisplayName ---- ---- ----------- 1033 en-US English (Unitied States) ``` You can temporarily change to en-US for the provisioning process to continue. ```powershell Set-Culture -CultureInfo en-US ``` Try to provision the Starter Kit again. ## Invalid App package installation - API Management missing Deployment of the included SPFx solutions `.\source\[component]\sharepoint\solution\[component].sppkg` may be [`completed manually`](./manual-deploy-sppkg-solution.md). In legacy tenants, if you do not have `Targeted Release` enabled for all users, or if you have enabled Targeted Release for all users but have not waited at least 24 hours to full roll out, you may encounter errors when manually deploying the .sppgk packages, or attempting to find API Management. `Manually deploying .sppkg packages` Although you will be able to upload the SPFx package to the tenant app catalog, an error will be thrown. ![SPFx deployment error](../assets/images/provision-package-deployment-error.png) `API Management missing` Without Targeted Release enabled, you will be unable to find `API Management` in the Preview Admin Center. ![SPFx deployment error API Management](../assets/images/provision-error-api-management-missing.png) ### Recommended solution Ensure that your tenant is set to targeted release for all users. `NOTE:` You will need to wait at least 24 hours after setting your tenant to targeted release before all required updates are provisioned to your tenant before the deploy script will execute correctly. ## ERROR: The user or administrator has not consented to use the application Certain versions of PnP PowerShell released in 2020 contained PnP Core authentication methods that utilze a AAD application. If you receive an error similar to: ```powershell The user or administrator has not consented to use the application with ID '31359c7f-bd7e-475c-86db-fdb8c937548e' named 'PnP Management Shell'. Send an interactive authorization request for this user and resource. ``` You should consider the following solution based on recommendations provided in issue 436: https://github.com/pnp/sp-starter-kit/issues/436 ### Recommended solution You can downgrade to a previous version of PnP PowerShell. A validated version includes PnP PowerShell 1.12.0 ```powershell Install-Module -Name "PnP.PowerShell" -RequiredVersion 1.12.0 ``` If you are using a PnP PS version after 1.12.0, use the following steps to grant the proper permissions. ```powershell Connect-PnPOnline -Url "https://.sharepoint.com/" -PnPManagementShell ``` Follow the instructions provided during the Mangement Shell login, including completing the device login, and consent the SharePoint Online permission requests. ```powershell Disconnect-PnPOnline Connect-PnPOnline -Graph ``` Follow the instructions provided during the Graph loging, inclduing completing the device login again, and consent the Microsoft Graph permission requests. ```powershell Disconnect-PnPOnline ``` Once this has been completed, the standard Starter Kit provisioning process should proceed as expected. ## ERROR: Invoke-PnPTenantTemplate : The remote server returned an error: (401) Unauthorized A common error if you are using an account that has MFA enabled, or recently was configured for MFA is: ```powershell Invoke-PnPTenantTemplate : The remote server returned an error: (401) Unauthorized ``` PnP Core / PnP PS do not currently appear to support MFA tokens when connecting to aspects of the tenant required but the kit, including access to the app catalog to provision .sppkg's. This includes when attempting to connect to your site using -PnPManagementShell or -UseWebLogin. At this time, the best resolution is to use a SharePoint global admin account that does not, nor has had, MFA enabled to apply the Starter Kit tenant template. ================================================ FILE: documentation/components/ext-alert.md ================================================ # Alert Application Customizer This application customizer provides you the ability to show notifications on content pages in the top / header area. Full documenation is found in the [extension's source](../../source/react-application-alerts/README.md) ![Alert](../../assets/images/components/ext-alert.gif) ================================================ FILE: documentation/components/ext-classification.md ================================================ # Site Classification Application Customizer This application customizer provides you the ability to add a header with site classification information which is pulled from the Classification of modern SharePoint sites property using PnP JS. Learn more about [site classification](https://docs.microsoft.com/en-us/sharepoint/dev/solution-guidance/modern-experience-site-classification) ![Site Classificiation](../../assets/images/components/ext-classification.png) ## Extension details This extension requires no external dependencies nor requires configuration as there are no custom properties. | Description | Name | Type | Required | Description | | ---- | ---- | ---- | ---- | ---- | # Installing the extension See getting started from [SP-Starter-Kit repository readme](https://github.com/SharePoint/sp-starter-kit). You can also download just the [SharePoint Framework solution package (spppkg) file](https://github.com/SharePoint/sp-starter-kit/blob/master/package/sharepoint-starter-kit.sppkg) and install that to your tenant. This extension does not have external dependencies. > As this is a SharePoint Framework extension, you will need to explicitly enable this extension for a specific site using CSOM or REST APIs. You may also enable this extension via a PnP Provisioning template. See [hubsite.xml provisioning template](../../provisioning/hubsite.xml) for an example. # Screenshots ![Site Classificiation](../../assets/images/components/ext-classification.png) # Source Code https://github.com/SharePoint/sp-starter-kit/tree/master/solution/src/extensions/siteClassification # Minimal Path to Awesome - Clone this repository - Move to Solution folder - in the command line run: - `npm install` - `gulp serve` Since this is an extension, debugging requires slightly more advance settings. Please see more from the official SharePoint development documentation around the [debugging options with SharePoint Framework extensions](https://docs.microsoft.com/en-us/sharepoint/dev/spfx/debug-modern-pages). # Version history Version|Date|Comments -------|----|-------- 1.0|May 2018|Initial release ![](https://telemetry.sharepointpnp.com/sp-starter-kit/documentation/components/ext-classification) ================================================ FILE: documentation/components/ext-collab-discussnow.md ================================================ # Discuss Now List View Command Set This List View Command Set provides you the ability to add a custom dialog to start a discussion on a specific document within a document library by scheduling an event meeting for the group of a specific site. The event is added to the group by way of the Microsoft Graph. The command set extension is designed for group associated team sites. ![Discuss Now](../../assets/images/components/ext-collab-discussnow.png) ## Extension details This extension requires access to the Microsoft Graph and must target a specific list template types, such as `101` for document libraries. | Description | Name | Type | Required | Description | | ---- | ---- | ---- | ---- | ---- | # Installing the extension See getting started from [SP-Starter-Kit repository readme](https://github.com/SharePoint/sp-starter-kit). You can also download just the [SharePoint Framework solution package (sppkg) file](https://github.com/pnp/sp-starter-kit/blob/master/source/react-command-discuss-now/sharepoint/solution/react-command-discuss-now.sppkg) and install that to your tenant. This extension depends on access to Microsoft Graph. > As this is a SharePoint Framework extension, you will need to explicitly enable this extension for a specific site using CSOM or REST APIs. > You may enable this extension via a PnP Provisioning template. See [collab.xml provisioning template](../../provisioning/collab.xml) for an example. > You may enable this extension via PnP PowerShell using the `Add-PnPCustomAction` commandlet. ```powershell $creds = Get-Credential Connect-PnPOnline https://[yourtenant].sharepoint.com/sites/[yoursite] -Credentials $creds Add-PnPCustomAction -Title "DiscussNow" -Name "DiscussNow" -Location "ClientSideExtension.ListViewCommandSet" -ClientSideComponentId 130b279d-a5d1-41b9-9fd1-4a274169b117 -RegistrationType List -RegistrationId 101 ``` > You may test this extension on a given collaboration site library by running `gulp serve` in powershell within the `./solution` folder, and then adding the querystring `?loadSPFX=true&debugManifestsFile=https://localhost:4321/temp/manifests.js&customActions={"130b279d-a5d1-41b9-9fd1-4a274169b117":{"location":"ClientSideExtension.ListViewCommandSet","properties":{}}}` to the url of a given library. As an example, for the tenant `contoso`, for a collaboration site `hr`: `https://contoso.sharepoint.com/sites/hr/Shared%20Documents/Forms/AllItems.aspx?loadSPFX=true&debugManifestsFile=https://localhost:4321/temp/manifests.js&customActions={%22130b279d-a5d1-41b9-9fd1-4a274169b117%22:{%22location%22:%22ClientSideExtension.ListViewCommandSet%22,%22properties%22:{}}}` # Screenshots ![Discuss Now](../../assets/images/components/ext-collab-discussnow.png) # Source Code https://github.com/pnp/sp-starter-kit/tree/master/source/react-command-discuss-now # Minimal Path to Awesome - Clone this repository - Move to Solution folder - in the command line run: - `npm install` - `gulp serve` Since this is an extension, debugging requires slightly more advance settings. Please see more from the official SharePoint development documentation around the [debugging options with SharePoint Framework extensions](https://docs.microsoft.com/en-us/sharepoint/dev/spfx/debug-modern-pages). # Version history Version|Date|Comments -------|----|-------- 1.0|May 2018|Initial release ![](https://telemetry.sharepointpnp.com/sp-starter-kit/documentation/components/ext-collab-discussnow) ================================================ FILE: documentation/components/ext-collab-footer.md ================================================ # Collaboration Footer Application Customizer This application customizer provides you the ability to include a footer designed for group associated teams sites. The footer includes sets of links. One set of links provides company wide links which are configured using a managed metadata / taxonomy term set. A second set of links are personalized links, unqiue to each user, stored within each user's user profile within a user profile property. By default, this application customizer is associated with group associated team sites created using the custom site design i.e. `{Company name} Team Site`, provided in this project. The custom site design is provisioned as a part of the [deployment process](../../provisioning) while applying the PnP Provisioning template, [hubsite.xml](../../provisioning/hubsite.xml). ![Collaboration Footer](../../assets/images/components/ext-collab-footer.gif) ## Extension details This extension is dependent on an explicit `source` term set for common links and an explicit `personalItems` user profile property for personal link storage. By default the source term set is created during the Starter Kit deployment process. The User Profile property must be [manually created](../../documentation/tenant-settings.md#create-a-custom-property-in-the-user-profile-service). | Description | Name | Type | Required | Description | | ---- | ---- | ---- | ---- | ---- | | Source Term Set Name | sourceTermSet | string | yes | Default: PnP-CollabFooter-SharedLinks - The name of the term set within the managed metadata service to obtain common links | | User Profile Property Name | personalItemsStorageProperty | string | yes | Default: PnP-CollabFooter-MyLinks - The name of the custom user profile property used to store custom footer links | # Installing the extension See getting started from the [SP-Starter-Kit repository readme](https://github.com/SharePoint/sp-starter-kit). You can also download the [SharePoint Framework solution package (sppkg) file](https://github.com/pnp/sp-starter-kit/blob/master/source/react-application-collab-footer/sharepoint/solution/react-application-collab-footer.sppkg) and install the SPFx solution to your tenant. This extension depends on the managed metadata service and the user profile to store common and user specific links. > As this is a SharePoint Framework extension, you will need to explicitly enable this extension for a specific site using CSOM or REST APIs. You may also auto enable this extension with defined custom properties as a part of a site script using the `associateExtension` verb. See [collabteamsite.json Site Script](../../provisioning/collabteamsite.json) for an example. # Screenshots ![Collaboration Footer](../../assets/images/components/ext-collab-footer.png) # Source Code https://github.com/pnp/sp-starter-kit/tree/master/source/react-application-collab-footer # Minimal Path to Awesome - Clone this repository - Move to Solution folder - in the command line run: - `npm install` - `gulp serve` Since this is an extension, debugging requires slightly more advance configuration. Please learn more from the official SharePoint development documentation on [debugging options with SharePoint Framework extensions](https://docs.microsoft.com/en-us/sharepoint/dev/spfx/debug-modern-pages). # Version history Version|Date|Comments -------|----|-------- 1.0|May 2018|Initial release ![](https://telemetry.sharepointpnp.com/sp-starter-kit/documentation/components/ext-collab-footer) ================================================ FILE: documentation/components/ext-portal-footer.md ================================================ # Portal Footer Application Customizer This application customizer provides you the ability to include a footer designed for the primary portal or hub site. The footer includes sets of links as well as a copyright statement and support email address. One set of links provides company wide links which are configured using a common list stored within the hub site. A second set of links are personalized links, unqiue to each user, stored within each user's user profile within a user profile property. By default, this application customizer is associated with communication sites created using the custom site design i.e. `{Company name} Communication Site`, provided in this project. The custom site design is provisioined as a part of the [deployment process](../../provisioning) while applying the PnP Provisioning template, [hubsite.xml](../../provisioning/hubsite.xml). ![Portal Footer](../../assets/images/components/ext-portal-footer.gif) ## Extension details This extension is dependent on an explicit `source` list of common links and an explicit `personalItems` user profile property for personal link storage. By default the source list is created during the Starter Kit deployment process. The User Profile property must be [manually created](../../documentation/tenant-settings.md#create-a-custom-property-in-the-user-profile-service). | Description | Name | Type | Required | Description | | ---- | ---- | ---- | ---- | ---- | | Common link list title | linksListTitle | string | yes | Default: PnP-PortalFooter-Links - The name of the list within the current site where common links are stored | | Copyright Message | copyright | string | yes | Default: (c) Copyright {Company}, 2018 - a copyright message | | Support Contact | support | string | yes | Default: support@contoso.com - a support or contact email address | | User Profile Property Name | personalItemsStorageProperty | string | yes | Default: PnP-CollabFooter-MyLinks - The name of the custom user profile property used to store custom footer links | ## Portal Footer Links list details This extension is dependent on a explicit `PnP-PortalFooter-Links` list that must be located in the root of the current site collection. | Display Name | Name | Type | Required | Description | | ---- | ---- | ---- | ---- | ---- | | Title | Title | string | yes | Link title | | Link Group | PnPPortalLinkGroup | choice | no | The group for a specific link | | Link URL| PnPPortalLinkUrl | URL | no | The url for a specific link | # Installing the extension See getting started from the [SP-Starter-Kit repository readme](https://github.com/SharePoint/sp-starter-kit). You can also download the [SharePoint Framework solution package (sppkg) file](https://github.com/pnp/sp-starter-kit/blob/master/source/react-application-portal-footer/sharepoint/solution/react-application-portal-footer.sppkg) and install the SPFx solution to your tenant. This extension depends on a SharePoint list and the user profile to store common and user specific links. > As this is a SharePoint Framework extension, you will need to explicitly enable this extension for a specific site using CSOM or REST APIs. You may also auto enable this extension with defined custom properties as a part of a site script using the `associateExtension` verb. See [collabcommunicationsite.json Site Script](../../provisioning/resources/collabcommunicationsite.json) for an example. # Screenshots ![Portal Footer](../../assets/images/components/ext-portal-footer.png) # Source Code https://github.com/pnp/sp-starter-kit/tree/master/source/react-application-portal-footer # Minimal Path to Awesome - Clone this repository - Move to Solution folder - in the command line run: - `npm install` - `gulp serve` Since this is an extension, debugging requires slightly more advance configuration. Please learn more from the official SharePoint development documentation on [debugging options with SharePoint Framework extensions](https://docs.microsoft.com/en-us/sharepoint/dev/spfx/debug-modern-pages). # Version history Version|Date|Comments -------|----|-------- 1.0|May 2018|Initial release ![](https://telemetry.sharepointpnp.com/sp-starter-kit/documentation/components/ext-portal-footer) ================================================ FILE: documentation/components/ext-redirect.md ================================================ # Redirect Application Customizer This application customizer provides you the ability to redirect from URL based on mapping from a list on the site. Can be used to automatically redirect from pages to other locations. Full documenation is found in the [extension's source](../../source/js-application-redirect/README.md) ![Alert](../../assets/images/components/ext-redirects.gif) ================================================ FILE: documentation/components/lib-shared.md ================================================ # Starter Kit SPFx Shared Library A shared library that includes shared locatization strings, consumabled by any other SPFx webpart or extension. Full documenation is found in the [extension's source](../../source/library-starter-kit-shared/README.md) ================================================ FILE: documentation/components/wp-banner.md ================================================ # Banner web part This web part provides you the ability to add a variable height image banner with a linkable title. ![Bannner](../../assets/images/components/part-banner.gif) ## How to use this web part on your web pages 1. Place the page you want to add this web part to in edit mode. 2. Search for and insert the **Banner** web part. 3. Configure the web part to update its properties. ## Configurable Properties The `Banner` webpart can be configured with the following properties: | Label | Property | Type | Required | Description | | ---- | ---- | ---- | ---- | ---- | | Overlay image text | bannerText | string | no | The text message or title you want displayed on the banner image | | Image URL | bannerImage | string | no | The url of the banner image | | Link URL | bannerLink | string | no | The hyperlink url of the bannerText link | | Banner height | bannerHeight | number | no | Provides the fixed height of the banner image | | Enable parallax effect | useParallax | toggle | no | Enable if you want to include parallax effect on vertical scrolling | # Installing the web part See getting started from [SP-Starter-Kit repository readme](https://github.com/SharePoint/sp-starter-kit). You can also download just the [SharePoint Framework solution package (sppkg) file](https://github.com/pnp/sp-starter-kit/blob/master/source/react-banner/sharepoint/solution/react-banner.sppkg) and install that to your tenant. This web part does not have external dependencies. # Screenshots ![Bannner](../../assets/images/components/part-banner.png) # Source Code https://github.com/pnp/sp-starter-kit/tree/master/source/react-banner # Minimal Path to Awesome - Clone this repository - Move to Solution folder - in the command line run: - `npm install` - `gulp serve` # Version history Version|Date|Comments -------|----|-------- 1.0|May 2018|Initial release ![](https://telemetry.sharepointpnp.com/sp-starter-kit/documentation/components/wp-banner) ================================================ FILE: documentation/components/wp-followed-sites.md ================================================ # Followed Sites webpart This web part provides you the ability to display a list of site administrator defined number of sites that a given user is following, with paging as well as inline filtering of sites by keyword or phrase. Currently the list of followed sites includes classic as well as modern communication sites but does not include group enabled (modern) team sites. ![Bannner](../../assets/images/components/part-followed-sites.gif) ## How to use this web part on your web pages 1. Place the page you want to add this web part to in edit mode. 2. Search for and insert the **Followed Sites** web part. 3. Configure the web part to update its properties. ## Configurable Properties The `Followed Sites` webpart can be configured with the following properties: | Label | Property | Type | Required | Description | | ---- | ---- | ---- | ---- | ---- | | Followed Sites | title | string | no | The webpart title, editable inline with the webpart itself | | Number of followed sites to retrieve | nrOfItems | number | no | The number of sites to show per page, default = 10 | | Specify the sort order of the retrieved sites | sortOrder | number | no | Preferred site sort order. Default sort order driven by SharePoint, or by site name | # Installing the web part See getting started from [SP-Starter-Kit repository readme](https://github.com/SharePoint/sp-starter-kit). You can also download just the [SharePoint Framework solution package (sppkg) file](https://github.com/pnp/sp-starter-kit/blob/master/source/react-followed-sites/sharepoint/solution/react-followed-sites.sppkg) and install that to your tenant. This web part utilizes the SharePoint Rest API, `/_api/social.following/my/followed(types=4)`, endpoint. # Screenshots ![Followed Sites](../../assets/images/components/part-followed-sites.png) # Source Code https://github.com/pnp/sp-starter-kit/tree/master/source/react-followed-sites # Minimal Path to Awesome - Clone this repository - Move to Solution folder - in the command line run: - `npm install` - `gulp serve` # Version history Version|Date|Comments -------|----|-------- 1.0|May 2018|Initial release ![](https://telemetry.sharepointpnp.com/sp-starter-kit/documentation/components/wp-followed-sites) ================================================ FILE: documentation/components/wp-links.md ================================================ # Links webpart This web part provides you the ability to add a per instance listing of links with the ability to group sets of links. Links are stored as a collection of links within the web part's properties, removing the need for link storage within SharePoint lists, tenant properties, or other external link storage requirements. Links and groups are both customizable. ![Links](../../assets/images/components/part-links.gif) ## How to use this web part on your web pages 1. Place the page you want to add this web part to in edit mode. 2. Search for and insert the **Links** web part. 3. Configure the webpart to update its properties. ## Configurable Properties The `Links` webpart can be configured with the following properties: | Label | Property | Type | Required | Description | | ---- | ---- | ---- | ---- | ---- | | Useful links | title | string | no | The webpart title, editable inline with the webpart itself | | Group names for the links | groupData | collection | no | Collection of group names for grouping links into sets | | Link data | collectionData | collection | no | Collection of links | ### groupData Collection Properties Configurable properties for each collection row within the `groupData` collection: | Label | Property | Type | Required | Description | | ---- | ---- | ---- | ---- | ---- | | Title | title | string | yes | The name of a group | ### collectionData Collection Properties Configurable properties for each collection row within the `collectionData` collection: | Label | Property | Type | Required | Description | | ---- | ---- | ---- | ---- | ---- | | Title | title | string | yes | The text / title of the link | | URL | url | string | yes | The link url | | UI Fabric icon name | icon | fabricIcon | no | Optional UI Fabric icon name | | Group name | group | dropdown | no | Optional name of the group to add this link to | | Target | target | dropdown | no | Optional target for this link, current or new window | # Installing the web part See getting started from [SP-Starter-Kit repository readme](https://github.com/SharePoint/sp-starter-kit). You can also download just the [SharePoint Framework solution package (sppkg) file](https://github.com/pnp/sp-starter-kit/blob/master/source/react-links/sharepoint/solution/react-links.sppkg) and install that to your tenant. This web part does not have external dependencies. # Screenshots ![Links](../../assets/images/components/part-links.png) # Source Code https://github.com/pnp/sp-starter-kit/tree/master/source/react-links # Minimal Path to Awesome - Clone this repository - Move to Solution folder - in the command line run: - `npm install` - `gulp serve` # Version history Version|Date|Comments -------|----|-------- 1.0|May 2018|Initial release 1.1|June 2018|Updated collection descriptions ![](https://telemetry.sharepointpnp.com/sp-starter-kit/documentation/components/wp-links) ================================================ FILE: documentation/components/wp-lob-integration.md ================================================ # LOB Integration webpart This web part allows you to learn how to consume 3rd party APIs, secured with Azure Active Directory, in the context of SharePoint Framework. It leverages two different back-end REST APIs: - An ApiController built in Microsoft ASP.NET MVC, which is defined in a .NET solution that you can find [here](../../sample-lob-service/SharePointPnP.LobScenario/SharePointPnP.LobScenario.sln) - An Azure Function, which is based on the code defined [here](../../sample-lob-service/LIstNorthwindCustomers) ![LOB Integration](../../assets/images/components/part-lob-integration.png) The purpose of this web part is to show how you can consume LOB (Line of Business) solutions and on-premises data within SharePoint Framework. In order to leverage this web part, you will need to configure a couple of applications in Azure Active Directory of your target tenant: - **SPFx-LOB-WebAPI**: for the .NET web application - Publish the ASP.NET MVC application on an Azure App Service - Register the AAD app providing the URL of the above Azure App Service - Choose a valid App ID Uri for the app - Configure that App ID Uri in the [LobIntegration.tsx](../../solution/src/webparts/lobIntegration/components/LobIntegration.tsx#L145) React component - Update the App manifest of the Azure AD app configuring the **oauth2Permissions** property with a value like the following one: ```json "oauth2Permissions": [ { "adminConsentDescription": "Allow the application to read customers through SPFx-LOB-WebAPI on behalf of the signed-in user.", "adminConsentDisplayName": "Read customers from SPFx-LOB-WebAPI", "id": "7510eb34-4403-44d5-a745-a62d0895351c", "isEnabled": true, "type": "User", "userConsentDescription": "Allow the application to access SPFx-LOB-WebAPI on your behalf.", "userConsentDisplayName": "Access SPFx-LOB-WebAPI", "value": "Customers.Read" } ], ``` - **SPFx-LOB-Function**: for the Azure Function - Create an Azure Function and configure it with Azure AD Authentication, registering it in your target AAD tenant - Register the AAD app providing the URL of the above Azure Function - Choose a valid App ID Uri for the app - Configure that App ID Uri in the [LobIntegration.tsx](../../solution/src/webparts/lobIntegration/components/LobIntegration.tsx#L99) React component Moreover, in order to make this web part working properly, you need to grant permissions to the SharePoint Service Application Principal to access them. You can do that using the PnP PowerShell command lets (or Office 365 CLI) with the following syntax: ```PowerShell Connect-PnPOnline "https://[your-tenant].sharepoint.com/" Grant-PnPTenantServicePrincipalPermission -Resource "SPFx-LOB-WebAPI" -Scope "Customers.Read" Grant-PnPTenantServicePrincipalPermission -Resource "SPFx-LOB-Function" -Scope "user_impersonation" ``` ## How to use this web part on your web pages 1. Place the page you want to add this web part to in edit mode. 2. Search for and insert the **LobIntegration** web part. 3. Configure the webpart to update its properties. ## Configurable Properties The `LobIntegration` webpart can be configured with the following properties: | Label | Property | Type | Required | Description | | ---- | ---- | ---- | ---- | ---- | | Web API URI | webapiUri | string | yes | The URL of the web API. Should be something like https://[your-app-service].azurewebsites.net/api/customers | | Function URI | functionUri | string | yes | The URL of the Azure Function. Should be something like https://[your-azure-function].azurewebsites.net/api/ListNorthwindCustomers | | Service Type | serviceType | choice | yes | Defines the service to use. It can be "ASP.NET REST API" or "Azure Function" | # Installing the web part See getting started from [SP-Starter-Kit repository readme](https://github.com/SharePoint/sp-starter-kit). You can also download just the [SharePoint Framework solution package (sppkg) file](https://github.com/pnp/sp-starter-kit/blob/master/source/react-lob-integration/sharepoint/solution/react-lob-integration.sppkg) and install that to your tenant. This web part does not have external dependencies. # Screenshots ![Links](../../assets/images/components/part-lob-integration.png) # Source Code https://github.com/pnp/sp-starter-kit/tree/master/source/react-lob-integration # Minimal Path to Awesome - Clone this repository - Move to Solution folder - in the command line run: - `npm install` - `gulp serve` # Version history Version|Date|Comments -------|----|-------- 1.0|May 2018|Initial release 1.1|June 2018|Updated collection descriptions 1.2|October 2018|Updated documentation ![](https://telemetry.sharepointpnp.com/sp-starter-kit/documentation/components/wp-lob-integration) ================================================ FILE: documentation/components/wp-people-directory.md ================================================ # People Directory web part This web part provides you the ability to add a searchable people directory. A people search box and alphabet list are provided to enable both searching by name as well as selecting a specific letter. This web part requires no configuration and utilizes the people search API to surface people results. ![People Directory](../../assets/images/components/part-people-directory.gif) ## How to use this web part on your web pages 1. Place the page you want to add this web part to in edit mode. 2. Search for and insert the **People Directory** web part. 3. Configure the webpart to update its properties. ## Configurable Properties The `People Directory` web part can be configured with the following properties: | Label | Property | Type | Required | Description | | ---- | ---- | ---- | ---- | ---- | | Web part title | title | string | no | The web part title, editable inline with the web part itself | # Installing the web part See getting started from [SP-Starter-Kit repository readme](https://github.com/SharePoint/sp-starter-kit). You can also download just the [SharePoint Framework solution package (spppkg) file](https://github.com/pnp/sp-starter-kit/blob/master/source/react-people-directory/sharepoint/solution/react-people-directory.sppkg) and install that to your tenant. This web part does not have external dependencies. # Screenshots ![People Directory](../../assets/images/components/part-people-directory.png) # Source Code https://github.com/pnp/sp-starter-kit/tree/master/source/react-people-directory # Minimal Path to Awesome - Clone this repository - Move to Solution folder - in the command line run: - `npm install` - `gulp serve` # Version history Version|Date|Comments -------|----|-------- 1.0|May 2018|Initial release ![](https://telemetry.sharepointpnp.com/sp-starter-kit/documentation/components/wp-people-directory) ================================================ FILE: documentation/components/wp-personal-calendar.md ================================================ # Personal Calendar web part This web part provides you the ability to add a particular user's personal calendar on a web page. The web part may be configured to automatically refresh, as well as display up to seven days of events and a pre-defined number of events at a time. This web part is powered by the Microsoft Graph and currently requires that the Office 365 tenant be configured for targeted release for all users. ![Personal Calendar](../../assets/images/components/part-personal-calendar.gif) ## How to use this web part on your web pages 1. Place the page you want to add this web part to in edit mode. 2. Search for and insert the **Personal Calendar** web part. 3. Configure the web part to update its properties. ## Configurable Properties The `Personal Calendar` web part can be configured with the following properties: | Label | Property | Type | Required | Description | | ---- | ---- | ---- | ---- | ---- | | Upcoming Events | title | string | no | The web part title, editable inline with the web part itself | | How often to check for new upcoming meetings (in minutes) | refreshInterval | number | no | Default: 5 - the interval in minutes between auto refresh | | How many days in advance to retrieve meetings for? 0 - today only | daysInAdvance | number | no | Default: 0 (Today only) - the interval in minutes between auto refresh | | How many meetings to show? 0 - show all retrieved meetings | numMeetings | number | no | Default: 0 (all) - the interval in minutes between auto refresh | # Installing the web part See getting started from [SP-Starter-Kit repository readme](https://github.com/SharePoint/sp-starter-kit). You can also download just the [SharePoint Framework solution package (sppkg) file](https://github.com/pnp/sp-starter-kit/blob/master/source/react-personal-calendar/sharepoint/solution/react-personal-calendar.sppkg) and install that to your tenant. This web part requires access to the Microsoft Graph. # Screenshots ![Personal Calendar](../../assets/images/components/part-personal-calendar.png) # Source Code https://github.com/pnp/sp-starter-kit/tree/master/source/react-personal-calendar # Minimal Path to Awesome - Clone this repository - Move to Solution folder - in the command line run: - `npm install` - `gulp serve` # Version history Version|Date|Comments -------|----|-------- 1.0|May 2018|Initial release ![](https://telemetry.sharepointpnp.com/sp-starter-kit/documentation/components/wp-personal-calendar) ================================================ FILE: documentation/components/wp-personal-contacts.md ================================================ # Personal Contacts web part This web part provides you the ability to add a particular user's personal contacts on a web page. The web part may be configured to display a pre-defined number of contacts at a time. This web part is powered by the Microsoft Graph and currently requires that the Office 365 tenant be configured for targeted release for all users. ![Personal Contacts](../../assets/images/components/part-personal-contacts.gif) ## How to use this web part on your web pages 1. Place the page you want to add this web part to in edit mode. 2. Search for and insert the **Personal Contacts** web part. 3. Configure the web part to update its properties. ## Configurable Properties The `Personal Contacts` web part can be configured with the following properties: | Label | Property | Type | Required | Description | | ---- | ---- | ---- | ---- | ---- | | Personal contacts | title | string | no | The web part title, editable inline with the web part itself | | Number of contacts to show | nrOfContacts | number | no | Default: 5 - The number of contacts to show | # Installing the web part See getting started from [SP-Starter-Kit repository readme](https://github.com/SharePoint/sp-starter-kit). You can also download just the [SharePoint Framework solution package (sppkg) file](https://github.com/pnp/sp-starter-kit/blob/master/source/react-personal-contacts/sharepoint/solution/react-personal-contacts.sppkg) and install that to your tenant. This web part requires access to the Microsoft Graph. # Screenshots ![Personal Contacts](../../assets/images/components/part-personal-contacts.png) # Source Code https://github.com/pnp/sp-starter-kit/tree/master/source/react-personal-contacts # Minimal Path to Awesome - Clone this repository - Move to Solution folder - in the command line run: - `npm install` - `gulp serve` # Version history Version|Date|Comments -------|----|-------- 1.0|May 2018|Initial release ![](https://telemetry.sharepointpnp.com/sp-starter-kit/documentation/components/wp-personal-contacts) ================================================ FILE: documentation/components/wp-personal-email.md ================================================ # Personal Email web part This web part provides you the ability to add a particular user's personal email on a web page. The web part may be configured to display a pre-defined number of emails at a time and includes a link to the user's Outlook to view all email. This web part is powered by the Microsoft Graph and currently requires that the Office 365 tenant be configured for targeted release for all users. ![Personal Email](../../assets/images/components/part-personal-email.gif) ## How to use this web part on your web pages 1. Place the page you want to add this web part to in edit mode. 2. Search for and insert the **Personal Email** web part. 3. Configure the web part to update its properties. ## Configurable Properties The `Personal Email` web part can be configured with the following properties: | Label | Property | Type | Required | Description | | ---- | ---- | ---- | ---- | ---- | | Personal e-mail | title | string | no | The web part title, editable inline with the web part itself | | Number of messages to show | nrOfMessages | number | no | Default: 5 - The number of emails to show | # Installing the web part See getting started from [SP-Starter-Kit repository readme](https://github.com/SharePoint/sp-starter-kit). You can also download just the [SharePoint Framework solution package (sppkg) file](https://github.com/pnp/sp-starter-kit/blob/master/source/react-personal-email/sharepoint/solution/react-personal-email.sppkg) and install that to your tenant. This web part requires access to the Microsoft Graph. # Screenshots ![Personal Email](../../assets/images/components/part-personal-email.png) # Source Code https://github.com/pnp/sp-starter-kit/tree/master/source/react-personal-email # Minimal Path to Awesome - Clone this repository - Move to Solution folder - in the command line run: - `npm install` - `gulp serve` # Version history Version|Date|Comments -------|----|-------- 1.0|May 2018|Initial release ![](https://telemetry.sharepointpnp.com/sp-starter-kit/documentation/components/wp-personal-email) ================================================ FILE: documentation/components/wp-personal-tasks.md ================================================ # Personal Tasks web part This web part provides you the ability to add a particular user's personal tasks on a web page. The web part may be configured to show all tasks or to exclude completed tasks. This web part is powered by the Microsoft Graph and currently requires that the Office 365 tenant be configured for targeted release for all users. ![Personal Tasks](../../assets/images/components/part-personal-tasks.gif) ## How to use this web part on your web pages 1. Place the page you want to add this web part to in edit mode. 2. Search for and insert the **Personal Tasks** web part. 3. Configure the web part to update its properties. ## Configurable Properties The `Personal Tasks` web part can be configured with the following properties: | Label | Property | Type | Required | Description | | ---- | ---- | ---- | ---- | ---- | | My Tasks | title | string | no | The web part title, editable inline with the web part itself | | Show completed tasks | showCompleted | bool | no | Default: false - If true, will show completed tasks as well | # Installing the web part See getting started from [SP-Starter-Kit repository readme](https://github.com/SharePoint/sp-starter-kit). You can also download just the [SharePoint Framework solution package (sppkg) file](https://github.com/pnp/sp-starter-kit/blob/master/source/react-personal-tasks/sharepoint/solution/react-personal-tasks.sppkg) and install that to your tenant. This web part requires access to the Microsoft Graph. # Screenshots ![Personal Tasks](../../assets/images/components/part-personal-tasks.png) # Source Code https://github.com/pnp/sp-starter-kit/tree/master/source/react-personal-tasks # Minimal Path to Awesome - Clone this repository - Move to Solution folder - in the command line run: - `npm install` - `gulp serve` # Version history Version|Date|Comments -------|----|-------- 1.0|May 2018|Initial release ![](https://telemetry.sharepointpnp.com/sp-starter-kit/documentation/components/wp-personal-tasks) ================================================ FILE: documentation/components/wp-recent-contacts.md ================================================ # Recent Contacts web part This web part provides you the ability to display list of a particular user's recent contacts on a web page. The web part may be configured to display a pre-defined number of contacts at a time. This web part is powered by the Microsoft Graph and currently requires that the Office 365 tenant be configured for targeted release for all users. ![Recent Contacts](../../assets/images/components/part-recent-contacts.gif) ## How to use this web part on your web pages 1. Place the page you want to add this web part to in edit mode. 2. Search for and insert the **Recent Contacts** web part. 3. Configure the web part to update its properties. ## Configurable Properties The `Recent Contacts` web part can be configured with the following properties: | Label | Property | Type | Required | Description | | ---- | ---- | ---- | ---- | ---- | | Recent contacts | title | string | no | The web part title, editable inline with the web part itself | | Specify the number of contacts to show | nrOfContacts | number | no | Default: 5 - The number of contacts to show | # Installing the web part See getting started from [SP-Starter-Kit repository readme](https://github.com/SharePoint/sp-starter-kit). You can also download just the [SharePoint Framework solution package (sppkg) file](https://github.com/pnp/sp-starter-kit/blob/master/source/react-recent-contacts/sharepoint/solution/react-recent-contacts.sppkg) and install that to your tenant. This web part requires access to the Microsoft Graph. # Screenshots ![Recent Contacts](../../assets/images/components/part-recent-contacts.png) # Source Code https://github.com/pnp/sp-starter-kit/tree/master/source/react-recent-contacts # Minimal Path to Awesome - Clone this repository - Move to Solution folder - in the command line run: - `npm install` - `gulp serve` # Version history Version|Date|Comments -------|----|-------- 1.0|May 2018|Initial release ![](https://telemetry.sharepointpnp.com/sp-starter-kit/documentation/components/wp-recent-contacts) ================================================ FILE: documentation/components/wp-recently-used-documents.md ================================================ # Recently Used Documents web part This web part provides you the ability to display a list of a particular user's recently used documents on a web page. The web part may be configured to display a pre-defined number of documents at a time. This web part is powered by the Microsoft Graph and currently requires that the Office 365 tenant be configured for targeted release for all users. ![Recently Used Documents](../../assets/images/components/part-recently-used-documents.gif) ## How to use this web part on your web pages 1. Place the page you want to add this web part to in edit mode. 2. Search for and insert the **Recently Used Documents** web part. 3. Configure the web part to update its properties. ## Configurable Properties The `Recently Used Documents` web part can be configured with the following properties: | Label | Property | Type | Required | Description | | ---- | ---- | ---- | ---- | ---- | | Recent Documents | title | string | no | The web part title, editable inline with the web part itself | | Specify the number of documents to show | nrOfItems | number | no | Default: 3 - The number of documents to show | # Installing the web part See getting started from [SP-Starter-Kit repository readme](https://github.com/SharePoint/sp-starter-kit). You can also download just the [SharePoint Framework solution package (sppkg) file](https://github.com/pnp/sp-starter-kit/blob/master/source/react-recently-used-documents/sharepoint/solution/react-recently-used-documents.sppkg) and install that to your tenant. This web part requires access to the Microsoft Graph. # Screenshots ![Recently Used Documents](../../assets/images/components/part-recently-used-documents.png) # Source Code https://github.com/pnp/sp-starter-kit/tree/master/source/react-recently-used-documents # Minimal Path to Awesome - Clone this repository - Move to Solution folder - in the command line run: - `npm install` - `gulp serve` # Version history Version|Date|Comments -------|----|-------- 1.0|May 2018|Initial release ![](https://telemetry.sharepointpnp.com/sp-starter-kit/documentation/components/wp-recently-used-documents) ================================================ FILE: documentation/components/wp-recently-visited-sites.md ================================================ # Recently Visited Sites web part This web part provides you the ability to display a list of a particular user's recently visited sites on a web page. The web part will display up to the first 30 (thirty) recently visited sites at a time. This web part is powered by the Microsoft Graph and currently requires that the Office 365 tenant be configured for targeted release for all users. ![Recently Visited Sites](../../assets/images/components/part-recently-visited-sites.gif) ## How to use this web part on your web pages 1. Place the page you want to add this web part to in edit mode. 2. Search for and insert the **Recently Visited Sites** web part. 3. Configure the web part to update its properties. ## Configurable Properties The `Recently Visited Sites` web part can be configured with the following properties: | Label | Property | Type | Required | Description | | ---- | ---- | ---- | ---- | ---- | | Recent Sites | title | string | no | The web part title, editable inline with the web part itself | # Installing the web part See getting started from [SP-Starter-Kit repository readme](https://github.com/SharePoint/sp-starter-kit). You can also download just the [SharePoint Framework solution package (sppkg) file](https://github.com/pnp/sp-starter-kit/blob/master/source/react-recently-visited-sites/sharepoint/solution/react-recently-visited-sites.sppkg) and install that to your tenant. This web part requires access to the Microsoft Graph. # Screenshots ![Recently Visited Sites](../../assets/images/components/part-recently-visited-sites.png) # Source Code https://github.com/pnp/sp-starter-kit/tree/master/source/react-recently-visited-sites # Minimal Path to Awesome - Clone this repository - Move to Solution folder - in the command line run: - `npm install` - `gulp serve` # Version history Version|Date|Comments -------|----|-------- 1.0|May 2018|Initial release ![](https://telemetry.sharepointpnp.com/sp-starter-kit/documentation/components/wp-recently-visited-sites) ================================================ FILE: documentation/components/wp-site-information.md ================================================ # Site Information web part This web part provides you the ability to collect and present additional metadata on a web page for group associated team sites. The web part may be configured to display site title, a site contacts powered by a people picker, and a term from the term store, often used to provide classification for the site. This web part is intended to be used once within a group associated team site to provide additional metadata. This web part provides an extensability framework in which to customize the web part code base to include additional properties and thus site metadata. Additional method demonstrations include the PnP Property Control people picker and the PnP Property Control term picker. The term store must include the term group name, `PnPTermSets`, which incudes a Term Set, `PnP-Organizations`. Terms should be placed within this term set. The term group, term set, and default terms are added by the Starter Kit provisioning process, in particular set within the `./provisioning/terms.xml` provisioning template. ![Site Information](../../assets/images/components/part-site-information.gif) ## How to use this web part on your web pages 1. Place the page you want to add this web part to in edit mode. 2. Search for and insert the **Site Information** web part. 3. Configure the web part to update its properties. ## Configurable Properties The `Site Information` web part can be configured with the following properties: | Label | Property | Type | Required | Description | | ---- | ---- | ---- | ---- | ---- | | Site Title | siteTitle | string | no | Default: Contoso Portal - the title of the site | | Site Contact | siteContact | IPropertyFieldGroupOrPerson[] | no | A site contact based on a people picker | | Site Organization | siteOrganization | IPickerTerms | no | The site's organization, based on a taxonomy termset | # Installing the web part See getting started from [SP-Starter-Kit repository readme](https://github.com/SharePoint/sp-starter-kit). You can also download just the [SharePoint Framework solution package (spppkg) file](https://github.com/pnp/sp-starter-kit/blob/master/source/react-site-information/sharepoint/solution/react-site-information.sppkg) and install that to your tenant. This web part requires access to the Microsoft Graph. # Screenshots ![Site Information](../../assets/images/components/part-site-information.png) # Source Code https://github.com/pnp/sp-starter-kit/tree/master/source/react-site-information # Minimal Path to Awesome - Clone this repository - Move to Solution folder - in the command line run: - `npm install` - `gulp serve` # Version history Version|Date|Comments -------|----|-------- 1.0|May 2018|Initial release 1.1|June 2018|Link webpart to proper term group and term set ![](https://telemetry.sharepointpnp.com/sp-starter-kit/documentation/components/wp-site-information) ================================================ FILE: documentation/components/wp-stock-information.md ================================================ # Stock Information web part This web part provides you the ability to display basic stock information for one publicly traded stock on a web page. The web part may be configured to display a stock based on stock symbol as well as be set to automatically refresh the stock information every 60 (sixty) seconds. The web part depends on a service provided by [Alpha Advantage](https://www.alphavantage.co/). [Learn how to register for your api key](https://github.com/SharePoint/sp-starter-kit/blob/master/documentation/tenant-settings.md#request-a-custom-api-key-to-alpha-vantage). The api key provided by Alpha Advantage is added as a tenant property by the Starter Kit provisioning process. [Use the -StockAPIKey parameter when deploying the kit](https://github.com/SharePoint/sp-starter-kit/tree/master/provisioning#-stockapikey). By default, the `Stock Information` web part will use the stock symbol set during the Starter Kit provisioning process when the [-StockSymbol](https://github.com/SharePoint/sp-starter-kit/tree/master/provisioning#-stocksymbol) parameter is provided. The default stock symbol is `MSFT`. The stock symbol may be customized per web part instance. ![Stock Information](../../assets/images/components/part-stock.gif) ## How to use this web part on your web pages 1. Place the page you want to add this web part to in edit mode. 2. Search for and insert the **Stock Information** web part. 3. Configure the web part to update its properties. ## Configurable Properties The `Stock Information` web part can be configured with the following properties: | Label | Property | Type | Required | Description | | ---- | ---- | ---- | ---- | ---- | | Stock Code | stockSymbol | string | no | Default: MSFT - overrides the default stock, MSFT, with a preferred stock symbol | | Automatic Refresh | autoRefresh | bool | no | Default: false - If true, the web part will auto refresh every 60 seconds | # Installing the web part See getting started from [SP-Starter-Kit repository readme](https://github.com/SharePoint/sp-starter-kit). You can also download just the [SharePoint Framework solution package (spppkg) file](https://github.com/SharePoint/sp-starter-kit/blob/master/package/sharepoint-starter-kit.sppkg) and install that to your tenant. This web part requires access to the Microsoft Graph. # Screenshots ![Stock Information](../../assets/images/components/part-stock.png) # Source Code https://github.com/SharePoint/sp-starter-kit/tree/master/solution/src/webparts/stockInformation # Minimal Path to Awesome - Clone this repository - Move to Solution folder - in the command line run: - `npm install` - `gulp serve` # Version history Version|Date|Comments -------|----|-------- 1.0|May 2018|Initial release ![](https://telemetry.sharepointpnp.com/sp-starter-kit/documentation/components/wp-stock-information) ================================================ FILE: documentation/components/wp-tiles.md ================================================ # Tiles web part This web part provides you the ability to add a per instance listing of tiled links. Tiles are stored as a collection of tiles within the web part's properties, removing the need for link storage within SharePoint lists, tenant properties, or other external link storage requirements. Icons are from Office UI Fabric. ![Tiles](../../assets/images/components/part-tiles.gif) ## How to use this web part on your web pages 1. Place the page you want to add this web part to in edit mode. 2. Search for and insert the **Tiles** web part. 3. Configure the web part to update its properties. ## Configurable Properties The `Tiles` web part can be configured with the following properties: | Label | Property | Type | Required | Description | | ---- | ---- | ---- | ---- | ---- | | Useful Tools | title | string | no | The web part title, editable inline with the web part itself | | Specify the height of the tiles | tileHeight | number | no | Default: 200, the height in pixels of each tile | | Tile data | collectionData | collection | no | Collection of tiles | ### collectionData Collection Properties Configurable properties for each tile row within the `collectionData` collection: | Label | Property | Type | Required | Description | | ---- | ---- | ---- | ---- | ---- | | Title | title | string | yes | The text / title of the tile | | Description | description | string | no | Optional tile description | | URL | url | string | yes | The tile link url | | UI Fabric icon name | icon | fabricIcon | no | Optional UI Fabric icon name | | Target | target | dropdown | no | Optional target for this link, current or new window | # Installing the web part See getting started from [SP-Starter-Kit repository readme](https://github.com/SharePoint/sp-starter-kit). You can also download just the [SharePoint Framework solution package (sppkg) file](https://github.com/pnp/sp-starter-kit/blob/master/source/react-tiles/sharepoint/solution/react-tiles.sppkg) and install that to your tenant. This web part requires access to the Microsoft Graph. # Screenshots ![Tiles](../../assets/images/components/part-tiles.png) # Source Code https://github.com/pnp/sp-starter-kit/tree/master/source/react-tiles # Minimal Path to Awesome - Clone this repository - Move to Solution folder - in the command line run: - `npm install` - `gulp serve` # Version history Version|Date|Comments -------|----|-------- 1.0|May 2018|Initial release 1.1|June 2018|Update SPFx Property Controls version to 1.7.0 - use Fabric Icon control ![](https://telemetry.sharepointpnp.com/sp-starter-kit/documentation/components/wp-tiles) ================================================ FILE: documentation/components/wp-weather-information.md ================================================ # Weather Information web part This web part provides you the ability to display basic weather information for one location on a web page. The web part depends on a service provided by [Yahoo Weather API](https://developer.yahoo.com/weather/). By default, the `Weather Information` web part will use the location **Seatle** during the Starter Kit provisioning process and can be overriden when the [-WeatherCity](https://github.com/SharePoint/sp-starter-kit/tree/master/provisioning#-weathercity) parameter is provided. ![Weather Information](../../assets/images/components/part-weather.gif) ## How to use this web part on your web pages 1. Place the page you want to add this web part to in edit mode. 2. Search for and insert the **Weather** web part. 3. Configure the web part to update its properties. ## Configurable Properties The `Weather Information` web part can be configured with the following properties: | Label | Property | Type | Required | Description | | ---- | ---- | ---- | ---- | ---- | | Add a location | location | string | no | Inline editable location for weather request | | Display temperature as | unit | string | no | The requested temperature unit, Celsius or Fahrenheit | # Installing the web part See getting started from [SP-Starter-Kit repository readme](https://github.com/SharePoint/sp-starter-kit). You can also download just the [SharePoint Framework solution package (sppkg) file](https://github.com/pnp/sp-starter-kit/blob/master/source/react-weather/sharepoint/solution/react-weather.sppkg) and install that to your tenant. # Screenshots ![Weather Information](../../assets/images/components/part-weather.png) # Source Code https://github.com/pnp/sp-starter-kit/tree/master/source/react-weather # Minimal Path to Awesome - Clone this repository - Move to Solution folder - in the command line run: - `npm install` - `gulp serve` # Version history Version|Date|Comments -------|----|-------- 1.0|May 2018|Initial release ![](https://telemetry.sharepointpnp.com/sp-starter-kit/documentation/components/wp-weather-information) ================================================ FILE: documentation/components/wp-world-time.md ================================================ # World Time web part This web part provides you the ability to display basic clock for a given time zone on a web page. The clock is based on the user's workstation time with an offset from UTC to the selected time zone. ![World Time](../../assets/images/components/part-world-time.gif) ## How to use this web part on your web pages 1. Place the page you want to add this web part to in edit mode. 2. Search for and insert the **World Time** web part. 3. Configure the web part to update its properties. ## Configurable Properties The `World Time` web part can be configured with the following properties: | Label | Property | Type | Required | Description | | ---- | ---- | ---- | ---- | ---- | | Description | description | string | no | Default: UTC Time - The clock description | | Time Zone | timeZoneOffset | number | no | Default: 0 - The clock offset where 0 = UTC, -8 = PST (UTC−08:00), etc | # Installing the web part See getting started from [SP-Starter-Kit repository readme](https://github.com/SharePoint/sp-starter-kit). You can also download just the [SharePoint Framework solution package (sppkg) file](https://github.com/pnp/sp-starter-kit/blob/master/source/react-world-clock/sharepoint/solution/react-world-clock.sppkg) and install that to your tenant. # Screenshots ![World Time](../../assets/images/components/part-world-time.png) # Source Code https://github.com/pnp/sp-starter-kit/tree/master/source/react-world-clock # Minimal Path to Awesome - Clone this repository - Move to Solution folder - in the command line run: - `npm install` - `gulp serve` # Version history Version|Date|Comments -------|----|-------- 1.0|May 2018|Initial release ![](https://telemetry.sharepointpnp.com/sp-starter-kit/documentation/components/wp-world-time) ================================================ FILE: documentation/manual-deploy-sppkg-solution.md ================================================ # Manually deploy the SP Starter Kit .sppkg SPFx solution packages to the tenant App Catalog The SP Starter Kit [`deployment process`](../provisiniong/readme.md) will automatically deploy the included SPFx solutions to your tenant app catalog. You can also pre-deploy any / all of the includes .sppkg packages from the [`/source`](../source) folder manually to the tenant app catalog, as well as ['manually approve the requested permissions`](api-management.md). ## Pre-requirements 1. You will need tenant admin access. 2. You will already have to have created an Application Catalog from your SharePoint Admin Center. **Note**: A newly created app catalog may take a few minutes to a few hours to fully provision. **SharePoint Admin Center Apps** ![SharePoint Admin Center](../assets/images/app-catalog-01.png) **Create tenant application site** ![SharePoint Admin Center](../assets/images/app-catalog-02.png) ## Manually deploy SP Starter Kit .sppkg files 1. Load your tenant app catalog in a browser, i.e. http://[tenant].sharepoint.com/sites/apps 2. Drag and drop each `.sppkg` from the './source/[component]/sharepoint/solution folder into your `app catalog`. As an example, to manually deploy the `React Banner` webpart package included in the starter kit, drag and drop [`react-banner.sppkg`](../source/react-banner/sharepoint/solution) from the [`./source/react-banner/sharepoint/solution`](../source/react-banner/sharepoint/solution) into your App Catalog ![Application Catalog](../assets/images/spfx-solution-deployment-manual-01.png) 3. Wait for the upload to complete. ![Application Catalog](../assets/images/spfx-solution-deployment-manual-02.png) 4. After a successful package upload, you will be asked to trust the solution. You will want to `Make this solution available to all sites in the organization`. Also note that you will need to approve api permissions after 'deploying' the solution. ![Application Catalog](../assets/images/spfx-solution-deployment-manual-03.png) 5. Your solution should now be deployed. ![Application Catalog](../assets/images/spfx-solution-deployment-manual-04.png) 6. Verify no errors were thrown during solution deployment. ![Application Catalog](../assets/images/spfx-solution-deployment-manual-05.png) 7. You should now approve the API permissions found in the [`API access`](api-management.md) pakge available in the SharePoint admin center. ================================================ FILE: documentation/modifying-spfx-solutions.md ================================================ # Notes and suggestions when modifying included SPFx solutions This project includes multiple SPFx solutions including webparts, extensions, and libraries that come pre-included and deployed to the tenant app catalog with a [default installation of the SP Starter Kit](../provisioning). You may also consider [Manually deploying the SP Starter Kit .sppkg SPFx solution packages to the tenant App Catalog](./manual-deploy-sppkg-solution.md) ## Notes and recommendations 1. SPFx source files are found in the [source](../source) folder 2. Ensure you are using Node.js version 16.x, e.g. [Node.js 16.15.0](https://nodejs.org/download/release/latest-v16.x/), as the SPFx solutions are currently configured to use SPFx version 1.16.1. ================================================ FILE: documentation/tenant-settings.md ================================================ # Preparing your tenant for the PnP SharePoint Starter Kit In this document you can find detailed information about preparing your tenant to provision and utilize the PnP SharePoint Starter Kit. In the main [ReadMe](./README.md) file of this repository you can find general information about the project. In fact, here is the list of requirements, which need some manual steps, to be accomplished in order to properly provision the solution: * You need to [create a custom property in the User Profile Service](#UPSCustomProperty). * If you want to use the StockInformation Web Part, you need to [request a custom API key to Alpha Vantage](#APIKeyAlphaVantage), which is the provider for live stocks data. In the following sections you can find detailed instructions about the above tasks. ## Create a Custom Property in the User Profile Service In order to register a custom property in the User Profile Service, you need to browse with your web browser to the SharePoint Admin Center of SharePoint Online, which is available at the URL https://<tenant-name>-admin.sharepoint.com/. There, you need to select the *User Profiles* menu item on the left menu and select *Manage User Properties* under the *People* category of links, as you can see in the following figure. ![The User Profiles Admin UI](../assets/images/UPS-Custom-Property-01.png) In the *Manage User Properties* page, select to *New Property* create a **New Property** as it is illustrated in the following figure. ![The add New Property button](../assets/images/UPS-Custom-Property-02.png) Configure the new property with the following settings: * Name: PnP-CollabFooter-MyLinks * Display name: PnP-CollabFooter-MyLinks * Type: string (Single Value) * Length: 3600 (which is the maximum allowed) * Policy Setting: Optional * Allow users to edit values for this property: Checked Leave all the other properties with their default values. > Note: We cannot automate this step because it is not yet possible to use the Client Side Object Model, or the REST API of SharePoint Online, to create a custom User Profile property. ## Request a custom API key to Alpha Vantage The StockInformation Web Part uses the live stocks service provided by [Alpha Advantage](https://www.alphavantage.co/). However, to use it you need a software key, that you can ask for free to the API provider. You will simply need to go to the page to [Claim your API Key](https://www.alphavantage.co/support/#api-key), fill in the form, and store the generated key in a safe place. The key should be configured at tenant level, by creating a storage entity using the following PowerShell script: ```powershell Set-PnPStorageEntity -Key "PnP-Portal-AlphaVantage-API-Key" -Value "your-api-key" -Comment "API Key for Alpha Advantage REST Stock service" -Description "API Key for Alpha Advantage REST Stock service" ``` ================================================ FILE: documentation/term-store.md ================================================ # Term Store Considerations For a successful deployment of the SP Starter Kit, certain term store considerations exist. ## Term Store Administration Per the project pre-requirements, the account you use when [provisioning](../provisioning) the SP Starter Kit must be manually set as a term store administrator. ## Non-English tenants The SP Starter Kit end to end provisioning only works with tenants that are configured with the dafault language set to English, i.e. those with culture code 1033 enabled. It is possible that certain tenants have English available, while the default language is not set to 1033. This can cause issues when the provisioning process adds terms to to the term store. If you do not have English set as the default language for your tenant, in particular for your term store, the following modification should enable automated provisioning of the included terms found in the SP Starter Kit to your term store. Before deploying the SP Starter Kit, complete the following tasks. If you have already attempted to deploy the starter kit and wish to remove the language code requirement to the terms, delete the Term Group `PnPTermSets` before continuing. 1. Open [./provisioning/terms.xml](../provisioning/terms.xml) if your code editor, i.e. Visual Studio Code. 2. Around line 5, look for the following: `` 3. Within the tag, you should find: `TemplateCultureInfo="1033"`. Remove `TemplateCultureInfo="1033"`. 4. Save terms.xml. 5. Run `./provisioning/deploy.ps1` with your standard paramaters. This should add the PnPTermSets term group to your default language. ================================================ FILE: lerna.json ================================================ { "packages": [ "source/**" ], "version": "0.0.0" } ================================================ FILE: package/readme.md ================================================ ## SharePoint Framework solution package - SP Starter Kit V1 It is recommended to package the solution as needed using the latest version of available code, but you can also upload the sppkg file available in this folder directly to your app catalog to speed up the setup process. This .sppkg is a legacy package from SP Starter Kit V1. ================================================ FILE: package.json ================================================ { "name": "root", "private": true, "scripts": { "initialize": "lerna bootstrap", "localization": "lerna run --scope @starter-kit/shared-library build" }, "devDependencies": { "lerna": "3.16.4" } } ================================================ FILE: provisioning/.vscode/launch.json ================================================ { // Use IntelliSense to learn about possible attributes. // Hover to view descriptions of existing attributes. // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ { "type": "PowerShell", "request": "launch", "name": "PowerShell Launch Current File", "script": "${file}", "args": [], "cwd": "${file}" }, { "type": "PowerShell", "request": "launch", "name": "PowerShell Launch Current File in Temporary Console", "script": "${file}", "args": [], "cwd": "${file}", "createTemporaryIntegratedConsole": true }, { "type": "PowerShell", "request": "launch", "name": "PowerShell Launch Current File w/Args Prompt", "script": "${file}", "args": [ "${command:SpecifyScriptArgs}" ], "cwd": "${file}" }, { "type": "PowerShell", "request": "attach", "name": "PowerShell Attach to Host Process", "processId": "${command:PickPSHostProcess}", "runspaceId": 1 }, { "type": "PowerShell", "request": "launch", "name": "PowerShell Interactive Session", "cwd": "${workspaceRoot}" } ] } ================================================ FILE: provisioning/readme-sp2019.md ================================================ # SP Starter Kit Provisioning Guidance - SharePoint 2019 Only - Starter Kit V2 only Provided documentation for SharePoint 2019 - also note the limitations The following documentation provides guidance related to the the provisioning process of **SP Starter Kit**. **For SharePoint 2019 only** This document provides guidance on installing a full installation for **SP Starter Kit** for only **SharePoint 2019**. The installation includes one SPFx bundled solution per SPFx component, i.e. webpart or extentsion. Additional options exist, refer to [Choose the right method depending on your requirements](./readme.md#choose-the-right-method-depending-on-your-requirements). It is recommended you read this entire document before installing the starter kit, in particular pay close attention to [Important notes](#important-notes) and [Fixing provisioning errors](#fixing-provisioning-errors) # Table of contents - [Choose the right method depending on your requirements](#choose-the-right-method-depending-on-your-requirements) - [Minimal path to success](#minimal-path-to-success) - [Important notes](#important-notes) - [Fixing provisioning errors](#fixing-provisioning-errors) - [Provisioning Parameters](#provisioning-parameters) ## Choose the right method depending on your requirements - [Default installation](./readme.md#minimal-path-to-success) - SharePoint Online only, full installation, SPFx solution per component. - **[SharePoint 2019](./readme-sp2019.md)** - SharePoint 2019 ready, limited featureset. - [Only SPFx components](./readme-spfx-only.md) - Advanced - Only install SPFx solutions for SharePoint Online. - [Single solution installation - deprecated](./readme-single-solution.md) - SharePoint Online only, decrecated full installation, on SPFx solution for all components. ## Minimal path to success **TODO** ## Important notes **TODO** ## Fixing provisioning errors **TODO** ## Provisioning Parameters **TODO** ### -Parameters ### **Optional** **TODO** ================================================ FILE: provisioning/readme-spfx-only.md ================================================ # SP Starter Kit Provisioning Guidance - SharePoint Online - SPFx solution packages only The following documentation provides guidance related to a secondard provisioning process of the **SP Starter Kit**. **For SharePoint Online SPFx solution packages only** Additional installation options exist, including the default provisioning method. Refer to [Choose the right method depending on your requirements](./readme.md#choose-the-right-method-depending-on-your-requirements). This document provides guidance on installing only the SPFx solution packages (`.sppkg files`) for the **SP Starter Kit** for only **SharePoint Online**. The installation includes one SPFx bundled solution per SPFx component, i.e. webpart, extension, library. It is recommended you read this entire document before installing the starter kit, in particular pay close attention to [Important notes](#important-notes) and [Fixing provisioning errors](#fixing-provisioning-errors). # Table of contents - [Minimal path to success](#minimal-path-to-success) - [Important notes](#important-notes) - [Fixing provisioning errors](#fixing-provisioning-errors) ## Minimal path to success 1. Ensure that you have met all **[Pre-requirements](../README.md#pre-requirements)** 2. Open PowerShell and run the following commands, changing the tenant url to your primary SharePoint tenant site. In order to successfully install the SP Starter Kit, you are required to install the latest [PnP PowerShell](https://github.com/pnp/powershell) (validated at version 1.12.0 or higher), which can be installed with the following PowerShell command: ```powershell Install-Module -Name PnP.PowerShell ``` 3. After successfully installing PnP PowerShell, you need to connect to your tenant **using authorization credentials that have tenant administrative rigths**. This level of access is required to provision taxonomy. ```powershell Connect-PnPOnline -Url https://[yourtenant].sharepoint.com ``` 4. Install the spfx only starter kit using the **Invoke-PnPTenantTemplate** PowerShell commandlet from this project's **./provisioning** folder: ```powershell Invoke-PnPTenantTemplate -Path starterkit-spfx-only.pnp ``` 5. Upon successful provisioning, no error messages should appear. Validate all solution packages were installed by validating your tenant App Catalog ![App catalog](../assets/images/provision-spfx-only-01.png) ## Important notes - This provisioning method will not create any new SharePoint sites, nor will it change any existing SharePoint sites. - This provisioning method is a great example of how to create a custom provisioning template and should be used as a template for your own custom requirements. - This provisioning template may be modified and repackaged by editing **starterkit-spfx-only.xml** found in this project's **./source/templates** folder. After updating the .xml file, repackage the provisioning template. This may be accomplished with the following PowerShell commandlets: ```powershell $kit = Read-PnPTenantTemplate -Path ..\source\templates\starterkit-spfx-only.xml Save-PnPTenantTemplate -Template $kit -Out yourstarterkit.pnp ``` - Ensure the credentials you use to connect to your tenant have **tenant administrative rights**, or be a site collection administrator of the tenant app catalog site collection. This is required to provision to the tenant app catalog. ## Fixing provisioning errors - If you run into errors during provisioning, refer to ['Common SP Starter Kit Provisioning results'](../documentation/common-provision-results.md) for additional suggestions and common mistakes - Refer to the ['Issues List'](https://github.com/SharePoint/sp-starter-kit/issues) to see if anyone else has run into a similar issue, and if so possible paths to success - ['Submit a new issue'](https://github.com/SharePoint/sp-starter-kit/issues) if you are unable to find a solution to your specific error or question ================================================ FILE: provisioning/readme.md ================================================ # SP Starter Kit Provisioning Guidance - SharePoint Online The following documentation provides guidance related to the provisioning process of **SP Starter Kit**. **For SharePoint Online only** This document provides guidance on installing a full installation for **SP Starter Kit** for only **SharePoint Online**. The installation includes one SPFx bundled solution per SPFx component, i.e. webpart, extension, library. It is recommended you read this entire document before installing the starter kit, in particular pay close attention to [Common notes](#common-notes) and [Fixing provisioning errors](#fixing-provisioning-errors). # Table of contents - [Choose the right method depending on your requirements](#choose-the-right-method-depending-on-your-requirements) - [Minimal path to success](#minimal-path-to-success) - [Important notes](#important-notes) - [Fixing provisioning errors](#fixing-provisioning-errors) - [Pre-providing credentials](#pre-providing-credentials) - [Provisioning Parameters](#provisioning-parameters) ## Choose the right method depending on your requirements - **[Default installation](#minimal-path-to-success)** - SharePoint Online only, full installation, one SPFx solution per component. - [Only SPFx components](./readme-spfx-only.md) - Advanced - Only install SPFx solutions to tenant app catalog, will not provision site designs, site scripts, sites, or content. - [Single solution installation - deprecated v1 starter kit](https://github.com/pnp/sp-starter-kit/tree/v1/provisioning/) - SharePoint Online only, deprecated full installation, one SPFx solution for all components. - [SharePoint 2019 - deprecated v2 starter kit](.https://github.com/pnp/sp-starter-kit/tree/v1/provisioning/readme-sp2019.md) - SharePoint 2019 ready, limited featureset. ## Minimal path to success 1. Ensure that you have met all **[Pre-requirements](../README.md#Pre-requirements)** 2. Open PowerShell and run the following commands, changing the tenant url to your primary SharePoint tenant site. In order to successfully install the SP Starter Kit, you are required to install the latest [PnP PowerShell](https://github.com/pnp/powershell) (validated at version 1.12.0 or higher), which can be installed with the following PowerShell command: ```powershell Install-Module -Name PnP.PowerShell ``` 3. After successfully installing PnP PowerShell, you need to connect to your tenant **using authorization credentials that have tenant administrative rigths**. This level of access is required to provision taxonomy. ```powershell Connect-PnPOnline -Url https://[yourtenant].sharepoint.com ``` 4. Install the starter kit using the **Invoke-PnPTenantTemplate** PowerShell commandlet from this project's **./provisioning** folder: ```powershell Invoke-PnPTenantTemplate -Path starterkit.pnp ``` ## Important notes - By default the starter kit will create three site collections, using a common prefix of 'Contoso'. These sites will be called 'contosoportal' (a communications site), 'contosohr' (a team site), and 'contosomarketing' (a team site). To customize the site collection urls, use the **-Parameters** commandlet parameter as follows: ```powershell Invoke-PnPTenantTemplate -Path starterkit.pnp -Parameters @{"PORTALURL"="/sites/contosoportal"; "MARKETINGALIAS"="contosomarketing"; "HRALIAS"="contosohr" } ``` Replace the values of **"PORTALURL"**, **"MARKETINGALIAS"**, and **"HRALIAS"** with your own custom site paths. The **PORTALURL** parameter is the tenant relative url for your main site collection. The two alias parameters are used to create modern team sites with connected Office 365 unified groups. - The tenant site you connect to via PowerShell, i.e. **https://[yourtenant].sharepoint.com**, is only used to create the initial connection to your tenant. During application of the starter kit, the three demo sites previously mentioned will be created within the connected tenant. If any of the site collections already exist, the starter kit provisioning process will reuse the existing site collections. - The site hierarchy of the sites created by the deployment process will be read from the starterkit.pnp file. If you want to modify this template you will have to modify and repackage **starterkit.xml** found in this project's **./source/templates** folder, into a new starterkit.pnp file. This may be accomplished with the following PowerShell commandlets: ```powershell $kit = Read-PnPTenantTemplate -Path ..\source\templates\starterkit.xml Save-PnPTenantTemplate -Template $kit -Out yourstarterkit.pnp ``` - Ensure the credentials you use to connect to your tenant have **tenant administrative rights**. We require this to provision the taxonomy parts. ## Fixing provisioning errors - If you run into errors during provisioning, refer to ['Common SP Starter Kit Provisioning results'](../documentation/common-provision-results.md) for additional suggestions and common mistakes - Refer to the ['Issues List'](https://github.com/SharePoint/sp-starter-kit/issues) to see if anyone else has run into a similar issue, and if so possible paths to success - ['Submit a new issue'](https://github.com/SharePoint/sp-starter-kit/issues) if you are unable to find a solution to your specific error or question ## Pre-providing credentials Credentials may be provided via the command line, or by using the ['Windows credential manager'](https://www.youtube.com/watch?v=w7NJ_qTK1l8). **Credentials provided via command line** ```powershell $creds = Get-Credential Connect-PnPOnline https://[yourtenant].sharepoint.com -Credentials $creds Invoke-PnPTenantTemplate -Path .\starterkit.pnp ``` ## Provisioning Parameters The deployment process may be configured with the following set of parameters that may be used in tandem with each other. ### -Parameters ### **Optional** You can override certain parameters, including: **Company** - defaults to "Contoso Electronics" **SiteUrlPrefix** - defaults to "Contoso" **WeatherCity** - defaults to "Seattle" **StockSymbol** - defaults to "MSFT" **PORTALURL** - the site path to the starter kit portal site url, defaults to "/sites/contosoportal" **MARKETINGALIAS** - the site path alias for the starter kit "marketing" team site, defaults to "contosomarketing" **HRALIAS** - the site path alias for the starter kit "hr" team site, defaults to "contosohr" Override one or more setting using the **-Parameters** parameter similar to the following. Each paramater must be separated by a semicolon, i.e. **;**: ```powershell Invoke-PnPTenantTemplate -Path .\starterkit.pnp -Parameters @{"Company"="Your Company Name";"SiteUrlPrefix"="YourCompany";"WeatherCity"="Stockholm"} ``` ================================================ FILE: provisioning/starterkit.pnp ================================================ [File too large to display: 20.5 MB] ================================================ FILE: sample-lob-service/SharePointPnP.LobScenario/.gitignore ================================================ ## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. ## ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore # Developer settings files appsettings.Development.json # User-specific files *.suo *.user *.userosscache *.sln.docstates # User-specific files (MonoDevelop/Xamarin Studio) *.userprefs # Build results [Dd]ebug/ [Dd]ebugPublic/ [Rr]elease/ [Rr]eleases/ x64/ x86/ bld/ [Bb]in/ [Oo]bj/ [Ll]og/ # Visual Studio 2015/2017 cache/options directory .vs/ # Uncomment if you have tasks that create the project's static files in wwwroot #wwwroot/ # Visual Studio 2017 auto generated files Generated\ Files/ # MSTest test Results [Tt]est[Rr]esult*/ [Bb]uild[Ll]og.* # NUNIT *.VisualState.xml TestResult.xml # Build Results of an ATL Project [Dd]ebugPS/ [Rr]eleasePS/ dlldata.c # Benchmark Results BenchmarkDotNet.Artifacts/ # .NET Core project.lock.json project.fragment.lock.json artifacts/ **/Properties/launchSettings.json # StyleCop StyleCopReport.xml # Files built by Visual Studio *_i.c *_p.c *_i.h *.ilk *.meta *.obj *.iobj *.pch *.pdb *.ipdb *.pgc *.pgd *.rsp *.sbr *.tlb *.tli *.tlh *.tmp *.tmp_proj *.log *.vspscc *.vssscc .builds *.pidb *.svclog *.scc # Chutzpah Test files _Chutzpah* # Visual C++ cache files ipch/ *.aps *.ncb *.opendb *.opensdf *.sdf *.cachefile *.VC.db *.VC.VC.opendb # Visual Studio profiler *.psess *.vsp *.vspx *.sap # Visual Studio Trace Files *.e2e # TFS 2012 Local Workspace $tf/ # Guidance Automation Toolkit *.gpState # ReSharper is a .NET coding add-in _ReSharper*/ *.[Rr]e[Ss]harper *.DotSettings.user # JustCode is a .NET coding add-in .JustCode # TeamCity is a build add-in _TeamCity* # DotCover is a Code Coverage Tool *.dotCover # AxoCover is a Code Coverage Tool .axoCover/* !.axoCover/settings.json # Visual Studio code coverage results *.coverage *.coveragexml # NCrunch _NCrunch_* .*crunch*.local.xml nCrunchTemp_* # MightyMoose *.mm.* AutoTest.Net/ # Web workbench (sass) .sass-cache/ # Installshield output folder [Ee]xpress/ # DocProject is a documentation generator add-in DocProject/buildhelp/ DocProject/Help/*.HxT DocProject/Help/*.HxC DocProject/Help/*.hhc DocProject/Help/*.hhk DocProject/Help/*.hhp DocProject/Help/Html2 DocProject/Help/html # Click-Once directory publish/ # Publish Web Output *.[Pp]ublish.xml *.azurePubxml # Note: Comment the next line if you want to checkin your web deploy settings, # but database connection strings (with potential passwords) will be unencrypted *.pubxml *.publishproj # Microsoft Azure Web App publish settings. Comment the next line if you want to # checkin your Azure Web App publish settings, but sensitive information contained # in these scripts will be unencrypted PublishScripts/ # NuGet Packages *.nupkg # The packages folder can be ignored because of Package Restore **/[Pp]ackages/* # except build/, which is used as an MSBuild target. !**/[Pp]ackages/build/ # Uncomment if necessary however generally it will be regenerated when needed #!**/[Pp]ackages/repositories.config # NuGet v3's project.json files produces more ignorable files *.nuget.props *.nuget.targets # Microsoft Azure Build Output csx/ *.build.csdef # Microsoft Azure Emulator ecf/ rcf/ # Windows Store app package directories and files AppPackages/ BundleArtifacts/ Package.StoreAssociation.xml _pkginfo.txt *.appx # Visual Studio cache files # files ending in .cache can be ignored *.[Cc]ache # but keep track of directories ending in .cache !*.[Cc]ache/ # Others ClientBin/ ~$* *~ *.dbmdl *.dbproj.schemaview *.jfm *.pfx *.publishsettings orleans.codegen.cs # Including strong name files can present a security risk # (https://github.com/github/gitignore/pull/2483#issue-259490424) #*.snk # Since there are multiple workflows, uncomment next line to ignore bower_components # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) #bower_components/ # RIA/Silverlight projects Generated_Code/ # Backup & report files from converting an old project file # to a newer Visual Studio version. Backup files are not needed, # because we have git ;-) _UpgradeReport_Files/ Backup*/ UpgradeLog*.XML UpgradeLog*.htm ServiceFabricBackup/ *.rptproj.bak # SQL Server files *.mdf *.ldf *.ndf # Business Intelligence projects *.rdl.data *.bim.layout *.bim_*.settings *.rptproj.rsuser # Microsoft Fakes FakesAssemblies/ # GhostDoc plugin setting file *.GhostDoc.xml # Node.js Tools for Visual Studio .ntvs_analysis.dat node_modules/ # Visual Studio 6 build log *.plg # Visual Studio 6 workspace options file *.opt # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) *.vbw # Visual Studio LightSwitch build output **/*.HTMLClient/GeneratedArtifacts **/*.DesktopClient/GeneratedArtifacts **/*.DesktopClient/ModelManifest.xml **/*.Server/GeneratedArtifacts **/*.Server/ModelManifest.xml _Pvt_Extensions # Paket dependency manager .paket/paket.exe paket-files/ # FAKE - F# Make .fake/ # JetBrains Rider .idea/ *.sln.iml # CodeRush .cr/ # Python Tools for Visual Studio (PTVS) __pycache__/ *.pyc # Cake - Uncomment if you are using it # tools/** # !tools/packages.config # Tabs Studio *.tss # Telerik's JustMock configuration file *.jmconfig # BizTalk build output *.btp.cs *.btm.cs *.odx.cs *.xsd.cs # OpenCover UI analysis results OpenCover/ # Azure Stream Analytics local run output ASALocalRun/ # MSBuild Binary and Structured Log *.binlog # NVidia Nsight GPU debugger configuration file *.nvuser # MFractors (Xamarin productivity tool) working folder .mfractor/ /Vostok1.WorkHub.Bots.v4.Documentation/SiteScripts/QnAFeedback.SiteScript.zip ================================================ FILE: sample-lob-service/SharePointPnP.LobScenario/Controllers/CustomersController.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Logging; using SharePointPnP.LobScenario.Models; namespace SharePointPnP.LobScenario.Controllers { [Authorize] [ApiController] [Route("[controller]")] public class CustomersController : ControllerBase { private readonly ILogger _logger; public CustomersController(ILogger logger) { _logger = logger; } // GET /customers [HttpGet] public LobResponse Get() { return (new LobResponse { Username = HttpContext.User.Identities.FirstOrDefault()?.Name, RequestDateTime = DateTime.Now, Customers = Customers, }); } // GET /customers/{customerId} [HttpGet] [Route("{customerId}")] public LobResponse Get(string customerId) { return (new LobResponse { Username = HttpContext.User.Identities.FirstOrDefault()?.Name, RequestDateTime = DateTime.Now, Customers = Customers.Where(c => c.CustomerID.ToLowerInvariant() == customerId.ToLowerInvariant()) }); } // GET /customers/search/Morgenstern Gesundkost [HttpGet] [Route("search/{searchValue}")] public Models.LobResponse Search(string searchValue) { return (new LobResponse { Username = HttpContext.User.Identities.FirstOrDefault()?.Name, RequestDateTime = DateTime.Now, Customers = Customers.Where(c => c.CustomerID.ToLowerInvariant() == searchValue.ToLowerInvariant() || c.CompanyName.Contains(searchValue, StringComparison.InvariantCultureIgnoreCase)) .ToList() }); } private readonly List Customers = new List { new Customer{ CustomerID = "ALFKI", CompanyName = "Alfreds Futterkiste",ContactName = "Maria Anders",Country = "Germany" }, new Customer{ CustomerID = "ANATR", CompanyName = "Ana Trujillo Emparedados y helados", ContactName = "Ana Trujillo", Country = "Mexico" }, new Customer{ CustomerID = "ANTON", CompanyName = "Antonio Moreno Taquería", ContactName = "Antonio Moreno", Country = "Mexico" }, new Customer{ CustomerID = "AROUT", CompanyName = "Around the Horn", ContactName = "Thomas Hardy", Country = "UK" }, new Customer{ CustomerID = "BERGS", CompanyName = "Berglunds snabbköp", ContactName = "Christina Berglund", Country = "Sweden" }, }; } } ================================================ FILE: sample-lob-service/SharePointPnP.LobScenario/Models/Customer.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; namespace SharePointPnP.LobScenario.Models { public class Customer { public string CustomerID { get; set; } public string CompanyName { get; set; } public string ContactName { get; set; } public string Country { get; set; } } } ================================================ FILE: sample-lob-service/SharePointPnP.LobScenario/Models/LobResponse.cs ================================================ using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; namespace SharePointPnP.LobScenario.Models { public class LobResponse { public String Username { get; set; } public DateTime RequestDateTime { get; set; } public IEnumerable Customers { get; set; } } } ================================================ FILE: sample-lob-service/SharePointPnP.LobScenario/Program.cs ================================================ using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Hosting; namespace SharePointPnP.LobScenario { public class Program { public static void Main(string[] args) { CreateHostBuilder(args).Build().Run(); } public static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) .ConfigureWebHostDefaults(webBuilder => { webBuilder.UseStartup(); }); } } ================================================ FILE: sample-lob-service/SharePointPnP.LobScenario/README.md ================================================ # PnP SharePoint Starter Kit - LOB Service This folder contains an ASP.NET Core 3.1 WebAPI application that emulates a LOB system, which you can consume through the LobIntegration sample client-side Web Part defined in the PnP Starter Kit project. Refer to the [react-lob-integration web part](../source/react-lob-integration/README.md) for setup instructions. ================================================ FILE: sample-lob-service/SharePointPnP.LobScenario/SharePointPnP.LobScenario.csproj ================================================  netcoreapp3.1 SharePointPnP.LobScenario ================================================ FILE: sample-lob-service/SharePointPnP.LobScenario/SharePointPnP.LobScenario.sln ================================================  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 16 VisualStudioVersion = 16.0.29519.87 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SharePointPnP.LobScenario", "SharePointPnP.LobScenario.csproj", "{CC02B119-8511-4975-868A-F5248CD6C861}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {CC02B119-8511-4975-868A-F5248CD6C861}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {CC02B119-8511-4975-868A-F5248CD6C861}.Debug|Any CPU.Build.0 = Debug|Any CPU {CC02B119-8511-4975-868A-F5248CD6C861}.Release|Any CPU.ActiveCfg = Release|Any CPU {CC02B119-8511-4975-868A-F5248CD6C861}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {6289362E-6162-4286-AECC-14C70C914E2B} EndGlobalSection EndGlobal ================================================ FILE: sample-lob-service/SharePointPnP.LobScenario/Startup.cs ================================================ using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Authentication.AzureAD.UI; using Microsoft.AspNetCore.Authentication.JwtBearer; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using Microsoft.IdentityModel.Logging; namespace SharePointPnP.LobScenario { public class Startup { public Startup(IConfiguration configuration) { Configuration = configuration; } public IConfiguration Configuration { get; } // This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { var azureadoptions = new AzureADOptions(); Configuration.Bind("AzureAd", azureadoptions); IdentityModelEventSource.ShowPII = true; services.AddAuthentication(AzureADDefaults.BearerAuthenticationScheme) .AddAzureADBearer(options => Configuration.Bind("AzureAd", options)); services.Configure(AzureADDefaults.JwtBearerAuthenticationScheme, options => { // This is a Microsoft identity platform web API. options.Authority += "/v2.0"; // The web API accepts as audiences both the Client ID (options.Audience) and api://{ClientID}. options.TokenValidationParameters.ValidAudiences = new[] { options.Audience, $"api://{options.Audience}" }; options.TokenValidationParameters.ValidateAudience = true; options.TokenValidationParameters.ValidIssuer = $"https://sts.windows.net/{azureadoptions.TenantId}/"; // for "signInAudience": "AzureADMyOrg" or "AzureADMultipleOrgs" options.TokenValidationParameters.ValidateIssuer = true; }); services.AddControllers(); services.AddCors(options => { options.AddPolicy("AllowSubdomain", builder => { builder.SetIsOriginAllowedToAllowWildcardSubdomains() .WithOrigins("https://*.sharepoint.com") .AllowAnyHeader() .AllowAnyMethod(); }); }); } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } app.UseHttpsRedirection(); app.UseRouting(); app.UseCors("AllowSubdomain"); app.UseAuthentication() .UseAuthorization(); app.UseEndpoints(endpoints => { endpoints.MapControllers(); }); } } } ================================================ FILE: sample-lob-service/SharePointPnP.LobScenario/appsettings.json ================================================ { "AzureAd": { "Instance": "https://login.microsoftonline.com/", "TenantId": "22222222-2222-2222-2222-222222222222", "ClientId": "11111111-1111-1111-11111111111111111" }, "Logging": { "LogLevel": { "Default": "Information", "Microsoft": "Warning", "Microsoft.Hosting.Lifetime": "Information" } }, "AllowedHosts": "*" } ================================================ FILE: source/README.md ================================================ # Individual solutions of the Starter Kit Starting from SharePoint Starter Kit v2, each web part and be taken into use independently without requirement to deploy them all to your tenant. Those solutions which do not have cloud dependencies, and with V3, may only be used on SharePoint Online. On-premises SharePoint is no longer supported. Supportability of each solution is explicitly called out in the solution level. Solution structure as as follows: Solution | Description | Environment ----------- | ----------- | ----------- [js-application-redirect](js-application-redirect/README.md) | Can be used to perform automatic redirections of URLs in the site based on a custom list. | SPO [library-starter-kit-shared](library-starter-kit-shared/README.md) | Shows the list of sites which particular user is following | SPO [rest-application-alerts](rest-application-alerts/README.md) | Shows informational or important messages in the header section of pages based on a custom list information in the hub site. | SPO [react-application-collab-footer](react-application-collab-footer/README.md) | Shows company wide links which are configured using Taxonomy service. Includes also personalized links which are stored in user profile property if set. | SPO [react-application-portal-footer](react-application-portal-footer/README.md) | Expanding footer for communication site. Show standard company links and also supports personalized links for the current user which are stored in User Profile. | SPO [react-banner](react-banner/README.md) | Creates a banner with an image and overlaid text. | SPO [react-command-discuss-now](react-command-discuss-now/README.md) | Custom list view command set to add new custom dialog for document library to start discussion around the document in Microsoft Teams using Graph APIs | SPO [react-followed-sites](react-followed-sites/README.md) | Shows the list of sites which particular user is following. | SPO [react-links](react-links/README.md) | Link list web part which is using collection data editor and stores the links in web part properties. | SPO [react-lob-integration](react-lob-integration/README.md) | Sample web part to surface LOB information from API hosted in Azure. | SPO [react-people-directory](react-people-directory/README.md) | People directory web part uses the people search API to get list of people to show. | SPO [react-personal-calendar](react-personal-calendar/README.md) | Shows upcoming calendar meetings for the particular user using Microsoft Graph. | SPO [react-react-personal-contacts](react-react-personal-contacts/README.md) | Personal contacts for particular user using Microsoft Graph. | SPO [react-personal-email](react-personal-email/README.md) | List latest personal emails for the current user using Microsoft Graph. | SPO [react-personal-tasks](react-personal-tasks/README.md) | Show personal tasks for the current user using Microsoft Graph with Graph Tool Kit. | SPO [react-recent-contacts](react-recent-contacts/README.md) | Show recent contacts for the current user using Microsoft Graph. | SPO [react-recently-used-documents](react-recently-used-documents/README.md) | Show recently used documents for the current user using Microsoft Graph. | SPO [react-recently-visited-sites](react-recently-visited-sites/README.md) | Show recently visited sites for current user using Microsoft Graph. | SPO [react-site-information](react-site-information/README.md) | Intended to collect and present additional metadata for group associated or normal team sites. | SPO [react-tiles](react-tiles/README.md) | Renders set of tiles. Icons are from Office UI Fabric and you can configure tiles using collection editor in web part properties. | SPO [react-weather](react-weather/README.md) | Weather web part targeted for SP2019 as SPO has out-of-the-box one. | SPO [react-tiles](react-world-clock/README.md) | World clock web part targeted for SP2019 as SPO has out-of-the-box one. | SPO ## Installation In order to run the project locally, we make use of [lerna](https://github.com/lerna/lerna). This tool will automatically set the `npm` linking correctly for the SPFx library component. Follow the next steps when you want to run this project on your own machine: - Clone the project: `git clone https://github.com/SharePoint/sp-starter-kit` - Navigate with your terminal to the cloned repository - Run: `npm i` - Once the root project dependencies are installed, you can run `npm run initialize` - Once all the packages are installed, you are ready to start developing ## Localization All localization keys and labels are managed from one library project [library-starter-kit-shared](./library-starter-kit-shared). In order to add/update new keys, all you have to do is add them to the appropriate localization files like `en-us.js`. Once added, run `gulp build` or run `npm run localization` on the root of the project. This ensures that the project updates the `LocaleKeys` enum. > **Important**: The version of the localization project should always be in sync in the projects which make use of it. ================================================ FILE: source/js-application-redirect/.editorconfig ================================================ # EditorConfig helps developers define and maintain consistent # coding styles between different editors and IDEs # editorconfig.org root = true [*] # change these settings to your own preference indent_style = space indent_size = 2 # we recommend you to keep these unchanged end_of_line = lf charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true [*.md] trim_trailing_whitespace = false [{package,bower}.json] indent_style = space indent_size = 2 ================================================ FILE: source/js-application-redirect/.eslintrc.js ================================================ require('@rushstack/eslint-config/patch/modern-module-resolution'); module.exports = { extends: ['@microsoft/eslint-config-spfx/lib/profiles/default'], parserOptions: { tsconfigRootDir: __dirname }, overrides: [ { files: ['*.ts', '*.tsx'], parser: '@typescript-eslint/parser', 'parserOptions': { 'project': './tsconfig.json', 'ecmaVersion': 2018, 'sourceType': 'module' }, rules: { // Prevent usage of the JavaScript null value, while allowing code to access existing APIs that may require null. https://www.npmjs.com/package/@rushstack/eslint-plugin '@rushstack/no-new-null': 1, // Require Jest module mocking APIs to be called before any other statements in their code block. https://www.npmjs.com/package/@rushstack/eslint-plugin '@rushstack/hoist-jest-mock': 1, // Require regular expressions to be constructed from string constants rather than dynamically building strings at runtime. https://www.npmjs.com/package/@rushstack/eslint-plugin-security '@rushstack/security/no-unsafe-regexp': 1, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/adjacent-overload-signatures': 1, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // // CONFIGURATION: By default, these are banned: String, Boolean, Number, Object, Symbol '@typescript-eslint/ban-types': [ 1, { 'extendDefaults': false, 'types': { 'String': { 'message': 'Use \'string\' instead', 'fixWith': 'string' }, 'Boolean': { 'message': 'Use \'boolean\' instead', 'fixWith': 'boolean' }, 'Number': { 'message': 'Use \'number\' instead', 'fixWith': 'number' }, 'Object': { 'message': 'Use \'object\' instead, or else define a proper TypeScript type:' }, 'Symbol': { 'message': 'Use \'symbol\' instead', 'fixWith': 'symbol' }, 'Function': { 'message': 'The \'Function\' type accepts any function-like value.\nIt provides no type safety when calling the function, which can be a common source of bugs.\nIt also accepts things like class declarations, which will throw at runtime as they will not be called with \'new\'.\nIf you are expecting the function to accept certain arguments, you should explicitly define the function shape.' } } } ], // RATIONALE: Code is more readable when the type of every variable is immediately obvious. // Even if the compiler may be able to infer a type, this inference will be unavailable // to a person who is reviewing a GitHub diff. This rule makes writing code harder, // but writing code is a much less important activity than reading it. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/explicit-function-return-type': [ 0, { 'allowExpressions': true, 'allowTypedFunctionExpressions': true, 'allowHigherOrderFunctions': false } ], // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // Rationale to disable: although this is a recommended rule, it is up to dev to select coding style. // Set to 1 (warning) or 2 (error) to enable. '@typescript-eslint/explicit-member-accessibility': 0, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/no-array-constructor': 1, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // // RATIONALE: The "any" keyword disables static type checking, the main benefit of using TypeScript. // This rule should be suppressed only in very special cases such as JSON.stringify() // where the type really can be anything. Even if the type is flexible, another type // may be more appropriate such as "unknown", "{}", or "Record". '@typescript-eslint/no-explicit-any': 0, // RATIONALE: The #1 rule of promises is that every promise chain must be terminated by a catch() // handler. Thus wherever a Promise arises, the code must either append a catch handler, // or else return the object to a caller (who assumes this responsibility). Unterminated // promise chains are a serious issue. Besides causing errors to be silently ignored, // they can also cause a NodeJS process to terminate unexpectedly. '@typescript-eslint/no-floating-promises': 0, // RATIONALE: Catches a common coding mistake. '@typescript-eslint/no-for-in-array': 2, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/no-misused-new': 2, // RATIONALE: The "namespace" keyword is not recommended for organizing code because JavaScript lacks // a "using" statement to traverse namespaces. Nested namespaces prevent certain bundler // optimizations. If you are declaring loose functions/variables, it's better to make them // static members of a class, since classes support property getters and their private // members are accessible by unit tests. Also, the exercise of choosing a meaningful // class name tends to produce more discoverable APIs: for example, search+replacing // the function "reverse()" is likely to return many false matches, whereas if we always // write "Text.reverse()" is more unique. For large scale organization, it's recommended // to decompose your code into separate NPM packages, which ensures that component // dependencies are tracked more conscientiously. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/no-namespace': [ 1, { 'allowDeclarations': false, 'allowDefinitionFiles': false } ], // RATIONALE: Parameter properties provide a shorthand such as "constructor(public title: string)" // that avoids the effort of declaring "title" as a field. This TypeScript feature makes // code easier to write, but arguably sacrifices readability: In the notes for // "@typescript-eslint/member-ordering" we pointed out that fields are central to // a class's design, so we wouldn't want to bury them in a constructor signature // just to save some typing. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // Set to 1 (warning) or 2 (error) to enable the rule '@typescript-eslint/no-parameter-properties': 0, // RATIONALE: When left in shipping code, unused variables often indicate a mistake. Dead code // may impact performance. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/no-unused-vars': [ 1, { 'vars': 'all', // Unused function arguments often indicate a mistake in JavaScript code. However in TypeScript code, // the compiler catches most of those mistakes, and unused arguments are fairly common for type signatures // that are overriding a base class method or implementing an interface. 'args': 'none' } ], // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/no-use-before-define': [ 2, { 'functions': false, 'classes': true, 'variables': true, 'enums': true, 'typedefs': true } ], // Disallows require statements except in import statements. // In other words, the use of forms such as var foo = require("foo") are banned. Instead use ES6 style imports or import foo = require("foo") imports. '@typescript-eslint/no-var-requires': 'error', // RATIONALE: The "module" keyword is deprecated except when describing legacy libraries. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/prefer-namespace-keyword': 1, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // Rationale to disable: it's up to developer to decide if he wants to add type annotations // Set to 1 (warning) or 2 (error) to enable the rule '@typescript-eslint/no-inferrable-types': 0, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // Rationale to disable: declaration of empty interfaces may be helpful for generic types scenarios '@typescript-eslint/no-empty-interface': 0, // RATIONALE: This rule warns if setters are defined without getters, which is probably a mistake. 'accessor-pairs': 1, // RATIONALE: In TypeScript, if you write x["y"] instead of x.y, it disables type checking. 'dot-notation': [ 1, { 'allowPattern': '^_' } ], // RATIONALE: Catches code that is likely to be incorrect 'eqeqeq': 0, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'for-direction': 1, // RATIONALE: Catches a common coding mistake. 'guard-for-in': 2, // RATIONALE: If you have more than 2,000 lines in a single source file, it's probably time // to split up your code. 'max-lines': ['warn', { max: 2000 }], // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-async-promise-executor': 2, // RATIONALE: Deprecated language feature. 'no-caller': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-compare-neg-zero': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-cond-assign': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-constant-condition': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-control-regex': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-debugger': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-delete-var': 2, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-duplicate-case': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-empty': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-empty-character-class': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-empty-pattern': 1, // RATIONALE: Eval is a security concern and a performance concern. 'no-eval': 1, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-ex-assign': 2, // RATIONALE: System types are global and should not be tampered with in a scalable code base. // If two different libraries (or two versions of the same library) both try to modify // a type, only one of them can win. Polyfills are acceptable because they implement // a standardized interoperable contract, but polyfills are generally coded in plain // JavaScript. 'no-extend-native': 1, // Disallow unnecessary labels 'no-extra-label': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-fallthrough': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-func-assign': 1, // RATIONALE: Catches a common coding mistake. 'no-implied-eval': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-invalid-regexp': 2, // RATIONALE: Catches a common coding mistake. 'no-label-var': 2, // RATIONALE: Eliminates redundant code. 'no-lone-blocks': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-misleading-character-class': 2, // RATIONALE: Catches a common coding mistake. 'no-multi-str': 2, // RATIONALE: It's generally a bad practice to call "new Thing()" without assigning the result to // a variable. Either it's part of an awkward expression like "(new Thing()).doSomething()", // or else implies that the constructor is doing nontrivial computations, which is often // a poor class design. 'no-new': 1, // RATIONALE: Obsolete language feature that is deprecated. 'no-new-func': 2, // RATIONALE: Obsolete language feature that is deprecated. 'no-new-object': 2, // RATIONALE: Obsolete notation. 'no-new-wrappers': 1, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-octal': 2, // RATIONALE: Catches code that is likely to be incorrect 'no-octal-escape': 2, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-regex-spaces': 2, // RATIONALE: Catches a common coding mistake. 'no-return-assign': 2, // RATIONALE: Security risk. 'no-script-url': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-self-assign': 2, // RATIONALE: Catches a common coding mistake. 'no-self-compare': 2, // RATIONALE: This avoids statements such as "while (a = next(), a && a.length);" that use // commas to create compound expressions. In general code is more readable if each // step is split onto a separate line. This also makes it easier to set breakpoints // in the debugger. 'no-sequences': 1, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-shadow-restricted-names': 2, // RATIONALE: Obsolete language feature that is deprecated. // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-sparse-arrays': 2, // RATIONALE: Although in theory JavaScript allows any possible data type to be thrown as an exception, // such flexibility adds pointless complexity, by requiring every catch block to test // the type of the object that it receives. Whereas if catch blocks can always assume // that their object implements the "Error" contract, then the code is simpler, and // we generally get useful additional information like a call stack. 'no-throw-literal': 2, // RATIONALE: Catches a common coding mistake. 'no-unmodified-loop-condition': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-unsafe-finally': 2, // RATIONALE: Catches a common coding mistake. 'no-unused-expressions': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-unused-labels': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-useless-catch': 1, // RATIONALE: Avoids a potential performance problem. 'no-useless-concat': 1, // RATIONALE: The "var" keyword is deprecated because of its confusing "hoisting" behavior. // Always use "let" or "const" instead. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json 'no-var': 2, // RATIONALE: Generally not needed in modern code. 'no-void': 1, // RATIONALE: Obsolete language feature that is deprecated. // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-with': 2, // RATIONALE: Makes logic easier to understand, since constants always have a known value // @typescript-eslint\eslint-plugin\dist\configs\eslint-recommended.js 'prefer-const': 0, // RATIONALE: Catches a common coding mistake where "resolve" and "reject" are confused. 'promise/param-names': 2, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'require-atomic-updates': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'require-yield': 1, // "Use strict" is redundant when using the TypeScript compiler. 'strict': [ 2, 'never' ], // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'use-isnan': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js // Set to 1 (warning) or 2 (error) to enable. // Rationale to disable: !!{} 'no-extra-boolean-cast': 0, // ==================================================================== // @microsoft/eslint-plugin-spfx // ==================================================================== '@microsoft/spfx/import-requires-chunk-name': 1, '@microsoft/spfx/no-require-ensure': 2, '@microsoft/spfx/pair-react-dom-render-unmount': 0, // ==================================================================== // no-useless-escape // ==================================================================== 'no-useless-escape': 0 } }, { // For unit tests, we can be a little bit less strict. The settings below revise the // defaults specified in the extended configurations, as well as above. files: [ // Test files '*.test.ts', '*.test.tsx', '*.spec.ts', '*.spec.tsx', // Facebook convention '**/__mocks__/*.ts', '**/__mocks__/*.tsx', '**/__tests__/*.ts', '**/__tests__/*.tsx', // Microsoft convention '**/test/*.ts', '**/test/*.tsx' ], rules: {} } ] }; ================================================ FILE: source/js-application-redirect/.gitignore ================================================ # Logs logs *.log npm-debug.log* # Dependency directories node_modules # Build generated files dist lib release solution temp *.sppkg .heft # Coverage directory used by tools like istanbul coverage # OSX .DS_Store # Visual Studio files .ntvs_analysis.dat .vs bin obj # Resx Generated Code *.resx.ts # Styles Generated Code *.scss.ts # Package Lock package-lock.json ================================================ FILE: source/js-application-redirect/.npmignore ================================================ !dist config gulpfile.js release src temp tsconfig.json tslint.json *.log .yo-rc.json .vscode ================================================ FILE: source/js-application-redirect/.vscode/launch.json ================================================ { "version": "0.2.0", "configurations": [ { "name": "Hosted workbench", "type": "pwa-chrome", "request": "launch", "url": "https://enter-your-SharePoint-site/_layouts/workbench.aspx", "webRoot": "${workspaceRoot}", "sourceMaps": true, "sourceMapPathOverrides": { "webpack:///.././src/*": "${webRoot}/src/*", "webpack:///../../../src/*": "${webRoot}/src/*", "webpack:///../../../../src/*": "${webRoot}/src/*", "webpack:///../../../../../src/*": "${webRoot}/src/*" }, "runtimeArgs": [ "--remote-debugging-port=9222", "-incognito" ] } ] } ================================================ FILE: source/js-application-redirect/.vscode/settings.json ================================================ // Place your settings in this file to overwrite default and user settings. { // Configure glob patterns for excluding files and folders in the file explorer. "files.exclude": { "**/.git": true, "**/.DS_Store": true, "**/bower_components": true, "**/coverage": true, "**/lib-amd": true, "src/**/*.scss.ts": true }, "typescript.tsdk": ".\\node_modules\\typescript\\lib" } ================================================ FILE: source/js-application-redirect/.yo-rc.json ================================================ { "@microsoft/generator-sharepoint": { "plusBeta": false, "isCreatingSolution": true, "nodeVersion": "16.19.0", "sdksVersions": { "@microsoft/microsoft-graph-client": "3.0.2", "@microsoft/teams-js": "2.4.1" }, "version": "1.16.1", "environment": "spo", "libraryName": "js-application-redirect", "libraryId": "16ba7527-a398-43f7-9f20-7b050e49887e", "packageManager": "npm", "componentType": "extension", "extensionType": "ApplicationCustomizer" } } ================================================ FILE: source/js-application-redirect/README.md ================================================ # Redirect Application Customizer Redirect from URL based on mapping from a list on the site. Can be used to automatically redirect from pages to other locations. The redirection paths are administered via a SharePoint list named "PnP Redirect Links" that is hosted by the site that is set to use the redirect extension. The list is automatically created by the extension if it is not found, dependent upon the current user loading the site has sufficient permissions to add a new list. ![Redirection Extension](../../assets/images/components/ext-redirects.gif) > Screenshot is from the v1 version. ## PnP Redirect Links list details This extension is dependent on a explicit `PnP Redirect Links` list that must be located in the current site that is utilizing the redirect extension. | Display Name | Name | Type | Required | Description | | ---- | ---- | ---- | ---- | ---- | | Source URL | PnPSourceUrl | Hyperlink | yes | The path of the source page | | Destination URL | PnPDestinationUrl | Hyperlink | yes | The path of the destination page | | Redirection Enabled | PnPRedirectionEnabled | Boolean | yes | Should the particular redirection occur | > Notice by default the extension will automatically create this list if it is not found in the current site, assuming the current user has the appropriate permissions to add a new list. Original v1 implementation located at https://github.com/SharePoint/sp-starter-kit/blob/master/solution/src/extensions/redirect/RedirectApplicationCustomizer.ts In v2 release repackaged as its own solution to provide more flexibility from deployment perspective. In v3 release, SPFx was upgraded to version 1.16.1. ## Creating a redirection entry Assume you have a url, **https://contoso.sharepoint.com/sites/contoso/sitepages/oldnews.aspx**, and you wish to automatically redirect visitors to this oldnews.aspx page to **https://contoso.sharepoint.com/sites/news/sitepages/news.aspx**. - Within the site, **https://contoso.sharepoint.com/sites/contoso/**, you will need to enable the redirect extension and ensure the "PnP Redirect Links" list is created by the extension by loading any page within the site. If the list does not get automatically created, check to ensure your user account has sufficient permissions to add lists to the site, and also validate the extension is loading. - Create a new list item in "PnP Redirect Links". - List item settings: - Source Url: /sites/contoso/sitepages/oldnews.aspx - Destination Url: https://contoso.sharepoint.com/sites/news/sitepages/news.aspx - Redirection Enabled: yes - After you save the list item, reload oldnews.aspx and you should be automatically redirected to the destination url. - If the redirection does not occur, check the console log or network trace to validate that the extension was loaded. ## Installing the extension See getting started from [SP-Starter-Kit repository readme](https://github.com/pnp/sp-starter-kit) for basic installation of the SP Starter Kit which includes installing the application customizer's sppkg to the tenant app catalog, and activating the extension on the hub site and associated team sites. You can also download just the [extension (sppkg) file](./sharepoint/solution/js-application-redirect.sppkg) and install that to your tenant's app catalog. This extension does not have external dependencies. > As this is a SharePoint Framework extension, you will need to explicitly enable this extension in a site using CSOM, REST APIs, PnP PowerShell, or PnP cli. **A common approach to activate the extention on a given site connection is to use PnP PowerShell commandlets:** ```powershell Connect-PnPOnline https://contosodemosk.sharepoint.com/sites/site-to-configure Add-PnPCustomAction -Name "Redirect" -Title "Redirect" -ClientSideComponentId 27f45dfa-839e-45c2-a379-fbfe627ed97c -Location "ClientSideExtension.ApplicationCustomizer" -ClientSideComponentProperties "{"redirectionsListTitle":"PnP Redirect Links"}" -Scope Site ``` > Set the full url and path of the Connect-PnPOnline commandlet to fit your specific tenant / site ## Used SharePoint Framework Version ![drop](https://img.shields.io/badge/version-1.16.1-green.svg) * Supported in SharePoint Online ## Applies to * [SharePoint Framework](https://learn.microsoft.com/en-us/sharepoint/dev/spfx/sharepoint-framework-overview) * [Office 365 tenant](https://learn.microsoft.com/en-us/sharepoint/dev/spfx/set-up-your-development-environment) ## Prerequisites Extension creates the needed list automatically if it's missing and user has sufficient permissions for the creation operation. ## Solution Solution|Author(s) --------|--------- solution/src/extensions/redirect | Paolo Pialorsi (@PaoloPia) js-application-redirect | Sébastien Levert (@sebastienlevert) js-application-redirect | Chandani Prajapati (@Chandani_SPD) ## Version history Version|Date|Comments -------|----|-------- 1.0|April 22, 2018|Initial release 2.0|December 29, 2019|v2.0 3.0|February 2023|Initial release for SharePoint Starter Kit v3 (Upgraded to SPFx 1.16.1) ## Disclaimer **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.** --- ## Minimal Path to Awesome * Clone this repository * Move to correct folder where solution exists * in the command line run: * `npm install` * `gulp serve` ## Features Key features demostrated by this solution: * PnPjs usage in the solution * Dynamic creation of the list if it's missing ================================================ FILE: source/js-application-redirect/config/config.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/config.2.0.schema.json", "version": "2.0", "bundles": { "redirect-application-customizer": { "components": [ { "entrypoint": "./lib/extensions/redirect/RedirectApplicationCustomizer.js", "manifest": "./src/extensions/redirect/RedirectApplicationCustomizer.manifest.json" } ] } }, "externals": {}, "localizedResources": { "RedirectApplicationCustomizerStrings": "lib/extensions/redirect/loc/{locale}.js" } } ================================================ FILE: source/js-application-redirect/config/deploy-azure-storage.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/deploy-azure-storage.schema.json", "workingDir": "./release/assets/", "account": "", "container": "js-application-redirect", "accessKey": "" } ================================================ FILE: source/js-application-redirect/config/package-solution.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/package-solution.schema.json", "solution": { "name": "Starter Kit - JS Redirect app customizer", "id": "16ba7527-a398-43f7-9f20-7b050e49887e", "version": "3.0.0.0", "includeClientSideAssets": true, "skipFeatureDeployment": true, "isDomainIsolated": false, "developer": { "name": "PnP Starter Kit", "privacyUrl": "", "termsOfUseUrl": "", "websiteUrl": "", "mpnId": "pnpsk" }, "metadata": { "shortDescription": { "default": "js-application-redirect description" }, "longDescription": { "default": "js-application-redirect description" }, "screenshotPaths": [], "videoUrl": "", "categories": [] }, "features": [ { "title": "Starter Kit - JS Redirect app customizer - Deployment of custom action.", "description": "Deploys a custom action within the Starter Kit - JS Redirect app customizer solution", "id": "c2d231d3-39ae-4f69-a958-44c5762354e0", "version": "2.0.0.0", "assets": { "elementManifests": [ "elements.xml" ] } } ] }, "paths": { "zippedPackage": "solution/js-application-redirect.sppkg" } } ================================================ FILE: source/js-application-redirect/config/sass.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/core-build/sass.schema.json" } ================================================ FILE: source/js-application-redirect/config/serve.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/spfx-serve.schema.json", "port": 4321, "https": true, "serveConfigurations": { "default": { "pageUrl": "https://contoso.sharepoint.com/sites/pnp-starter-kit/SitePages/Home.aspx", "customActions": { "27f45dfa-839e-45c2-a379-fbfe627ed97c": { "location": "ClientSideExtension.ApplicationCustomizer", "properties": { "redirectionsListTitle": "PnPRedirections" } } } }, "redirect": { "pageUrl": "https://contoso.sharepoint.com/sites/pnp-starter-kit/SitePages/Home.aspx", "customActions": { "27f45dfa-839e-45c2-a379-fbfe627ed97c": { "location": "ClientSideExtension.ApplicationCustomizer", "properties": { "redirectionsListTitle": "PnPRedirections" } } } } } } ================================================ FILE: source/js-application-redirect/config/write-manifests.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/write-manifests.schema.json", "cdnBasePath": "" } ================================================ FILE: source/js-application-redirect/gulpfile.js ================================================ 'use strict'; const build = require('@microsoft/sp-build-web'); build.addSuppression(`Warning - [sass] The local CSS class 'ms-Grid' is not camelCase and will not be type-safe.`); var getTasks = build.rig.getTasks; build.rig.getTasks = function () { var result = getTasks.call(build.rig); result.set('serve', result.get('serve-deprecated')); return result; }; build.initialize(require('gulp')); ================================================ FILE: source/js-application-redirect/package.json ================================================ { "name": "js-application-redirect", "version": "3.0.0", "private": true, "main": "lib/index.js", "engines": { "node": ">=16.13.0 <17.0.0" }, "scripts": { "build": "gulp bundle", "clean": "gulp clean", "test": "gulp test" }, "dependencies": { "@microsoft/decorators": "1.16.1", "@microsoft/sp-application-base": "1.16.1", "@microsoft/sp-core-library": "1.16.1", "@microsoft/sp-dialog": "1.16.1", "@pnp/sp": "3.11.0", "tslib": "2.3.1" }, "resolutions": { "@types/react": "16.8.8" }, "devDependencies": { "@microsoft/eslint-config-spfx": "1.16.1", "@microsoft/eslint-plugin-spfx": "1.16.1", "@microsoft/rush-stack-compiler-4.5": "0.2.2", "@microsoft/sp-build-web": "1.16.1", "@microsoft/sp-module-interfaces": "1.16.1", "@microsoft/sp-tslint-rules": "1.14.0", "@rushstack/eslint-config": "2.5.1", "@types/es6-promise": "0.0.33", "@types/webpack-env": "1.15.2", "ajv": "6.12.5", "eslint": "8.7.0", "gulp": "4.0.2", "tslint-microsoft-contrib": "5.0.0", "typescript": "4.5.5" } } ================================================ FILE: source/js-application-redirect/sharepoint/assets/ClientSideInstance.xml ================================================ ================================================ FILE: source/js-application-redirect/sharepoint/assets/elements.xml ================================================ ================================================ FILE: source/js-application-redirect/src/extensions/redirect/IRedirectApplicationCustomizerProperties.ts ================================================ export interface IRedirectApplicationCustomizerProperties { // Defines the Title of the list that holds the redirection items redirectionsListTitle: string; } ================================================ FILE: source/js-application-redirect/src/extensions/redirect/IRedirection.ts ================================================ // this interface defines a redirection item export interface IRedirection { // defines the relative URL of the source page to redirect from sourceRelativeUrl: string; // defines the relative or absolute URL of the destination page to redirect to destinationUrl: string; // declares whether the redirection is enabled or not enabled: boolean; } ================================================ FILE: source/js-application-redirect/src/extensions/redirect/RedirectApplicationCustomizer.manifest.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx/client-side-extension-manifest.schema.json", "id": "27f45dfa-839e-45c2-a379-fbfe627ed97c", "alias": "RedirectApplicationCustomizer", "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 } ================================================ FILE: source/js-application-redirect/src/extensions/redirect/RedirectApplicationCustomizer.ts ================================================ import { override } from '@microsoft/decorators'; import { Log } from '@microsoft/sp-core-library'; import { BaseApplicationCustomizer } from '@microsoft/sp-application-base'; import * as strings from 'RedirectApplicationCustomizerStrings'; import { IRedirectApplicationCustomizerProperties } from './IRedirectApplicationCustomizerProperties'; import { IRedirection } from './IRedirection'; import { IListEnsureResult, SPFI, spfi, SPFx } from '@pnp/sp/presets/all'; import { UrlFieldFormatType, IFieldAddResult, IField } from "@pnp/sp/fields"; const LOG_SOURCE: string = 'RedirectApplicationCustomizer'; /** A Custom Action which can be run during execution of a Client Side Application */ export default class RedirectApplicationCustomizer extends BaseApplicationCustomizer { private readonly FIELD_INTERNALNAME_SOURCEURL: string = 'PnPSourceUrl'; private readonly FIELD_INTERNALNAME_DESTINATIONURL: string = 'PnPDestinationUrl'; private readonly FIELD_INTERNALNAME_REDIRECTIONENABLED: string = 'PnPRedirectionEnabled'; private _sp : SPFI; // private _web: IWeb; @override public async onInit(): Promise { await super.onInit(); Log.info(LOG_SOURCE, `Initialized ${strings.Title}`); // ensure to have proper settings if (!this.properties || !this.properties.redirectionsListTitle) { Log.info(LOG_SOURCE, 'No properties were provided'); return; } this._sp = spfi().using(SPFx(this.context)); // read the server relative URL of the current page from Legacy Page Context const currentPageRelativeUrl: string = this.context.pageContext.legacyPageContext.serverRequestPath; // currentPageRelativeUrl will look similar to: /sites/contosoportal/SitePages/Home.aspx // Getting the current SharePoint Web URL // this._web = Web(this.context.pageContext.web.absoluteUrl); // search for a redirection rule for the current page, if any const redirection: IRedirection = await this.loadRedirectionForCurrentPage( this.properties.redirectionsListTitle, currentPageRelativeUrl); if (redirection) { // redirect to the target page, if any window.location.href = redirection.destinationUrl; } } private async loadRedirectionForCurrentPage(redirectionsListTitle: string, currentPageRelativeUrl: string): Promise { let result: IRedirection = undefined; // first of all, exclude redirection for the list of redirections if (currentPageRelativeUrl.indexOf(`Lists/${redirectionsListTitle}/AllItems.aspx`) < 0) { // ensures that the PnPRedirections lists exists // it will fail if a user doesn't have correct permissions, but we won't limit this to prevent subsequent execution await this.ensureRedirectionsList(redirectionsListTitle).catch(error=>{ console.log("Unable to call Ensure(). User does not have enough permissions."); }); // define a CAML query to get the redirection item for the current page, if any const query = { ViewXml: ` 1 ${currentPageRelativeUrl} 1 ` }; // search for items matching the query // tslint:disable-next-line: no-any const queryResult: any = await this._sp.web.lists.getByTitle(redirectionsListTitle).getItemsByCAMLQuery(query); if (queryResult && queryResult.length > 0) { // if there are any items, get the first one only to build the result // tslint:disable-next-line: no-any const firstResult: any = queryResult[0]; result = { sourceRelativeUrl: firstResult[this.FIELD_INTERNALNAME_SOURCEURL].Url, destinationUrl: firstResult[this.FIELD_INTERNALNAME_DESTINATIONURL].Url, enabled: firstResult[this.FIELD_INTERNALNAME_REDIRECTIONENABLED] }; } } return(result); } // this method ensures that the Redirections lists exists, or if it doesn't exist // it creates it, as long as the currently connected user has proper permissions private async ensureRedirectionsList(redirectionsListTitle: string): Promise { let result: boolean = false; try { const ensureResult: IListEnsureResult = await this._sp.web.lists.ensure(redirectionsListTitle, 'Redirections', 100, true); // if we've got the list if (ensureResult.list) { // if the list has just been created if (ensureResult.created) { // we need to add the custom fields to the list const sourceUrlFieldAddResult: IFieldAddResult = await ensureResult.list.fields.addUrl( this.FIELD_INTERNALNAME_SOURCEURL, { DisplayFormat: UrlFieldFormatType.Hyperlink, Required: true } ); await sourceUrlFieldAddResult.field.update({ Title: strings.FieldSourceUrlTitle }); const destinationUrlFieldAddResult: IFieldAddResult = await ensureResult.list.fields.addUrl( this.FIELD_INTERNALNAME_DESTINATIONURL, { DisplayFormat: UrlFieldFormatType.Hyperlink, Required: true } ); await destinationUrlFieldAddResult.field.update({ Title: strings.FieldDestinationUrlTitle }); const redirectionEnabledFieldAddResult: IFieldAddResult = await ensureResult.list.fields.addBoolean( this.FIELD_INTERNALNAME_REDIRECTIONENABLED, { Required: true }); await redirectionEnabledFieldAddResult.field.update({ Title: strings.FieldRedirectionEnabledTitle }); // the list is ready to be used result = true; } else { // the list already exists, double check the fields try { const sourceUrlField: IField = ensureResult.list.fields.getByInternalNameOrTitle( this.FIELD_INTERNALNAME_SOURCEURL); const destinationUrlField: IField = ensureResult.list.fields.getByInternalNameOrTitle( this.FIELD_INTERNALNAME_DESTINATIONURL); const redirectionEnabledField: IField = ensureResult.list.fields.getByInternalNameOrTitle( this.FIELD_INTERNALNAME_REDIRECTIONENABLED); // if it is all good, then the list is ready to be used result = (sourceUrlField && destinationUrlField && redirectionEnabledField) !== undefined; } catch (e) { // if any of the fields does not exist, raise an exception in the console log console.log(`The ${redirectionsListTitle} list does not match the expected fields definition.`); } } } } catch (e) { // if we fail to create the list, raise an exception in the console log console.log(`Failed to create custom list ${redirectionsListTitle}.`); } return(result); } } ================================================ FILE: source/js-application-redirect/src/extensions/redirect/loc/en-us.js ================================================ define([], function() { return { FieldRedirectionEnabledTitle: "Redirection Enabled", FieldDestinationUrlTitle: "Destination URL", FieldSourceUrlTitle: "Source URL", Title: "RedirectApplicationCustomizer" } }); ================================================ FILE: source/js-application-redirect/src/extensions/redirect/loc/fr-fr.js ================================================ define([], function() { return { FieldRedirectionEnabledTitle: "Redirection activée", FieldDestinationUrlTitle: "URL de destination", FieldSourceUrlTitle: "URL initiale", Title: "RedirectApplicationCustomizer" } }); ================================================ FILE: source/js-application-redirect/src/extensions/redirect/loc/myStrings.d.ts ================================================ declare interface IRedirectApplicationCustomizerStrings { FieldRedirectionEnabledTitle: string; FieldDestinationUrlTitle: string; FieldSourceUrlTitle: string; Title: string; } declare module 'RedirectApplicationCustomizerStrings' { const strings: IRedirectApplicationCustomizerStrings; export = strings; } ================================================ FILE: source/js-application-redirect/src/index.ts ================================================ // A file is required to be in the root of the /src directory by the TypeScript compiler ================================================ FILE: source/js-application-redirect/tsconfig.json ================================================ { "extends": "./node_modules/@microsoft/rush-stack-compiler-4.5/includes/tsconfig-web.json", "compilerOptions": { "target": "es5", "forceConsistentCasingInFileNames": true, "module": "esnext", "moduleResolution": "node", "jsx": "react", "declaration": true, "sourceMap": true, "experimentalDecorators": true, "skipLibCheck": true, "outDir": "lib", "inlineSources": false, "strictNullChecks": false, "noImplicitAny": true, "typeRoots": [ "./node_modules/@types", "./node_modules/@microsoft" ], "types": [ "webpack-env" ], "lib": [ "es5", "dom", "es2015.collection", "es2015.promise" ] }, "include": [ "src/**/*.ts", "src/**/*.tsx" ] } ================================================ FILE: source/library-starter-kit-shared/.editorconfig ================================================ # EditorConfig helps developers define and maintain consistent # coding styles between different editors and IDEs # editorconfig.org root = true [*] # change these settings to your own preference indent_style = space indent_size = 2 # we recommend you to keep these unchanged end_of_line = lf charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true [*.md] trim_trailing_whitespace = false [{package,bower}.json] indent_style = space indent_size = 2 ================================================ FILE: source/library-starter-kit-shared/.eslintrc.js ================================================ require('@rushstack/eslint-config/patch/modern-module-resolution'); module.exports = { extends: ['@microsoft/eslint-config-spfx/lib/profiles/default'], parserOptions: { tsconfigRootDir: __dirname } }; ================================================ FILE: source/library-starter-kit-shared/.gitignore ================================================ # Logs logs *.log npm-debug.log* # Dependency directories node_modules # Build generated files dist lib temp # Coverage directory used by tools like istanbul coverage # OSX .DS_Store # Visual Studio files .ntvs_analysis.dat .vs bin obj # Resx Generated Code *.resx.ts # Styles Generated Code *.scss.ts .heft library package-lock.json ================================================ FILE: source/library-starter-kit-shared/.npmignore ================================================ !dist config gulpfile.js release src temp tsconfig.json tslint.json *.log .yo-rc.json .vscode ================================================ FILE: source/library-starter-kit-shared/.vscode/extensions.json ================================================ { "recommendations": [ "msjsdiag.debugger-for-chrome" ] } ================================================ FILE: source/library-starter-kit-shared/.vscode/launch.json ================================================ { /** * Install Chrome Debugger Extension for Visual Studio Code to debug your components with the * Chrome browser: https://aka.ms/spfx-debugger-extensions */ "version": "0.2.0", "configurations": [ { "name": "Hosted workbench", "type": "chrome", "request": "launch", "url": "https://enter-your-SharePoint-site/_layouts/workbench.aspx", "webRoot": "${workspaceRoot}", "sourceMaps": true, "sourceMapPathOverrides": { "webpack:///.././src/*": "${webRoot}/src/*", "webpack:///../../../src/*": "${webRoot}/src/*", "webpack:///../../../../src/*": "${webRoot}/src/*", "webpack:///../../../../../src/*": "${webRoot}/src/*" }, "runtimeArgs": [ "--remote-debugging-port=9222", "-incognito" ] }, { "type": "pwa-chrome" } ] } ================================================ FILE: source/library-starter-kit-shared/.vscode/settings.json ================================================ // Place your settings in this file to overwrite default and user settings. { // Configure glob patterns for excluding files and folders in the file explorer. "files.exclude": { "**/.git": true, "**/.DS_Store": true, "**/bower_components": true, "**/coverage": true, "**/lib-amd": true, "src/**/*.scss.ts": true }, "typescript.tsdk": ".\\node_modules\\typescript\\lib" } ================================================ FILE: source/library-starter-kit-shared/.yo-rc.json ================================================ { "@microsoft/generator-sharepoint": { "isCreatingSolution": true, "environment": "spo", "version": "1.16.1", "libraryName": "library-starter-kit-shared", "libraryId": "3e313dee-8a65-4ee7-a5c2-59670e43c6d2", "packageManager": "npm", "isDomainIsolated": false, "componentType": "library", "nodeVersion": "16.15.0", "sdkVersions": { "@microsoft/microsoft-graph-client": "3.0.2", "@microsoft/teams-js": "2.4.1" } } } ================================================ FILE: source/library-starter-kit-shared/README.md ================================================ # Library for shared features for SharePoint Online ## Summary A SharePoint Framework shared library that includes an approach to share langauge strings across multiple SharePoint Framework webparts. Currently used by the [Followed Sites webpart](../react-followed-sites/README.md) ## Used SharePoint Framework Version ![drop](https://img.shields.io/badge/version-1.16.1-green.svg) * Supported in SharePoint Online ## Applies to * [SharePoint Framework](https://learn.microsoft.com/en-us/sharepoint/dev/spfx/sharepoint-framework-overview) * [Office 365 tenant](https://learn.microsoft.com/en-us/sharepoint/dev/spfx/set-up-your-development-environment) ## Prerequisites Only works in SharePoint Online due to version dependency. ## Solution Solution|Author(s) --------|--------- library-starter-kit-shared | Eric Overfield ## Version history Version|Date|Comments -------|----|-------- 1.0|December 25, 2019|Initial release for SharePoint Starter Kit v2 3.0|February 2023|Update to SPFx 1.16.1 - V3 of Starter Kit ## Disclaimer **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.** --- ## Minimal Path to Awesome 1. Clone this repository 2. Within the [library-starter-kit-shared](../library-starter-kit-shared) source, i.e. [./source/library-starter-kit-shared](../library-starter-kit-shared) 3. in the command line run: ```powershell npm install gulp build gulp bundle npm link ``` 4. This project may now we consumed by another SPFx project. For an example, refer to the included SPFx webpart, [./source/react-followed-sites](../react-followed-sites) * Reference library component in other solutions to make things work - https://learn.microsoft.com/en-us/sharepoint/dev/spfx/library-component-tutorial ================================================ FILE: source/library-starter-kit-shared/config/config.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/config.2.0.schema.json", "version": "2.0", "bundles": { "sp-starter-kit-shared-library": { "components": [ { "entrypoint": "./lib/index.js", "manifest": "./src/libraries/spStarterKitShared/SpStarterKitSharedLibrary.manifest.json" } ] } }, "externals": {}, "localizedResources": { "SpStarterKitSharedLibraryStrings": "lib/libraries/spStarterKitShared/loc/{locale}.js" } } ================================================ FILE: source/library-starter-kit-shared/config/deploy-azure-storage.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/deploy-azure-storage.schema.json", "workingDir": "./release/assets/", "account": "", "container": "library-starter-kit-shared", "accessKey": "" } ================================================ FILE: source/library-starter-kit-shared/config/package-solution.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/package-solution.schema.json", "solution": { "name": "Starter Kit - Shared Library", "id": "3e313dee-8a65-4ee7-a5c2-59670e43c6d2", "version": "3.0.0.0", "includeClientSideAssets": true, "skipFeatureDeployment": true, "isDomainIsolated": false, "developer": { "name": "PnP Starter Kit", "privacyUrl": "", "termsOfUseUrl": "", "websiteUrl": "", "mpnId": "pnpsk" }, "metadata": { "shortDescription": { "default": "library-starter-kit-shared-client-side-solution description" }, "longDescription": { "default": "library-starter-kit-shared-client-side-solution description" }, "screenshotPaths": [], "videoUrl": "", "categories": [] }, "features": [ { "title": "@starter-kit/shared-library Shared Library Feature", "description": "The feature that activates Shared Library from the @starter-kit/shared-library solution.", "id": "849381c3-2209-441c-a559-2dc6a5c0cb63", "version": "3.0.0.0", "componentIds": [ "849381c3-2209-441c-a559-2dc6a5c0cb63" ] } ] }, "paths": { "zippedPackage": "solution/library-starter-kit-shared.sppkg" } } ================================================ FILE: source/library-starter-kit-shared/config/sass.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/core-build/sass.schema.json" } ================================================ FILE: source/library-starter-kit-shared/config/serve.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/spfx-serve.schema.json", "port": 43211, "https": true, "initialPage": "https://enter-your-SharePoint-site/_layouts/workbench.aspx" } ================================================ FILE: source/library-starter-kit-shared/config/write-manifests.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/write-manifests.schema.json", "cdnBasePath": "" } ================================================ FILE: source/library-starter-kit-shared/gulpfile.generatelocalkeys.js ================================================ const gulp = require('gulp'); const build = require('@microsoft/sp-build-web'); const fs = require('fs'); const path = require('path'); function getKeyValuePairs(fileContents) { let localeKeyValue = []; // Check if file contents were passed if (fileContents) { // Find the position of the return statement const fileLines = fileContents.split("\n"); const returnIdx = fileLines.findIndex(line => { const matches = line.trim().match(/(^return|{$)/gi); return matches !== null && matches.length >= 2; }); // Check if the index has been found if (returnIdx !== -1) { // Loop over all the lines for (const line of fileLines) { const lineVal = line.trim(); // Get the colon location const colonIdx = lineVal.indexOf(":"); if (colonIdx !== -1) { const keyName = lineVal.substring(0, colonIdx); let keyValue = lineVal.substring((colonIdx + 1)); keyValue = keyValue.trim(); keyValue = stripQuotes(keyValue); // Add the key and value to the array if (keyName && keyValue) { localeKeyValue.push({ key: stripQuotes(keyName), value: keyValue }); } } } } } return localeKeyValue; } function stripQuotes(value) { // Strip the comma if (value.endsWith(",")) { value = value.substring(0, value.length - 1); } if ((value.startsWith(`'`) && value.endsWith(`'`)) || (value.startsWith(`"`) && value.endsWith(`"`)) || (value.startsWith("`") && value.endsWith("`"))) { return value.substring(1, value.length - 1); } return value; } /** * Generate the locale keys from the en-us.js file */ const generateLocaleKeys = build.task('generateLocaleKeys', { execute: async (config) => { const fileContents = fs.readFileSync(path.join(__dirname, './src/libraries/spStarterKitShared/loc/en-us.js'), { encoding: "utf8" }); if (fileContents) { const keyPairs = getKeyValuePairs(fileContents); if (keyPairs && keyPairs.length > 0) { let enumInfo = []; let keys = []; enumInfo.push(`export enum LocaleKeys {`); for (const keyPair of keyPairs) { keys.push(` /** * Label value: "${keyPair.value}" */ ${keyPair.key} = "${keyPair.key}"`) } enumInfo.push(keys.join(`,\n`)) enumInfo.push(`}`); // only rebuild LocaleKeys.ts if a change has occurred var buildEnum = true; try { const existingFileContents = fs.readFileSync(path.join(__dirname, './src/libraries/spStarterKitShared/loc/LocaleKeys.ts'), { encoding: "utf8" }); if (existingFileContents && existingFileContents == enumInfo.join(`\n`)) { buildEnum = false; } } catch (err) { } if (buildEnum) { fs.writeFileSync(path.join(__dirname, './src/libraries/spStarterKitShared/loc/LocaleKeys.ts'), enumInfo.join(`\n`)); } } } } }); build.rig.addPreBuildTask(generateLocaleKeys); ================================================ FILE: source/library-starter-kit-shared/gulpfile.js ================================================ 'use strict'; const gulp = require('gulp'); const build = require('@microsoft/sp-build-web'); build.addSuppression(`Warning - [sass] The local CSS class 'ms-Grid' is not camelCase and will not be type-safe.`); require('./gulpfile.generatelocalkeys.js'); var getTasks = build.rig.getTasks; build.rig.getTasks = function () { var result = getTasks.call(build.rig); result.set('serve', result.get('serve-deprecated')); return result; }; build.initialize(gulp); ================================================ FILE: source/library-starter-kit-shared/package.json ================================================ { "name": "@starter-kit/shared-library", "version": "3.0.0", "private": false, "main": "lib/index.js", "engines": { "node": ">=16.13.0 <17.0.0" }, "browser": { "[module-name]": false }, "scripts": { "build": "gulp bundle", "clean": "gulp clean", "test": "gulp test" }, "dependencies": { "@microsoft/sp-core-library": "1.16.1", "@microsoft/sp-adaptive-card-extension-base": "1.16.1", "tslib": "2.3.1" }, "devDependencies": { "@microsoft/sp-build-web": "1.16.1", "@microsoft/sp-module-interfaces": "1.16.1", "@microsoft/rush-stack-compiler-4.5": "0.2.2", "@microsoft/eslint-plugin-spfx": "1.16.1", "@microsoft/eslint-config-spfx": "1.16.1", "typescript": "4.5.5", "@types/webpack-env": "1.15.2", "@rushstack/eslint-config": "2.5.1", "eslint": "8.7.0", "@types/es6-promise": "0.0.33", "gulp": "4.0.2", "ajv": "6.12.5" } } ================================================ FILE: source/library-starter-kit-shared/src/index.ts ================================================ export { SpStarterKitSharedLibrary } from './libraries/spStarterKitShared/SpStarterKitSharedLibrary'; export * from './libraries/spStarterKitShared/loc/LocaleKeys'; ================================================ FILE: source/library-starter-kit-shared/src/libraries/spStarterKitShared/SpStarterKitSharedLibrary.manifest.json ================================================ { "id": "849381c3-2209-441c-a559-2dc6a5c0cb63", "alias": "SpStarterKitSharedLibrary", "componentType": "Library", // The "*" signifies that the version should be taken from the package.json "version": "*", "manifestVersion": 2 } ================================================ FILE: source/library-starter-kit-shared/src/libraries/spStarterKitShared/SpStarterKitSharedLibrary.ts ================================================ import * as strings from 'SpStarterKitSharedLibraryStrings'; import { LocaleKeys } from './loc/LocaleKeys'; export class SpStarterKitSharedLibrary { /** * Retrieve the locale label for the specified key * * @param localeKey */ public static getLocale(localeKey: LocaleKeys | string, returnNull = false): string { if (!returnNull) { return strings[localeKey as keyof ISpStarterKitSharedLibraryStrings] || `Locale key not defined`; } else { return strings[localeKey as keyof ISpStarterKitSharedLibraryStrings] || null; } } } ================================================ FILE: source/library-starter-kit-shared/src/libraries/spStarterKitShared/loc/LocaleKeys.ts ================================================ export enum LocaleKeys { /** * Label value: "Web part configuration" */ PropertyPaneDescription = "PropertyPaneDescription", /** * Label value: "Refresh interval (in minutes)" */ RefreshInterval = "RefreshInterval", /** * Label value: "Number of followed sites to retrieve" */ NrOfFollowedItemsLabel = "NrOfFollowedItemsLabel", /** * Label value: "Specify the sort order of the retrieved sites" */ SortOrderFollowedItemsLabel = "SortOrderFollowedItemsLabel", /** * Label value: "Default" */ SortOrderDefaultLabel = "SortOrderDefaultLabel", /** * Label value: "Name" */ SortOrderNameLabel = "SortOrderNameLabel", /** * Label value: "You are not following any sites" */ NoFollowedSitesMsg = "NoFollowedSitesMsg", /** * Label value: "Filter sites by their name" */ SitesFilterLabel = "SitesFilterLabel", /** * Label value: "No corresponding sites found" */ NoFollowSitesFoundMsg = "NoFollowSitesFoundMsg", /** * Label value: "Loading followed sites" */ SitesLoading = "SitesLoading", /** * Label value: "Sorry, something went wrong retrieving your followed sites." */ SitesLoadingError = "SitesLoadingError", /** * Label value: "Configure your web part" */ BannerPlaceholderIconText = "BannerPlaceholderIconText", /** * Label value: "Please specify the banner configuration." */ BannerPlaceholderDescription = "BannerPlaceholderDescription", /** * Label value: "Configure" */ BannerPlaceholderBtnLabel = "BannerPlaceholderBtnLabel" } ================================================ FILE: source/library-starter-kit-shared/src/libraries/spStarterKitShared/loc/de-de.js ================================================ define([], function() { return { // general labels "PropertyPaneDescription": "Web Part Konfiguration", // Followed Sites Webpart "NrOfFollowedItemsLabel": "Anzahl der gefolgen Seiten zum abrufen", "SortOrderFollowedItemsLabel": "Geben Sie die Sortierreihenfolge der abgerufenen Seiten an", "SortOrderDefaultLabel": "Standard", "SortOrderNameLabel": "Name", "NoFollowedSitesMsg": "Sie folgen keiner Seite", "SitesFilterLabel": "Filterung bei Seitenname", "NoFollowSitesFoundMsg": "Keine zugehörige Seite gefunden", "SitesLoading": "Lade gefolgte Seiten", "SitesLoadingError": "Beim abruffen der gefolgten Seiten ist ein Fehler aufgetreten.", // Validation // React component strings "BannerPlaceholderIconText": "Configure your web part", "BannerPlaceholderDescription": "Please specify the banner configuration.", "BannerPlaceholderBtnLabel": "Configure" } }); ================================================ FILE: source/library-starter-kit-shared/src/libraries/spStarterKitShared/loc/en-us.js ================================================ define([], function() { return { // general labels "PropertyPaneDescription": "Web part configuration", "RefreshInterval": "Refresh interval (in minutes)", // Followed Sites Webpart "NrOfFollowedItemsLabel": "Number of followed sites to retrieve", "SortOrderFollowedItemsLabel": "Specify the sort order of the retrieved sites", "SortOrderDefaultLabel": "Default", "SortOrderNameLabel": "Name", "NoFollowedSitesMsg": "You are not following any sites", "SitesFilterLabel": "Filter sites by their name", "NoFollowSitesFoundMsg": "No corresponding sites found", "SitesLoading": "Loading followed sites", "SitesLoadingError": "Sorry, something went wrong retrieving your followed sites.", // Validation // React component strings "BannerPlaceholderIconText": "Configure your web part", "BannerPlaceholderDescription": "Please specify the banner configuration.", "BannerPlaceholderBtnLabel": "Configure" } }); ================================================ FILE: source/library-starter-kit-shared/src/libraries/spStarterKitShared/loc/es-es.js ================================================ define([], function() { return { // general labels "PropertyPaneDescription": "Configuración del elemento web", // Followed Sites Webpart "NrOfFollowedItemsLabel": "Número de sitios seguidos a retornar", "SortOrderFollowedItemsLabel": "Especifique el método de ordenacion de los sitios retornados", "SortOrderDefaultLabel": "Predeterminado", "SortOrderNameLabel": "Nombre", "NoFollowedSitesMsg": "Usted aun no sigue ningun sitio", "SitesFilterLabel": "Filtre sitios por nombre", "NoFollowSitesFoundMsg": "No se encontraron sitios que correspondan", "SitesLoading": "Cargando sitios que usted sigue", "SitesLoadingError": "Lo sentimos, algo salio mal cuando retornabamos los siios que suted sigue.", // Validation // React component strings "BannerPlaceholderIconText": "Configure your web part", "BannerPlaceholderDescription": "Please specify the banner configuration.", "BannerPlaceholderBtnLabel": "Configure" } }); ================================================ FILE: source/library-starter-kit-shared/src/libraries/spStarterKitShared/loc/fr-fr.js ================================================ define([], function() { return { // general labels "PropertyPaneDescription": "Web part configuration", // Followed Sites Webpart "NrOfFollowedItemsLabel": "Nombre de sites suivis à récupérer", "SortOrderFollowedItemsLabel": "Spécifiez l'ordre de tri des sites récupérés", "SortOrderDefaultLabel": "Défaut", "SortOrderNameLabel": "Nom", "NoFollowedSitesMsg": "Vous ne suivez aucun site", "SitesFilterLabel": "Filtrer les sites par leur nom", "NoFollowSitesFoundMsg": "Aucun site correspondant trouvé", "SitesLoading": "Chargement des sites suivis", "SitesLoadingError": "Désolé, une erreur s'est produite lors de la récupération des sites suivis.", // Validation // React component strings "BannerPlaceholderIconText": "Configure your web part", "BannerPlaceholderDescription": "Please specify the banner configuration.", "BannerPlaceholderBtnLabel": "Configure" } }); ================================================ FILE: source/library-starter-kit-shared/src/libraries/spStarterKitShared/loc/mystrings.d.ts ================================================ declare interface ISpStarterKitSharedLibraryStrings {} declare module 'SpStarterKitSharedLibraryStrings' { const strings: ISpStarterKitSharedLibraryStrings; export = strings; } ================================================ FILE: source/library-starter-kit-shared/src/libraries/spStarterKitShared/loc/nb-no.js ================================================ define([], function() { return { // general labels "PropertyPaneDescription": "Webdel konfigurasjon", // Followed Sites Webpart "NrOfFollowedItemsLabel": "Antall fulgte områder som hentes", "SortOrderFollowedItemsLabel": "Spesifiser sortering for områdene", "SortOrderDefaultLabel": "Standard", "SortOrderNameLabel": "Navn", "NoFollowedSitesMsg": "Du følger ingen områder", "SitesFilterLabel": "Filtrer områder etter navn", "NoFollowSitesFoundMsg": "Ingen områder funnet", "SitesLoading": "Laster inn fulgte områder", "SitesLoadingError": "Dessverre gikk noe galt med innlastingen av dine fulgte områder.", // Validation // React component strings "BannerPlaceholderIconText": "Configure your web part", "BannerPlaceholderDescription": "Please specify the banner configuration.", "BannerPlaceholderBtnLabel": "Configure" } }); ================================================ FILE: source/library-starter-kit-shared/src/libraries/spStarterKitShared/loc/nl-nl.js ================================================ define([], function() { return { // general labels "PropertyPaneDescription": "Webpart configuratie", // Followed Sites Webpart "NrOfFollowedItemsLabel": "Aantal gevolgde sites om op te halen", "SortOrderFollowedItemsLabel": "Specificeer de sorteringsvolgorde van de opgehaalde sites", "SortOrderDefaultLabel": "Default", "SortOrderNameLabel": "Naam", "NoFollowedSitesMsg": "Je volgt momenteel geen sites", "SitesFilterLabel": "Filter sites op naam", "NoFollowSitesFoundMsg": "Geen overeenkomstige sites gevonden", "SitesLoading": "Gevolgde sites aan het laden", "SitesLoadingError": "Sorry, er ging iets mis bij het ophalen van je gevolgde sites.", // Validation // React component strings "BannerPlaceholderIconText": "Configure your web part", "BannerPlaceholderDescription": "Please specify the banner configuration.", "BannerPlaceholderBtnLabel": "Configure" } }); ================================================ FILE: source/library-starter-kit-shared/src/libraries/spStarterKitShared/loc/sv-se.js ================================================ define([], function() { return { // general labels "PropertyPaneDescription": "Webbdelkonfiguration", // Followed Sites Webpart "NrOfFollowedItemsLabel": "Antal följda webbplatser att hämta", "SortOrderFollowedItemsLabel": "Specificera sorteringsordningen för de hämtade webbplatserna", "SortOrderDefaultLabel": "Standard", "SortOrderNameLabel": "Namn", "NoFollowedSitesMsg": "Du följer inte några webbplatser", "SitesFilterLabel": "Filtrera webbplatser efter deras namn", "NoFollowSitesFoundMsg": "Inga motsvarande webbplatser hittades", "SitesLoading": "Laddar följda webbplatser", "SitesLoadingError": "Ledsen, något gick fel med att hämta dina följda webbplatser.", // Validation // React component strings "BannerPlaceholderIconText": "Configure your web part", "BannerPlaceholderDescription": "Please specify the banner configuration.", "BannerPlaceholderBtnLabel": "Configure" } }); ================================================ FILE: source/library-starter-kit-shared/src/libraries/spStarterKitShared/loc/tr-tr.js ================================================ define([], function() { return { // general labels "PropertyPaneDescription": "Web bölümü yapılandırması", // Followed Sites Webpart "NrOfFollowedItemsLabel": "Alınacak takip edilen site sayısı", "SortOrderFollowedItemsLabel": "Alınan sitelerin sıralama düzenini belirtin", "SortOrderDefaultLabel": "Varsayılan", "SortOrderNameLabel": "İsim", "NoFollowedSitesMsg": "Hiçbir siteyi takip etmiyorsunuz", "SitesFilterLabel": "Siteleri isimlerine göre filtreleme", "NoFollowSitesFoundMsg": "İlgili site bulunamadı", "SitesLoading": "Takip edilen siteleri yüklüyor", "SitesLoadingError": "Üzgünüz, takip ettiğiniz siteleri alırken bir şeyler ters gitti.", // Validation // React component strings "BannerPlaceholderIconText": "Configure your web part", "BannerPlaceholderDescription": "Please specify the banner configuration.", "BannerPlaceholderBtnLabel": "Configure" } }); ================================================ FILE: source/library-starter-kit-shared/tsconfig.json ================================================ { "extends": "./node_modules/@microsoft/rush-stack-compiler-4.5/includes/tsconfig-web.json", "compilerOptions": { "target": "es5", "forceConsistentCasingInFileNames": true, "module": "esnext", "moduleResolution": "node", "jsx": "react", "declaration": true, "sourceMap": true, "experimentalDecorators": true, "skipLibCheck": true, "outDir": "lib", "inlineSources": false, "strictNullChecks": false, "noUnusedLocals": false, "noImplicitAny": true, "typeRoots": [ "./node_modules/@types", "./node_modules/@microsoft" ], "types": [ "webpack-env" ], "lib": [ "es5", "dom", "es2015.collection", "es2015.promise" ] }, "include": [ "src/**/*.ts", "src/**/*.tsx" ] } ================================================ FILE: source/mgt-spfx/README.md ================================================ # Microsoft Graph Toolkit SPFx Package ## Summary Certain webparts included in the Starter Kit include a dependency on the [mgt-spfx sppkg - mgt-spfx-2.2.1.sppkg](https://github.com/microsoftgraph/microsoft-graph-toolkit/releases). By default, the Starter Kit will install this sppkg to the tenant app catalog. ================================================ FILE: source/react-application-alerts/.editorconfig ================================================ # EditorConfig helps developers define and maintain consistent # coding styles between different editors and IDEs # editorconfig.org root = true [*] # change these settings to your own preference indent_style = space indent_size = 2 # we recommend you to keep these unchanged end_of_line = lf charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true [*.md] trim_trailing_whitespace = false [{package,bower}.json] indent_style = space indent_size = 2 ================================================ FILE: source/react-application-alerts/.eslintrc.js ================================================ require('@rushstack/eslint-config/patch/modern-module-resolution'); module.exports = { extends: ['@microsoft/eslint-config-spfx/lib/profiles/default'], parserOptions: { tsconfigRootDir: __dirname }, overrides: [ { files: ['*.ts', '*.tsx'], parser: '@typescript-eslint/parser', 'parserOptions': { 'project': './tsconfig.json', 'ecmaVersion': 2018, 'sourceType': 'module' }, rules: { // Prevent usage of the JavaScript null value, while allowing code to access existing APIs that may require null. https://www.npmjs.com/package/@rushstack/eslint-plugin '@rushstack/no-new-null': 1, // Require Jest module mocking APIs to be called before any other statements in their code block. https://www.npmjs.com/package/@rushstack/eslint-plugin '@rushstack/hoist-jest-mock': 1, // Require regular expressions to be constructed from string constants rather than dynamically building strings at runtime. https://www.npmjs.com/package/@rushstack/eslint-plugin-security '@rushstack/security/no-unsafe-regexp': 1, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/adjacent-overload-signatures': 1, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // // CONFIGURATION: By default, these are banned: String, Boolean, Number, Object, Symbol '@typescript-eslint/ban-types': [ 1, { 'extendDefaults': false, 'types': { 'String': { 'message': 'Use \'string\' instead', 'fixWith': 'string' }, 'Boolean': { 'message': 'Use \'boolean\' instead', 'fixWith': 'boolean' }, 'Number': { 'message': 'Use \'number\' instead', 'fixWith': 'number' }, 'Object': { 'message': 'Use \'object\' instead, or else define a proper TypeScript type:' }, 'Symbol': { 'message': 'Use \'symbol\' instead', 'fixWith': 'symbol' }, 'Function': { 'message': 'The \'Function\' type accepts any function-like value.\nIt provides no type safety when calling the function, which can be a common source of bugs.\nIt also accepts things like class declarations, which will throw at runtime as they will not be called with \'new\'.\nIf you are expecting the function to accept certain arguments, you should explicitly define the function shape.' } } } ], // RATIONALE: Code is more readable when the type of every variable is immediately obvious. // Even if the compiler may be able to infer a type, this inference will be unavailable // to a person who is reviewing a GitHub diff. This rule makes writing code harder, // but writing code is a much less important activity than reading it. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/explicit-function-return-type': [ 0, { 'allowExpressions': true, 'allowTypedFunctionExpressions': true, 'allowHigherOrderFunctions': false } ], // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // Rationale to disable: although this is a recommended rule, it is up to dev to select coding style. // Set to 1 (warning) or 2 (error) to enable. '@typescript-eslint/explicit-member-accessibility': 0, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/no-array-constructor': 1, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // // RATIONALE: The "any" keyword disables static type checking, the main benefit of using TypeScript. // This rule should be suppressed only in very special cases such as JSON.stringify() // where the type really can be anything. Even if the type is flexible, another type // may be more appropriate such as "unknown", "{}", or "Record". '@typescript-eslint/no-explicit-any': 0, // RATIONALE: The #1 rule of promises is that every promise chain must be terminated by a catch() // handler. Thus wherever a Promise arises, the code must either append a catch handler, // or else return the object to a caller (who assumes this responsibility). Unterminated // promise chains are a serious issue. Besides causing errors to be silently ignored, // they can also cause a NodeJS process to terminate unexpectedly. '@typescript-eslint/no-floating-promises': 0, // RATIONALE: Catches a common coding mistake. '@typescript-eslint/no-for-in-array': 2, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/no-misused-new': 2, // RATIONALE: The "namespace" keyword is not recommended for organizing code because JavaScript lacks // a "using" statement to traverse namespaces. Nested namespaces prevent certain bundler // optimizations. If you are declaring loose functions/variables, it's better to make them // static members of a class, since classes support property getters and their private // members are accessible by unit tests. Also, the exercise of choosing a meaningful // class name tends to produce more discoverable APIs: for example, search+replacing // the function "reverse()" is likely to return many false matches, whereas if we always // write "Text.reverse()" is more unique. For large scale organization, it's recommended // to decompose your code into separate NPM packages, which ensures that component // dependencies are tracked more conscientiously. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/no-namespace': [ 1, { 'allowDeclarations': false, 'allowDefinitionFiles': false } ], // RATIONALE: Parameter properties provide a shorthand such as "constructor(public title: string)" // that avoids the effort of declaring "title" as a field. This TypeScript feature makes // code easier to write, but arguably sacrifices readability: In the notes for // "@typescript-eslint/member-ordering" we pointed out that fields are central to // a class's design, so we wouldn't want to bury them in a constructor signature // just to save some typing. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // Set to 1 (warning) or 2 (error) to enable the rule '@typescript-eslint/no-parameter-properties': 0, // RATIONALE: When left in shipping code, unused variables often indicate a mistake. Dead code // may impact performance. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/no-unused-vars': [ 1, { 'vars': 'all', // Unused function arguments often indicate a mistake in JavaScript code. However in TypeScript code, // the compiler catches most of those mistakes, and unused arguments are fairly common for type signatures // that are overriding a base class method or implementing an interface. 'args': 'none' } ], // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/no-use-before-define': [ 2, { 'functions': false, 'classes': true, 'variables': true, 'enums': true, 'typedefs': true } ], // Disallows require statements except in import statements. // In other words, the use of forms such as var foo = require("foo") are banned. Instead use ES6 style imports or import foo = require("foo") imports. '@typescript-eslint/no-var-requires': 'error', // RATIONALE: The "module" keyword is deprecated except when describing legacy libraries. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/prefer-namespace-keyword': 1, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // Rationale to disable: it's up to developer to decide if he wants to add type annotations // Set to 1 (warning) or 2 (error) to enable the rule '@typescript-eslint/no-inferrable-types': 0, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // Rationale to disable: declaration of empty interfaces may be helpful for generic types scenarios '@typescript-eslint/no-empty-interface': 0, // RATIONALE: This rule warns if setters are defined without getters, which is probably a mistake. 'accessor-pairs': 1, // RATIONALE: In TypeScript, if you write x["y"] instead of x.y, it disables type checking. 'dot-notation': [ 1, { 'allowPattern': '^_' } ], // RATIONALE: Catches code that is likely to be incorrect 'eqeqeq': 0, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'for-direction': 1, // RATIONALE: Catches a common coding mistake. 'guard-for-in': 2, // RATIONALE: If you have more than 2,000 lines in a single source file, it's probably time // to split up your code. 'max-lines': ['warn', { max: 2000 }], // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-async-promise-executor': 2, // RATIONALE: Deprecated language feature. 'no-caller': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-compare-neg-zero': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-cond-assign': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-constant-condition': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-control-regex': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-debugger': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-delete-var': 2, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-duplicate-case': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-empty': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-empty-character-class': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-empty-pattern': 1, // RATIONALE: Eval is a security concern and a performance concern. 'no-eval': 1, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-ex-assign': 2, // RATIONALE: System types are global and should not be tampered with in a scalable code base. // If two different libraries (or two versions of the same library) both try to modify // a type, only one of them can win. Polyfills are acceptable because they implement // a standardized interoperable contract, but polyfills are generally coded in plain // JavaScript. 'no-extend-native': 1, // Disallow unnecessary labels 'no-extra-label': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-fallthrough': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-func-assign': 1, // RATIONALE: Catches a common coding mistake. 'no-implied-eval': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-invalid-regexp': 2, // RATIONALE: Catches a common coding mistake. 'no-label-var': 2, // RATIONALE: Eliminates redundant code. 'no-lone-blocks': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-misleading-character-class': 2, // RATIONALE: Catches a common coding mistake. 'no-multi-str': 2, // RATIONALE: It's generally a bad practice to call "new Thing()" without assigning the result to // a variable. Either it's part of an awkward expression like "(new Thing()).doSomething()", // or else implies that the constructor is doing nontrivial computations, which is often // a poor class design. 'no-new': 1, // RATIONALE: Obsolete language feature that is deprecated. 'no-new-func': 2, // RATIONALE: Obsolete language feature that is deprecated. 'no-new-object': 2, // RATIONALE: Obsolete notation. 'no-new-wrappers': 1, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-octal': 2, // RATIONALE: Catches code that is likely to be incorrect 'no-octal-escape': 2, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-regex-spaces': 2, // RATIONALE: Catches a common coding mistake. 'no-return-assign': 2, // RATIONALE: Security risk. 'no-script-url': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-self-assign': 2, // RATIONALE: Catches a common coding mistake. 'no-self-compare': 2, // RATIONALE: This avoids statements such as "while (a = next(), a && a.length);" that use // commas to create compound expressions. In general code is more readable if each // step is split onto a separate line. This also makes it easier to set breakpoints // in the debugger. 'no-sequences': 1, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-shadow-restricted-names': 2, // RATIONALE: Obsolete language feature that is deprecated. // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-sparse-arrays': 2, // RATIONALE: Although in theory JavaScript allows any possible data type to be thrown as an exception, // such flexibility adds pointless complexity, by requiring every catch block to test // the type of the object that it receives. Whereas if catch blocks can always assume // that their object implements the "Error" contract, then the code is simpler, and // we generally get useful additional information like a call stack. 'no-throw-literal': 2, // RATIONALE: Catches a common coding mistake. 'no-unmodified-loop-condition': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-unsafe-finally': 2, // RATIONALE: Catches a common coding mistake. 'no-unused-expressions': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-unused-labels': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-useless-catch': 1, // RATIONALE: Avoids a potential performance problem. 'no-useless-concat': 1, // RATIONALE: The "var" keyword is deprecated because of its confusing "hoisting" behavior. // Always use "let" or "const" instead. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json 'no-var': 2, // RATIONALE: Generally not needed in modern code. 'no-void': 1, // RATIONALE: Obsolete language feature that is deprecated. // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-with': 2, // RATIONALE: Makes logic easier to understand, since constants always have a known value // @typescript-eslint\eslint-plugin\dist\configs\eslint-recommended.js 'prefer-const': 0, // RATIONALE: Catches a common coding mistake where "resolve" and "reject" are confused. 'promise/param-names': 2, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'require-atomic-updates': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'require-yield': 1, // "Use strict" is redundant when using the TypeScript compiler. 'strict': [ 2, 'never' ], // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'use-isnan': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js // Set to 1 (warning) or 2 (error) to enable. // Rationale to disable: !!{} 'no-extra-boolean-cast': 0, // ==================================================================== // @microsoft/eslint-plugin-spfx // ==================================================================== '@microsoft/spfx/import-requires-chunk-name': 1, '@microsoft/spfx/no-require-ensure': 2, '@microsoft/spfx/pair-react-dom-render-unmount': 0, // ==================================================================== // no-useless-escape // ==================================================================== 'no-useless-escape': 0 } }, { // For unit tests, we can be a little bit less strict. The settings below revise the // defaults specified in the extended configurations, as well as above. files: [ // Test files '*.test.ts', '*.test.tsx', '*.spec.ts', '*.spec.tsx', // Facebook convention '**/__mocks__/*.ts', '**/__mocks__/*.tsx', '**/__tests__/*.ts', '**/__tests__/*.tsx', // Microsoft convention '**/test/*.ts', '**/test/*.tsx' ], rules: {} } ] }; ================================================ FILE: source/react-application-alerts/.gitignore ================================================ # Logs logs *.log npm-debug.log* # Dependency directories node_modules # Build generated files dist lib release solution temp *.sppkg .heft # Coverage directory used by tools like istanbul coverage # OSX .DS_Store # Visual Studio files .ntvs_analysis.dat .vs bin obj # Resx Generated Code *.resx.ts # Styles Generated Code *.scss.ts ================================================ FILE: source/react-application-alerts/.npmignore ================================================ !dist config gulpfile.js release src temp tsconfig.json tslint.json *.log .yo-rc.json .vscode ================================================ FILE: source/react-application-alerts/.vscode/launch.json ================================================ { "version": "0.2.0", "configurations": [ { "name": "Hosted workbench", "type": "pwa-chrome", "request": "launch", "url": "https://enter-your-SharePoint-site/_layouts/workbench.aspx", "webRoot": "${workspaceRoot}", "sourceMaps": true, "sourceMapPathOverrides": { "webpack:///.././src/*": "${webRoot}/src/*", "webpack:///../../../src/*": "${webRoot}/src/*", "webpack:///../../../../src/*": "${webRoot}/src/*", "webpack:///../../../../../src/*": "${webRoot}/src/*" }, "runtimeArgs": [ "--remote-debugging-port=9222", "-incognito" ] } ] } ================================================ FILE: source/react-application-alerts/.vscode/settings.json ================================================ // Place your settings in this file to overwrite default and user settings. { // Configure glob patterns for excluding files and folders in the file explorer. "files.exclude": { "**/.git": true, "**/.DS_Store": true, "**/bower_components": true, "**/coverage": true, "**/lib-amd": true, "src/**/*.scss.ts": true }, "typescript.tsdk": ".\\node_modules\\typescript\\lib" } ================================================ FILE: source/react-application-alerts/.yo-rc.json ================================================ { "@microsoft/generator-sharepoint": { "plusBeta": false, "isCreatingSolution": true, "nodeVersion": "16.19.0", "sdksVersions": { "@microsoft/microsoft-graph-client": "3.0.2", "@microsoft/teams-js": "2.4.1" }, "version": "1.16.1", "environment": "spo", "libraryName": "react-application-alerts", "libraryId": "bc996340-c1e8-488d-9d62-ebd5293617fd", "packageManager": "npm", "componentType": "extension", "extensionType": "ApplicationCustomizer", "isDomainIsolated": false } } ================================================ FILE: source/react-application-alerts/README.md ================================================ # Alerts Application Customizers This application customizer provides you the ability to show notifications on content pages in the top / header area within a hub site and its associated sites. The notifications that are to be displayed are administered via a SharePoint list named "Alerts" that is hosted by a hub site. The "Alerts" list within a hub site supports the hub site and all sites associated with the hub site that have activated the Alerts application customizer. The default SP Starter Kit installation process will automatically provision the "Alerts" list including a custom content type, "PnP Alert" to the hub site. The hub site and associated collaboration sites provisioned by the starter kit will also have the Alert application customizer extension automatically activated. New sites added to the hub that wish to include the Alert application customizer will need to activate the extension via a site script, PnP PowerShell, or PnP cli. > This extension will only work for hub sites or sites that are associated with a hub site. ![Alert](../../assets/images/components/ext-alert.gif) > Screenshot is from the v1 version. ## Alert list details This extension is dependent on a explicit `Alerts` list that must be located in a hub site to which current site collection is associated. If site collection is the actual hub site, alerts list has to exist in the root of that site collection. | Display Name | Name | Type | Required | Description | | ---- | ---- | ---- | ---- | ---- | | Alert type | PnPAlertType | choice | yes | Type of Alert to display. Urgent = Red. Information = Yellow. | | Alert message | PnPAlertMessage | string | yes | The message you want to display in the alert | | Start date-time | PnPAlertStartDateTime | date time | yes | The Date/Time the alert should show in the header placeholder | | End date-time | PnPAlertEndDateTime | date time | yes | The Date/Time the alert stops showing in the header placeholder | | More information link | PnPAlertMoreInformation | URL | no | Provides a clickable link at the end of the alert message | > Notice that in default SharePoint Starter Kit installation this list is automatically provisioned on the hub site in the case of SharePoint Online solution. Original v1 implementation located at https://github.com/SharePoint/sp-starter-kit/blob/master/documentation/components/ext-alert.md In the v2 release, this extension has been repackaged as its own solution to provide more flexibility from deployment perspective. ## Installing the extension See getting started from [SP-Starter-Kit repository readme](https://github.com/pnp/sp-starter-kit) for basic installation of the SP Starter Kit which includes installing the proper list, "Alerts" to the hub site, installation the application customizer's sppkg to the tenant app catalog, and activating the extension on the hub site and associated team sites. You can also download just the [extension (sppkg) file](./sharepoint/solution/react-application-alerts.sppkg) and install that to your tenant's app catalog. This extension does not have external dependencies. This extension does require the 'Alerts' list be available in the root of the hub site with the proper site columns as specified in [Alert list details](#Alert-list-details). > As this is a SharePoint Framework extension, you will need to explicitly enable this extension in a site using CSOM, REST APIs, PnP PowerShell, or PnP cli. **A common approach to activate the extention on a given site connection is to use PnP PowerShell commandlets:** ```powershell Connect-PnPOnline https://contosodemosk.sharepoint.com/sites/site-to-configure Add-PnPCustomAction -Name "HubOrSiteAlertsApplicationCustomizer" -Title "HubOrSiteAlertsApplicationCustomizer" -ClientSideComponentId 29df5d8b-1d9b-4d32-971c-d66162396ed3 -Location "ClientSideExtension.ApplicationCustomizer" -ClientSideComponentProperties "{}" -Scope Site ``` > Set the full url and path of the Connect-PnPOnline commandlet to fit your specific tenant / site ## Screenshots ![Alert](../../assets/images/components/ext-alert.png) ## Used SharePoint Framework Version ![drop](https://img.shields.io/badge/version-1.16.1-green.svg) * Supported in SharePoint Online ## Applies to * [SharePoint Framework](https://learn.microsoft.com/en-us/sharepoint/dev/spfx/sharepoint-framework-overview) * [Office 365 tenant](https://learn.microsoft.com/en-us/sharepoint/dev/spfx/set-up-your-development-environment) ## Prerequisites Alert is is created automatically to the root of the site collection if it's missing where the extension is executed. This requires that the person using the extension will have sufficient permissions. If permissions are missing, then application customizer will not render anything. ## Solution Solution|Author(s) --------|--------- folder name | Author details ./solution/src/extensions/alertNotification | Waldek Mastykarz @waldekm ./source/react-application-alerts | Robert Schouten @rfjschouten ./source/react-application-alerts | Chandani Prajapati @Chandani_SPD ## Version history Version|Date|Comments -------|----|-------- 1.0|Appril 1, 2018|Initial release for SharePoint Starter Kit v1 2.0|December 25, 2019|Initial release for SharePoint Starter Kit v2 3.0|February 2023|Initial release for SharePoint Starter Kit v3 ## Disclaimer **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.** --- ## Minimal Path to Awesome * Clone this repository * Move to correct folder where solution exists * in the command line run: * `npm install` * `gulp serve` ## Features Key features demostrated by this solution: * PnPjs usage in the solution * Dynamic creation of the list if it's missing * SPFx application customizer that includes a header driven by a SharePoint list ================================================ FILE: source/react-application-alerts/config/config.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/config.2.0.schema.json", "version": "2.0", "bundles": { "hub-or-site-alerts-application-customizer": { "components": [ { "entrypoint": "./lib/extensions/hubOrSiteAlerts/HubOrSiteAlertsApplicationCustomizer.js", "manifest": "./src/extensions/hubOrSiteAlerts/HubOrSiteAlertsApplicationCustomizer.manifest.json" } ] } }, "externals": {}, "localizedResources": { "HubOrSiteAlertsApplicationCustomizerStrings": "lib/extensions/hubOrSiteAlerts/loc/{locale}.js" } } ================================================ FILE: source/react-application-alerts/config/deploy-azure-storage.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/deploy-azure-storage.schema.json", "workingDir": "./release/assets/", "account": "", "container": "react-application-alerts", "accessKey": "" } ================================================ FILE: source/react-application-alerts/config/package-solution.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/package-solution.schema.json", "solution": { "name": "Starter Kit - Alerts", "id": "bc996340-c1e8-488d-9d62-ebd5293617fd", "version": "3.0.0.0", "includeClientSideAssets": true, "skipFeatureDeployment": true, "isDomainIsolated": false, "developer": { "name": "PnP Starter Kit", "websiteUrl": "", "privacyUrl": "", "termsOfUseUrl": "", "mpnId": "pnpsk" }, "metadata": { "shortDescription": { "default": "react-application-alerts description" }, "longDescription": { "default": "react-application-alerts description" }, "screenshotPaths": [], "videoUrl": "", "categories": [] }, "features": [ { "title": "Application Extension - Starter Kit - Alerts - Deployment of custom action.", "description": "Deploys a custom action within Starter Kit - Alerts", "id": "f15797fb-d6a8-4359-86fa-895111433c04", "version": "3.0.0.0", "assets": { "elementManifests": [ "elements.xml" ] } } ] }, "paths": { "zippedPackage": "solution/react-application-alerts.sppkg" } } ================================================ FILE: source/react-application-alerts/config/sass.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/core-build/sass.schema.json" } ================================================ FILE: source/react-application-alerts/config/serve.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/spfx-serve.schema.json", "port": 4321, "https": true, "serveConfigurations": { "default": { "pageUrl": "https://pmspkit02.sharepoint.com/sites/uatMarketing/SitePages/World-Clock-1.16.1.aspx", "customActions": { "29df5d8b-1d9b-4d32-971c-d66162396ed3": { "location": "ClientSideExtension.ApplicationCustomizer", "properties": { "testMessage": "Test message" } } } }, "hubOrSiteAlerts": { "pageUrl": "https://pmspkit02.sharepoint.com/sites/uatMarketing/SitePages/World-Clock-1.16.1.aspx", "customActions": { "29df5d8b-1d9b-4d32-971c-d66162396ed3": { "location": "ClientSideExtension.ApplicationCustomizer", "properties": { "testMessage": "Test message" } } } } } } ================================================ FILE: source/react-application-alerts/config/write-manifests.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/write-manifests.schema.json", "cdnBasePath": "" } ================================================ FILE: source/react-application-alerts/gulpfile.js ================================================ 'use strict'; const build = require('@microsoft/sp-build-web'); build.addSuppression(`Warning - [sass] The local CSS class 'ms-Grid' is not camelCase and will not be type-safe.`); var getTasks = build.rig.getTasks; build.rig.getTasks = function () { var result = getTasks.call(build.rig); result.set('serve', result.get('serve-deprecated')); return result; }; build.initialize(require('gulp')); ================================================ FILE: source/react-application-alerts/package.json ================================================ { "name": "react-application-alerts", "version": "3.0.0", "private": true, "main": "lib/index.js", "engines": { "node": ">=16.13.0 <17.0.0" }, "scripts": { "build": "gulp bundle", "clean": "gulp clean", "test": "gulp test" }, "dependencies": { "@microsoft/decorators": "1.16.1", "@microsoft/sp-application-base": "1.16.1", "@microsoft/sp-core-library": "1.16.1", "@microsoft/sp-dialog": "1.16.1", "@microsoft/sp-office-ui-fabric-core": "1.16.1", "@microsoft/sp-webpart-base": "1.16.1", "react": "17.0.1", "react-dom": "17.0.1", "tslib": "2.3.1" }, "resolutions": { "@types/react": "16.8.8" }, "devDependencies": { "@microsoft/eslint-config-spfx": "1.16.1", "@microsoft/eslint-plugin-spfx": "1.16.1", "@microsoft/rush-stack-compiler-4.5": "0.2.2", "@microsoft/sp-build-web": "1.16.1", "@microsoft/sp-module-interfaces": "1.16.1", "@microsoft/sp-tslint-rules": "1.14.0", "@rushstack/eslint-config": "2.5.1", "@types/es6-promise": "0.0.33 ", "@types/react": "17.0.45", "@types/react-dom": "17.0.17", "@types/webpack-env": "1.15.2", "ajv": "6.12.5", "eslint": "8.7.0", "eslint-plugin-react-hooks": "4.3.0", "gulp": "4.0.2", "tslint-microsoft-contrib": "5.0.0", "typescript": "4.5.5" } } ================================================ FILE: source/react-application-alerts/sharepoint/assets/ClientSideInstance.xml ================================================ ================================================ FILE: source/react-application-alerts/sharepoint/assets/elements.xml ================================================ ================================================ FILE: source/react-application-alerts/src/extensions/hubOrSiteAlerts/HubOrSiteAlertsApplicationCustomizer.manifest.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx/client-side-extension-manifest.schema.json", "id": "29df5d8b-1d9b-4d32-971c-d66162396ed3", "alias": "HubOrSiteAlertsApplicationCustomizer", "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 } ================================================ FILE: source/react-application-alerts/src/extensions/hubOrSiteAlerts/HubOrSiteAlertsApplicationCustomizer.ts ================================================ import { override } from '@microsoft/decorators'; import { BaseApplicationCustomizer, PlaceholderContent, PlaceholderName } from '@microsoft/sp-application-base'; import { IHubSiteData, IHubSiteDataResponse } from './IHubSiteData'; import { SPHttpClientResponse, SPHttpClient } from '@microsoft/sp-http'; import { IAlert, IAlertItem, AlertType } from './IAlert'; import * as React from 'react'; import * as ReactDom from 'react-dom'; import { IAlertNotificationsProps, AlertNotifications } from './components'; /** * 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 IHubOrSiteAlertsApplicationCustomizerProperties { } /** A Custom Action which can be run during execution of a Client Side Application */ export default class HubOrSiteAlertsApplicationCustomizer extends BaseApplicationCustomizer { private static _topPlaceholder?: PlaceholderContent; /** * Constant used to exit the chain of promises when the current site * is not connected to a hub site and is not a hub site itself. */ private static readonly NO_HUBSITE_DATA: string = 'NO_HUBSITE_DATA'; @override public onInit(): Promise { // add handler to he page navigated event which occurs both when // the user opens and leaves the page this.context.application.navigatedEvent.add(this, this._render); return Promise.resolve(); } private _handleDispose(): void { console.log('[HubOrSiteAlertsApplicationCustomizer._onDispose] Disposed custom top placeholder.'); } /** * Retrieves information about the hub site to which the current site is connected. * If the current site is a hub site itself, returns information about the current * hub site. * If the is not connected to a hub sites, returns null; */ private _getConnectedHubSiteData(): Promise { // tslint:disable-next-line: no-any max-line-length return new Promise((resolve: (connectedHubSiteData: IHubSiteData) => void, reject: (error: any) => void): void => { // suppress loading metadata to minimize the amount of data sent over the network const headers: Headers = new Headers(); headers.append('accept', 'application/json;odata.metadata=none'); this.context.spHttpClient .get(`${this.context.pageContext.web.absoluteUrl}/_api/web/hubsitedata`, SPHttpClient.configurations.v1, { headers: headers }) .then((res: SPHttpClientResponse): Promise => { return res.json(); }) .then((res: IHubSiteDataResponse): void => { // the site is not connected to a hub site and is not a hub site itself if (res['@odata.null'] === true) { resolve(undefined); return; } try { // parse the hub site data from the value property to JSON const hubSiteData: IHubSiteData = JSON.parse(res.value); resolve(hubSiteData); } catch (e) { reject(e); } }) .catch((error): void => { reject(error); }); }); } /** * Loads upcoming alerts from the Alerts list located in the hub site * @param hubSiteUrl URL of the hub site to which the current site is connected */ private _loadUpcomingAlerts(hubSiteUrl: string): Promise { // tslint:disable-next-line: no-any max-line-length return new Promise((resolve: (upcomingAlerts: IAlert[]) => void, reject: (error: any) => void): void => { // suppress loading metadata to minimize the amount of data sent over the network const headers: Headers = new Headers(); headers.append('accept', 'application/json;odata.metadata=none'); // current date in the ISO format used to retrieve active alerts const nowString: string = new Date().toISOString(); // from the Alerts list in the hub site, load the list of upcoming alerts sorted // ascending by their end time so that alerts that expire first, are shown on top this.context.spHttpClient .get(hubSiteUrl + `/_api/web/GetList('${hubSiteUrl.replace(window.location.origin,"")}/Lists/Alerts')/items?` + '$filter=PnPAlertStartDateTime le datetime\'' + nowString + '\' ' + 'and PnPAlertEndDateTime ge datetime\'' + nowString + '\' ' + '&$select=PnPAlertType,PnPAlertMessage,PnPAlertMoreInformation&$orderby=PnPAlertEndDateTime', SPHttpClient.configurations.v1, { headers: headers }) .then((res: SPHttpClientResponse): Promise<{ value: IAlertItem[] }> => { return res.json(); }) .then((res: { value: IAlertItem[] }): void => { // change the alert list item to alert object const upcomingAlerts: IAlert[] = res.value.map(alert => { return { type: AlertType[alert.PnPAlertType], message: alert.PnPAlertMessage, moreInformationUrl: alert.PnPAlertMoreInformation ? alert.PnPAlertMoreInformation.Url : undefined }; }); resolve(upcomingAlerts); }) // tslint:disable-next-line: no-any .catch((error: any): void => { reject(error); }); }); } private _render(): void { // check if the application customizer has already been rendered if (!HubOrSiteAlertsApplicationCustomizer._topPlaceholder) { // create a DOM element in the top placeholder for the application customizer // to render HubOrSiteAlertsApplicationCustomizer._topPlaceholder = this.context.placeholderProvider .tryCreateContent(PlaceholderName.Top, { onDispose: this._handleDispose }); } // if the top placeholder is not available, there is no place in the UI // for the app customizer to render, so quit. if (!HubOrSiteAlertsApplicationCustomizer._topPlaceholder) { return; } this ._getConnectedHubSiteData() .then((connectedHubSiteData: IHubSiteData): Promise => { if (!connectedHubSiteData || connectedHubSiteData === undefined) { // Current site is not connected to a hub site and is not a hub site // itself. Exit the promise chain by rejecting the promise with a known // error code. return Promise.reject(HubOrSiteAlertsApplicationCustomizer.NO_HUBSITE_DATA); } return this._loadUpcomingAlerts(connectedHubSiteData.url); }) .then((upcomingAlerts: IAlert[]): void => { if (upcomingAlerts.length === 0) { console.log('No upcoming alerts found'); return; } const element: React.ReactElement = React.createElement( AlertNotifications, { alerts: upcomingAlerts } ); // render the UI using a React component ReactDom.render(element, HubOrSiteAlertsApplicationCustomizer._topPlaceholder.domElement); }) // tslint:disable-next-line: no-any .catch((error: any): void => { if (error === HubOrSiteAlertsApplicationCustomizer.NO_HUBSITE_DATA) { console.log(`Current site is not connected to a hub site and is not a hub site itself. Skipping loading alerts`); } else { console.error(error); } }); } } ================================================ FILE: source/react-application-alerts/src/extensions/hubOrSiteAlerts/IAlert.ts ================================================ /** * Interface that represents an alert item */ export interface IAlert { message: string; moreInformationUrl: string; type: AlertType; } export enum AlertType { Information = 1, Urgent } /** * Interface that represents a list item with alert information */ export interface IAlertItem { PnPAlertEndDateTime: string; PnPAlertMessage: string; PnPAlertMoreInformation: { Description: string; Url: string; }; PnPAlertStartDateTime: string; PnPAlertType: string; } ================================================ FILE: source/react-application-alerts/src/extensions/hubOrSiteAlerts/IHubSiteData.ts ================================================ export interface IHubSiteData { logoUrl: string; name: string; // tslint:disable-next-line: no-any navigation: any[]; themeKey: string; url: string; usesMetadataNavigation: boolean; } export interface IHubSiteDataResponse { '@odata.null'?: boolean; value?: string; } ================================================ FILE: source/react-application-alerts/src/extensions/hubOrSiteAlerts/components/AlertNotifications.tsx ================================================ import * as React from 'react'; import { IAlertNotificationsProps } from '.'; import * as strings from 'HubOrSiteAlertsApplicationCustomizerStrings'; import { MessageBar, MessageBarType } from '@fluentui/react/lib/MessageBar'; import { AlertType } from '../IAlert'; export class AlertNotifications extends React.Component { public render(): React.ReactElement { return (
{this.props.alerts.map(alert => {alert.message} {alert.moreInformationUrl ? {strings.MoreInformation} : ''} )}
); } } ================================================ FILE: source/react-application-alerts/src/extensions/hubOrSiteAlerts/components/IAlertNotificationsProps.ts ================================================ import { IAlert } from '../IAlert'; export interface IAlertNotificationsProps { alerts: IAlert[]; } ================================================ FILE: source/react-application-alerts/src/extensions/hubOrSiteAlerts/components/index.ts ================================================ export * from './IAlertNotificationsProps'; export * from './AlertNotifications'; ================================================ FILE: source/react-application-alerts/src/extensions/hubOrSiteAlerts/loc/de-de.js ================================================ define([], function() { return { "MoreInformation": "Mehr Informationen" } }); ================================================ FILE: source/react-application-alerts/src/extensions/hubOrSiteAlerts/loc/en-us.js ================================================ define([], function() { return { "MoreInformation": "More information" } }); ================================================ FILE: source/react-application-alerts/src/extensions/hubOrSiteAlerts/loc/es-es.js ================================================ define([], function() { return { "MoreInformation": "Más información" } }); ================================================ FILE: source/react-application-alerts/src/extensions/hubOrSiteAlerts/loc/fr-fr.js ================================================ define([], function() { return { "MoreInformation": "Plus d'information" } }); ================================================ FILE: source/react-application-alerts/src/extensions/hubOrSiteAlerts/loc/myStrings.d.ts ================================================ declare interface IHubOrSiteAlertsApplicationCustomizerStrings { MoreInformation: string; } declare module 'HubOrSiteAlertsApplicationCustomizerStrings' { const strings: IHubOrSiteAlertsApplicationCustomizerStrings; export = strings; } ================================================ FILE: source/react-application-alerts/src/extensions/hubOrSiteAlerts/loc/nb-no.js ================================================ define([], function() { return { "MoreInformation": "Mer informasjon" } }); ================================================ FILE: source/react-application-alerts/src/extensions/hubOrSiteAlerts/loc/nl-nl.js ================================================ define([], function() { return { "MoreInformation": "Meer informatie" } }); ================================================ FILE: source/react-application-alerts/src/extensions/hubOrSiteAlerts/loc/sv-se.js ================================================ define([], function() { return { "MoreInformation": "Mer information" } }); ================================================ FILE: source/react-application-alerts/src/extensions/hubOrSiteAlerts/loc/tr-tr.js ================================================ define([], function() { return { "MoreInformation": "Daha fazla bilgi" } }); ================================================ FILE: source/react-application-alerts/src/index.ts ================================================ // A file is required to be in the root of the /src directory by the TypeScript compiler ================================================ FILE: source/react-application-alerts/tsconfig.json ================================================ { "extends": "./node_modules/@microsoft/rush-stack-compiler-4.5/includes/tsconfig-web.json", "compilerOptions": { "target": "es5", "forceConsistentCasingInFileNames": true, "module": "esnext", "moduleResolution": "node", "jsx": "react", "declaration": true, "sourceMap": true, "experimentalDecorators": true, "skipLibCheck": true, "outDir": "lib", "inlineSources": false, "strictNullChecks": false, "noImplicitAny": false, "typeRoots": [ "./node_modules/@types", "./node_modules/@microsoft" ], "types": [ "webpack-env" ], "lib": [ "es5", "dom", "es2015.collection", "es2015.promise" ] }, "include": [ "src/**/*.ts", "src/**/*.tsx" ] } ================================================ FILE: source/react-application-collab-footer/.editorconfig ================================================ # EditorConfig helps developers define and maintain consistent # coding styles between different editors and IDEs # editorconfig.org root = true [*] # change these settings to your own preference indent_style = space indent_size = 2 # we recommend you to keep these unchanged end_of_line = lf charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true [*.md] trim_trailing_whitespace = false [{package,bower}.json] indent_style = space indent_size = 2 ================================================ FILE: source/react-application-collab-footer/.eslintrc.js ================================================ require('@rushstack/eslint-config/patch/modern-module-resolution'); module.exports = { extends: ['@microsoft/eslint-config-spfx/lib/profiles/react'], parserOptions: { tsconfigRootDir: __dirname }, overrides: [ { files: ['*.ts', '*.tsx'], parser: '@typescript-eslint/parser', 'parserOptions': { 'project': './tsconfig.json', 'ecmaVersion': 2018, 'sourceType': 'module' }, rules: { // Prevent usage of the JavaScript null value, while allowing code to access existing APIs that may require null. https://www.npmjs.com/package/@rushstack/eslint-plugin '@rushstack/no-new-null': 1, // Require Jest module mocking APIs to be called before any other statements in their code block. https://www.npmjs.com/package/@rushstack/eslint-plugin '@rushstack/hoist-jest-mock': 1, // Require regular expressions to be constructed from string constants rather than dynamically building strings at runtime. https://www.npmjs.com/package/@rushstack/eslint-plugin-security '@rushstack/security/no-unsafe-regexp': 1, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/adjacent-overload-signatures': 1, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // // CONFIGURATION: By default, these are banned: String, Boolean, Number, Object, Symbol '@typescript-eslint/ban-types': [ 1, { 'extendDefaults': false, 'types': { 'String': { 'message': 'Use \'string\' instead', 'fixWith': 'string' }, 'Boolean': { 'message': 'Use \'boolean\' instead', 'fixWith': 'boolean' }, 'Number': { 'message': 'Use \'number\' instead', 'fixWith': 'number' }, 'Object': { 'message': 'Use \'object\' instead, or else define a proper TypeScript type:' }, 'Symbol': { 'message': 'Use \'symbol\' instead', 'fixWith': 'symbol' }, 'Function': { 'message': 'The \'Function\' type accepts any function-like value.\nIt provides no type safety when calling the function, which can be a common source of bugs.\nIt also accepts things like class declarations, which will throw at runtime as they will not be called with \'new\'.\nIf you are expecting the function to accept certain arguments, you should explicitly define the function shape.' } } } ], // RATIONALE: Code is more readable when the type of every variable is immediately obvious. // Even if the compiler may be able to infer a type, this inference will be unavailable // to a person who is reviewing a GitHub diff. This rule makes writing code harder, // but writing code is a much less important activity than reading it. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/explicit-function-return-type': [ 0, { 'allowExpressions': true, 'allowTypedFunctionExpressions': true, 'allowHigherOrderFunctions': false } ], // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // Rationale to disable: although this is a recommended rule, it is up to dev to select coding style. // Set to 1 (warning) or 2 (error) to enable. '@typescript-eslint/explicit-member-accessibility': 0, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/no-array-constructor': 1, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // // RATIONALE: The "any" keyword disables static type checking, the main benefit of using TypeScript. // This rule should be suppressed only in very special cases such as JSON.stringify() // where the type really can be anything. Even if the type is flexible, another type // may be more appropriate such as "unknown", "{}", or "Record". '@typescript-eslint/no-explicit-any': 0, // RATIONALE: The #1 rule of promises is that every promise chain must be terminated by a catch() // handler. Thus wherever a Promise arises, the code must either append a catch handler, // or else return the object to a caller (who assumes this responsibility). Unterminated // promise chains are a serious issue. Besides causing errors to be silently ignored, // they can also cause a NodeJS process to terminate unexpectedly. '@typescript-eslint/no-floating-promises': 0, // RATIONALE: Catches a common coding mistake. '@typescript-eslint/no-for-in-array': 2, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/no-misused-new': 2, // RATIONALE: The "namespace" keyword is not recommended for organizing code because JavaScript lacks // a "using" statement to traverse namespaces. Nested namespaces prevent certain bundler // optimizations. If you are declaring loose functions/variables, it's better to make them // static members of a class, since classes support property getters and their private // members are accessible by unit tests. Also, the exercise of choosing a meaningful // class name tends to produce more discoverable APIs: for example, search+replacing // the function "reverse()" is likely to return many false matches, whereas if we always // write "Text.reverse()" is more unique. For large scale organization, it's recommended // to decompose your code into separate NPM packages, which ensures that component // dependencies are tracked more conscientiously. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/no-namespace': [ 1, { 'allowDeclarations': false, 'allowDefinitionFiles': false } ], // RATIONALE: Parameter properties provide a shorthand such as "constructor(public title: string)" // that avoids the effort of declaring "title" as a field. This TypeScript feature makes // code easier to write, but arguably sacrifices readability: In the notes for // "@typescript-eslint/member-ordering" we pointed out that fields are central to // a class's design, so we wouldn't want to bury them in a constructor signature // just to save some typing. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // Set to 1 (warning) or 2 (error) to enable the rule '@typescript-eslint/no-parameter-properties': 0, // RATIONALE: When left in shipping code, unused variables often indicate a mistake. Dead code // may impact performance. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/no-unused-vars': [ 1, { 'vars': 'all', // Unused function arguments often indicate a mistake in JavaScript code. However in TypeScript code, // the compiler catches most of those mistakes, and unused arguments are fairly common for type signatures // that are overriding a base class method or implementing an interface. 'args': 'none' } ], // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/no-use-before-define': [ 2, { 'functions': false, 'classes': true, 'variables': true, 'enums': true, 'typedefs': true } ], // Disallows require statements except in import statements. // In other words, the use of forms such as var foo = require("foo") are banned. Instead use ES6 style imports or import foo = require("foo") imports. '@typescript-eslint/no-var-requires': 'error', // RATIONALE: The "module" keyword is deprecated except when describing legacy libraries. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/prefer-namespace-keyword': 1, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // Rationale to disable: it's up to developer to decide if he wants to add type annotations // Set to 1 (warning) or 2 (error) to enable the rule '@typescript-eslint/no-inferrable-types': 0, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // Rationale to disable: declaration of empty interfaces may be helpful for generic types scenarios '@typescript-eslint/no-empty-interface': 0, // RATIONALE: This rule warns if setters are defined without getters, which is probably a mistake. 'accessor-pairs': 1, // RATIONALE: In TypeScript, if you write x["y"] instead of x.y, it disables type checking. 'dot-notation': [ 1, { 'allowPattern': '^_' } ], // RATIONALE: Catches code that is likely to be incorrect 'eqeqeq': 0, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'for-direction': 1, // RATIONALE: Catches a common coding mistake. 'guard-for-in': 2, // RATIONALE: If you have more than 2,000 lines in a single source file, it's probably time // to split up your code. 'max-lines': ['warn', { max: 2000 }], // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-async-promise-executor': 2, // RATIONALE: Deprecated language feature. 'no-caller': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-compare-neg-zero': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-cond-assign': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-constant-condition': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-control-regex': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-debugger': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-delete-var': 2, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-duplicate-case': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-empty': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-empty-character-class': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-empty-pattern': 1, // RATIONALE: Eval is a security concern and a performance concern. 'no-eval': 1, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-ex-assign': 2, // RATIONALE: System types are global and should not be tampered with in a scalable code base. // If two different libraries (or two versions of the same library) both try to modify // a type, only one of them can win. Polyfills are acceptable because they implement // a standardized interoperable contract, but polyfills are generally coded in plain // JavaScript. 'no-extend-native': 1, // Disallow unnecessary labels 'no-extra-label': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-fallthrough': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-func-assign': 1, // RATIONALE: Catches a common coding mistake. 'no-implied-eval': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-invalid-regexp': 2, // RATIONALE: Catches a common coding mistake. 'no-label-var': 2, // RATIONALE: Eliminates redundant code. 'no-lone-blocks': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-misleading-character-class': 2, // RATIONALE: Catches a common coding mistake. 'no-multi-str': 2, // RATIONALE: It's generally a bad practice to call "new Thing()" without assigning the result to // a variable. Either it's part of an awkward expression like "(new Thing()).doSomething()", // or else implies that the constructor is doing nontrivial computations, which is often // a poor class design. 'no-new': 1, // RATIONALE: Obsolete language feature that is deprecated. 'no-new-func': 2, // RATIONALE: Obsolete language feature that is deprecated. 'no-new-object': 2, // RATIONALE: Obsolete notation. 'no-new-wrappers': 1, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-octal': 2, // RATIONALE: Catches code that is likely to be incorrect 'no-octal-escape': 2, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-regex-spaces': 2, // RATIONALE: Catches a common coding mistake. 'no-return-assign': 2, // RATIONALE: Security risk. 'no-script-url': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-self-assign': 2, // RATIONALE: Catches a common coding mistake. 'no-self-compare': 2, // RATIONALE: This avoids statements such as "while (a = next(), a && a.length);" that use // commas to create compound expressions. In general code is more readable if each // step is split onto a separate line. This also makes it easier to set breakpoints // in the debugger. 'no-sequences': 1, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-shadow-restricted-names': 2, // RATIONALE: Obsolete language feature that is deprecated. // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-sparse-arrays': 2, // RATIONALE: Although in theory JavaScript allows any possible data type to be thrown as an exception, // such flexibility adds pointless complexity, by requiring every catch block to test // the type of the object that it receives. Whereas if catch blocks can always assume // that their object implements the "Error" contract, then the code is simpler, and // we generally get useful additional information like a call stack. 'no-throw-literal': 2, // RATIONALE: Catches a common coding mistake. 'no-unmodified-loop-condition': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-unsafe-finally': 2, // RATIONALE: Catches a common coding mistake. 'no-unused-expressions': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-unused-labels': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-useless-catch': 1, // RATIONALE: Avoids a potential performance problem. 'no-useless-concat': 1, // RATIONALE: The "var" keyword is deprecated because of its confusing "hoisting" behavior. // Always use "let" or "const" instead. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json 'no-var': 2, // RATIONALE: Generally not needed in modern code. 'no-void': 1, // RATIONALE: Obsolete language feature that is deprecated. // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-with': 2, // RATIONALE: Makes logic easier to understand, since constants always have a known value // @typescript-eslint\eslint-plugin\dist\configs\eslint-recommended.js 'prefer-const': 0, // RATIONALE: Catches a common coding mistake where "resolve" and "reject" are confused. 'promise/param-names': 2, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'require-atomic-updates': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'require-yield': 1, // "Use strict" is redundant when using the TypeScript compiler. 'strict': [ 2, 'never' ], // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'use-isnan': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js // Set to 1 (warning) or 2 (error) to enable. // Rationale to disable: !!{} 'no-extra-boolean-cast': 0, // ==================================================================== // @microsoft/eslint-plugin-spfx // ==================================================================== '@microsoft/spfx/import-requires-chunk-name': 1, '@microsoft/spfx/no-require-ensure': 2, '@microsoft/spfx/pair-react-dom-render-unmount': 0, // ==================================================================== // no-useless-escape // ==================================================================== 'no-useless-escape': 0, // ==================================================================== // react/no-direct-mutation-state // ==================================================================== 'react/no-direct-mutation-state': 0, } }, { // For unit tests, we can be a little bit less strict. The settings below revise the // defaults specified in the extended configurations, as well as above. files: [ // Test files '*.test.ts', '*.test.tsx', '*.spec.ts', '*.spec.tsx', // Facebook convention '**/__mocks__/*.ts', '**/__mocks__/*.tsx', '**/__tests__/*.ts', '**/__tests__/*.tsx', // Microsoft convention '**/test/*.ts', '**/test/*.tsx' ], rules: {} } ] }; ================================================ FILE: source/react-application-collab-footer/.gitignore ================================================ # Logs logs *.log npm-debug.log* # Dependency directories node_modules # Build generated files dist lib release solution temp *.sppkg .heft # Coverage directory used by tools like istanbul coverage # OSX .DS_Store # Visual Studio files .ntvs_analysis.dat .vs bin obj # Resx Generated Code *.resx.ts # Styles Generated Code *.scss.ts ================================================ FILE: source/react-application-collab-footer/.npmignore ================================================ !dist config gulpfile.js release src temp tsconfig.json tslint.json *.log .yo-rc.json .vscode ================================================ FILE: source/react-application-collab-footer/.vscode/launch.json ================================================ { "version": "0.2.0", "configurations": [ { "name": "Hosted workbench", "type": "pwa-chrome", "request": "launch", "url": "https://enter-your-SharePoint-site/_layouts/workbench.aspx", "webRoot": "${workspaceRoot}", "sourceMaps": true, "sourceMapPathOverrides": { "webpack:///.././src/*": "${webRoot}/src/*", "webpack:///../../../src/*": "${webRoot}/src/*", "webpack:///../../../../src/*": "${webRoot}/src/*", "webpack:///../../../../../src/*": "${webRoot}/src/*" }, "runtimeArgs": [ "--remote-debugging-port=9222", "-incognito" ] } ] } ================================================ FILE: source/react-application-collab-footer/.vscode/settings.json ================================================ // Place your settings in this file to overwrite default and user settings. { // Configure glob patterns for excluding files and folders in the file explorer. "files.exclude": { "**/.git": true, "**/.DS_Store": true, "**/bower_components": true, "**/coverage": true, "**/lib-amd": true, "src/**/*.scss.ts": true }, "typescript.tsdk": ".\\node_modules\\typescript\\lib" } ================================================ FILE: source/react-application-collab-footer/.yo-rc.json ================================================ { "@microsoft/generator-sharepoint": { "plusBeta": false, "isCreatingSolution": true, "nodeVersion": "16.19.0", "sdksVersions": { "@microsoft/microsoft-graph-client": "3.0.2", "@microsoft/teams-js": "2.4.1" }, "version": "1.16.1", "environment": "spo", "libraryName": "react-application-collab-footer", "libraryId": "8b5fa72c-26f0-488a-a952-6ec68c81f623", "packageManager": "npm", "componentType": "extension", "extensionType": "ApplicationCustomizer", "isDomainIsolated": false } } ================================================ FILE: source/react-application-collab-footer/README.md ================================================ # Collaboration Footer Application Customizers This application customizer provides you the ability to include a footer designed for normal and group associated teams sites. The footer includes sets of links configured within a taxonomy term set via the term store. A second set of links are personalized links, unqiue to each user, stored within each user's user profile within a user profile property. If this property does not exist in the user profile service, this capability will be hidden. ![Collaboration Footer](../../assets/images/components/ext-collab-footer.gif) Taxonomy dependency is utilized within the collaboration footer to provide a global set of links across multiple team sites, as well as a technology demostrator. Visit the [Portal footer application customizer](../react-application-portal-footer/) for an example of footer links driven by a SharePoint list. Details on implementation at https://github.com/SharePoint/sp-starter-kit/blob/master/documentation/components/ext-collab-footer.md ## Configurable Properties The `Collaboration Footer` application customizers can be configured with the following properties: | Label | Property | Type | Required | Description | | ---- | ---- | ---- | ---- | ---- | | Link Term Set name | sourceTermSet | string | yes | The name of the term set that stores link terms for footer | | User profile propery name | personalItemsStorageProperty | string | yes | The name of the user profile property to store user specific links | ## Modifying Extension properties This extension has a collection of properties that are set by default, although may be modified using the [`PnP PowerShell`](https://github.com/pnp/powershell) commandlet Set-PnPApplicationCustomizer. ```powershell Set-PnPApplicationCustomizer -Title "CollabFooter" -ClientSideComponentId 6638da67-06f4-4f55-a1df-485d568e8b72 -ClientSideComponentProperties "{`"sourceTermSet`":`"PnP-CollabFooter-SharedLinks`",`"personalItemsStorageProperty`":`"PnP-CollabFooter-MyLinks`"}" ``` ## Used SharePoint Framework Version ![drop](https://img.shields.io/badge/version-1.16.1-green.svg) * Supported in SharePoint Online ## Applies to * [SharePoint Framework](https://learn.microsoft.com/en-us/sharepoint/dev/spfx/sharepoint-framework-overview) * [Office 365 tenant](https://learn.microsoft.com/en-us/sharepoint/dev/spfx/set-up-your-development-environment) ## Prerequisites The shared links are retrieved from a term set called `PnP-CollabFooter-SharedLinks`. This termset's intended use must be set for to be used for site navigation. The url is set in the terms property "simple link or header". The termset is created when applying the pnp tenant template found in the instructrions. The xml used to provision the termset can be found [here](../../provisioning/starterkit.xml). Personalized links only works if a custom property called `PnP-CollabFooter-MyLinks` has been added on the user profile service. This is string based property with maximum lenght. As there's no APIs to automate the property creation to the user profile service, this property will need to be manually created to enable the personalized links capability. Instructions to set up the custom property can be found [here](../../documentation/tenant-settings.md#create-a-custom-property-in-the-user-profile-service). Both component property names can be [changed in the SPFx extension properties](#modifying-extension-properties). ## Solution Solution|Author(s) --------|--------- react-application-collab-footer | Paolo Pialorsi react-application-collab-footer | David Opdendries react-application-collab-footer | Chandani Prajapati ## Version history Version|Date|Comments -------|----|-------- 1.0|May 9, 2018|Initial release 2.0|January 1, 2020|Initial release for SharePoint Starter Kit v2 3.0|February 2023|v3 - Upgraded to SPFx 1.16.1 ## Disclaimer **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.** --- ## Minimal Path to Awesome * Clone this repository * Move to correct folder where solution exists * in the command line run: * `npm install` * `gulp serve` ## Features Key features demostrated by this solution: * Work with term sets using spHttpClient * Work with data from user property ================================================ FILE: source/react-application-collab-footer/config/config.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/config.2.0.schema.json", "version": "2.0", "bundles": { "collaboration-footer-application-customizer": { "components": [ { "entrypoint": "./lib/extensions/collaborationFooter/CollaborationFooterApplicationCustomizer.js", "manifest": "./src/extensions/collaborationFooter/CollaborationFooterApplicationCustomizer.manifest.json" } ] } }, "externals": {}, "localizedResources": { "CollaborationFooterApplicationCustomizerStrings": "lib/extensions/collaborationFooter/loc/{locale}.js", "MyLinksStrings": "lib/extensions/collaborationFooter/components/myLinks/loc/{locale}.js" } } ================================================ FILE: source/react-application-collab-footer/config/deploy-azure-storage.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/deploy-azure-storage.schema.json", "workingDir": "./release/assets/", "account": "", "container": "react-application-collab-footer", "accessKey": "" } ================================================ FILE: source/react-application-collab-footer/config/package-solution.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/package-solution.schema.json", "solution": { "name": "Starter Kit - Collaboration Footer", "id": "8b5fa72c-26f0-488a-a952-6ec68c81f623", "version": "3.0.0.0", "includeClientSideAssets": true, "skipFeatureDeployment": true, "isDomainIsolated": false, "developer": { "name": "PnP Starter Kit", "privacyUrl": "", "termsOfUseUrl": "", "websiteUrl": "", "mpnId": "pnpsk" }, "metadata": { "shortDescription": { "default": "react-application-collab-footer description" }, "longDescription": { "default": "react-application-collab-footer description" }, "screenshotPaths": [], "videoUrl": "", "categories": [] }, "features": [ { "title": "Application Extension - Deployment of custom action.", "description": "Deploys a custom action with ClientSideComponentId association", "id": "d92e00dd-d103-482a-837f-d5728af1fec6", "version": "3.0.0.0", "assets": { "elementManifests": [ "elements.xml", "clientsideinstance.xml" ] } } ] }, "paths": { "zippedPackage": "solution/react-application-collab-footer.sppkg" } } ================================================ FILE: source/react-application-collab-footer/config/sass.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/core-build/sass.schema.json" } ================================================ FILE: source/react-application-collab-footer/config/serve.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/spfx-serve.schema.json", "port": 4321, "https": true, "serveConfigurations": { "default": { "pageUrl": "https://contoso.sharepoint.com/sites/mySite/SitePages/myPage.aspx", "customActions": { "6638da67-06f4-4f55-a1df-485d568e8b72": { "location": "ClientSideExtension.ApplicationCustomizer", "properties": { "sourceTermSet": "PnP-CollabFooter-SharedLinks", "personalItemsStorageProperty": "PnP-CollabFooter-MyLinks" } } } }, "collaborationFooter": { "pageUrl": "https://contoso.sharepoint.com/sites/mySite/SitePages/myPage.aspx", "customActions": { "6638da67-06f4-4f55-a1df-485d568e8b72": { "location": "ClientSideExtension.ApplicationCustomizer", "properties": { "sourceTermSet": "PnP-CollabFooter-SharedLinks", "personalItemsStorageProperty": "PnP-CollabFooter-MyLinks" } } } } } } ================================================ FILE: source/react-application-collab-footer/config/write-manifests.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/write-manifests.schema.json", "cdnBasePath": "" } ================================================ FILE: source/react-application-collab-footer/gulpfile.js ================================================ 'use strict'; const build = require('@microsoft/sp-build-web'); build.addSuppression(`Warning - [sass] The local CSS class 'ms-Grid' is not camelCase and will not be type-safe.`); var getTasks = build.rig.getTasks; build.rig.getTasks = function () { var result = getTasks.call(build.rig); result.set('serve', result.get('serve-deprecated')); return result; }; build.initialize(require('gulp')); ================================================ FILE: source/react-application-collab-footer/package.json ================================================ { "name": "react-application-collab-footer", "version": "3.0.0", "private": true, "main": "lib/index.js", "engines": { "node": ">=16.13.0 <17.0.0" }, "scripts": { "build": "gulp bundle", "clean": "gulp clean", "test": "gulp test" }, "dependencies": { "@microsoft/decorators": "1.16.1", "@microsoft/sp-application-base": "1.16.1", "@microsoft/sp-core-library": "1.16.1", "@microsoft/sp-dialog": "1.16.1", "@microsoft/sp-office-ui-fabric-core": "1.16.1", "@microsoft/sp-webpart-base": "^1.16.1", "react": "17.0.1", "react-dom": "17.0.1", "tslib": "2.3.1" }, "resolutions": { "@types/react": "16.8.8" }, "devDependencies": { "@microsoft/eslint-config-spfx": "1.16.1", "@microsoft/eslint-plugin-spfx": "1.16.1", "@microsoft/rush-stack-compiler-4.5": "0.2.2", "@microsoft/sp-build-web": "1.16.1", "@microsoft/sp-module-interfaces": "1.16.1", "@microsoft/sp-tslint-rules": "1.14.0", "@rushstack/eslint-config": "2.5.1", "@types/es6-promise": "0.0.33", "@types/react": "17.0.45", "@types/react-dom": "17.0.17", "@types/webpack-env": "1.15.2", "ajv": "6.12.5", "eslint": "8.7.0", "eslint-plugin-react-hooks": "4.3.0", "gulp": "4.0.2", "tslint-microsoft-contrib": "5.0.0", "typescript": "4.5.5" } } ================================================ FILE: source/react-application-collab-footer/sharepoint/assets/ClientSideInstance.xml ================================================ ================================================ FILE: source/react-application-collab-footer/sharepoint/assets/elements.xml ================================================ ================================================ FILE: source/react-application-collab-footer/src/extensions/collaborationFooter/CollaborationFooterApplicationCustomizer.manifest.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx/client-side-extension-manifest.schema.json", "id": "6638da67-06f4-4f55-a1df-485d568e8b72", "alias": "CollaborationFooterApplicationCustomizer", "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 } ================================================ FILE: source/react-application-collab-footer/src/extensions/collaborationFooter/CollaborationFooterApplicationCustomizer.ts ================================================ import * as React from 'react'; import * as ReactDom from 'react-dom'; import { override } from '@microsoft/decorators'; import { Log } from '@microsoft/sp-core-library'; import { BaseApplicationCustomizer, PlaceholderContent, PlaceholderName } from '@microsoft/sp-application-base'; import * as strings from 'CollaborationFooterApplicationCustomizerStrings'; import CollabFooter from './components/CollabFooter'; import { ICollabFooterProps } from './components/ICollabFooterProps'; import { ICollabFooterEditResult } from './components/ICollabFooterEditResult'; // import additional controls/components import { ContextualMenuItemType, IContextualMenuItem } from '@fluentui/react/lib/ContextualMenu'; import SPTaxonomyService from '../../services/SPTaxonomyService'; import {ITerm } from '../../services/SPTaxonomyTypes'; import SPUserProfileService from '../../services/SPUserProfileService'; import MyLinksDialog from './components/myLinks/MyLinksDialog'; import IMyLink from './components/myLinks/IMyLink'; const LOG_SOURCE: string = 'CollaborationFooterApplicationCustomizer'; /** * 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 ICollaborationFooterApplicationCustomizerProperties { // the Taxonomy Term Set that stores the shared menu items sourceTermSet: string; // the UPS property to store the MyLinks items personalItemsStorageProperty: string; } /** A Custom Action which can be run during execution of a Client Side Application */ export default class CollaborationFooterApplicationCustomizer extends BaseApplicationCustomizer { private _footerPlaceholder: PlaceholderContent | undefined; private _myLinks: IMyLink[]; private _myLinksMenuItems: IContextualMenuItem[]; @override public async onInit(): Promise { Log.info(LOG_SOURCE, `Initialized ${strings.Title}`); let sourceTermSet: string = this.properties.sourceTermSet; let personalItemsStorageProperty: string = this.properties.personalItemsStorageProperty; if (!sourceTermSet || !personalItemsStorageProperty) { console.log('Provide valid properties for CollabFooterApplicationCustomizer!'); } // call render method for generating the needed html elements return(await this._renderPlaceHolders()); } private async getMenuItems(): Promise { // get the list of menu items from the Taxonomy const svc: SPTaxonomyService = new SPTaxonomyService(this.context); const terms: ITerm[] = await svc.getTermsFromTermSet(this.properties.sourceTermSet); // map the taxonomy items to the menu items const sharedMenuItems: IContextualMenuItem[] = terms.map((i) => { return(this.projectTermToMenuItem(i, ContextualMenuItemType.Header)); }); // prepare the result let result: IContextualMenuItem[] = sharedMenuItems; // get the list of personal items from the User Profile Service let upsService: SPUserProfileService = new SPUserProfileService(this.context); let myLinksJson: any = await upsService.getUserProfileProperty(this.properties.personalItemsStorageProperty); if (myLinksJson != null) { if (myLinksJson.length > 0) { this._myLinks = JSON.parse(myLinksJson) as IMyLink[]; // map the taxonomy items to the menu items this._myLinksMenuItems = this._myLinks.map((i) => { return(this.projectMyLinkToMenuItem(i, ContextualMenuItemType.Normal)); }); } else { // if there are no personal items for my links, just provide an empty array that can be customized this._myLinks = []; this._myLinksMenuItems = []; } } return(result); } // projects a Taxonomy term into an object of type IContextualMenuItem for the CommandBar private projectTermToMenuItem(menuItem: ITerm, itemType: ContextualMenuItemType): IContextualMenuItem { return({ key: menuItem.Id, name: menuItem.Name, itemType: itemType, iconProps: { iconName: (menuItem.LocalCustomProperties["PnP-CollabFooter-Icon"] !== undefined ? menuItem.LocalCustomProperties["PnP-CollabFooter-Icon"] : null) }, href: menuItem.Terms.length === 0 ? (menuItem.LocalCustomProperties["_Sys_Nav_SimpleLinkUrl"] !== undefined ? menuItem.LocalCustomProperties["_Sys_Nav_SimpleLinkUrl"] : null) : null, subMenuProps: menuItem.Terms.length > 0 ? { items : menuItem.Terms.map((i) => { return(this.projectTermToMenuItem(i, ContextualMenuItemType.Normal)); }) } : null, isSubMenu: itemType !== ContextualMenuItemType.Header, }); } // projects a personal link item into an object of type IContextualMenuItem for the CommandBar private projectMyLinkToMenuItem(menuItem: IMyLink, itemType: ContextualMenuItemType): IContextualMenuItem { return({ key: menuItem.title, name: menuItem.title, itemType: itemType, href: menuItem.url, subMenuProps: null, isSubMenu: itemType !== ContextualMenuItemType.Header, }); } private _editMyLinks = async (): Promise => { let result: ICollabFooterEditResult = { editResult: null, myLinks: null, }; const myLinksDialog: MyLinksDialog = new MyLinksDialog(this._myLinks); await myLinksDialog.show(); // update the local list of links let resultingLinks: IMyLink[] = myLinksDialog.links; if (this._myLinks !== resultingLinks) { this._myLinks = resultingLinks; // map the taxonomy items to the menu items this._myLinksMenuItems = this._myLinks.map((i) => { return(this.projectMyLinkToMenuItem(i, ContextualMenuItemType.Normal)); }); // update the result result.myLinks = this._myLinksMenuItems; // save the personal links in the UPS, if there are any updates let upsService: SPUserProfileService = new SPUserProfileService(this.context); result.editResult = await upsService.setUserProfileProperty(this.properties.personalItemsStorageProperty, 'String', JSON.stringify(this._myLinks)); } return (result); } private async _renderPlaceHolders(): Promise { // Handling the header placeholder if (!this._footerPlaceholder) { this._footerPlaceholder = this.context.placeholderProvider.tryCreateContent( PlaceholderName.Bottom, { onDispose: this._onDispose }); // The extension should not assume that the expected placeholder is available. if (!this._footerPlaceholder) { console.error('The expected placeholder (Bottom) was not found.'); return; } const menuItems: IContextualMenuItem[] = await this.getMenuItems(); const element: React.ReactElement = React.createElement( CollabFooter, { sharedLinks: menuItems, myLinks: this._myLinksMenuItems, editMyLinks: this._editMyLinks } ); ReactDom.render(element, this._footerPlaceholder.domElement); } } private _onDispose(): void { console.log('[CollabFooterApplicationCustomizer._onDispose] Disposed custom bottom placeholder.'); } } ================================================ FILE: source/react-application-collab-footer/src/extensions/collaborationFooter/components/CollabFooter.module.scss ================================================ @import '~@fluentui/react/dist/sass/References.scss'; .collabFooter { .collabFooterContainer { background-color: $ms-color-neutralLighter; color: $ms-color-neutralPrimary; } .commandBar { width: 100%; } } ================================================ FILE: source/react-application-collab-footer/src/extensions/collaborationFooter/components/CollabFooter.tsx ================================================ import * as React from 'react'; import styles from './CollabFooter.module.scss'; import { ICollabFooterProps } from './ICollabFooterProps'; import { ICollabFooterState } from './ICollabFooterState'; import { ICollabFooterEditResult } from './ICollabFooterEditResult'; import * as strings from 'CollaborationFooterApplicationCustomizerStrings'; // import additional controls/components import { MessageBar, MessageBarType } from '@fluentui/react/lib/MessageBar'; import { CommandBar } from '@fluentui/react/lib/CommandBar'; import { ContextualMenuItemType, IContextualMenuItem } from '@fluentui/react/lib/ContextualMenu'; export default class CollabFooter extends React.Component { /** * Main constructor for the component */ constructor(props: ICollabFooterProps) { super(props); this.state = { myLinks: props.myLinks, }; } public render(): React.ReactElement { // console.log("CollabFooter.render"); // console.log(this.state.myLinks); let menuItems: IContextualMenuItem[] = this.props.sharedLinks; // add the personal menu items to the list of menu items if (this.state.myLinks != null && this.state.myLinks.length > 0) { menuItems = menuItems.concat([ { key: "MyLinksRoot", name: strings.MyLinks, itemType: ContextualMenuItemType.Header, iconProps: { iconName: "Heart" }, subMenuProps: { items: this.state.myLinks }, isSubMenu: false, } ]); // console.log(menuItems); } if (menuItems != null && menuItems.length > 0) { return (
{ this.state.myLinksSaved != null ? (this.state.myLinksSaved ? { strings.MyLinksSaveSuccess } : { strings.MyLinksSaveFailed }) : null }
); } else { return (null); } } // method used to edit and save personal items private _editMyLinks = (): void => { this.props.editMyLinks() .then((editResult: ICollabFooterEditResult): void => { // show result message this.setState({ myLinksSaved: editResult.editResult, myLinks: editResult.myLinks, }); if (editResult != null) { // hide the message after 2 sec window.setTimeout(() => { this.setState({ myLinksSaved: null, }); }, 2000); } }); } } ================================================ FILE: source/react-application-collab-footer/src/extensions/collaborationFooter/components/ICollabFooterEditResult.ts ================================================ import { IContextualMenuItem } from "office-ui-fabric-react"; export interface ICollabFooterEditResult { editResult?: boolean; myLinks: IContextualMenuItem[]; } ================================================ FILE: source/react-application-collab-footer/src/extensions/collaborationFooter/components/ICollabFooterProps.ts ================================================ import { IContextualMenuItem } from 'office-ui-fabric-react'; import { ICollabFooterEditResult } from './ICollabFooterEditResult'; export interface ICollabFooterProps { // used to pass the menu items from the extension to the React component sharedLinks: IContextualMenuItem[]; // used to pass the personal links menu item myLinks: IContextualMenuItem[]; // function to edit the list of my links editMyLinks: () => Promise; } ================================================ FILE: source/react-application-collab-footer/src/extensions/collaborationFooter/components/ICollabFooterState.ts ================================================ import { IContextualMenuItem } from 'office-ui-fabric-react'; export interface ICollabFooterState { // state variable to show the result of saving my links myLinksSaved?: boolean; // used to hold the personal links menu item myLinks: IContextualMenuItem[]; } ================================================ FILE: source/react-application-collab-footer/src/extensions/collaborationFooter/components/myLinks/IMyLink.ts ================================================ /** * Interface to define a single URL item for My Links */ export default interface IMyLink { // the Title of the Link title: string; // the URL of theLink url: string; } ================================================ FILE: source/react-application-collab-footer/src/extensions/collaborationFooter/components/myLinks/MyLinks.module.scss ================================================ @import '~@fluentui/react/dist/sass/References.scss'; .myLinksDialogRoot { .myLinksDialogContent { text-align: left; vertical-align: top; .editPanel { margin-top: 10px; margin-bottom: 10px; } .textField { width: 250px; } } } ================================================ FILE: source/react-application-collab-footer/src/extensions/collaborationFooter/components/myLinks/MyLinksDialog.tsx ================================================ import * as React from 'react'; import * as ReactDOM from 'react-dom'; // import supporting types import IMyLink from './IMyLink'; import styles from './MyLinks.module.scss'; import * as strings from 'MyLinksStrings'; // import additional controls/components import { BaseDialog, IDialogConfiguration } from '@microsoft/sp-dialog'; import { DefaultButton } from '@fluentui/react/lib/Button'; import { TextField } from '@fluentui/react/lib/TextField'; import { CommandBar } from '@fluentui/react/lib/CommandBar'; import { DetailsList, DetailsListLayoutMode, Selection, SelectionMode, IColumn } from '@fluentui/react/lib/DetailsList'; import { DialogContent, DialogFooter } from '@fluentui/react/lib/Dialog'; /** * Define the columns that will be used to render the list of links */ const _linksColumns: IColumn[] = [ { key: 'TitleColumn', name: strings.TitleColumn, fieldName: 'title', minWidth: 150, maxWidth: 350, isResizable: true, ariaLabel: strings.TitleColumnAriaLabel }, { key: 'urlColumn', name: strings.UrlColumn, fieldName: 'url', minWidth: 150, maxWidth: 350, isResizable: true, ariaLabel: strings.UrlColumnAriaLabel } ]; /** * Defines the initialization properties for the MyLinks dialog window */ interface IMyLinksDialogContentProps { // the array of Links to render/manage links: Array; // cancel button handler, to undo the changes cancel: () => void; // save button handler, to save the Links save: (links: Array) => void; } /** * Defines the state for the MyLinks dialog window */ interface IMyLinksDialogContentState { // the Links to render/manage links: Array; // currently selected item, if any selectedLink?: IMyLink; // defines whether to show the detail (add/edit) panel or not showDetailPanel?: boolean; // defines whether the dialog is adding a new item addingNewItem?: boolean; // title for the pending editing item title?: string; // url for the pending editing item url?: string; } /** * Defines the main content of the MyLinks dialog */ class MyLinksDialogContent extends React.Component { // to handle item selection in the DetailsList of Links private _selection: Selection; constructor(props: IMyLinksDialogContentProps) { super(props); this._selection = new Selection({ onSelectionChanged: () => { let selectedLink: IMyLink = this._selection.getSelectedCount() !== 0 ? this._selection.getSelection()[0] as IMyLink : null; this.setState({ selectedLink: selectedLink }); } }); this.state = { links: this.props.links, showDetailPanel: false }; } public componentDidMount(): void { // fire the resize event to paint the content of the dialog let resizeEvent = window.document.createEvent('UIEvents'); resizeEvent.initUIEvent('resize', true, false, window, 0); window.dispatchEvent(resizeEvent); } /** * Renders the dialog content using an Office UI Fabric grid */ public render(): JSX.Element { return (
{this.state.showDetailPanel ?
: null} {!this.state.showDetailPanel ?
: null} {!this.state.showDetailPanel ?
: null}
{!this.state.showDetailPanel ? { this.props.save(this.state.links); }} /> : null}
); } private _cancelEdit = (): void => { // disable the detail panel this.setState({ showDetailPanel: false, title: "", url: "" }); } private _saveEdit = (): void => { if (!this.state.addingNewItem) { const updatedLink: IMyLink = { title: this.state.title, url: this.state.url }; // update the selected item this.state.links[this.state.links.indexOf(this.state.selectedLink)] = updatedLink; // refresh the array of Links const updatedLinks: IMyLink[] = this.state.links.concat([]); // update the list of links and disable the detail panel this.setState({ showDetailPanel: false, links: updatedLinks }); } else { const newLink: IMyLink = { title: this.state.title, url: this.state.url }; // if we have a valid new link if (newLink != null && newLink.title != null && newLink.title.length > 0 && newLink.url != null && newLink.url.length > 0) { // add the new item to the array of Links const updatedLinks: IMyLink[] = this.state.links.concat([newLink]); // update the list of links and disable the detail panel this.setState({ showDetailPanel: false, links: updatedLinks }); } } } private _onChangedTitle = (event: React.FormEvent, newValue?: string) => { this.setState({ title: newValue }); } private _onChangedUrl = (event: React.FormEvent, newValue?: string) => { this.setState({ url: newValue }); } private _getErrorMessageUrl = (value: string): string => { // validate the URL with a specific Regular Expression const regEx: RegExp = /(https)?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&\/\/=]*)/; return (value == null || value.length === 0 || regEx.test(value) ? "" : strings.InvalidUrlError); } private addLink = (): void => { if (this.state.selectedLink != null && this.state.links != null && this.state.links.length > 0) { this._selection.toggleIndexSelected(this.state.links.indexOf(this.state.selectedLink)); } // enable the detail panel this.setState({ showDetailPanel: true, addingNewItem: true, title: "", url: "", selectedLink: null }); } private editLink = (): void => { // enable the detail panel this.setState({ showDetailPanel: true, addingNewItem: false, title: this.state.selectedLink.title, url: this.state.selectedLink.url }); } private deleteLink = (): void => { // delete the selected link this.state.links.splice(this.state.links.indexOf(this.state.selectedLink), 1); // refresh the array of Links const updatedLinks: IMyLink[] = this.state.links.concat([]); // refresh the DetailsList view this.setState({ links: updatedLinks }); } } /** * Dialog window to show the list of links */ export default class MyLinksDialog extends BaseDialog { // to keep track of the initial links in case user will cancel private initialLinks: IMyLink[]; /** * Constructor for the dialog window */ constructor(public links: Array, public isSave?: boolean) { // Blocking or else click outside causes error in 1.7 super({isBlocking: true}); // clone the initial list of links we've got this.initialLinks = (this.links != null) ? this.links.concat([]) : []; } public render(): void { ReactDOM.render(, this.domElement); } public getConfig(): IDialogConfiguration { return { isBlocking: true }; } private _cancel = (): void => { this.isSave = false; this.links = this.initialLinks; // Fix for all browsers regarding SP Dialog not being to open twice ReactDOM.unmountComponentAtNode(this.domElement); this.close(); } private _save = (links: Array): void => { this.isSave = true; // Fix for all browsers regarding SP Dialog not being to open twice ReactDOM.unmountComponentAtNode(this.domElement); this.links = links; this.close(); } } ================================================ FILE: source/react-application-collab-footer/src/extensions/collaborationFooter/components/myLinks/loc/de-de.js ================================================ define([], function() { return { "DialogSaveButton": "Speichern", "DialogCancelButton": "Abbrechen", "DialogAddButton": "Hinzufügen", "DialogUpdateButton": "Aktualisieren", "MyLinksDialogTitle": "Meine Links", "MyLinksDialogDescription": "Nutzen Sie diesen Dialog um ihre Links zu verwalten", "SingleLinkDialogTitle": "Link hinzufügen/bearbeiten", "SingleLinkDialogDescription": "Nutzen Sie diesen Dialog um das Link (hinzufügen/bearbeiten) zu verwalten", "ConfirmDeleteLink": "Sind Sie sicher, das Sie diesen Link entfernen möchten?", "LinkTitleLabel": "Titel", "LinkUrlLabel": "URL", "InvalidUrlError": "The bereitgestellt URL ist ungültig", "TitleColumn": "Titel", "TitleColumnAriaLabel": "Titel der URL", "UrlColumn": "URL", "UrlColumnAriaLabel": "Hyperlink der URL", "SelectionColumnAriaLabel": "Auswahl umschalten", "SelectionAllColumnAriaLabel": "Auswahl für alle Items umschalten", "AddLinkCommand": "Hinzufügen", "EditLinkCommand": "Ändern", "DeleteLinkCommand": "Entfernen" } }); ================================================ FILE: source/react-application-collab-footer/src/extensions/collaborationFooter/components/myLinks/loc/en-us.js ================================================ define([], function() { return { "DialogSaveButton": "Save", "DialogCancelButton": "Cancel", "DialogAddButton": "Add", "DialogUpdateButton": "Update", "MyLinksDialogTitle": "My Links", "MyLinksDialogDescription": "Use this dialog to manage your Links", "SingleLinkDialogTitle": "Add/Edit Link", "SingleLinkDialogDescription": "Use this dialog to manage (add/edit) a link", "ConfirmDeleteLink": "Do you really want to delete the selected link?", "LinkTitleLabel": "Title", "LinkUrlLabel": "URL", "InvalidUrlError": "The provided URL is not valid", "TitleColumn": "Title", "TitleColumnAriaLabel": "Title of the URL", "UrlColumn": "URL", "UrlColumnAriaLabel": "Hyperlink of the URL", "SelectionColumnAriaLabel": "Toggle selection", "SelectionAllColumnAriaLabel": "Toggle selection for all items", "AddLinkCommand": "Add", "EditLinkCommand": "Edit", "DeleteLinkCommand": "Delete" } }); ================================================ FILE: source/react-application-collab-footer/src/extensions/collaborationFooter/components/myLinks/loc/es-es.js ================================================ define([], function() { return { "DialogSaveButton": "Guardar", "DialogCancelButton": "Cancelar", "DialogAddButton": "Agregar", "DialogUpdateButton": "Actualizar", "MyLinksDialogTitle": "Mis Enlaces", "MyLinksDialogDescription": "Utilice esta ventana de dialogo para administrar sus enlaces", "SingleLinkDialogTitle": "Agregar/Editar Enlace", "SingleLinkDialogDescription": "Utilice esta ventana de dialogo para adminsitrar (agregar/editar) un enlace", "ConfirmDeleteLink": "¿Realmente quiere eliminar el enlace seleccionado?", "LinkTitleLabel": "Título", "LinkUrlLabel": "URL", "InvalidUrlError": "La direccion URL capturada no es valida", "TitleColumn": "Título", "TitleColumnAriaLabel": "Título de la dirección URL", "UrlColumn": "URL", "UrlColumnAriaLabel": "Hypervinculo de la dirección URL", "SelectionColumnAriaLabel": "Seleccion Toggle", "SelectionAllColumnAriaLabel": "Seleccion Toggle para todos los elementos", "AddLinkCommand": "Agregar", "EditLinkCommand": "Editar", "DeleteLinkCommand": "Eliminar" } }); ================================================ FILE: source/react-application-collab-footer/src/extensions/collaborationFooter/components/myLinks/loc/fr-fr.js ================================================ define([], function() { return { "DialogSaveButton": "Sauvegarder", "DialogCancelButton": "Annuler", "DialogAddButton": "Ajouter", "DialogUpdateButton": "Mettre à jour", "MyLinksDialogTitle": "Mes Liens", "MyLinksDialogDescription": "Utilisez cette boîte de dialogue pour gérer vos liens", "SingleLinkDialogTitle": "Ajouter/Modifier lien", "SingleLinkDialogDescription": "Utiliser cette boîte de dialogue pour gérer (ajouter / modifier) un lien", "ConfirmDeleteLink": "Voulez-vous vraiment supprimer le lien sélectionné?", "LinkTitleLabel": "Titre", "LinkUrlLabel": "URL", "InvalidUrlError": "L'URL fournie n'est pas valide", "TitleColumn": "Titre", "TitleColumnAriaLabel": "Titre de l'URL", "UrlColumn": "URL", "UrlColumnAriaLabel": "Hyperlien de l'URL", "SelectionColumnAriaLabel": "Basculer la sélection", "SelectionAllColumnAriaLabel": "Basculer la sélection pour tous les objets", "AddLinkCommand": "Ajouter", "EditLinkCommand": "Modifier", "DeleteLinkCommand": "Supprimer" } }); ================================================ FILE: source/react-application-collab-footer/src/extensions/collaborationFooter/components/myLinks/loc/mystrings.d.ts ================================================ declare interface IMyLinksStrings { // generic labels for dialogs DialogSaveButton: string; DialogCancelButton: string; DialogAddButton: string; DialogUpdateButton: string; // labels for the dialog content MyLinksDialogTitle: string; MyLinksDialogDescription: string; SingleLinkDialogTitle: string; SingleLinkDialogDescription: string; ConfirmDeleteLink: string; // labels for the SingleLink editor dialog LinkTitleLabel: string; LinkUrlLabel: string; InvalidUrlError: string; // labels for DetailList of URLs TitleColumn: string; TitleColumnAriaLabel: string; UrlColumn: string; UrlColumnAriaLabel: string; SelectionColumnAriaLabel: string; SelectionAllColumnAriaLabel: string; // labels for the CommandBar AddLinkCommand: string; EditLinkCommand: string; DeleteLinkCommand: string; } declare module 'MyLinksStrings' { const strings: IMyLinksStrings; export = strings; } ================================================ FILE: source/react-application-collab-footer/src/extensions/collaborationFooter/components/myLinks/loc/nb-no.js ================================================ define([], function() { return { "DialogSaveButton": "Lagre", "DialogCancelButton": "Avbryt", "DialogAddButton": "Legg til", "DialogUpdateButton": "Oppdater", "MyLinksDialogTitle": "Mine lenker", "MyLinksDialogDescription": "Bruk denne dialogen for å håndtere dine lenker", "SingleLinkDialogTitle": "Legg til/redigere lenke", "SingleLinkDialogDescription": "Bruk denne dialogen for å håndtere (legg til/rediger) en lenke", "ConfirmDeleteLink": "Vil du virkelig slette den valgte lenken?", "LinkTitleLabel": "Tittel", "LinkUrlLabel": "URL", "InvalidUrlError": "Den angitte URL-en er ugyldig", "TitleColumn": "Tittel", "TitleColumnAriaLabel": "Tittel på URL-en", "UrlColumn": "URL", "UrlColumnAriaLabel": "URL-ens hyperlenke", "SelectionColumnAriaLabel": "Endre valg", "SelectionAllColumnAriaLabel": "Endre valg for alle objekt", "AddLinkCommand": "Legg til", "EditLinkCommand": "Rediger", "DeleteLinkCommand": "Slett" } }); ================================================ FILE: source/react-application-collab-footer/src/extensions/collaborationFooter/components/myLinks/loc/nl-nl.js ================================================ define([], function() { return { "DialogSaveButton": "Opslaan", "DialogCancelButton": "Annuleren", "DialogAddButton": "Toevoegen", "DialogUpdateButton": "Bijwerken", "MyLinksDialogTitle": "Mijn Links", "MyLinksDialogDescription": "Gebruik dit dialoogvenster om je links te beheren", "SingleLinkDialogTitle": "Toevoegen/Bewerken Link", "SingleLinkDialogDescription": "Gebruik dit dialoogvenster voor het beheren (toevoegen/bewerken) van een link", "ConfirmDeleteLink": "Weet je zeker dat je de geselecteerde link wil verwijderen?", "LinkTitleLabel": "Titel", "LinkUrlLabel": "URL", "InvalidUrlError": "De opgegeven URL is niet geldig", "TitleColumn": "Titel", "TitleColumnAriaLabel": "Titel van de URL", "UrlColumn": "URL", "UrlColumnAriaLabel": "Hyperlink van de URL", "SelectionColumnAriaLabel": "Selectie omzetten", "SelectionAllColumnAriaLabel": "Selectie omzetten voor alle items", "AddLinkCommand": "Toevoegen", "EditLinkCommand": "Bewerken", "DeleteLinkCommand": "Verwijderen" } }); ================================================ FILE: source/react-application-collab-footer/src/extensions/collaborationFooter/components/myLinks/loc/sv-se.js ================================================ define([], function() { return { "DialogSaveButton": "Spara", "DialogCancelButton": "Avbryt", "DialogAddButton": "Lägg till", "DialogUpdateButton": "Uppdatera", "MyLinksDialogTitle": "Mina Länkar", "MyLinksDialogDescription": "Använd den här dialogrutan för att hantera dina länkar", "SingleLinkDialogTitle": "Lägg till/Redigera Länk", "SingleLinkDialogDescription": "Använd den här dialogrutan för att hantera (lägg till/redigera) en länk", "ConfirmDeleteLink": "Vill du verkligen ta bort den valda länken?", "LinkTitleLabel": "Titel", "LinkUrlLabel": "URL", "InvalidUrlError": "Den angivna URLen är inte giltig", "TitleColumn": "Titel", "TitleColumnAriaLabel": "Titel på URLen", "UrlColumn": "URL", "UrlColumnAriaLabel": "URLens hyperlänk", "SelectionColumnAriaLabel": "Växla val", "SelectionAllColumnAriaLabel": "Växla val för alla objekt", "AddLinkCommand": "Lägg till", "EditLinkCommand": "Redigera", "DeleteLinkCommand": "Radera" } }); ================================================ FILE: source/react-application-collab-footer/src/extensions/collaborationFooter/components/myLinks/loc/tr-tr.js ================================================ define([], function() { return { "DialogSaveButton": "Kaydet", "DialogCancelButton": "İptal", "DialogAddButton": "Ekle", "DialogUpdateButton": "Güncelle", "MyLinksDialogTitle": "Bağlantılarım", "MyLinksDialogDescription": "Bağlantılarınızı yönetmek için bu iletişim kutusunu kullanın", "SingleLinkDialogTitle": "Bağlantı Ekle / Düzenle", "SingleLinkDialogDescription": "Bir bağlantıyı yönetmek için (eklemek / düzenlemek) bu iletişim kutusunu kullanın", "ConfirmDeleteLink": "Seçili bağlantıyı gerçekten silmek istiyor musunuz?", "LinkTitleLabel": "Başlık", "LinkUrlLabel": "URL", "InvalidUrlError": "Sağlanan URL geçerli değil", "TitleColumn": "Başlık", "TitleColumnAriaLabel": "URL’nin Başlığı", "UrlColumn": "URL", "UrlColumnAriaLabel": "URL’nin köprüsü", "SelectionColumnAriaLabel": "Seçimi değiştir", "SelectionAllColumnAriaLabel": "Tüm öğeler için seçimi değiştir", "AddLinkCommand": "Ekle", "EditLinkCommand": "Düzenle", "DeleteLinkCommand": "Sil" } }); ================================================ FILE: source/react-application-collab-footer/src/extensions/collaborationFooter/loc/de-de.js ================================================ define([], function() { return { "Title": "CollabFooterApplicationCustomizer", "MyLinks": "Meine Links", "EditMyLinks": "Ändere meine Links", "MyLinksSaveSuccess": "Meine Links wurden erfolgreich gespeichert!", "MyLinksSaveFailed": "Das Speichern meiner Links ist fehlgeschlagen!" } }); ================================================ FILE: source/react-application-collab-footer/src/extensions/collaborationFooter/loc/en-us.js ================================================ define([], function() { return { "Title": "CollabFooterApplicationCustomizer", "MyLinks": "My Links", "EditMyLinks": "Edit My Links", "MyLinksSaveSuccess": "My links successfully saved!", "MyLinksSaveFailed": "Failed to save my links!" } }); ================================================ FILE: source/react-application-collab-footer/src/extensions/collaborationFooter/loc/es-es.js ================================================ define([], function() { return { "Title": "CollabFooterApplicationCustomizer", "MyLinks": "Mis enlaces", "EditMyLinks": "Modificar Mis Enlaces", "MyLinksSaveSuccess": "Mis enlaces guardados exitosamente!", "MyLinksSaveFailed": "Fallo al guardar su enlace!" } }); ================================================ FILE: source/react-application-collab-footer/src/extensions/collaborationFooter/loc/fr-fr.js ================================================ define([], function() { return { "Title": "CollabFooterApplicationCustomizer", "MyLinks": "Mes Liens", "EditMyLinks": "Editer Mes Liens", "MyLinksSaveSuccess": "Mes liens ont été enregistrés avec succès!", "MyLinksSaveFailed": "Échec de l'enregistrement de mes liens!" } }); ================================================ FILE: source/react-application-collab-footer/src/extensions/collaborationFooter/loc/myStrings.d.ts ================================================ declare interface ICollabFooterApplicationCustomizerStrings { Title: string; MyLinks: string; EditMyLinks: string; MyLinksSaveSuccess: string; MyLinksSaveFailed: string; } declare module 'CollaborationFooterApplicationCustomizerStrings' { const strings: ICollabFooterApplicationCustomizerStrings; export = strings; } ================================================ FILE: source/react-application-collab-footer/src/extensions/collaborationFooter/loc/nb-no.js ================================================ define([], function() { return { "Title": "CollabFooterApplicationCustomizer", "MyLinks": "Mine lenker", "EditMyLinks": "Rediger mine lenker", "MyLinksSaveSuccess": "Mine lenker har blitt lagret!", "MyLinksSaveFailed": "Lagring av mine lenker feilet!" } }); ================================================ FILE: source/react-application-collab-footer/src/extensions/collaborationFooter/loc/nl-nl.js ================================================ define([], function() { return { "Title": "CollabFooterApplicationCustomizer", "MyLinks": "Mijn Links", "EditMyLinks": "Bewerk Mijn Links", "MyLinksSaveSuccess": "Mijn links succesvol opgeslagen!", "MyLinksSaveFailed": "Opslaan van Mijn Links mislukt!" } }); ================================================ FILE: source/react-application-collab-footer/src/extensions/collaborationFooter/loc/sv-se.js ================================================ define([], function() { return { "Title": "CollabFooterApplicationCustomizer", "MyLinks": "Mina Länkar", "EditMyLinks": "Redigera Mina Länkar", "MyLinksSaveSuccess": "Mina länkar har sparats!", "MyLinksSaveFailed": "Misslyckades med att spara mina länkar!" } }); ================================================ FILE: source/react-application-collab-footer/src/extensions/collaborationFooter/loc/tr-tr.js ================================================ define([], function() { return { "Title": "CollabFooterApplicationCustomizer", "MyLinks": "Bağlantılarım", "EditMyLinks": "Bağlantılarımı Düzenle", "MyLinksSaveSuccess": "Bağlantılarım başarıyla kaydedildi!", "MyLinksSaveFailed": "Bağlantılarım kaydedilemedi!" } }); ================================================ FILE: source/react-application-collab-footer/src/index.ts ================================================ // A file is required to be in the root of the /src directory by the TypeScript compiler ================================================ FILE: source/react-application-collab-footer/src/services/SPTaxonomyService.ts ================================================ /** * DISCLAIMER * * As there is not yet an OData end-point for managed metadata, this service makes use of the ProcessQuery end-points. * The service will get updated once the APIs are in place for managing managed metadata. */ import { IWebPartContext} from '@microsoft/sp-webpart-base'; import { ExtensionContext } from '@microsoft/sp-extension-base'; import { Environment, EnvironmentType } from '@microsoft/sp-core-library'; import { SPHttpClient, SPHttpClientResponse, ISPHttpClientOptions } from '@microsoft/sp-http'; import { ITermSets, ITermSet, ITerms, ITerm } from './SPTaxonomyTypes'; export default class SPTaxonomyService { // private member to hold the URL of the /_vti_bin/client.svc/ProcessQuery endpoint private clientServiceUrl: string; // private member to hold the URL of the /_api/contextinfo endpoint private contextInfoUrl: string; // private member to hold the FormDigest for SPO private formDigest: string; /** * Main constructor for the Taxonomy Service */ constructor(private context: IWebPartContext | ExtensionContext) { this.clientServiceUrl = this.context.pageContext.web.absoluteUrl + '/_vti_bin/client.svc/ProcessQuery'; this.contextInfoUrl = this.context.pageContext.web.absoluteUrl + '/_api/contextinfo'; } /** * @function * Retrieves a new value for the Form Digest for SPO */ private async getFormDigest(): Promise { let httpPostOptions: ISPHttpClientOptions = { headers: { "accept": "application/json", "content-type": "application/json" } }; let contextInfoResponse: SPHttpClientResponse = await this.context.spHttpClient.post(this.contextInfoUrl, SPHttpClient.configurations.v1, httpPostOptions); let contextInfoJsonResponse: any = await contextInfoResponse.json(); const formDigest: string = contextInfoJsonResponse.FormDigestValue; return(formDigest); } /** * @function * Retrieves the collection of terms for a term set stored in the current SharePoint env */ public async getTermsFromTermSet(termSetName: string, locale: number = 1033): Promise { // if we are in a real SharePoint environment if (Environment.type === EnvironmentType.SharePoint || Environment.type === EnvironmentType.ClassicSharePoint) { this.formDigest = await this.getFormDigest(); // build the Client Service Request let data: string = ` ${termSetName} ${locale} `; let httpPostOptions: ISPHttpClientOptions = { headers: { 'accept': 'application/json', 'content-type': 'text/xml', "X-RequestDigest": this.formDigest }, body: data }; let serviceResponse: SPHttpClientResponse = await this.context.spHttpClient.post(this.clientServiceUrl, SPHttpClient.configurations.v1, httpPostOptions); let serviceJSONResponse: Array = await serviceResponse.json(); //let result: Array = new Array(); // extract the object of type SP.Taxonomy.TermSetCollection from the array let termSetsCollections: ITermSets[] = serviceJSONResponse.filter( (child: any) => (child != null && child['_ObjectType_'] !== undefined && child['_ObjectType_'] === "SP.Taxonomy.TermSetCollection") ); // and if any, process the TermSet objects in it if (termSetsCollections != null && termSetsCollections.length > 0) { let termSetCollection: ITermSets = termSetsCollections[0]; let childTermSets: ITermSet[] = termSetCollection._Child_Items_; // extract the object of type SP.Taxonomy.TermSet from the array let termSets: ITermSet[] = childTermSets.filter( (child: any) => (child != null && child['_ObjectType_'] !== undefined && child['_ObjectType_'] === "SP.Taxonomy.TermSet") ); // and if any, process the requested TermSet object if (termSets != null && termSets.length > 0) { let termSet: ITermSet = termSets[0]; let childItems: ITerm[] = termSet.Terms._Child_Items_; return(await Promise.all(childItems.map(async (t: any): Promise => { return await this.expandTerm(t); }))); } } } // default empty array in case of any missing data return (new Promise>((resolve, reject) => { resolve(new Array()); })); } /** * @function * Gets the child terms of another term of the Term Store in the current SharePoint env */ private async getChildTerms(term: ITerm): Promise { // check if there are child terms to search for if (Number(term.TermsCount) > 0) { // build the Client Service Request let data: string = ` `; let httpPostOptions: ISPHttpClientOptions = { headers: { 'accept': 'application/json', 'content-type': 'text/xml', "X-RequestDigest": this.formDigest }, body: data }; let serviceResponse: SPHttpClientResponse = await this.context.spHttpClient.post(this.clientServiceUrl, SPHttpClient.configurations.v1, httpPostOptions); let serviceJSONResponse: Array = await serviceResponse.json(); // extract the object of type SP.Taxonomy.TermCollection from the array let termsCollections: ITerms[] = serviceJSONResponse.filter( (child: any) => (child != null && child['_ObjectType_'] !== undefined && child['_ObjectType_'] === "SP.Taxonomy.TermCollection") ); // and if any, get the first and unique Terms collection object if (termsCollections != null && termsCollections.length > 0) { let termsCollection: ITerms = termsCollections[0]; let childItems: Array = termsCollection._Child_Items_; return(await Promise.all(childItems.map(async (t: ITerm): Promise => { return await this.expandTerm(t); }))); } } // default empty array in case of any missing data return (new Promise>((resolve, reject) => { resolve(new Array()); })); } /** * @function * Expands a Term object of type ITerm, including child terms * @param guid */ private async expandTerm(term: ITerm): Promise { let childTerms: ITerm[] = await this.getChildTerms(term); term.CustomProperties = term.CustomProperties !== undefined ? term.CustomProperties : null; term.Id = term.Id !== undefined ? this.cleanGuid(term.Id) : ""; term.LocalCustomProperties = term.LocalCustomProperties !== undefined ? term.LocalCustomProperties : null; term.Terms = childTerms; term.TermsCount = childTerms.length; term.PathDepth = term.PathOfTerm.split(';').length; return(term); } /** * @function * Clean the Guid from the Web Service response * @param guid */ private cleanGuid(guid: string): string { if (guid !== undefined) { return guid.replace('/Guid(', '').replace('/', '').replace(')', ''); } else { return(""); } } } ================================================ FILE: source/react-application-collab-footer/src/services/SPTaxonomyTypes.ts ================================================ /** * Defines the SP.Taxonomy.TermSetCollection type */ export interface ITermSets { _ObjectType_: string; _Child_Items_: ITermSet[]; } /** * Defines the SP.Taxonomy.TermSet type */ export interface ITermSet { _ObjectType_: string; _ObjectIdentity_: string; Id: string; Name: string; Description: string; Terms: ITerms; } /** * SP.Taxonomy.TermCollection */ export interface ITerms { _ObjectType_: string; _Child_Items_: ITerm[]; } /** * SP.Taxonomy.Term */ export interface ITerm { _ObjectType_: string; _ObjectIdentity_: string; CreatedDate: string; CustomProperties: any; CustomSortOrder: string; Description: string; Id: string; IsAvailableForTagging: boolean; IsDeprecated: boolean; IsKeyword: boolean; IsPinned: boolean; IsPinnedRoot: boolean; IsReused: boolean; IsRoot: boolean; IsSourceTerm: boolean; LastModifiedDate: string; LocalCustomProperties: any; Name: string; Owner: string; PathOfTerm: string; PathDepth?: number; Terms: ITerm[]; TermsCount: number; } ================================================ FILE: source/react-application-collab-footer/src/services/SPUserProfileService.ts ================================================ /** * DISCLAIMER * * As there is not yet an OData end-point for managed metadata, this service makes use of the ProcessQuery end-points. * The service will get updated once the APIs are in place for managing managed metadata. */ import { IWebPartContext} from '@microsoft/sp-webpart-base'; import { ExtensionContext } from '@microsoft/sp-extension-base'; import { Environment, EnvironmentType } from '@microsoft/sp-core-library'; import { SPHttpClient, SPHttpClientResponse, ISPHttpClientOptions } from '@microsoft/sp-http'; import { IPersonProperties, ISetPropertyResponse } from './SPUserProfileTypes'; export default class SPUserProfileService { // private member to hold the URL of the /_vti_bin/client.svc/ProcessQuery endpoint private clientServiceUrl: string; // private member to hold the URL of the /_api/contextinfo endpoint private contextInfoUrl: string; // private member to hold the FormDigest for SPO private formDigest: string; /** * Main constructor for the Taxonomy Service */ constructor(private context: IWebPartContext | ExtensionContext) { this.clientServiceUrl = this.context.pageContext.web.absoluteUrl + '/_vti_bin/client.svc/ProcessQuery'; this.contextInfoUrl = this.context.pageContext.web.absoluteUrl + '/_api/contextinfo'; } /** * @function * Retrieves a new value for the Form Digest for SPO */ private async getFormDigest(): Promise { let httpPostOptions: ISPHttpClientOptions = { headers: { "accept": "application/json", "content-type": "application/json" } }; let contextInfoResponse: SPHttpClientResponse = await this.context.spHttpClient.post(this.contextInfoUrl, SPHttpClient.configurations.v1, httpPostOptions); let contextInfoJsonResponse: any = await contextInfoResponse.json(); const formDigest: string = contextInfoJsonResponse.FormDigestValue; return(formDigest); } /** * @function * Retrieves the value of a User Profile property for the current user */ public async getUserProfileProperty(propertyName: string): Promise { // if we are in a real SharePoint environment if (Environment.type === EnvironmentType.SharePoint || Environment.type === EnvironmentType.ClassicSharePoint) { this.formDigest = await this.getFormDigest(); // build the Client Service Request let data: string = ` `; let httpPostOptions: ISPHttpClientOptions = { headers: { 'accept': 'application/json', 'content-type': 'text/xml', "X-RequestDigest": this.formDigest }, body: data }; let serviceResponse: SPHttpClientResponse = await this.context.spHttpClient.post(this.clientServiceUrl, SPHttpClient.configurations.v1, httpPostOptions); let serviceJSONResponse: Array = await serviceResponse.json(); // extract the object of type SP.UserProfiles.PersonProperties from the array let personPropertiesCollection: IPersonProperties[] = serviceJSONResponse.filter( (child: any) => (child != null && child['_ObjectType_'] !== undefined && child['_ObjectType_'] === "SP.UserProfiles.PersonProperties") ); // and if any, process the TermSet objects in it if (personPropertiesCollection != null && personPropertiesCollection.length > 0) { let personProperties: IPersonProperties = personPropertiesCollection[0]; // return the requested User Profile property return(personProperties.UserProfileProperties[propertyName]); } } // default empty item in case of any missing data return (new Promise((resolve, reject) => { resolve(null); })); } /** * @function * Retrieves the value of a User Profile property for the current user */ public async setUserProfileProperty(propertyName: string, propertyType: string, value: any): Promise { // if we are in a real SharePoint environment if (Environment.type === EnvironmentType.SharePoint || Environment.type === EnvironmentType.ClassicSharePoint) { this.formDigest = await this.getFormDigest(); // make the request based on the current user's name const currentUserName: string = `i:0#.f|membership|${this.context.pageContext.user.loginName}`; // build the Client Service Request let data: string = ` ${currentUserName} ${propertyName} ${value} `; let httpPostOptions: ISPHttpClientOptions = { headers: { 'accept': 'application/json', 'content-type': 'text/xml', "X-RequestDigest": this.formDigest }, body: data }; let serviceResponse: SPHttpClientResponse = await this.context.spHttpClient.post(this.clientServiceUrl, SPHttpClient.configurations.v1, httpPostOptions); let serviceJSONResponse: Array = await serviceResponse.json(); // get the response, if any if (serviceJSONResponse != null && serviceJSONResponse.length > 0) { let response: ISetPropertyResponse = serviceJSONResponse[0]; // return the requested User Profile property return(response.ErrorInfo === null); } } // default to false in case of any missing data return (new Promise((resolve, reject) => { resolve(false); })); } } ================================================ FILE: source/react-application-collab-footer/src/services/SPUserProfileTypes.ts ================================================ /** * Defines SP.UserProfiles.PersonProperties type */ export interface IPersonProperties { _ObjectType_: string; AccountName: string; UserProfileProperties: any; } /** * Defines the structure of the response for a User Profile property updated */ export interface ISetPropertyResponse { ErrorInfo: string; LibraryVersion: string; SchemaVersion: string; TraceCorrelationId: string; } ================================================ FILE: source/react-application-collab-footer/tsconfig.json ================================================ { "extends": "./node_modules/@microsoft/rush-stack-compiler-4.5/includes/tsconfig-web.json", "compilerOptions": { "target": "es5", "forceConsistentCasingInFileNames": true, "module": "esnext", "moduleResolution": "node", "jsx": "react", "declaration": true, "sourceMap": true, "experimentalDecorators": true, "skipLibCheck": true, "outDir": "lib", "inlineSources": false, "strictNullChecks": false, "noImplicitAny": true, "typeRoots": [ "./node_modules/@types", "./node_modules/@microsoft" ], "types": [ "webpack-env" ], "lib": [ "es5", "dom", "es2015", "es2015.collection", "es2015.promise" ] }, "include": [ "src/**/*.ts", "src/**/*.tsx" ] } ================================================ FILE: source/react-application-portal-footer/.editorconfig ================================================ # EditorConfig helps developers define and maintain consistent # coding styles between different editors and IDEs # editorconfig.org root = true [*] # change these settings to your own preference indent_style = space indent_size = 2 # we recommend you to keep these unchanged end_of_line = lf charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true [*.md] trim_trailing_whitespace = false [{package,bower}.json] indent_style = space indent_size = 2 ================================================ FILE: source/react-application-portal-footer/.eslintrc.js ================================================ require('@rushstack/eslint-config/patch/modern-module-resolution'); module.exports = { extends: ['@microsoft/eslint-config-spfx/lib/profiles/default'], parserOptions: { tsconfigRootDir: __dirname }, overrides: [ { files: ['*.ts', '*.tsx'], parser: '@typescript-eslint/parser', 'parserOptions': { 'project': './tsconfig.json', 'ecmaVersion': 2018, 'sourceType': 'module' }, rules: { // Prevent usage of the JavaScript null value, while allowing code to access existing APIs that may require null. https://www.npmjs.com/package/@rushstack/eslint-plugin '@rushstack/no-new-null': 1, // Require Jest module mocking APIs to be called before any other statements in their code block. https://www.npmjs.com/package/@rushstack/eslint-plugin '@rushstack/hoist-jest-mock': 1, // Require regular expressions to be constructed from string constants rather than dynamically building strings at runtime. https://www.npmjs.com/package/@rushstack/eslint-plugin-security '@rushstack/security/no-unsafe-regexp': 1, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/adjacent-overload-signatures': 1, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // // CONFIGURATION: By default, these are banned: String, Boolean, Number, Object, Symbol '@typescript-eslint/ban-types': [ 1, { 'extendDefaults': false, 'types': { 'String': { 'message': 'Use \'string\' instead', 'fixWith': 'string' }, 'Boolean': { 'message': 'Use \'boolean\' instead', 'fixWith': 'boolean' }, 'Number': { 'message': 'Use \'number\' instead', 'fixWith': 'number' }, 'Object': { 'message': 'Use \'object\' instead, or else define a proper TypeScript type:' }, 'Symbol': { 'message': 'Use \'symbol\' instead', 'fixWith': 'symbol' }, 'Function': { 'message': 'The \'Function\' type accepts any function-like value.\nIt provides no type safety when calling the function, which can be a common source of bugs.\nIt also accepts things like class declarations, which will throw at runtime as they will not be called with \'new\'.\nIf you are expecting the function to accept certain arguments, you should explicitly define the function shape.' } } } ], // RATIONALE: Code is more readable when the type of every variable is immediately obvious. // Even if the compiler may be able to infer a type, this inference will be unavailable // to a person who is reviewing a GitHub diff. This rule makes writing code harder, // but writing code is a much less important activity than reading it. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/explicit-function-return-type': [ 0, { 'allowExpressions': true, 'allowTypedFunctionExpressions': true, 'allowHigherOrderFunctions': false } ], // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // Rationale to disable: although this is a recommended rule, it is up to dev to select coding style. // Set to 1 (warning) or 2 (error) to enable. '@typescript-eslint/explicit-member-accessibility': 0, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/no-array-constructor': 1, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // // RATIONALE: The "any" keyword disables static type checking, the main benefit of using TypeScript. // This rule should be suppressed only in very special cases such as JSON.stringify() // where the type really can be anything. Even if the type is flexible, another type // may be more appropriate such as "unknown", "{}", or "Record". '@typescript-eslint/no-explicit-any': 0, // RATIONALE: The #1 rule of promises is that every promise chain must be terminated by a catch() // handler. Thus wherever a Promise arises, the code must either append a catch handler, // or else return the object to a caller (who assumes this responsibility). Unterminated // promise chains are a serious issue. Besides causing errors to be silently ignored, // they can also cause a NodeJS process to terminate unexpectedly. '@typescript-eslint/no-floating-promises': 0, // RATIONALE: Catches a common coding mistake. '@typescript-eslint/no-for-in-array': 2, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/no-misused-new': 2, // RATIONALE: The "namespace" keyword is not recommended for organizing code because JavaScript lacks // a "using" statement to traverse namespaces. Nested namespaces prevent certain bundler // optimizations. If you are declaring loose functions/variables, it's better to make them // static members of a class, since classes support property getters and their private // members are accessible by unit tests. Also, the exercise of choosing a meaningful // class name tends to produce more discoverable APIs: for example, search+replacing // the function "reverse()" is likely to return many false matches, whereas if we always // write "Text.reverse()" is more unique. For large scale organization, it's recommended // to decompose your code into separate NPM packages, which ensures that component // dependencies are tracked more conscientiously. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/no-namespace': [ 1, { 'allowDeclarations': false, 'allowDefinitionFiles': false } ], // RATIONALE: Parameter properties provide a shorthand such as "constructor(public title: string)" // that avoids the effort of declaring "title" as a field. This TypeScript feature makes // code easier to write, but arguably sacrifices readability: In the notes for // "@typescript-eslint/member-ordering" we pointed out that fields are central to // a class's design, so we wouldn't want to bury them in a constructor signature // just to save some typing. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // Set to 1 (warning) or 2 (error) to enable the rule '@typescript-eslint/no-parameter-properties': 0, // RATIONALE: When left in shipping code, unused variables often indicate a mistake. Dead code // may impact performance. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/no-unused-vars': [ 1, { 'vars': 'all', // Unused function arguments often indicate a mistake in JavaScript code. However in TypeScript code, // the compiler catches most of those mistakes, and unused arguments are fairly common for type signatures // that are overriding a base class method or implementing an interface. 'args': 'none' } ], // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/no-use-before-define': [ 2, { 'functions': false, 'classes': true, 'variables': true, 'enums': true, 'typedefs': true } ], // Disallows require statements except in import statements. // In other words, the use of forms such as var foo = require("foo") are banned. Instead use ES6 style imports or import foo = require("foo") imports. '@typescript-eslint/no-var-requires': 'error', // RATIONALE: The "module" keyword is deprecated except when describing legacy libraries. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/prefer-namespace-keyword': 1, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // Rationale to disable: it's up to developer to decide if he wants to add type annotations // Set to 1 (warning) or 2 (error) to enable the rule '@typescript-eslint/no-inferrable-types': 0, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // Rationale to disable: declaration of empty interfaces may be helpful for generic types scenarios '@typescript-eslint/no-empty-interface': 0, // RATIONALE: This rule warns if setters are defined without getters, which is probably a mistake. 'accessor-pairs': 1, // RATIONALE: In TypeScript, if you write x["y"] instead of x.y, it disables type checking. 'dot-notation': [ 1, { 'allowPattern': '^_' } ], // RATIONALE: Catches code that is likely to be incorrect 'eqeqeq': 0, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'for-direction': 1, // RATIONALE: Catches a common coding mistake. 'guard-for-in': 2, // RATIONALE: If you have more than 2,000 lines in a single source file, it's probably time // to split up your code. 'max-lines': ['warn', { max: 2000 }], // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-async-promise-executor': 2, // RATIONALE: Deprecated language feature. 'no-caller': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-compare-neg-zero': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-cond-assign': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-constant-condition': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-control-regex': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-debugger': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-delete-var': 2, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-duplicate-case': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-empty': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-empty-character-class': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-empty-pattern': 1, // RATIONALE: Eval is a security concern and a performance concern. 'no-eval': 1, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-ex-assign': 2, // RATIONALE: System types are global and should not be tampered with in a scalable code base. // If two different libraries (or two versions of the same library) both try to modify // a type, only one of them can win. Polyfills are acceptable because they implement // a standardized interoperable contract, but polyfills are generally coded in plain // JavaScript. 'no-extend-native': 1, // Disallow unnecessary labels 'no-extra-label': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-fallthrough': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-func-assign': 1, // RATIONALE: Catches a common coding mistake. 'no-implied-eval': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-invalid-regexp': 2, // RATIONALE: Catches a common coding mistake. 'no-label-var': 2, // RATIONALE: Eliminates redundant code. 'no-lone-blocks': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-misleading-character-class': 2, // RATIONALE: Catches a common coding mistake. 'no-multi-str': 2, // RATIONALE: It's generally a bad practice to call "new Thing()" without assigning the result to // a variable. Either it's part of an awkward expression like "(new Thing()).doSomething()", // or else implies that the constructor is doing nontrivial computations, which is often // a poor class design. 'no-new': 1, // RATIONALE: Obsolete language feature that is deprecated. 'no-new-func': 2, // RATIONALE: Obsolete language feature that is deprecated. 'no-new-object': 2, // RATIONALE: Obsolete notation. 'no-new-wrappers': 1, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-octal': 2, // RATIONALE: Catches code that is likely to be incorrect 'no-octal-escape': 2, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-regex-spaces': 2, // RATIONALE: Catches a common coding mistake. 'no-return-assign': 2, // RATIONALE: Security risk. 'no-script-url': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-self-assign': 2, // RATIONALE: Catches a common coding mistake. 'no-self-compare': 2, // RATIONALE: This avoids statements such as "while (a = next(), a && a.length);" that use // commas to create compound expressions. In general code is more readable if each // step is split onto a separate line. This also makes it easier to set breakpoints // in the debugger. 'no-sequences': 1, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-shadow-restricted-names': 2, // RATIONALE: Obsolete language feature that is deprecated. // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-sparse-arrays': 2, // RATIONALE: Although in theory JavaScript allows any possible data type to be thrown as an exception, // such flexibility adds pointless complexity, by requiring every catch block to test // the type of the object that it receives. Whereas if catch blocks can always assume // that their object implements the "Error" contract, then the code is simpler, and // we generally get useful additional information like a call stack. 'no-throw-literal': 2, // RATIONALE: Catches a common coding mistake. 'no-unmodified-loop-condition': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-unsafe-finally': 2, // RATIONALE: Catches a common coding mistake. 'no-unused-expressions': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-unused-labels': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-useless-catch': 1, // RATIONALE: Avoids a potential performance problem. 'no-useless-concat': 1, // RATIONALE: The "var" keyword is deprecated because of its confusing "hoisting" behavior. // Always use "let" or "const" instead. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json 'no-var': 2, // RATIONALE: Generally not needed in modern code. 'no-void': 1, // RATIONALE: Obsolete language feature that is deprecated. // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-with': 2, // RATIONALE: Makes logic easier to understand, since constants always have a known value // @typescript-eslint\eslint-plugin\dist\configs\eslint-recommended.js 'prefer-const': 0, // RATIONALE: Catches a common coding mistake where "resolve" and "reject" are confused. 'promise/param-names': 2, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'require-atomic-updates': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'require-yield': 1, // "Use strict" is redundant when using the TypeScript compiler. 'strict': [ 2, 'never' ], // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'use-isnan': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js // Set to 1 (warning) or 2 (error) to enable. // Rationale to disable: !!{} 'no-extra-boolean-cast': 0, // ==================================================================== // @microsoft/eslint-plugin-spfx // ==================================================================== '@microsoft/spfx/import-requires-chunk-name': 1, '@microsoft/spfx/no-require-ensure': 2, '@microsoft/spfx/pair-react-dom-render-unmount': 0, // ==================================================================== // no-useless-escape // ==================================================================== 'no-useless-escape': 0 } }, { // For unit tests, we can be a little bit less strict. The settings below revise the // defaults specified in the extended configurations, as well as above. files: [ // Test files '*.test.ts', '*.test.tsx', '*.spec.ts', '*.spec.tsx', // Facebook convention '**/__mocks__/*.ts', '**/__mocks__/*.tsx', '**/__tests__/*.ts', '**/__tests__/*.tsx', // Microsoft convention '**/test/*.ts', '**/test/*.tsx' ], rules: {} } ] }; ================================================ FILE: source/react-application-portal-footer/.gitignore ================================================ # Logs logs *.log npm-debug.log* # Dependency directories node_modules # Build generated files dist lib release solution temp *.sppkg .heft # Coverage directory used by tools like istanbul coverage # OSX .DS_Store # Visual Studio files .ntvs_analysis.dat .vs bin obj # Resx Generated Code *.resx.ts # Styles Generated Code *.scss.ts # Package Lock package-lock.json ================================================ FILE: source/react-application-portal-footer/.npmignore ================================================ !dist config gulpfile.js release src temp tsconfig.json tslint.json *.log .yo-rc.json .vscode ================================================ FILE: source/react-application-portal-footer/.vscode/launch.json ================================================ { "version": "0.2.0", "configurations": [ { "name": "Hosted workbench", "type": "pwa-chrome", "request": "launch", "url": "https://enter-your-SharePoint-site/_layouts/workbench.aspx", "webRoot": "${workspaceRoot}", "sourceMaps": true, "sourceMapPathOverrides": { "webpack:///.././src/*": "${webRoot}/src/*", "webpack:///../../../src/*": "${webRoot}/src/*", "webpack:///../../../../src/*": "${webRoot}/src/*", "webpack:///../../../../../src/*": "${webRoot}/src/*" }, "runtimeArgs": [ "--remote-debugging-port=9222", "-incognito" ] } ] } ================================================ FILE: source/react-application-portal-footer/.vscode/settings.json ================================================ // Place your settings in this file to overwrite default and user settings. { // Configure glob patterns for excluding files and folders in the file explorer. "files.exclude": { "**/.git": true, "**/.DS_Store": true, "**/bower_components": true, "**/coverage": true, "**/lib-amd": true, "src/**/*.scss.ts": true }, "typescript.tsdk": ".\\node_modules\\typescript\\lib" } ================================================ FILE: source/react-application-portal-footer/.yo-rc.json ================================================ { "@microsoft/generator-sharepoint": { "plusBeta": false, "isCreatingSolution": true, "nodeVersion": "16.19.0", "sdksVersions": { "@microsoft/microsoft-graph-client": "3.0.2", "@microsoft/teams-js": "2.4.1" }, "version": "1.16.1", "environment": "spo", "libraryName": "react-application-portal-footer", "libraryId": "4d7c1cea-0ef5-4143-88f6-43411d978b2f", "packageManager": "npm", "componentType": "extension", "extensionType": "ApplicationCustomizer", "skipFeatureDeployment": true, "isDomainIsolated": false } } ================================================ FILE: source/react-application-portal-footer/README.md ================================================ # Portal Footer Application Customizer This application customizer provides you the ability to include a footer designed for communiation sites. The footer includes sets of links configured using the tenant wide deployment list at the app catalog (global links). A second set of links are personalized links, unqiue to each user, stored within each user's user profile within a user profile property. If this property does not exist in the user profile service, this capability will be hidden. Portal footer has extending UI experience if user clicks the top arrow in the footer. ![Portal Footer](../../assets/images/components/ext-portal-footer.gif) Details on implementation at https://github.com/SharePoint/sp-starter-kit/blob/master/documentation/components/ext-portal-footer.md ## Configurable Properties The `Portal Footer` application customizers can be configured with the following properties: | Label | Property | Type | Required | Description | | ---- | ---- | ---- | ---- | ---- | | Global links | linksListTitle | string | yes | The title of the list of global links | | User profile propery name | personalItemsStorageProperty | string | yes | The name of the user profile property to store user specific links | | Copyright message | copyright | string | yes | Footer copyright message | | Support message | support | string | yes | A support message, i.e. email address or link | ## Modifying Extension properties This extension has a collection of properties that are set by default, although may be modified using the [`PnP PowerShell`](https://github.com/pnp/powershell) commandlet Set-PnPApplicationCustomizer. ```powershell Set-PnPApplicationCustomizer -Title "PortalFooter" -ClientSideComponentId df889434-1b1c-4f5b-ada3-086d948e4270 -ClientSideComponentProperties "{`"linksListTitle`":`"PnP-PortalFooter-Links`",`"personalItemsStorageProperty`":`"PnP-CollabFooter-MyLinks`",`"copyright`":`"Ⓒ Copyright 2023`",`"support`":`"support@contoso.com`"}" ``` ## Used SharePoint Framework Version ![drop](https://img.shields.io/badge/version-1.16.1-green.svg) * Supported in SharePoint Online ## Applies to * [SharePoint Framework](https://learn.microsoft.com/en-us/sharepoint/dev/spfx/sharepoint-framework-overview) * [Office 365 tenant](https://learn.microsoft.com/en-us/sharepoint/dev/spfx/set-up-your-development-environment) ## Prerequisites The shared links are retrieved from a list called `PnP-PortalFooter-Links`. The webpart will first look to see if the site is part of a hub site and get the data from the list from that hub site. If no hub site is available it falls back to the local site as the source. If you have not applied the starterkit.pnp package you can find the xml used to provision the list [here](../../provisioning/starterkit.xml) Personalized links only works if a custom property called `PnP-CollabFooter-MyLinks` has been added to the user profile service. By default, this custom property is shared by both the portal and collaboration footer extensions to provide one list per user of customized links. This is string based property with maximum lenght. As there's no APIs to automate the property creation to the user profile service, this property will need to be manually created to enable the personalized links capability. Instructions to set up the custom property can be found [here](../../documentation/tenant-settings.md#create-a-custom-property-in-the-user-profile-service). Both component property names can be [changed in the SPFx extension properties](#modifying-extension-properties). ## Solution Solution|Author(s) --------|--------- react-application-portal-footer | Waldek Mastykarz react-application-portal-footer | Paolo Pialorsi react-application-portal-footer | David Opdendries react-application-portal-footer | Chandani Prajapati ## Version history Version|Date|Comments -------|----|-------- 1.0|January 2019|Initial release for SharePoint Starter Kit v2 2.0|January 1, 2020|Initial release for SharePoint Starter Kit v2 3.0|February 2023|v3 - Upgraded to SPFx 1.16.1 ## Disclaimer **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.** --- ## Minimal Path to Awesome * Clone this repository * Move to correct folder where solution exists * in the command line run: * `npm install` * `gulp serve` ## Features Key features demostrated by this solution: * PnPjs usage in the solution * Dynamic creation of the list if it's missing * Work with data from user property ================================================ FILE: source/react-application-portal-footer/config/config.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/config.2.0.schema.json", "version": "2.0", "bundles": { "portal-footer-application-customizer": { "components": [ { "entrypoint": "./lib/extensions/portalFooter/PortalFooterApplicationCustomizer.js", "manifest": "./src/extensions/portalFooter/PortalFooterApplicationCustomizer.manifest.json" } ] } }, "externals": {}, "localizedResources": { "PortalFooterApplicationCustomizerStrings": "lib/extensions/portalFooter/loc/{locale}.js", "MyLinksStrings": "lib/extensions/portalFooter/components/myLinks/loc/{locale}.js" } } ================================================ FILE: source/react-application-portal-footer/config/deploy-azure-storage.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/deploy-azure-storage.schema.json", "workingDir": "./release/assets/", "account": "", "container": "react-application-portal-footer", "accessKey": "" } ================================================ FILE: source/react-application-portal-footer/config/package-solution.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/package-solution.schema.json", "solution": { "name": "Starter Kit - Portal Footer", "id": "4d7c1cea-0ef5-4143-88f6-43411d978b2f", "version": "3.0.0.0", "includeClientSideAssets": true, "skipFeatureDeployment": true, "isDomainIsolated": false, "developer": { "name": "PnP Starter Kit", "websiteUrl": "", "privacyUrl": "", "termsOfUseUrl": "", "mpnId": "pnpsk" }, "metadata": { "shortDescription": { "default": "react-application-portal-footer description" }, "longDescription": { "default": "react-application-portal-footer description" }, "screenshotPaths": [], "videoUrl": "", "categories": [] }, "features": [ { "title": "Application Extension - Deployment of custom action.", "description": "Deploys a custom action with ClientSideComponentId association", "id": "5716e6ec-8ef5-4ce3-9064-02bd771988e8", "version": "3.0.0.0", "assets": { "elementManifests": [ "elements.xml", "clientsideinstance.xml" ] } } ] }, "paths": { "zippedPackage": "solution/react-application-portal-footer.sppkg" } } ================================================ FILE: source/react-application-portal-footer/config/sass.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/core-build/sass.schema.json" } ================================================ FILE: source/react-application-portal-footer/config/serve.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/spfx-serve.schema.json", "port": 4321, "https": true, "serveConfigurations": { "default": { "pageUrl": "https://contoso.sharepoint.com", "customActions": { "df889434-1b1c-4f5b-ada3-086d948e4270": { "location": "ClientSideExtension.ApplicationCustomizer", "properties": { "linksListTitle": "PnP-PortalFooter-Links", "personalItemsStorageProperty": "PnP-CollabFooter-MyLinks", "copyright": "2019", "support" :"help@contoso.com" } } } }, "portalFooter": { "pageUrl": "https://contoso.sharepoint.com", "customActions": { "df889434-1b1c-4f5b-ada3-086d948e4270": { "location": "ClientSideExtension.ApplicationCustomizer", "properties": { "linksListTitle": "PnP-PortalFooter-Links", "personalItemsStorageProperty": "PnP-CollabFooter-MyLinks", "copyright": "2019", "support" :"help@contoso.com" } } } } } } ================================================ FILE: source/react-application-portal-footer/config/write-manifests.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/write-manifests.schema.json", "cdnBasePath": "" } ================================================ FILE: source/react-application-portal-footer/gulpfile.js ================================================ 'use strict'; const build = require('@microsoft/sp-build-web'); build.addSuppression(`Warning - [sass] The local CSS class 'ms-Grid' is not camelCase and will not be type-safe.`); var getTasks = build.rig.getTasks; build.rig.getTasks = function () { var result = getTasks.call(build.rig); result.set('serve', result.get('serve-deprecated')); return result; }; build.initialize(require('gulp')); ================================================ FILE: source/react-application-portal-footer/package.json ================================================ { "name": "react-application-portal-footer", "version": "3.0.0", "private": true, "main": "lib/index.js", "engines": { "node": ">=0.10.0" }, "scripts": { "build": "gulp bundle", "clean": "gulp clean", "test": "gulp test" }, "dependencies": { "@microsoft/decorators": "1.16.1", "@microsoft/sp-application-base": "1.16.1", "@microsoft/sp-core-library": "1.16.1", "@microsoft/sp-dialog": "1.16.1", "@microsoft/sp-office-ui-fabric-core": "1.16.1", "@microsoft/sp-webpart-base": "1.16.1", "@pnp/sp": "3.11.0", "react": "17.0.1", "react-dom": "17.0.1", "tslib": "2.3.1" }, "resolutions": { "@types/react": "16.8.8" }, "devDependencies": { "@microsoft/eslint-config-spfx": "1.16.1", "@microsoft/eslint-plugin-spfx": "1.16.1", "@microsoft/rush-stack-compiler-4.5": "0.2.2", "@microsoft/sp-build-web": "1.16.1", "@microsoft/sp-module-interfaces": "1.16.1", "@microsoft/sp-tslint-rules": "1.14.0", "@rushstack/eslint-config": "2.5.1", "@types/es6-promise": "0.0.33 ", "@types/react": "17.0.45", "@types/react-dom": "17.0.17", "@types/webpack-env": "1.15.2", "ajv": "6.12.5", "eslint": "8.7.0", "eslint-plugin-react-hooks": "4.3.0", "gulp": "4.0.2", "tslint-microsoft-contrib": "5.0.0", "typescript": "4.5.5" } } ================================================ FILE: source/react-application-portal-footer/sharepoint/assets/ClientSideInstance.xml ================================================ ================================================ FILE: source/react-application-portal-footer/sharepoint/assets/elements.xml ================================================ ================================================ FILE: source/react-application-portal-footer/src/extensions/portalFooter/IHubSiteData.ts ================================================ export interface IHubSiteDataResponse { ["odata.metadata"]: string; value: string; } export interface IHubSiteData { themeKey: string; name: string; url: string; logoUrl: string; usesMetadataNavigation: boolean; navigation: { Id: number; Title: string; Url: string; IsDocLib: boolean; IsExternal: boolean; ParentId: number; ListTemplateType: number; Children: any[] }[]; } ================================================ FILE: source/react-application-portal-footer/src/extensions/portalFooter/ILinkListItem.ts ================================================ export interface ILinkListItem { PnPPortalLinkGroup: string; Title: string; PnPPortalLinkUrl: { Description: string; Url: string; }; } ================================================ FILE: source/react-application-portal-footer/src/extensions/portalFooter/PortalFooterApplicationCustomizer.manifest.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx/client-side-extension-manifest.schema.json", "id": "df889434-1b1c-4f5b-ada3-086d948e4270", "alias": "PortalFooterApplicationCustomizer", "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 } ================================================ FILE: source/react-application-portal-footer/src/extensions/portalFooter/PortalFooterApplicationCustomizer.ts ================================================ import * as React from 'react'; import * as ReactDom from 'react-dom'; import { override } from '@microsoft/decorators'; import { Log } from '@microsoft/sp-core-library'; import { BaseApplicationCustomizer, PlaceholderContent, PlaceholderName } from '@microsoft/sp-application-base'; import * as strings from 'PortalFooterApplicationCustomizerStrings'; const LOG_SOURCE: string = 'PortalFooterApplicationCustomizer'; import { IPortalFooterProps, PortalFooter } from './components/PortalFooter'; import { ILinkGroup } from './components/PortalFooter/ILinkGroup'; // import additional controls/components import { SPHttpClient, SPHttpClientResponse } from '@microsoft/sp-http'; import { IHubSiteData, IHubSiteDataResponse } from './IHubSiteData'; import { ILinkListItem } from './ILinkListItem'; import SPUserProfileService from '../../services/SPUserProfileService'; import MyLinksDialog from './components/myLinks/MyLinksDialog'; import IMyLink from './components/myLinks/IMyLink'; import { IPortalFooterEditResult } from './components/PortalFooter/IPortalFooterEditResult'; /** * 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 IPortalFooterApplicationCustomizerProperties { // the title of the list, in the Hub Site, holding the link items linksListTitle: string; // copyright message for the footer copyright?: string; // support text for the footer support?: string; // the UPS property to store the MyLinks items personalItemsStorageProperty: string; } /** A Custom Action which can be run during execution of a Client Side Application */ export default class PortalFooterApplicationCustomizer extends BaseApplicationCustomizer { private _bottomPlaceholder?: PlaceholderContent; private _myLinks: IMyLink[]; private _handleDispose(): void { console.log('[PortalFooterApplicationCustomizer._onDispose] Disposed custom bottom placeholder.'); } @override public async onInit(): Promise { // get the hub site URL let hubSiteUrl: string = await this.getHubSiteUrl(); if (!hubSiteUrl) { console.log('Current site is not part of an hub and the footer will fallback to local list of links.'); hubSiteUrl = this.context.pageContext.web.absoluteUrl; } Log.info(LOG_SOURCE, `Initialized ${strings.Title}`); let linksListTitle: string = this.properties.linksListTitle; let copyright: string = this.properties.copyright; let support: string = this.properties.support; let personalItemsStorageProperty: string = this.properties.personalItemsStorageProperty; if (!linksListTitle || !copyright || !support || !personalItemsStorageProperty) { console.log('Provide valid properties for PortalFooterApplicationCustomizer!'); } // call render method for generating the needed html elements return (await this._renderPlaceHolders()); } private _editLinks = async (): Promise => { let result: IPortalFooterEditResult = { editResult: null, links: null, }; const myLinksDialog: MyLinksDialog = new MyLinksDialog(this._myLinks); await myLinksDialog.show(); // update the local list of links let resultingLinks: IMyLink[] = myLinksDialog.links; // Do not save if the dialog was cancelled if (myLinksDialog.isSave) { if (this._myLinks !== resultingLinks) { this._myLinks = resultingLinks; // save the personal links in the UPS, if there are any updates let upsService: SPUserProfileService = new SPUserProfileService(this.context); result.editResult = await upsService.setUserProfileProperty(this.properties.personalItemsStorageProperty, 'String', JSON.stringify(this._myLinks)); } } result.links = await this.loadLinks(); return (result); } // retrieves the URL of the hub site for the current site private async getHubSiteUrl(): Promise { let result: string = null; try { // get the hub site data via REST API let response: SPHttpClientResponse = await this.context.spHttpClient .get(`${this.context.pageContext.web.absoluteUrl}/_api/web/hubsitedata`, SPHttpClient.configurations.v1); // deserialize JSON response and, if any, get the URL of the hub site const hubSiteDataResponse: IHubSiteDataResponse = await response.json(); if (hubSiteDataResponse) { let hubSiteData: IHubSiteData = hubSiteDataResponse.value && JSON.parse(hubSiteDataResponse.value); if (hubSiteData) { result = hubSiteData.url; } } } catch (error) { console.log(error); } return (result); } // loads the groups of links from the hub site reference list private async loadLinks(): Promise { const { spfi, SPFx } = await import( /* webpackChunkName: 'pnp-sp' */ "@pnp/sp/presets/all"); // initialize PnP JS library to play with SPFx contenxt const sp = spfi().using(SPFx(this.context)); // prepare the result variable let result: ILinkGroup[] = []; // get the links from the source list let items: ILinkListItem[] = await sp.web .lists.getByTitle(this.properties.linksListTitle) .items.select("Title", "PnPPortalLinkGroup", "PnPPortalLinkUrl").top(100) .orderBy("PnPPortalLinkGroup", true) .orderBy("Title", true)(); // console.log("ITEMS: >>", items); // map the list items to the results items.map((v, i, a) => { // in case we have a new group title if (result.length === 0 || v.PnPPortalLinkGroup !== result[result.length - 1].title) { // create the new group and add the current item result.push({ title: v.PnPPortalLinkGroup, links: [{ title: v.Title, url: v.PnPPortalLinkUrl.Url, }], }); } else { // or add the current item to the already existing group result[result.length - 1].links.push({ title: v.Title, url: v.PnPPortalLinkUrl.Url, }); } }); // get the list of personal items from the User Profile Service let upsService: SPUserProfileService = new SPUserProfileService(this.context); let myLinksJson: any = await upsService.getUserProfileProperty(this.properties.personalItemsStorageProperty); // if we have personalizes links if (myLinksJson != null) { if (myLinksJson.length > 0) { this._myLinks = JSON.parse(myLinksJson) as IMyLink[]; // add all of them to the "My Links" group if (this._myLinks.length > 0) { result.push({ title: strings.MyLinks, links: this._myLinks, }); } } else { // if there are no personal items for my links, just provide an empty array that can be customized this._myLinks = []; } } return (result); } private async _renderPlaceHolders(): Promise { // check if the application customizer has already been rendered if (!this._bottomPlaceholder) { // create a DOM element in the bottom placeholder for the application customizer to render this._bottomPlaceholder = this.context.placeholderProvider .tryCreateContent(PlaceholderName.Bottom, { onDispose: this._handleDispose }); } // if the top placeholder is not available, there is no place in the UI // for the app customizer to render, so quit. if (!this._bottomPlaceholder) { return; } const links: ILinkGroup[] = await this.loadLinks(); const element: React.ReactElement = React.createElement( PortalFooter, { links: links, copyright: this.properties.copyright, support: this.properties.support, onLinksEdit: this._editLinks, } ); // render the UI using a React component ReactDom.render(element, this._bottomPlaceholder.domElement); } } ================================================ FILE: source/react-application-portal-footer/src/extensions/portalFooter/components/Links/ILinksProps.ts ================================================ import { ILinkGroup } from "../PortalFooter"; export interface ILinksProps { links: ILinkGroup[]; loadingLinks: boolean; visible: boolean; onMyLinksEdit: () => Promise; } ================================================ FILE: source/react-application-portal-footer/src/extensions/portalFooter/components/Links/Links.module.scss ================================================ @import '~@fluentui/react/dist/sass/References.scss'; .links { background-color: $ms-color-neutralLighter; color: $ms-color-neutralPrimary; transition: height 0.5s; overflow: hidden; position: relative; height: 0; .content { padding: 25px; } &.visible { height: auto; } &.hidden { height: 0; } .linksGroupTitle { color: inherit; font-weight: bold; } ul { list-style-type: none; padding: 0; } li { margin: 0.2em 0; } a { color: inherit; text-decoration: none; &:hover { color: $ms-color-neutralSecondary; } } .editButton { color: inherit; position: absolute; top: 0.5em; right: 0.5em; padding: 0.5em; min-width: 0; } } ================================================ FILE: source/react-application-portal-footer/src/extensions/portalFooter/components/Links/Links.tsx ================================================ import * as React from 'react'; import styles from './Links.module.scss'; import * as strings from 'PortalFooterApplicationCustomizerStrings'; import { DefaultButton } from '@fluentui/react/lib/Button'; import { ILinksProps } from '.'; export class Links extends React.Component { private _handleEdit = async (): Promise => { return(await this.props.onMyLinksEdit()); } public render(): React.ReactElement { return (
{this.props.links.map(g =>
{g.title}
)}
{strings.Edit}
); } } ================================================ FILE: source/react-application-portal-footer/src/extensions/portalFooter/components/Links/index.ts ================================================ export * from './ILinksProps'; export * from './Links'; ================================================ FILE: source/react-application-portal-footer/src/extensions/portalFooter/components/PortalFooter/ILinkGroup.ts ================================================ export interface ILinkGroup { title: string; links: { title: string; url: string; }[]; } ================================================ FILE: source/react-application-portal-footer/src/extensions/portalFooter/components/PortalFooter/IPortalFooterEditResult.ts ================================================ import { ILinkGroup } from "."; export interface IPortalFooterEditResult { editResult?: boolean; links: ILinkGroup[]; } ================================================ FILE: source/react-application-portal-footer/src/extensions/portalFooter/components/PortalFooter/IPortalFooterProps.ts ================================================ import { ILinkGroup } from "."; import { IPortalFooterEditResult } from "./IPortalFooterEditResult"; export interface IPortalFooterProps { links: ILinkGroup[]; copyright: string; support: string; onLinksEdit: () => Promise; } ================================================ FILE: source/react-application-portal-footer/src/extensions/portalFooter/components/PortalFooter/IPortalFooterState.ts ================================================ import { ILinkGroup } from "."; export interface IPortalFooterState { // state variable to show the result of saving my links myLinksSaved?: boolean; // used to hold the expanded/collapsed state for menu expanded: boolean; // used to hold the link groups links: ILinkGroup[]; // used to determine if we are loading the links loadingLinks: boolean; // used to manage the expand/collapse button icon toggleButtonIconName: string; } ================================================ FILE: source/react-application-portal-footer/src/extensions/portalFooter/components/PortalFooter/PortalFooter.module.scss ================================================ @import '~@fluentui/react/dist/sass/References.scss'; .portalFooter { .main { // inherit theme colors background-color: $ms-color-themePrimary; @include ms-fontColor-white; padding-left: 10px; } .supportButton { color: inherit; &:hover { background-color: $ms-color-themeDark; } &:hover i, i { color: inherit; } } .copyright { color: inherit; line-height: 30px; } .filler { color: inherit; line-height: 30px; } // put the toggle control on the right hand side .toggleControl { float: right; width: 1em; margin-right: 0.5em; .toggleButton { background-color: transparent; border: 0; color: inherit; padding: 0; min-width: 0; div { width: 1em; height: 40px; line-height: 40px; } } } } ================================================ FILE: source/react-application-portal-footer/src/extensions/portalFooter/components/PortalFooter/PortalFooter.tsx ================================================ import * as React from 'react'; import { IPortalFooterProps, IPortalFooterState } from '.'; import styles from './PortalFooter.module.scss'; import { DefaultButton, ActionButton } from '@fluentui/react/lib/Button'; import { Label } from '@fluentui/react/lib/Label'; import { MessageBar, MessageBarType } from '@fluentui/react/lib/MessageBar'; import * as strings from 'PortalFooterApplicationCustomizerStrings'; import { Links } from '../Links'; import { IPortalFooterEditResult } from '../PortalFooter/IPortalFooterEditResult'; export class PortalFooter extends React.Component { constructor(props: IPortalFooterProps) { super(props); this.state = { expanded: false, toggleButtonIconName: 'DoubleChevronUp', loadingLinks: false, links: props.links, }; } private _handleToggle = (): void => { const wasExpanded: boolean = this.state.expanded; this.setState({ expanded: !wasExpanded, toggleButtonIconName: wasExpanded ? 'DoubleChevronUp' : 'DoubleChevronDown' }); } private _handleSupport = (): void => { const supportUrl: string = `mailto:${this.props.support}`; location.href = supportUrl; console.log(supportUrl); } private _handleLinksEdit = async (): Promise => { let editResult: IPortalFooterEditResult = await this.props.onLinksEdit(); if (editResult != null) { this.setState({ myLinksSaved: editResult.editResult, links: editResult.links }); // hide the message after 2 sec window.setTimeout(() => { this.setState({ myLinksSaved: null, }); }, 2000); } } public render(): React.ReactElement { return (
{this.state.myLinksSaved != null ? (this.state.myLinksSaved ? {strings.MyLinksSaveSuccess} : {strings.MyLinksSaveFailed}) : null}
{this.props.support}
); } } ================================================ FILE: source/react-application-portal-footer/src/extensions/portalFooter/components/PortalFooter/index.ts ================================================ export * from './ILinkGroup'; export * from './IPortalFooterEditResult'; export * from './IPortalFooterProps'; export * from './IPortalFooterState'; export * from './PortalFooter'; ================================================ FILE: source/react-application-portal-footer/src/extensions/portalFooter/components/myLinks/IMyLink.ts ================================================ /** * Interface to define a single URL item for My Links */ export default interface IMyLink { // the Title of the Link title: string; // the URL of theLink url: string; } ================================================ FILE: source/react-application-portal-footer/src/extensions/portalFooter/components/myLinks/MyLinks.module.scss ================================================ @import '~@fluentui/react/dist/sass/References.scss'; .myLinksDialogRoot { .myLinksDialogContent { text-align: left; vertical-align: top; .editPanel { margin-top: 10px; margin-bottom: 10px; } .textField { width: 250px; } } } ================================================ FILE: source/react-application-portal-footer/src/extensions/portalFooter/components/myLinks/MyLinksDialog.tsx ================================================ import * as React from 'react'; import * as ReactDOM from 'react-dom'; // import supporting types import IMyLink from './IMyLink'; import styles from './MyLinks.module.scss'; import * as strings from 'MyLinksStrings'; // import additional controls/components import { BaseDialog, IDialogConfiguration } from '@microsoft/sp-dialog'; import { DefaultButton } from '@fluentui/react/lib/Button'; import { TextField } from '@fluentui/react/lib/TextField'; import { CommandBar } from '@fluentui/react/lib/CommandBar'; import { DetailsList, DetailsListLayoutMode, Selection, SelectionMode, IColumn } from '@fluentui/react/lib/DetailsList'; import { DialogContent, DialogFooter } from '@fluentui/react/lib/Dialog'; /** * Define the columns that will be used to render the list of links */ const _linksColumns: IColumn[] = [ { key: 'TitleColumn', name: strings.TitleColumn, fieldName: 'title', minWidth: 150, maxWidth: 350, isResizable: true, ariaLabel: strings.TitleColumnAriaLabel }, { key: 'urlColumn', name: strings.UrlColumn, fieldName: 'url', minWidth: 150, maxWidth: 350, isResizable: true, ariaLabel: strings.UrlColumnAriaLabel }, ]; /** * Defines the initialization properties for the MyLinks dialog window */ interface IMyLinksDialogContentProps { // the array of Links to render/manage links: Array; // cancel button handler, to undo the changes cancel: () => void; // save button handler, to save the Links save: (links: Array) => void; } /** * Defines the state for the MyLinks dialog window */ interface IMyLinksDialogContentState { // the Links to render/manage links: Array; // currently selected item, if any selectedLink?: IMyLink; // defines whether to show the detail (add/edit) panel or not showDetailPanel?: boolean; // defines whether the dialog is adding a new item addingNewItem?: boolean; // title for the pending editing item title?: string; // url for the pending editing item url?: string; } /** * Defines the main content of the MyLinks dialog */ class MyLinksDialogContent extends React.Component { // to handle item selection in the DetailsList of Links private _selection: Selection; constructor(props: IMyLinksDialogContentProps) { super(props); this._selection = new Selection({ onSelectionChanged: () => { let selectedLink: IMyLink = this._selection.getSelectedCount() !== 0 ? this._selection.getSelection()[0] as IMyLink : null; this.setState({ selectedLink: selectedLink }); } }); this.state = { links: this.props.links && this.props.links.length > 0 ? this.props.links : [], showDetailPanel: false, }; } public componentDidMount(): void { // fire the resize event to paint the content of the dialog let resizeEvent = window.document.createEvent('UIEvents'); resizeEvent.initUIEvent('resize', true, false, window, 0); window.dispatchEvent(resizeEvent); } /** * Renders the dialog content using an Office UI Fabric grid */ public render(): JSX.Element { return (
{this.state.showDetailPanel ?
: null} {!this.state.showDetailPanel ?
: null} {!this.state.showDetailPanel ?
: null}
{!this.state.showDetailPanel ? { this.props.save(this.state.links); }} /> : null}
); } private _cancelEdit = (): void => { // disable the detail panel this.setState({ showDetailPanel: false, title: "", url: "", }); } private _saveEdit = (): void => { if (!this.state.addingNewItem) { let updatedLink: IMyLink = { title: this.state.title, url: this.state.url, }; // update the selected item this.state.links[this.state.links.indexOf(this.state.selectedLink)] = updatedLink; // refresh the array of Links let updatedLinks: IMyLink[] = this.state.links.concat([]); // update the list of links and disable the detail panel this.setState({ showDetailPanel: false, links: updatedLinks }); } else { let newLink: IMyLink = { title: this.state.title, url: this.state.url, }; // if we have a valid new link if (newLink != null && newLink.title != null && newLink.title.length > 0 && newLink.url != null && newLink.url.length > 0) { // add the new item to the array of Links let updatedLinks: IMyLink[] = this.state.links.concat([newLink]); // update the list of links and disable the detail panel this.setState({ showDetailPanel: false, links: updatedLinks }); } } } private _onChangedTitle = (event: React.FormEvent, newValue?: string) => { this.setState({ title: newValue, }); } private _onChangedUrl = (event: React.FormEvent, newValue?: string) => { this.setState({ url: newValue, }); } private _getErrorMessageUrl = (value: string): string => { // validate the URL with a specific Regular Expression const regEx: RegExp = /(https)?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&\/\/=]*)/; return (value == null || value.length === 0 || regEx.test(value) ? "" : strings.InvalidUrlError); } private addLink = (): void => { if (this.state.selectedLink != null && this.state.links != null && this.state.links.length > 0) { this._selection.toggleIndexSelected(this.state.links.indexOf(this.state.selectedLink)); } // enable the detail panel this.setState({ showDetailPanel: true, addingNewItem: true, title: "", url: "", selectedLink: null }); } private editLink = (): void => { // enable the detail panel this.setState({ showDetailPanel: true, addingNewItem: false, title: this.state.selectedLink.title, url: this.state.selectedLink.url }); } private deleteLink = (): void => { // delete the selected link this.state.links.splice(this.state.links.indexOf(this.state.selectedLink), 1); // refresh the array of Links let updatedLinks: IMyLink[] = this.state.links.concat([]); // refresh the DetailsList view this.setState({ links: updatedLinks }); } } /** * Dialog window to show the list of links */ export default class MyLinksDialog extends BaseDialog { // to keep track of the initial links in case user will cancel private initialLinks: IMyLink[]; /** * Constructor for the dialog window */ constructor(public links: Array, public isSave?: boolean) { // Blocking or else click outside causes error in 1.7 super({ isBlocking: true }); // clone the initial list of links we've got this.initialLinks = (this.links != null) ? this.links.concat([]) : []; } public render(): void { ReactDOM.render(, this.domElement); } public getConfig(): IDialogConfiguration { return { isBlocking: true }; } private _cancel = (): void => { this.isSave = false; this.links = this.initialLinks; // Fix for all browsers regarding SP Dialog not being to open twice ReactDOM.unmountComponentAtNode(this.domElement); this.close(); } private _save = (links: Array): void => { this.isSave = true; // Fix for all browsers regarding SP Dialog not being to open twice ReactDOM.unmountComponentAtNode(this.domElement); this.links = links; this.close(); } } ================================================ FILE: source/react-application-portal-footer/src/extensions/portalFooter/components/myLinks/loc/de-de.js ================================================ define([], function() { return { "DialogSaveButton": "Speichern", "DialogCancelButton": "Abbrechen", "DialogAddButton": "Hinzufügen", "DialogUpdateButton": "Aktualisieren", "MyLinksDialogTitle": "Meine Links", "MyLinksDialogDescription": "Nutzen Sie diesen Dialog um ihre Links zu verwalten", "SingleLinkDialogTitle": "Link hinzufügen/bearbeiten", "SingleLinkDialogDescription": "Nutzen Sie diesen Dialog um das Link (hinzufügen/bearbeiten) zu verwalten", "ConfirmDeleteLink": "Sind Sie sicher, das Sie diesen Link entfernen möchten?", "LinkTitleLabel": "Titel", "LinkUrlLabel": "URL", "InvalidUrlError": "The bereitgestellt URL ist ungültig", "TitleColumn": "Titel", "TitleColumnAriaLabel": "Titel der URL", "UrlColumn": "URL", "UrlColumnAriaLabel": "Hyperlink der URL", "SelectionColumnAriaLabel": "Auswahl umschalten", "SelectionAllColumnAriaLabel": "Auswahl für alle Items umschalten", "AddLinkCommand": "Hinzufügen", "EditLinkCommand": "Ändern", "DeleteLinkCommand": "Entfernen" } }); ================================================ FILE: source/react-application-portal-footer/src/extensions/portalFooter/components/myLinks/loc/en-us.js ================================================ define([], function() { return { "DialogSaveButton": "Save", "DialogCancelButton": "Cancel", "DialogAddButton": "Add", "DialogUpdateButton": "Update", "MyLinksDialogTitle": "My Links", "MyLinksDialogDescription": "Use this dialog to manage your Links", "SingleLinkDialogTitle": "Add/Edit Link", "SingleLinkDialogDescription": "Use this dialog to manage (add/edit) a link", "ConfirmDeleteLink": "Do you really want to delete the selected link?", "LinkTitleLabel": "Title", "LinkUrlLabel": "URL", "InvalidUrlError": "The provided URL is not valid", "TitleColumn": "Title", "TitleColumnAriaLabel": "Title of the URL", "UrlColumn": "URL", "UrlColumnAriaLabel": "Hyperlink of the URL", "SelectionColumnAriaLabel": "Toggle selection", "SelectionAllColumnAriaLabel": "Toggle selection for all items", "AddLinkCommand": "Add", "EditLinkCommand": "Edit", "DeleteLinkCommand": "Delete" } }); ================================================ FILE: source/react-application-portal-footer/src/extensions/portalFooter/components/myLinks/loc/es-es.js ================================================ define([], function() { return { "DialogSaveButton": "Guardar", "DialogCancelButton": "Cancelar", "DialogAddButton": "Agregar", "DialogUpdateButton": "Actualizar", "MyLinksDialogTitle": "Mis Enlaces", "MyLinksDialogDescription": "Utilice esta ventana de dialogo para administrar sus enlaces", "SingleLinkDialogTitle": "Agregar/Editar Enlace", "SingleLinkDialogDescription": "Utilice esta ventana de dialogo para adminsitrar (agregar/editar) un enlace", "ConfirmDeleteLink": "¿Realmente quiere eliminar el enlace seleccionado?", "LinkTitleLabel": "Título", "LinkUrlLabel": "URL", "InvalidUrlError": "La direccion URL capturada no es valida", "TitleColumn": "Título", "TitleColumnAriaLabel": "Título de la dirección URL", "UrlColumn": "URL", "UrlColumnAriaLabel": "Hypervinculo de la dirección URL", "SelectionColumnAriaLabel": "Seleccion Toggle", "SelectionAllColumnAriaLabel": "Seleccion Toggle para todos los elementos", "AddLinkCommand": "Agregar", "EditLinkCommand": "Editar", "DeleteLinkCommand": "Eliminar" } }); ================================================ FILE: source/react-application-portal-footer/src/extensions/portalFooter/components/myLinks/loc/fr-fr.js ================================================ define([], function() { return { "DialogSaveButton": "Sauvegarder", "DialogCancelButton": "Annuler", "DialogAddButton": "Ajouter", "DialogUpdateButton": "Mettre à jour", "MyLinksDialogTitle": "Mes Liens", "MyLinksDialogDescription": "Utilisez cette boîte de dialogue pour gérer vos liens", "SingleLinkDialogTitle": "Ajouter/Modifier lien", "SingleLinkDialogDescription": "Utiliser cette boîte de dialogue pour gérer (ajouter / modifier) un lien", "ConfirmDeleteLink": "Voulez-vous vraiment supprimer le lien sélectionné?", "LinkTitleLabel": "Titre", "LinkUrlLabel": "URL", "InvalidUrlError": "L'URL fournie n'est pas valide", "TitleColumn": "Titre", "TitleColumnAriaLabel": "Titre de l'URL", "UrlColumn": "URL", "UrlColumnAriaLabel": "Hyperlien de l'URL", "SelectionColumnAriaLabel": "Basculer la sélection", "SelectionAllColumnAriaLabel": "Basculer la sélection pour tous les objets", "AddLinkCommand": "Ajouter", "EditLinkCommand": "Modifier", "DeleteLinkCommand": "Supprimer" } }); ================================================ FILE: source/react-application-portal-footer/src/extensions/portalFooter/components/myLinks/loc/mystrings.d.ts ================================================ declare interface IMyLinksStrings { // generic labels for dialogs DialogSaveButton: string; DialogCancelButton: string; DialogAddButton: string; DialogUpdateButton: string; // labels for the dialog content MyLinksDialogTitle: string; MyLinksDialogDescription: string; SingleLinkDialogTitle: string; SingleLinkDialogDescription: string; ConfirmDeleteLink: string; // labels for the SingleLink editor dialog LinkTitleLabel: string; LinkUrlLabel: string; InvalidUrlError: string; // labels for DetailList of URLs TitleColumn: string; TitleColumnAriaLabel: string; UrlColumn: string; UrlColumnAriaLabel: string; SelectionColumnAriaLabel: string; SelectionAllColumnAriaLabel: string; // labels for the CommandBar AddLinkCommand: string; EditLinkCommand: string; DeleteLinkCommand: string; } declare module 'MyLinksStrings' { const strings: IMyLinksStrings; export = strings; } ================================================ FILE: source/react-application-portal-footer/src/extensions/portalFooter/components/myLinks/loc/nb-no.js ================================================ define([], function() { return { "DialogSaveButton": "Lagre", "DialogCancelButton": "Avbryt", "DialogAddButton": "Legg til", "DialogUpdateButton": "Oppdater", "MyLinksDialogTitle": "Mine lenker", "MyLinksDialogDescription": "Bruk denne dialogen for å håndtere dine lenker", "SingleLinkDialogTitle": "Legg til/redigere lenke", "SingleLinkDialogDescription": "Bruk denne dialogen for å håndtere (legg til/rediger) en lenke", "ConfirmDeleteLink": "Vil du virkelig slette den valgte lenken?", "LinkTitleLabel": "Tittel", "LinkUrlLabel": "URL", "InvalidUrlError": "Den angitte URL-en er ugyldig", "TitleColumn": "Tittel", "TitleColumnAriaLabel": "Tittel på URL-en", "UrlColumn": "URL", "UrlColumnAriaLabel": "URL-ens hyperlenke", "SelectionColumnAriaLabel": "Endre valg", "SelectionAllColumnAriaLabel": "Endre valg for alle objekt", "AddLinkCommand": "Legg til", "EditLinkCommand": "Rediger", "DeleteLinkCommand": "Slett" } }); ================================================ FILE: source/react-application-portal-footer/src/extensions/portalFooter/components/myLinks/loc/nl-nl.js ================================================ define([], function() { return { "DialogSaveButton": "Opslaan", "DialogCancelButton": "Annuleren", "DialogAddButton": "Toevoegen", "DialogUpdateButton": "Bijwerken", "MyLinksDialogTitle": "Mijn Links", "MyLinksDialogDescription": "Gebruik dit dialoogvenster om je links te beheren", "SingleLinkDialogTitle": "Toevoegen/Bewerken Link", "SingleLinkDialogDescription": "Gebruik dit dialoogvenster voor het beheren (toevoegen/bewerken) van een link", "ConfirmDeleteLink": "Weet je zeker dat je de geselecteerde link wil verwijderen?", "LinkTitleLabel": "Titel", "LinkUrlLabel": "URL", "InvalidUrlError": "De opgegeven URL is niet geldig", "TitleColumn": "Titel", "TitleColumnAriaLabel": "Titel van de URL", "UrlColumn": "URL", "UrlColumnAriaLabel": "Hyperlink van de URL", "SelectionColumnAriaLabel": "Selectie omzetten", "SelectionAllColumnAriaLabel": "Selectie omzetten voor alle items", "AddLinkCommand": "Toevoegen", "EditLinkCommand": "Bewerken", "DeleteLinkCommand": "Verwijderen" } }); ================================================ FILE: source/react-application-portal-footer/src/extensions/portalFooter/components/myLinks/loc/sv-se.js ================================================ define([], function() { return { "DialogSaveButton": "Spara", "DialogCancelButton": "Avbryt", "DialogAddButton": "Lägg till", "DialogUpdateButton": "Uppdatera", "MyLinksDialogTitle": "Mina Länkar", "MyLinksDialogDescription": "Använd den här dialogrutan för att hantera dina länkar", "SingleLinkDialogTitle": "Lägg till/Redigera Länk", "SingleLinkDialogDescription": "Använd den här dialogrutan för att hantera (lägg till/redigera) en länk", "ConfirmDeleteLink": "Vill du verkligen ta bort den valda länken?", "LinkTitleLabel": "Titel", "LinkUrlLabel": "URL", "InvalidUrlError": "Den angivna URLen är inte giltig", "TitleColumn": "Titel", "TitleColumnAriaLabel": "Titel på URLen", "UrlColumn": "URL", "UrlColumnAriaLabel": "URLens hyperlänk", "SelectionColumnAriaLabel": "Växla val", "SelectionAllColumnAriaLabel": "Växla val för alla objekt", "AddLinkCommand": "Lägg till", "EditLinkCommand": "Redigera", "DeleteLinkCommand": "Radera" } }); ================================================ FILE: source/react-application-portal-footer/src/extensions/portalFooter/components/myLinks/loc/tr-tr.js ================================================ define([], function() { return { "DialogSaveButton": "Kaydet", "DialogCancelButton": "İptal", "DialogAddButton": "Ekle", "DialogUpdateButton": "Güncelle", "MyLinksDialogTitle": "Bağlantılarım", "MyLinksDialogDescription": "Bağlantılarınızı yönetmek için bu iletişim kutusunu kullanın", "SingleLinkDialogTitle": "Bağlantı Ekle / Düzenle", "SingleLinkDialogDescription": "Bir bağlantıyı yönetmek için (eklemek / düzenlemek) bu iletişim kutusunu kullanın", "ConfirmDeleteLink": "Seçili bağlantıyı gerçekten silmek istiyor musunuz?", "LinkTitleLabel": "Başlık", "LinkUrlLabel": "URL", "InvalidUrlError": "Sağlanan URL geçerli değil", "TitleColumn": "Başlık", "TitleColumnAriaLabel": "URL’nin Başlığı", "UrlColumn": "URL", "UrlColumnAriaLabel": "URL’nin köprüsü", "SelectionColumnAriaLabel": "Seçimi değiştir", "SelectionAllColumnAriaLabel": "Tüm öğeler için seçimi değiştir", "AddLinkCommand": "Ekle", "EditLinkCommand": "Düzenle", "DeleteLinkCommand": "Sil" } }); ================================================ FILE: source/react-application-portal-footer/src/extensions/portalFooter/loc/de-de.js ================================================ define([], function () { return { "Title": "PortalFooterApplicationCustomizer", "MyLinks": "Meine Verknüpfungen", "ToggleButtonOpen": "Öffnen", "ToggleButtonClose": "Schließen", "Edit": "Bearbeiten", "EditTitle": "Fußzeilenverknüpfungen auswählen", "MyLinksSaveSuccess": "'Meine Verknüpfungen' wurden erfolgreich gespeichert!", "MyLinksSaveFailed": "Fehler beim Speichern von 'Meine Verknüpfungen'!" } }); ================================================ FILE: source/react-application-portal-footer/src/extensions/portalFooter/loc/en-us.js ================================================ define([], function () { return { "Title": "PortalFooterApplicationCustomizer", "MyLinks": "My Links", "ToggleButtonOpen": "Open", "ToggleButtonClose": "Close", "Edit": "Edit", "EditTitle": "Select footer links", "MyLinksSaveSuccess": "My links successfully saved!", "MyLinksSaveFailed": "Failed to save my links!" } }); ================================================ FILE: source/react-application-portal-footer/src/extensions/portalFooter/loc/es-es.js ================================================ define([], function () { return { "Title": "PortalFooterApplicationCustomizer", "MyLinks": "Mis Enlaces", "ToggleButtonOpen": "Abrir", "ToggleButtonClose": "Cerrar", "Edit": "Editar", "EditTitle": "Seleccione los enlaces del pie de pagina", "MyLinksSaveSuccess": "Mis enlaces salvados satiosfactoriamente!", "MyLinksSaveFailed": "Fallo al salvar mis enlaces!" } }); ================================================ FILE: source/react-application-portal-footer/src/extensions/portalFooter/loc/fr-fr.js ================================================ define([], function () { return { "Title": "PortalFooterApplicationCustomizer", "MyLinks": "Mes liens", "ToggleButtonOpen": "Ouvrir", "ToggleButtonClose": "Fermer", "Edit": "Editer", "EditTitle": "Sélectionner les liens de pied de page", "MyLinksSaveSuccess": "Mes liens ont été enregistrés avec succès!", "MyLinksSaveFailed": "Échec de l'enregistrement de mes liens!" } }); ================================================ FILE: source/react-application-portal-footer/src/extensions/portalFooter/loc/myStrings.d.ts ================================================ declare interface IPortalFooterApplicationCustomizerStrings { Title: string; MyLinks: string; ToggleButtonOpen: string; ToggleButtonClose: string; Edit: string; EditTitle: string; MyLinksSaveSuccess: string; MyLinksSaveFailed: string; } declare module 'PortalFooterApplicationCustomizerStrings' { const strings: IPortalFooterApplicationCustomizerStrings; export = strings; } ================================================ FILE: source/react-application-portal-footer/src/extensions/portalFooter/loc/nb-no.js ================================================ define([], function () { return { "Title": "PortalFooterApplicationCustomizer", "MyLinks": "Mine lenker", "ToggleButtonOpen": "Åpne", "ToggleButtonClose": "Lukke", "Edit": "Rediger", "EditTitle": "Velg lenker", "MyLinksSaveSuccess": "Mine lenker har blitt lagret!", "MyLinksSaveFailed": "Klarte ikke å lagre mine lenker!" } }); ================================================ FILE: source/react-application-portal-footer/src/extensions/portalFooter/loc/nl-nl.js ================================================ define([], function () { return { "Title": "PortalFooterApplicationCustomizer", "MyLinks": "Mijn links", "ToggleButtonOpen": "Open", "ToggleButtonClose": "Sluit", "Edit": "Bewerk", "EditTitle": "Selecteer footer links", "MyLinksSaveSuccess": "Mijn links succesvol opgeslagen!", "MyLinksSaveFailed": "Het opslaan van mijn links is mislukt!" } }); ================================================ FILE: source/react-application-portal-footer/src/extensions/portalFooter/loc/sv-se.js ================================================ define([], function () { return { "Title": "PortalFooterApplicationCustomizer", "MyLinks": "Mina Länkar", "ToggleButtonOpen": "Öppna", "ToggleButtonClose": "Stäng", "Edit": "Redigera", "EditTitle": "Välj sidfotens länkar", "MyLinksSaveSuccess": "Mina länkar har sparats!", "MyLinksSaveFailed": "Misslyckades med att spara mina länkar!" } }); ================================================ FILE: source/react-application-portal-footer/src/extensions/portalFooter/loc/tr-tr.js ================================================ define([], function () { return { "Title": "PortalFooterApplicationCustomizer", "MyLinks": "Bağlantılarım", "ToggleButtonOpen": "Açık", "ToggleButtonClose": "Kapalı", "Edit": "Düzenle", "EditTitle": "Sayfa altı bağlantılarını seçin", "MyLinksSaveSuccess": "Bağlantılarım başarıyla kaydedildi!", "MyLinksSaveFailed": "Bağlantılarım kaydedilemedi!" } }); ================================================ FILE: source/react-application-portal-footer/src/index.ts ================================================ // A file is required to be in the root of the /src directory by the TypeScript compiler ================================================ FILE: source/react-application-portal-footer/src/services/SPUserProfileService.ts ================================================ /** * DISCLAIMER * * As there is not yet an OData end-point for managed metadata, this service makes use of the ProcessQuery end-points. * The service will get updated once the APIs are in place for managing managed metadata. */ import { IWebPartContext} from '@microsoft/sp-webpart-base'; import { ExtensionContext } from '@microsoft/sp-extension-base'; import { Environment, EnvironmentType } from '@microsoft/sp-core-library'; import { SPHttpClient, SPHttpClientResponse, ISPHttpClientOptions } from '@microsoft/sp-http'; import { IPersonProperties, ISetPropertyResponse } from './SPUserProfileTypes'; export default class SPUserProfileService { // private member to hold the URL of the /_vti_bin/client.svc/ProcessQuery endpoint private clientServiceUrl: string; // private member to hold the URL of the /_api/contextinfo endpoint private contextInfoUrl: string; // private member to hold the FormDigest for SPO private formDigest: string; /** * Main constructor for the Taxonomy Service */ constructor(private context: IWebPartContext | ExtensionContext) { this.clientServiceUrl = this.context.pageContext.web.absoluteUrl + '/_vti_bin/client.svc/ProcessQuery'; this.contextInfoUrl = this.context.pageContext.web.absoluteUrl + '/_api/contextinfo'; } /** * @function * Retrieves a new value for the Form Digest for SPO */ private async getFormDigest(): Promise { let httpPostOptions: ISPHttpClientOptions = { headers: { "accept": "application/json", "content-type": "application/json" } }; let contextInfoResponse: SPHttpClientResponse = await this.context.spHttpClient.post(this.contextInfoUrl, SPHttpClient.configurations.v1, httpPostOptions); let contextInfoJsonResponse: any = await contextInfoResponse.json(); const formDigest: string = contextInfoJsonResponse.FormDigestValue; return(formDigest); } /** * @function * Retrieves the value of a User Profile property for the current user */ public async getUserProfileProperty(propertyName: string): Promise { // if we are in a real SharePoint environment if (Environment.type === EnvironmentType.SharePoint || Environment.type === EnvironmentType.ClassicSharePoint) { this.formDigest = await this.getFormDigest(); // build the Client Service Request let data: string = ` `; let httpPostOptions: ISPHttpClientOptions = { headers: { 'accept': 'application/json', 'content-type': 'text/xml', "X-RequestDigest": this.formDigest }, body: data }; let serviceResponse: SPHttpClientResponse = await this.context.spHttpClient.post(this.clientServiceUrl, SPHttpClient.configurations.v1, httpPostOptions); let serviceJSONResponse: Array = await serviceResponse.json(); // extract the object of type SP.UserProfiles.PersonProperties from the array let personPropertiesCollection: IPersonProperties[] = serviceJSONResponse.filter( (child: any) => (child != null && child['_ObjectType_'] !== undefined && child['_ObjectType_'] === "SP.UserProfiles.PersonProperties") ); // and if any, process the TermSet objects in it if (personPropertiesCollection != null && personPropertiesCollection.length > 0) { let personProperties: IPersonProperties = personPropertiesCollection[0]; // return the requested User Profile property return(personProperties.UserProfileProperties[propertyName]); } } // default empty item in case of any missing data return (new Promise((resolve, reject) => { resolve(null); })); } /** * @function * Retrieves the value of a User Profile property for the current user */ public async setUserProfileProperty(propertyName: string, propertyType: string, value: any): Promise { // if we are in a real SharePoint environment if (Environment.type === EnvironmentType.SharePoint || Environment.type === EnvironmentType.ClassicSharePoint) { this.formDigest = await this.getFormDigest(); // make the request based on the current user's name const currentUserName: string = `i:0#.f|membership|${this.context.pageContext.user.loginName}`; // build the Client Service Request let data: string = ` ${currentUserName} ${propertyName} ${value} `; let httpPostOptions: ISPHttpClientOptions = { headers: { 'accept': 'application/json', 'content-type': 'text/xml', "X-RequestDigest": this.formDigest }, body: data }; let serviceResponse: SPHttpClientResponse = await this.context.spHttpClient.post(this.clientServiceUrl, SPHttpClient.configurations.v1, httpPostOptions); let serviceJSONResponse: Array = await serviceResponse.json(); // get the response, if any if (serviceJSONResponse != null && serviceJSONResponse.length > 0) { let response: ISetPropertyResponse = serviceJSONResponse[0]; // return the requested User Profile property return(response.ErrorInfo === null); } } // default to false in case of any missing data return (new Promise((resolve, reject) => { resolve(false); })); } } ================================================ FILE: source/react-application-portal-footer/src/services/SPUserProfileTypes.ts ================================================ /** * Defines SP.UserProfiles.PersonProperties type */ export interface IPersonProperties { _ObjectType_: string; AccountName: string; UserProfileProperties: any; } /** * Defines the structure of the response for a User Profile property updated */ export interface ISetPropertyResponse { ErrorInfo: string; LibraryVersion: string; SchemaVersion: string; TraceCorrelationId: string; } ================================================ FILE: source/react-application-portal-footer/tsconfig.json ================================================ { "extends": "./node_modules/@microsoft/rush-stack-compiler-4.5/includes/tsconfig-web.json", "compilerOptions": { "target": "es5", "forceConsistentCasingInFileNames": true, "module": "esnext", "moduleResolution": "node", "jsx": "react", "declaration": true, "sourceMap": true, "experimentalDecorators": true, "skipLibCheck": true, "outDir": "lib", "inlineSources": false, "strictNullChecks": false, "noImplicitAny": true, "typeRoots": [ "./node_modules/@types", "./node_modules/@microsoft" ], "types": [ "webpack-env" ], "lib": [ "es5", "dom", "es2015.collection", "es2015.promise" ] }, "include": [ "src/**/*.ts", "src/**/*.tsx" ] } ================================================ FILE: source/react-banner/.editorconfig ================================================ # EditorConfig helps developers define and maintain consistent # coding styles between different editors and IDEs # editorconfig.org root = true [*] # change these settings to your own preference indent_style = space indent_size = 2 # we recommend you to keep these unchanged end_of_line = lf charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true [*.md] trim_trailing_whitespace = false [{package,bower}.json] indent_style = space indent_size = 2 ================================================ FILE: source/react-banner/.eslintrc.js ================================================ require('@rushstack/eslint-config/patch/modern-module-resolution'); module.exports = { extends: ['@microsoft/eslint-config-spfx/lib/profiles/react'], parserOptions: { tsconfigRootDir: __dirname }, overrides: [ { files: ['*.ts', '*.tsx'], parser: '@typescript-eslint/parser', 'parserOptions': { 'project': './tsconfig.json', 'ecmaVersion': 2018, 'sourceType': 'module' }, rules: { // Prevent usage of the JavaScript null value, while allowing code to access existing APIs that may require null. https://www.npmjs.com/package/@rushstack/eslint-plugin '@rushstack/no-new-null': 1, // Require Jest module mocking APIs to be called before any other statements in their code block. https://www.npmjs.com/package/@rushstack/eslint-plugin '@rushstack/hoist-jest-mock': 1, // Require regular expressions to be constructed from string constants rather than dynamically building strings at runtime. https://www.npmjs.com/package/@rushstack/eslint-plugin-security '@rushstack/security/no-unsafe-regexp': 1, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/adjacent-overload-signatures': 1, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // // CONFIGURATION: By default, these are banned: String, Boolean, Number, Object, Symbol '@typescript-eslint/ban-types': [ 1, { 'extendDefaults': false, 'types': { 'String': { 'message': 'Use \'string\' instead', 'fixWith': 'string' }, 'Boolean': { 'message': 'Use \'boolean\' instead', 'fixWith': 'boolean' }, 'Number': { 'message': 'Use \'number\' instead', 'fixWith': 'number' }, 'Object': { 'message': 'Use \'object\' instead, or else define a proper TypeScript type:' }, 'Symbol': { 'message': 'Use \'symbol\' instead', 'fixWith': 'symbol' }, 'Function': { 'message': 'The \'Function\' type accepts any function-like value.\nIt provides no type safety when calling the function, which can be a common source of bugs.\nIt also accepts things like class declarations, which will throw at runtime as they will not be called with \'new\'.\nIf you are expecting the function to accept certain arguments, you should explicitly define the function shape.' } } } ], // RATIONALE: Code is more readable when the type of every variable is immediately obvious. // Even if the compiler may be able to infer a type, this inference will be unavailable // to a person who is reviewing a GitHub diff. This rule makes writing code harder, // but writing code is a much less important activity than reading it. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/explicit-function-return-type': [ 0, { 'allowExpressions': true, 'allowTypedFunctionExpressions': true, 'allowHigherOrderFunctions': false } ], // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // Rationale to disable: although this is a recommended rule, it is up to dev to select coding style. // Set to 1 (warning) or 2 (error) to enable. '@typescript-eslint/explicit-member-accessibility': 0, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/no-array-constructor': 1, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // // RATIONALE: The "any" keyword disables static type checking, the main benefit of using TypeScript. // This rule should be suppressed only in very special cases such as JSON.stringify() // where the type really can be anything. Even if the type is flexible, another type // may be more appropriate such as "unknown", "{}", or "Record". '@typescript-eslint/no-explicit-any': 0, // RATIONALE: The #1 rule of promises is that every promise chain must be terminated by a catch() // handler. Thus wherever a Promise arises, the code must either append a catch handler, // or else return the object to a caller (who assumes this responsibility). Unterminated // promise chains are a serious issue. Besides causing errors to be silently ignored, // they can also cause a NodeJS process to terminate unexpectedly. '@typescript-eslint/no-floating-promises': 2, // RATIONALE: Catches a common coding mistake. '@typescript-eslint/no-for-in-array': 2, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/no-misused-new': 2, // RATIONALE: The "namespace" keyword is not recommended for organizing code because JavaScript lacks // a "using" statement to traverse namespaces. Nested namespaces prevent certain bundler // optimizations. If you are declaring loose functions/variables, it's better to make them // static members of a class, since classes support property getters and their private // members are accessible by unit tests. Also, the exercise of choosing a meaningful // class name tends to produce more discoverable APIs: for example, search+replacing // the function "reverse()" is likely to return many false matches, whereas if we always // write "Text.reverse()" is more unique. For large scale organization, it's recommended // to decompose your code into separate NPM packages, which ensures that component // dependencies are tracked more conscientiously. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/no-namespace': [ 1, { 'allowDeclarations': false, 'allowDefinitionFiles': false } ], // RATIONALE: Parameter properties provide a shorthand such as "constructor(public title: string)" // that avoids the effort of declaring "title" as a field. This TypeScript feature makes // code easier to write, but arguably sacrifices readability: In the notes for // "@typescript-eslint/member-ordering" we pointed out that fields are central to // a class's design, so we wouldn't want to bury them in a constructor signature // just to save some typing. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // Set to 1 (warning) or 2 (error) to enable the rule '@typescript-eslint/no-parameter-properties': 0, // RATIONALE: When left in shipping code, unused variables often indicate a mistake. Dead code // may impact performance. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/no-unused-vars': [ 1, { 'vars': 'all', // Unused function arguments often indicate a mistake in JavaScript code. However in TypeScript code, // the compiler catches most of those mistakes, and unused arguments are fairly common for type signatures // that are overriding a base class method or implementing an interface. 'args': 'none' } ], // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/no-use-before-define': [ 2, { 'functions': false, 'classes': true, 'variables': true, 'enums': true, 'typedefs': true } ], // Disallows require statements except in import statements. // In other words, the use of forms such as var foo = require("foo") are banned. Instead use ES6 style imports or import foo = require("foo") imports. '@typescript-eslint/no-var-requires': 'error', // RATIONALE: The "module" keyword is deprecated except when describing legacy libraries. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/prefer-namespace-keyword': 1, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // Rationale to disable: it's up to developer to decide if he wants to add type annotations // Set to 1 (warning) or 2 (error) to enable the rule '@typescript-eslint/no-inferrable-types': 0, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // Rationale to disable: declaration of empty interfaces may be helpful for generic types scenarios '@typescript-eslint/no-empty-interface': 0, // RATIONALE: This rule warns if setters are defined without getters, which is probably a mistake. 'accessor-pairs': 1, // RATIONALE: In TypeScript, if you write x["y"] instead of x.y, it disables type checking. 'dot-notation': [ 1, { 'allowPattern': '^_' } ], // RATIONALE: Catches code that is likely to be incorrect 'eqeqeq': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'for-direction': 1, // RATIONALE: Catches a common coding mistake. 'guard-for-in': 2, // RATIONALE: If you have more than 2,000 lines in a single source file, it's probably time // to split up your code. 'max-lines': ['warn', { max: 2000 }], // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-async-promise-executor': 2, // RATIONALE: Deprecated language feature. 'no-caller': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-compare-neg-zero': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-cond-assign': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-constant-condition': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-control-regex': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-debugger': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-delete-var': 2, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-duplicate-case': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-empty': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-empty-character-class': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-empty-pattern': 1, // RATIONALE: Eval is a security concern and a performance concern. 'no-eval': 1, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-ex-assign': 2, // RATIONALE: System types are global and should not be tampered with in a scalable code base. // If two different libraries (or two versions of the same library) both try to modify // a type, only one of them can win. Polyfills are acceptable because they implement // a standardized interoperable contract, but polyfills are generally coded in plain // JavaScript. 'no-extend-native': 1, // Disallow unnecessary labels 'no-extra-label': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-fallthrough': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-func-assign': 1, // RATIONALE: Catches a common coding mistake. 'no-implied-eval': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-invalid-regexp': 2, // RATIONALE: Catches a common coding mistake. 'no-label-var': 2, // RATIONALE: Eliminates redundant code. 'no-lone-blocks': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-misleading-character-class': 2, // RATIONALE: Catches a common coding mistake. 'no-multi-str': 2, // RATIONALE: It's generally a bad practice to call "new Thing()" without assigning the result to // a variable. Either it's part of an awkward expression like "(new Thing()).doSomething()", // or else implies that the constructor is doing nontrivial computations, which is often // a poor class design. 'no-new': 1, // RATIONALE: Obsolete language feature that is deprecated. 'no-new-func': 2, // RATIONALE: Obsolete language feature that is deprecated. 'no-new-object': 2, // RATIONALE: Obsolete notation. 'no-new-wrappers': 1, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-octal': 2, // RATIONALE: Catches code that is likely to be incorrect 'no-octal-escape': 2, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-regex-spaces': 2, // RATIONALE: Catches a common coding mistake. 'no-return-assign': 2, // RATIONALE: Security risk. 'no-script-url': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-self-assign': 2, // RATIONALE: Catches a common coding mistake. 'no-self-compare': 2, // RATIONALE: This avoids statements such as "while (a = next(), a && a.length);" that use // commas to create compound expressions. In general code is more readable if each // step is split onto a separate line. This also makes it easier to set breakpoints // in the debugger. 'no-sequences': 1, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-shadow-restricted-names': 2, // RATIONALE: Obsolete language feature that is deprecated. // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-sparse-arrays': 2, // RATIONALE: Although in theory JavaScript allows any possible data type to be thrown as an exception, // such flexibility adds pointless complexity, by requiring every catch block to test // the type of the object that it receives. Whereas if catch blocks can always assume // that their object implements the "Error" contract, then the code is simpler, and // we generally get useful additional information like a call stack. 'no-throw-literal': 2, // RATIONALE: Catches a common coding mistake. 'no-unmodified-loop-condition': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-unsafe-finally': 2, // RATIONALE: Catches a common coding mistake. 'no-unused-expressions': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-unused-labels': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-useless-catch': 1, // RATIONALE: Avoids a potential performance problem. 'no-useless-concat': 1, // RATIONALE: The "var" keyword is deprecated because of its confusing "hoisting" behavior. // Always use "let" or "const" instead. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json 'no-var': 2, // RATIONALE: Generally not needed in modern code. 'no-void': 1, // RATIONALE: Obsolete language feature that is deprecated. // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-with': 2, // RATIONALE: Makes logic easier to understand, since constants always have a known value // @typescript-eslint\eslint-plugin\dist\configs\eslint-recommended.js 'prefer-const': 1, // RATIONALE: Catches a common coding mistake where "resolve" and "reject" are confused. 'promise/param-names': 2, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'require-atomic-updates': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'require-yield': 1, // "Use strict" is redundant when using the TypeScript compiler. 'strict': [ 2, 'never' ], // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'use-isnan': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js // Set to 1 (warning) or 2 (error) to enable. // Rationale to disable: !!{} 'no-extra-boolean-cast': 0, // ==================================================================== // @microsoft/eslint-plugin-spfx // ==================================================================== '@microsoft/spfx/import-requires-chunk-name': 1, '@microsoft/spfx/no-require-ensure': 2, '@microsoft/spfx/pair-react-dom-render-unmount': 0, // ==================================================================== // react/self-closing-comp // ==================================================================== 'react/self-closing-comp': 0 } }, { // For unit tests, we can be a little bit less strict. The settings below revise the // defaults specified in the extended configurations, as well as above. files: [ // Test files '*.test.ts', '*.test.tsx', '*.spec.ts', '*.spec.tsx', // Facebook convention '**/__mocks__/*.ts', '**/__mocks__/*.tsx', '**/__tests__/*.ts', '**/__tests__/*.tsx', // Microsoft convention '**/test/*.ts', '**/test/*.tsx' ], rules: {} } ] }; ================================================ FILE: source/react-banner/.gitignore ================================================ # Logs logs *.log npm-debug.log* # Dependency directories node_modules # Build generated files dist lib release solution temp *.sppkg .heft # Coverage directory used by tools like istanbul coverage # OSX .DS_Store # Visual Studio files .ntvs_analysis.dat .vs bin obj # Resx Generated Code *.resx.ts # Styles Generated Code *.scss.ts ================================================ FILE: source/react-banner/.npmignore ================================================ !dist config gulpfile.js release src temp tsconfig.json tslint.json *.log .yo-rc.json .vscode ================================================ FILE: source/react-banner/.vscode/launch.json ================================================ { "version": "0.2.0", "configurations": [ { "name": "Hosted workbench", "type": "pwa-chrome", "request": "launch", "url": "https://enter-your-SharePoint-site/_layouts/workbench.aspx", "webRoot": "${workspaceRoot}", "sourceMaps": true, "sourceMapPathOverrides": { "webpack:///.././src/*": "${webRoot}/src/*", "webpack:///../../../src/*": "${webRoot}/src/*", "webpack:///../../../../src/*": "${webRoot}/src/*", "webpack:///../../../../../src/*": "${webRoot}/src/*" }, "runtimeArgs": [ "--remote-debugging-port=9222", "-incognito" ] } ] } ================================================ FILE: source/react-banner/.vscode/settings.json ================================================ // Place your settings in this file to overwrite default and user settings. { // Configure glob patterns for excluding files and folders in the file explorer. "files.exclude": { "**/.git": true, "**/.DS_Store": true, "**/bower_components": true, "**/coverage": true, "**/lib-amd": true, "src/**/*.scss.ts": true }, "typescript.tsdk": ".\\node_modules\\typescript\\lib" } ================================================ FILE: source/react-banner/.yo-rc.json ================================================ { "@microsoft/generator-sharepoint": { "plusBeta": false, "isCreatingSolution": true, "nodeVersion": "16.19.0", "sdksVersions": { "@microsoft/microsoft-graph-client": "3.0.2", "@microsoft/teams-js": "2.4.1" }, "version": "1.16.1", "environment": "spo", "libraryName": "react-banner", "libraryId": "b50504bb-cf4d-4b53-b47a-70d2d903b8d7", "packageManager": "npm", "skipFeatureDeployment": true, "isDomainIsolated": false, "componentType": "webpart" } } ================================================ FILE: source/react-banner/README.md ================================================ # Banner web part This web part provides you the ability to add a variable height image banner with a linkable title. **note** As of V2, this Banner webpart is hidden from the webpart toolbox and may be only added to a webpart using PowerShell or another automated deployment approach. This may be overwritten by updating the hiddenFromToolbox property to "false" found in [./src/webparts/banner/BannerWebPart.manifest.json](./src/webparts/banner/BannerWebPart.manifest.json). ![Bannner](../../assets/images/components/part-banner.gif) ## Configurable Properties The `Banner` webpart can be configured with the following properties: | Label | Property | Type | Required | Description | | ---- | ---- | ---- | ---- | ---- | | Overlay image text | bannerText | string | no | The text message or title you want displayed on the banner image | | Image URL | bannerImage | string | no | The url of the banner image | | Link URL | bannerLink | string | no | The hyperlink url of the bannerText link | | Banner height | bannerHeight | number | no | Provides the fixed height of the banner image | | Enable parallax effect | useParallax | toggle | no | Enable if you want to include parallax effect on vertical scrolling | ## How to use this web part on your web pages 1. Place the page you want to add this web part to in edit mode. 2. Search for and insert the **Banner** web part. 3. Configure the web part to update its properties. ## Used SharePoint Framework Version ![drop](https://img.shields.io/badge/version-1.16.1-green.svg) * Supported in SharePoint Online ## Applies to * [SharePoint Framework](https://learn.microsoft.com/en-us/sharepoint/dev/spfx/sharepoint-framework-overview) * [Office 365 tenant](https://learn.microsoft.com/en-us/sharepoint/dev/spfx/set-up-your-development-environment) ## Prerequisites none ## Solution Solution|Author(s) --------|--------- ./src/webparts/banner | Elio Struyf @eliostruyf ./source/react-banner | Eric Overfield @ericoverfield ./source/react-banner | Chandani Prajapati @Chandani_SPD ## Version history Version|Date|Comments -------|----|-------- 1.0|May 2018|Initial release 2.0|November 30, 2019| SP2019 and SPO compatible 3.0|February 2023|Initial release for SharePoint Starter Kit v3 (Upgraded to SPFx 1.16.1) ## Disclaimer **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.** --- ## Minimal Path to Awesome * Clone this repository * in the command line run: * `npm install` * `gulp serve` > Include any additional steps as needed. ## Features Description of the web part with possible additional details than in short summary. This Web Part illustrates the following concepts on top of the SharePoint Framework: * Hiding a webpart from the webpart toolbox ================================================ FILE: source/react-banner/config/config.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/config.2.0.schema.json", "version": "2.0", "bundles": { "banner-web-part": { "components": [ { "entrypoint": "./lib/webparts/banner/BannerWebPart.js", "manifest": "./src/webparts/banner/BannerWebPart.manifest.json" } ] } }, "externals": {}, "localizedResources": { "BannerWebPartStrings": "lib/webparts/banner/loc/{locale}.js", "ControlStrings": "node_modules/@pnp/spfx-controls-react/lib/loc/{locale}.js", "PropertyControlStrings": "node_modules/@pnp/spfx-property-controls/lib/loc/{locale}.js" } } ================================================ FILE: source/react-banner/config/deploy-azure-storage.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/deploy-azure-storage.schema.json", "workingDir": "./release/assets/", "account": "", "container": "react-banner", "accessKey": "" } ================================================ FILE: source/react-banner/config/package-solution.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/package-solution.schema.json", "solution": { "name": "Starter Kit - Banner", "id": "b50504bb-cf4d-4b53-b47a-70d2d903b8d7", "version": "3.0.0.0", "includeClientSideAssets": true, "skipFeatureDeployment": true, "isDomainIsolated": false, "developer": { "name": "PnP Starter Kit", "privacyUrl": "", "termsOfUseUrl": "", "websiteUrl": "", "mpnId": "pnpsk" }, "metadata": { "shortDescription": { "default": "react-banner description" }, "longDescription": { "default": "react-banner description" }, "screenshotPaths": [], "videoUrl": "", "categories": [] }, "features": [ { "title": "Starter Kit - Banner Webpart Feature", "description": "The feature that activates Banner WebPart from the Starter Kit - Banner solution.", "id": "84a626d0-e973-4429-91cc-5adc610d437c", "version": "3.0.0.0", "componentIds": [ "84a626d0-e973-4429-91cc-5adc610d437c" ] } ] }, "paths": { "zippedPackage": "solution/react-banner.sppkg" } } ================================================ FILE: source/react-banner/config/sass.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/core-build/sass.schema.json" } ================================================ FILE: source/react-banner/config/serve.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/spfx-serve.schema.json", "port": 4321, "https": true, "initialPage": "https://enter-your-SharePoint-site/_layouts/workbench.aspx" } ================================================ FILE: source/react-banner/config/write-manifests.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/write-manifests.schema.json", "cdnBasePath": "" } ================================================ FILE: source/react-banner/gulpfile.js ================================================ 'use strict'; const build = require('@microsoft/sp-build-web'); build.addSuppression(`Warning - [sass] The local CSS class 'ms-Grid' is not camelCase and will not be type-safe.`); var getTasks = build.rig.getTasks; build.rig.getTasks = function () { var result = getTasks.call(build.rig); result.set('serve', result.get('serve-deprecated')); return result; }; build.initialize(require('gulp')); ================================================ FILE: source/react-banner/package.json ================================================ { "name": "react-banner", "version": "3.0.0", "private": true, "main": "lib/index.js", "engines": { "node": ">=16.13.0 <17.0.0" }, "scripts": { "build": "gulp bundle", "clean": "gulp clean", "test": "gulp test" }, "dependencies": { "@microsoft/sp-core-library": "1.16.1", "@microsoft/sp-lodash-subset": "1.16.1", "@microsoft/sp-office-ui-fabric-core": "1.16.1", "@microsoft/sp-property-pane": "1.16.1", "@microsoft/sp-webpart-base": "1.16.1", "@pnp/spfx-controls-react": "3.12.0", "@pnp/spfx-property-controls": "3.11.0", "react": "17.0.1", "react-dom": "17.0.1", "tslib": "2.3.1" }, "resolutions": { "@types/react": "16.8.8" }, "devDependencies": { "@microsoft/eslint-config-spfx": "1.16.1", "@microsoft/eslint-plugin-spfx": "1.16.1", "@microsoft/rush-stack-compiler-4.5": "0.2.2", "@microsoft/sp-build-web": "1.16.1", "@microsoft/sp-module-interfaces": "1.16.1", "@rushstack/eslint-config": "2.5.1", "@types/react": "17.0.45", "@types/react-dom": "17.0.17", "@types/webpack-env": "~1.15.2", "ajv": "^6.12.5", "eslint-plugin-react-hooks": "4.3.0", "gulp": "4.0.2", "typescript": "4.5.5" } } ================================================ FILE: source/react-banner/src/index.ts ================================================ // A file is required to be in the root of the /src directory by the TypeScript compiler ================================================ FILE: source/react-banner/src/webparts/banner/BannerWebPart.manifest.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx/client-side-web-part-manifest.schema.json", "id": "84a626d0-e973-4429-91cc-5adc610d437c", "alias": "BannerWebPart", "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, "supportsFullBleed": true, "supportedHosts": ["SharePointWebPart", "TeamsTab", "TeamsPersonalApp", "SharePointFullPage"], "hiddenFromToolbox": true, "preconfiguredEntries": [{ "groupId": "5c03119e-3074-46fd-976b-c60198311f70", // Other "group": { "default": "Other" }, "title": { "default": "Banner" }, "description": { "default": "Renders a banner style presentation with text and image" }, "officeFabricIconFontName": "PanoIndicator", "properties": { "bannerText": "", "bannerImage": "", "bannerLink": "", "bannerHeight": 280, "useParallax": true } }] } ================================================ FILE: source/react-banner/src/webparts/banner/BannerWebPart.ts ================================================ import * as React from 'react'; import * as ReactDom from 'react-dom'; import { Version, DisplayMode } from '@microsoft/sp-core-library'; import { BaseClientSideWebPart, IWebPartPropertiesMetadata } from "@microsoft/sp-webpart-base"; import { IPropertyPaneConfiguration, PropertyPaneTextField, PropertyPaneToggle } from "@microsoft/sp-property-pane"; import { Banner, IBannerProps } from './components'; import * as strings from 'BannerWebPartStrings'; export interface IBannerWebPartProps { bannerText: string; bannerImage: string; bannerLink: string; bannerHeight: number; fullWidth: boolean; useParallax: boolean; useParallaxInt: boolean; } export default class BannerWebPart extends BaseClientSideWebPart { // tslint:disable-next-line:no-any private propertyFieldNumber: any; public render(): void { const element: React.ReactElement = React.createElement( Banner, { ...this.properties, propertyPane: this.context.propertyPane, domElement: this.context.domElement, // tslint:disable-next-line:max-line-length useParallaxInt: this.displayMode === DisplayMode.Read && !!this.properties.bannerImage && this.properties.useParallax } ); ReactDom.render(element, this.domElement); } protected get dataVersion(): Version { return Version.parse('1.0'); } /** * Set property metadata */ protected get propertiesMetadata(): IWebPartPropertiesMetadata { return { 'bannerText': { isSearchablePlainText: true }, 'bannerImage': { isImageSource: true }, 'bannerLink': { isLink: true } }; } // executes only before property pane is loaded. protected async loadPropertyPaneResources(): Promise { // import additional controls/components const { PropertyFieldNumber } = await import( /* webpackChunkName: 'pnp-propcontrols-number' */ '@pnp/spfx-property-controls/lib/propertyFields/number' ); this.propertyFieldNumber = PropertyFieldNumber; } /** * Property pane configuration */ protected getPropertyPaneConfiguration(): IPropertyPaneConfiguration { return { pages: [ { groups: [ { groupName: strings.BannerConfigName, groupFields: [ PropertyPaneTextField('bannerText', { label: strings.BannerTextField, multiline: true, maxLength: 200, value: this.properties.bannerText }), PropertyPaneTextField('bannerImage', { label: strings.BannerImageUrlField, onGetErrorMessage: this._validateImageField, value: this.properties.bannerImage }), PropertyPaneTextField('bannerLink', { label: strings.BannerLinkField, value: this.properties.bannerLink }), this.propertyFieldNumber('bannerHeight', { key: 'bannerHeight', label: strings.BannerNumberField, value: this.properties.bannerHeight, maxValue: 500, minValue: 100 }), PropertyPaneToggle('useParallax', { label: strings.BannerParallaxField, checked: this.properties.useParallax }) ] } ] } ] }; } /** * Field validation */ private _validateImageField(imgVal: string): string { if (imgVal) { const urlSplit: string[] = imgVal.split('.'); if (urlSplit && urlSplit.length > 0) { const extName: string = urlSplit.pop().toLowerCase(); if (['jpg', 'jpeg', 'png', 'gif'].indexOf(extName) === -1) { return strings.BannerValidationNotImage; } } } return ''; } } ================================================ FILE: source/react-banner/src/webparts/banner/components/Banner.module.scss ================================================ @import '~@fluentui/react/dist/sass/References.scss'; .banner { align-items: flex-end; display: flex; flex-direction: row; font-size: 14px; position: relative; overflow: hidden; .bannerImg { background-position: center; background-size: cover; height: 100%; position: absolute; top: 0; width: 100%; will-change: transform; } .bannerOverlay { background-color: rgba(0, 0, 0, 0.4); height: 100%; position: absolute; width: 100%; } .bannerText { @include ms-fontSize-su; @include ms-fontWeight-light; box-sizing: border-box; color: #fff; position: relative; margin: 0 auto 12px auto; max-width: 1284px; padding: 0 40px; width: 100%; word-break: break-word; a { color: #fff; text-decoration: none; &:visited { color: #fff; } &:hover { color: #fff; border-bottom: 1px solid #fff; } } } } ================================================ FILE: source/react-banner/src/webparts/banner/components/Banner.tsx ================================================ import * as React from 'react'; import styles from './Banner.module.scss'; import { IBannerProps } from '.'; import { escape } from '@microsoft/sp-lodash-subset'; import { Placeholder } from '@pnp/spfx-controls-react/lib/Placeholder'; import * as strings from 'BannerWebPartStrings'; export class Banner extends React.Component { private _scrollElm: HTMLElement = undefined; private _scrollElmRect: ClientRect = undefined; private _parallaxElm: HTMLElement = undefined; /** * Bind the parallax effect on mount */ public componentDidMount(): void { this._parallaxBinding(); } /** * Bind the parallax effect on update * @param prevProps */ public componentDidUpdate(prevProps: IBannerProps): void { this._parallaxBinding(); } /** * Unbind the parallax effect */ public componentWillUnmount(): void { this._removeParallaxBinding(); } /** * Default React render method */ public render(): React.ReactElement { if (this.props.bannerImage) { return (
{ this.props.bannerLink ? ( // tslint:disable-next-line:max-line-length {escape(this.props.bannerText)} ) : ( {escape(this.props.bannerText)} ) }
); } else { return ; } } /** * Opens the property pane of the web part for configuration */ private _onConfigure = () => { this.props.propertyPane.open(); } /** * Finds the scrollable parent */ private _getScrollableParent(): HTMLElement { const scrollElm: HTMLElement = document.querySelector('div[data-is-scrollable="true"]') as HTMLElement; if (scrollElm) { return scrollElm; } return undefined; } /** * Set translate / parallax effect * @param vector */ private _setTranslate (vector: number): void { const r: string = `translate3d(0px, ${vector}px, 0px)`; this._parallaxElm.style.transform = r; } /** * Set the parallax effect to the banner image element */ private _setParallaxEffect = (): void => { window.requestAnimationFrame((): void => { const scrollElmTop: number = this._scrollElmRect.top; const clientElmRect: ClientRect = this.props.domElement.getBoundingClientRect(); const clientElmTop: number = clientElmRect.top; const clientElmBottom: number = clientElmRect.bottom; if (clientElmTop < scrollElmTop && clientElmBottom > scrollElmTop) { const vector: number = Math.round((scrollElmTop - clientElmTop) / 1.81); this._setTranslate(vector); } else if (clientElmTop >= scrollElmTop) { this._setTranslate(0); } }); } private _removeParallaxBinding(): void { if (this._scrollElm) { // Unbind the scroll event this._scrollElm.removeEventListener('scroll', this._setParallaxEffect); } } /** * Add or remove parallax binding to the banner */ private _parallaxBinding(): void { if (this.props.useParallaxInt) { this._scrollElm = this._getScrollableParent(); this._parallaxElm = this.props.domElement.querySelector(`.${styles.bannerImg}`) as HTMLElement; if (this._scrollElm && this._parallaxElm) { // Get client rect info this._scrollElmRect = this._scrollElm.getBoundingClientRect(); // Bind the scroll event this._scrollElm.addEventListener('scroll', this._setParallaxEffect); } } else { this._removeParallaxBinding(); } } } ================================================ FILE: source/react-banner/src/webparts/banner/components/IBannerProps.ts ================================================ import { IBannerWebPartProps } from '../BannerWebPart'; import { IPropertyPaneAccessor } from '@microsoft/sp-webpart-base'; export interface IBannerProps extends IBannerWebPartProps { propertyPane: IPropertyPaneAccessor; domElement: HTMLElement; } ================================================ FILE: source/react-banner/src/webparts/banner/components/index.ts ================================================ export * from './IBannerProps'; export * from './Banner'; ================================================ FILE: source/react-banner/src/webparts/banner/loc/de-de.js ================================================ define([], function() { return { "BannerConfigName": "Banner konfiguration", "BannerTextField": "Overlay Bild Text", "BannerImageUrlField": "Bild URL", "BannerLinkField": "Link URL", "BannerNumberField": "Banner Höhe", "BannerParallaxField": "Aktiviere Parallaxe-Effekt", // Validation "BannerValidationNotImage": "Bitte geben sie einen Link zu einem Bild an", // React component strings "BannerPlaceholderIconText": "Konfigurieren Sie ihren Web Part", "BannerPlaceholderDescription": "Bitte geben Sie die Banner konfiguration an.", "BannerPlaceholderBtnLabel": "Konfigurieren" } }); ================================================ FILE: source/react-banner/src/webparts/banner/loc/en-us.js ================================================ define([], function() { return { "BannerConfigName": "Banner configuration", "BannerTextField": "Overlay image text", "BannerImageUrlField": "Image URL", "BannerLinkField": "Link URL", "BannerNumberField": "Banner height", "BannerParallaxField": "Enable parallax effect", // Validation "BannerValidationNotImage": "Please provide a link to an image", // React component strings "BannerPlaceholderIconText": "Configure your web part", "BannerPlaceholderDescription": "Please specify the banner configuration.", "BannerPlaceholderBtnLabel": "Configure" } }); ================================================ FILE: source/react-banner/src/webparts/banner/loc/es-es.js ================================================ define([], function() { return { "BannerConfigName": "Configuración de la pancarta", "BannerTextField": "Texto de la imagen sobre puesta", "BannerImageUrlField": "Dirección URL de la imagen", "BannerLinkField": "Dirección URL del enlace", "BannerNumberField": "Alto de la pancarta", "BannerParallaxField": "Habilitar el efecto paralaje", // Validation "BannerValidationNotImage": "Favor de proporcionar un enlace a la imagen", // React component strings "BannerPlaceholderIconText": "Configure su elemento web", "BannerPlaceholderDescription": "Favor de especificar la configuración de la pancarta.", "BannerPlaceholderBtnLabel": "Configuración" } }); ================================================ FILE: source/react-banner/src/webparts/banner/loc/fr-fr.js ================================================ define([], function() { return { "BannerConfigName": "Configuration de la bannière", "BannerTextField": "Légende texte de l'image", "BannerImageUrlField": "Image URL", "BannerLinkField": "Lien URL", "BannerNumberField": "Hauteur de la bannière", "BannerParallaxField": "Activer l'effet de parallaxe", // Validation "BannerValidationNotImage": "Veuillez fournir un lien vers une image", // React component strings "BannerPlaceholderIconText": "Configurez votre partie Web", "BannerPlaceholderDescription": "Veuillez spécifier la configuration de la bannière.", "BannerPlaceholderBtnLabel": "Configurez" } }); ================================================ FILE: source/react-banner/src/webparts/banner/loc/mystrings.d.ts ================================================ declare interface IBannerWebPartStrings { BannerConfigName: string; BannerTextField: string; BannerImageUrlField: string; BannerLinkField: string; BannerNumberField: string; BannerParallaxField: string; BannerValidationNotImage: string; BannerPlaceholderIconText: string; BannerPlaceholderDescription: string; BannerPlaceholderBtnLabel: string; } declare module 'BannerWebPartStrings' { const strings: IBannerWebPartStrings; export = strings; } ================================================ FILE: source/react-banner/src/webparts/banner/loc/nb-no.js ================================================ define([], function() { return { "BannerConfigName": "Banner konfigurasjon", "BannerTextField": "Bildetekst", "BannerImageUrlField": "Bilde URL", "BannerLinkField": "Lenke URL", "BannerNumberField": "Banner høyde", "BannerParallaxField": "Aktiver parallax effekt", // Validation "BannerValidationNotImage": "Vennligst angi en lenke til bildet", // React component strings "BannerPlaceholderIconText": "Konfigurer webdelen", "BannerPlaceholderDescription": "Angi banner konfigurasjonen.", "BannerPlaceholderBtnLabel": "Konfigurer" } }); ================================================ FILE: source/react-banner/src/webparts/banner/loc/nl-nl.js ================================================ define([], function() { return { "BannerConfigName": "Banner configuratie", "BannerTextField": "Banner afbeeldingstekst", "BannerImageUrlField": "Afbeeldings URL", "BannerLinkField": "Link URL", "BannerNumberField": "Banner hoogte", "BannerParallaxField": "Activeer parallax effect", // Validation "BannerValidationNotImage": "Voeg een link toe naar een afbeelding alsjeblieft", // React component strings "BannerPlaceholderIconText": "Configureer je webpart", "BannerPlaceholderDescription": "Specificeer de banner configuratie alsjeblieft", "BannerPlaceholderBtnLabel": "Configureer" } }); ================================================ FILE: source/react-banner/src/webparts/banner/loc/sv-se.js ================================================ define([], function() { return { "BannerConfigName": "Bannerkonfiguration", "BannerTextField": "Täckande bildtext", "BannerImageUrlField": "Bild URL", "BannerLinkField": "Länk URL", "BannerNumberField": "Bannerhöjd", "BannerParallaxField": "Aktivera parallaxeffekt", // Validation "BannerValidationNotImage": "Vänligen ange en länk till en bild", // React component strings "BannerPlaceholderIconText": "Konfigurera din webbdel", "BannerPlaceholderDescription": "Ange bannerkonfigurationen.", "BannerPlaceholderBtnLabel": "Konfigurera" } }); ================================================ FILE: source/react-banner/src/webparts/banner/loc/tr-tr.js ================================================ define([], function() { return { "BannerConfigName": "Banner yapılandırması", "BannerTextField": "Bindirme resmi metni", "BannerImageUrlField": "Resim URL’si", "BannerLinkField": "Bağlantı adresi", "BannerNumberField": "Banner yüksekliği", "BannerParallaxField": "Paralaks efektini etkinleştir", // Validation "BannerValidationNotImage": "Lütfen bir resme bağlantı verin", // React component strings "BannerPlaceholderIconText": "Web bölümünü yapılandır", "BannerPlaceholderDescription": "Lütfen banner yapılandırmasını belirtin.", "BannerPlaceholderBtnLabel": "Yapılandır" } }); ================================================ FILE: source/react-banner/tsconfig.json ================================================ { "extends": "./node_modules/@microsoft/rush-stack-compiler-4.5/includes/tsconfig-web.json", "compilerOptions": { "target": "es5", "forceConsistentCasingInFileNames": true, "module": "esnext", "moduleResolution": "node", "jsx": "react", "declaration": true, "sourceMap": true, "experimentalDecorators": true, "skipLibCheck": true, "outDir": "lib", "inlineSources": false, "strictNullChecks": false, "noImplicitAny": true, "typeRoots": [ "./node_modules/@types", "./node_modules/@microsoft" ], "types": [ "webpack-env" ], "lib": [ "es5", "dom", "es2015.collection", "es2015.promise" ] }, "include": [ "src/**/*.ts", "src/**/*.tsx" ] } ================================================ FILE: source/react-command-discuss-now/.editorconfig ================================================ # EditorConfig helps developers define and maintain consistent # coding styles between different editors and IDEs # editorconfig.org root = true [*] # change these settings to your own preference indent_style = space indent_size = 2 # we recommend you to keep these unchanged end_of_line = lf charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true [*.md] trim_trailing_whitespace = false [{package,bower}.json] indent_style = space indent_size = 2 ================================================ FILE: source/react-command-discuss-now/.eslintrc.js ================================================ require('@rushstack/eslint-config/patch/modern-module-resolution'); module.exports = { extends: ['@microsoft/eslint-config-spfx/lib/profiles/default'], parserOptions: { tsconfigRootDir: __dirname }, overrides: [ { files: ['*.ts', '*.tsx'], parser: '@typescript-eslint/parser', 'parserOptions': { 'project': './tsconfig.json', 'ecmaVersion': 2018, 'sourceType': 'module' }, rules: { // Prevent usage of the JavaScript null value, while allowing code to access existing APIs that may require null. https://www.npmjs.com/package/@rushstack/eslint-plugin '@rushstack/no-new-null': 1, // Require Jest module mocking APIs to be called before any other statements in their code block. https://www.npmjs.com/package/@rushstack/eslint-plugin '@rushstack/hoist-jest-mock': 1, // Require regular expressions to be constructed from string constants rather than dynamically building strings at runtime. https://www.npmjs.com/package/@rushstack/eslint-plugin-security '@rushstack/security/no-unsafe-regexp': 1, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/adjacent-overload-signatures': 1, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // // CONFIGURATION: By default, these are banned: String, Boolean, Number, Object, Symbol '@typescript-eslint/ban-types': [ 0, { 'extendDefaults': false, 'types': { 'String': { 'message': 'Use \'string\' instead', 'fixWith': 'string' }, 'Boolean': { 'message': 'Use \'boolean\' instead', 'fixWith': 'boolean' }, 'Number': { 'message': 'Use \'number\' instead', 'fixWith': 'number' }, 'Object': { 'message': 'Use \'object\' instead, or else define a proper TypeScript type:' }, 'Symbol': { 'message': 'Use \'symbol\' instead', 'fixWith': 'symbol' }, 'Function': { 'message': 'The \'Function\' type accepts any function-like value.\nIt provides no type safety when calling the function, which can be a common source of bugs.\nIt also accepts things like class declarations, which will throw at runtime as they will not be called with \'new\'.\nIf you are expecting the function to accept certain arguments, you should explicitly define the function shape.' } } } ], // RATIONALE: Code is more readable when the type of every variable is immediately obvious. // Even if the compiler may be able to infer a type, this inference will be unavailable // to a person who is reviewing a GitHub diff. This rule makes writing code harder, // but writing code is a much less important activity than reading it. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/explicit-function-return-type': [ 0, { 'allowExpressions': true, 'allowTypedFunctionExpressions': true, 'allowHigherOrderFunctions': false } ], // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // Rationale to disable: although this is a recommended rule, it is up to dev to select coding style. // Set to 1 (warning) or 2 (error) to enable. '@typescript-eslint/explicit-member-accessibility': 0, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/no-array-constructor': 1, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // // RATIONALE: The "any" keyword disables static type checking, the main benefit of using TypeScript. // This rule should be suppressed only in very special cases such as JSON.stringify() // where the type really can be anything. Even if the type is flexible, another type // may be more appropriate such as "unknown", "{}", or "Record". '@typescript-eslint/no-explicit-any': 0, // RATIONALE: The #1 rule of promises is that every promise chain must be terminated by a catch() // handler. Thus wherever a Promise arises, the code must either append a catch handler, // or else return the object to a caller (who assumes this responsibility). Unterminated // promise chains are a serious issue. Besides causing errors to be silently ignored, // they can also cause a NodeJS process to terminate unexpectedly. '@typescript-eslint/no-floating-promises': 0, // RATIONALE: Catches a common coding mistake. '@typescript-eslint/no-for-in-array': 2, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/no-misused-new': 2, // RATIONALE: The "namespace" keyword is not recommended for organizing code because JavaScript lacks // a "using" statement to traverse namespaces. Nested namespaces prevent certain bundler // optimizations. If you are declaring loose functions/variables, it's better to make them // static members of a class, since classes support property getters and their private // members are accessible by unit tests. Also, the exercise of choosing a meaningful // class name tends to produce more discoverable APIs: for example, search+replacing // the function "reverse()" is likely to return many false matches, whereas if we always // write "Text.reverse()" is more unique. For large scale organization, it's recommended // to decompose your code into separate NPM packages, which ensures that component // dependencies are tracked more conscientiously. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/no-namespace': [ 1, { 'allowDeclarations': false, 'allowDefinitionFiles': false } ], // RATIONALE: Parameter properties provide a shorthand such as "constructor(public title: string)" // that avoids the effort of declaring "title" as a field. This TypeScript feature makes // code easier to write, but arguably sacrifices readability: In the notes for // "@typescript-eslint/member-ordering" we pointed out that fields are central to // a class's design, so we wouldn't want to bury them in a constructor signature // just to save some typing. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // Set to 1 (warning) or 2 (error) to enable the rule '@typescript-eslint/no-parameter-properties': 0, // RATIONALE: When left in shipping code, unused variables often indicate a mistake. Dead code // may impact performance. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/no-unused-vars': [ 0, { 'vars': 'all', // Unused function arguments often indicate a mistake in JavaScript code. However in TypeScript code, // the compiler catches most of those mistakes, and unused arguments are fairly common for type signatures // that are overriding a base class method or implementing an interface. 'args': 'none' } ], // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/no-use-before-define': [ 2, { 'functions': false, 'classes': true, 'variables': true, 'enums': true, 'typedefs': true } ], // Disallows require statements except in import statements. // In other words, the use of forms such as var foo = require("foo") are banned. Instead use ES6 style imports or import foo = require("foo") imports. '@typescript-eslint/no-var-requires': 'error', // RATIONALE: The "module" keyword is deprecated except when describing legacy libraries. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/prefer-namespace-keyword': 1, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // Rationale to disable: it's up to developer to decide if he wants to add type annotations // Set to 1 (warning) or 2 (error) to enable the rule '@typescript-eslint/no-inferrable-types': 0, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // Rationale to disable: declaration of empty interfaces may be helpful for generic types scenarios '@typescript-eslint/no-empty-interface': 0, // RATIONALE: This rule warns if setters are defined without getters, which is probably a mistake. 'accessor-pairs': 1, // RATIONALE: In TypeScript, if you write x["y"] instead of x.y, it disables type checking. 'dot-notation': [ 1, { 'allowPattern': '^_' } ], // RATIONALE: Catches code that is likely to be incorrect 'eqeqeq': 0, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'for-direction': 1, // RATIONALE: Catches a common coding mistake. 'guard-for-in': 2, // RATIONALE: If you have more than 2,000 lines in a single source file, it's probably time // to split up your code. 'max-lines': ['warn', { max: 2000 }], // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-async-promise-executor': 2, // RATIONALE: Deprecated language feature. 'no-caller': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-compare-neg-zero': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-cond-assign': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-constant-condition': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-control-regex': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-debugger': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-delete-var': 2, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-duplicate-case': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-empty': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-empty-character-class': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-empty-pattern': 1, // RATIONALE: Eval is a security concern and a performance concern. 'no-eval': 1, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-ex-assign': 2, // RATIONALE: System types are global and should not be tampered with in a scalable code base. // If two different libraries (or two versions of the same library) both try to modify // a type, only one of them can win. Polyfills are acceptable because they implement // a standardized interoperable contract, but polyfills are generally coded in plain // JavaScript. 'no-extend-native': 1, // Disallow unnecessary labels 'no-extra-label': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-fallthrough': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-func-assign': 1, // RATIONALE: Catches a common coding mistake. 'no-implied-eval': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-invalid-regexp': 2, // RATIONALE: Catches a common coding mistake. 'no-label-var': 2, // RATIONALE: Eliminates redundant code. 'no-lone-blocks': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-misleading-character-class': 2, // RATIONALE: Catches a common coding mistake. 'no-multi-str': 2, // RATIONALE: It's generally a bad practice to call "new Thing()" without assigning the result to // a variable. Either it's part of an awkward expression like "(new Thing()).doSomething()", // or else implies that the constructor is doing nontrivial computations, which is often // a poor class design. 'no-new': 1, // RATIONALE: Obsolete language feature that is deprecated. 'no-new-func': 2, // RATIONALE: Obsolete language feature that is deprecated. 'no-new-object': 2, // RATIONALE: Obsolete notation. 'no-new-wrappers': 1, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-octal': 2, // RATIONALE: Catches code that is likely to be incorrect 'no-octal-escape': 2, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-regex-spaces': 2, // RATIONALE: Catches a common coding mistake. 'no-return-assign': 2, // RATIONALE: Security risk. 'no-script-url': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-self-assign': 2, // RATIONALE: Catches a common coding mistake. 'no-self-compare': 2, // RATIONALE: This avoids statements such as "while (a = next(), a && a.length);" that use // commas to create compound expressions. In general code is more readable if each // step is split onto a separate line. This also makes it easier to set breakpoints // in the debugger. 'no-sequences': 1, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-shadow-restricted-names': 2, // RATIONALE: Obsolete language feature that is deprecated. // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-sparse-arrays': 2, // RATIONALE: Although in theory JavaScript allows any possible data type to be thrown as an exception, // such flexibility adds pointless complexity, by requiring every catch block to test // the type of the object that it receives. Whereas if catch blocks can always assume // that their object implements the "Error" contract, then the code is simpler, and // we generally get useful additional information like a call stack. 'no-throw-literal': 2, // RATIONALE: Catches a common coding mistake. 'no-unmodified-loop-condition': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-unsafe-finally': 2, // RATIONALE: Catches a common coding mistake. 'no-unused-expressions': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-unused-labels': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-useless-catch': 1, // RATIONALE: Avoids a potential performance problem. 'no-useless-concat': 1, // RATIONALE: The "var" keyword is deprecated because of its confusing "hoisting" behavior. // Always use "let" or "const" instead. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json 'no-var': 0, // RATIONALE: Generally not needed in modern code. 'no-void': 1, // RATIONALE: Obsolete language feature that is deprecated. // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-with': 2, // RATIONALE: Makes logic easier to understand, since constants always have a known value // @typescript-eslint\eslint-plugin\dist\configs\eslint-recommended.js 'prefer-const': 0, // RATIONALE: Catches a common coding mistake where "resolve" and "reject" are confused. 'promise/param-names': 2, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'require-atomic-updates': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'require-yield': 1, // "Use strict" is redundant when using the TypeScript compiler. 'strict': [ 2, 'never' ], // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'use-isnan': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js // Set to 1 (warning) or 2 (error) to enable. // Rationale to disable: !!{} 'no-extra-boolean-cast': 0, // ==================================================================== // @microsoft/eslint-plugin-spfx // ==================================================================== '@microsoft/spfx/import-requires-chunk-name': 1, '@microsoft/spfx/no-require-ensure': 2, '@microsoft/spfx/pair-react-dom-render-unmount': 0, // ==================================================================== // no-useless-escape // ==================================================================== 'no-useless-escape': 0, 'no-case-declarations': 0 } }, { // For unit tests, we can be a little bit less strict. The settings below revise the // defaults specified in the extended configurations, as well as above. files: [ // Test files '*.test.ts', '*.test.tsx', '*.spec.ts', '*.spec.tsx', // Facebook convention '**/__mocks__/*.ts', '**/__mocks__/*.tsx', '**/__tests__/*.ts', '**/__tests__/*.tsx', // Microsoft convention '**/test/*.ts', '**/test/*.tsx' ], rules: {} } ] }; ================================================ FILE: source/react-command-discuss-now/.gitignore ================================================ # Logs logs *.log npm-debug.log* # Dependency directories node_modules # Build generated files dist lib release solution temp *.sppkg .heft # Coverage directory used by tools like istanbul coverage # OSX .DS_Store # Visual Studio files .ntvs_analysis.dat .vs bin obj # Resx Generated Code *.resx.ts # Styles Generated Code *.scss.ts ================================================ FILE: source/react-command-discuss-now/.npmignore ================================================ !dist config gulpfile.js release src temp tsconfig.json tslint.json *.log .yo-rc.json .vscode ================================================ FILE: source/react-command-discuss-now/.vscode/launch.json ================================================ { "version": "0.2.0", "configurations": [ { "name": "Hosted workbench", "type": "pwa-chrome", "request": "launch", "url": "https://enter-your-SharePoint-site/_layouts/workbench.aspx", "webRoot": "${workspaceRoot}", "sourceMaps": true, "sourceMapPathOverrides": { "webpack:///.././src/*": "${webRoot}/src/*", "webpack:///../../../src/*": "${webRoot}/src/*", "webpack:///../../../../src/*": "${webRoot}/src/*", "webpack:///../../../../../src/*": "${webRoot}/src/*" }, "runtimeArgs": [ "--remote-debugging-port=9222", "-incognito" ] } ] } ================================================ FILE: source/react-command-discuss-now/.vscode/settings.json ================================================ // Place your settings in this file to overwrite default and user settings. { // Configure glob patterns for excluding files and folders in the file explorer. "files.exclude": { "**/.git": true, "**/.DS_Store": true, "**/bower_components": true, "**/coverage": true, "**/lib-amd": true, "src/**/*.scss.ts": true }, "typescript.tsdk": ".\\node_modules\\typescript\\lib" } ================================================ FILE: source/react-command-discuss-now/.yo-rc.json ================================================ { "@microsoft/generator-sharepoint": { "plusBeta": false, "isCreatingSolution": true, "nodeVersion": "16.19.0", "sdksVersions": { "@microsoft/microsoft-graph-client": "3.0.2", "@microsoft/teams-js": "2.4.1" }, "version": "1.16.1", "environment": "spo", "libraryName": "react-command-discuss-now", "libraryId": "76b85695-0232-4c4a-8e24-5458cf1dcbba", "packageManager": "npm", "isDomainIsolated": false, "componentType": "extension", "extensionType": "ListViewCommandSet" } } ================================================ FILE: source/react-command-discuss-now/README.md ================================================ # Discuss now extension # Discuss Now List View Command Set This List View Command Set provides you the ability to add a custom dialog to start a discussion on a specific document within a document library by creating a discussion on the choosen team at Microsoft Team. The message is added to the team by using Microsoft Graph APIs based on choosen list of items. The command set extension is designed for group associated team sites. ![Discuss Now](../../assets/images/components/ext-collab-discussnow.png) This extension requires access to the Microsoft Graph and must target a specific list template types, such as `101` for document libraries. Details on the v1 version of the extension from https://github.com/SharePoint/sp-starter-kit/blob/master/documentation/components/ext-collab-discussnow.md. Notice that the v1 UI is different as that was creatin a meeting for the discussion. In the v2, we need to ask list of teams which user has access to start the discussion. ## Used SharePoint Framework Version ![drop](https://img.shields.io/badge/version-1.16.1-green.svg) * Supported in SharePoint Online ## Applies to * [SharePoint Framework](https://learn.microsoft.com/en-us/sharepoint/dev/spfx/sharepoint-framework-overview) * [Office 365 tenant](https://learn.microsoft.com/en-us/sharepoint/dev/spfx/set-up-your-development-environment) ## Prerequisites Permissions to Microsoft Graph - scope: "Group.ReadWrite.All" ## Solution Solution|Author(s) --------|--------- react-command-discuss-now | Chandani Prajapati ## Version history Version|Date|Comments -------|----|-------- 1.0|December 25, 2019|Initial release 2.0|February 2023|Initial release for SharePoint Starter Kit v3 (Upgraded to SPFx 1.16.1) ## Disclaimer **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.** --- ## Minimal Path to Awesome * Clone this repository * Move to correct folder * Update config.json based on the tenant details which you use for testing * in the command line run: * `npm install` * `gulp serve` ## Features This Application customizer illustrates the following concepts on top of the SharePoint Framework: * Using Microsoft Graph within an application customizer command set ================================================ FILE: source/react-command-discuss-now/config/config.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/config.2.0.schema.json", "version": "2.0", "bundles": { "discuss-now-command-set": { "components": [ { "entrypoint": "./lib/extensions/discussNow/DiscussNowCommandSet.js", "manifest": "./src/extensions/discussNow/DiscussNowCommandSet.manifest.json" } ] } }, "externals": {}, "localizedResources": { "DiscussNowCommandSetStrings": "lib/extensions/discussNow/loc/{locale}.js" } } ================================================ FILE: source/react-command-discuss-now/config/deploy-azure-storage.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/deploy-azure-storage.schema.json", "workingDir": "./release/assets/", "account": "", "container": "react-command-discuss-now", "accessKey": "" } ================================================ FILE: source/react-command-discuss-now/config/package-solution.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/package-solution.schema.json", "solution": { "name": "Starter Kit - Discuss Now command set", "id": "76b85695-0232-4c4a-8e24-5458cf1dcbba", "version": "3.0.0.0", "includeClientSideAssets": true, "skipFeatureDeployment": true, "isDomainIsolated": false, "developer": { "name": "PnP Starter Kit", "websiteUrl": "", "privacyUrl": "", "termsOfUseUrl": "", "mpnId": "pnpsk" }, "metadata": { "shortDescription": { "default": "react-command-discuss-now description" }, "longDescription": { "default": "react-command-discuss-now description" }, "screenshotPaths": [], "videoUrl": "", "categories": [] }, "webApiPermissionRequests": [ { "resource": "Microsoft Graph", "scope": "Group.ReadWrite.All" } ], "features": [ { "title": "Application Extension - Deployment of Starter Kit - Discuss Now command set custom action", "description": "Deploys a custom action within Starter Kit - Discuss Now command set", "id": "89733413-9b66-4c6a-8bac-ecd0844ef752", "version": "3.0.0.0", "assets": { "elementManifests": [ "elements.xml", "clientsideinstance.xml" ] } } ] }, "paths": { "zippedPackage": "solution/react-command-discuss-now.sppkg" } } ================================================ FILE: source/react-command-discuss-now/config/sass.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/core-build/sass.schema.json" } ================================================ FILE: source/react-command-discuss-now/config/serve.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/spfx-serve.schema.json", "port": 4321, "https": true, "serveConfigurations": { "default": { "pageUrl": "https://contoso.sharepoint.com/sites/mySite/SitePages/myPage.aspx", "customActions": { "84de6bad-859f-4c3b-934c-f6c6ae935c72": { "location": "ClientSideExtension.ListViewCommandSet.CommandBar", "properties": { "sampleTextOne": "One item is selected in the list", "sampleTextTwo": "This command is always visible." } } } }, "discussNow": { "pageUrl": "https://contoso.sharepoint.com/sites/mySite/SitePages/myPage.aspx", "customActions": { "84de6bad-859f-4c3b-934c-f6c6ae935c72": { "location": "ClientSideExtension.ListViewCommandSet.CommandBar", "properties": { "sampleTextOne": "One item is selected in the list", "sampleTextTwo": "This command is always visible." } } } } } } ================================================ FILE: source/react-command-discuss-now/config/write-manifests.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/write-manifests.schema.json", "cdnBasePath": "" } ================================================ FILE: source/react-command-discuss-now/gulpfile.js ================================================ 'use strict'; const build = require('@microsoft/sp-build-web'); build.addSuppression(`Warning - [sass] The local CSS class 'ms-Grid' is not camelCase and will not be type-safe.`); var getTasks = build.rig.getTasks; build.rig.getTasks = function () { var result = getTasks.call(build.rig); result.set('serve', result.get('serve-deprecated')); return result; }; build.initialize(require('gulp')); ================================================ FILE: source/react-command-discuss-now/package.json ================================================ { "name": "react-command-discuss-now", "version": "3.0.0", "private": true, "main": "lib/index.js", "engines": { "node": ">=16.13.0 <17.0.0" }, "scripts": { "build": "gulp bundle", "clean": "gulp clean", "test": "gulp test" }, "dependencies": { "@microsoft/decorators": "1.16.1", "@microsoft/sp-application-base": "1.16.1", "@microsoft/sp-core-library": "1.16.1", "@microsoft/sp-dialog": "1.16.1", "@microsoft/sp-listview-extensibility": "1.16.1", "@microsoft/sp-office-ui-fabric-core": "1.16.1", "@microsoft/sp-webpart-base": "1.16.1", "react": "17.0.1", "react-dom": "17.0.1", "tslib": "2.3.1" }, "resolutions": { "@types/react": "16.8.8" }, "devDependencies": { "@microsoft/eslint-config-spfx": "1.16.1", "@microsoft/eslint-plugin-spfx": "1.16.1", "@microsoft/rush-stack-compiler-4.5": "0.2.2", "@microsoft/sp-build-web": "1.16.1", "@microsoft/sp-module-interfaces": "1.16.1", "@microsoft/sp-tslint-rules": "1.14.0", "@rushstack/eslint-config": "2.5.1", "@types/es6-promise": "0.0.33 ", "@types/react": "17.0.45", "@types/react-dom": "17.0.17", "@types/webpack-env": "1.15.2", "ajv": "6.12.5", "eslint": "8.7.0", "eslint-plugin-react-hooks": "4.3.0", "gulp": "4.0.2", "tslint-microsoft-contrib": "5.0.0", "typescript": "4.5.5" } } ================================================ FILE: source/react-command-discuss-now/sharepoint/assets/ClientSideInstance.xml ================================================ ================================================ FILE: source/react-command-discuss-now/sharepoint/assets/elements.xml ================================================ ================================================ FILE: source/react-command-discuss-now/src/extensions/discussNow/DiscussNowCommandSet.manifest.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx/command-set-extension-manifest.schema.json", "id": "84de6bad-859f-4c3b-934c-f6c6ae935c72", "alias": "DiscussNowCommandSet", "componentType": "Extension", "extensionType": "ListViewCommandSet", // 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, "items": { "DISCUSS_NOW": { "title": { "default": "Discuss Now" }, "iconImageUrl": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAG4AAABkCAYAAABnwAWdAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAZdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuMjHxIGmVAAACfElEQVR4Xu3cMW7CQBRF0SyMHVDBFkC0LIQCiYaGlpI1Okxl5fHDKLHH/s/c4jSf8cjjmyJWIr66roOhcIj8wiHyC4fILxwiv3CI/MIh8guHyC8ctrTdbrvVavXD4/F4fhSvz6rcs56jnE3XtRIOWyLcOMJhS4QbRzhsiXDjCIctEW4c4bCVctj1ev1y4PP5/Pw4viarcs96jnK2qX4Iw+Fv9vv9y81iXOUZ63OPhMPfEK49wpkinCnCmZos3Ol0en4Ur49sNpuXPe73+/OjeH1W5Z71HOVsuu6d8ux0j8nCXS6X50fx+kj0HqdrXOg5/voeV56d7kG4Ceg5CGdCz0E4E3qORYc7Ho/dbrf7Qde40HOUs+mad6zCoUc4U4QzRThThDM1a7jD4dBdr1f8Q3l2+jwnC4dxEc4U4UwRzhThTE0W7q9/SEXP6g+p6PECbopwpghninCmPi6c3kOha2pa7LHof10Yg95DoWtqWuxBuAq9h0LX1LTYg3AVeg+FrqlpsQfhKvQeCl1T02IPwn0IwpkinCnCmSKcKcKZsgpXfmXWPXRNjV6fZY9Fvw4Qrke4JHsQrkKvz7IH4Sr0+ix7LDrc7XZ7+R96XVOj12fZo5xN17xjFQ49wpkinCnCmSKcKatwY3zPiV6fZY9Ff88J73E9wiXZg3AVen2WPQhXoddn2WPR4fjlpGcVDj3CmSKcKcKZIpwpq3BL+kPqUFbhlvQeNxThZtpjKMLNtMdQhJtpj6EIN9MeQ1mFQ49wpghninCmCGdq1nB8Q+z/zfoNsRgX4UwRzhThTBHOVJNwyCMcIr9wiPzCIfILh8gvHCK/cIj8wiGy676+ARlkLSkcz5VlAAAAAElFTkSuQmCC", "type": "command" } } } ================================================ FILE: source/react-command-discuss-now/src/extensions/discussNow/DiscussNowCommandSet.ts ================================================ import { override } from '@microsoft/decorators'; import { Log } from '@microsoft/sp-core-library'; import { BaseListViewCommandSet, Command, IListViewCommandSetListViewUpdatedParameters, IListViewCommandSetExecuteEventParameters } from '@microsoft/sp-listview-extensibility'; import { Dialog } from '@microsoft/sp-dialog'; import * as strings from 'DiscussNowCommandSetStrings'; import ScheduleMeetingDialog from './components/ScheduleMeetingDialog'; /** * 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 IDiscussNowCommandSetProperties { // This is an example; replace with your own property disabledCommandIds: string[] | undefined; } const LOG_SOURCE: string = 'DiscussNowCommandSet'; export default class DiscussNowCommandSet extends BaseListViewCommandSet { @override public onInit(): Promise { Log.info(LOG_SOURCE, 'Initialized DiscussNowCommandSet'); return Promise.resolve(); } @override public onListViewUpdated(event: IListViewCommandSetListViewUpdatedParameters): void { // show the command just in case a single item is selected const scheduleMeetingCommand: Command | undefined = this.tryGetCommand('DISCUSS_NOW'); scheduleMeetingCommand.visible = event.selectedRows.length == 1; } @override public onExecute(event: IListViewCommandSetExecuteEventParameters): void { switch (event.itemId) { case 'DISCUSS_NOW': const id: number = event.selectedRows[0].getValueByName("ID"); const fileName: string = event.selectedRows[0].getValueByName("FileLeafRef"); const filePath: string = event.selectedRows[0].getValueByName("ServerRedirectedEmbedUrl"); const dialog: ScheduleMeetingDialog = new ScheduleMeetingDialog(); dialog.fileName = fileName; dialog.filePath = filePath; dialog.context = this.context; dialog.show(); break; default: throw new Error('Unknown command'); } } } ================================================ FILE: source/react-command-discuss-now/src/extensions/discussNow/components/DateTimePicker.tsx ================================================ import * as React from 'react'; import { IDateTimePickerProps } from './IDateTimePickerProps'; import { IDateTimePickerState } from './IDateTimePickerState'; /** * Common Infrastructure */ import { BaseComponent, assign } from '@fluentui/react/lib/Utilities'; /** * Label */ import { Label } from '@fluentui/react/lib/Label'; /** * Text Field */ import { TextField } from '@fluentui/react/lib/TextField'; import { Icon } from '@fluentui/react/lib/Icon'; /** * Date Picker */ import { DatePicker, DayOfWeek, IDatePickerStrings } from '@fluentui/react/lib/DatePicker'; const DayPickerStrings: IDatePickerStrings = { months: [ 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' ], shortMonths: [ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' ], days: [ 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday' ], shortDays: [ 'S', 'M', 'T', 'W', 'T', 'F', 'S' ], goToToday: 'Go to today', isRequiredErrorMessage: 'Field is required.', invalidInputErrorMessage: 'Invalid date format.' }; export interface IDatePickerRequiredExampleState { firstDayOfWeek?: DayOfWeek; } export class DateTimePicker extends React.Component { /** * Constructor */ constructor(props: IDateTimePickerProps) { super(props); this.state = { date: (this.props.initialDateTime != null) ? this.props.initialDateTime : null, hours: (this.props.initialDateTime != null) ? this.props.initialDateTime.getHours() : 0, minutes: (this.props.initialDateTime != null) ? this.props.initialDateTime.getMinutes() : 0, seconds: (this.props.initialDateTime != null) ? this.props.initialDateTime.getSeconds() : 0, }; } public render(): React.ReactElement { return (
{ (this.props.showTime) ?
: null } { (this.props.showTime) ?
: null } { (this.props.showTime && this.props.includeSeconds) ?
: null }
); } private _dateSelected = (date: Date): void => { if (date == null) { return; } this.setState({ date: date }, () => { this.saveFullDate(); }); } private _hoursChanged = (event: React.FormEvent, value?: string): void => { this.setState({ hours: Number(value) }, () => { this.saveFullDate(); }); } private _getErrorMessageHours = (value: string): string => { let hoursValue: Number = Number(value); return (hoursValue >= 0 && hoursValue <= 23) ? '' : `${this.props.hoursValidationError}.`; } private _minutesChanged = (event: React.FormEvent, newValue?: string): void => { this.setState({ minutes: Number(newValue) }, () => { this.saveFullDate(); }); } private _getErrorMessageMinutes = (value: string): string => { let minutesValue: Number = Number(value); return (minutesValue >= 0 && minutesValue <= 59) ? '' : `${this.props.minutesValidationError}.`; } private _secondsChanged = (event: React.FormEvent, newValue?: string): void => { this.setState({ seconds: Number(newValue) }, () => { this.saveFullDate(); }); } private _getErrorMessageSeconds = (value: string): string => { let secondsValue: Number = Number(value); return (secondsValue >= 0 && secondsValue <= 59) ? '' : `${this.props.secondsValidationError}.`; } private saveFullDate(): void { if (this.state.date == null) { return; } var finalDate: Date = new Date(this.state.date.toISOString()); finalDate.setHours(this.state.hours); finalDate.setMinutes(this.state.minutes); finalDate.setSeconds(this.props.includeSeconds ? this.state.seconds : 0); if (finalDate != null) { var finalDateAsString: string = ''; if (this.props.formatDate) { finalDateAsString = this.props.formatDate(finalDate); } else { finalDateAsString = finalDate.toString(); } } this.setState({ fullDate: finalDateAsString }); if (this.props.onChanged != null) { this.props.onChanged(finalDate); } } } ================================================ FILE: source/react-command-discuss-now/src/extensions/discussNow/components/IDateTimePickerProps.ts ================================================ export interface IDateTimePickerProps { dateLabel: string; datePlaceholder?: string; hoursLabel?: string; hoursValidationError?: string; minutesLabel?: string; minutesValidationError?: string; secondsLabel?: string; secondsValidationError?: string; isRequired: boolean; initialDateTime?: Date; showTime?: boolean; includeSeconds?: boolean; formatDate?: (date: Date) => string; onChanged?: (newValue: Date) => void; } ================================================ FILE: source/react-command-discuss-now/src/extensions/discussNow/components/IDateTimePickerState.ts ================================================ export interface IDateTimePickerState { date?: Date; hours?: number; minutes?: number; seconds?: number; fullDate?: string; } ================================================ FILE: source/react-command-discuss-now/src/extensions/discussNow/components/ScheduleMeetingDialog.module.scss ================================================ @import '~@fluentui/react/dist/sass/References.scss'; .scheduleMeetingDialogRoot { .scheduleMeetingDialogContent { text-align: left; vertical-align: top; } } ================================================ FILE: source/react-command-discuss-now/src/extensions/discussNow/components/ScheduleMeetingDialog.tsx ================================================ import * as React from 'react'; import * as ReactDOM from 'react-dom'; import { BaseDialog, IDialogConfiguration } from '@microsoft/sp-dialog'; import { PrimaryButton, CommandButton, TextField, Dropdown, IDropdownOption, DialogFooter, DialogContent } from '@fluentui/react'; import { DateTimePicker } from './DateTimePicker'; import { ListViewCommandSetContext } from '@microsoft/sp-listview-extensibility'; import { Dialog } from '@microsoft/sp-dialog'; import { MSGraphClientV3 } from "@microsoft/sp-http"; import styles from './ScheduleMeetingDialog.module.scss'; import * as strings from 'DiscussNowCommandSetStrings'; interface IScheduleMeetingDialogContentProps { fileName: string; filePath: string; close: () => void; submit: (subject: string, meetingDateTime: Date, duration: number) => void; } interface IScheduleMeetingDialogContentState { subject: string; dateTime: Date; duration: number; } class ScheduleMeetingDialogContent extends React.Component { constructor(props: IScheduleMeetingDialogContentProps) { super(props); this.state = { subject: this.props.fileName, dateTime: new Date(), duration: 60 }; } public render(): JSX.Element { return (
{ this.props.submit(this.state.subject, this.state.dateTime, this.state.duration); }} />
); } private _onChangedSubject = (event: React.FormEvent, newValue?: string): void => { this.setState({ subject: newValue, }); } private _getErrorMessageSubject(value: string): string { return (value == null || value.length === 0 || value.length >= 10) ? '' : `${strings.ScheduleMeetingSubjectValidationErrorMessage} ${value.length}.`; } private _onChangedScheduledDateTime = (newValue: Date): void => { this.setState({ dateTime: newValue, }); } private _onChangedScheduleDuration = (option: IDropdownOption, index?: number): void => { const duration: number = Number(option.key); this.setState({ duration: duration }); } } export default class ScheduleMeetingDialog extends BaseDialog { public fileName: string; public filePath: string; public context: ListViewCommandSetContext; public render(): void { ReactDOM.render(, this.domElement); } public getConfig(): IDialogConfiguration { return { isBlocking: false }; } private _submit = async (subject: string, dateTime: Date, duration: number): Promise => { // ******************************************* // schedule the meeting with Microsoft Graph // ******************************************* let response: any = null; const startDateTimeISO: string = dateTime.toISOString(); // calculate the end date time let addMinutes: number = 0; let addHours: number = 0; switch (duration) { case 30: addMinutes = 30; break; case 60: addHours = 1; break; case 90: addHours = 1; addMinutes = 30; break; case 120: addHours = 2; break; default: break; } let endDateTime: Date = new Date(startDateTimeISO); endDateTime.setHours(dateTime.getHours() + addHours); endDateTime.setMinutes(dateTime.getMinutes() + addMinutes); const endDateTimeISO: string = endDateTime.toISOString(); const groupId: string = this.context.pageContext.legacyPageContext.groupId; if (groupId) { const newMeetingRequest: any = { body: { content: "Let's discuss about this document: ${this.filePath}", contentType: "Text" }, subject: subject, start: { dateTime: startDateTimeISO, timeZone: "UTC" }, end: { dateTime: endDateTimeISO, timeZone: "UTC" } }; const graphClient: MSGraphClientV3 = await this.context.msGraphClientFactory.getClient('3'); response = await graphClient .api(`groups/${groupId}/calendar/events`) .version("v1.0") .post(newMeetingRequest); } if (response && response.id) { Dialog.alert(`Meeting "${subject}" has been successfully created.`); } else { Dialog.alert(`Failed to create meeting "${subject}"!`); } this.close(); } } ================================================ FILE: source/react-command-discuss-now/src/extensions/discussNow/loc/de-de.js ================================================ define([], function() { return { "DiscussNowCommand": "Discuss Now", "DiscussNowDialogTitle": "Jetzt besprechen", "DiscussNowDialogDescription": "Stellen Sie für eine Besprechung Thema, Datum und Dauer bereit, in der Sie das aktuell ausgewählte Dokument diskutieren.", "ScheduleMeetingSubjectLabel": "Besprechungsthema:", "ScheduleMeetingSubjectValidationErrorMessage": "Das Thema muss aus mehr als 10 Zeichen bestehen.", "ScheduleMeetingDateLabel": "Besprechungsdatum:", "ScheduleMeetingHoursLabel": "Stunden", "ScheduleMeetingHoursValidationError": "Bitte geben Sie eine gültigen Stundenwert an", "ScheduleMeetingMinutesLabel": "Minuten", "ScheduleMeetingMinutesValidationError": "Bitte geben Sie eine gültigen Minutenwert an", "ScheduleMeetingDurationLabel": "Besprechungsdauer:", "ScheduleMeetingOkButtonText": "Zeitplan", "ScheduleMeetingCancelButtonText": "Abbrechen", } }); ================================================ FILE: source/react-command-discuss-now/src/extensions/discussNow/loc/en-us.js ================================================ define([], function() { return { "DiscussNowCommand": "Discuss Now", "DiscussNowDialogTitle": "Discuss Now", "DiscussNowDialogDescription": "Provide a subject, date, and duration for a meeting to discuss about the currently selected document", "ScheduleMeetingSubjectLabel": "Meeting Subject:", "ScheduleMeetingSubjectValidationErrorMessage": "Provide a subject text longer than 10 characters.", "ScheduleMeetingDateLabel": "Meeting Date:", "ScheduleMeetingHoursLabel": "Hours", "ScheduleMeetingHoursValidationError": "Please provide a valid hours value", "ScheduleMeetingMinutesLabel": "Minutes", "ScheduleMeetingMinutesValidationError": "Please provide a valid minutes value", "ScheduleMeetingDurationLabel": "Meeting Duration:", "ScheduleMeetingOkButtonText": "Schedule", "ScheduleMeetingCancelButtonText": "Cancel", } }); ================================================ FILE: source/react-command-discuss-now/src/extensions/discussNow/loc/es-es.js ================================================ define([], function() { return { "DiscussNowCommand": "Discutir ahora", "DiscussNowDialogTitle": "Discutir ahora", "DiscussNowDialogDescription": "Capture un tema, fecha y duracion para discutirlo en la reunionacerca del documento seleccionado", "ScheduleMeetingSubjectLabel": "Título de la reunion:", "ScheduleMeetingSubjectValidationErrorMessage": "Capture un titulo de la reunion mayor a 10 caracteres.", "ScheduleMeetingDateLabel": "Fecha de la reunion:", "ScheduleMeetingHoursLabel": "Horas", "ScheduleMeetingHoursValidationError": "Favor de capturar hora validas", "ScheduleMeetingMinutesLabel": "Minutos", "ScheduleMeetingMinutesValidationError": "Favor de capturar minutos validos", "ScheduleMeetingDurationLabel": "Duracion de la reunion:", "ScheduleMeetingOkButtonText": "Agenda", "ScheduleMeetingCancelButtonText": "Cancelar", } }); ================================================ FILE: source/react-command-discuss-now/src/extensions/discussNow/loc/fr-fr.js ================================================ define([], function() { return { "DiscussNowCommand": "Discuter maintenant", "DiscussNowDialogTitle": "Discuter maintenant", "DiscussNowDialogDescription": "Fournir un sujet, une date et une durée pour une réunion afin de discuter du document actuellement sélectionné", "ScheduleMeetingSubjectLabel": "Sujet de la réunion:", "ScheduleMeetingSubjectValidationErrorMessage": "Fournissez un texte sujet de plus de 10 caractères.", "ScheduleMeetingDateLabel": "Date de réunion:", "ScheduleMeetingHoursLabel": "Heures", "ScheduleMeetingHoursValidationError": "Veuillez fournir une valeur d'heures valide", "ScheduleMeetingMinutesLabel": "Minutes", "ScheduleMeetingMinutesValidationError": "Veuillez fournir une valeur de minutes valide", "ScheduleMeetingDurationLabel": "Durée de réunion:", "ScheduleMeetingOkButtonText": "Planifier", "ScheduleMeetingCancelButtonText": "Annuler", } }); ================================================ FILE: source/react-command-discuss-now/src/extensions/discussNow/loc/myStrings.d.ts ================================================ declare interface IDiscussNowCommandSetStrings { DiscussNowCommand: string; DiscussNowDialogTitle: string; DiscussNowDialogDescription: string; ScheduleMeetingSubjectLabel: string; ScheduleMeetingSubjectPlaceholder: string; ScheduleMeetingSubjectValidationErrorMessage: string; ScheduleMeetingDateLabel: string; ScheduleMeetingHoursLabel: string; ScheduleMeetingHoursValidationError: string; ScheduleMeetingMinutesLabel: string; ScheduleMeetingMinutesValidationError: string; ScheduleMeetingDurationLabel: string; ScheduleMeetingOkButtonText: string; ScheduleMeetingCancelButtonText: string; } declare module 'DiscussNowCommandSetStrings' { const strings: IDiscussNowCommandSetStrings; export = strings; } ================================================ FILE: source/react-command-discuss-now/src/extensions/discussNow/loc/nb-no.js ================================================ define([], function() { return { "DiscussNowCommand": "Diskuter nå", "DiscussNowDialogTitle": "Diskuter nå", "DiscussNowDialogDescription": "Angi et tema, dato og varighet for møtet for å diskutere det valgte dokumentet", "ScheduleMeetingSubjectLabel": "Møtetema:", "ScheduleMeetingSubjectValidationErrorMessage": "Benytt mer enn 10 tegn for team.", "ScheduleMeetingDateLabel": "Møtedato:", "ScheduleMeetingHoursLabel": "Timer", "ScheduleMeetingHoursValidationError": "Angi en gyldig verdi for timer", "ScheduleMeetingMinutesLabel": "Minutter", "ScheduleMeetingMinutesValidationError": "Angi en gyldig verdi for minutter", "ScheduleMeetingDurationLabel": "Møteperiode:", "ScheduleMeetingOkButtonText": "Planlegg", "ScheduleMeetingCancelButtonText": "Avbryt", } }); ================================================ FILE: source/react-command-discuss-now/src/extensions/discussNow/loc/nl-nl.js ================================================ define([], function() { return { "DiscussNowCommand": "Discuss Now", "DiscussNowDialogTitle": "Bespreek nu", "DiscussNowDialogDescription": "Geef een onderwerp, datum en lengte van een meeting op om het geselecteerde document te bespreken", "ScheduleMeetingSubjectLabel": "Meeting onderwerp:", "ScheduleMeetingSubjectValidationErrorMessage": "Geef een onderwerp tekst op van langer dan 10 tekens.", "ScheduleMeetingDateLabel": "Meeting datum:", "ScheduleMeetingHoursLabel": "Uur", "ScheduleMeetingHoursValidationError": "Geef een valide uur waarde op", "ScheduleMeetingMinutesLabel": "Minuten", "ScheduleMeetingMinutesValidationError": "Geef een valide minuten waarde op", "ScheduleMeetingDurationLabel": "Meeting lengte:", "ScheduleMeetingOkButtonText": "Plan", "ScheduleMeetingCancelButtonText": "Annuleer", } }); ================================================ FILE: source/react-command-discuss-now/src/extensions/discussNow/loc/sv-se.js ================================================ define([], function() { return { "DiscussNowCommand": "Diskutera Nu", "DiscussNowDialogTitle": "Diskutera Nu", "DiscussNowDialogDescription": "Ange ett ämne, datum och varaktighet för ett möte, för att diskutera det valda dokumentet", "ScheduleMeetingSubjectLabel": "Mötesämne:", "ScheduleMeetingSubjectValidationErrorMessage": "Ange en ämnestext längre än 10 tecken.", "ScheduleMeetingDateLabel": "Mötesdatum:", "ScheduleMeetingHoursLabel": "Timmar", "ScheduleMeetingHoursValidationError": "Ange ett giltigt värde för timmar", "ScheduleMeetingMinutesLabel": "Minuter", "ScheduleMeetingMinutesValidationError": "Ange ett giltigt värde för minuter", "ScheduleMeetingDurationLabel": "Mötesperiod:", "ScheduleMeetingOkButtonText": "Schemalägg", "ScheduleMeetingCancelButtonText": "Avbryt", } }); ================================================ FILE: source/react-command-discuss-now/src/extensions/discussNow/loc/tr-tr.js ================================================ define([], function() { return { "DiscussNowCommand": "Şimdi Görüş", "DiscussNowDialogTitle": "Şimdi Görüş", "DiscussNowDialogDescription": "Seçili belge hakkında görüşmek üzere bir toplantı için bir konu, tarih ve süre belirtin", "ScheduleMeetingSubjectLabel": "Toplantı Konusu:", "ScheduleMeetingSubjectValidationErrorMessage": "10 karakterden daha uzun bir konu metni sağlayın.", "ScheduleMeetingDateLabel": "Buluşma tarihi:", "ScheduleMeetingHoursLabel": "Saat", "ScheduleMeetingHoursValidationError": "Lütfen geçerli bir saat değeri belirtin", "ScheduleMeetingMinutesLabel": "Dakika", "ScheduleMeetingMinutesValidationError": "Lütfen geçerli bir dakika değeri belirtin", "ScheduleMeetingDurationLabel": "Toplantı Süresi:", "ScheduleMeetingOkButtonText": "Zamanla", "ScheduleMeetingCancelButtonText": "İptal", } }); ================================================ FILE: source/react-command-discuss-now/src/index.ts ================================================ // A file is required to be in the root of the /src directory by the TypeScript compiler ================================================ FILE: source/react-command-discuss-now/tsconfig.json ================================================ { "extends": "./node_modules/@microsoft/rush-stack-compiler-4.5/includes/tsconfig-web.json", "compilerOptions": { "target": "es5", "forceConsistentCasingInFileNames": true, "module": "esnext", "moduleResolution": "node", "jsx": "react", "declaration": true, "sourceMap": true, "experimentalDecorators": true, "skipLibCheck": true, "outDir": "lib", "inlineSources": false, "strictNullChecks": false, "noImplicitAny": false, "noUnusedLocals": false, "typeRoots": [ "./node_modules/@types", "./node_modules/@microsoft" ], "types": [ "webpack-env" ], "lib": [ "es5", "dom", "es2015.collection", "es2015.promise" ] }, "include": [ "src/**/*.ts", "src/**/*.tsx" ] } ================================================ FILE: source/react-followed-sites/.editorconfig ================================================ # EditorConfig helps developers define and maintain consistent # coding styles between different editors and IDEs # editorconfig.org root = true [*] # change these settings to your own preference indent_style = space indent_size = 2 # we recommend you to keep these unchanged end_of_line = lf charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true [*.md] trim_trailing_whitespace = false [{package,bower}.json] indent_style = space indent_size = 2 ================================================ FILE: source/react-followed-sites/.gitignore ================================================ # Logs logs *.log npm-debug.log* # Dependency directories node_modules # Build generated files dist lib release solution temp *.sppkg .heft # Coverage directory used by tools like istanbul coverage # OSX .DS_Store # Visual Studio files .ntvs_analysis.dat .vs bin obj # Resx Generated Code *.resx.ts # Styles Generated Code *.scss.ts ================================================ FILE: source/react-followed-sites/.npmignore ================================================ !dist config gulpfile.js release src temp tsconfig.json tslint.json *.log .yo-rc.json .vscode ================================================ FILE: source/react-followed-sites/.vscode/launch.json ================================================ { "version": "0.2.0", "configurations": [ { "name": "Hosted workbench", "type": "pwa-chrome", "request": "launch", "url": "https://enter-your-SharePoint-site/_layouts/workbench.aspx", "webRoot": "${workspaceRoot}", "sourceMaps": true, "sourceMapPathOverrides": { "webpack:///.././src/*": "${webRoot}/src/*", "webpack:///../../../src/*": "${webRoot}/src/*", "webpack:///../../../../src/*": "${webRoot}/src/*", "webpack:///../../../../../src/*": "${webRoot}/src/*" }, "runtimeArgs": [ "--remote-debugging-port=9222", "-incognito" ] } ] } ================================================ FILE: source/react-followed-sites/.vscode/settings.json ================================================ // Place your settings in this file to overwrite default and user settings. { // Configure glob patterns for excluding files and folders in the file explorer. "files.exclude": { "**/.git": true, "**/.DS_Store": true, "**/bower_components": true, "**/coverage": true, "**/lib-amd": true, "src/**/*.scss.ts": true }, "typescript.tsdk": ".\\node_modules\\typescript\\lib" } ================================================ FILE: source/react-followed-sites/.yo-rc.json ================================================ { "@microsoft/generator-sharepoint": { "plusBeta": false, "isCreatingSolution": true, "nodeVersion": "16.19.0", "sdksVersions": { "@microsoft/microsoft-graph-client": "3.0.2", "@microsoft/teams-js": "2.4.1" }, "version": "1.16.1", "environment": "spo", "libraryName": "react-followed-sites", "libraryId": "c818b178-6ea2-4722-8c55-32fdf5cfcc9d", "packageManager": "npm", "isDomainIsolated": false, "componentType": "webpart" } } ================================================ FILE: source/react-followed-sites/README.md ================================================ # Followed Sites webpart This web part provides you the ability to display a list of site administrator defined number of sites that a given user is following, with paging as well as inline filtering of sites by keyword or phrase. Currently the list of followed sites includes sites that returned by the SharePoint api endpoint: `/_api/social.following/my/followed(types=4)` > `NOTE:` This webpart includes the use of a custom SPFx library, [library-starter-kit-shared](../library-starter-kit-shared). If you need to rebuild / bundle / package this solution, refer to [Minimal Path to Awesome](#Minimal-Path-to-Awesome) ![Follwed Sites](../../assets/images/components/part-followed-sites.gif) ## Configurable Properties The `Followed Sites` webpart can be configured with the following properties: | Label | Property | Type | Required | Description | | ---- | ---- | ---- | ---- | ---- | | Followed Sites | title | string | no | The webpart title, editable inline with the webpart itself | | Number of followed sites to retrieve | nrOfItems | number | no | The number of sites to show per page, default = 10 | | Specify the sort order of the retrieved sites | sortOrder | number | no | Preferred site sort order. Default sort order driven by SharePoint, or by site name | ## Used SharePoint Framework Version ![drop](https://img.shields.io/badge/version-1.16.1-green.svg) * Supported in SharePoint Online ## Applies to * [SharePoint Framework](https://learn.microsoft.com/en-us/sharepoint/dev/spfx/sharepoint-framework-overview) * [Office 365 tenant](https://learn.microsoft.com/en-us/sharepoint/dev/spfx/set-up-your-development-environment) ## Prerequisites * [library-starter-kit-shared](../library-starter-kit-shared) - this is provided by default in the solution. If you need to rebuild / bundle / package this solution, refer to [Minimal Path to Awesome](#Minimal-Path-to-Awesome) ## Minimal Path to Awesome This solution uses a SPFx library, [library-starter-kit-shared](../library-starter-kit-shared). As such, additional steps are required to rebuild this project. 1. Clone this entire project 2. Within the [library-starter-kit-shared](../library-starter-kit-shared) source, i.e. [./source/library-starter-kit-shared](../library-starter-kit-shared) ```powershell npm install gulp build gulp bundle npm link ``` 3. Within this SPFx solution folder [react-followed-sites](./), i.e. [./source/react-followed-sites](../react-followed-sites) * in the command line run: ```powershell npm install npm link @starter-kit/shared-library ``` 4. Edit package.json found at the root of the [react-followed-sites](./), i.e. [./source/react-followed-sites/package.json](../react-followed-sites/package.json) - Add a new dependancy to the project: "@starter-kit/shared-library": "3.0.0" **Example**: ```xml "dependencies": { "@microsoft/sp-core-library": "1.16.1", ... "react": "17.0.1", "react-dom": "17.0.1" } ``` to: ```xml "dependencies": { "@microsoft/sp-core-library": "1.16.1", ... "react": "17.0.1", "react-dom": "17.0.1" "@starter-kit/shared-library": "3.0.0" } ``` 5. Within this SPFx solution folder [react-followed-sites](./), i.e. [./source/react-followed-sites](../react-followed-sites) * in the command line run: ```powershell gulp serve ``` 6. To rebundle the webpart, within this SPFx solution folder [react-followed-sites](./), i.e. [./source/react-followed-sites](../react-followed-sites) * in the command line run: ```powershell gulp bundle gulp package-solution ``` > If you add this webpart's sppkg to your app catalog, the sppkg for the [shared library](../library-starter-kit-shared) must also be installed. The [library](../library-starter-kit-shared) may be built, bundled, and packaged similar to a standard SPFx webpart or extension. > The package.json within this SPFx solution file must be manually updated for if the library dependency was included by default with the project, **npm install** would fail as the [library-starter-kit-shared](../library-starter-kit-shared) package would not be found. Linking the two projects allows this webpart to reference the library during **development**, while the package.json reference is required for **bundling and packaging**. ## Solution Solution|Author(s) --------|--------- react-followed-sites | Elio Struyf react-followed-sites | Beau Cameron react-followed-sites | Chandani Prajapati ## Version history Version|Date|Comments -------|----|-------- 1.0|May, 2018|Initial release 2.0|November 29, 2019| v2.0 3.0|February 2023| Initial release for SharePoint Starter Kit v3 (Upgraded to SPFx 1.16.1) ## Features Description of the web part with possible additional details than in short summary. This Web Part illustrates the following concepts on top of the SharePoint Framework: * Using SharePoint APIs and spHttpClient within a web part * Using [SharePoint Framework library components](https://docs.microsoft.com/en-us/sharepoint/dev/spfx/library-component-overview_) * Hosting SharePoint Framework components as Microsoft Teams tabs * Using app pages in SharePoint Online ## Disclaimer **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.** --- ================================================ FILE: source/react-followed-sites/config/config.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/config.2.0.schema.json", "version": "2.0", "bundles": { "followed-sites-web-part": { "components": [ { "entrypoint": "./lib/webparts/followedSites/FollowedSitesWebPart.js", "manifest": "./src/webparts/followedSites/FollowedSitesWebPart.manifest.json" } ] } }, "externals": {}, "localizedResources": { "ControlStrings": "node_modules/@pnp/spfx-controls-react/lib/loc/{locale}.js", "PropertyControlStrings": "node_modules/@pnp/spfx-property-controls/lib/loc/{locale}.js" } } ================================================ FILE: source/react-followed-sites/config/deploy-azure-storage.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/deploy-azure-storage.schema.json", "workingDir": "./release/assets/", "account": "", "container": "react-followed-sites", "accessKey": "" } ================================================ FILE: source/react-followed-sites/config/package-solution.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/package-solution.schema.json", "solution": { "name": "Starter Kit - Followed Sites", "id": "c818b178-6ea2-4722-8c55-32fdf5cfcc9d", "version": "3.0.0.0", "includeClientSideAssets": true, "skipFeatureDeployment": true, "isDomainIsolated": false, "developer": { "name": "PnP Starter Kit", "privacyUrl": "", "termsOfUseUrl": "", "websiteUrl": "", "mpnId": "pnpsk" }, "metadata": { "shortDescription": { "default": "react-followed-sites description" }, "longDescription": { "default": "react-followed-sites description" }, "screenshotPaths": [], "videoUrl": "", "categories": [] }, "features": [ { "title": "Starter Kit - Followed Sites Webpart Feature", "description": "The feature that activates Followed Sites Webpart from the Starter Kit - Followed Sites solution.", "id": "93c8302a-ab02-4a85-8cc2-184eb0e4e13d", "version": "3.0.0.0", "componentIds": [ "93c8302a-ab02-4a85-8cc2-184eb0e4e13d" ] } ] }, "paths": { "zippedPackage": "solution/react-followed-sites.sppkg" } } ================================================ FILE: source/react-followed-sites/config/sass.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/core-build/sass.schema.json" } ================================================ FILE: source/react-followed-sites/config/serve.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/spfx-serve.schema.json", "port": 4321, "https": true, "initialPage": "https://enter-your-SharePoint-site/_layouts/workbench.aspx" } ================================================ FILE: source/react-followed-sites/config/write-manifests.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/write-manifests.schema.json", "cdnBasePath": "" } ================================================ FILE: source/react-followed-sites/gulpfile.js ================================================ 'use strict'; const build = require('@microsoft/sp-build-web'); build.addSuppression(`Warning - [sass] The local CSS class 'ms-Grid' is not camelCase and will not be type-safe.`); var getTasks = build.rig.getTasks; build.rig.getTasks = function () { var result = getTasks.call(build.rig); result.set('serve', result.get('serve-deprecated')); return result; }; build.initialize(require('gulp')); ================================================ FILE: source/react-followed-sites/package.json ================================================ { "name": "react-followed-sites", "version": "3.0.0", "private": true, "main": "lib/index.js", "engines": { "node": ">=16.13.0 <17.0.0" }, "scripts": { "build": "gulp bundle", "clean": "gulp clean", "test": "gulp test" }, "dependencies": { "@microsoft/sp-core-library": "1.16.1", "@microsoft/sp-lodash-subset": "1.16.1", "@microsoft/sp-office-ui-fabric-core": "1.16.1", "@microsoft/sp-property-pane": "1.16.1", "@microsoft/sp-webpart-base": "1.16.1", "@pnp/spfx-controls-react": "3.12.0", "@pnp/spfx-property-controls": "3.11.0", "react": "17.0.1", "react-dom": "17.0.1", "tslib": "2.3.1" }, "resolutions": { "@types/react": "16.8.8" }, "devDependencies": { "@microsoft/eslint-config-spfx": "1.16.1", "@microsoft/eslint-plugin-spfx": "1.16.1", "@microsoft/rush-stack-compiler-4.5": "0.2.2", "@microsoft/sp-build-web": "1.16.1", "@microsoft/sp-module-interfaces": "1.16.1", "@rushstack/eslint-config": "2.5.1", "@types/react": "17.0.45", "@types/react-dom": "17.0.17", "@types/webpack-env": "~1.15.2", "ajv": "^6.12.5", "eslint-plugin-react-hooks": "4.3.0", "gulp": "4.0.2", "typescript": "4.5.5" } } ================================================ FILE: source/react-followed-sites/src/index.ts ================================================ // A file is required to be in the root of the /src directory by the TypeScript compiler ================================================ FILE: source/react-followed-sites/src/webparts/followedSites/FollowedSitesWebPart.manifest.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx/client-side-web-part-manifest.schema.json", "id": "93c8302a-ab02-4a85-8cc2-184eb0e4e13d", "alias": "FollowedSitesWebPart", "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, "supportedHosts": ["SharePointWebPart","TeamsTab", "SharePointFullPage", "TeamsPersonalApp"], "preconfiguredEntries": [{ "groupId": "5c03119e-3074-46fd-976b-c60198311f70", // Other "group": { "default": "Other" }, "title": { "default": "Followed Sites" }, "description": { "default": "Followed sites for user" }, "officeFabricIconFontName": "FavoriteStarFill", "properties": { "title": "Followed Sites", "sortOrder": 2, "nrOfItems": 10 } }] } ================================================ FILE: source/react-followed-sites/src/webparts/followedSites/FollowedSitesWebPart.ts ================================================ import * as React from 'react'; import * as ReactDom from 'react-dom'; import { Version } from '@microsoft/sp-core-library'; import { BaseClientSideWebPart } from "@microsoft/sp-webpart-base"; import { IPropertyPaneConfiguration, PropertyPaneDropdown } from "@microsoft/sp-property-pane"; import FollowedSites from './components/FollowedSites'; import { IFollowedSitesProps } from './components/IFollowedSitesProps'; import { SpStarterKitSharedLibrary, LocaleKeys } from '@starter-kit/shared-library'; export interface IFollowedSitesWebPartProps { title: string; nrOfItems: number; sortOrder: number; } export enum SortOrder { default = 1, name } export default class FollowedSitesWebPart extends BaseClientSideWebPart { private propertyFieldNumber : any; public render(): void { const element: React.ReactElement = React.createElement( FollowedSites, { title: this.properties.title, nrOfItems: this.properties.nrOfItems, sortOrder: this.properties.sortOrder, context: this.context, displayMode: this.displayMode, updateProperty: (value: string) => { this.properties.title = value; } } ); ReactDom.render(element, this.domElement); } protected onDispose(): void { ReactDom.unmountComponentAtNode(this.domElement); } protected get dataVersion(): Version { return Version.parse('1.0'); } //executes only before property pane is loaded. protected async loadPropertyPaneResources(): Promise { // import additional controls/components const { PropertyFieldNumber } = await import( /* webpackChunkName: 'pnp-propcontrols-number' */ '@pnp/spfx-property-controls/lib/propertyFields/number' ); this.propertyFieldNumber = PropertyFieldNumber; } protected getPropertyPaneConfiguration(): IPropertyPaneConfiguration { return { pages: [ { header: { description: SpStarterKitSharedLibrary.getLocale(LocaleKeys.PropertyPaneDescription), }, groups: [ { groupFields: [ this.propertyFieldNumber("nrOfItems", { key: "nrOfItems", label: SpStarterKitSharedLibrary.getLocale(LocaleKeys.NrOfFollowedItemsLabel), value: this.properties.nrOfItems }), PropertyPaneDropdown('sortOrder', { label: SpStarterKitSharedLibrary.getLocale(LocaleKeys.SortOrderFollowedItemsLabel), selectedKey: this.properties.sortOrder, options: [ { key: SortOrder.default, text: SpStarterKitSharedLibrary.getLocale(LocaleKeys.SortOrderDefaultLabel) }, { key: SortOrder.name, text: SpStarterKitSharedLibrary.getLocale(LocaleKeys.SortOrderNameLabel) } ] }) ] } ] } ] }; } } ================================================ FILE: source/react-followed-sites/src/webparts/followedSites/components/FollowedSites.module.scss ================================================ @import '~@fluentui/react/dist/sass/References.scss'; .followedSites { .list { @include ms-Grid-row; ul { list-style: none; margin: 0; padding: 0; } } .filter { @include ms-Grid-col; @include ms-sm12; margin-bottom: 15px; } .site { @include ms-Grid-col; @include ms-sm12; a { display: block; padding: 5px 12px; &:hover { background-color: $ms-color-neutralLighterAlt; } } } .noSites { @include ms-font-m; } .error { @include ms-font-m; color: $ms-color-alert; } } ================================================ FILE: source/react-followed-sites/src/webparts/followedSites/components/FollowedSites.tsx ================================================ import * as React from 'react'; import styles from './FollowedSites.module.scss'; import { SPHttpClientResponse, SPHttpClient } from '@microsoft/sp-http'; import { WebPartTitle } from "@pnp/spfx-controls-react/lib/WebPartTitle"; import { SortOrder } from '../FollowedSitesWebPart'; import { Link } from '@fluentui/react/lib/Link'; import { TextField } from '@fluentui/react/lib/TextField'; import { IFollowedSitesProps, IFollowedSitesState, IFollowedResult, IFollowed } from '.'; import { Paging } from './paging'; import { Spinner, SpinnerSize } from '@fluentui/react/lib//Spinner'; import { SpStarterKitSharedLibrary, LocaleKeys } from '@starter-kit/shared-library'; export default class FollowedSites extends React.Component { private _allFollowing: IFollowedResult[] = []; constructor(props: IFollowedSitesProps) { super(props); this.state = { following: null, allFollowing: [], loading: true, error: null }; } /** * Retrieves all the current user its followed sites */ private _fetchFollowedSites(): void { this.setState({ loading: true, error: null }); // Types 4 === sites const apiUrl = `${this.props.context.pageContext.web.absoluteUrl}/_api/social.following/my/followed(types=4)`; this.props.context.spHttpClient.fetch(apiUrl, SPHttpClient.configurations.v1, { method: "GET" }) .then((data: SPHttpClientResponse) => data.json()) .then((data: IFollowed) => { // Check if data was retrieved if (data && data.value) { let fSites = data.value; // Check if items need to be sorted by their name if (this.props.sortOrder && this.props.sortOrder === SortOrder.name) { fSites = fSites.sort(this._sortByName); } else { // Last added item is last in the list, so we use reverse to turn it around fSites = data.value.reverse(); } // Locally store the followed site results this._allFollowing = [...fSites]; // Pass sites to trigger state update this._updateFollowingSites(fSites); } // Check if an error occured if (data && data.error) { // Error occured while fetching personal sites this.setState({ loading: false, error: SpStarterKitSharedLibrary.getLocale(LocaleKeys.SitesLoadingError) }); } }) .catch((err) => { this.setState({ loading: false, error: SpStarterKitSharedLibrary.getLocale(LocaleKeys.SitesLoadingError) }); }); } /** * Updates the current following site state */ private _updateFollowingSites = (fSites: IFollowedResult[]): void => { const allSites = [...fSites]; // Check if the array has to be limited if (this.props.nrOfItems) { fSites = fSites.slice(0, this.props.nrOfItems); } this.setState({ following: fSites, allFollowing: allSites, loading: false }); } /** * Sort array by their name * @param a First item * @param b Second item */ private _sortByName(a: IFollowedResult, b: IFollowedResult): number { if(a.Name.toLowerCase() < b.Name.toLowerCase()) return -1; if(a.Name.toLowerCase() > b.Name.toLowerCase()) return 1; return 0; } /** * Update the current site results array */ private _updatePagedItems = (pagedItems: IFollowedResult[]): void => { if (pagedItems) { this.setState({ following: pagedItems }); } } private _onFilterChanged = (event: React.FormEvent, val?: string) => { // Check if a value was provided if (val) { const allSites = [...this._allFollowing]; const filteredItems = allSites.filter(f => f.Name.toLowerCase().indexOf(val.toLowerCase()) !== -1); this._updateFollowingSites(filteredItems); } else { this._updateFollowingSites(this._allFollowing); } } /** * componentDidMount lifecycle hook */ public componentDidMount(): void { this._fetchFollowedSites(); } /** * componentDidUpdate lifecycle hook * @param prevProps * @param prevState */ public componentDidUpdate(prevProps: IFollowedSitesProps, prevState: IFollowedSitesState): void { if (this.props.nrOfItems !== prevProps.nrOfItems || this.props.sortOrder !== prevProps.sortOrder) { this._fetchFollowedSites(); } } /** * Default React render method */ public render(): React.ReactElement { return (
{ this.state.loading && ( ) } { this.state.following ? (
    { this.state.following.length > 0 ? ( this.state.following.map(follow => (
  • {follow.Name}
  • )) ) : (
  • {SpStarterKitSharedLibrary.getLocale(LocaleKeys.NoFollowSitesFoundMsg)}
  • ) }
) : ( !this.state.loading && ( this.state.error ? {this.state.error} : {SpStarterKitSharedLibrary.getLocale(LocaleKeys.NoFollowedSitesMsg)} ) ) }
); } } ================================================ FILE: source/react-followed-sites/src/webparts/followedSites/components/IFollowedResult.ts ================================================ export interface IFollowed { '@odata.context': string; error?: IErrorMessage; value: IFollowedResult[]; } export interface IFollowedResult { AccountName?: any; ActorType: number; CanFollow: boolean; ContentUri: string; EmailAddress?: any; FollowedContentUri?: any; Id: string; ImageUri?: any; IsFollowed: boolean; LibraryUri?: any; Name: string; PersonalSiteUri?: any; Status: number; StatusText?: any; TagGuid: string; Title?: any; Uri: string; } export interface IErrorMessage { code: string; message: string; } ================================================ FILE: source/react-followed-sites/src/webparts/followedSites/components/IFollowedSitesProps.ts ================================================ import { WebPartContext } from "@microsoft/sp-webpart-base"; import { DisplayMode } from "@microsoft/sp-core-library"; import { IFollowedSitesWebPartProps } from "../FollowedSitesWebPart"; export interface IFollowedSitesProps extends IFollowedSitesWebPartProps { displayMode: DisplayMode; updateProperty: (value: string) => void; context: WebPartContext; } ================================================ FILE: source/react-followed-sites/src/webparts/followedSites/components/IFollowedSitesState.ts ================================================ import { IFollowedResult } from "./IFollowedResult"; export interface IFollowedSitesState { following: IFollowedResult[]; allFollowing: IFollowedResult[]; loading: boolean; error: string; } ================================================ FILE: source/react-followed-sites/src/webparts/followedSites/components/index.ts ================================================ export * from './FollowedSites'; export * from './IFollowedResult'; export * from './IFollowedSitesProps'; export * from './IFollowedSitesState'; ================================================ FILE: source/react-followed-sites/src/webparts/followedSites/components/paging/IPagingProps.ts ================================================ import { IFollowedResult } from ".."; export interface IPagingProps { allItems: IFollowedResult[]; nrOfItems: number; fUpdateItems: (pagedItems: IFollowedResult[]) => void; } ================================================ FILE: source/react-followed-sites/src/webparts/followedSites/components/paging/IPagingState.ts ================================================ export interface IPagingState { crntPage: number; } ================================================ FILE: source/react-followed-sites/src/webparts/followedSites/components/paging/Paging.module.scss ================================================ @import '~@fluentui/react/dist/sass/References.scss'; .paging { text-align: center; button { padding: 0 5px; margin: 15px 5px; min-width: auto; } } .pagingNrLabels { display: inline-block; line-height: 32px; margin: 15px 5px; text-align: center; min-width: 55px; } ================================================ FILE: source/react-followed-sites/src/webparts/followedSites/components/paging/Paging.tsx ================================================ import * as React from 'react'; import styles from './Paging.module.scss'; import { DefaultButton } from '@fluentui/react/lib//Button'; import { Icon } from '@fluentui/react/lib//Icon'; import { IPagingProps, IPagingState } from '.'; export class Paging extends React.Component { constructor(props: IPagingProps) { super(props); this.state = { crntPage: 0 }; } /** * Load the previous page */ private _prevPage = (): void => { let { crntPage } = this.state; if (crntPage > 0) { crntPage--; // Update the current page this.setState({ crntPage }); // Update elements to render this._triggerUpdate(crntPage); } } /** * Load the previous page */ private _nextPage = (): void => { let { crntPage } = this.state; if ((this.props.nrOfItems*(this.state.crntPage)) < this.props.allItems.length) { crntPage++; // Update the current page this.setState({ crntPage }); // Update elements to render this._triggerUpdate(crntPage); } } /** * Triggers the update function with the new batch of items */ private _triggerUpdate = (pageNr: number): void => { let allItems = [...this.props.allItems]; // Pass the next batch of items to render to the parent component this.props.fUpdateItems(allItems.splice((pageNr * this.props.nrOfItems), this.props.nrOfItems)); } /** * componentWillReceiveProps lifecycle hook * @param nextProps */ public componentWillReceiveProps(nextProps: IPagingProps): void { // Check if items were filtered if (this.props.allItems.length !== nextProps.allItems.length) { this.setState({ crntPage: 0 }); } } /** * Default React render method */ public render(): React.ReactElement { if (this.props.nrOfItems && this.props.allItems && this.props.allItems.length > this.props.nrOfItems) { return (
{this.state.crntPage + 1}/{Math.ceil(this.props.allItems.length/this.props.nrOfItems)} = this.props.allItems.length}>
); } return null; } } ================================================ FILE: source/react-followed-sites/src/webparts/followedSites/components/paging/index.ts ================================================ export * from './IPagingProps'; export * from './IPagingState'; export * from './Paging'; ================================================ FILE: source/react-followed-sites/tsconfig.json ================================================ { "extends": "./node_modules/@microsoft/rush-stack-compiler-4.5/includes/tsconfig-web.json", "compilerOptions": { "target": "es5", "forceConsistentCasingInFileNames": true, "module": "esnext", "moduleResolution": "node", "jsx": "react", "declaration": true, "sourceMap": true, "experimentalDecorators": true, "skipLibCheck": true, "outDir": "lib", "inlineSources": false, "strictNullChecks": false, "noImplicitAny": true, "typeRoots": [ "./node_modules/@types", "./node_modules/@microsoft" ], "types": [ "webpack-env" ], "lib": [ "es5", "dom", "es2015.collection", "es2015.promise" ] }, "include": [ "src/**/*.ts", "src/**/*.tsx" ] } ================================================ FILE: source/react-links/.editorconfig ================================================ # EditorConfig helps developers define and maintain consistent # coding styles between different editors and IDEs # editorconfig.org root = true [*] # change these settings to your own preference indent_style = space indent_size = 2 # we recommend you to keep these unchanged end_of_line = lf charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true [*.md] trim_trailing_whitespace = false [{package,bower}.json] indent_style = space indent_size = 2 ================================================ FILE: source/react-links/.eslintrc.js ================================================ require('@rushstack/eslint-config/patch/modern-module-resolution'); module.exports = { extends: ['@microsoft/eslint-config-spfx/lib/profiles/react'], parserOptions: { tsconfigRootDir: __dirname }, overrides: [ { files: ['*.ts', '*.tsx'], parser: '@typescript-eslint/parser', 'parserOptions': { 'project': './tsconfig.json', 'ecmaVersion': 2018, 'sourceType': 'module' }, rules: { // Prevent usage of the JavaScript null value, while allowing code to access existing APIs that may require null. https://www.npmjs.com/package/@rushstack/eslint-plugin '@rushstack/no-new-null': 1, // Require Jest module mocking APIs to be called before any other statements in their code block. https://www.npmjs.com/package/@rushstack/eslint-plugin '@rushstack/hoist-jest-mock': 1, // Require regular expressions to be constructed from string constants rather than dynamically building strings at runtime. https://www.npmjs.com/package/@rushstack/eslint-plugin-security '@rushstack/security/no-unsafe-regexp': 1, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/adjacent-overload-signatures': 1, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // // CONFIGURATION: By default, these are banned: String, Boolean, Number, Object, Symbol '@typescript-eslint/ban-types': [ 1, { 'extendDefaults': false, 'types': { 'String': { 'message': 'Use \'string\' instead', 'fixWith': 'string' }, 'Boolean': { 'message': 'Use \'boolean\' instead', 'fixWith': 'boolean' }, 'Number': { 'message': 'Use \'number\' instead', 'fixWith': 'number' }, 'Object': { 'message': 'Use \'object\' instead, or else define a proper TypeScript type:' }, 'Symbol': { 'message': 'Use \'symbol\' instead', 'fixWith': 'symbol' }, 'Function': { 'message': 'The \'Function\' type accepts any function-like value.\nIt provides no type safety when calling the function, which can be a common source of bugs.\nIt also accepts things like class declarations, which will throw at runtime as they will not be called with \'new\'.\nIf you are expecting the function to accept certain arguments, you should explicitly define the function shape.' } } } ], // RATIONALE: Code is more readable when the type of every variable is immediately obvious. // Even if the compiler may be able to infer a type, this inference will be unavailable // to a person who is reviewing a GitHub diff. This rule makes writing code harder, // but writing code is a much less important activity than reading it. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/explicit-function-return-type': [ 1, { 'allowExpressions': true, 'allowTypedFunctionExpressions': true, 'allowHigherOrderFunctions': false } ], // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // Rationale to disable: although this is a recommended rule, it is up to dev to select coding style. // Set to 1 (warning) or 2 (error) to enable. '@typescript-eslint/explicit-member-accessibility': 0, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/no-array-constructor': 1, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // // RATIONALE: The "any" keyword disables static type checking, the main benefit of using TypeScript. // This rule should be suppressed only in very special cases such as JSON.stringify() // where the type really can be anything. Even if the type is flexible, another type // may be more appropriate such as "unknown", "{}", or "Record". '@typescript-eslint/no-explicit-any': 0, // RATIONALE: The #1 rule of promises is that every promise chain must be terminated by a catch() // handler. Thus wherever a Promise arises, the code must either append a catch handler, // or else return the object to a caller (who assumes this responsibility). Unterminated // promise chains are a serious issue. Besides causing errors to be silently ignored, // they can also cause a NodeJS process to terminate unexpectedly. '@typescript-eslint/no-floating-promises': 2, // RATIONALE: Catches a common coding mistake. '@typescript-eslint/no-for-in-array': 2, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/no-misused-new': 2, // RATIONALE: The "namespace" keyword is not recommended for organizing code because JavaScript lacks // a "using" statement to traverse namespaces. Nested namespaces prevent certain bundler // optimizations. If you are declaring loose functions/variables, it's better to make them // static members of a class, since classes support property getters and their private // members are accessible by unit tests. Also, the exercise of choosing a meaningful // class name tends to produce more discoverable APIs: for example, search+replacing // the function "reverse()" is likely to return many false matches, whereas if we always // write "Text.reverse()" is more unique. For large scale organization, it's recommended // to decompose your code into separate NPM packages, which ensures that component // dependencies are tracked more conscientiously. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/no-namespace': [ 1, { 'allowDeclarations': false, 'allowDefinitionFiles': false } ], // RATIONALE: Parameter properties provide a shorthand such as "constructor(public title: string)" // that avoids the effort of declaring "title" as a field. This TypeScript feature makes // code easier to write, but arguably sacrifices readability: In the notes for // "@typescript-eslint/member-ordering" we pointed out that fields are central to // a class's design, so we wouldn't want to bury them in a constructor signature // just to save some typing. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // Set to 1 (warning) or 2 (error) to enable the rule '@typescript-eslint/no-parameter-properties': 0, // RATIONALE: When left in shipping code, unused variables often indicate a mistake. Dead code // may impact performance. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/no-unused-vars': [ 1, { 'vars': 'all', // Unused function arguments often indicate a mistake in JavaScript code. However in TypeScript code, // the compiler catches most of those mistakes, and unused arguments are fairly common for type signatures // that are overriding a base class method or implementing an interface. 'args': 'none' } ], // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/no-use-before-define': [ 2, { 'functions': false, 'classes': true, 'variables': true, 'enums': true, 'typedefs': true } ], // Disallows require statements except in import statements. // In other words, the use of forms such as var foo = require("foo") are banned. Instead use ES6 style imports or import foo = require("foo") imports. '@typescript-eslint/no-var-requires': 'error', // RATIONALE: The "module" keyword is deprecated except when describing legacy libraries. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/prefer-namespace-keyword': 1, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // Rationale to disable: it's up to developer to decide if he wants to add type annotations // Set to 1 (warning) or 2 (error) to enable the rule '@typescript-eslint/no-inferrable-types': 0, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // Rationale to disable: declaration of empty interfaces may be helpful for generic types scenarios '@typescript-eslint/no-empty-interface': 0, // RATIONALE: This rule warns if setters are defined without getters, which is probably a mistake. 'accessor-pairs': 1, // RATIONALE: In TypeScript, if you write x["y"] instead of x.y, it disables type checking. 'dot-notation': [ 1, { 'allowPattern': '^_' } ], // RATIONALE: Catches code that is likely to be incorrect 'eqeqeq': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'for-direction': 1, // RATIONALE: Catches a common coding mistake. 'guard-for-in': 2, // RATIONALE: If you have more than 2,000 lines in a single source file, it's probably time // to split up your code. 'max-lines': ['warn', { max: 2000 }], // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-async-promise-executor': 2, // RATIONALE: Deprecated language feature. 'no-caller': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-compare-neg-zero': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-cond-assign': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-constant-condition': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-control-regex': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-debugger': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-delete-var': 2, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-duplicate-case': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-empty': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-empty-character-class': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-empty-pattern': 1, // RATIONALE: Eval is a security concern and a performance concern. 'no-eval': 1, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-ex-assign': 2, // RATIONALE: System types are global and should not be tampered with in a scalable code base. // If two different libraries (or two versions of the same library) both try to modify // a type, only one of them can win. Polyfills are acceptable because they implement // a standardized interoperable contract, but polyfills are generally coded in plain // JavaScript. 'no-extend-native': 1, // Disallow unnecessary labels 'no-extra-label': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-fallthrough': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-func-assign': 1, // RATIONALE: Catches a common coding mistake. 'no-implied-eval': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-invalid-regexp': 2, // RATIONALE: Catches a common coding mistake. 'no-label-var': 2, // RATIONALE: Eliminates redundant code. 'no-lone-blocks': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-misleading-character-class': 2, // RATIONALE: Catches a common coding mistake. 'no-multi-str': 2, // RATIONALE: It's generally a bad practice to call "new Thing()" without assigning the result to // a variable. Either it's part of an awkward expression like "(new Thing()).doSomething()", // or else implies that the constructor is doing nontrivial computations, which is often // a poor class design. 'no-new': 1, // RATIONALE: Obsolete language feature that is deprecated. 'no-new-func': 2, // RATIONALE: Obsolete language feature that is deprecated. 'no-new-object': 2, // RATIONALE: Obsolete notation. 'no-new-wrappers': 1, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-octal': 2, // RATIONALE: Catches code that is likely to be incorrect 'no-octal-escape': 2, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-regex-spaces': 2, // RATIONALE: Catches a common coding mistake. 'no-return-assign': 2, // RATIONALE: Security risk. 'no-script-url': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-self-assign': 2, // RATIONALE: Catches a common coding mistake. 'no-self-compare': 2, // RATIONALE: This avoids statements such as "while (a = next(), a && a.length);" that use // commas to create compound expressions. In general code is more readable if each // step is split onto a separate line. This also makes it easier to set breakpoints // in the debugger. 'no-sequences': 1, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-shadow-restricted-names': 2, // RATIONALE: Obsolete language feature that is deprecated. // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-sparse-arrays': 2, // RATIONALE: Although in theory JavaScript allows any possible data type to be thrown as an exception, // such flexibility adds pointless complexity, by requiring every catch block to test // the type of the object that it receives. Whereas if catch blocks can always assume // that their object implements the "Error" contract, then the code is simpler, and // we generally get useful additional information like a call stack. 'no-throw-literal': 2, // RATIONALE: Catches a common coding mistake. 'no-unmodified-loop-condition': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-unsafe-finally': 2, // RATIONALE: Catches a common coding mistake. 'no-unused-expressions': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-unused-labels': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-useless-catch': 1, // RATIONALE: Avoids a potential performance problem. 'no-useless-concat': 1, // RATIONALE: The "var" keyword is deprecated because of its confusing "hoisting" behavior. // Always use "let" or "const" instead. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json 'no-var': 2, // RATIONALE: Generally not needed in modern code. 'no-void': 1, // RATIONALE: Obsolete language feature that is deprecated. // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-with': 2, // RATIONALE: Makes logic easier to understand, since constants always have a known value // @typescript-eslint\eslint-plugin\dist\configs\eslint-recommended.js 'prefer-const': 1, // RATIONALE: Catches a common coding mistake where "resolve" and "reject" are confused. 'promise/param-names': 2, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'require-atomic-updates': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'require-yield': 1, // "Use strict" is redundant when using the TypeScript compiler. 'strict': [ 2, 'never' ], // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'use-isnan': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js // Set to 1 (warning) or 2 (error) to enable. // Rationale to disable: !!{} 'no-extra-boolean-cast': 0, // ==================================================================== // @microsoft/eslint-plugin-spfx // ==================================================================== '@microsoft/spfx/import-requires-chunk-name': 1, '@microsoft/spfx/no-require-ensure': 2, '@microsoft/spfx/pair-react-dom-render-unmount': 0, // ==================================================================== // react/no-deprecated // ==================================================================== 'react/no-deprecated': 0 } }, { // For unit tests, we can be a little bit less strict. The settings below revise the // defaults specified in the extended configurations, as well as above. files: [ // Test files '*.test.ts', '*.test.tsx', '*.spec.ts', '*.spec.tsx', // Facebook convention '**/__mocks__/*.ts', '**/__mocks__/*.tsx', '**/__tests__/*.ts', '**/__tests__/*.tsx', // Microsoft convention '**/test/*.ts', '**/test/*.tsx' ], rules: {} } ] }; ================================================ FILE: source/react-links/.gitignore ================================================ # Logs logs *.log npm-debug.log* # Dependency directories node_modules # Build generated files dist lib release solution temp *.sppkg .heft # Coverage directory used by tools like istanbul coverage # OSX .DS_Store # Visual Studio files .ntvs_analysis.dat .vs bin obj # Resx Generated Code *.resx.ts # Styles Generated Code *.scss.ts ================================================ FILE: source/react-links/.npmignore ================================================ !dist config gulpfile.js release src temp tsconfig.json tslint.json *.log .yo-rc.json .vscode ================================================ FILE: source/react-links/.vscode/launch.json ================================================ { "version": "0.2.0", "configurations": [ { "name": "Hosted workbench", "type": "pwa-chrome", "request": "launch", "url": "https://enter-your-SharePoint-site/_layouts/workbench.aspx", "webRoot": "${workspaceRoot}", "sourceMaps": true, "sourceMapPathOverrides": { "webpack:///.././src/*": "${webRoot}/src/*", "webpack:///../../../src/*": "${webRoot}/src/*", "webpack:///../../../../src/*": "${webRoot}/src/*", "webpack:///../../../../../src/*": "${webRoot}/src/*" }, "runtimeArgs": [ "--remote-debugging-port=9222", "-incognito" ] } ] } ================================================ FILE: source/react-links/.vscode/settings.json ================================================ // Place your settings in this file to overwrite default and user settings. { // Configure glob patterns for excluding files and folders in the file explorer. "files.exclude": { "**/.git": true, "**/.DS_Store": true, "**/bower_components": true, "**/coverage": true, "**/lib-amd": true, "src/**/*.scss.ts": true }, "typescript.tsdk": ".\\node_modules\\typescript\\lib" } ================================================ FILE: source/react-links/.yo-rc.json ================================================ { "@microsoft/generator-sharepoint": { "plusBeta": false, "isCreatingSolution": true, "nodeVersion": "16.19.0", "sdksVersions": { "@microsoft/microsoft-graph-client": "3.0.2", "@microsoft/teams-js": "2.4.1" }, "version": "1.16.1", "environment": "spo", "libraryName": "react-links", "libraryId": "941e9447-0430-498e-b380-a154b73983fe", "packageManager": "npm", "isDomainIsolated": false, "componentType": "webpart" } } ================================================ FILE: source/react-links/README.md ================================================ # Links webpart This web part provides you the ability to add a per instance listing of links with the ability to group sets of links. Links are stored as a collection of links within the web part's properties, removing the need for link storage within SharePoint lists, tenant properties, or other external link storage requirements. Links and groups are both customizable. Icons are from Fluent UI Icons, those icons that should be available within at least Fluent UI version 7.3. View [Fluent UI Icons](https://developer.microsoft.com/en-us/fluentui#/styles/web/icons) for icon names. ![Links](../../assets/images/components/part-links.gif) ## Configurable Properties The `Links` webpart can be configured with the following properties: | Label | Property | Type | Required | Description | | ---- | ---- | ---- | ---- | ---- | | Useful links | title | string | no | The webpart title, editable inline with the webpart itself | | Group names for the links | groupData | collection | no | Collection of group names for grouping links into sets | | Link data | collectionData | collection | no | Collection of links | ### groupData Collection Properties Configurable properties for each collection row within the `groupData` collection: | Label | Property | Type | Required | Description | | ---- | ---- | ---- | ---- | ---- | | Title | title | string | yes | The name of a group | ### collectionData Collection Properties Configurable properties for each collection row within the `collectionData` collection: | Label | Property | Type | Required | Description | | ---- | ---- | ---- | ---- | ---- | | Title | title | string | yes | The text / title of the link | | URL | url | string | yes | The link url | | UI Fabric icon name | icon | fabricIcon | no | Optional UI Fabric icon name | | Group name | group | dropdown | no | Optional name of the group to add this link to | | Target | target | dropdown | no | Optional target for this link, current or new window | ## Used SharePoint Framework Version ![drop](https://img.shields.io/badge/version-1.16.1-green.svg) * Supported in SharePoint Online ## Applies to * [SharePoint Framework](https://learn.microsoft.com/en-us/sharepoint/dev/spfx/sharepoint-framework-overview) * [Office 365 tenant](https://learn.microsoft.com/en-us/sharepoint/dev/spfx/set-up-your-development-environment) ## Prerequisites none ## Solution Solution|Author(s) --------|--------- react-links V1 | Elio Struyf (@estruyf) react-links V2 | Fabio Franzini (@fabiofranzini) react-links V3 | Chandani Prajapati (@Chandani_SPD) ## Version history Version|Date|Comments -------|----|-------- 1.0|May 18th, 2018|Initial release (extract web part from Starter Kit v1) 2.0|January 24, 2020|Initial release (extract web part from Starter Kit v1) 3.0|February 2023|Initial release for SharePoint Starter Kit v3 (Upgraded to SPFx 1.16.1) ## Disclaimer **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.** --- ## Minimal Path to Awesome * Clone this repository * Move to solution folder * in the command line run: * `npm install` * `gulp serve` ## Features Description of the web part with possible additional details than in short summary. This Web Part illustrates the following concepts on top of the SharePoint Framework: * PnP property control usage * Fluent UI React controls ================================================ FILE: source/react-links/config/config.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/config.2.0.schema.json", "version": "2.0", "bundles": { "links-web-part": { "components": [ { "entrypoint": "./lib/webparts/links/LinksWebPart.js", "manifest": "./src/webparts/links/LinksWebPart.manifest.json" } ] } }, "externals": {}, "localizedResources": { "LinksWebPartStrings": "lib/webparts/links/loc/{locale}.js", "PropertyControlStrings": "node_modules/@pnp/spfx-property-controls/lib/loc/{locale}.js", "ControlStrings": "node_modules/@pnp/spfx-controls-react/lib/loc/{locale}.js" } } ================================================ FILE: source/react-links/config/deploy-azure-storage.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/deploy-azure-storage.schema.json", "workingDir": "./release/assets/", "account": "", "container": "react-links", "accessKey": "" } ================================================ FILE: source/react-links/config/package-solution.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/package-solution.schema.json", "solution": { "name": "Starter Kit - React Links", "id": "941e9447-0430-498e-b380-a154b73983fe", "version": "3.0.0.0", "includeClientSideAssets": true, "skipFeatureDeployment": true, "isDomainIsolated": false, "developer": { "name": "PnP Starter Kit", "privacyUrl": "", "termsOfUseUrl": "", "websiteUrl": "", "mpnId": "pnpsk" }, "metadata": { "shortDescription": { "default": "react-links description" }, "longDescription": { "default": "react-links description" }, "screenshotPaths": [], "videoUrl": "", "categories": [] }, "features": [ { "title": "Starter Kit - React Links WebPart Feature", "description": "The feature that activates React Links Webpart from the Starter Kit - React Links solution.", "id": "659e9e2c-9656-4ce1-9f80-7d13a0574d7a", "version": "3.0.0.0", "componentIds": [ "659e9e2c-9656-4ce1-9f80-7d13a0574d7a" ] } ] }, "paths": { "zippedPackage": "solution/react-links.sppkg" } } ================================================ FILE: source/react-links/config/sass.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/core-build/sass.schema.json" } ================================================ FILE: source/react-links/config/serve.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/spfx-serve.schema.json", "port": 4321, "https": true, "initialPage": "https://enter-your-SharePoint-site/_layouts/workbench.aspx" } ================================================ FILE: source/react-links/config/write-manifests.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/write-manifests.schema.json", "cdnBasePath": "" } ================================================ FILE: source/react-links/gulpfile.js ================================================ 'use strict'; const build = require('@microsoft/sp-build-web'); build.addSuppression(`Warning - [sass] The local CSS class 'ms-Grid' is not camelCase and will not be type-safe.`); var getTasks = build.rig.getTasks; build.rig.getTasks = function () { var result = getTasks.call(build.rig); result.set('serve', result.get('serve-deprecated')); return result; }; build.initialize(require('gulp')); ================================================ FILE: source/react-links/package.json ================================================ { "name": "react-links", "version": "3.0.0", "private": true, "main": "lib/index.js", "engines": { "node": ">=16.13.0 <17.0.0" }, "scripts": { "build": "gulp bundle", "clean": "gulp clean", "test": "gulp test" }, "dependencies": { "@microsoft/sp-core-library": "1.16.1", "@microsoft/sp-lodash-subset": "1.16.1", "@microsoft/sp-office-ui-fabric-core": "1.16.1", "@microsoft/sp-property-pane": "1.16.1", "@microsoft/sp-webpart-base": "1.16.1", "@pnp/spfx-controls-react": "3.12.0", "@pnp/spfx-property-controls": "3.11.0", "react": "17.0.1", "react-dom": "17.0.1", "tslib": "2.3.1" }, "resolutions": { "@types/react": "16.8.8" }, "devDependencies": { "@microsoft/eslint-config-spfx": "1.16.1", "@microsoft/eslint-plugin-spfx": "1.16.1", "@microsoft/rush-stack-compiler-4.5": "0.2.2", "@microsoft/sp-build-web": "1.16.1", "@microsoft/sp-module-interfaces": "1.16.1", "@rushstack/eslint-config": "2.5.1", "@types/react": "17.0.45", "@types/react-dom": "17.0.17", "@types/webpack-env": "~1.15.2", "ajv": "^6.12.5", "eslint-plugin-react-hooks": "4.3.0", "gulp": "4.0.2", "typescript": "4.5.5" } } ================================================ FILE: source/react-links/src/index.ts ================================================ // A file is required to be in the root of the /src directory by the TypeScript compiler ================================================ FILE: source/react-links/src/webparts/links/ILink.ts ================================================ export interface ILink { title: string; url: string; icon: string; group: string; target: LinkTarget; } export interface IGroupData { title: string; } export enum LinkTarget { parent = '', blank = '_blank' } ================================================ FILE: source/react-links/src/webparts/links/LinksWebPart.manifest.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx/client-side-web-part-manifest.schema.json", "id": "659e9e2c-9656-4ce1-9f80-7d13a0574d7a", "alias": "LinksWebPart", "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, "supportedHosts": ["SharePointWebPart", "TeamsPersonalApp", "TeamsTab", "SharePointFullPage"], "preconfiguredEntries": [{ "groupId": "5c03119e-3074-46fd-976b-c60198311f70", // Other "group": { "default": "Other" }, "title": { "default": "Links" }, "description": { "default": "List of links based on collection control configured in the web part properties" }, "officeFabricIconFontName": "Link", "properties": { "title": "Links" } }] } ================================================ FILE: source/react-links/src/webparts/links/LinksWebPart.ts ================================================ import * as React from 'react'; import * as ReactDom from 'react-dom'; import { Version } from '@microsoft/sp-core-library'; import { BaseClientSideWebPart } from "@microsoft/sp-webpart-base"; import { IPropertyPaneConfiguration } from "@microsoft/sp-property-pane"; import * as strings from 'LinksWebPartStrings'; import Links from './components/Links'; import { ILinksProps } from './components/ILinksProps'; import { ILink, LinkTarget, IGroupData } from './ILink'; export interface ILinksWebPartProps { collectionData: ILink[]; groupData: IGroupData[]; title: string; } export default class LinksWebPart extends BaseClientSideWebPart { // Just for suppress the tslint validation of dinamically loading of this field by using loadPropertyPaneResources() // tslint:disable-next-line: no-any private propertyFieldCollectionData: any; // Just for suppress the tslint validation of dinamically loading of this field by using loadPropertyPaneResources() // tslint:disable-next-line: no-any private customCollectionFieldType: any; public render(): void { const element: React.ReactElement = React.createElement( Links, { collectionData: this.properties.collectionData, title: this.properties.title, displayMode: this.displayMode, fUpdateProperty: (value: string) => { this.properties.title = value; }, fPropertyPaneOpen: this.context.propertyPane.open } ); ReactDom.render(element, this.domElement); } protected get dataVersion(): Version { return Version.parse('1.0'); } // executes only before property pane is loaded. protected async loadPropertyPaneResources(): Promise { // import additional controls/components const { PropertyFieldCollectionData, CustomCollectionFieldType } = await import( /* webpackChunkName: 'pnp-propcontrols-colldata' */ '@pnp/spfx-property-controls/lib/PropertyFieldCollectionData' ); this.propertyFieldCollectionData = PropertyFieldCollectionData; this.customCollectionFieldType = CustomCollectionFieldType; } protected getPropertyPaneConfiguration(): IPropertyPaneConfiguration { let groups: { key: string, text: string }[] = []; if (this.properties.groupData && this.properties.groupData.length > 0) { groups = this.properties.groupData.map((group: IGroupData) => ({ key: group.title, text: group.title })); } return { pages: [ { groups: [ { groupFields: [ this.propertyFieldCollectionData('groupData', { key: 'groupData', label: strings.groupDataLabel, panelHeader: strings.groupPanelHeader, manageBtnLabel: strings.manageGroupBtn, value: this.properties.groupData, fields: [ { id: 'title', title: strings.titleField, type: this.customCollectionFieldType.string, required: true } ] }), this.propertyFieldCollectionData('collectionData', { key: 'collectionData', label: strings.linkDataLabel, panelHeader: strings.linkPanelHeader, // tslint:disable-next-line:max-line-length panelDescription: `${strings.iconInformation} https://developer.microsoft.com/en-us/fabric#/styles/icons`, manageBtnLabel: strings.manageLinksBtn, value: this.properties.collectionData, fields: [ { id: 'title', title: strings.titleField, type: this.customCollectionFieldType.string, required: true }, { id: 'url', title: strings.urlField, type: this.customCollectionFieldType.string, required: true }, { id: 'icon', title: strings.iconField, type: this.customCollectionFieldType.fabricIcon }, { id: 'group', title: strings.groupField, type: this.customCollectionFieldType.dropdown, options: [ { key: undefined, text: '' }, ...groups ] }, { id: 'target', title: strings.targetField, type: this.customCollectionFieldType.dropdown, options: [ { key: LinkTarget.parent, text: strings.targetCurrent }, { key: LinkTarget.blank, text: strings.targetNew } ] } ] }) ] } ] } ] }; } } ================================================ FILE: source/react-links/src/webparts/links/components/ILinksProps.ts ================================================ import { DisplayMode } from '@microsoft/sp-core-library'; import { ILink } from '../ILink'; export interface ILinksProps { collectionData: ILink[]; displayMode: DisplayMode; title: string; fUpdateProperty: (value: string) => void; fPropertyPaneOpen: () => void; } ================================================ FILE: source/react-links/src/webparts/links/components/ILinksState.ts ================================================ import { ILink } from '../ILink'; export interface ILinksState { groups: { [group: string]: ILink[]; }; } ================================================ FILE: source/react-links/src/webparts/links/components/Links.module.scss ================================================ @import '~@fluentui/react/dist/sass/References.scss'; .links { .row { @include ms-Grid-row; } .column { @include ms-Grid-col; @include ms-sm12; } .groupName { @include ms-font-l; @include ms-fontSize-l; margin: 10px 0 5px; } .link { margin: 2px; } .icon { margin-right: 10px; } } ================================================ FILE: source/react-links/src/webparts/links/components/Links.tsx ================================================ import * as React from 'react'; import styles from './Links.module.scss'; import * as strings from 'LinksWebPartStrings'; import { ILinksProps } from './ILinksProps'; import { ILinksState } from './ILinksState'; import { groupBy, toPairs, sortBy, fromPairs } from '@microsoft/sp-lodash-subset'; import { Link } from '@fluentui/react/lib/Link'; import { WebPartTitle } from '@pnp/spfx-controls-react/lib/WebPartTitle'; import { Placeholder } from '@pnp/spfx-controls-react/lib/Placeholder'; import { Icon } from '@fluentui/react/lib/Icon'; import { ILink } from '../ILink'; const NO_GROUP_NAME: string = '..NOGROUPNAME..'; export default class Links extends React.Component { constructor(props: ILinksProps) { super(props); this.state = { groups: undefined }; } /** * componentWillMount lifecycle hook */ public componentWillMount(): void { this._processLinks(); } /** * componentDidUpdate lifecycle hook * @param prevProps * @param prevState */ public componentDidUpdate(prevProps: ILinksProps, prevState: ILinksState): void { if (prevProps.collectionData !== this.props.collectionData) { this._processLinks(); } } /** * Default React render method */ public render(): React.ReactElement { // Get all group names const groupNames: string[] = this.state.groups ? Object.keys(this.state.groups) : undefined; return (
{ (groupNames && groupNames.length > 0) ? (
{ groupNames.map((groupName, index) => (
{ // Do not show a header for the empty group groupName !== NO_GROUP_NAME && (
{groupName}
) } { // Loop over all links per group sortBy(this.state.groups[groupName], (link: { title: string; }) => link.title.toLowerCase()).map((link: { title: string; url: string; target: string; icon: string; }, index: React.Key) => (
{ link.icon && } {link.title}
)) }
)) }
) : ( ) }
); } /** * Process all links from the collection data */ private _processLinks(): void { const { collectionData } = this.props; if (collectionData && collectionData.length > 0) { // Group by the group name let groups: _.Dictionary = groupBy(collectionData, link => link.group ? link.group : NO_GROUP_NAME); // Sort the group by the property name groups = fromPairs(sortBy(toPairs(groups), 0)); this.setState({ groups }); } else { this.setState({ groups: undefined }); } } } ================================================ FILE: source/react-links/src/webparts/links/loc/de-de.js ================================================ define([], function() { return { "groupDataLabel": "Gruppenname für die Links", "groupPanelHeader": "Konfigurieren Sie Ihre Gruppennamen", "manageGroupBtn": "Konfiguriere Gruppen", "iconInformation": "Die Namen zum angeben des Icon Feldes können unter der folgenden URL gefunden werden:", "linkDataLabel": "Linkdaten", "linkPanelHeader": "Ihre Links konfigurieren", "manageLinksBtn": "Links konfigurieren", "titleField": "Title", "urlField": "URL", "iconField": "UI Fabric icon name", "groupField": "Gruppenname", "targetField": "Fensterverhalten", "targetCurrent": "Aktuelles Fenster", "targetNew": "Neuer Tab", "noLinksIconText": "Ihre Links konfigurieren", "noLinksConfigured": "Bitte konfigurieren Sie den Web Part um Links anzuzeigen.", "noLinksBtn": "Konfigurieren", } }); ================================================ FILE: source/react-links/src/webparts/links/loc/en-us.js ================================================ define([], function() { return { "groupDataLabel": "Group names for the links", "groupPanelHeader": "Configure your group names", "manageGroupBtn": "Configure groups", "iconInformation": "The names to specify for the icon field can be found on the following URL:", "linkDataLabel": "Link data", "linkPanelHeader": "Configure your links", "manageLinksBtn": "Configure links", "titleField": "Title", "urlField": "URL", "iconField": "UI Fabric icon name", "groupField": "Group name", "targetField": "Target", "targetCurrent": "Current window", "targetNew": "New tab", "noLinksIconText": "Configure your links", "noLinksConfigured": "Please configure the web part in order to show links", "noLinksBtn": "Configure", } }); ================================================ FILE: source/react-links/src/webparts/links/loc/es-es.js ================================================ define([], function() { return { "groupDataLabel": "Nombres de grupos para los enlaces", "groupPanelHeader": "Configure los nombres de los grupos", "manageGroupBtn": "Configure grupos", "iconInformation": "Los nombres a especificar para el campo Icono puede encontrarse en la siguiente dirección URL:", "linkDataLabel": "Enlace datos", "linkPanelHeader": "Configure sus enlaces", "manageLinksBtn": "Configure enlaces", "titleField": "Título", "urlField": "URL", "iconField": "Nombre de Icono de UI Fabric", "groupField": "Nombre del grupo", "targetField": "Destino", "targetCurrent": "Ventana actual", "targetNew": "Nueva ventana", "noLinksIconText": "Configure sus enlaces", "noLinksConfigured": "Favor de configurar el elemento web a fin de mostrar enlaces", "noLinksBtn": "Configuración", } }); ================================================ FILE: source/react-links/src/webparts/links/loc/fr-fr.js ================================================ define([], function() { return { "groupDataLabel": "Noms de groupe pour les liens", "groupPanelHeader": "Configurez vos noms de groupe", "manageGroupBtn": "Configurez des groupes", "iconInformation": "Les noms à spécifier pour le champ d'icône se trouvent à l'URL suivant:", "linkDataLabel": "Données de lien", "linkPanelHeader": "Configurez vos liens", "manageLinksBtn": "Configurez vos liens", "titleField": "Titre", "urlField": "URL", "iconField": "Nom de l'icône d'UI Fabric", "groupField": "Nom de groupe", "targetField": "Cible", "targetCurrent": "Fenêtre actuelle", "targetNew": "Nouvel onglet", "noLinksIconText": "Configurez tes liens", "noLinksConfigured": "Veuillez configurer la partie Web pour afficher les liens.", "noLinksBtn": "Configurer", } }); ================================================ FILE: source/react-links/src/webparts/links/loc/mystrings.d.ts ================================================ declare interface ILinksWebPartStrings { groupDataLabel: string; groupPanelHeader: string; manageGroupBtn: string; iconInformation: string; linkDataLabel: string; linkPanelHeader: string; manageLinksBtn: string; titleField: string; urlField: string; iconField: string; groupField: string; targetField: string; targetCurrent: string; targetNew: string; noLinksIconText: string; noLinksConfigured: string; noLinksBtn: string; } declare module 'LinksWebPartStrings' { const strings: ILinksWebPartStrings; export = strings; } ================================================ FILE: source/react-links/src/webparts/links/loc/nb-no.js ================================================ define([], function() { return { "groupDataLabel": "Gruppenavn til lenkene", "groupPanelHeader": "Konfigurer gruppenavn", "manageGroupBtn": "Konfigurer grupper", "iconInformation": "Navnene som skal angis i ikonfeltet ligger på følgende URL:", "linkDataLabel": "Lenkedata", "linkPanelHeader": "Konfigurer lenkene", "manageLinksBtn": "Konfigurer lenker", "titleField": "Tittel", "urlField": "URL", "iconField": "UI Fabric ikon navn", "groupField": "Gruppenavn", "targetField": "Mål", "targetCurrent": "Gjeldende vindu", "targetNew": "Nytt vindu", "noLinksIconText": "Konfigurer dine lenker", "noLinksConfigured": "Konfigurer webdelen for å vise lenker", "noLinksBtn": "Konfigurer", } }); ================================================ FILE: source/react-links/src/webparts/links/loc/nl-nl.js ================================================ define([], function() { return { "groupDataLabel": "Groepnamen voor de links", "groupPanelHeader": "Configureer je groepnamen", "manageGroupBtn": "Configureer groepen", "iconInformation": "De icoonnamen kan je vinden via de volgende URL:", "linkDataLabel": "Link data", "linkPanelHeader": "Configureer je links", "manageLinksBtn": "Configureer links", "titleField": "Titel", "urlField": "URL", "iconField": "UI Fabric icoonnaam", "groupField": "Groupnaam", "targetField": "Doel", "targetCurrent": "Huidig venster", "targetNew": "Nieuw tabblad", "noLinksIconText": "Configureer je links", "noLinksConfigured": "Configureer het webpart om links te tonen", "noLinksBtn": "Configureer", } }); ================================================ FILE: source/react-links/src/webparts/links/loc/sv-se.js ================================================ define([], function() { return { "groupDataLabel": "Gruppnamn för länkarna", "groupPanelHeader": "Konfigurera dina gruppnamn", "manageGroupBtn": "Konfigurera grupper", "iconInformation": "Namnen som ska anges i ikonfältet finns på följande webbadress:", "linkDataLabel": "Länkdata", "linkPanelHeader": "Konfigurera dina länkar", "manageLinksBtn": "Konfigurera länkar", "titleField": "Titel", "urlField": "URL", "iconField": "UI Fabric ikonnamn", "groupField": "Gruppnamn", "targetField": "Mål", "targetCurrent": "Nuvarande fönster", "targetNew": "Ny flik", "noLinksIconText": "Konfigurera dina länkar", "noLinksConfigured": "Konfigurera webbdelen för att visa länkar", "noLinksBtn": "Konfigurera", } }); ================================================ FILE: source/react-links/src/webparts/links/loc/tr-tr.js ================================================ define([], function() { return { "groupDataLabel": "Bağlantılar için grup adları", "groupPanelHeader": "Grup adlarınızı yapılandırın", "manageGroupBtn": "Grupları yapılandır", "iconInformation": "İkon alanı için belirtilecek isimler aşağıdaki URL’de bulunabilir:", "linkDataLabel": "Bağlantı verisi", "linkPanelHeader": "Bağlantılarınızı yapılandırın", "manageLinksBtn": "Bağlantıları yapılandır", "titleField": "Başlık", "urlField": "URL", "iconField": "UI Fabric ikon adı", "groupField": "Grup ismi", "targetField": "Hedef", "targetCurrent": "Geçerli pencere", "targetNew": "Yeni sekme", "noLinksIconText": "Bağlantılarınızı yapılandırın", "noLinksConfigured": "Lütfen bağlantıları göstermek için web bölümünü yapılandırın", "noLinksBtn": "Yapılandır", } }); ================================================ FILE: source/react-links/tsconfig.json ================================================ { "extends": "./node_modules/@microsoft/rush-stack-compiler-4.5/includes/tsconfig-web.json", "compilerOptions": { "target": "es5", "forceConsistentCasingInFileNames": true, "module": "esnext", "moduleResolution": "node", "jsx": "react", "declaration": true, "sourceMap": true, "experimentalDecorators": true, "skipLibCheck": true, "outDir": "lib", "inlineSources": false, "strictNullChecks": false, "noImplicitAny": true, "typeRoots": [ "./node_modules/@types", "./node_modules/@microsoft" ], "types": [ "webpack-env" ], "lib": [ "es5", "dom", "es2015.collection", "es2015.promise" ] }, "include": [ "src/**/*.ts", "src/**/*.tsx" ] } ================================================ FILE: source/react-lob-integration/.editorconfig ================================================ # EditorConfig helps developers define and maintain consistent # coding styles between different editors and IDEs # editorconfig.org root = true [*] # change these settings to your own preference indent_style = space indent_size = 2 # we recommend you to keep these unchanged end_of_line = lf charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true [*.md] trim_trailing_whitespace = false [{package,bower}.json] indent_style = space indent_size = 2 ================================================ FILE: source/react-lob-integration/.eslintrc.js ================================================ require('@rushstack/eslint-config/patch/modern-module-resolution'); module.exports = { extends: ['@microsoft/eslint-config-spfx/lib/profiles/react'], parserOptions: { tsconfigRootDir: __dirname }, overrides: [ { files: ['*.ts', '*.tsx'], parser: '@typescript-eslint/parser', 'parserOptions': { 'project': './tsconfig.json', 'ecmaVersion': 2018, 'sourceType': 'module' }, rules: { // Prevent usage of the JavaScript null value, while allowing code to access existing APIs that may require null. https://www.npmjs.com/package/@rushstack/eslint-plugin '@rushstack/no-new-null': 1, // Require Jest module mocking APIs to be called before any other statements in their code block. https://www.npmjs.com/package/@rushstack/eslint-plugin '@rushstack/hoist-jest-mock': 1, // Require regular expressions to be constructed from string constants rather than dynamically building strings at runtime. https://www.npmjs.com/package/@rushstack/eslint-plugin-security '@rushstack/security/no-unsafe-regexp': 1, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/adjacent-overload-signatures': 1, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // // CONFIGURATION: By default, these are banned: String, Boolean, Number, Object, Symbol '@typescript-eslint/ban-types': [ 1, { 'extendDefaults': false, 'types': { 'String': { 'message': 'Use \'string\' instead', 'fixWith': 'string' }, 'Boolean': { 'message': 'Use \'boolean\' instead', 'fixWith': 'boolean' }, 'Number': { 'message': 'Use \'number\' instead', 'fixWith': 'number' }, 'Object': { 'message': 'Use \'object\' instead, or else define a proper TypeScript type:' }, 'Symbol': { 'message': 'Use \'symbol\' instead', 'fixWith': 'symbol' }, 'Function': { 'message': 'The \'Function\' type accepts any function-like value.\nIt provides no type safety when calling the function, which can be a common source of bugs.\nIt also accepts things like class declarations, which will throw at runtime as they will not be called with \'new\'.\nIf you are expecting the function to accept certain arguments, you should explicitly define the function shape.' } } } ], // RATIONALE: Code is more readable when the type of every variable is immediately obvious. // Even if the compiler may be able to infer a type, this inference will be unavailable // to a person who is reviewing a GitHub diff. This rule makes writing code harder, // but writing code is a much less important activity than reading it. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/explicit-function-return-type': [ 1, { 'allowExpressions': true, 'allowTypedFunctionExpressions': true, 'allowHigherOrderFunctions': false } ], // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // Rationale to disable: although this is a recommended rule, it is up to dev to select coding style. // Set to 1 (warning) or 2 (error) to enable. '@typescript-eslint/explicit-member-accessibility': 0, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/no-array-constructor': 1, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // // RATIONALE: The "any" keyword disables static type checking, the main benefit of using TypeScript. // This rule should be suppressed only in very special cases such as JSON.stringify() // where the type really can be anything. Even if the type is flexible, another type // may be more appropriate such as "unknown", "{}", or "Record". '@typescript-eslint/no-explicit-any': 1, // RATIONALE: The #1 rule of promises is that every promise chain must be terminated by a catch() // handler. Thus wherever a Promise arises, the code must either append a catch handler, // or else return the object to a caller (who assumes this responsibility). Unterminated // promise chains are a serious issue. Besides causing errors to be silently ignored, // they can also cause a NodeJS process to terminate unexpectedly. '@typescript-eslint/no-floating-promises': 2, // RATIONALE: Catches a common coding mistake. '@typescript-eslint/no-for-in-array': 2, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/no-misused-new': 2, // RATIONALE: The "namespace" keyword is not recommended for organizing code because JavaScript lacks // a "using" statement to traverse namespaces. Nested namespaces prevent certain bundler // optimizations. If you are declaring loose functions/variables, it's better to make them // static members of a class, since classes support property getters and their private // members are accessible by unit tests. Also, the exercise of choosing a meaningful // class name tends to produce more discoverable APIs: for example, search+replacing // the function "reverse()" is likely to return many false matches, whereas if we always // write "Text.reverse()" is more unique. For large scale organization, it's recommended // to decompose your code into separate NPM packages, which ensures that component // dependencies are tracked more conscientiously. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/no-namespace': [ 1, { 'allowDeclarations': false, 'allowDefinitionFiles': false } ], // RATIONALE: Parameter properties provide a shorthand such as "constructor(public title: string)" // that avoids the effort of declaring "title" as a field. This TypeScript feature makes // code easier to write, but arguably sacrifices readability: In the notes for // "@typescript-eslint/member-ordering" we pointed out that fields are central to // a class's design, so we wouldn't want to bury them in a constructor signature // just to save some typing. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // Set to 1 (warning) or 2 (error) to enable the rule '@typescript-eslint/no-parameter-properties': 0, // RATIONALE: When left in shipping code, unused variables often indicate a mistake. Dead code // may impact performance. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/no-unused-vars': [ 1, { 'vars': 'all', // Unused function arguments often indicate a mistake in JavaScript code. However in TypeScript code, // the compiler catches most of those mistakes, and unused arguments are fairly common for type signatures // that are overriding a base class method or implementing an interface. 'args': 'none' } ], // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/no-use-before-define': [ 2, { 'functions': false, 'classes': true, 'variables': true, 'enums': true, 'typedefs': true } ], // Disallows require statements except in import statements. // In other words, the use of forms such as var foo = require("foo") are banned. Instead use ES6 style imports or import foo = require("foo") imports. '@typescript-eslint/no-var-requires': 'error', // RATIONALE: The "module" keyword is deprecated except when describing legacy libraries. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/prefer-namespace-keyword': 1, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // Rationale to disable: it's up to developer to decide if he wants to add type annotations // Set to 1 (warning) or 2 (error) to enable the rule '@typescript-eslint/no-inferrable-types': 0, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // Rationale to disable: declaration of empty interfaces may be helpful for generic types scenarios '@typescript-eslint/no-empty-interface': 0, // RATIONALE: This rule warns if setters are defined without getters, which is probably a mistake. 'accessor-pairs': 1, // RATIONALE: In TypeScript, if you write x["y"] instead of x.y, it disables type checking. 'dot-notation': [ 1, { 'allowPattern': '^_' } ], // RATIONALE: Catches code that is likely to be incorrect 'eqeqeq': 0, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'for-direction': 1, // RATIONALE: Catches a common coding mistake. 'guard-for-in': 2, // RATIONALE: If you have more than 2,000 lines in a single source file, it's probably time // to split up your code. 'max-lines': ['warn', { max: 2000 }], // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-async-promise-executor': 2, // RATIONALE: Deprecated language feature. 'no-caller': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-compare-neg-zero': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-cond-assign': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-constant-condition': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-control-regex': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-debugger': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-delete-var': 2, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-duplicate-case': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-empty': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-empty-character-class': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-empty-pattern': 1, // RATIONALE: Eval is a security concern and a performance concern. 'no-eval': 1, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-ex-assign': 2, // RATIONALE: System types are global and should not be tampered with in a scalable code base. // If two different libraries (or two versions of the same library) both try to modify // a type, only one of them can win. Polyfills are acceptable because they implement // a standardized interoperable contract, but polyfills are generally coded in plain // JavaScript. 'no-extend-native': 1, // Disallow unnecessary labels 'no-extra-label': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-fallthrough': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-func-assign': 1, // RATIONALE: Catches a common coding mistake. 'no-implied-eval': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-invalid-regexp': 2, // RATIONALE: Catches a common coding mistake. 'no-label-var': 2, // RATIONALE: Eliminates redundant code. 'no-lone-blocks': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-misleading-character-class': 2, // RATIONALE: Catches a common coding mistake. 'no-multi-str': 2, // RATIONALE: It's generally a bad practice to call "new Thing()" without assigning the result to // a variable. Either it's part of an awkward expression like "(new Thing()).doSomething()", // or else implies that the constructor is doing nontrivial computations, which is often // a poor class design. 'no-new': 1, // RATIONALE: Obsolete language feature that is deprecated. 'no-new-func': 2, // RATIONALE: Obsolete language feature that is deprecated. 'no-new-object': 2, // RATIONALE: Obsolete notation. 'no-new-wrappers': 1, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-octal': 2, // RATIONALE: Catches code that is likely to be incorrect 'no-octal-escape': 2, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-regex-spaces': 2, // RATIONALE: Catches a common coding mistake. 'no-return-assign': 2, // RATIONALE: Security risk. 'no-script-url': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-self-assign': 2, // RATIONALE: Catches a common coding mistake. 'no-self-compare': 2, // RATIONALE: This avoids statements such as "while (a = next(), a && a.length);" that use // commas to create compound expressions. In general code is more readable if each // step is split onto a separate line. This also makes it easier to set breakpoints // in the debugger. 'no-sequences': 1, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-shadow-restricted-names': 2, // RATIONALE: Obsolete language feature that is deprecated. // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-sparse-arrays': 2, // RATIONALE: Although in theory JavaScript allows any possible data type to be thrown as an exception, // such flexibility adds pointless complexity, by requiring every catch block to test // the type of the object that it receives. Whereas if catch blocks can always assume // that their object implements the "Error" contract, then the code is simpler, and // we generally get useful additional information like a call stack. 'no-throw-literal': 2, // RATIONALE: Catches a common coding mistake. 'no-unmodified-loop-condition': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-unsafe-finally': 2, // RATIONALE: Catches a common coding mistake. 'no-unused-expressions': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-unused-labels': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-useless-catch': 1, // RATIONALE: Avoids a potential performance problem. 'no-useless-concat': 1, // RATIONALE: The "var" keyword is deprecated because of its confusing "hoisting" behavior. // Always use "let" or "const" instead. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json 'no-var': 2, // RATIONALE: Generally not needed in modern code. 'no-void': 1, // RATIONALE: Obsolete language feature that is deprecated. // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-with': 2, // RATIONALE: Makes logic easier to understand, since constants always have a known value // @typescript-eslint\eslint-plugin\dist\configs\eslint-recommended.js 'prefer-const': 1, // RATIONALE: Catches a common coding mistake where "resolve" and "reject" are confused. 'promise/param-names': 2, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'require-atomic-updates': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'require-yield': 1, // "Use strict" is redundant when using the TypeScript compiler. 'strict': [ 2, 'never' ], // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'use-isnan': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js // Set to 1 (warning) or 2 (error) to enable. // Rationale to disable: !!{} 'no-extra-boolean-cast': 0, // ==================================================================== // @microsoft/eslint-plugin-spfx // ==================================================================== '@microsoft/spfx/import-requires-chunk-name': 1, '@microsoft/spfx/no-require-ensure': 2, '@microsoft/spfx/pair-react-dom-render-unmount': 1 } }, { // For unit tests, we can be a little bit less strict. The settings below revise the // defaults specified in the extended configurations, as well as above. files: [ // Test files '*.test.ts', '*.test.tsx', '*.spec.ts', '*.spec.tsx', // Facebook convention '**/__mocks__/*.ts', '**/__mocks__/*.tsx', '**/__tests__/*.ts', '**/__tests__/*.tsx', // Microsoft convention '**/test/*.ts', '**/test/*.tsx' ], rules: {} } ] }; ================================================ FILE: source/react-lob-integration/.gitignore ================================================ # Logs logs *.log npm-debug.log* # Dependency directories node_modules # Build generated files dist lib release solution temp *.sppkg .heft # Coverage directory used by tools like istanbul coverage # OSX .DS_Store # Visual Studio files .ntvs_analysis.dat .vs bin obj # Resx Generated Code *.resx.ts # Styles Generated Code *.scss.ts*.scss.d.ts ================================================ FILE: source/react-lob-integration/.npmignore ================================================ !dist config gulpfile.js release src temp tsconfig.json tslint.json *.log .yo-rc.json .vscode ================================================ FILE: source/react-lob-integration/.vscode/launch.json ================================================ { "version": "0.2.0", "configurations": [ { "name": "Hosted workbench", "type": "pwa-chrome", "request": "launch", "url": "https://enter-your-SharePoint-site/_layouts/workbench.aspx", "webRoot": "${workspaceRoot}", "sourceMaps": true, "sourceMapPathOverrides": { "webpack:///.././src/*": "${webRoot}/src/*", "webpack:///../../../src/*": "${webRoot}/src/*", "webpack:///../../../../src/*": "${webRoot}/src/*", "webpack:///../../../../../src/*": "${webRoot}/src/*" }, "runtimeArgs": [ "--remote-debugging-port=9222", "-incognito" ] } ] } ================================================ FILE: source/react-lob-integration/.vscode/settings.json ================================================ // Place your settings in this file to overwrite default and user settings. { // Configure glob patterns for excluding files and folders in the file explorer. "files.exclude": { "**/.git": true, "**/.DS_Store": true, "**/bower_components": true, "**/coverage": true, "**/lib-amd": true, "src/**/*.scss.ts": true }, "typescript.tsdk": ".\\node_modules\\typescript\\lib" } ================================================ FILE: source/react-lob-integration/.yo-rc.json ================================================ { "@microsoft/generator-sharepoint": { "plusBeta": false, "isCreatingSolution": true, "nodeVersion": "16.19.0", "sdksVersions": { "@microsoft/microsoft-graph-client": "3.0.2", "@microsoft/teams-js": "2.4.1" }, "version": "1.16.1", "environment": "spo", "libraryName": "react-lob-integration", "libraryId": "9cd26e88-b530-474a-8bd0-55a5b87df80d", "packageManager": "npm", "isDomainIsolated": false, "componentType": "webpart" } } ================================================ FILE: source/react-lob-integration/README.md ================================================ # LOB Integration webpart The purpose of this web part is to show how you can consume LOB (Line of Business) solutions and external (on-premises, cloud based, etc) data within SharePoint Framework. ![LOB Integration](../../assets/images/components/part-lob-integration.png) The web part leverages a back-end REST API, built using a ASP.NET Core 3.1 WebAPI project that you can find [here](../../sample-lob-service/SharePointPnP.LobScenario/). This API is representative of LOB data exposed via a web service and consumed using Http calls. Visual Studio 2019 version 16.4 or higher required for Visual Studio based deployment to Azure. ## LOB service - Application Registration The LOB service is protected via the Microsoft Identity Platform. An application registration is required to implement this protection. Peform the following steps to register an application in a tenant. > If you are not an administrator of a Microsoft 365 tenant, you can get a tenant at no charge as part of the [Microsoft 365 Developer Program](https://developer.microsoft.com/en-us/office/dev-program). 1. Log in to the Azure Active Directory admin center at https://aad.portal.azure.com/. 1. In the left-hand navigation bar, select **Azure Active Directory**, then **App Registrations**. ![Screenshot of the left navigation in the Azure Active Directory admin center](../../assets/images/sample-lob-service/figure1.png) 1. Select **New Registration** from the toolbar. 1. Enter a name for the application. In this example, the name is **SharePointPnP-LobScenario**. > This value, known as the **_Application Name_**, is required later in the SharePoint Service Principal configuration. 1. For **Supported account types**, select **Accounts in this organizational directory only (Single tenant)**. 1. Select **Register**. ![Screenshot of the New Application pane in the Azure Active Directory admin center](../../assets/images/sample-lob-service/figure2.png) 1. In the application overview blade, select **Expose an API**. 1. Select **Add a scope**. 1. The portal will display a panel requesting an Application ID URI. Leave the suggested default (`api://{app-id}`). > This value, known as the **_Application URI_**, is required as a web part property. 1. Select **Save and continue**. ![Screenshot of the Add a scope pane in the Azure Active Directory admin center](../../assets/images/sample-lob-service/figure3.png) 1. For **Scope name**, enter `access_as_user`. > This value, known as the **_Application Scope_**, is required later in the SharePoint Service Principal configuration. 1. Complete the Consent fields as appropriate. 1. Select **Add scope** to complete the configuration. ![Screenshot of the Add a scope pane in the Azure Active Directory admin center](../../assets/images/sample-lob-service/figure4.png) 1. Select **Overview** in the application menu. Make note of the following values for configuring the service code: 1. Application (client) ID 1. Directory (tenant) ID ![Screenshot of the application overview in the Azure Active Directory admin center](../../assets/images/sample-lob-service/figure5.png) ## LOB service - Code configuration The [LOB service](../../sample-lob-service/SharePointPnP.LobScenario/) code must be configured with the application registration values. 1. Open the `appsettings.json` file. 1. Set the TenantId property to the **_Directory (tenant) ID_** value. 1. Set the ClientId property to the **_Application (client) ID_** value. Once updated, deploy or start the solution. The service must use the https scheme. Make note of the address (url). > This value, known as the **_Service Url_**, is required as a web part property. ## SharePoint Service Principal configuration The SharePoint Service Principal must have a permission grant before getting an access token for the service. The following PowerShell commands will configure the service principal (the **Resource** and **Scope** parameters must match the values from the application registration): ```PowerShell Connect-SPOService -Url "https://[your-tenant]-admin.sharepoint.com/" Approve-SPOTenantServicePrincipalPermissionGrant -Resource "[Application Name]" -Scope "[Application Scope]" ``` ## How to use this web part on your web pages 1. Place the page you want to add this web part to in edit mode. 2. Search for and insert the **LobIntegration** web part. 3. Configure the webpart to update its properties. ## Configurable Properties The `LobIntegration` webpart must be configured with the following properties: | Label | Property | Type | Required | Description | | --------------- | ---------- | ------ | -------- | ----------- | | Service Url | serviceUrl | string | yes | The hosting address of the LOB service. (The address must use the https scheme.) | | Application URI | webapiUri | string | yes | The value from the application registration in the Azure Active Directory admin center. | ## Used SharePoint Framework Version ![drop](https://img.shields.io/badge/version-1.16.1-green.svg) * SharePoint Online only due to dependency on API permission management ## Applies to * [SharePoint Framework](https:/dev.office.com/sharepoint) * [Office 365 tenant](https://dev.office.com/sharepoint/docs/spfx/set-up-your-development-environment) ## Prerequisites WebAPI configured as secured asset in the same Azure AD instance as where web part is hosted. ## Solution Solution|Author(s) --------|--------- react-lob-integration | Paul Schaeflein (Technical Architect, AddIn365) / Microsoft MVP (Office Development) / @paulschaeflein react-lob-integration | Chandani Prajapati / @Chandani_SPD ## Version history Version|Date|Comments -------|----|-------- 2.0|December 25, 2019|Initial release 3.0|February 2023|Initial release for SharePoint Starter Kit v3 (Upgraded to SPFx 1.16.1) ## Disclaimer **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.** --- ## Minimal Path to Awesome * Clone this repository * Move to solution folder * in the command line run: * `npm install` * `gulp serve` > Include any additional steps as needed. ## Features Description of the web part with possible additional details than in short summary. This Web Part illustrates the following concepts on top of the SharePoint Framework: * Calling securely custom Web APIs in SharePoint Online from SharePoint Framework solutions ================================================ FILE: source/react-lob-integration/config/config.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/config.2.0.schema.json", "version": "2.0", "bundles": { "lob-integration-web-part": { "components": [ { "entrypoint": "./lib/webparts/lobIntegration/LobIntegrationWebPart.js", "manifest": "./src/webparts/lobIntegration/LobIntegrationWebPart.manifest.json" } ] } }, "externals": {}, "localizedResources": { "LobIntegrationWebPartStrings": "lib/webparts/lobIntegration/loc/{locale}.js", "ControlStrings": "node_modules/@pnp/spfx-controls-react/lib/loc/{locale}.js" } } ================================================ FILE: source/react-lob-integration/config/deploy-azure-storage.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/deploy-azure-storage.schema.json", "workingDir": "./release/assets/", "account": "", "container": "react-lob-integration", "accessKey": "" } ================================================ FILE: source/react-lob-integration/config/package-solution.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/package-solution.schema.json", "solution": { "name": "Starter Kit - LOB Integration", "id": "9cd26e88-b530-474a-8bd0-55a5b87df80d", "version": "3.0.0.0", "includeClientSideAssets": true, "skipFeatureDeployment": true, "isDomainIsolated": false, "developer": { "name": "PnP Starter Kit", "privacyUrl": "", "termsOfUseUrl": "", "websiteUrl": "", "mpnId": "pnpsk" }, "metadata": { "shortDescription": { "default": "react-lob-integration description" }, "longDescription": { "default": "react-lob-integration description" }, "screenshotPaths": [], "videoUrl": "", "categories": [] }, "features": [ { "title": "Starter Kit - LOB Integration WebPart Feature", "description": "The feature that activates LOB Integration WebPart from the Starter Kit - LOB Integration solution.", "id": "748e6953-56aa-4a34-93bc-668966484f88", "version": "3.0.0.0", "componentIds": [ "748e6953-56aa-4a34-93bc-668966484f88" ] } ] }, "paths": { "zippedPackage": "solution/react-lob-integration.sppkg" } } ================================================ FILE: source/react-lob-integration/config/sass.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/core-build/sass.schema.json" } ================================================ FILE: source/react-lob-integration/config/serve.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/spfx-serve.schema.json", "port": 4321, "https": true, "initialPage": "https://enter-your-SharePoint-site/_layouts/workbench.aspx" } ================================================ FILE: source/react-lob-integration/config/write-manifests.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/write-manifests.schema.json", "cdnBasePath": "" } ================================================ FILE: source/react-lob-integration/gulpfile.js ================================================ 'use strict'; const build = require('@microsoft/sp-build-web'); build.addSuppression(`Warning - [sass] The local CSS class 'ms-Grid' is not camelCase and will not be type-safe.`); var getTasks = build.rig.getTasks; build.rig.getTasks = function () { var result = getTasks.call(build.rig); result.set('serve', result.get('serve-deprecated')); return result; }; build.initialize(require('gulp')); ================================================ FILE: source/react-lob-integration/package.json ================================================ { "name": "react-lob-integration", "version": "3.0.0", "private": true, "main": "lib/index.js", "engines": { "node": ">=16.13.0 <17.0.0" }, "scripts": { "build": "gulp bundle", "clean": "gulp clean", "test": "gulp test" }, "dependencies": { "@microsoft/sp-core-library": "1.16.1", "@microsoft/sp-lodash-subset": "1.16.1", "@microsoft/sp-office-ui-fabric-core": "1.16.1", "@microsoft/sp-property-pane": "1.16.1", "@microsoft/sp-webpart-base": "1.16.1", "@pnp/spfx-controls-react": "3.12.0", "react": "17.0.1", "react-dom": "17.0.1", "tslib": "2.3.1" }, "resolutions": { "@types/react": "16.8.8" }, "devDependencies": { "@microsoft/eslint-config-spfx": "1.16.1", "@microsoft/eslint-plugin-spfx": "1.16.1", "@microsoft/rush-stack-compiler-4.5": "0.2.2", "@microsoft/sp-build-web": "1.16.1", "@microsoft/sp-module-interfaces": "1.16.1", "@rushstack/eslint-config": "2.5.1", "@types/react": "17.0.45", "@types/react-dom": "17.0.17", "@types/webpack-env": "~1.15.2", "ajv": "^6.12.5", "eslint-plugin-react-hooks": "4.3.0", "gulp": "4.0.2", "typescript": "4.5.5" } } ================================================ FILE: source/react-lob-integration/src/index.ts ================================================ // A file is required to be in the root of the /src directory by the TypeScript compiler ================================================ FILE: source/react-lob-integration/src/webparts/lobIntegration/ICustomer.ts ================================================ export interface ICustomer { customerID: string; companyName: string; contactName: string; country: string; } ================================================ FILE: source/react-lob-integration/src/webparts/lobIntegration/ILobIntegrationWebPartProps.ts ================================================ export interface ILobIntegrationWebPartProps { applicationUri: string; serviceUrl: string; } ================================================ FILE: source/react-lob-integration/src/webparts/lobIntegration/ILobServiceResponse.ts ================================================ import { ICustomer } from "./ICustomer"; export interface ILobServiceResponse { username: string; requestDateTime: Date; customers: ICustomer[]; } ================================================ FILE: source/react-lob-integration/src/webparts/lobIntegration/LobIntegrationWebPart.manifest.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx/client-side-web-part-manifest.schema.json", "id": "748e6953-56aa-4a34-93bc-668966484f88", "alias": "LobIntegrationWebPart", "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, "supportedHosts": ["SharePointWebPart", "SharePointFullPage", "TeamsPersonalApp", "TeamsTab"], "preconfiguredEntries": [{ "groupId": "5c03119e-3074-46fd-976b-c60198311f70", // Other "group": { "default": "Other" }, "title": { "default": "LOBIntegration" }, "description": { "default": "Demonstrates Line-of-Business solution integration with SharePoint Framework" }, "officeFabricIconFontName": "PlugConnected", "properties": { "description": "LOBIntegration" } }] } ================================================ FILE: source/react-lob-integration/src/webparts/lobIntegration/LobIntegrationWebPart.ts ================================================ import * as React from 'react'; import * as ReactDom from 'react-dom'; import { Version, DisplayMode } from '@microsoft/sp-core-library'; import { BaseClientSideWebPart } from "@microsoft/sp-webpart-base"; import { IPropertyPaneConfiguration, PropertyPaneTextField } from "@microsoft/sp-property-pane"; import * as strings from 'LobIntegrationWebPartStrings'; import { ILobIntegrationWebPartProps } from './ILobIntegrationWebPartProps'; import LobIntegration from './components/LobIntegration'; import { ILobIntegrationProps } from './components/ILobIntegrationProps'; export default class LobIntegrationWebPart extends BaseClientSideWebPart { // method to determine if the web part has to be configured private needsConfiguration(): boolean { // as long as we don't have the configuration settings return (!this.properties.applicationUri || !this.properties.serviceUrl); } public render(): void { const element: React.ReactElement = React.createElement( LobIntegration, { applicationUri: this.properties.applicationUri, serviceUrl: this.properties.serviceUrl, needsConfiguration: this.needsConfiguration(), context: this.context, configureHandler: () => { this.context.propertyPane.open(); }, errorHandler: (errorMessage: string) => { if (this.displayMode === DisplayMode.Edit) { this.context.statusRenderer.renderError(this.domElement, errorMessage); } else { // nothing to do, if we are not in edit Mode } } } ); ReactDom.render(element, this.domElement); } protected onDispose(): void { ReactDom.unmountComponentAtNode(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('serviceUrl', { label: strings.ServiceUrlFieldLabel }), PropertyPaneTextField('applicationUri', { label: strings.ApplicationUriFieldLabel }) ] } ] } ] }; } } ================================================ FILE: source/react-lob-integration/src/webparts/lobIntegration/components/ILobIntegrationProps.ts ================================================ import { WebPartContext } from "@microsoft/sp-webpart-base"; export interface ILobIntegrationProps { applicationUri: string; serviceUrl: string; needsConfiguration: boolean; context: WebPartContext; configureHandler: () => void; errorHandler: (errorMessage: string) => void; } ================================================ FILE: source/react-lob-integration/src/webparts/lobIntegration/components/ILobIntegrationState.ts ================================================ import { ICustomer } from "../ICustomer"; export interface ILobIntegrationState { // used to show the Spinner while loading data loading: boolean; // value to search for searchFor?: string; // the list of customers to render customers?: ICustomer[]; // current username, taken from the service response username?: string; // date and time of API invokation, taken from the service response requestDateTime?: Date; } ================================================ FILE: source/react-lob-integration/src/webparts/lobIntegration/components/LobIntegration.module.scss ================================================ @import '~@fluentui/react/dist/sass/References.scss'; .lobIntegration { .container { margin: 0px auto; box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.2), 0 25px 50px 0 rgba(0, 0, 0, 0.1); } .row { @include ms-Grid-row; padding: 20px; } .column { @include ms-Grid-col; @include ms-lg10; @include ms-xl8; @include ms-xlPush2; @include ms-lgPush1; } .title { @include ms-font-xl; } .form { @include ms-font-l; } .spinner { .ms-Spinner-label { color: $ms-color-themeDark; } } .subTitle { @include ms-font-l; } .description { @include ms-font-l; } .button { // Our button text-decoration: none; height: 32px; // Primary Button min-width: 80px; background-color: $ms-color-themePrimary; border-color: $ms-color-themePrimary; color: $ms-color-white; // Basic Button outline: transparent; position: relative; font-family: "Segoe UI WestEuropean","Segoe UI",-apple-system,BlinkMacSystemFont,Roboto,"Helvetica Neue",sans-serif; -webkit-font-smoothing: antialiased; font-size: $ms-font-size-m; font-weight: $ms-font-weight-regular; border-width: 0; text-align: center; cursor: pointer; display: inline-block; padding: 0 16px; .label { font-weight: $ms-font-weight-semibold; font-size: $ms-font-size-m; height: 32px; line-height: 32px; margin: 0 4px; vertical-align: top; display: inline-block; } } } ================================================ FILE: source/react-lob-integration/src/webparts/lobIntegration/components/LobIntegration.module.scss.ts ================================================ /* tslint:disable */ require("./LobIntegration.module.css"); const styles = { lobIntegration: 'lobIntegration_f1a12cf6', container: 'container_f1a12cf6', row: 'row_f1a12cf6', column: 'column_f1a12cf6', 'ms-Grid': 'ms-Grid_f1a12cf6', title: 'title_f1a12cf6', form: 'form_f1a12cf6', spinner: 'spinner_f1a12cf6', 'ms-Spinner-label': 'ms-Spinner-label_f1a12cf6', subTitle: 'subTitle_f1a12cf6', description: 'description_f1a12cf6', button: 'button_f1a12cf6', label: 'label_f1a12cf6' }; export default styles; /* tslint:enable */ ================================================ FILE: source/react-lob-integration/src/webparts/lobIntegration/components/LobIntegration.tsx ================================================ import * as React from 'react'; import styles from './LobIntegration.module.scss'; import { ILobIntegrationProps } from './ILobIntegrationProps'; import { ILobIntegrationState } from './ILobIntegrationState'; // import additional controls/components import * as strings from 'LobIntegrationWebPartStrings'; import { Placeholder } from "@pnp/spfx-controls-react/lib/Placeholder"; import { Spinner, SpinnerSize, PrimaryButton, TextField, Label, DetailsList, DetailsListLayoutMode, IColumn, SelectionMode } from '@fluentui/react'; import { AadHttpClient, HttpClientResponse, IHttpClientOptions } from "@microsoft/sp-http"; import { ILobServiceResponse } from '../ILobServiceResponse'; /** * Define the columns that will be used to render the list of customers */ const _customersColumns: IColumn[] = [ { key: 'CustomerIDColumn', name: strings.CustomerIDColumn, fieldName: 'customerID', minWidth: 80, maxWidth: 100, isResizable: true, ariaLabel: strings.CustomerIDColumnAriaLabel }, { key: 'CompanyNameColumn', name: strings.CompanyNameColumn, fieldName: 'companyName', minWidth: 150, maxWidth: 350, isResizable: true, ariaLabel: strings.CompanyNameColumnAriaLabel }, { key: 'ContactNameColumn', name: strings.ContactNameColumn, fieldName: 'contactName', minWidth: 150, maxWidth: 350, isResizable: true, ariaLabel: strings.ContactNameColumnAriaLabel }, { key: 'CountryColumn', name: strings.CountryColumn, fieldName: 'country', minWidth: 100, maxWidth: 200, isResizable: true, ariaLabel: strings.CountryColumnAriaLabel }, ]; export default class LobIntegration extends React.Component { constructor(props: ILobIntegrationProps) { super(props); // set initial state for the component this.state = { loading: false, searchFor: "", customers: null, }; } public componentDidMount(): void { // this._listCustomers(); } private _onSearchForChanged(newValue: string): void { // update the component state accordingly to the current user's input this.setState({ searchFor: newValue, }); } private async _callService(requestUrl: string): Promise { // create an AadHttpClient object to consume the 3rd party API const aadClient: AadHttpClient = await this.props.context.aadHttpClientFactory.getClient(this.props.applicationUri); console.log("Created aadClient"); const requestHeaders: Headers = new Headers(); requestHeaders.append('Accept', 'application/json'); const requestOptions: IHttpClientOptions = { headers: requestHeaders, }; // get the list of customers const httpResponse: HttpClientResponse = await aadClient .get( requestUrl, AadHttpClient.configurations.v1, requestOptions ); return await httpResponse.json(); } private async _listCustomers(): Promise { // update the component state while listing customers this.setState({ customers: null, loading: true, }); const response:ILobServiceResponse = await this._callService(this.props.serviceUrl); // update the component state accordingly to the result this.setState({ customers: response.customers, username: response.username, requestDateTime: response.requestDateTime, loading: false, }); return; } private async _searchCustomers(): Promise { // update the component state while searching customers this.setState({ customers: null, loading: true, }); const response: ILobServiceResponse = await this._callService(`${this.props.serviceUrl}/search/${this.state.searchFor}`); // update the component state accordingly to the result this.setState({ customers: response.customers, username: response.username, requestDateTime: response.requestDateTime, loading: false, }); return; } public render(): React.ReactElement { let contents: JSX.Element = null; if (!this.props.needsConfiguration) { contents = (
{strings.ListDescription}

this._listCustomers()} />

{strings.SearchDescription}

this._onSearchForChanged(newValue)} />

this._searchCustomers()} />

{ (this.state.customers != null) ?
: null } { (this.state.loading) ?
: null }
); } // show the Placeholder control, if we are missing the real content, otherwise show the real content return (
{this.props.needsConfiguration && this.props.configureHandler()} /> } {contents}
); } } ================================================ FILE: source/react-lob-integration/src/webparts/lobIntegration/loc/de-de.js ================================================ define([], function() { return { "PropertyPaneDescription": "LOB Integration", "BasicGroupName": "Allgemeine Einstellungen", "ApplicationUriFieldLabel": "Application URI", "FunctionUriFieldLabel": "Funktion URI", "ServiceUrlFieldLabel": "Service Url", "PlaceholderIconName":"Ändern", "PlaceholderIconText":"Konfigurieren Sie Ihren Web Part", "PlaceholderDescription":"Bitte konfigurieren Sie den Web Part", "PlaceholderButtonLabel":"Konfigurieren", "LoadingDataLabel": "Lade Daten ...", "SearchFor": "Suche nach:", "SearchButtonText": "Suche", "SearchDescription": "Suche nach Kunden im LOB System", "ListButtonText": "Kunden auflisten", "ListDescription": "Listet Kunden aus dem LOb System auf", "CustomerIDColumn": "Customer ID", "CustomerIDColumnAriaLabel": "Kunden ID", "CompanyNameColumn": "Company", "CompanyNameColumnAriaLabel": "Firma", "ContactNameColumn": "Contact", "ContactNameColumnAriaLabel": "Kontakt", "CountryColumn": "Country", "CountryColumnAriaLabel": "Land", } }); ================================================ FILE: source/react-lob-integration/src/webparts/lobIntegration/loc/en-us.js ================================================ define([], function() { return { "PropertyPaneDescription": "LOB Integration", "BasicGroupName": "General Settings", "ApplicationUriFieldLabel": "Application URI", "FunctionUriFieldLabel": "Function URI", "ServiceUrlFieldLabel": "Service Url", "PlaceholderIconName":"Edit", "PlaceholderIconText":"Configure your web part", "PlaceholderDescription":"Please configure the web part.", "PlaceholderButtonLabel":"Configure", "LoadingDataLabel": "Loading data ...", "SearchFor": "Search for:", "SearchButtonText": "Search", "SearchDescription": "Search for Customers from LOB System", "ListButtonText": "List Customers", "ListDescription": "List Customers from LOB System", "CustomerIDColumn": "Customer ID", "CustomerIDColumnAriaLabel": "Customer ID", "CompanyNameColumn": "Company", "CompanyNameColumnAriaLabel": "Company", "ContactNameColumn": "Contact", "ContactNameColumnAriaLabel": "Contact", "CountryColumn": "Country", "CountryColumnAriaLabel": "Country", } }); ================================================ FILE: source/react-lob-integration/src/webparts/lobIntegration/loc/es-es.js ================================================ define([], function() { return { "PropertyPaneDescription": "Integración LOB", "BasicGroupName": "Configuración general", "ApplicationUriFieldLabel": "Application URI", "FunctionUriFieldLabel": "Function URI", "ServiceUrlFieldLabel": "Service Url", "PlaceholderIconName":"Editar", "PlaceholderIconText":"Configure su elementoi web", "PlaceholderDescription":"Favor de configurar este elemento web.", "PlaceholderButtonLabel":"Configurar", "LoadingDataLabel": "Cargando datos ...", "SearchFor": "Buscar por:", "SearchButtonText": "Busqueda", "SearchDescription": "Busqueda de cleinte desde siustema LOB", "ListButtonText": "Lista de Clientes", "ListDescription": "Lista de clientes de sistema LOB", "CustomerIDColumn": "Customer ID", "CustomerIDColumnAriaLabel": "Cliente ID", "CompanyNameColumn": "Company", "CompanyNameColumnAriaLabel": "Compañia", "ContactNameColumn": "Contact", "ContactNameColumnAriaLabel": "Contacto", "CountryColumn": "Country", "CountryColumnAriaLabel": "País", } }); ================================================ FILE: source/react-lob-integration/src/webparts/lobIntegration/loc/fr-fr.js ================================================ define([], function() { return { "PropertyPaneDescription": "Integration LOB", "BasicGroupName": "Réglages généraux", "ApplicationUriFieldLabel": "Application URI", "FunctionUriFieldLabel": "URI de la fonction", "ServiceUrlFieldLabel": "Service Url", "PlaceholderIconName":"Editez", "PlaceholderIconText":"Configurez votre partie Web", "PlaceholderDescription":"Veuillez configurer la partie Web.", "PlaceholderButtonLabel":"Configurez", "LoadingDataLabel": "Chargement des données ...", "SearchFor": "Rechercher:", "SearchButtonText": "Rechercher", "SearchDescription": "Rechercher des clients depuis le système LOB", "ListButtonText": "Liste des clients", "ListDescription": "Liste des clients depuis le système LOB", "CustomerIDColumn": "ID du client", "CustomerIDColumnAriaLabel": "ID du client", "CompanyNameColumn": "Entreprise", "CompanyNameColumnAriaLabel": "Entreprise", "ContactNameColumn": "Contacte", "ContactNameColumnAriaLabel": "Contacte", "CountryColumn": "Pays", "CountryColumnAriaLabel": "Pays", } }); ================================================ FILE: source/react-lob-integration/src/webparts/lobIntegration/loc/mystrings.d.ts ================================================ declare interface ILobIntegrationWebPartStrings { // Property Pane labels and strings PropertyPaneDescription: string; BasicGroupName: string; ApplicationUriFieldLabel: string; FunctionUriFieldLabel: string; ServiceUrlFieldLabel: string; // Placeholder labels and strings PlaceholderIconName: string; PlaceholderIconText: string; PlaceholderDescription: string; PlaceholderButtonLabel: string; // UI labels and strings LoadingDataLabel: string; SearchFor: string; SearchButtonText: string; SearchDescription: string; ListButtonText: string; ListDescription: string; // labels for list of customers CustomerIDColumn: string; CustomerIDColumnAriaLabel: string; CompanyNameColumn: string; CompanyNameColumnAriaLabel: string; ContactNameColumn: string; ContactNameColumnAriaLabel: string; CountryColumn: string; CountryColumnAriaLabel: string; } declare module 'LobIntegrationWebPartStrings' { const strings: ILobIntegrationWebPartStrings; export = strings; } ================================================ FILE: source/react-lob-integration/src/webparts/lobIntegration/loc/nb-no.js ================================================ define([], function() { return { "PropertyPaneDescription": "LOB Integrasjon", "BasicGroupName": "Generelle innstillinger", "ApplicationUriFieldLabel": "Application URI", "FunctionUriFieldLabel": "Funksjon URI", "ServiceUrlFieldLabel": "Service Url", "PlaceholderIconName":"Rediger", "PlaceholderIconText":"Konfigurer webdelen", "PlaceholderDescription":"Vennligst konfigurer webdelen.", "PlaceholderButtonLabel":"Konfigurer", "LoadingDataLabel": "Laster data ...", "SearchFor": "Søk etter:", "SearchButtonText": "Søk", "SearchDescription": "Søk etter kunder fra LOB systemet", "ListButtonText": "Vis kunder", "ListDescription": "List opp kunder fra LOB systemet", "CustomerIDColumn": "Kunde ID", "CustomerIDColumnAriaLabel": "Kunde ID", "CompanyNameColumn": "Selskap", "CompanyNameColumnAriaLabel": "Selskap", "ContactNameColumn": "Kontakt", "ContactNameColumnAriaLabel": "Kontakt", "CountryColumn": "Land", "CountryColumnAriaLabel": "Land", } }); ================================================ FILE: source/react-lob-integration/src/webparts/lobIntegration/loc/sv-se.js ================================================ define([], function() { return { "PropertyPaneDescription": "LOB Integration", "BasicGroupName": "Generella Inställningar", "ApplicationUriFieldLabel": "Application URI", "FunctionUriFieldLabel": "Function URI", "ServiceUrlFieldLabel": "Service Url", "PlaceholderIconName":"Redigera", "PlaceholderIconText":"Konfigurera din webbdel", "PlaceholderDescription":"Var god och konfigurera din webbdel.", "PlaceholderButtonLabel":"Konfigurera", "LoadingDataLabel": "Laddar data ...", "SearchFor": "Sök efter:", "SearchButtonText": "Sök", "SearchDescription": "Sök efter kunder från LOB Systemet", "ListButtonText": "Lista kunder", "ListDescription": "Lista kunder från LOB Systemet", "CustomerIDColumn": "KundID", "CustomerIDColumnAriaLabel": "KundID", "CompanyNameColumn": "Företag", "CompanyNameColumnAriaLabel": "Företag", "ContactNameColumn": "Kontakt", "ContactNameColumnAriaLabel": "Kontakt", "CountryColumn": "Land", "CountryColumnAriaLabel": "Land", } }); ================================================ FILE: source/react-lob-integration/src/webparts/lobIntegration/loc/tr-tr.js ================================================ define([], function() { return { "PropertyPaneDescription": "LOB Entegrasyon", "BasicGroupName": "Genel Ayarlar", "ApplicationUriFieldLabel": "Application URI", "FunctionUriFieldLabel": "Fonksiyon URI", "ServiceUrlFieldLabel": "Service Url", "PlaceholderIconName":"Düzenle", "PlaceholderIconText":"Web bölümünü yapılandır", "PlaceholderDescription":"Lütfen web bölümünü yapılandırın.", "PlaceholderButtonLabel":"Yapılandır", "LoadingDataLabel": "Veri yükleniyor ...", "SearchFor": "Arama:", "SearchButtonText": "Ara", "SearchDescription": "LOB Sisteminden Müşterileri Arayın", "ListButtonText": "Müşterileri Listele", "ListDescription": "LOB Sisteminden Müşterileri Listele", "CustomerIDColumn": "Müşteri Kimliği", "CustomerIDColumnAriaLabel": "Müşteri Kimliği", "CompanyNameColumn": "Şirket", "CompanyNameColumnAriaLabel": "Şirket", "ContactNameColumn": "Yetkili", "ContactNameColumnAriaLabel": "Yetkili", "CountryColumn": "Ülke", "CountryColumnAriaLabel": "Ülke", } }); ================================================ FILE: source/react-lob-integration/tsconfig.json ================================================ { "extends": "./node_modules/@microsoft/rush-stack-compiler-4.5/includes/tsconfig-web.json", "compilerOptions": { "target": "es5", "forceConsistentCasingInFileNames": true, "module": "esnext", "moduleResolution": "node", "jsx": "react", "declaration": true, "sourceMap": true, "experimentalDecorators": true, "skipLibCheck": true, "outDir": "lib", "inlineSources": false, "strictNullChecks": false, "noImplicitAny": true, "typeRoots": [ "./node_modules/@types", "./node_modules/@microsoft" ], "types": [ "webpack-env" ], "lib": [ "es5", "dom", "es2015.collection", "es2015.promise" ] }, "include": [ "src/**/*.ts", "src/**/*.tsx" ] } ================================================ FILE: source/react-people-directory/.eslintrc.js ================================================ require('@rushstack/eslint-config/patch/modern-module-resolution'); module.exports = { extends: ['@microsoft/eslint-config-spfx/lib/profiles/react'], parserOptions: { tsconfigRootDir: __dirname }, overrides: [ { files: ['*.ts', '*.tsx'], parser: '@typescript-eslint/parser', 'parserOptions': { 'project': './tsconfig.json', 'ecmaVersion': 2018, 'sourceType': 'module' }, rules: { // Prevent usage of the JavaScript null value, while allowing code to access existing APIs that may require null. https://www.npmjs.com/package/@rushstack/eslint-plugin '@rushstack/no-new-null': 1, // Require Jest module mocking APIs to be called before any other statements in their code block. https://www.npmjs.com/package/@rushstack/eslint-plugin '@rushstack/hoist-jest-mock': 1, // Require regular expressions to be constructed from string constants rather than dynamically building strings at runtime. https://www.npmjs.com/package/@rushstack/eslint-plugin-security '@rushstack/security/no-unsafe-regexp': 1, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/adjacent-overload-signatures': 1, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // // CONFIGURATION: By default, these are banned: String, Boolean, Number, Object, Symbol '@typescript-eslint/ban-types': [ 1, { 'extendDefaults': false, 'types': { 'String': { 'message': 'Use \'string\' instead', 'fixWith': 'string' }, 'Boolean': { 'message': 'Use \'boolean\' instead', 'fixWith': 'boolean' }, 'Number': { 'message': 'Use \'number\' instead', 'fixWith': 'number' }, 'Object': { 'message': 'Use \'object\' instead, or else define a proper TypeScript type:' }, 'Symbol': { 'message': 'Use \'symbol\' instead', 'fixWith': 'symbol' }, 'Function': { 'message': 'The \'Function\' type accepts any function-like value.\nIt provides no type safety when calling the function, which can be a common source of bugs.\nIt also accepts things like class declarations, which will throw at runtime as they will not be called with \'new\'.\nIf you are expecting the function to accept certain arguments, you should explicitly define the function shape.' } } } ], // RATIONALE: Code is more readable when the type of every variable is immediately obvious. // Even if the compiler may be able to infer a type, this inference will be unavailable // to a person who is reviewing a GitHub diff. This rule makes writing code harder, // but writing code is a much less important activity than reading it. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/explicit-function-return-type': [ 0, { 'allowExpressions': true, 'allowTypedFunctionExpressions': true, 'allowHigherOrderFunctions': false } ], // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // Rationale to disable: although this is a recommended rule, it is up to dev to select coding style. // Set to 1 (warning) or 2 (error) to enable. '@typescript-eslint/explicit-member-accessibility': 0, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/no-array-constructor': 1, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // // RATIONALE: The "any" keyword disables static type checking, the main benefit of using TypeScript. // This rule should be suppressed only in very special cases such as JSON.stringify() // where the type really can be anything. Even if the type is flexible, another type // may be more appropriate such as "unknown", "{}", or "Record". '@typescript-eslint/no-explicit-any': 0, // RATIONALE: The #1 rule of promises is that every promise chain must be terminated by a catch() // handler. Thus wherever a Promise arises, the code must either append a catch handler, // or else return the object to a caller (who assumes this responsibility). Unterminated // promise chains are a serious issue. Besides causing errors to be silently ignored, // they can also cause a NodeJS process to terminate unexpectedly. '@typescript-eslint/no-floating-promises': 2, // RATIONALE: Catches a common coding mistake. '@typescript-eslint/no-for-in-array': 2, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/no-misused-new': 2, // RATIONALE: The "namespace" keyword is not recommended for organizing code because JavaScript lacks // a "using" statement to traverse namespaces. Nested namespaces prevent certain bundler // optimizations. If you are declaring loose functions/variables, it's better to make them // static members of a class, since classes support property getters and their private // members are accessible by unit tests. Also, the exercise of choosing a meaningful // class name tends to produce more discoverable APIs: for example, search+replacing // the function "reverse()" is likely to return many false matches, whereas if we always // write "Text.reverse()" is more unique. For large scale organization, it's recommended // to decompose your code into separate NPM packages, which ensures that component // dependencies are tracked more conscientiously. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/no-namespace': [ 1, { 'allowDeclarations': false, 'allowDefinitionFiles': false } ], // RATIONALE: Parameter properties provide a shorthand such as "constructor(public title: string)" // that avoids the effort of declaring "title" as a field. This TypeScript feature makes // code easier to write, but arguably sacrifices readability: In the notes for // "@typescript-eslint/member-ordering" we pointed out that fields are central to // a class's design, so we wouldn't want to bury them in a constructor signature // just to save some typing. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // Set to 1 (warning) or 2 (error) to enable the rule '@typescript-eslint/no-parameter-properties': 0, // RATIONALE: When left in shipping code, unused variables often indicate a mistake. Dead code // may impact performance. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/no-unused-vars': [ 1, { 'vars': 'all', // Unused function arguments often indicate a mistake in JavaScript code. However in TypeScript code, // the compiler catches most of those mistakes, and unused arguments are fairly common for type signatures // that are overriding a base class method or implementing an interface. 'args': 'none' } ], // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/no-use-before-define': [ 2, { 'functions': false, 'classes': true, 'variables': true, 'enums': true, 'typedefs': true } ], // Disallows require statements except in import statements. // In other words, the use of forms such as var foo = require("foo") are banned. Instead use ES6 style imports or import foo = require("foo") imports. '@typescript-eslint/no-var-requires': 'error', // RATIONALE: The "module" keyword is deprecated except when describing legacy libraries. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/prefer-namespace-keyword': 1, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // Rationale to disable: it's up to developer to decide if he wants to add type annotations // Set to 1 (warning) or 2 (error) to enable the rule '@typescript-eslint/no-inferrable-types': 0, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // Rationale to disable: declaration of empty interfaces may be helpful for generic types scenarios '@typescript-eslint/no-empty-interface': 0, // RATIONALE: This rule warns if setters are defined without getters, which is probably a mistake. 'accessor-pairs': 1, // RATIONALE: In TypeScript, if you write x["y"] instead of x.y, it disables type checking. 'dot-notation': [ 1, { 'allowPattern': '^_' } ], // RATIONALE: Catches code that is likely to be incorrect 'eqeqeq': 0, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'for-direction': 1, // RATIONALE: Catches a common coding mistake. 'guard-for-in': 2, // RATIONALE: If you have more than 2,000 lines in a single source file, it's probably time // to split up your code. 'max-lines': ['warn', { max: 2000 }], // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-async-promise-executor': 2, // RATIONALE: Deprecated language feature. 'no-caller': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-compare-neg-zero': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-cond-assign': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-constant-condition': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-control-regex': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-debugger': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-delete-var': 2, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-duplicate-case': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-empty': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-empty-character-class': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-empty-pattern': 1, // RATIONALE: Eval is a security concern and a performance concern. 'no-eval': 1, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-ex-assign': 2, // RATIONALE: System types are global and should not be tampered with in a scalable code base. // If two different libraries (or two versions of the same library) both try to modify // a type, only one of them can win. Polyfills are acceptable because they implement // a standardized interoperable contract, but polyfills are generally coded in plain // JavaScript. 'no-extend-native': 1, // Disallow unnecessary labels 'no-extra-label': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-fallthrough': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-func-assign': 1, // RATIONALE: Catches a common coding mistake. 'no-implied-eval': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-invalid-regexp': 2, // RATIONALE: Catches a common coding mistake. 'no-label-var': 2, // RATIONALE: Eliminates redundant code. 'no-lone-blocks': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-misleading-character-class': 2, // RATIONALE: Catches a common coding mistake. 'no-multi-str': 2, // RATIONALE: It's generally a bad practice to call "new Thing()" without assigning the result to // a variable. Either it's part of an awkward expression like "(new Thing()).doSomething()", // or else implies that the constructor is doing nontrivial computations, which is often // a poor class design. 'no-new': 1, // RATIONALE: Obsolete language feature that is deprecated. 'no-new-func': 2, // RATIONALE: Obsolete language feature that is deprecated. 'no-new-object': 2, // RATIONALE: Obsolete notation. 'no-new-wrappers': 1, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-octal': 2, // RATIONALE: Catches code that is likely to be incorrect 'no-octal-escape': 2, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-regex-spaces': 2, // RATIONALE: Catches a common coding mistake. 'no-return-assign': 2, // RATIONALE: Security risk. 'no-script-url': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-self-assign': 2, // RATIONALE: Catches a common coding mistake. 'no-self-compare': 2, // RATIONALE: This avoids statements such as "while (a = next(), a && a.length);" that use // commas to create compound expressions. In general code is more readable if each // step is split onto a separate line. This also makes it easier to set breakpoints // in the debugger. 'no-sequences': 1, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-shadow-restricted-names': 2, // RATIONALE: Obsolete language feature that is deprecated. // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-sparse-arrays': 2, // RATIONALE: Although in theory JavaScript allows any possible data type to be thrown as an exception, // such flexibility adds pointless complexity, by requiring every catch block to test // the type of the object that it receives. Whereas if catch blocks can always assume // that their object implements the "Error" contract, then the code is simpler, and // we generally get useful additional information like a call stack. 'no-throw-literal': 2, // RATIONALE: Catches a common coding mistake. 'no-unmodified-loop-condition': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-unsafe-finally': 2, // RATIONALE: Catches a common coding mistake. 'no-unused-expressions': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-unused-labels': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-useless-catch': 1, // RATIONALE: Avoids a potential performance problem. 'no-useless-concat': 1, // RATIONALE: The "var" keyword is deprecated because of its confusing "hoisting" behavior. // Always use "let" or "const" instead. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json 'no-var': 0, // RATIONALE: Generally not needed in modern code. 'no-void': 1, // RATIONALE: Obsolete language feature that is deprecated. // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-with': 2, // RATIONALE: Makes logic easier to understand, since constants always have a known value // @typescript-eslint\eslint-plugin\dist\configs\eslint-recommended.js 'prefer-const': 0, // RATIONALE: Catches a common coding mistake where "resolve" and "reject" are confused. 'promise/param-names': 2, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'require-atomic-updates': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'require-yield': 1, // "Use strict" is redundant when using the TypeScript compiler. 'strict': [ 2, 'never' ], // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'use-isnan': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js // Set to 1 (warning) or 2 (error) to enable. // Rationale to disable: !!{} 'no-extra-boolean-cast': 0, // ==================================================================== // @microsoft/eslint-plugin-spfx // ==================================================================== '@microsoft/spfx/import-requires-chunk-name': 1, '@microsoft/spfx/no-require-ensure': 2, '@microsoft/spfx/pair-react-dom-render-unmount': 1, // ==================================================================== // self-closing-comp // ==================================================================== 'self-closing-comp': 0, // ==================================================================== // react/self-closing-comp // ==================================================================== 'react/self-closing-comp': 0, // ==================================================================== // prefer-spread // ==================================================================== 'prefer-spread': 0 } }, { // For unit tests, we can be a little bit less strict. The settings below revise the // defaults specified in the extended configurations, as well as above. files: [ // Test files '*.test.ts', '*.test.tsx', '*.spec.ts', '*.spec.tsx', // Facebook convention '**/__mocks__/*.ts', '**/__mocks__/*.tsx', '**/__tests__/*.ts', '**/__tests__/*.tsx', // Microsoft convention '**/test/*.ts', '**/test/*.tsx' ], rules: {} } ] }; ================================================ FILE: source/react-people-directory/.gitignore ================================================ # Logs logs *.log npm-debug.log* # Dependency directories node_modules # Build generated files dist lib release solution temp *.sppkg .heft # Coverage directory used by tools like istanbul coverage # OSX .DS_Store # Visual Studio files .ntvs_analysis.dat .vs bin obj # Resx Generated Code *.resx.ts # Styles Generated Code *.scss.ts ================================================ FILE: source/react-people-directory/.npmignore ================================================ !dist config gulpfile.js release src temp tsconfig.json tslint.json *.log .yo-rc.json .vscode ================================================ FILE: source/react-people-directory/.vscode/launch.json ================================================ { "version": "0.2.0", "configurations": [ { "name": "Hosted workbench", "type": "pwa-chrome", "request": "launch", "url": "https://enter-your-SharePoint-site/_layouts/workbench.aspx", "webRoot": "${workspaceRoot}", "sourceMaps": true, "sourceMapPathOverrides": { "webpack:///.././src/*": "${webRoot}/src/*", "webpack:///../../../src/*": "${webRoot}/src/*", "webpack:///../../../../src/*": "${webRoot}/src/*", "webpack:///../../../../../src/*": "${webRoot}/src/*" }, "runtimeArgs": [ "--remote-debugging-port=9222", "-incognito" ] } ] } ================================================ FILE: source/react-people-directory/.vscode/settings.json ================================================ // Place your settings in this file to overwrite default and user settings. { // Configure glob patterns for excluding files and folders in the file explorer. "files.exclude": { "**/.git": true, "**/.DS_Store": true, "**/bower_components": true, "**/coverage": true, "**/lib-amd": true, "src/**/*.scss.ts": true }, "typescript.tsdk": ".\\node_modules\\typescript\\lib" } ================================================ FILE: source/react-people-directory/.yo-rc.json ================================================ { "@microsoft/generator-sharepoint": { "plusBeta": false, "isCreatingSolution": true, "nodeVersion": "16.19.0", "sdksVersions": { "@microsoft/microsoft-graph-client": "3.0.2", "@microsoft/teams-js": "2.4.1" }, "version": "1.16.1", "environment": "spo", "libraryName": "react-people-directory", "libraryId": "bf076fcb-c67e-4b89-b1ff-2ab5242945c5", "packageManager": "npm", "isDomainIsolated": false, "componentType": "webpart" } } ================================================ FILE: source/react-people-directory/README.md ================================================ # People Directory web part This web part provides you the ability to add a searchable people directory. A people search box and alphabet list are provided to enable both searching by name as well as selecting a specific letter. This web part requires no configuration and utilizes the people search API to surface people results, i.e. `/_api/search/query`. ![People Directory](../../assets/images/components/part-people-directory.gif) ## How to use this web part on your web pages 1. Place the page you want to add this web part to in edit mode. 2. Search for and insert the **People Directory** web part. 3. Configure the webpart to update its properties. ## Configurable Properties The `People Directory` web part can be configured with the following properties: | Label | Property | Type | Required | Description | | ---- | ---- | ---- | ---- | ---- | | Web part title | title | string | no | The web part title, editable inline with the web part itself | ## Used SharePoint Framework Version ![drop](https://img.shields.io/badge/version-1.16.1-green.svg) * Supported in SharePoint Online ## Applies to * [SharePoint Framework](https://learn.microsoft.com/en-us/sharepoint/dev/spfx/sharepoint-framework-overview) * [Office 365 tenant](https://learn.microsoft.com/en-us/sharepoint/dev/spfx/set-up-your-development-environment) ## Prerequisites none ## Solution Solution|Author(s) --------|--------- react-people-directory | Waldek Mastykarz react-people-directory | David Warner II react-people-directory | Don Kirkham react-people-directory | Chandani Prajapati ## Version history Version|Date|Comments -------|----|-------- 1.0|March 27, 2018|Initial release 2.0|December 3, 2019|v2.0 2.1|February 7, 2022|Upgrade solution to SPFx v1.13.1 2.2|February 10, 2022|Adjust controls to be responsive 3.0|February 2023|Initial release for SharePoint Starter Kit v3 (Upgraded to SPFx 1.16.1) ## Disclaimer **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.** --- ## Minimal Path to Awesome * Clone this repository * Move to solution folder * in the command line run: * `npm install` * `gulp serve` > Include any additional steps as needed. ## Features Description of the web part with possible additional details than in short summary. This Web Part illustrates the following concepts on top of the SharePoint Framework: * SharePoint Search API * PnP React Controls * Fluint UI Controls ================================================ FILE: source/react-people-directory/config/config.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/config.2.0.schema.json", "version": "2.0", "bundles": { "people-directory-web-part": { "components": [ { "entrypoint": "./lib/webparts/peopleDirectory/PeopleDirectoryWebPart.js", "manifest": "./src/webparts/peopleDirectory/PeopleDirectoryWebPart.manifest.json" } ] } }, "externals": {}, "localizedResources": { "PeopleDirectoryWebPartStrings": "lib/webparts/peopleDirectory/loc/{locale}.js", "ControlStrings": "node_modules/@pnp/spfx-controls-react/lib/loc/{locale}.js" } } ================================================ FILE: source/react-people-directory/config/deploy-azure-storage.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/deploy-azure-storage.schema.json", "workingDir": "./release/assets/", "account": "", "container": "react-people-directory", "accessKey": "" } ================================================ FILE: source/react-people-directory/config/package-solution.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/package-solution.schema.json", "solution": { "name": "Starter Kit - People Directory", "id": "bf076fcb-c67e-4b89-b1ff-2ab5242945c5", "version": "3.0.0.0", "developer": { "name": "PnP Starter Kit", "privacyUrl": "", "termsOfUseUrl": "", "websiteUrl": "", "mpnId": "pnpsk" }, "metadata": { "shortDescription": { "default": "react-people-directory description" }, "longDescription": { "default": "react-people-directory description" }, "screenshotPaths": [], "videoUrl": "", "categories": [] }, "features": [ { "title": "Starter Kit - People Directory WebPart Feature", "description": "The feature that activates People Directory WebPart from the Starter Kit - People Directory solution.", "id": "52b26049-6e2e-4302-8258-e9f8861a881f", "version": "3.0.0.0", "componentIds": [ "52b26049-6e2e-4302-8258-e9f8861a881f" ] } ], "includeClientSideAssets": true, "skipFeatureDeployment": true, "isDomainIsolated": false }, "paths": { "zippedPackage": "solution/react-people-directory.sppkg" } } ================================================ FILE: source/react-people-directory/config/sass.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/core-build/sass.schema.json" } ================================================ FILE: source/react-people-directory/config/serve.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/spfx-serve.schema.json", "port": 4321, "https": true, "initialPage": "https://enter-your-SharePoint-site/_layouts/workbench.aspx" } ================================================ FILE: source/react-people-directory/config/write-manifests.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/write-manifests.schema.json", "cdnBasePath": "" } ================================================ FILE: source/react-people-directory/gulpfile.js ================================================ 'use strict'; const build = require('@microsoft/sp-build-web'); build.addSuppression(`Warning - [sass] The local CSS class 'ms-Grid' is not camelCase and will not be type-safe.`); var getTasks = build.rig.getTasks; build.rig.getTasks = function () { var result = getTasks.call(build.rig); result.set('serve', result.get('serve-deprecated')); return result; }; build.initialize(require('gulp')); ================================================ FILE: source/react-people-directory/package.json ================================================ { "name": "react-people-directory", "version": "3.0.0", "private": true, "main": "lib/index.js", "engines": { "node": ">=16.13.0 <17.0.0" }, "scripts": { "build": "gulp bundle", "clean": "gulp clean", "test": "gulp test" }, "dependencies": { "@microsoft/sp-core-library": "1.16.1", "@microsoft/sp-lodash-subset": "1.16.1", "@microsoft/sp-office-ui-fabric-core": "1.16.1", "@microsoft/sp-property-pane": "1.16.1", "@microsoft/sp-webpart-base": "1.16.1", "@pnp/spfx-controls-react": "3.12.0", "react": "17.0.1", "react-dom": "17.0.1", "tslib": "2.3.1" }, "resolutions": { "@types/react": "16.8.8" }, "devDependencies": { "@microsoft/eslint-config-spfx": "1.16.1", "@microsoft/eslint-plugin-spfx": "1.16.1", "@microsoft/rush-stack-compiler-4.5": "0.2.2", "@microsoft/sp-build-web": "1.16.1", "@microsoft/sp-module-interfaces": "1.16.1", "@rushstack/eslint-config": "2.5.1", "@types/react": "17.0.45", "@types/react-dom": "17.0.17", "@types/webpack-env": "~1.15.2", "ajv": "^6.12.5", "eslint-plugin-react-hooks": "4.3.0", "gulp": "4.0.2", "typescript": "4.5.5" } } ================================================ FILE: source/react-people-directory/src/index.ts ================================================ // A file is required to be in the root of the /src directory by the TypeScript compiler ================================================ FILE: source/react-people-directory/src/webparts/peopleDirectory/PeopleDirectoryWebPart.manifest.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx/client-side-web-part-manifest.schema.json", "id": "52b26049-6e2e-4302-8258-e9f8861a881f", "alias": "PeopleDirectoryWebPart", "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, "supportedHosts": ["SharePointWebPart", "SharePointFullPage", "TeamsTab", "TeamsPersonalApp"], "preconfiguredEntries": [{ "groupId": "5c03119e-3074-46fd-976b-c60198311f70", // Other "group": { "default": "Other" }, "title": { "default": "People Directory" }, "description": { "default": "Search people in the corporate directory" }, "officeFabricIconFontName": "CompanyDirectory", "properties": { "title": "People Directory" } }] } ================================================ FILE: source/react-people-directory/src/webparts/peopleDirectory/PeopleDirectoryWebPart.ts ================================================ import * as React from 'react'; import * as ReactDom from 'react-dom'; import { Version } from '@microsoft/sp-core-library'; import { BaseClientSideWebPart } from "@microsoft/sp-webpart-base"; import { IPropertyPaneConfiguration } from "@microsoft/sp-property-pane"; import { PeopleDirectory, IPeopleDirectoryProps } from './components/PeopleDirectory/'; export interface IPeopleDirectoryWebPartProps { title: string; } export default class PeopleDirectoryWebPart extends BaseClientSideWebPart { protected onInit(): Promise { document.documentElement.style .setProperty('--maxPersonaWidth', this.width > 640 ? "50%" : "100"); return Promise.resolve(); } protected onAfterResize(newWidth: number) { console.log("New web part width: " + newWidth); document.documentElement.style .setProperty('--maxPersonaWidth', newWidth > 640 ? "50%" : "100"); } public render(): void { const element: React.ReactElement = React.createElement( PeopleDirectory, { webUrl: this.context.pageContext.web.absoluteUrl, spHttpClient: this.context.spHttpClient, title: this.properties.title, displayMode: this.displayMode, locale: this.getLocaleId(), onTitleUpdate: (newTitle: string) => { // after updating the web part title in the component // persist it in web part properties this.properties.title = newTitle; } } ); ReactDom.render(element, this.domElement); } protected onDispose(): void { ReactDom.unmountComponentAtNode(this.domElement); } protected get dataVersion(): Version { return Version.parse('1.0'); } protected getLocaleId(): string { return this.context.pageContext.cultureInfo.currentUICultureName; } protected getPropertyPaneConfiguration(): IPropertyPaneConfiguration { return { pages: [] }; } } ================================================ FILE: source/react-people-directory/src/webparts/peopleDirectory/components/IndexNavigation/IIndexNavigationProps.ts ================================================ /** * Properties for the index navigation component */ export interface IIndexNavigationProps { /** * Name of the currently selected tab, eg. 'A' */ selectedIndex: string; /** * Current search query. Empty, if not searching. */ searchQuery: string; /** * Current locale */ locale: string; /** * Event handler for selecting a tab */ onIndexSelect: (index: string) => void; /** * Event handler for issuing a search query */ onSearch: (searchQuery: string) => void; /** * Event handler for clearing the search query */ onSearchClear: () => void; } ================================================ FILE: source/react-people-directory/src/webparts/peopleDirectory/components/IndexNavigation/IndexNavigation.module.scss ================================================ @import '~@fluentui/react/dist/sass/References.scss'; .indexNavigation { margin-bottom: 1em; div[role^='tablist'] { white-space: normal; button:last-child { font-weight: 600; } } [class^='ms-SearchBox'] { max-width: 100%; } } ================================================ FILE: source/react-people-directory/src/webparts/peopleDirectory/components/IndexNavigation/IndexNavigation.tsx ================================================ import * as React from 'react'; import styles from './IndexNavigation.module.scss'; import { IIndexNavigationProps } from '.'; import { Search } from '../Search'; import { Pivot, PivotItem } from '@fluentui/react/lib/Pivot'; import * as strings from 'PeopleDirectoryWebPartStrings'; export class IndexNavigation extends React.Component { /** * Event handler for selecting a tab in the navigation */ private _handleIndexSelect = (item?: PivotItem, ev?: React.MouseEvent): void => { this.props.onIndexSelect(item.props.linkText); } public shouldComponentUpdate(nextProps: IIndexNavigationProps, nextState: {}, nextContext: any): boolean { // Component should update only if the selected tab has changed. // This check helps to avoid unnecessary renders return this.props.selectedIndex !== nextProps.selectedIndex; } public render(): React.ReactElement { // build the list of alphabet letters A..Z const az = Array.apply(null, { length: 26 }).map((x: string, i: number): string => { return String.fromCharCode(65 + i); }); if (this.props.locale === "sv-SE") { az.push('Å', 'Ä', 'Ö'); } // for each letter, create a PivotItem component const indexes: JSX.Element[] = az.map((index: any) => ); // as the last tab in the navigation, add the Search option indexes.push( ); return (
{indexes}
); } } ================================================ FILE: source/react-people-directory/src/webparts/peopleDirectory/components/IndexNavigation/index.ts ================================================ export * from './IIndexNavigationProps'; export * from './IndexNavigation'; ================================================ FILE: source/react-people-directory/src/webparts/peopleDirectory/components/PeopleCallout/IPeopleCalloutProps.ts ================================================ import { IPerson } from "../PeopleDirectory"; export interface IPeopleCalloutProps { person: IPerson; } ================================================ FILE: source/react-people-directory/src/webparts/peopleDirectory/components/PeopleCallout/IPeopleCalloutState.ts ================================================ export interface IPeopleCalloutState { } ================================================ FILE: source/react-people-directory/src/webparts/peopleDirectory/components/PeopleCallout/PeopleCallout.module.scss ================================================ @import '~@fluentui/react/dist/sass/References.scss'; $neutralLight: "[theme:neutralLight, default: #eaeaea]"; .calloutCard{ padding: 1rem; h1{ border-bottom: 1px solid $neutralLight; margin: 0; margin-bottom: .5rem; padding-bottom: 1rem; } } .PeopleCallout{ list-style: none; margin: 0; max-width: 18rem; padding-left: 0; .info{ padding: .5rem 0; } li{ align-items: center; display: flex; position: relative; &.fl_column{ align-items: flex-start; flex-direction: column; } a{ outline: none; display: block; padding-right: 1rem; width: 100%; &:hover{ + .clipboard{ opacity: 1; transform: translateX(1rem); transition: .3s opacity cubic-bezier(0.165, 0.84, 0.44, 1), .3s transform cubic-bezier(0.165, 0.84, 0.44, 1); will-change: opacity, transform; } } } i{ display: inline-flex; cursor: pointer; margin-right: .5rem; position: relative; &.clipboard{ border: 1px solid "[theme:themePrimary, default: #0078d7]"; background-color: white; border-radius: 100%; cursor: pointer; opacity: 0; padding: .75rem; position: absolute; right: 0; transform: translateX(0); transition: .3s opacity cubic-bezier(0.165, 0.84, 0.44, 1), .3s transform cubic-bezier(0.165, 0.84, 0.44, 1); top: 0; will-change: opacity, transform; &:hover{ opacity: 1; transform: translateX(1rem); transition: .3s opacity cubic-bezier(0.165, 0.84, 0.44, 1), .3s transform cubic-bezier(0.165, 0.84, 0.44, 1); will-change: opacity, transform; } } } } } ================================================ FILE: source/react-people-directory/src/webparts/peopleDirectory/components/PeopleCallout/PeopleCallout.tsx ================================================ import * as React from 'react'; import { IPeopleCalloutProps, IPeopleCalloutState } from '.'; import styles from './PeopleCallout.module.scss'; import * as strings from 'PeopleDirectoryWebPartStrings'; export class PeopleCallout extends React.Component { constructor(props: IPeopleCalloutProps) { super(props); this.state = { }; } public render(): React.ReactElement { return (

{this.props.person.name}

    {this.props.person.function &&
  • {this.props.person.function}
  • } {this.props.person.department &&
  • {this.props.person.department}
  • } {this.props.person.email &&
  • {this.props.person.email}
  • } {this.props.person.phone &&
  • {this.props.person.phone}
  • } {this.props.person.mobile &&
  • {this.props.person.mobile}
  • } {this.props.person.projects &&
  • {this.props.person.projects}
  • } {this.props.person.skills &&
  • {this.props.person.skills}
  • }
); } private _onCopyClicked = (elementName: string) => (event: any) => { let copyText = document.getElementById(elementName); var range = document.createRange(); range.selectNode(copyText); window.getSelection().removeAllRanges(); window.getSelection().addRange(range); document.execCommand("copy"); window.getSelection().removeAllRanges(); event.target.className = "ms-Icon ms-Icon--StatusCircleCheckmark"; } } ================================================ FILE: source/react-people-directory/src/webparts/peopleDirectory/components/PeopleCallout/index.ts ================================================ export * from './IPeopleCalloutProps'; export * from './IPeopleCalloutState'; export * from './PeopleCallout'; ================================================ FILE: source/react-people-directory/src/webparts/peopleDirectory/components/PeopleDirectory/IPeopleDirectoryProps.ts ================================================ import { SPHttpClient } from "@microsoft/sp-http"; import { DisplayMode } from "@microsoft/sp-core-library"; /** * Properties for the people directory component */ export interface IPeopleDirectoryProps { /** * Absolute URL of the current site */ webUrl: string; /** * Instance of the SPHttpClient. Used to retrieve information about * people. */ spHttpClient: SPHttpClient; /** * Web part title to be displayed in the web part */ title: string; /** * Current page display mode. Used to determine if the user should * be able to edit the page title or not. */ displayMode: DisplayMode; /** * Current locale */ locale: string; /** * Event handler for changing the web part title */ onTitleUpdate: (newTitle: string) => void; } ================================================ FILE: source/react-people-directory/src/webparts/peopleDirectory/components/PeopleDirectory/IPeopleDirectoryState.ts ================================================ import { IPerson } from "."; /** * State for the people directory component */ export interface IPeopleDirectoryState { /** * True if the component is loading its data, false otherwise */ loading: boolean; /** * Contains the error message that occurred while loading the data. * If no error message occurred, null. */ errorMessage: string; /** * Currently selected tab, eg. 'A' */ selectedIndex: string; /** * Current search query. Empty string if no search query has been issued */ searchQuery: string; /** * List of people matching either the currently selected tab or the * search query. Empty array if no matching people found. */ people: IPerson[]; } ================================================ FILE: source/react-people-directory/src/webparts/peopleDirectory/components/PeopleDirectory/IPeopleSearchResults.ts ================================================ /** * Interface describing people search results coming from SharePoint Search */ export interface IPeopleSearchResults { PrimaryQueryResult: { RelevantResults: { RowCount: number; Table: { Rows: { Cells: ICell[]; }[]; }; TotalRows: number; }; }; error?: { code: string; message: string; }; } export interface ICell { Key: string; Value: string; ValueType: string; } ================================================ FILE: source/react-people-directory/src/webparts/peopleDirectory/components/PeopleDirectory/IPerson.ts ================================================ export interface IPerson { name: string; firstName: string; lastName: string; phone: string; mobile: string; email: string; photoUrl: string; function: string; department: string; skills: string; projects: string; } ================================================ FILE: source/react-people-directory/src/webparts/peopleDirectory/components/PeopleDirectory/PeopleDirectory.module.scss ================================================ @import '~@fluentui/react/dist/sass/References.scss'; .peopleDirectory { .container { max-width: 700px; margin: 0px auto; box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.2), 0 25px 50px 0 rgba(0, 0, 0, 0.1); } .row { @include ms-Grid-row; @include ms-fontColor-white; background-color: $ms-color-themeDark; padding: 20px; } .column { @include ms-Grid-col; @include ms-lg10; @include ms-xl8; @include ms-xlPush2; @include ms-lgPush1; } .title { @include ms-font-xl; @include ms-fontColor-white; } .subTitle { @include ms-font-l; @include ms-fontColor-white; } .description { @include ms-font-l; @include ms-fontColor-white; } .button { // Our button text-decoration: none; height: 32px; // Primary Button min-width: 80px; background-color: $ms-color-themePrimary; border-color: $ms-color-themePrimary; color: $ms-color-white; // Basic Button outline: transparent; position: relative; font-family: "Segoe UI WestEuropean","Segoe UI",-apple-system,BlinkMacSystemFont,Roboto,"Helvetica Neue",sans-serif; -webkit-font-smoothing: antialiased; font-size: $ms-font-size-m; font-weight: $ms-font-weight-regular; border-width: 0; text-align: center; cursor: pointer; display: inline-block; padding: 0 16px; .label { font-weight: $ms-font-weight-semibold; font-size: $ms-font-size-m; height: 32px; line-height: 32px; margin: 0 4px; vertical-align: top; display: inline-block; } } } ================================================ FILE: source/react-people-directory/src/webparts/peopleDirectory/components/PeopleDirectory/PeopleDirectory.tsx ================================================ import * as React from 'react'; import { SPHttpClient, SPHttpClientResponse } from '@microsoft/sp-http'; import styles from './PeopleDirectory.module.scss'; import { Spinner, SpinnerSize } from '@fluentui/react/lib/Spinner'; import { MessageBar, MessageBarType } from '@fluentui/react/lib/MessageBar'; import { WebPartTitle } from "@pnp/spfx-controls-react/lib/WebPartTitle"; import { IPeopleDirectoryProps, IPeopleDirectoryState, IPeopleSearchResults, IPerson, ICell } from '.'; import { IndexNavigation } from '../IndexNavigation'; import { PeopleList } from '../PeopleList'; import * as strings from 'PeopleDirectoryWebPartStrings'; export class PeopleDirectory extends React.Component { constructor(props: IPeopleDirectoryProps) { super(props); this.state = { loading: false, errorMessage: null, selectedIndex: 'A', searchQuery: '', people: [] }; } private _handleIndexSelect = (index: string): void => { // switch the current tab to the tab selected in the navigation // and reset the search query this.setState({ selectedIndex: index, searchQuery: '' }, function () { // load information about people matching the selected tab this._loadPeopleInfo(index, null); }); } private _handleSearch = (searchQuery: string): void => { // activate the Search tab in the navigation and set the // specified text as the current search query this.setState({ selectedIndex: 'Search', searchQuery: searchQuery }, function () { // load information about people matching the specified search query this._loadPeopleInfo(null, searchQuery); }); } private _handleSearchClear = (): void => { // activate the A tab in the navigation and clear the previous search query this.setState({ selectedIndex: 'A', searchQuery: '' }, function () { // load information about people whose last name begins with A this._loadPeopleInfo('A', null); }); } /** * Loads information about people using SharePoint Search * @param index Selected tab in the index navigation or 'Search', if the user is searching * @param searchQuery Current search query or empty string if not searching */ private _loadPeopleInfo(index: string, searchQuery: string): void { // update the UI notifying the user that the component will now load its data // clear any previously set error message and retrieved list of people this.setState({ loading: true, errorMessage: null, people: [] }); const headers: HeadersInit = new Headers(); // suppress metadata to minimize the amount of data loaded from SharePoint headers.append("accept", "application/json;odata.metadata=none"); // if no search query has been specified, retrieve people whose last name begins with the // specified letter. if a search query has been specified, escape any ' (single quotes) // by replacing them with two '' (single quotes). Without this, the search query would fail let query: string = searchQuery === null ? `LastName:${index}*` : searchQuery.replace(/'/g, `''`); if (query.lastIndexOf('*') !== query.length - 1) { query += '*'; } // retrieve information about people using SharePoint People Search // sort results ascending by the last name this.props.spHttpClient .get(`${this.props.webUrl}/_api/search/query?querytext='${query}'&selectproperties='FirstName,LastName,PreferredName,WorkEmail,PictureURL,WorkPhone,MobilePhone,JobTitle,Department,Skills,PastProjects'&sortlist='LastName:ascending'&sourceid='b09a7990-05ea-4af9-81ef-edfab16c4e31'&rowlimit=500`, SPHttpClient.configurations.v1, { headers: headers }) .then((res: SPHttpClientResponse): Promise => { return res.json(); }) .then((res: IPeopleSearchResults): void => { if (res.error) { // There was an error loading information about people. // Notify the user that loading data is finished and return the // error message that occurred this.setState({ loading: false, errorMessage: res.error.message }); return; } if (res.PrimaryQueryResult.RelevantResults.TotalRows == 0) { // No results were found. Notify the user that loading data is finished this.setState({ loading: false }); return; } // convert the SharePoint People Search results to an array of people let people: IPerson[] = res.PrimaryQueryResult.RelevantResults.Table.Rows.map(r => { return { name: this._getValueFromSearchResult('PreferredName', r.Cells), firstName: this._getValueFromSearchResult('FirstName', r.Cells), lastName: this._getValueFromSearchResult('LastName', r.Cells), phone: this._getValueFromSearchResult('WorkPhone', r.Cells), mobile: this._getValueFromSearchResult('MobilePhone', r.Cells), email: this._getValueFromSearchResult('WorkEmail', r.Cells), photoUrl: `${this.props.webUrl}${"/_layouts/15/userphoto.aspx?size=M&accountname=" + this._getValueFromSearchResult('WorkEmail', r.Cells)}`, function: this._getValueFromSearchResult('JobTitle', r.Cells), department: this._getValueFromSearchResult('Department', r.Cells), skills: this._getValueFromSearchResult('Skills', r.Cells), projects: this._getValueFromSearchResult('PastProjects', r.Cells) }; }); const selectedIndex = this.state.selectedIndex; if (this.state.searchQuery === '') { // An Index is used to search people. //Reduce the people collection if the first letter of the lastName of the person is not equal to the selected index people = people.reduce((result: IPerson[], person: IPerson) => { if (person.lastName && person.lastName.indexOf(selectedIndex) === 0) { result.push(person); } return result; }, []); } if (people.length > 0) { // notify the user that loading the data is finished and return the loaded information this.setState({ loading: false, people: people }); } else { // People collection could be reduced to zero, so no results this.setState({ loading: false }); return; } }, (error: any): void => { // An error has occurred while loading the data. Notify the user // that loading data is finished and return the error message. this.setState({ loading: false, errorMessage: error }); }) .catch((error: any): void => { // An exception has occurred while loading the data. Notify the user // that loading data is finished and return the exception. this.setState({ loading: false, errorMessage: error }); }); } /** * Retrieves the value of the particular managed property for the current search result. * If the property is not found, returns an empty string. * @param key Name of the managed property to retrieve from the search result * @param cells The array of cells for the current search result */ private _getValueFromSearchResult(key: string, cells: ICell[]): string { for (let i: number = 0; i < cells.length; i++) { if (cells[i].Key === key) { return cells[i].Value; } } return ''; } public componentDidMount(): void { // load information about people after the component has been // initiated on the page this._loadPeopleInfo(this.state.selectedIndex, null); } public render(): React.ReactElement { const { loading, errorMessage, selectedIndex, searchQuery, people } = this.state; return (
{!loading && errorMessage && // if the component is not loading data anymore and an error message // has been returned, display the error message to the user {strings.ErrorLabel}: {errorMessage} } {loading && // if the component is loading its data, show the spinner } {!loading && !errorMessage && // if the component is not loading data anymore and no errors have occurred // render the list of retrieved people }
); } } ================================================ FILE: source/react-people-directory/src/webparts/peopleDirectory/components/PeopleDirectory/index.ts ================================================ export * from './IPeopleDirectoryProps'; export * from './IPeopleDirectoryState'; export * from './PeopleDirectory'; export * from './IPerson'; export * from './IPeopleSearchResults'; ================================================ FILE: source/react-people-directory/src/webparts/peopleDirectory/components/PeopleDirectory.module.scss ================================================ @import '~@fluentui/react/dist/sass/References.scss'; .peopleDirectory { .container { max-width: 700px; margin: 0px auto; box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.2), 0 25px 50px 0 rgba(0, 0, 0, 0.1); } .row { @include ms-Grid-row; @include ms-fontColor-white; background-color: $ms-color-themeDark; padding: 20px; } .column { @include ms-Grid-col; @include ms-lg10; @include ms-xl8; @include ms-xlPush2; @include ms-lgPush1; } .title { @include ms-font-xl; @include ms-fontColor-white; } .subTitle { @include ms-font-l; @include ms-fontColor-white; } .description { @include ms-font-l; @include ms-fontColor-white; } .button { // Our button text-decoration: none; height: 32px; // Primary Button min-width: 80px; background-color: $ms-color-themePrimary; border-color: $ms-color-themePrimary; color: $ms-color-white; // Basic Button outline: transparent; position: relative; font-family: "Segoe UI WestEuropean","Segoe UI",-apple-system,BlinkMacSystemFont,Roboto,"Helvetica Neue",sans-serif; -webkit-font-smoothing: antialiased; font-size: $ms-font-size-m; font-weight: $ms-font-weight-regular; border-width: 0; text-align: center; cursor: pointer; display: inline-block; padding: 0 16px; .label { font-weight: $ms-font-weight-semibold; font-size: $ms-font-size-m; height: 32px; line-height: 32px; margin: 0 4px; vertical-align: top; display: inline-block; } } } ================================================ FILE: source/react-people-directory/src/webparts/peopleDirectory/components/PeopleList/IPeopleListProps.ts ================================================ import { IPerson } from "../PeopleDirectory"; /** * Properties for the people list component */ export interface IPeopleListProps { /** * Array of people matching the selected tab or the current search query */ people: IPerson[]; /** * Currently selected tab, eg. 'A' */ selectedIndex: string; /** * True if the user is searching for people */ hasSearchQuery: boolean; } ================================================ FILE: source/react-people-directory/src/webparts/peopleDirectory/components/PeopleList/IPeopleListState.ts ================================================ import { IPerson } from "../PeopleDirectory"; export interface IPeopleListState { showCallOut: boolean; calloutElement: number; person: IPerson; } ================================================ FILE: source/react-people-directory/src/webparts/peopleDirectory/components/PeopleList/PeopleList.module.scss ================================================ @import '~@fluentui/react/dist/sass/References.scss'; .persona_card{ align-items: center; border: 1px solid "[theme:neutralLight, default: #eaeaea]"; display: flex; justify-content: space-between; margin-bottom: 1rem; padding: 1rem; position: relative; max-width: var(--maxPersonaWidth); // @media (min-width: $ms-screen-min-lg){ // max-width: 50%; // } .persona{ align-items: center; display: inline-flex; height: 1.4rem; justify-content: center; position: absolute; right: 1rem; width: 1.4rem; i{ color: "[theme:themeSecondary, default: #2b88d8]"; cursor: pointer; font-size: 1.4rem; } } .callout { display: hidden; } .calloutShow { display: block; } } ================================================ FILE: source/react-people-directory/src/webparts/peopleDirectory/components/PeopleList/PeopleList.tsx ================================================ import * as React from 'react'; import { IPeopleListProps } from '.'; import { Persona, PersonaSize } from '@fluentui/react/lib/Persona'; import * as strings from 'PeopleDirectoryWebPartStrings'; import styles from './PeopleList.module.scss'; import { Callout, DirectionalHint } from '@fluentui/react/lib/Callout'; import { IPeopleListState } from './IPeopleListState'; import { PeopleCallout } from '../PeopleCallout'; import { IPerson } from '../PeopleDirectory'; export class PeopleList extends React.Component { constructor(props: IPeopleListProps) { super(props); this.state = { showCallOut: false, calloutElement: null, person: null }; //this._onPersonaClicked = this._onPersonaClicked.bind(this); this._onCalloutDismiss = this._onCalloutDismiss.bind(this); } public render(): React.ReactElement { return (
{this.props.people.length === 0 && (this.props.selectedIndex !== 'Search' || (this.props.selectedIndex === 'Search' && this.props.hasSearchQuery)) && // Show the 'No people found' message if no people have been retrieved // and the user either selected a letter in the navigation or issued // a search query (but not when navigated to the Search tab without // providing a query yet)
{strings.NoPeopleFoundLabel}
} {this.props.people.length > 0 && // for each retrieved person, create a persona card with the retrieved // information //this.props.people.map(p => ) this.props.people.map((p,i) => { const phone: string = p.phone && p.mobile ? `${p.phone}/${p.mobile}`: p.phone ? p.phone: p.mobile; // const toggleClassName: string = this.state.toggleClass ? `ms-Icon--ChromeClose ${styles.isClose}` : "ms-Icon--ContactInfo"; return (
{ this.state.showCallOut && this.state.calloutElement === i && ( )}
); }) }
); } private _onPersonaClicked = (index: number, person: IPerson) => (_event: any) => { this.setState({ showCallOut: !this.state.showCallOut, calloutElement: index, person: person }); } private _onCalloutDismiss = (_event: any) => { this.setState({ showCallOut: false, }); } } ================================================ FILE: source/react-people-directory/src/webparts/peopleDirectory/components/PeopleList/index.ts ================================================ export * from './IPeopleListProps'; export * from './PeopleList'; ================================================ FILE: source/react-people-directory/src/webparts/peopleDirectory/components/Search/ISearchProps.ts ================================================ /** * Properties for the search component */ export interface ISearchProps { /** * Current search query */ searchQuery: string; /** * Event handler for issuing a search query */ onSearch: (searchQuery: string) => void; /** * Event handler for clearing the current search query */ onClear: () => void; } ================================================ FILE: source/react-people-directory/src/webparts/peopleDirectory/components/Search/Search.module.scss ================================================ @import '~@fluentui/react/dist/sass/References.scss'; .search { .searchBox { width: 30em; margin: 1em auto; } } ================================================ FILE: source/react-people-directory/src/webparts/peopleDirectory/components/Search/Search.tsx ================================================ import * as React from 'react'; import styles from './Search.module.scss'; import { ISearchProps } from '.'; import { SearchBox } from '@fluentui/react/lib/SearchBox'; import * as strings from 'PeopleDirectoryWebPartStrings'; export class Search extends React.Component { private _handleSearch = (searchQuery: string): void => { this.props.onSearch(searchQuery); } private _handleClear = (): void => { this.props.onClear(); } public render(): React.ReactElement { return (
); } } ================================================ FILE: source/react-people-directory/src/webparts/peopleDirectory/components/Search/index.ts ================================================ export * from './Search'; export * from './ISearchProps'; ================================================ FILE: source/react-people-directory/src/webparts/peopleDirectory/loc/de-de.js ================================================ define([], function() { return { "SearchButtonText": "Suchen", "LoadingSpinnerLabel": "Lade Personenverzeichnis...", "NoPeopleFoundLabel": "Keine Personen gefunden", "SearchBoxPlaceholder": "Suche", "Error": "Fehler", "SkillsLabel": "Fähigkeiten", "ProjectsLabel": "Projekte", "CopyEmailLabel": "Kopiere Emailadresse in die Zwischenablage", "CopyPhoneLabel": "Kopiere Phonenumber in die Zwischenablage", "CopyMobileLabel": "Kopiere Mobilefunknummer in die Zwischenablage" } }); ================================================ FILE: source/react-people-directory/src/webparts/peopleDirectory/loc/en-us.js ================================================ define([], function() { return { "SearchButtonText": "Search", "LoadingSpinnerLabel": "Loading people directory...", "NoPeopleFoundLabel": "No people found", "SearchBoxPlaceholder": "Search", "Error": "Error", "SkillsLabel": "Skills", "ProjectsLabel": "Projects", "CopyEmailLabel": "Copy email to clipboard", "CopyPhoneLabel": "Copy phone to clipboard", "CopyMobileLabel": "Copy mobile to clipboard" } }); ================================================ FILE: source/react-people-directory/src/webparts/peopleDirectory/loc/es-es.js ================================================ define([], function() { return { "SearchButtonText": "Buscar", "LoadingSpinnerLabel": "Cargando directorio de personas...", "NoPeopleFoundLabel": "No se ha encontrado personas", "SearchBoxPlaceholder": "Buscar", "Error": "Error" } }); ================================================ FILE: source/react-people-directory/src/webparts/peopleDirectory/loc/fr-fr.js ================================================ define([], function() { return { "SearchButtonText": "Chercher", "LoadingSpinnerLabel": "Chargement du répertoire de personnes ...", "NoPeopleFoundLabel": "Aucune personne trouvée", "SearchBoxPlaceholder": "Chercher", "Error": "Erreur", "SkillsLabel": "Compétences", "ProjectsLabel": "Projets", "CopyEmailLabel": "Copier l'email dans le presse papier", "CopyPhoneLabel": "Copier le téléphone dans le presse papier", "CopyMobileLabel": "Copier le mobile dans le presse-papier" } }); ================================================ FILE: source/react-people-directory/src/webparts/peopleDirectory/loc/mystrings.d.ts ================================================ declare interface IPeopleDirectoryWebPartStrings { SearchButtonText: string; LoadingSpinnerLabel: string; NoPeopleFoundLabel: string; SearchBoxPlaceholder: string; ErrorLabel: string; SkillsLabel: string; ProjectsLabel: string; CopyEmailLabel: string; CopyPhoneLabel: string; CopyMobileLabel: string; } declare module 'PeopleDirectoryWebPartStrings' { const strings: IPeopleDirectoryWebPartStrings; export = strings; } ================================================ FILE: source/react-people-directory/src/webparts/peopleDirectory/loc/nb-no.js ================================================ define([], function() { return { "SearchButtonText": "Søk", "LoadingSpinnerLabel": "Laster personkatalogen...", "NoPeopleFoundLabel": "Ingen personer funnet", "SearchBoxPlaceholder": "Søk", "Error": "Feil", "SkillsLabel": "Kompetanser", "ProjectsLabel": "Prosjekter", "CopyEmailLabel": "Kopier e-post adresse til utklippstavlen", "CopyPhoneLabel": "Kopier telefonnummer til utklippstavlen", "CopyMobileLabel": "Kopier mobilnummer til utklippstavlen" } }); ================================================ FILE: source/react-people-directory/src/webparts/peopleDirectory/loc/nl-nl.js ================================================ define([], function() { return { "SearchButtonText": "Zoeken", "LoadingSpinnerLabel": "Collega's aan het ophalen...", "NoPeopleFoundLabel": "Geen collega's gevonden", "SearchBoxPlaceholder": "Zoeken", "Error": "Error", "SkillsLabel": "Vaardigheden", "ProjectsLabel": "Projecten", "CopyEmailLabel": "Kopieer email naar klembord", "CopyPhoneLabel": "Kopieer telefoonnummer naar klembord", "CopyMobileLabel": "Kopieer mobiel telefoonnummer naar klembord" } }); ================================================ FILE: source/react-people-directory/src/webparts/peopleDirectory/loc/sv-se.js ================================================ define([], function() { return { "SearchButtonText": "Sök", "LoadingSpinnerLabel": "Laddar personkatalog...", "NoPeopleFoundLabel": "Inga personer hittades", "SearchBoxPlaceholder": "Sök", "Error": "Fel" } }); ================================================ FILE: source/react-people-directory/src/webparts/peopleDirectory/loc/tr-tr.js ================================================ define([], function() { return { "SearchButtonText": "Ara", "LoadingSpinnerLabel": "Kişi dizini yükleniyor...", "NoPeopleFoundLabel": "Hiç kimse bulunamadı", "SearchBoxPlaceholder": "Arama", "Error": "Hata", "SkillsLabel": "Yetenekler", "ProjectsLabel": "Projeler", "CopyEmailLabel": "E-postayı panoya kopyala", "CopyPhoneLabel": "Telefonu panoya kopyala", "CopyMobileLabel": "Cep telefonunu panoya kopyala" } }); ================================================ FILE: source/react-people-directory/tsconfig.json ================================================ { "extends": "./node_modules/@microsoft/rush-stack-compiler-4.5/includes/tsconfig-web.json", "compilerOptions": { "target": "es5", "forceConsistentCasingInFileNames": true, "module": "esnext", "moduleResolution": "node", "jsx": "react", "declaration": true, "sourceMap": true, "experimentalDecorators": true, "skipLibCheck": true, "outDir": "lib", "inlineSources": false, "strictNullChecks": false, "noImplicitAny": true, "typeRoots": [ "./node_modules/@types", "./node_modules/@microsoft" ], "types": [ "webpack-env" ], "lib": [ "es5", "dom", "es2015.collection", "es2015.promise" ] }, "include": [ "src/**/*.ts", "src/**/*.tsx" ] } ================================================ FILE: source/react-personal-calendar/.editorconfig ================================================ # EditorConfig helps developers define and maintain consistent # coding styles between different editors and IDEs # editorconfig.org root = true [*] # change these settings to your own preference indent_style = space indent_size = 2 # we recommend you to keep these unchanged end_of_line = lf charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true [*.md] trim_trailing_whitespace = false [{package,bower}.json] indent_style = space indent_size = 2 ================================================ FILE: source/react-personal-calendar/.eslintrc.js ================================================ require('@rushstack/eslint-config/patch/modern-module-resolution'); module.exports = { extends: ['@microsoft/eslint-config-spfx/lib/profiles/react'], parserOptions: { tsconfigRootDir: __dirname }, overrides: [ { files: ['*.ts', '*.tsx'], parser: '@typescript-eslint/parser', 'parserOptions': { 'project': './tsconfig.json', 'ecmaVersion': 2018, 'sourceType': 'module' }, rules: { // Prevent usage of the JavaScript null value, while allowing code to access existing APIs that may require null. https://www.npmjs.com/package/@rushstack/eslint-plugin '@rushstack/no-new-null': 1, // Require Jest module mocking APIs to be called before any other statements in their code block. https://www.npmjs.com/package/@rushstack/eslint-plugin '@rushstack/hoist-jest-mock': 1, // Require regular expressions to be constructed from string constants rather than dynamically building strings at runtime. https://www.npmjs.com/package/@rushstack/eslint-plugin-security '@rushstack/security/no-unsafe-regexp': 1, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/adjacent-overload-signatures': 1, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // // CONFIGURATION: By default, these are banned: String, Boolean, Number, Object, Symbol '@typescript-eslint/ban-types': [ 1, { 'extendDefaults': false, 'types': { 'String': { 'message': 'Use \'string\' instead', 'fixWith': 'string' }, 'Boolean': { 'message': 'Use \'boolean\' instead', 'fixWith': 'boolean' }, 'Number': { 'message': 'Use \'number\' instead', 'fixWith': 'number' }, 'Object': { 'message': 'Use \'object\' instead, or else define a proper TypeScript type:' }, 'Symbol': { 'message': 'Use \'symbol\' instead', 'fixWith': 'symbol' }, 'Function': { 'message': 'The \'Function\' type accepts any function-like value.\nIt provides no type safety when calling the function, which can be a common source of bugs.\nIt also accepts things like class declarations, which will throw at runtime as they will not be called with \'new\'.\nIf you are expecting the function to accept certain arguments, you should explicitly define the function shape.' } } } ], // RATIONALE: Code is more readable when the type of every variable is immediately obvious. // Even if the compiler may be able to infer a type, this inference will be unavailable // to a person who is reviewing a GitHub diff. This rule makes writing code harder, // but writing code is a much less important activity than reading it. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/explicit-function-return-type': [ 0, { 'allowExpressions': true, 'allowTypedFunctionExpressions': true, 'allowHigherOrderFunctions': false } ], // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // Rationale to disable: although this is a recommended rule, it is up to dev to select coding style. // Set to 1 (warning) or 2 (error) to enable. '@typescript-eslint/explicit-member-accessibility': 0, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/no-array-constructor': 1, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // // RATIONALE: The "any" keyword disables static type checking, the main benefit of using TypeScript. // This rule should be suppressed only in very special cases such as JSON.stringify() // where the type really can be anything. Even if the type is flexible, another type // may be more appropriate such as "unknown", "{}", or "Record". '@typescript-eslint/no-explicit-any': 0, // RATIONALE: The #1 rule of promises is that every promise chain must be terminated by a catch() // handler. Thus wherever a Promise arises, the code must either append a catch handler, // or else return the object to a caller (who assumes this responsibility). Unterminated // promise chains are a serious issue. Besides causing errors to be silently ignored, // they can also cause a NodeJS process to terminate unexpectedly. '@typescript-eslint/no-floating-promises': 0, // RATIONALE: Catches a common coding mistake. '@typescript-eslint/no-for-in-array': 2, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/no-misused-new': 2, // RATIONALE: The "namespace" keyword is not recommended for organizing code because JavaScript lacks // a "using" statement to traverse namespaces. Nested namespaces prevent certain bundler // optimizations. If you are declaring loose functions/variables, it's better to make them // static members of a class, since classes support property getters and their private // members are accessible by unit tests. Also, the exercise of choosing a meaningful // class name tends to produce more discoverable APIs: for example, search+replacing // the function "reverse()" is likely to return many false matches, whereas if we always // write "Text.reverse()" is more unique. For large scale organization, it's recommended // to decompose your code into separate NPM packages, which ensures that component // dependencies are tracked more conscientiously. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/no-namespace': [ 1, { 'allowDeclarations': false, 'allowDefinitionFiles': false } ], // RATIONALE: Parameter properties provide a shorthand such as "constructor(public title: string)" // that avoids the effort of declaring "title" as a field. This TypeScript feature makes // code easier to write, but arguably sacrifices readability: In the notes for // "@typescript-eslint/member-ordering" we pointed out that fields are central to // a class's design, so we wouldn't want to bury them in a constructor signature // just to save some typing. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // Set to 1 (warning) or 2 (error) to enable the rule '@typescript-eslint/no-parameter-properties': 0, // RATIONALE: When left in shipping code, unused variables often indicate a mistake. Dead code // may impact performance. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/no-unused-vars': [ 1, { 'vars': 'all', // Unused function arguments often indicate a mistake in JavaScript code. However in TypeScript code, // the compiler catches most of those mistakes, and unused arguments are fairly common for type signatures // that are overriding a base class method or implementing an interface. 'args': 'none' } ], // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/no-use-before-define': [ 2, { 'functions': false, 'classes': true, 'variables': true, 'enums': true, 'typedefs': true } ], // Disallows require statements except in import statements. // In other words, the use of forms such as var foo = require("foo") are banned. Instead use ES6 style imports or import foo = require("foo") imports. '@typescript-eslint/no-var-requires': 'error', // RATIONALE: The "module" keyword is deprecated except when describing legacy libraries. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/prefer-namespace-keyword': 1, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // Rationale to disable: it's up to developer to decide if he wants to add type annotations // Set to 1 (warning) or 2 (error) to enable the rule '@typescript-eslint/no-inferrable-types': 0, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // Rationale to disable: declaration of empty interfaces may be helpful for generic types scenarios '@typescript-eslint/no-empty-interface': 0, // RATIONALE: This rule warns if setters are defined without getters, which is probably a mistake. 'accessor-pairs': 1, // RATIONALE: In TypeScript, if you write x["y"] instead of x.y, it disables type checking. 'dot-notation': [ 1, { 'allowPattern': '^_' } ], // RATIONALE: Catches code that is likely to be incorrect 'eqeqeq': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'for-direction': 1, // RATIONALE: Catches a common coding mistake. 'guard-for-in': 2, // RATIONALE: If you have more than 2,000 lines in a single source file, it's probably time // to split up your code. 'max-lines': ['warn', { max: 2000 }], // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-async-promise-executor': 2, // RATIONALE: Deprecated language feature. 'no-caller': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-compare-neg-zero': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-cond-assign': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-constant-condition': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-control-regex': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-debugger': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-delete-var': 2, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-duplicate-case': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-empty': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-empty-character-class': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-empty-pattern': 1, // RATIONALE: Eval is a security concern and a performance concern. 'no-eval': 1, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-ex-assign': 2, // RATIONALE: System types are global and should not be tampered with in a scalable code base. // If two different libraries (or two versions of the same library) both try to modify // a type, only one of them can win. Polyfills are acceptable because they implement // a standardized interoperable contract, but polyfills are generally coded in plain // JavaScript. 'no-extend-native': 1, // Disallow unnecessary labels 'no-extra-label': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-fallthrough': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-func-assign': 1, // RATIONALE: Catches a common coding mistake. 'no-implied-eval': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-invalid-regexp': 2, // RATIONALE: Catches a common coding mistake. 'no-label-var': 2, // RATIONALE: Eliminates redundant code. 'no-lone-blocks': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-misleading-character-class': 2, // RATIONALE: Catches a common coding mistake. 'no-multi-str': 2, // RATIONALE: It's generally a bad practice to call "new Thing()" without assigning the result to // a variable. Either it's part of an awkward expression like "(new Thing()).doSomething()", // or else implies that the constructor is doing nontrivial computations, which is often // a poor class design. 'no-new': 1, // RATIONALE: Obsolete language feature that is deprecated. 'no-new-func': 2, // RATIONALE: Obsolete language feature that is deprecated. 'no-new-object': 2, // RATIONALE: Obsolete notation. 'no-new-wrappers': 1, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-octal': 2, // RATIONALE: Catches code that is likely to be incorrect 'no-octal-escape': 2, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-regex-spaces': 2, // RATIONALE: Catches a common coding mistake. 'no-return-assign': 2, // RATIONALE: Security risk. 'no-script-url': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-self-assign': 2, // RATIONALE: Catches a common coding mistake. 'no-self-compare': 2, // RATIONALE: This avoids statements such as "while (a = next(), a && a.length);" that use // commas to create compound expressions. In general code is more readable if each // step is split onto a separate line. This also makes it easier to set breakpoints // in the debugger. 'no-sequences': 1, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-shadow-restricted-names': 2, // RATIONALE: Obsolete language feature that is deprecated. // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-sparse-arrays': 2, // RATIONALE: Although in theory JavaScript allows any possible data type to be thrown as an exception, // such flexibility adds pointless complexity, by requiring every catch block to test // the type of the object that it receives. Whereas if catch blocks can always assume // that their object implements the "Error" contract, then the code is simpler, and // we generally get useful additional information like a call stack. 'no-throw-literal': 2, // RATIONALE: Catches a common coding mistake. 'no-unmodified-loop-condition': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-unsafe-finally': 2, // RATIONALE: Catches a common coding mistake. 'no-unused-expressions': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-unused-labels': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-useless-catch': 1, // RATIONALE: Avoids a potential performance problem. 'no-useless-concat': 1, // RATIONALE: The "var" keyword is deprecated because of its confusing "hoisting" behavior. // Always use "let" or "const" instead. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json 'no-var': 2, // RATIONALE: Generally not needed in modern code. 'no-void': 1, // RATIONALE: Obsolete language feature that is deprecated. // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-with': 2, // RATIONALE: Makes logic easier to understand, since constants always have a known value // @typescript-eslint\eslint-plugin\dist\configs\eslint-recommended.js 'prefer-const': 1, // RATIONALE: Catches a common coding mistake where "resolve" and "reject" are confused. 'promise/param-names': 2, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'require-atomic-updates': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'require-yield': 1, // "Use strict" is redundant when using the TypeScript compiler. 'strict': [ 2, 'never' ], // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'use-isnan': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js // Set to 1 (warning) or 2 (error) to enable. // Rationale to disable: !!{} 'no-extra-boolean-cast': 0, // ==================================================================== // @microsoft/eslint-plugin-spfx // ==================================================================== '@microsoft/spfx/import-requires-chunk-name': 1, '@microsoft/spfx/no-require-ensure': 2, '@microsoft/spfx/pair-react-dom-render-unmount': 0, // ==================================================================== // react/self-closing-comp // ==================================================================== 'react/self-closing-comp': 0 } }, { // For unit tests, we can be a little bit less strict. The settings below revise the // defaults specified in the extended configurations, as well as above. files: [ // Test files '*.test.ts', '*.test.tsx', '*.spec.ts', '*.spec.tsx', // Facebook convention '**/__mocks__/*.ts', '**/__mocks__/*.tsx', '**/__tests__/*.ts', '**/__tests__/*.tsx', // Microsoft convention '**/test/*.ts', '**/test/*.tsx' ], rules: {} } ] }; ================================================ FILE: source/react-personal-calendar/.gitignore ================================================ # Logs logs *.log npm-debug.log* # Dependency directories node_modules # Build generated files dist lib release solution temp *.sppkg .heft # Coverage directory used by tools like istanbul coverage # OSX .DS_Store # Visual Studio files .ntvs_analysis.dat .vs bin obj # Resx Generated Code *.resx.ts # Styles Generated Code *.scss.ts ================================================ FILE: source/react-personal-calendar/.npmignore ================================================ !dist config gulpfile.js release src temp tsconfig.json tslint.json *.log .yo-rc.json .vscode ================================================ FILE: source/react-personal-calendar/.vscode/launch.json ================================================ { "version": "0.2.0", "configurations": [ { "name": "Hosted workbench", "type": "pwa-chrome", "request": "launch", "url": "https://enter-your-SharePoint-site/_layouts/workbench.aspx", "webRoot": "${workspaceRoot}", "sourceMaps": true, "sourceMapPathOverrides": { "webpack:///.././src/*": "${webRoot}/src/*", "webpack:///../../../src/*": "${webRoot}/src/*", "webpack:///../../../../src/*": "${webRoot}/src/*", "webpack:///../../../../../src/*": "${webRoot}/src/*" }, "runtimeArgs": [ "--remote-debugging-port=9222", "-incognito" ] } ] } ================================================ FILE: source/react-personal-calendar/.vscode/settings.json ================================================ // Place your settings in this file to overwrite default and user settings. { // Configure glob patterns for excluding files and folders in the file explorer. "files.exclude": { "**/.git": true, "**/.DS_Store": true, "**/bower_components": true, "**/coverage": true, "**/lib-amd": true, "src/**/*.scss.ts": true }, "typescript.tsdk": ".\\node_modules\\typescript\\lib" } ================================================ FILE: source/react-personal-calendar/.yo-rc.json ================================================ { "@microsoft/generator-sharepoint": { "plusBeta": false, "isCreatingSolution": true, "nodeVersion": "16.19.0", "sdksVersions": { "@microsoft/microsoft-graph-client": "3.0.2", "@microsoft/teams-js": "2.4.1" }, "version": "1.16.1", "environment": "spo", "libraryName": "react-personal-calendar", "libraryId": "a30bc805-c1fb-46ef-9278-8226be832374", "packageManager": "npm", "skipFeatureDeployment": true, "isDomainIsolated": false, "componentType": "webpart" } } ================================================ FILE: source/react-personal-calendar/README.md ================================================ # Personal Calendar web part This web part provides you the ability to add a particular user's personal calendar on a web page. The web part may be configured to automatically refresh, as well as display up to seven days of events and a pre-defined number of events at a time. This web part is powered by the Microsoft Graph. This webpart is a technology demostrator of Microsoft Graph Toolkit React components, in particular "Agenda". This webpart uses the @microsoft/mgt-react and @microsoft/mgt-spfx packages, currently version 2.9.0. > `NOTE:` This webpart includes the use of a custom SPFx library, [library-starter-kit-shared](../library-starter-kit-shared). If you need to rebuild / bundle / package this solution, refer to [Minimal Path to Awesome](#Minimal-Path-to-Awesome) > `NOTE:` This webpart includes the use the Microsoft Graph Toolkit with React, [@microsoft/mgt-react](https://www.npmjs.com/package/@microsoft/mgt-react). > `NOTE:` This webpart includes the use the Microsoft Graph Toolkit with React SPFx, [@microsoft/mgt-spfx](../mgt-spfx/README.md) with a dependency on [mgt-spfx-2.9.0.sppkg](https://github.com/microsoftgraph/microsoft-graph-toolkit/releases) that must be installed to the tenant app catalog. By default the Starter Kit will install this additional dependency. ![Personal Calendar](../../assets/images/components/part-personal-calendar.gif) ## How to use this web part on your web pages 1. Place the page you want to add this web part to in edit mode. 2. Search for and insert the **Personal Calendar** web part. 3. Configure the web part to update its properties. ## Configurable Properties The `Personal Calendar` web part can be configured with the following properties: | Label | Property | Type | Required | Description | | ---- | ---- | ---- | ---- | ---- | | Upcoming Events | title | string | no | The web part title, editable inline with the web part itself | | How often to check for new upcoming meetings (in minutes) | refreshInterval | number | no | Default: 5 - the interval in minutes between auto refresh | | How many days in advance to retrieve meetings for? 0 - today only | daysInAdvance | number | no | Default: 0 (Today only) - the interval in minutes between auto refresh | | How many meetings to show? 0 - show all retrieved meetings | numMeetings | number | no | Default: 0 (all) - the interval in minutes between auto refresh | | Show Calendar | showCalendar | bool | no | Show or hide the calendar component | ## Used SharePoint Framework Version ![drop](https://img.shields.io/badge/version-1.16.1-green.svg) * Supported in SharePoint Online ## Applies to * [SharePoint Framework](https://learn.microsoft.com/en-us/sharepoint/dev/spfx/sharepoint-framework-overview) * [Office 365 tenant](https://learn.microsoft.com/en-us/sharepoint/dev/spfx/set-up-your-development-environment) ## Prerequisites * [library-starter-kit-shared](../library-starter-kit-shared) - must be installed to the tenant app catalog. By default the Starter Kit will install this additional dependency. If you need to rebuild / bundle / package this solution, refer to [Minimal Path to Awesome](#Minimal-Path-to-Awesome) * [mgt-spfx-2.9.0.sppkg](https://github.com/microsoftgraph/microsoft-graph-toolkit/releases) must be installed to the tenant app catalog. By default the Starter Kit will install this additional dependency. ## Minimal Path to Awesome This solution uses a SPFx library, [library-starter-kit-shared](../library-starter-kit-shared). As such, additional steps are required to rebuild this project. 1. Clone this entire project 2. Within the [library-starter-kit-shared](../library-starter-kit-shared) source, i.e. [./source/library-starter-kit-shared](../library-starter-kit-shared) ```powershell npm install gulp build gulp bundle npm link ``` 3. Within this SPFx solution folder [react-personal-calendar](./), i.e. [./source/react-personal-calendar](../react-personal-calendar) * in the command line run: ```powershell npm install npm link @starter-kit/shared-library ``` 4. Edit package.json found at the root of the [react-personal-calendar](./), i.e. [./source/react-personal-calendar/package.json](../react-personal-calendar/package.json) - Add a new dependancy to the project: "@starter-kit/shared-library": "3.0.0" **Example**: ```xml "dependencies": { "@microsoft/mgt-react": "2.9.0", "@microsoft/mgt-spfx": "2.9.0", ... "react": "17.0.1", "react-dom": "17.0.1" } ``` to: ```xml "dependencies": { "@microsoft/mgt-react": "2.9.0", "@microsoft/mgt-spfx": "2.9.0", ... "react": "17.0.1", "react-dom": "17.0.1" "@starter-kit/shared-library": "3.0.0" } ``` 5. Within this SPFx solution folder [react-personal-calendar](./), i.e. [./source/react-personal-calendar](../react-personal-calendar) * in the command line run: ```powershell gulp serve ``` 6. To rebundle the webpart, within this SPFx solution folder [react-personal-calendar](./), i.e. [./source/react-personal-calendar](../react-personal-calendar) * in the command line run: ```powershell gulp bundle gulp package-solution ``` > If you add this webpart's sppkg to your app catalog, the sppkg for the [shared library](../library-starter-kit-shared) must also be installed. The [library](../library-starter-kit-shared) may be built, bundled, and packaged similar to a standard SPFx webpart or extension. > The package.json within this SPFx solution file must be manually updated for if the library dependency was included by default with the project, **npm install** would fail as the [library-starter-kit-shared](../library-starter-kit-shared) package would not be found. Linking the two projects allows this webpart to reference the library during **development**, while the package.json reference is required for **bundling and packaging**. ## Features Description of the web part with possible additional details than in short summary. This Web Part illustrates the following concepts on top of the SharePoint Framework: * Using Microsoft Graph and the Microsoft Graph Toolkit React components within a web part * Using [SharePoint Framework library components](https://docs.microsoft.com/en-us/sharepoint/dev/spfx/library-component-overview_) ## Solution Solution|Author(s) --------|--------- react-personal-calendar | Waldek Mastykarz react-personal-calendar | Beau Cameron react-personal-calendar | Eric Overfield ## Version history Version|Date|Comments -------|----|-------- 1.0|May, 2018|Initial release 2.0|November 29,2019|v2.0 2.1|November 2020|Include Microsoft Graph Toolkit React components 2.3|August 2021|Upgrade to MGT 2.2.1 3.0|February 2023|Upgrade to SPFx v1.16.1 ## Disclaimer **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.** --- ================================================ FILE: source/react-personal-calendar/config/config.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/config.2.0.schema.json", "version": "2.0", "bundles": { "personal-calendar-web-part": { "components": [ { "entrypoint": "./lib/webparts/personalCalendar/PersonalCalendarWebPart.js", "manifest": "./src/webparts/personalCalendar/PersonalCalendarWebPart.manifest.json" } ] } }, "externals": {}, "localizedResources": { "PersonalCalendarWebPartStrings": "lib/webparts/personalCalendar/loc/{locale}.js", "ControlStrings": "node_modules/@pnp/spfx-controls-react/lib/loc/{locale}.js", "PropertyControlStrings": "node_modules/@pnp/spfx-property-controls/lib/loc/{locale}.js" } } ================================================ FILE: source/react-personal-calendar/config/deploy-azure-storage.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/deploy-azure-storage.schema.json", "workingDir": "./release/assets/", "account": "", "container": "react-personal-calendar", "accessKey": "" } ================================================ FILE: source/react-personal-calendar/config/package-solution.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/package-solution.schema.json", "solution": { "name": "Starter Kit - Personal Calendar", "id": "a30bc805-c1fb-46ef-9278-8226be832374", "version": "3.0.0.0", "includeClientSideAssets": true, "skipFeatureDeployment": true, "isDomainIsolated": false, "developer": { "name": "PnP Starter Kit", "privacyUrl": "", "termsOfUseUrl": "", "websiteUrl": "", "mpnId": "pnpsk" }, "metadata": { "shortDescription": { "default": "react-personal-calendar description" }, "longDescription": { "default": "react-personal-calendar description" }, "screenshotPaths": [], "videoUrl": "", "categories": [] }, "features": [ { "title": "Starter Kit - Personal Calendar WebPart Feature", "description": "The feature that activates Personal Calendar Webpart from the Starter Kit - Personal Calendar solution.", "id": "6d28e73b-ed80-494e-8238-c0106c26b36a", "version": "3.0.0.0", "componentIds": [ "6d28e73b-ed80-494e-8238-c0106c26b36a" ] } ], "webApiPermissionRequests": [ { "resource": "Microsoft Graph", "scope": "MailboxSettings.Read" }, { "resource": "Microsoft Graph", "scope": "Calendars.Read" } ] }, "paths": { "zippedPackage": "solution/react-personal-calendar.sppkg" } } ================================================ FILE: source/react-personal-calendar/config/sass.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/core-build/sass.schema.json" } ================================================ FILE: source/react-personal-calendar/config/serve.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/spfx-serve.schema.json", "port": 4321, "https": true, "initialPage": "https://enter-your-SharePoint-site/_layouts/workbench.aspx" } ================================================ FILE: source/react-personal-calendar/config/write-manifests.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/write-manifests.schema.json", "cdnBasePath": "" } ================================================ FILE: source/react-personal-calendar/gulpfile.js ================================================ 'use strict'; const build = require('@microsoft/sp-build-web'); build.addSuppression(`Warning - [sass] The local CSS class 'ms-Grid' is not camelCase and will not be type-safe.`); var getTasks = build.rig.getTasks; build.rig.getTasks = function () { var result = getTasks.call(build.rig); result.set('serve', result.get('serve-deprecated')); return result; }; build.initialize(require('gulp')); ================================================ FILE: source/react-personal-calendar/package.json ================================================ { "name": "react-personal-calendar", "version": "3.0.0", "private": true, "main": "lib/index.js", "engines": { "node": ">=16.13.0 <17.0.0" }, "scripts": { "build": "gulp bundle", "clean": "gulp clean", "test": "gulp test" }, "dependencies": { "@microsoft/mgt-react": "2.9.0", "@microsoft/mgt-spfx": "2.9.0", "@microsoft/sp-core-library": "1.16.1", "@microsoft/sp-lodash-subset": "1.16.1", "@microsoft/sp-office-ui-fabric-core": "1.16.1", "@microsoft/sp-property-pane": "1.16.1", "@microsoft/sp-webpart-base": "1.16.1", "@pnp/spfx-controls-react": "3.12.0", "@pnp/spfx-property-controls": "3.11.0", "date-fns": "2.29.3", "react": "17.0.1", "react-dom": "17.0.1", "tslib": "2.3.1", "windows-iana": "5.1.0" }, "resolutions": { "@types/react": "16.8.8" }, "devDependencies": { "@microsoft/eslint-config-spfx": "1.16.1", "@microsoft/eslint-plugin-spfx": "1.16.1", "@microsoft/rush-stack-compiler-4.5": "0.2.2", "@microsoft/sp-build-web": "1.16.1", "@microsoft/sp-module-interfaces": "1.16.1", "@rushstack/eslint-config": "2.5.1", "@types/es6-promise": "0.0.33", "@types/react": "17.0.45", "@types/react-dom": "17.0.17", "@types/webpack-env": "1.15.2", "ajv": "6.12.5", "eslint-plugin-react-hooks": "4.3.0", "gulp": "4.0.2", "typescript": "4.5.5" } } ================================================ FILE: source/react-personal-calendar/src/index.ts ================================================ // A file is required to be in the root of the /src directory by the TypeScript compiler ================================================ FILE: source/react-personal-calendar/src/webparts/personalCalendar/PersonalCalendarWebPart.manifest.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx/client-side-web-part-manifest.schema.json", "id": "6d28e73b-ed80-494e-8238-c0106c26b36a", "alias": "PersonalCalendarWebPart", "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, "supportedHosts": ["SharePointWebPart", "SharePointFullPage", "TeamsTab", "TeamsPersonalApp"], "supportsThemeVariants": true, "preconfiguredEntries": [{ "groupId": "5c03119e-3074-46fd-976b-c60198311f70", // Other "group": { "default": "Other" }, "title": { "default": "Personal Calendar" }, "description": { "default": "Shows upcoming meetings for the current user" }, "officeFabricIconFontName": "Calendar", "properties": { "title": "Upcoming meetings", "refreshInterval": 5, "daysInAdvance": 0, "numMeetings": 0 } }] } ================================================ FILE: source/react-personal-calendar/src/webparts/personalCalendar/PersonalCalendarWebPart.ts ================================================ import * as React from 'react'; import * as ReactDom from 'react-dom'; import { Version } from '@microsoft/sp-core-library'; import { BaseClientSideWebPart } from '@microsoft/sp-webpart-base'; import { IPropertyPaneConfiguration, PropertyPaneSlider, PropertyPaneCheckbox } from "@microsoft/sp-property-pane"; import * as strings from 'PersonalCalendarWebPartStrings'; import { SpStarterKitSharedLibrary } from '@starter-kit/shared-library'; import PersonalCalendar from './components/PersonalCalendar'; import { IPersonalCalendarProps } from './components/IPersonalCalendarProps'; import { Providers, SharePointProvider } from '@microsoft/mgt-spfx'; import { IReadonlyTheme, ThemeChangedEventArgs, ThemeProvider } from "@microsoft/sp-component-base"; export interface IPersonalCalendarWebPartProps { title: string; refreshInterval: number; daysInAdvance: number; numMeetings: number; showCalendar: boolean; } export default class PersonalCalendarWebPart extends BaseClientSideWebPart { private propertyFieldNumber: any; private _themeProvider: ThemeProvider; private _themeVariant: IReadonlyTheme | undefined; public onInit(): Promise { Providers.globalProvider = new SharePointProvider(this.context); this._themeProvider = this.context.serviceScope.consume( ThemeProvider.serviceKey ); // If it exists, get the theme variant this._themeVariant = this._themeProvider.tryGetTheme(); // Register a handler to be notified if the theme variant changes this._themeProvider.themeChangedEvent.add( this, this._handleThemeChangedEvent ); return Promise.resolve(); } public render(): void { const element: React.ReactElement = React.createElement( PersonalCalendar, { title: this.properties.title, refreshInterval: this.properties.refreshInterval, daysInAdvance: this.properties.daysInAdvance, numMeetings: this.properties.numMeetings, showCalendar: this.properties.showCalendar, // pass the current display mode to determine if the title should be // editable or not displayMode: this.displayMode, themeVariant: this._themeVariant, // handle updated web part title updateProperty: (value: string): void => { // store the new title in the title web part property this.properties.title = value; } } ); ReactDom.render(element, this.domElement); } protected get dataVersion(): Version { return Version.parse('1.0'); } //executes only before property pane is loaded. protected async loadPropertyPaneResources(): Promise { // import additional controls/components const { PropertyFieldNumber } = await import( /* webpackChunkName: 'pnp-propcontrols-number' */ '@pnp/spfx-property-controls/lib/propertyFields/number' ); this.propertyFieldNumber = PropertyFieldNumber; } protected getPropertyPaneConfiguration(): IPropertyPaneConfiguration { return { pages: [ { header: { description: strings.PropertyPaneDescription }, groups: [ { groupFields: [ this.propertyFieldNumber("refreshInterval", { key: "refreshInterval", // label: strings.RefreshInterval, label: SpStarterKitSharedLibrary.getLocale('RefreshInterval'), value: this.properties.refreshInterval, minValue: 1, maxValue: 60 }), PropertyPaneSlider('daysInAdvance', { label: strings.DaysInAdvance, min: 0, max: 7, step: 1, value: this.properties.daysInAdvance }), PropertyPaneSlider('numMeetings', { label: strings.NumMeetings, min: 0, max: 20, step: 1, value: this.properties.numMeetings }), PropertyPaneCheckbox('showCalendar', { text: strings.ShowCalendar, checked: this.properties.showCalendar }) ] } ] } ] }; } private _handleThemeChangedEvent(args: ThemeChangedEventArgs): void { this._themeVariant = args.theme; this.render(); } } ================================================ FILE: source/react-personal-calendar/src/webparts/personalCalendar/components/IMeeting.ts ================================================ export interface IMeetings { value: IMeeting[]; } export interface IMeeting { end: IMeetingTime; isAllDay: boolean; location: { displayName: string; }; showAs: string; start: IMeetingTime; subject: string; webLink: string; } export interface IMeetingTime { dateTime: string; timeZone: string; } ================================================ FILE: source/react-personal-calendar/src/webparts/personalCalendar/components/IPersonalCalendarProps.ts ================================================ import { IPersonalCalendarWebPartProps } from "../PersonalCalendarWebPart"; import { DisplayMode } from "@microsoft/sp-core-library"; import { IReadonlyTheme } from '@microsoft/sp-component-base'; export interface IPersonalCalendarProps extends IPersonalCalendarWebPartProps { displayMode: DisplayMode; themeVariant: IReadonlyTheme | undefined; updateProperty: (value: string) => void; } ================================================ FILE: source/react-personal-calendar/src/webparts/personalCalendar/components/IPersonalCalendarState.ts ================================================ import { IMeeting } from '.'; export interface IPersonalCalendarState { error: string; loading: boolean; meetings: IMeeting[]; renderedDateTime: Date; timeZone?: string; } ================================================ FILE: source/react-personal-calendar/src/webparts/personalCalendar/components/PersonalCalendar.module.scss ================================================ @import '~@fluentui/react/dist/sass/References.scss'; .personalCalendar { @include ms-font-m; padding: 1em; --varientBGColor: $ms-color-themePrimary; --varientDividerColor: $ms-color-themePrimary; --varientFontcolor: $ms-color-gray160; color: var(--varientFontcolor); button * { color: var(--varientFontcolor) !important; } .list { margin-top: 1em; margin-bottom: 1em; } .meetingDate { padding: 0.5em; font-size: 1.1em; } // Override for PnP SPFX webPartTitle font .personalCalendarTitle * { font-size: 20px !important; font-weight: 600 !important; color: var(--varientFontcolor) !important; } .meeting { display: block; padding: 0.5em 10px; color: var(--varientFontcolor); &:hover { color: var(--varientBGColor); background: var(--varientFontcolor); } } .linkWrapper { display: -webkit-box; flex-flow: row nowrap; } .timeDetails { flex: 0 0 auto; width: 5em; } .divider { width: 0.5em; margin: 0 0.5em; border-radius: 5px; &:global(.tentative) { background: var(--varientDividerColor) url('data:image/gif;base64,R0lGODlhBwAHAIABAP///////yH/C1hNUCBEYXRhWE1QPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS4wLWMwNjAgNjEuMTM0Nzc3LCAyMDEwLzAyLzEyLTE3OjMyOjAwICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlUmVmIyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M1IE1hY2ludG9zaCIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDpDMUQ3NUMxRTk5MDExMUUwOTI0OEIzRjU5RDg0NTg0MCIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDpDMUQ3NUMxRjk5MDExMUUwOTI0OEIzRjU5RDg0NTg0MCI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOkMxRDc1QzFDOTkwMTExRTA5MjQ4QjNGNTlEODQ1ODQwIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOkMxRDc1QzFEOTkwMTExRTA5MjQ4QjNGNTlEODQ1ODQwIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+Af/+/fz7+vn49/b19PPy8fDv7u3s6+rp6Ofm5eTj4uHg397d3Nva2djX1tXU09LR0M/OzczLysnIx8bFxMPCwcC/vr28u7q5uLe2tbSzsrGwr66trKuqqainpqWko6KhoJ+enZybmpmYl5aVlJOSkZCPjo2Mi4qJiIeGhYSDgoGAf359fHt6eXh3dnV0c3JxcG9ubWxramloZ2ZlZGNiYWBfXl1cW1pZWFdWVVRTUlFQT05NTEtKSUhHRkVEQ0JBQD8+PTw7Ojk4NzY1NDMyMTAvLi0sKyopKCcmJSQjIiEgHx4dHBsaGRgXFhUUExIREA8ODQwLCgkIBwYFBAMCAQAAIfkEAQAAAQAsAAAAAAcABwAAAgyMgRYIyp6gWk1CUAAAOw==') } &:global(.busy) { background: var(--varientDividerColor); } &:global(.oof) { background: indigo; } &:global(.workingElsewhere) { background: var(--varientDividerColor) url('data:image/gif;base64,R0lGODlhAwAEAIABAP///////yH/C1hNUCBEYXRhWE1QPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS4wLWMwNjAgNjEuMTM0Nzc3LCAyMDEwLzAyLzEyLTE3OjMyOjAwICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxuczpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlUmVmIyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M1IE1hY2ludG9zaCIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDowQTIxMjhEQkEwMkUxMUUwQURCNUFBRDk1NjM2OTRBNSIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDowQTIxMjhEQ0EwMkUxMUUwQURCNUFBRDk1NjM2OTRBNSI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjBBMjEyOEQ5QTAyRTExRTBBREI1QUFEOTU2MzY5NEE1IiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjBBMjEyOERBQTAyRTExRTBBREI1QUFEOTU2MzY5NEE1Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+Af/+/fz7+vn49/b19PPy8fDv7u3s6+rp6Ofm5eTj4uHg397d3Nva2djX1tXU09LR0M/OzczLysnIx8bFxMPCwcC/vr28u7q5uLe2tbSzsrGwr66trKuqqainpqWko6KhoJ+enZybmpmYl5aVlJOSkZCPjo2Mi4qJiIeGhYSDgoGAf359fHt6eXh3dnV0c3JxcG9ubWxramloZ2ZlZGNiYWBfXl1cW1pZWFdWVVRTUlFQT05NTEtKSUhHRkVEQ0JBQD8+PTw7Ojk4NzY1NDMyMTAvLi0sKyopKCcmJSQjIiEgHx4dHBsaGRgXFhUUExIREA8ODQwLCgkIBwYFBAMCAQAAIfkEAQAAAQAsAAAAAAMABAAAAgQMjmBXADs='); } } .meeting:hover .divider { &:global(.busy) { background: var(--varientBGColor); } } .start { display: inline; } .subject { @include ms-fontWeight-bold; } .duration { @include ms-fontWeight-light; height: 1em; } .location { @include ms-fontWeight-light; display: inline; } .noMeetings { @include ms-font-m; } .error { @include ms-font-m; color: $ms-color-alert; } } ================================================ FILE: source/react-personal-calendar/src/webparts/personalCalendar/components/PersonalCalendar.tsx ================================================ import { Providers } from '@microsoft/mgt-spfx'; import { Agenda, MgtTemplateProps } from '@microsoft/mgt-react/dist/es6/spfx'; import { WebPartTitle } from '@pnp/spfx-controls-react/lib/WebPartTitle'; import { Link } from '@fluentui/react/lib/Link'; import * as strings from 'PersonalCalendarWebPartStrings'; import * as React from 'react'; import { IPersonalCalendarProps, IPersonalCalendarState } from '.'; import { Event } from '@microsoft/microsoft-graph-types'; import styles from './PersonalCalendar.module.scss'; import { Spinner, SpinnerSize } from '@fluentui/react/lib/Spinner'; import format from 'date-fns/format'; import { IIconProps } from '@fluentui/react/lib/Icon'; import { ActionButton } from '@fluentui/react/lib/Button'; import SimpleCalendar from './SimpleCalendar'; import { findIana } from 'windows-iana'; const EventInfo = (props: MgtTemplateProps) => { /** * Get user-friendly string that represents the duration of an event * < 1h: x minutes * >= 1h: 1 hour (y minutes) * all day: All day */ const getDuration = (_event: Event): string => { if (_event.isAllDay) { return strings.AllDay; } const _startDateTime: Date = new Date(_event.start.dateTime); const _endDateTime: Date = new Date(_event.end.dateTime); // get duration in minutes const _duration: number = Math.round((_endDateTime as any) - (_startDateTime as any)) / (1000 * 60); if (_duration <= 0) { return ''; } if (_duration < 60) { return `${_duration} ${strings.Minutes}`; } const _hours: number = Math.floor(_duration / 60); const _minutes: number = Math.round(_duration % 60); let durationString: string = `${_hours} ${_hours > 1 ? strings.Hours : strings.Hour}`; if (_minutes > 0) { durationString += ` ${_minutes} ${strings.Minutes}`; } return durationString; }; const event: Event | undefined = props.dataContext ? props.dataContext.event : undefined; if (!event) { return
; } const startTime: Date = new Date(event.start.dateTime); const minutes: number = startTime.getMinutes(); return
{event.isAllDay ? 'All day' : `${startTime.getHours()}:${minutes < 10 ? '0' + minutes : minutes}`}
{getDuration(event)}
{event.subject}
{event.location.displayName}
; }; const HeaderInfo = (props: MgtTemplateProps) => { const day: string | undefined = props.dataContext ? props.dataContext.header : undefined; return
{format(new Date(day), 'iiii, MMMM d, yyyy')}
; }; const LoadingTemplate = (props: MgtTemplateProps) => { return ; }; export default class PersonalCalendar extends React.Component { private _interval: number; constructor(props: IPersonalCalendarProps) { super(props); this.state = { meetings: [], error: undefined, loading: false, renderedDateTime: new Date() }; } private addIcon: IIconProps = { iconName: 'Add' }; private viewList: IIconProps = { iconName: 'AllApps' }; /** * Get timezone for logged in user */ private _getTimeZone(): Promise { return new Promise((resolve, reject) => { Providers.globalProvider.graph // get the mailbox settings .api(`me/mailboxSettings`) .version("v1.0") .get((err: any, res: microsoftgraph.MailboxSettings): void => { if (err) { console.error("Error:", err) return reject(err); } // else { // console.log("Response:", res) // } resolve(res?.timeZone); }); }); } /** * Forces re-render of the component */ private _reRender = (): void => { // update the render date to force reloading data and re-rendering // the component this.setState({ renderedDateTime: new Date() }); } /** * Sets interval so that the data in the component is refreshed on the * specified cycle */ private _setInterval = (): void => { let { refreshInterval } = this.props; // set up safe default if the specified interval is not a number // or beyond the valid range if (isNaN(refreshInterval) || refreshInterval < 0 || refreshInterval > 60) { refreshInterval = 5; } // refresh the component every x minutes this._interval = window.setInterval(this._reRender, refreshInterval * 1000 * 60); this._reRender(); } public componentDidMount(): void { this._setInterval(); this ._getTimeZone() .then((_timeZone: string): void => { const convertedTimeZone = findIana(_timeZone); this.setState({ timeZone: convertedTimeZone?.length > 1 ? convertedTimeZone[0] : convertedTimeZone[0], loading: false }); }); } public componentWillUnmount(): void { // remove the interval so that the data won't be reloaded clearInterval(this._interval); } public componentDidUpdate(prevProps: IPersonalCalendarProps, prevState: IPersonalCalendarState): void { // if the refresh interval has changed, clear the previous interval // and setup new one, which will also automatically re-render the component if (prevProps.refreshInterval !== this.props.refreshInterval) { clearInterval(this._interval); this._setInterval(); return; } } public render(): React.ReactElement { const date: Date = new Date(); const now: string = date.toISOString(); // set the date to midnight today to load all upcoming meetings for today date.setUTCHours(23); date.setUTCMinutes(59); date.setUTCSeconds(0); date.setDate(date.getDate() + (this.props.daysInAdvance || 0)); const midnight: string = date.toISOString(); const varientStyles = { "--varientBGColor": this.props.themeVariant.semanticColors.bodyBackground , "--varientFontcolor": this.props.themeVariant.semanticColors.bodyText , "--varientDividerColor": this.props.themeVariant.isInverted ? this.props.themeVariant.palette.neutralLight : this.props.themeVariant.palette.themePrimary } as React.CSSProperties; return (
{this.props.showCalendar && } { <>
0 ? this.props.numMeetings : 100}`} >
{strings.ViewAll} }
); } private openNewEvent = () => { window.open('https://outlook.office.com/calendar/deeplink/compose', '_blank'); } private openList = () => { window.open('https://outlook.office.com/owa/?path=/calendar/view/Day', '_blank'); } } ================================================ FILE: source/react-personal-calendar/src/webparts/personalCalendar/components/SimpleCalendar.module.scss ================================================ @import '~@fluentui/react/dist/sass/References.scss'; .calendarContainer { display: grid; grid-template-columns: repeat(7, auto); font-weight: bold; .dayContainer { position: relative; width: 100%; } .dayWrapper { height: 36px; width: 36px; text-align: center; margin: auto; } .day { text-align: center; padding: 9px 0; } .weekend, .past { color: grey; } .today { background-color: $ms-color-neutralLight; border-radius: 50%; } .monthText { text-align: center; font-size: 10px; padding-top: 4px; } .monthText + .day { padding-top: 0; } } ================================================ FILE: source/react-personal-calendar/src/webparts/personalCalendar/components/SimpleCalendar.tsx ================================================ import * as React from 'react'; import styles from './SimpleCalendar.module.scss'; import startOfWeek from 'date-fns/startOfWeek'; import addDays from 'date-fns/addDays'; import eachDayOfInterval from 'date-fns/eachDayOfInterval'; import format from 'date-fns/format'; import getDate from 'date-fns/getDate'; import isToday from 'date-fns/isToday'; import differenceInCalendarDays from 'date-fns/differenceInCalendarDays'; function SimpleCalendar () { const today = new Date(); const startDate = startOfWeek(today); const endDate = addDays(startDate, 13); return (
S
M
T
W
T
F
S
{eachDayOfInterval({start: startDate, end: endDate}).map((date: any, index: any) => { const isFirstOfMonth = getDate(date) === 1; const isPast = differenceInCalendarDays(today, date) > 0; return (
{isFirstOfMonth &&
{format(date, 'MMM')}
}
{format(date, 'd')}
); })}
); } export default SimpleCalendar; ================================================ FILE: source/react-personal-calendar/src/webparts/personalCalendar/components/index.ts ================================================ export * from './IMeeting'; export * from './IPersonalCalendarProps'; export * from './IPersonalCalendarState'; export * from './PersonalCalendar'; ================================================ FILE: source/react-personal-calendar/src/webparts/personalCalendar/loc/de-de.js ================================================ define([], function() { return { "AllDay": "Ganzer Tag", "DaysInAdvance": "Für wieviele Tage im vorraus sollen Besprechungen abgerufen werden? 0 - Nur Heute", "Error": "Ein Fehler beim abrufen der bevorstehend Besprechungen ist aufgetreten", "Hour": "Stunde", "Hours": "Stunden", "Loading": "Rufe bevorstehend Besprechungen auf", "Minutes": "Minuten", "NoMessages": "Sie haben keine bevorstehend Besprechungen", "NumMeetings": "Wieviele Besprechungen sollen angezeigt werden? 0 - Zeige alle abgerufenen Besprechungen", "RefreshInterval": "Wie oft soll nach bevorstehenden Besprechungen geprüft werden(in Minuten)", "PropertyPaneDescription": "Besprechungen Web Part Konfiguration", "ViewAll": "Vollständige Liste anzeigen" } }); ================================================ FILE: source/react-personal-calendar/src/webparts/personalCalendar/loc/en-us.js ================================================ define([], function() { return { "AllDay": "All day", "DaysInAdvance": "How many days in advance to retrieve meetings for? 0 - today only", "Error": "An error has occurred while retrieving your upcoming meetings", "Hour": "hour", "Hours": "hours", "Loading": "Retrieving your upcoming meeting", "Minutes": "minutes", "NewMeeting": "New meeting", "NoMessages": "You have no upcoming meetings", "NumMeetings": "How many meetings to show? 0 - show all retrieved meetings", "RefreshInterval": "How often to check for new upcoming meetings (in minutes)", "PropertyPaneDescription": "Meetings web part configuration", "ViewAll": "View the full list", "ShowCalendar": "Show Calendar" } }); ================================================ FILE: source/react-personal-calendar/src/webparts/personalCalendar/loc/es-es.js ================================================ define([], function() { return { "AllDay": "Todo el día", "DaysInAdvance": "Cuantos días por adelantado necesita retornar reuniones? 0 - solo hoy", "Error": "Ha ocurrido un error mientras retornabamos sus proximos eventos", "Hour": "hora", "Hours": "horas", "Loading": "Cargando sus proxima reuniones", "Minutes": "minutos", "NoMessages": "Usted no cuenta con proximas reuniones", "NumMeetings": "CCuantas reuniones mostrar? 0 - mostrar todas las reuniones obtenidas", "RefreshInterval": "Que tan frecuente revisar sus proximas reuniones (en minutos)", "PropertyPaneDescription": "Configuracion del elemento web de reuniones", "ViewAll": "Ver la lista completa" } }); ================================================ FILE: source/react-personal-calendar/src/webparts/personalCalendar/loc/fr-fr.js ================================================ define([], function() { return { "AllDay": "Toute la journée", "DaysInAdvance": "Combien de jours à l'avance pour récupérer des réunions? 0 - aujourd'hui uniquement", "Error": "Une erreur s'est produite lors de la récupération de vos réunions à venir", "Hour": "heure", "Hours": "heures", "Loading": "Récupération de votre prochaine réunion", "Minutes": "minutes", "NewMeeting": "Nouvelle réunion", "NoMessages": "Vous n'avez aucune réunion à venir", "NumMeetings": "Combien de réunions à montrer? 0 - afficher toutes les réunions récupérées", "RefreshInterval": "À quelle fréquence vérifier les nouvelles réunions à venir (en minutes)", "PropertyPaneDescription": "Configuration de réunions de la partie Web", "ViewAll": "Voir toute la liste" } }); ================================================ FILE: source/react-personal-calendar/src/webparts/personalCalendar/loc/mystrings.d.ts ================================================ declare interface IPersonalCalendarWebPartStrings { AllDay: string; DaysInAdvance: string; Error: string; Hour: string; Hours: string; Loading: string; Minutes: string; NewMeeting: string; NoMeetings: string; NumMeetings: string; RefreshInterval: string; PropertyPaneDescription: string; ViewAll: string; ShowCalendar: string; } declare module 'PersonalCalendarWebPartStrings' { const strings: IPersonalCalendarWebPartStrings; export = strings; } ================================================ FILE: source/react-personal-calendar/src/webparts/personalCalendar/loc/nb-no.js ================================================ define([], function() { return { "AllDay": "Hele dagen", "DaysInAdvance": "Antall dager i forveien å hente møter for? 0 - kun dagen i dag", "Error": "Det har oppstått en feil mens vi hentet de kommende møtene dine", "Hour": "time", "Hours": "timer", "Loading": "Henter dine kommende møter", "Minutes": "minutter", "NewMeeting": "Nytt møte", "NoMessages": "Du har ingen kommende møter", "NumMeetings": "Hvor mange møter skal vises? 0 - vis alle hentede møter", "RefreshInterval": "Hvor ofte skal du sjekke etter nye kommende møter (i minutter)", "PropertyPaneDescription": "Konfigurer møte webdelen", "ViewAll": "Vis hele listen" } }); ================================================ FILE: source/react-personal-calendar/src/webparts/personalCalendar/loc/nl-nl.js ================================================ define([], function() { return { "AllDay": "Volledige dag", "DaysInAdvance": "Van hoeveel dagen van tevoren wil je de meetings ophalen? 0 = alleen vandaag", "Error": "Een foutmelding is opgetreden bij het ophalen van de aankomende meetings", "Hour": "uur", "Hours": "uren", "Loading": "Aankomende meeting(s) aan het ophalen", "Minutes": "minuten", "NewMeeting": "Nieuwe meeting", "NoMessages": "Je hebt geen aankomende meetings", "NumMeetings": "Hoeveel meetings wil je tonen? 0 = laat alle opgehaalde meetings zien", "RefreshInterval": "Hoe vaak wil je aankomende meetings ophalen (in minuten)", "PropertyPaneDescription": "Meetings webpart configuratie", "ViewAll": "Bekijk de volledige lijst" } }); ================================================ FILE: source/react-personal-calendar/src/webparts/personalCalendar/loc/sv-se.js ================================================ define([], function() { return { "AllDay": "Heldag", "DaysInAdvance": "Hur många dagar i förväg att hämta möten för? 0 - endast idag", "Error": "Ett fel har uppstått när dina kommande möten skulle hämtas", "Hour": "timme", "Hours": "timmar", "Loading": "Hämtar dina kommande möten", "Minutes": "minuter", "NoMessages": "Du har inga kommande möten", "NumMeetings": "Hur många möten ska visas? 0 - alla hämtade möten visas", "RefreshInterval": "Hur ofta skall det kontrolleras om det finns nya kommande möten (i minuter)", "PropertyPaneDescription": "Möten webbdelskonfiguration", "ViewAll": "Visa hela listan" } }); ================================================ FILE: source/react-personal-calendar/src/webparts/personalCalendar/loc/tr-tr.js ================================================ define([], function() { return { "AllDay": "Tüm gün", "DaysInAdvance": "Kaç gün önceden öne almak istiyorsunuz? 0 - sadece bugün", "Error": "Yaklaşan toplantılarınız alınırken bir hata oluştu", "Hour": "saat", "Hours": "saat", "Loading": "Yaklaşan toplantınız alınıyor", "Minutes": "dakika", "NewMeeting": "Yeni toplantı", "NoMessages": "Yaklaşan toplantınız yok", "NumMeetings": "Gösterilecek kaç toplantı var? 0 - tüm alınan toplantıları göster", "RefreshInterval": "Yaklaşan yeni toplantıların ne sıklıkta kontrol edileceği (dakika olarak)", "PropertyPaneDescription": "Toplantılar web bölümü yapılandırması", "ViewAll": "Tam listeyi görüntüle" } }); ================================================ FILE: source/react-personal-calendar/tsconfig.json ================================================ { "extends": "./node_modules/@microsoft/rush-stack-compiler-4.5/includes/tsconfig-web.json", "compilerOptions": { "target": "es5", "forceConsistentCasingInFileNames": true, "module": "esnext", "moduleResolution": "node", "jsx": "react", "declaration": true, "sourceMap": true, "experimentalDecorators": true, "skipLibCheck": true, "outDir": "lib", "inlineSources": false, "strictNullChecks": false, "noImplicitAny": true, "typeRoots": [ "./node_modules/@types", "./node_modules/@microsoft" ], "types": [ "webpack-env" ], "lib": [ "es5", "dom", "es2015.collection", "es2015.promise" ] }, "include": [ "src/**/*.ts", "src/**/*.tsx" ] } ================================================ FILE: source/react-personal-contacts/.eslintrc.js ================================================ require('@rushstack/eslint-config/patch/modern-module-resolution'); module.exports = { extends: ['@microsoft/eslint-config-spfx/lib/profiles/react'], parserOptions: { tsconfigRootDir: __dirname }, overrides: [ { files: ['*.ts', '*.tsx'], parser: '@typescript-eslint/parser', 'parserOptions': { 'project': './tsconfig.json', 'ecmaVersion': 2018, 'sourceType': 'module' }, rules: { // Prevent usage of the JavaScript null value, while allowing code to access existing APIs that may require null. https://www.npmjs.com/package/@rushstack/eslint-plugin '@rushstack/no-new-null': 1, // Require Jest module mocking APIs to be called before any other statements in their code block. https://www.npmjs.com/package/@rushstack/eslint-plugin '@rushstack/hoist-jest-mock': 1, // Require regular expressions to be constructed from string constants rather than dynamically building strings at runtime. https://www.npmjs.com/package/@rushstack/eslint-plugin-security '@rushstack/security/no-unsafe-regexp': 1, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/adjacent-overload-signatures': 1, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // // CONFIGURATION: By default, these are banned: String, Boolean, Number, Object, Symbol '@typescript-eslint/ban-types': [ 1, { 'extendDefaults': false, 'types': { 'String': { 'message': 'Use \'string\' instead', 'fixWith': 'string' }, 'Boolean': { 'message': 'Use \'boolean\' instead', 'fixWith': 'boolean' }, 'Number': { 'message': 'Use \'number\' instead', 'fixWith': 'number' }, 'Object': { 'message': 'Use \'object\' instead, or else define a proper TypeScript type:' }, 'Symbol': { 'message': 'Use \'symbol\' instead', 'fixWith': 'symbol' }, 'Function': { 'message': 'The \'Function\' type accepts any function-like value.\nIt provides no type safety when calling the function, which can be a common source of bugs.\nIt also accepts things like class declarations, which will throw at runtime as they will not be called with \'new\'.\nIf you are expecting the function to accept certain arguments, you should explicitly define the function shape.' } } } ], // RATIONALE: Code is more readable when the type of every variable is immediately obvious. // Even if the compiler may be able to infer a type, this inference will be unavailable // to a person who is reviewing a GitHub diff. This rule makes writing code harder, // but writing code is a much less important activity than reading it. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/explicit-function-return-type': [ 0, { 'allowExpressions': true, 'allowTypedFunctionExpressions': true, 'allowHigherOrderFunctions': false } ], // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // Rationale to disable: although this is a recommended rule, it is up to dev to select coding style. // Set to 1 (warning) or 2 (error) to enable. '@typescript-eslint/explicit-member-accessibility': 0, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/no-array-constructor': 1, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // // RATIONALE: The "any" keyword disables static type checking, the main benefit of using TypeScript. // This rule should be suppressed only in very special cases such as JSON.stringify() // where the type really can be anything. Even if the type is flexible, another type // may be more appropriate such as "unknown", "{}", or "Record". '@typescript-eslint/no-explicit-any': 0, // RATIONALE: The #1 rule of promises is that every promise chain must be terminated by a catch() // handler. Thus wherever a Promise arises, the code must either append a catch handler, // or else return the object to a caller (who assumes this responsibility). Unterminated // promise chains are a serious issue. Besides causing errors to be silently ignored, // they can also cause a NodeJS process to terminate unexpectedly. '@typescript-eslint/no-floating-promises': 2, // RATIONALE: Catches a common coding mistake. '@typescript-eslint/no-for-in-array': 2, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/no-misused-new': 2, // RATIONALE: The "namespace" keyword is not recommended for organizing code because JavaScript lacks // a "using" statement to traverse namespaces. Nested namespaces prevent certain bundler // optimizations. If you are declaring loose functions/variables, it's better to make them // static members of a class, since classes support property getters and their private // members are accessible by unit tests. Also, the exercise of choosing a meaningful // class name tends to produce more discoverable APIs: for example, search+replacing // the function "reverse()" is likely to return many false matches, whereas if we always // write "Text.reverse()" is more unique. For large scale organization, it's recommended // to decompose your code into separate NPM packages, which ensures that component // dependencies are tracked more conscientiously. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/no-namespace': [ 1, { 'allowDeclarations': false, 'allowDefinitionFiles': false } ], // RATIONALE: Parameter properties provide a shorthand such as "constructor(public title: string)" // that avoids the effort of declaring "title" as a field. This TypeScript feature makes // code easier to write, but arguably sacrifices readability: In the notes for // "@typescript-eslint/member-ordering" we pointed out that fields are central to // a class's design, so we wouldn't want to bury them in a constructor signature // just to save some typing. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // Set to 1 (warning) or 2 (error) to enable the rule '@typescript-eslint/no-parameter-properties': 0, // RATIONALE: When left in shipping code, unused variables often indicate a mistake. Dead code // may impact performance. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/no-unused-vars': [ 1, { 'vars': 'all', // Unused function arguments often indicate a mistake in JavaScript code. However in TypeScript code, // the compiler catches most of those mistakes, and unused arguments are fairly common for type signatures // that are overriding a base class method or implementing an interface. 'args': 'none' } ], // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/no-use-before-define': [ 2, { 'functions': false, 'classes': true, 'variables': true, 'enums': true, 'typedefs': true } ], // Disallows require statements except in import statements. // In other words, the use of forms such as var foo = require("foo") are banned. Instead use ES6 style imports or import foo = require("foo") imports. '@typescript-eslint/no-var-requires': 'error', // RATIONALE: The "module" keyword is deprecated except when describing legacy libraries. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/prefer-namespace-keyword': 1, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // Rationale to disable: it's up to developer to decide if he wants to add type annotations // Set to 1 (warning) or 2 (error) to enable the rule '@typescript-eslint/no-inferrable-types': 0, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // Rationale to disable: declaration of empty interfaces may be helpful for generic types scenarios '@typescript-eslint/no-empty-interface': 0, // RATIONALE: This rule warns if setters are defined without getters, which is probably a mistake. 'accessor-pairs': 1, // RATIONALE: In TypeScript, if you write x["y"] instead of x.y, it disables type checking. 'dot-notation': [ 1, { 'allowPattern': '^_' } ], // RATIONALE: Catches code that is likely to be incorrect 'eqeqeq': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'for-direction': 1, // RATIONALE: Catches a common coding mistake. 'guard-for-in': 2, // RATIONALE: If you have more than 2,000 lines in a single source file, it's probably time // to split up your code. 'max-lines': ['warn', { max: 2000 }], // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-async-promise-executor': 2, // RATIONALE: Deprecated language feature. 'no-caller': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-compare-neg-zero': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-cond-assign': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-constant-condition': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-control-regex': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-debugger': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-delete-var': 2, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-duplicate-case': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-empty': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-empty-character-class': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-empty-pattern': 1, // RATIONALE: Eval is a security concern and a performance concern. 'no-eval': 1, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-ex-assign': 2, // RATIONALE: System types are global and should not be tampered with in a scalable code base. // If two different libraries (or two versions of the same library) both try to modify // a type, only one of them can win. Polyfills are acceptable because they implement // a standardized interoperable contract, but polyfills are generally coded in plain // JavaScript. 'no-extend-native': 1, // Disallow unnecessary labels 'no-extra-label': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-fallthrough': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-func-assign': 1, // RATIONALE: Catches a common coding mistake. 'no-implied-eval': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-invalid-regexp': 2, // RATIONALE: Catches a common coding mistake. 'no-label-var': 2, // RATIONALE: Eliminates redundant code. 'no-lone-blocks': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-misleading-character-class': 2, // RATIONALE: Catches a common coding mistake. 'no-multi-str': 2, // RATIONALE: It's generally a bad practice to call "new Thing()" without assigning the result to // a variable. Either it's part of an awkward expression like "(new Thing()).doSomething()", // or else implies that the constructor is doing nontrivial computations, which is often // a poor class design. 'no-new': 1, // RATIONALE: Obsolete language feature that is deprecated. 'no-new-func': 2, // RATIONALE: Obsolete language feature that is deprecated. 'no-new-object': 2, // RATIONALE: Obsolete notation. 'no-new-wrappers': 1, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-octal': 2, // RATIONALE: Catches code that is likely to be incorrect 'no-octal-escape': 2, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-regex-spaces': 2, // RATIONALE: Catches a common coding mistake. 'no-return-assign': 2, // RATIONALE: Security risk. 'no-script-url': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-self-assign': 2, // RATIONALE: Catches a common coding mistake. 'no-self-compare': 2, // RATIONALE: This avoids statements such as "while (a = next(), a && a.length);" that use // commas to create compound expressions. In general code is more readable if each // step is split onto a separate line. This also makes it easier to set breakpoints // in the debugger. 'no-sequences': 1, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-shadow-restricted-names': 2, // RATIONALE: Obsolete language feature that is deprecated. // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-sparse-arrays': 2, // RATIONALE: Although in theory JavaScript allows any possible data type to be thrown as an exception, // such flexibility adds pointless complexity, by requiring every catch block to test // the type of the object that it receives. Whereas if catch blocks can always assume // that their object implements the "Error" contract, then the code is simpler, and // we generally get useful additional information like a call stack. 'no-throw-literal': 2, // RATIONALE: Catches a common coding mistake. 'no-unmodified-loop-condition': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-unsafe-finally': 2, // RATIONALE: Catches a common coding mistake. 'no-unused-expressions': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-unused-labels': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-useless-catch': 1, // RATIONALE: Avoids a potential performance problem. 'no-useless-concat': 1, // RATIONALE: The "var" keyword is deprecated because of its confusing "hoisting" behavior. // Always use "let" or "const" instead. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json 'no-var': 2, // RATIONALE: Generally not needed in modern code. 'no-void': 1, // RATIONALE: Obsolete language feature that is deprecated. // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-with': 2, // RATIONALE: Makes logic easier to understand, since constants always have a known value // @typescript-eslint\eslint-plugin\dist\configs\eslint-recommended.js 'prefer-const': 1, // RATIONALE: Catches a common coding mistake where "resolve" and "reject" are confused. 'promise/param-names': 2, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'require-atomic-updates': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'require-yield': 1, // "Use strict" is redundant when using the TypeScript compiler. 'strict': [ 2, 'never' ], // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'use-isnan': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js // Set to 1 (warning) or 2 (error) to enable. // Rationale to disable: !!{} 'no-extra-boolean-cast': 0, // ==================================================================== // @microsoft/eslint-plugin-spfx // ==================================================================== '@microsoft/spfx/import-requires-chunk-name': 1, '@microsoft/spfx/no-require-ensure': 2, '@microsoft/spfx/pair-react-dom-render-unmount': 0 } }, { // For unit tests, we can be a little bit less strict. The settings below revise the // defaults specified in the extended configurations, as well as above. files: [ // Test files '*.test.ts', '*.test.tsx', '*.spec.ts', '*.spec.tsx', // Facebook convention '**/__mocks__/*.ts', '**/__mocks__/*.tsx', '**/__tests__/*.ts', '**/__tests__/*.tsx', // Microsoft convention '**/test/*.ts', '**/test/*.tsx' ], rules: {} } ] }; ================================================ FILE: source/react-personal-contacts/.gitignore ================================================ # Logs logs *.log npm-debug.log* # Dependency directories node_modules # Build generated files dist lib release solution temp *.sppkg .heft # Coverage directory used by tools like istanbul coverage # OSX .DS_Store # Visual Studio files .ntvs_analysis.dat .vs bin obj # Resx Generated Code *.resx.ts # Styles Generated Code *.scss.ts ================================================ FILE: source/react-personal-contacts/.npmignore ================================================ !dist config gulpfile.js release src temp tsconfig.json tslint.json *.log .yo-rc.json .vscode ================================================ FILE: source/react-personal-contacts/.vscode/launch.json ================================================ { "version": "0.2.0", "configurations": [ { "name": "Hosted workbench", "type": "pwa-chrome", "request": "launch", "url": "https://enter-your-SharePoint-site/_layouts/workbench.aspx", "webRoot": "${workspaceRoot}", "sourceMaps": true, "sourceMapPathOverrides": { "webpack:///.././src/*": "${webRoot}/src/*", "webpack:///../../../src/*": "${webRoot}/src/*", "webpack:///../../../../src/*": "${webRoot}/src/*", "webpack:///../../../../../src/*": "${webRoot}/src/*" }, "runtimeArgs": [ "--remote-debugging-port=9222", "-incognito" ] } ] } ================================================ FILE: source/react-personal-contacts/.vscode/settings.json ================================================ // Place your settings in this file to overwrite default and user settings. { // Configure glob patterns for excluding files and folders in the file explorer. "files.exclude": { "**/.git": true, "**/.DS_Store": true, "**/bower_components": true, "**/coverage": true, "**/lib-amd": true, "src/**/*.scss.ts": true }, "typescript.tsdk": ".\\node_modules\\typescript\\lib" } ================================================ FILE: source/react-personal-contacts/.yo-rc.json ================================================ { "@microsoft/generator-sharepoint": { "plusBeta": false, "isCreatingSolution": true, "nodeVersion": "16.19.0", "sdksVersions": { "@microsoft/microsoft-graph-client": "3.0.2", "@microsoft/teams-js": "2.4.1" }, "version": "1.16.1", "environment": "spo", "libraryName": "react-personal-contacts", "libraryId": "05a9dee1-2de3-40f0-bee3-d511aca62e0a", "packageManager": "npm", "skipFeatureDeployment": true, "isDomainIsolated": false, "componentType": "webpart" } } ================================================ FILE: source/react-personal-contacts/README.md ================================================ # Personal Contacts web part This web part provides you the ability to add a particular user's personal contacts on a web page. The web part may be configured to display a pre-defined number of contacts at a time. This web part is powered by the Microsoft Graph and currently requires that the Office 365 tenant be configured for targeted release for all users. ![Personal Contacts](../../assets/images/components/part-personal-contacts.gif) ## How to use this web part on your web pages 1. Place the page you want to add this web part to in edit mode. 2. Search for and insert the **Personal Contacts** web part. 3. Configure the web part to update its properties. ## Configurable Properties The `Personal Contacts` web part can be configured with the following properties: | Label | Property | Type | Required | Description | | ---- | ---- | ---- | ---- | ---- | | Personal contacts | title | string | no | The web part title, editable inline with the web part itself | | Number of contacts to show | nrOfContacts | number | no | Default: 5 - The number of contacts to show | ## Used SharePoint Framework Version ![drop](https://img.shields.io/badge/version-1.13.1-green.svg) * Only supported in SharePoint Online due to dependency on the Microsoft Graph APIs ## Applies to * [SharePoint Framework](https:/dev.office.com/sharepoint) * [Office 365 tenant](https://dev.office.com/sharepoint/docs/spfx/set-up-your-development-environment) ## Prerequisites none ## Solution Solution|Author(s) --------|--------- react-personal-contacts | Waldek Mastykarz ([@waldekm](https://twitter.com/waldekm)) react-personal-contacts | Vardhaman Deshpande ([@vrdmn](https://twitter.com/vrdmn)) react-presonal-contacts | Don Kirkham ([@DonKirkham](https://twitter.com/donkirkham)) react-presonal-contacts | Chandani Prajapati ([@Chandani_SPD](https://twitter.com/Chandani_SPD)) ## Version history Version|Date|Comments -------|----|-------- 1.0|May 2018| Initial release 2.0|January 2020| Upgrade to V2 3.0|February 2022| Upgrade to SPFx1.13.1 4.0|January 16, 2013|Initial release for SharePoint Starter Kit v3 (Upgraded to SPFx 1.16.1) ## Disclaimer **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.** --- ## Minimal Path to Awesome * Clone this repository * Move to solution folder * in the command line run: * `npm install` * `gulp serve` > Include any additional steps as needed. ## Features This Web Part illustrates the following concepts on top of the SharePoint Framework: * Using Microsoft Graph from the web parts * Hosting SharePoint Framework components as Microsoft Teams tabs * Using app pages in SharePoint Online ## Permissions Requested Resource | Permission --------|--------- Microsoft Graph | Contacts.Read ================================================ FILE: source/react-personal-contacts/config/config.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/config.2.0.schema.json", "version": "2.0", "bundles": { "personal-contacts-web-part": { "components": [ { "entrypoint": "./lib/webparts/personalContacts/PersonalContactsWebPart.js", "manifest": "./src/webparts/personalContacts/PersonalContactsWebPart.manifest.json" } ] } }, "externals": {}, "localizedResources": { "PersonalContactsWebPartStrings": "lib/webparts/personalContacts/loc/{locale}.js", "ControlStrings": "node_modules/@pnp/spfx-controls-react/lib/loc/{locale}.js", "PropertyControlStrings": "node_modules/@pnp/spfx-property-controls/lib/loc/{locale}.js" } } ================================================ FILE: source/react-personal-contacts/config/deploy-azure-storage.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/deploy-azure-storage.schema.json", "workingDir": "./release/assets/", "account": "", "container": "react-personal-contacts", "accessKey": "" } ================================================ FILE: source/react-personal-contacts/config/package-solution.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/package-solution.schema.json", "solution": { "name": "Starter Kit - Personal Contacts", "id": "05a9dee1-2de3-40f0-bee3-d511aca62e0a", "version": "3.0.0.0", "developer": { "name": "PnP Starter Kit", "privacyUrl": "", "termsOfUseUrl": "", "websiteUrl": "", "mpnId": "pnpsk" }, "metadata": { "shortDescription": { "default": "react-personal-contacts description" }, "longDescription": { "default": "react-personal-contacts description" }, "screenshotPaths": [], "videoUrl": "", "categories": [] }, "features": [ { "title": "react-personal-contacts PersonalContactsWebPart Feature", "description": "The feature that activates PersonalContactsWebPart from the react-personal-contacts solution.", "id": "156030ad-510a-49b6-b1ef-33097667c829", "version": "3.0.0.0", "componentIds": [ "156030ad-510a-49b6-b1ef-33097667c829" ] } ], "includeClientSideAssets": true, "skipFeatureDeployment": true, "isDomainIsolated": false, "webApiPermissionRequests": [ { "resource": "Microsoft Graph", "scope": "Contacts.Read" } ] }, "paths": { "zippedPackage": "solution/react-personal-contacts.sppkg" } } ================================================ FILE: source/react-personal-contacts/config/sass.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/core-build/sass.schema.json" } ================================================ FILE: source/react-personal-contacts/config/serve.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/spfx-serve.schema.json", "port": 4321, "https": true, "initialPage": "https://enter-your-SharePoint-site/_layouts/workbench.aspx" } ================================================ FILE: source/react-personal-contacts/config/write-manifests.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/write-manifests.schema.json", "cdnBasePath": "" } ================================================ FILE: source/react-personal-contacts/gulpfile.js ================================================ 'use strict'; const build = require('@microsoft/sp-build-web'); build.addSuppression(`Warning - [sass] The local CSS class 'ms-Grid' is not camelCase and will not be type-safe.`); var getTasks = build.rig.getTasks; build.rig.getTasks = function () { var result = getTasks.call(build.rig); result.set('serve', result.get('serve-deprecated')); return result; }; build.initialize(require('gulp')); ================================================ FILE: source/react-personal-contacts/package.json ================================================ { "name": "react-personal-contacts", "version": "3.0.0", "private": true, "main": "lib/index.js", "engines": { "node": ">=16.13.0 <17.0.0" }, "scripts": { "build": "gulp bundle", "clean": "gulp clean", "test": "gulp test" }, "dependencies": { "@microsoft/microsoft-graph-client": "^3.0.4", "@microsoft/sp-core-library": "1.16.1", "@microsoft/sp-lodash-subset": "1.16.1", "@microsoft/sp-office-ui-fabric-core": "1.16.1", "@microsoft/sp-property-pane": "1.16.1", "@microsoft/sp-webpart-base": "1.16.1", "@pnp/spfx-controls-react": "^3.12.0", "@pnp/spfx-property-controls": "^3.11.0", "office-ui-fabric-react": "^7.199.1", "react": "17.0.1", "react-dom": "17.0.1", "tslib": "2.3.1" }, "resolutions": { "@types/react": "16.8.8" }, "devDependencies": { "@microsoft/eslint-config-spfx": "1.16.1", "@microsoft/eslint-plugin-spfx": "1.16.1", "@microsoft/rush-stack-compiler-4.5": "0.2.2", "@microsoft/sp-build-web": "1.16.1", "@microsoft/sp-module-interfaces": "1.16.1", "@rushstack/eslint-config": "2.5.1", "@types/react": "17.0.45", "@types/react-dom": "17.0.17", "@types/webpack-env": "~1.15.2", "ajv": "^6.12.5", "eslint-plugin-react-hooks": "4.3.0", "gulp": "4.0.2", "typescript": "4.5.5" } } ================================================ FILE: source/react-personal-contacts/src/index.ts ================================================ // A file is required to be in the root of the /src directory by the TypeScript compiler ================================================ FILE: source/react-personal-contacts/src/webparts/personalContacts/PersonalContactsWebPart.manifest.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx/client-side-web-part-manifest.schema.json", "id": "156030ad-510a-49b6-b1ef-33097667c829", "alias": "PersonalContactsWebPart", "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, "supportedHosts": ["SharePointWebPart", "SharePointFullPage", "TeamsTab", "TeamsPersonalApp"], "preconfiguredEntries": [{ "groupId": "5c03119e-3074-46fd-976b-c60198311f70", // Other "group": { "default": "Other" }, "title": { "default": "PersonalContacts" }, "description": { "default": "Personal contacts of the user" }, "officeFabricIconFontName": "ContactHeart", "properties": { "title": "Personal Contacts", "nrOfContacts": 5 } }] } ================================================ FILE: source/react-personal-contacts/src/webparts/personalContacts/PersonalContactsWebPart.ts ================================================ import * as React from 'react'; import * as ReactDom from 'react-dom'; import { Version } from '@microsoft/sp-core-library'; import { BaseClientSideWebPart } from "@microsoft/sp-webpart-base"; import { IPropertyPaneConfiguration } from "@microsoft/sp-property-pane"; import * as strings from 'PersonalContactsWebPartStrings'; import { PersonalContacts, IPersonalContactsProps } from './components/PersonalContacts'; import { MSGraphClientV3 } from '@microsoft/sp-http'; export interface IPersonalContactsWebPartProps { title: string; nrOfContacts: number; } export default class PersonalContactsWebPart extends BaseClientSideWebPart { private graphClient: MSGraphClientV3; private propertyFieldNumber : any; public onInit(): Promise { return new Promise((resolve: () => void, reject: (error: any) => void): void => { this.context.msGraphClientFactory .getClient('3') .then((client: MSGraphClientV3): void => { this.graphClient = client; resolve(); }, err => reject(err)); }); } public render(): void { const element: React.ReactElement = React.createElement( PersonalContacts, { title: this.properties.title, nrOfContacts: this.properties.nrOfContacts, // pass the reference to the MSGraphClient graphClient: this.graphClient, // pass the current display mode to determine if the title should be // editable or not displayMode: this.displayMode, // handle updated web part title updateProperty: (value: string): void => { // store the new title in the title web part property this.properties.title = value; } } ); ReactDom.render(element, this.domElement); } protected get dataVersion(): Version { return Version.parse('1.0'); } //executes only before property pane is loaded. protected async loadPropertyPaneResources(): Promise { // import additional controls/components const { PropertyFieldNumber } = await import( /* webpackChunkName: 'pnp-propcontrols-number' */ '@pnp/spfx-property-controls/lib/propertyFields/number' ); this.propertyFieldNumber = PropertyFieldNumber; } protected getPropertyPaneConfiguration(): IPropertyPaneConfiguration { return { pages: [ { header: { description: strings.PropertyPaneDescription }, groups: [ { groupFields: [ this.propertyFieldNumber("nrOfContacts", { key: "nrOfContacts", label: strings.NrOfContactsToShow, value: this.properties.nrOfContacts, minValue: 1, maxValue: 10 }) ] } ] } ] }; } } ================================================ FILE: source/react-personal-contacts/src/webparts/personalContacts/components/IContacts.ts ================================================ export interface IContacts { value?: IContact[]; } export interface IContact { id: string; displayName: string; homePhones?: string[]; mobilePhone?: string; businessPhones?: string[]; emailAddresses: { name: string; address: string; }[]; } ================================================ FILE: source/react-personal-contacts/src/webparts/personalContacts/components/Person/IPersonProps.ts ================================================ import { MSGraphClientV3 } from '@microsoft/sp-http'; import { IContact } from ".."; export interface IPersonProps { graphClient: MSGraphClientV3; person: IContact; } ================================================ FILE: source/react-personal-contacts/src/webparts/personalContacts/components/Person/IPersonState.ts ================================================ export interface IPersonState { image: string; } ================================================ FILE: source/react-personal-contacts/src/webparts/personalContacts/components/Person/Person.module.scss ================================================ @import '~@fluentui/react/dist/sass/References.scss'; .persona { margin-bottom: 5px; } ================================================ FILE: source/react-personal-contacts/src/webparts/personalContacts/components/Person/Person.tsx ================================================ import * as React from 'react'; import styles from './Person.module.scss'; import { IPersonProps, IPersonState } from '.'; import { Persona, PersonaSize, IPersonaProps } from '@fluentui/react/lib/Persona'; import { Link } from '@fluentui/react/lib/Link'; import { GraphError } from '@microsoft/microsoft-graph-client/lib/src'; export class Person extends React.Component { constructor(props: IPersonProps) { super(props); this.state = { image: null }; } /** * Renders the secondary field as mail */ private _renderMail = (props: IPersonaProps) => { if (props.secondaryText) { return {props.secondaryText}; } return
; } /** * Renders the tertiary field as mail */ private _renderPhone = (props: IPersonaProps) => { if (props.tertiaryText) { return {props.tertiaryText}; } return
; } private _setPhoto(rawResponse: any): void { if (rawResponse && rawResponse.xhr && rawResponse.xhr.response) { const url = window.URL; const blobUrl = url.createObjectURL(rawResponse.xhr.response); this.setState({ image: blobUrl }); } } /** * componentDidMount lifecycle hook */ public componentDidMount(): void { const { person, graphClient } = this.props; if (!person) { return; } // download contact photo graphClient .api(`me/contacts/${person.id}/photo/$value`) .version('v1.0') .responseType('blob') .get((err: GraphError, res: any, rawResponse: any): void => { if (err && err.statusCode === 404) { // no photo set on the contact, try retrieving from the user object if (!person.emailAddresses || person.emailAddresses.length < 1) { // no email available, can't retrieve photo for the user return; } graphClient .api(`users/${person.emailAddresses[0].address}/photo/$value`) .version('v1.0') .responseType('blob') .get((err2: GraphError, res2: any, rawResponse2: any): void => { this._setPhoto(rawResponse2); }); } else { this._setPhoto(rawResponse); } }); } /** * Default React render */ public render(): React.ReactElement { const { person } = this.props; let phoneNr: string = null; if (person.businessPhones && person.businessPhones.length > 0) { phoneNr = person.businessPhones[0]; } else { if (person.mobilePhone) { phoneNr = person.mobilePhone; } else { if (person.homePhones && person.homePhones.length > 0) { phoneNr = person.homePhones[0]; } } } return 0) && person.emailAddresses[0].address} onRenderSecondaryText={this._renderMail} tertiaryText={phoneNr} onRenderTertiaryText={this._renderPhone} imageUrl={this.state.image} size={PersonaSize.size72} />; } } ================================================ FILE: source/react-personal-contacts/src/webparts/personalContacts/components/Person/index.ts ================================================ export * from './IPersonProps'; export * from './IPersonState'; export * from './Person'; ================================================ FILE: source/react-personal-contacts/src/webparts/personalContacts/components/PersonalContacts/IPersonalContactsProps.ts ================================================ import { DisplayMode } from '@microsoft/sp-core-library'; import { IPersonalContactsWebPartProps } from '../../PersonalContactsWebPart'; import { MSGraphClientV3 } from '@microsoft/sp-http'; export interface IPersonalContactsProps extends IPersonalContactsWebPartProps { displayMode: DisplayMode; graphClient: MSGraphClientV3; updateProperty: (value: string) => void; } ================================================ FILE: source/react-personal-contacts/src/webparts/personalContacts/components/PersonalContacts/IPersonalContactsState.ts ================================================ import { IContact } from '..'; export interface IPersonalContactsState { contacts: IContact[]; error: string; loading: boolean; } ================================================ FILE: source/react-personal-contacts/src/webparts/personalContacts/components/PersonalContacts/PersonalContacts.module.scss ================================================ @import '~@fluentui/react/dist/sass/References.scss'; .personalContacts { .persona { margin-bottom: 5px; } .noContacts { @include ms-font-m; } .error { @include ms-font-m; color: $ms-color-alert; } } ================================================ FILE: source/react-personal-contacts/src/webparts/personalContacts/components/PersonalContacts/PersonalContacts.tsx ================================================ import * as React from 'react'; import styles from './PersonalContacts.module.scss'; import * as strings from 'PersonalContactsWebPartStrings'; import { IPersonalContactsProps, IPersonalContactsState } from '.'; import { IContact, IContacts } from '..'; import { WebPartTitle } from '@pnp/spfx-controls-react/lib/WebPartTitle'; import { Spinner, SpinnerSize } from '@fluentui/react/lib/Spinner'; import { List } from '@fluentui/react/lib/List'; import { Link } from '@fluentui/react/lib/Link'; import { Person } from '../Person'; export class PersonalContacts extends React.Component { /** * */ constructor(props: IPersonalContactsProps) { super(props); this.state = { contacts: [], loading: false, error: undefined }; } /** * Fetch the recently used contacts for the user */ private _loadContacts(): void { if (!this.props.graphClient) { return; } // update state to indicate loading and remove any previously loaded // messages this.setState({ error: null, loading: true, contacts: [] }); this.props.graphClient .api("me/contacts") .version("v1.0") .select("id,displayName,emailAddresses,businessPhones,mobilePhone,homePhones") .top(this.props.nrOfContacts || 5) .get((err: any, res: IContacts): void => { if (err) { // Something failed calling the MS Graph this.setState({ error: err.message ? err.message : strings.Error, loading: false }); return; } // Check if a response was retrieved if (res && res.value && res.value.length > 0) { this.setState({ contacts: res.value, loading: false }); } else { // No contacts found this.setState({ loading: false }); } }); } /** * Renders the list cell for the persona's */ private _onRenderCell = (item: IContact, index: number | undefined): JSX.Element => { return ; } /** * Renders the secondary field as mail */ // private _renderMail = (props: IPersonaProps): JSX.Element => { // if (props.secondaryText) { // return {props.secondaryText}; // } // return
; // } /** * Renders the tertiary field as mail */ // private _renderPhone = (props: IPersonaProps): JSX.Element => { // if (props.tertiaryText) { // return {props.tertiaryText}; // } // return
; // } public componentDidMount(): void { // load data initially after the component has been instantiated this._loadContacts(); } public componentDidUpdate(prevProps: IPersonalContactsProps, prevState: IPersonalContactsState): void { // verify if the component should update. Helps avoid unnecessary re-renders // when the parent has changed but this component hasn't if (prevProps.nrOfContacts !== this.props.nrOfContacts) { this._loadContacts(); } } public render(): React.ReactElement { return (
{ this.state.loading && } { this.state.contacts && this.state.contacts.length > 0 ? (
{strings.ViewAll}
) : ( !this.state.loading && ( this.state.error ? {this.state.error} : {strings.NoContacts} ) ) }
); } } ================================================ FILE: source/react-personal-contacts/src/webparts/personalContacts/components/PersonalContacts/index.ts ================================================ export * from './IPersonalContactsProps'; export * from './IPersonalContactsState'; export * from './PersonalContacts'; ================================================ FILE: source/react-personal-contacts/src/webparts/personalContacts/components/index.ts ================================================ export * from './IContacts'; ================================================ FILE: source/react-personal-contacts/src/webparts/personalContacts/loc/de-de.js ================================================ define([], function() { return { "Error": "Ein Fehler beim abrufen Ihrer Kontakte ist aufgetreten.", "Loading": "Rufe Ihre Kontakte auf", "NoContacts": "Keine Kontake gefunden", "NrOfContactsToShow": "Anzahl der anzuzeigenden Kontakte", "PropertyPaneDescription": "Kontakte Web Part Konfiguration", "ViewAll": "Vollständige Liste anzeigen" } }); ================================================ FILE: source/react-personal-contacts/src/webparts/personalContacts/loc/en-us.js ================================================ define([], function() { return { "Error": "An error has occurred while retrieving your contacts", "Loading": "Retrieving your contacts", "NoContacts": "No contacts were found", "NrOfContactsToShow": "Number of contacts to show", "PropertyPaneDescription": "Contacts web part configuration", "ViewAll": "View the full list" } }); ================================================ FILE: source/react-personal-contacts/src/webparts/personalContacts/loc/es-es.js ================================================ define([], function() { return { "Error": "Un error ha ocurrido mientras obtenemos sus contactos", "Loading": "Retornando sus contactos", "NoContacts": "No se encontraton contactos", "NrOfContactsToShow": "Numero de contactos a mostrar", "PropertyPaneDescription": "Configuracion del elemento web de Contactos", "ViewAll": "Ver la lista completa" } }); ================================================ FILE: source/react-personal-contacts/src/webparts/personalContacts/loc/fr-fr.js ================================================ define([], function() { return { "Error": "Une erreur est survenue lors de la récupération de vos contacts", "Loading": "Récupération de vos contacts", "NoContacts": "Aucun contact n'a été trouvé", "NrOfContactsToShow": "Nombre de contacts à afficher", "PropertyPaneDescription": "Configuration des contacts de la partie Web", "ViewAll": "Voir toute la liste" } }); ================================================ FILE: source/react-personal-contacts/src/webparts/personalContacts/loc/mystrings.d.ts ================================================ declare interface IPersonalContactsWebPartStrings { Error: string; Loading: string; NoContacts: string; NrOfContactsToShow: string; PropertyPaneDescription: string; ViewAll: string; } declare module 'PersonalContactsWebPartStrings' { const strings: IPersonalContactsWebPartStrings; export = strings; } ================================================ FILE: source/react-personal-contacts/src/webparts/personalContacts/loc/nb-no.js ================================================ define([], function() { return { "Error": "En feil oppstod ved henting av dine kontakter", "Loading": "Henter dine kontakter", "NoContacts": "Ingen kontakter funnet", "NrOfContactsToShow": "Antall kontakter som skal vises", "PropertyPaneDescription": "Konfigurer kontakter webdelen", "ViewAll": "Vis hele listen" } }); ================================================ FILE: source/react-personal-contacts/src/webparts/personalContacts/loc/nl-nl.js ================================================ define([], function() { return { "Error": "Een foutmelding is opgetreden tijdens het ophalen van je contactpersonen", "Loading": "Contactpersonen aan het ophalen", "NoContacts": "Geen contactpersonen gevonden", "NrOfContactsToShow": "Aantal te tonen contactpersonen", "PropertyPaneDescription": "Contactpersonen webpart configuratie", "ViewAll": "Bekijk de volledige lijst" } }); ================================================ FILE: source/react-personal-contacts/src/webparts/personalContacts/loc/sv-se.js ================================================ define([], function() { return { "Error": "Ett fel uppstod när dina kontakter hämtades", "Loading": "Hämtar dina kontakter", "NoContacts": "Inga kontakter hittades", "NrOfContactsToShow": "Antal kontakter att visa", "PropertyPaneDescription": "Kontaker webbdelskonfiguration", "ViewAll": "Visa hela listan" } }); ================================================ FILE: source/react-personal-contacts/src/webparts/personalContacts/loc/tr-tr.js ================================================ define([], function() { return { "Error": "Rehberinizi alırken bir hata oluştu", "Loading": "Kişilerinizi alınıyor", "NoContacts": "Kişi bulunamadı", "NrOfContactsToShow": "Gösterilecek kişi sayısı", "PropertyPaneDescription": "Rehber web parçası yapılandırması", "ViewAll": "Tam listeyi görüntüle" } }); ================================================ FILE: source/react-personal-contacts/tsconfig.json ================================================ { "extends": "./node_modules/@microsoft/rush-stack-compiler-4.5/includes/tsconfig-web.json", "compilerOptions": { "target": "es5", "forceConsistentCasingInFileNames": true, "module": "esnext", "moduleResolution": "node", "jsx": "react", "declaration": true, "sourceMap": true, "experimentalDecorators": true, "skipLibCheck": true, "outDir": "lib", "inlineSources": false, "strictNullChecks": false, "noImplicitAny": true, "typeRoots": [ "./node_modules/@types", "./node_modules/@microsoft" ], "types": [ "webpack-env" ], "lib": [ "es5", "dom", "es2015.collection", "es2015.promise" ] }, "include": [ "src/**/*.ts", "src/**/*.tsx" ] } ================================================ FILE: source/react-personal-email/.editorconfig ================================================ # EditorConfig helps developers define and maintain consistent # coding styles between different editors and IDEs # editorconfig.org root = true [*] # change these settings to your own preference indent_style = space indent_size = 2 # we recommend you to keep these unchanged end_of_line = lf charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true [*.md] trim_trailing_whitespace = false [{package,bower}.json] indent_style = space indent_size = 2 ================================================ FILE: source/react-personal-email/.eslintrc.js ================================================ require('@rushstack/eslint-config/patch/modern-module-resolution'); module.exports = { extends: ['@microsoft/eslint-config-spfx/lib/profiles/react'], parserOptions: { tsconfigRootDir: __dirname }, overrides: [ { files: ['*.ts', '*.tsx'], parser: '@typescript-eslint/parser', 'parserOptions': { 'project': './tsconfig.json', 'ecmaVersion': 2018, 'sourceType': 'module' }, rules: { // Prevent usage of the JavaScript null value, while allowing code to access existing APIs that may require null. https://www.npmjs.com/package/@rushstack/eslint-plugin '@rushstack/no-new-null': 1, // Require Jest module mocking APIs to be called before any other statements in their code block. https://www.npmjs.com/package/@rushstack/eslint-plugin '@rushstack/hoist-jest-mock': 1, // Require regular expressions to be constructed from string constants rather than dynamically building strings at runtime. https://www.npmjs.com/package/@rushstack/eslint-plugin-security '@rushstack/security/no-unsafe-regexp': 1, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/adjacent-overload-signatures': 1, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // // CONFIGURATION: By default, these are banned: String, Boolean, Number, Object, Symbol '@typescript-eslint/ban-types': [ 1, { 'extendDefaults': false, 'types': { 'String': { 'message': 'Use \'string\' instead', 'fixWith': 'string' }, 'Boolean': { 'message': 'Use \'boolean\' instead', 'fixWith': 'boolean' }, 'Number': { 'message': 'Use \'number\' instead', 'fixWith': 'number' }, 'Object': { 'message': 'Use \'object\' instead, or else define a proper TypeScript type:' }, 'Symbol': { 'message': 'Use \'symbol\' instead', 'fixWith': 'symbol' }, 'Function': { 'message': 'The \'Function\' type accepts any function-like value.\nIt provides no type safety when calling the function, which can be a common source of bugs.\nIt also accepts things like class declarations, which will throw at runtime as they will not be called with \'new\'.\nIf you are expecting the function to accept certain arguments, you should explicitly define the function shape.' } } } ], // RATIONALE: Code is more readable when the type of every variable is immediately obvious. // Even if the compiler may be able to infer a type, this inference will be unavailable // to a person who is reviewing a GitHub diff. This rule makes writing code harder, // but writing code is a much less important activity than reading it. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/explicit-function-return-type': [ 0, { 'allowExpressions': true, 'allowTypedFunctionExpressions': true, 'allowHigherOrderFunctions': false } ], // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // Rationale to disable: although this is a recommended rule, it is up to dev to select coding style. // Set to 1 (warning) or 2 (error) to enable. '@typescript-eslint/explicit-member-accessibility': 0, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/no-array-constructor': 1, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // // RATIONALE: The "any" keyword disables static type checking, the main benefit of using TypeScript. // This rule should be suppressed only in very special cases such as JSON.stringify() // where the type really can be anything. Even if the type is flexible, another type // may be more appropriate such as "unknown", "{}", or "Record". '@typescript-eslint/no-explicit-any': 0, // RATIONALE: The #1 rule of promises is that every promise chain must be terminated by a catch() // handler. Thus wherever a Promise arises, the code must either append a catch handler, // or else return the object to a caller (who assumes this responsibility). Unterminated // promise chains are a serious issue. Besides causing errors to be silently ignored, // they can also cause a NodeJS process to terminate unexpectedly. '@typescript-eslint/no-floating-promises': 2, // RATIONALE: Catches a common coding mistake. '@typescript-eslint/no-for-in-array': 2, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/no-misused-new': 2, // RATIONALE: The "namespace" keyword is not recommended for organizing code because JavaScript lacks // a "using" statement to traverse namespaces. Nested namespaces prevent certain bundler // optimizations. If you are declaring loose functions/variables, it's better to make them // static members of a class, since classes support property getters and their private // members are accessible by unit tests. Also, the exercise of choosing a meaningful // class name tends to produce more discoverable APIs: for example, search+replacing // the function "reverse()" is likely to return many false matches, whereas if we always // write "Text.reverse()" is more unique. For large scale organization, it's recommended // to decompose your code into separate NPM packages, which ensures that component // dependencies are tracked more conscientiously. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/no-namespace': [ 1, { 'allowDeclarations': false, 'allowDefinitionFiles': false } ], // RATIONALE: Parameter properties provide a shorthand such as "constructor(public title: string)" // that avoids the effort of declaring "title" as a field. This TypeScript feature makes // code easier to write, but arguably sacrifices readability: In the notes for // "@typescript-eslint/member-ordering" we pointed out that fields are central to // a class's design, so we wouldn't want to bury them in a constructor signature // just to save some typing. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // Set to 1 (warning) or 2 (error) to enable the rule '@typescript-eslint/no-parameter-properties': 0, // RATIONALE: When left in shipping code, unused variables often indicate a mistake. Dead code // may impact performance. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/no-unused-vars': [ 1, { 'vars': 'all', // Unused function arguments often indicate a mistake in JavaScript code. However in TypeScript code, // the compiler catches most of those mistakes, and unused arguments are fairly common for type signatures // that are overriding a base class method or implementing an interface. 'args': 'none' } ], // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/no-use-before-define': [ 2, { 'functions': false, 'classes': true, 'variables': true, 'enums': true, 'typedefs': true } ], // Disallows require statements except in import statements. // In other words, the use of forms such as var foo = require("foo") are banned. Instead use ES6 style imports or import foo = require("foo") imports. '@typescript-eslint/no-var-requires': 'error', // RATIONALE: The "module" keyword is deprecated except when describing legacy libraries. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/prefer-namespace-keyword': 1, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // Rationale to disable: it's up to developer to decide if he wants to add type annotations // Set to 1 (warning) or 2 (error) to enable the rule '@typescript-eslint/no-inferrable-types': 0, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // Rationale to disable: declaration of empty interfaces may be helpful for generic types scenarios '@typescript-eslint/no-empty-interface': 0, // RATIONALE: This rule warns if setters are defined without getters, which is probably a mistake. 'accessor-pairs': 1, // RATIONALE: In TypeScript, if you write x["y"] instead of x.y, it disables type checking. 'dot-notation': [ 1, { 'allowPattern': '^_' } ], // RATIONALE: Catches code that is likely to be incorrect 'eqeqeq': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'for-direction': 1, // RATIONALE: Catches a common coding mistake. 'guard-for-in': 2, // RATIONALE: If you have more than 2,000 lines in a single source file, it's probably time // to split up your code. 'max-lines': ['warn', { max: 2000 }], // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-async-promise-executor': 2, // RATIONALE: Deprecated language feature. 'no-caller': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-compare-neg-zero': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-cond-assign': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-constant-condition': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-control-regex': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-debugger': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-delete-var': 2, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-duplicate-case': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-empty': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-empty-character-class': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-empty-pattern': 1, // RATIONALE: Eval is a security concern and a performance concern. 'no-eval': 1, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-ex-assign': 2, // RATIONALE: System types are global and should not be tampered with in a scalable code base. // If two different libraries (or two versions of the same library) both try to modify // a type, only one of them can win. Polyfills are acceptable because they implement // a standardized interoperable contract, but polyfills are generally coded in plain // JavaScript. 'no-extend-native': 1, // Disallow unnecessary labels 'no-extra-label': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-fallthrough': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-func-assign': 1, // RATIONALE: Catches a common coding mistake. 'no-implied-eval': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-invalid-regexp': 2, // RATIONALE: Catches a common coding mistake. 'no-label-var': 2, // RATIONALE: Eliminates redundant code. 'no-lone-blocks': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-misleading-character-class': 2, // RATIONALE: Catches a common coding mistake. 'no-multi-str': 2, // RATIONALE: It's generally a bad practice to call "new Thing()" without assigning the result to // a variable. Either it's part of an awkward expression like "(new Thing()).doSomething()", // or else implies that the constructor is doing nontrivial computations, which is often // a poor class design. 'no-new': 1, // RATIONALE: Obsolete language feature that is deprecated. 'no-new-func': 2, // RATIONALE: Obsolete language feature that is deprecated. 'no-new-object': 2, // RATIONALE: Obsolete notation. 'no-new-wrappers': 1, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-octal': 2, // RATIONALE: Catches code that is likely to be incorrect 'no-octal-escape': 2, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-regex-spaces': 2, // RATIONALE: Catches a common coding mistake. 'no-return-assign': 2, // RATIONALE: Security risk. 'no-script-url': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-self-assign': 2, // RATIONALE: Catches a common coding mistake. 'no-self-compare': 2, // RATIONALE: This avoids statements such as "while (a = next(), a && a.length);" that use // commas to create compound expressions. In general code is more readable if each // step is split onto a separate line. This also makes it easier to set breakpoints // in the debugger. 'no-sequences': 1, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-shadow-restricted-names': 2, // RATIONALE: Obsolete language feature that is deprecated. // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-sparse-arrays': 2, // RATIONALE: Although in theory JavaScript allows any possible data type to be thrown as an exception, // such flexibility adds pointless complexity, by requiring every catch block to test // the type of the object that it receives. Whereas if catch blocks can always assume // that their object implements the "Error" contract, then the code is simpler, and // we generally get useful additional information like a call stack. 'no-throw-literal': 2, // RATIONALE: Catches a common coding mistake. 'no-unmodified-loop-condition': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-unsafe-finally': 2, // RATIONALE: Catches a common coding mistake. 'no-unused-expressions': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-unused-labels': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-useless-catch': 1, // RATIONALE: Avoids a potential performance problem. 'no-useless-concat': 1, // RATIONALE: The "var" keyword is deprecated because of its confusing "hoisting" behavior. // Always use "let" or "const" instead. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json 'no-var': 2, // RATIONALE: Generally not needed in modern code. 'no-void': 1, // RATIONALE: Obsolete language feature that is deprecated. // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-with': 2, // RATIONALE: Makes logic easier to understand, since constants always have a known value // @typescript-eslint\eslint-plugin\dist\configs\eslint-recommended.js 'prefer-const': 1, // RATIONALE: Catches a common coding mistake where "resolve" and "reject" are confused. 'promise/param-names': 2, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'require-atomic-updates': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'require-yield': 1, // "Use strict" is redundant when using the TypeScript compiler. 'strict': [ 2, 'never' ], // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'use-isnan': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js // Set to 1 (warning) or 2 (error) to enable. // Rationale to disable: !!{} 'no-extra-boolean-cast': 0, // ==================================================================== // @microsoft/eslint-plugin-spfx // ==================================================================== '@microsoft/spfx/import-requires-chunk-name': 1, '@microsoft/spfx/no-require-ensure': 2, '@microsoft/spfx/pair-react-dom-render-unmount': 0 } }, { // For unit tests, we can be a little bit less strict. The settings below revise the // defaults specified in the extended configurations, as well as above. files: [ // Test files '*.test.ts', '*.test.tsx', '*.spec.ts', '*.spec.tsx', // Facebook convention '**/__mocks__/*.ts', '**/__mocks__/*.tsx', '**/__tests__/*.ts', '**/__tests__/*.tsx', // Microsoft convention '**/test/*.ts', '**/test/*.tsx' ], rules: {} } ] }; ================================================ FILE: source/react-personal-email/.gitignore ================================================ # Logs logs *.log npm-debug.log* # Dependency directories node_modules # Build generated files dist lib release solution temp *.sppkg .heft # Coverage directory used by tools like istanbul coverage # OSX .DS_Store # Visual Studio files .ntvs_analysis.dat .vs bin obj # Resx Generated Code *.resx.ts # Styles Generated Code *.scss.ts ================================================ FILE: source/react-personal-email/.npmignore ================================================ !dist config gulpfile.js release src temp tsconfig.json tslint.json *.log .yo-rc.json .vscode ================================================ FILE: source/react-personal-email/.vscode/launch.json ================================================ { "version": "0.2.0", "configurations": [ { "name": "Hosted workbench", "type": "pwa-chrome", "request": "launch", "url": "https://enter-your-SharePoint-site/_layouts/workbench.aspx", "webRoot": "${workspaceRoot}", "sourceMaps": true, "sourceMapPathOverrides": { "webpack:///.././src/*": "${webRoot}/src/*", "webpack:///../../../src/*": "${webRoot}/src/*", "webpack:///../../../../src/*": "${webRoot}/src/*", "webpack:///../../../../../src/*": "${webRoot}/src/*" }, "runtimeArgs": [ "--remote-debugging-port=9222", "-incognito" ] } ] } ================================================ FILE: source/react-personal-email/.vscode/settings.json ================================================ // Place your settings in this file to overwrite default and user settings. { // Configure glob patterns for excluding files and folders in the file explorer. "files.exclude": { "**/.git": true, "**/.DS_Store": true, "**/bower_components": true, "**/coverage": true, "**/lib-amd": true, "src/**/*.scss.ts": true }, "typescript.tsdk": ".\\node_modules\\typescript\\lib" } ================================================ FILE: source/react-personal-email/.yo-rc.json ================================================ { "@microsoft/generator-sharepoint": { "plusBeta": false, "isCreatingSolution": true, "nodeVersion": "16.19.0", "sdksVersions": { "@microsoft/microsoft-graph-client": "3.0.2", "@microsoft/teams-js": "2.4.1" }, "version": "1.16.1", "environment": "spo", "libraryName": "react-personal-email", "libraryId": "7c886936-7bcd-4ef5-ac98-e802299dc5ad", "packageManager": "npm", "skipFeatureDeployment": true, "isDomainIsolated": false, "componentType": "webpart" } } ================================================ FILE: source/react-personal-email/README.md ================================================ # Personal Email web part This web part provides you the ability to add a particular user's personal email on a web page. The web part may be configured to display a pre-defined number of emails at a time and includes a link to the user's Outlook to view all email. This web part is powered by the Microsoft Graph and currently requires that the Office 365 tenant be configured for targeted release for all users. Demostrates the use of **this.context.msGraphClientFactory**, getting the **v3** Graph client, to make Graph calls to **me/messages** and **me/mailFolders/Inbox/messages** Graph endpoints. ![Personal Email](../../assets/images/components/part-personal-email.gif) ## How to use this web part on your web pages 1. Place the page you want to add this web part to in edit mode. 2. Search for and insert the **Personal Email** web part. 3. Configure the web part to update its properties. ## Configurable Properties The `Personal Email` web part can be configured with the following properties: | Label | Property | Type | Required | Description | | ---- | ---- | ---- | ---- | ---- | | Personal e-mail | title | string | no | The web part title, editable inline with the web part itself | | Number of messages to show | nrOfMessages | number | no | Default: 5 - The number of emails to show | ## Used SharePoint Framework Version ![drop](https://img.shields.io/badge/version-1.16.1-green.svg) * Supported in SharePoint Online ## Applies to * [SharePoint Framework](https://learn.microsoft.com/en-us/sharepoint/dev/spfx/sharepoint-framework-overview) * [Office 365 tenant](https://learn.microsoft.com/en-us/sharepoint/dev/spfx/set-up-your-development-environment) ## Prerequisites Graph API Persmissions ```json webApiPermissionRequests": [ { "resource": "Microsoft Graph", "scope": "Mail.Read" } ] ``` ## Solution Solution|Author(s) --------|--------- react-personal-email| Waldek Mastykarz react-personal-email| Beau Cameron react-personal-email| Chandani Prajapati ## Version history Version|Date|Comments -------|----|-------- 1.0|May, 2018|Initial release 2.0|November 29, 2019|v2.0 3.0|February 2023|Initial release for SharePoint Starter Kit v3 (Upgraded to SPFx 1.16.1) ## Disclaimer **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.** --- ## Minimal Path to Awesome * Clone this repository * Move to solution folder * in the command line run: * `npm install` * `gulp serve` > Include any additional steps as needed. ## Features Description of the web part with possible additional details than in short summary. This Web Part illustrates the following concepts on top of the SharePoint Framework: * Using Microsoft Graph from the web parts * Hosting SharePoint Framework components as Microsoft Teams tabs * Using app pages in SharePoint Online ================================================ FILE: source/react-personal-email/config/config.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/config.2.0.schema.json", "version": "2.0", "bundles": { "personal-email-web-part": { "components": [ { "entrypoint": "./lib/webparts/personalEmail/PersonalEmailWebPart.js", "manifest": "./src/webparts/personalEmail/PersonalEmailWebPart.manifest.json" } ] } }, "externals": {}, "localizedResources": { "PersonalEmailWebPartStrings": "lib/webparts/personalEmail/loc/{locale}.js", "ControlStrings": "node_modules/@pnp/spfx-controls-react/lib/loc/{locale}.js", "PropertyControlStrings": "node_modules/@pnp/spfx-property-controls/lib/loc/{locale}.js" } } ================================================ FILE: source/react-personal-email/config/deploy-azure-storage.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/deploy-azure-storage.schema.json", "workingDir": "./release/assets/", "account": "", "container": "react-personal-email", "accessKey": "" } ================================================ FILE: source/react-personal-email/config/package-solution.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/package-solution.schema.json", "solution": { "name": "Starter Kit - Personal Email", "id": "7c886936-7bcd-4ef5-ac98-e802299dc5ad", "version": "3.0.0.0", "includeClientSideAssets": true, "skipFeatureDeployment": true, "isDomainIsolated": false, "developer": { "name": "PnP Starter Kit", "privacyUrl": "", "termsOfUseUrl": "", "websiteUrl": "", "mpnId": "pnpsk" }, "metadata": { "shortDescription": { "default": "react-personal-email description" }, "longDescription": { "default": "react-personal-email description" }, "screenshotPaths": [], "videoUrl": "", "categories": [] }, "features": [ { "title": "Starter Kit - Personal Email WebPart Feature", "description": "The feature that activates Personal Email Webpart from the Starter Kit - Personal Email solution.", "id": "0a4ad3e5-1677-4829-b173-55cbb3ffc317", "version": "3.0.0.0", "componentIds": [ "0a4ad3e5-1677-4829-b173-55cbb3ffc317" ] } ], "webApiPermissionRequests": [ { "resource": "Microsoft Graph", "scope": "Mail.Read" } ] }, "paths": { "zippedPackage": "solution/react-personal-email.sppkg" } } ================================================ FILE: source/react-personal-email/config/sass.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/core-build/sass.schema.json" } ================================================ FILE: source/react-personal-email/config/serve.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/spfx-serve.schema.json", "port": 4321, "https": true, "initialPage": "https://enter-your-SharePoint-site/_layouts/workbench.aspx" } ================================================ FILE: source/react-personal-email/config/write-manifests.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/write-manifests.schema.json", "cdnBasePath": "" } ================================================ FILE: source/react-personal-email/gulpfile.js ================================================ 'use strict'; const build = require('@microsoft/sp-build-web'); build.addSuppression(`Warning - [sass] The local CSS class 'ms-Grid' is not camelCase and will not be type-safe.`); var getTasks = build.rig.getTasks; build.rig.getTasks = function () { var result = getTasks.call(build.rig); result.set('serve', result.get('serve-deprecated')); return result; }; build.initialize(require('gulp')); ================================================ FILE: source/react-personal-email/package.json ================================================ { "name": "react-personal-email", "version": "3.0.0", "private": true, "main": "lib/index.js", "engines": { "node": ">=16.13.0 <17.0.0" }, "scripts": { "build": "gulp bundle", "clean": "gulp clean", "test": "gulp test" }, "dependencies": { "@microsoft/sp-core-library": "1.16.1", "@microsoft/sp-lodash-subset": "1.16.1", "@microsoft/sp-office-ui-fabric-core": "1.16.1", "@microsoft/sp-property-pane": "1.16.1", "@microsoft/sp-webpart-base": "1.16.1", "@pnp/spfx-controls-react": "3.12.0", "@pnp/spfx-property-controls": "3.11.0", "react": "17.0.1", "react-dom": "17.0.1", "tslib": "2.3.1" }, "resolutions": { "@types/react": "16.8.8" }, "devDependencies": { "@microsoft/eslint-config-spfx": "1.16.1", "@microsoft/eslint-plugin-spfx": "1.16.1", "@microsoft/rush-stack-compiler-4.5": "0.2.2", "@microsoft/sp-build-web": "1.16.1", "@microsoft/sp-module-interfaces": "1.16.1", "@rushstack/eslint-config": "2.5.1", "@types/react": "17.0.45", "@types/react-dom": "17.0.17", "@types/webpack-env": "~1.15.2", "ajv": "^6.12.5", "eslint-plugin-react-hooks": "4.3.0", "gulp": "4.0.2", "typescript": "4.5.5" } } ================================================ FILE: source/react-personal-email/src/index.ts ================================================ // A file is required to be in the root of the /src directory by the TypeScript compiler ================================================ FILE: source/react-personal-email/src/webparts/personalEmail/PersonalEmailWebPart.manifest.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx/client-side-web-part-manifest.schema.json", "id": "0a4ad3e5-1677-4829-b173-55cbb3ffc317", "alias": "PersonalEmailWebPart", "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, "supportedHosts": ["SharePointWebPart", "SharePointFullPage", "TeamsTab", "TeamsPersonalApp"], "supportsThemeVariants": true, "preconfiguredEntries": [{ "groupId": "5c03119e-3074-46fd-976b-c60198311f70", // Other "group": { "default": "Other" }, "title": { "default": "Personal e-mail" }, "description": { "default": "Shows email of a user" }, "officeFabricIconFontName": "Mail", "properties": { "title": "Personal e-mail", "nrOfMessages": 5, "showInboxOnly": true } }] } ================================================ FILE: source/react-personal-email/src/webparts/personalEmail/PersonalEmailWebPart.ts ================================================ import * as React from 'react'; import * as ReactDom from 'react-dom'; import { Version } from '@microsoft/sp-core-library'; import { BaseClientSideWebPart } from '@microsoft/sp-webpart-base'; import { IPropertyPaneConfiguration } from '@microsoft/sp-property-pane'; import * as strings from 'PersonalEmailWebPartStrings'; import { PersonalEmail, IPersonalEmailProps } from './components'; import { CalloutTriggers } from '@pnp/spfx-property-controls/lib/PropertyFieldHeader'; import { PropertyFieldToggleWithCallout } from '@pnp/spfx-property-controls/lib/PropertyFieldToggleWithCallout'; import { MSGraphClientV3 } from '@microsoft/sp-http'; import { IReadonlyTheme, ThemeChangedEventArgs, ThemeProvider } from "@microsoft/sp-component-base"; export interface IPersonalEmailWebPartProps { title: string; nrOfMessages: number; showInboxOnly: boolean; } export default class PersonalEmailWebPart extends BaseClientSideWebPart { private graphClient: MSGraphClientV3; private propertyFieldNumber: any; private _themeProvider: ThemeProvider; private _themeVariant: IReadonlyTheme | undefined; public onInit(): Promise { return new Promise((resolve: () => void, reject: (error: any) => void): void => { this.context.msGraphClientFactory .getClient('3') .then((client: MSGraphClientV3): void => { this.graphClient = client; resolve(); }, err => reject(err)); this._themeProvider = this.context.serviceScope.consume( ThemeProvider.serviceKey ); // If it exists, get the theme variant this._themeVariant = this._themeProvider.tryGetTheme(); // Register a handler to be notified if the theme variant changes this._themeProvider.themeChangedEvent.add( this, this._handleThemeChangedEvent ); }); } public render(): void { const element: React.ReactElement = React.createElement( PersonalEmail, { title: this.properties.title, nrOfMessages: this.properties.nrOfMessages, showInboxOnly: this.properties.showInboxOnly, // pass the current display mode to determine if the title should be // editable or not displayMode: this.displayMode, themeVariant: this._themeVariant, // pass the reference to the MSGraphClient graphClient: this.graphClient, // handle updated web part title updateProperty: (value: string): void => { // store the new title in the title web part property this.properties.title = value; } } ); ReactDom.render(element, this.domElement); } protected get dataVersion(): Version { return Version.parse('1.0'); } //executes only before property pane is loaded. protected async loadPropertyPaneResources(): Promise { // import additional controls/components const { PropertyFieldNumber } = await import( /* webpackChunkName: 'pnp-propcontrols-number' */ '@pnp/spfx-property-controls/lib/propertyFields/number' ); this.propertyFieldNumber = PropertyFieldNumber; } protected getPropertyPaneConfiguration(): IPropertyPaneConfiguration { return { pages: [ { header: { description: strings.PropertyPaneDescription }, groups: [ { groupFields: [ this.propertyFieldNumber("nrOfMessages", { key: "nrOfMessages", label: strings.NrOfMessagesToShow, value: this.properties.nrOfMessages, minValue: 1, maxValue: 10 }), PropertyFieldToggleWithCallout('showInboxOnly', { calloutTrigger: CalloutTriggers.Click, key: 'showInboxOnly', label: strings.ShowInboxOnly, calloutContent: React.createElement('p', {}, strings.ShowInboxOnlyCallout), checked: this.properties.showInboxOnly }) ] } ] } ] }; } private _handleThemeChangedEvent(args: ThemeChangedEventArgs): void { this._themeVariant = args.theme; this.render(); } } ================================================ FILE: source/react-personal-email/src/webparts/personalEmail/components/IMessage.ts ================================================ export interface IMessages { value: IMessage[]; } export interface IMessage { bodyPreview: string; from: { emailAddress: { address: string; name: string; } }; isRead: boolean; receivedDateTime: string; subject: string; webLink: string; } ================================================ FILE: source/react-personal-email/src/webparts/personalEmail/components/IPersonalEmailProps.ts ================================================ import { IPersonalEmailWebPartProps } from "../PersonalEmailWebPart"; import { MSGraphClientV3 } from "@microsoft/sp-http"; import { DisplayMode } from "@microsoft/sp-core-library"; import { IReadonlyTheme } from "@microsoft/sp-component-base"; export interface IPersonalEmailProps extends IPersonalEmailWebPartProps { displayMode: DisplayMode; graphClient: MSGraphClientV3; themeVariant: IReadonlyTheme | undefined; updateProperty: (value: string) => void; } ================================================ FILE: source/react-personal-email/src/webparts/personalEmail/components/IPersonalEmailState.ts ================================================ import { IMessage } from '.'; export interface IPersonalEmailState { error: string; loading: boolean; messages: IMessage[]; } ================================================ FILE: source/react-personal-email/src/webparts/personalEmail/components/PersonalEmail.module.scss ================================================ @import '~@fluentui/react/dist/sass/References.scss'; .personalEmail { --varientBGColor: $ms-color-primary; --varientFontColor: black; --varientBGHovered: black; background-color: var(--varientBGColor); color: var(--varientFontColor) !important; .title, .viewAll, .list { margin-top: 1em; margin-bottom: 1em; } .title * { font-size: 20px!important; font-weight: 600!important; color: var(--varientFontColor) !important; } button * { color: var(--varientFontColor) !important; } .message { display: block; padding: 0.5em 10px; color: var(--varientFontColor); &:hover { background: var(--varientBGHovered); } } .from { @include ms-font-l; @include ms-fontWeight-semibold; } .subject { @include ms-font-s; @include ms-fontWeight-semibold; font-weight: bold; float: left; width: 80%; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; } .date { @include ms-font-s; @include ms-fontWeight-semibold; font-weight: bold; float: right; width: 20%; text-align: right; word-break: keep-all; } .preview { @include ms-font-s; @include ms-fontWeight-light; clear: both; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; } .isRead { .from { @include ms-fontWeight-semilight; } .subject { @include ms-fontWeight-semilight; } .date { @include ms-fontWeight-semilight; } .preview { @include ms-fontWeight-light; } } .noMessages { @include ms-font-m; } .error { @include ms-font-m; color: $ms-color-alert; } } ================================================ FILE: source/react-personal-email/src/webparts/personalEmail/components/PersonalEmail.tsx ================================================ import * as React from 'react'; import styles from './PersonalEmail.module.scss'; import * as strings from 'PersonalEmailWebPartStrings'; import { IPersonalEmailProps, IPersonalEmailState, IMessage, IMessages } from '.'; import { WebPartTitle } from '@pnp/spfx-controls-react/lib/WebPartTitle'; import { Spinner, SpinnerSize } from '@fluentui/react/lib/Spinner'; import { List } from '@fluentui/react/lib/List'; import { Link } from '@fluentui/react/lib/Link'; import { IIconProps } from '@fluentui/react/lib/Icon'; import { ActionButton } from '@fluentui/react/lib/Button'; export class PersonalEmail extends React.Component { protected readonly outlookLink: string = "https://outlook.office.com/owa/"; protected readonly outlookNewEmailLink: string = "https://outlook.office.com/mail/deeplink/compose"; constructor(props: IPersonalEmailProps) { super(props); this.state = { messages: [], loading: false, error: undefined }; } private addIcon: IIconProps = { iconName: 'Add' }; private viewList: IIconProps = { iconName: 'AllApps' }; /** * Load recent messages for the current user */ private _loadMessages(): void { if (!this.props.graphClient) { return; } // update state to indicate loading and remove any previously loaded // messages this.setState({ error: null, loading: true, messages: [] }); let graphURI: string = "me/messages"; if(this.props.showInboxOnly) { graphURI = "me/mailFolders/Inbox/messages"; } this.props.graphClient .api(graphURI) .version("v1.0") .select("bodyPreview,receivedDateTime,from,isRead,subject,webLink") .top(this.props.nrOfMessages || 5) .orderby("receivedDateTime desc") .get((err: any, res: IMessages): void => { if (err) { // Something failed calling the MS Graph this.setState({ error: err.message ? err.message : strings.Error, loading: false }); return; } // Check if a response was retrieved if (res && res.value && res.value.length > 0) { this.setState({ messages: res.value, loading: false }); } else { // No messages found this.setState({ loading: false }); } }); } /** * Render message item */ private _onRenderCell = (item: IMessage, index: number | undefined): JSX.Element => { if (item.isRead) { styles.message = styles.message + " " + styles.isRead; } return
{item.from.emailAddress.name || item.from.emailAddress.address}
{item.subject}
{(new Date(item.receivedDateTime).toLocaleDateString())}
{item.bodyPreview}
; } public componentDidMount(): void { // load data initially after the component has been instantiated this._loadMessages(); } public componentDidUpdate(prevProps: IPersonalEmailProps, prevState: IPersonalEmailState): void { // verify if the component should update. Helps avoid unnecessary re-renders // when the parent has changed but this component hasn't if (prevProps.nrOfMessages !== this.props.nrOfMessages || prevProps.showInboxOnly !== this.props.showInboxOnly) { this._loadMessages(); } } public render(): React.ReactElement { const varientStyles = { "--varientBGColor": this.props.themeVariant.semanticColors.bodyBackground , "--varientFontColor": this.props.themeVariant.semanticColors.bodyText , "--varientBGHovered": this.props.themeVariant.semanticColors.listItemBackgroundHovered } as React.CSSProperties; return (
{ this.state.loading && } { this.state.messages && this.state.messages.length > 0 ? (
) : ( !this.state.loading && ( this.state.error ? {this.state.error} : {strings.NoMessages} ) ) }
); } private openNewEmail = () => { window.open(this.outlookNewEmailLink, "_blank"); } private openList = () => { window.open(this.outlookLink, "_blank"); } } ================================================ FILE: source/react-personal-email/src/webparts/personalEmail/components/index.ts ================================================ export * from './IMessage'; export * from './IPersonalEmailProps'; export * from './IPersonalEmailState'; export * from './PersonalEmail'; ================================================ FILE: source/react-personal-email/src/webparts/personalEmail/loc/de-de.js ================================================ define([], function() { return { "Error": "Ein Fehler beim abrufen Ihrer Nachrichten ist aufgetreten.", "Loading": "Rufe Ihre Nachrichten auf", "NoMessages": "Keine Nachrichten gefunden", "NrOfMessagesToShow": "Anzahl der anzuzeigenden Nachrichten", "PropertyPaneDescription": "Nachrichten Web Part Konfiguration", "ViewAll": "Vollständige Liste anzeigen" } }); ================================================ FILE: source/react-personal-email/src/webparts/personalEmail/loc/en-us.js ================================================ define([], function() { return { "Error": "An error has occurred while retrieving your messages", "Loading": "Retrieving your messages", "NewEmail": "New e-mail", "NoMessages": "No messages were found", "NrOfMessagesToShow": "Number of messages to show", "PropertyPaneDescription": "Messages web part configuration", "ShowInboxOnly":"Show e-mail from Inbox only", "ShowInboxOnlyCallout": "When selected, only e-mails from Inbox will be shown.", "ViewAll": "View the full list" } }); ================================================ FILE: source/react-personal-email/src/webparts/personalEmail/loc/es-es.js ================================================ define([], function() { return { "Error": "Un erorr ha ocurrido mientrar obtenemos sus mensajes", "Loading": "Obteniendo sus mensajes", "NoMessages": "No se encontraron mensajes", "NrOfMessagesToShow": "Numero de mensajes a mostrar", "PropertyPaneDescription": "Configuracion del elemento web de Mensajes", "ViewAll": "Ver la lista completa" } }); ================================================ FILE: source/react-personal-email/src/webparts/personalEmail/loc/fr-fr.js ================================================ define([], function() { return { "Error": "Une erreur est survenue lors de la récupération de vos messages", "Loading": "Récupération de vos messages", "NewEmail": "Nouveau e-mail", "NoMessages": "Aucun message n'a été trouvé", "NrOfMessagesToShow": "Nombre de messages à afficher", "PropertyPaneDescription": "Configuration des messages de la partie Web", "ViewAll": "Voir toute la liste" } }); ================================================ FILE: source/react-personal-email/src/webparts/personalEmail/loc/mystrings.d.ts ================================================ declare interface IPersonalEmailWebPartStrings { Error: string; Loading: string; NewEmail: string; NoMessages: string; NrOfMessagesToShow: string; PropertyPaneDescription: string; ShowInboxOnly: string; ShowInboxOnlyCallout: string; ViewAll: string; } declare module 'PersonalEmailWebPartStrings' { const strings: IPersonalEmailWebPartStrings; export = strings; } ================================================ FILE: source/react-personal-email/src/webparts/personalEmail/loc/nb-no.js ================================================ define([], function() { return { "Error": "En feil oppstod ved henting av e-post", "Loading": "Henter dine e-poster", "NewEmail": "Ny e-post", "NoMessages": "Ingen e-poster funnet", "NrOfMessagesToShow": "Antall e-poster som skal vises", "PropertyPaneDescription": "Konfigurer e-post webdelen", "ViewAll": "Vis hele listen" } }); ================================================ FILE: source/react-personal-email/src/webparts/personalEmail/loc/nl-nl.js ================================================ define([], function() { return { "Error": "Een foutmelding is opgetreden bij het ophalen van je e-mails", "Loading": "E-mails aan het ophalen", "NewEmail": "Nieuwe e-mail", "NoMessages": "Geen e-mail gevonden", "NrOfMessagesToShow": "Aantal te tonen e-mails", "PropertyPaneDescription": "E-mail webpart configuratie", "ShowInboxOnly":"Toon alleen e-mail uit Inbox", "ShowInboxOnlyCallout": "Indien dit inschakeld is worden alleen e-mails uit de Inbox getoond.", "ViewAll": "Bekijk de volledige lijst" } }); ================================================ FILE: source/react-personal-email/src/webparts/personalEmail/loc/sv-se.js ================================================ define([], function() { return { "Error": "Ett fel uppstod när dina meddelanden hämtades", "Loading": "Hämtar dina meddelanden", "NoMessages": "Inga meddelanden hittades", "NrOfMessagesToShow": "Antal meddelanden att visa", "PropertyPaneDescription": "Meddelanden webbdelskonfiguration", "ViewAll": "Visa hela listan" } }); ================================================ FILE: source/react-personal-email/src/webparts/personalEmail/loc/tr-tr.js ================================================ define([], function() { return { "Error": "Mesajlarınız alınırken bir hata oluştu.", "Loading": "Mesajlarınızı alınıyor", "NewEmail": "Yeni e-posta", "NoMessages": "Hiçbir mesaj bulunamadı", "NrOfMessagesToShow": "Gösterilecek mesaj sayısı", "PropertyPaneDescription": "Mesajlar web parçası yapılandırması", "ShowInboxOnly":"Sadece gelen kutusundaki e-postayı göster", "ShowInboxOnlyCallout": "Seçildiğinde, yalnızca Gelen Kutusu'ndan gelen e-postalar gösterilecektir.", "ViewAll": "Listenin tamamını görüntüle" } }); ================================================ FILE: source/react-personal-email/tsconfig.json ================================================ { "extends": "./node_modules/@microsoft/rush-stack-compiler-4.5/includes/tsconfig-web.json", "compilerOptions": { "target": "es5", "forceConsistentCasingInFileNames": true, "module": "esnext", "moduleResolution": "node", "jsx": "react", "declaration": true, "sourceMap": true, "experimentalDecorators": true, "skipLibCheck": true, "outDir": "lib", "inlineSources": false, "strictNullChecks": false, "noImplicitAny": true, "typeRoots": [ "./node_modules/@types", "./node_modules/@microsoft" ], "types": [ "webpack-env" ], "lib": [ "es5", "dom", "es2015.collection", "es2015.promise" ] }, "include": [ "src/**/*.ts", "src/**/*.tsx" ] } ================================================ FILE: source/react-personal-tasks/.editorconfig ================================================ # EditorConfig helps developers define and maintain consistent # coding styles between different editors and IDEs # editorconfig.org root = true [*] # change these settings to your own preference indent_style = space indent_size = 2 # we recommend you to keep these unchanged end_of_line = lf charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true [*.md] trim_trailing_whitespace = false [{package,bower}.json] indent_style = space indent_size = 2 ================================================ FILE: source/react-personal-tasks/.gitignore ================================================ # Logs logs *.log npm-debug.log* # Dependency directories node_modules # Build generated files dist lib release solution temp *.sppkg .heft # Coverage directory used by tools like istanbul coverage # OSX .DS_Store # Visual Studio files .ntvs_analysis.dat .vs bin obj # Resx Generated Code *.resx.ts # Styles Generated Code *.scss.ts ================================================ FILE: source/react-personal-tasks/.npmignore ================================================ !dist config gulpfile.js release src temp tsconfig.json tslint.json *.log .yo-rc.json .vscode ================================================ FILE: source/react-personal-tasks/.vscode/launch.json ================================================ { "version": "0.2.0", "configurations": [ { "name": "Hosted workbench", "type": "pwa-chrome", "request": "launch", "url": "https://enter-your-SharePoint-site/_layouts/workbench.aspx", "webRoot": "${workspaceRoot}", "sourceMaps": true, "sourceMapPathOverrides": { "webpack:///.././src/*": "${webRoot}/src/*", "webpack:///../../../src/*": "${webRoot}/src/*", "webpack:///../../../../src/*": "${webRoot}/src/*", "webpack:///../../../../../src/*": "${webRoot}/src/*" }, "runtimeArgs": [ "--remote-debugging-port=9222", "-incognito" ] } ] } ================================================ FILE: source/react-personal-tasks/.vscode/settings.json ================================================ // Place your settings in this file to overwrite default and user settings. { // Configure glob patterns for excluding files and folders in the file explorer. "files.exclude": { "**/.git": true, "**/.DS_Store": true, "**/bower_components": true, "**/coverage": true, "**/lib-amd": true, "src/**/*.scss.ts": true }, "typescript.tsdk": ".\\node_modules\\typescript\\lib" } ================================================ FILE: source/react-personal-tasks/.yo-rc.json ================================================ { "@microsoft/generator-sharepoint": { "plusBeta": false, "isCreatingSolution": true, "nodeVersion": "16.19.0", "sdksVersions": { "@microsoft/microsoft-graph-client": "3.0.2", "@microsoft/teams-js": "2.4.1" }, "version": "1.16.1", "environment": "spo", "libraryName": "react-personal-tasks", "libraryId": "95cfc0f9-4052-476f-8443-8f23245e2a87", "packageManager": "npm", "componentType": "webpart", "skipFeatureDeployment": true, "isDomainIsolated": false } } ================================================ FILE: source/react-personal-tasks/README.md ================================================ # Personal Tasks web part This web part provides you the ability to add a particular user's personal tasks on a web page. The web part may be configured to show tasks from Planner or To Do. This web part is powered by the Microsoft Graph. This webpart is a technology demostrator of Microsoft Graph Toolkit React components, in particular "Tasks". This webpart uses the @microsoft/mgt-react and @microsoft/mgt-spfx packages, currently version 2.9.0. > `NOTE:` This webpart includes the use the Microsoft Graph Toolkit with React, [@microsoft/mgt-react](https://www.npmjs.com/package/@microsoft/mgt-react). > `NOTE:` This webpart includes the use the Microsoft Graph Toolkit with React SPFx, [@microsoft/mgt-spfx](../mgt-spfx/README.md) with a dependency on [mgt-spfx-2.9.0.sppkg](https://github.com/microsoftgraph/microsoft-graph-toolkit/releases) that must be installed to the tenant app catalog. By default the Starter Kit will install this additional dependency. ![Personal Tasks](./assets/personal-tasks-demo.gif) ## How to use this web part on your web pages 1. Place the page you want to add this web part to in edit mode. 2. Search for and insert the **Personal Tasks** web part. 3. Configure the web part to update its properties. ## Configurable Properties The `Personal Tasks` web part can be configured with the following properties: | Label | Property | Type | Required | Description | | ---- | ---- | ---- | ---- | ---- | | My Tasks | title | string | no | The web part title, editable inline with the web part itself | | Data source | dataSource | 'planner' \| 'todo' | yes | Web part's data source: Planner or To Do. Default: planner | | Allow editing | allowEditing | boolean | no | Flag if editing is allowed. Default is false. | | Hide filter | hideHeader | boolean | no | Flag if the header on MS Graph Toolkit Personal Tasks component should be hidden. The header contains a filter and "Add" button. Default is true. | | Initially displayed Plan or ToDo Folder id | initialId | string | no | A string id to set the initially displayed planner or folder to the provided ID. | | Initially displayed bucket id | initialBucketId | string | no | A string id to set the initially displayed bucket (Planner Data-Source Only) to the provided ID. | | Source Plan or ToDo Folder id | targetId | string | no | A string id to lock the tasks interface to the provided planner or folder ID. | | Source bucket id | targetBucketId | string | no | A string ID to lock the tasks interface to the provided bucket ID (Planner Data-Source Only). | ## Configuration suggestions * When "hide filter" is selected, the filter header will be hidden from view (default setting). With the filter hidden, you remove the ability for a visitor to filter task results by all tasks or tasks for the current user. By default, if a planner id is not specified, a visitor will see only their tasks. If a specific planner id is set in the webpart properties, all tasks within that planner are displayed. To allow for filtering in this scenario, you will want to sure that the filter is not hidden (unchecked). ## Used SharePoint Framework Version ![drop](https://img.shields.io/badge/version-1.16.1-green.svg) * Supported in SharePoint Online ## Applies to * [SharePoint Framework](https://learn.microsoft.com/en-us/sharepoint/dev/spfx/sharepoint-framework-overview) * [Office 365 tenant](https://learn.microsoft.com/en-us/sharepoint/dev/spfx/set-up-your-development-environment) ## Prerequisites * [mgt-spfx-2.9.0.sppkg](https://github.com/microsoftgraph/microsoft-graph-toolkit/releases) must be installed to the tenant app catalog. By default the Starter Kit will install this additional dependency. ## Solution Solution|Author(s) --------|--------- react-personal-tasks | Waldek Mastykarz react-personal-tasks | Alex Terentiev react-personal-tasks | Eric Overfield react-personal-tasks | Chandani Prajapati ## Version history Version|Date|Comments -------|----|-------- 1.0|December 25, 2019|Initial release 2.2|August 2021|Upgrade to MGT 2.2.1 3.0|February 2023|Initial release for SharePoint Starter Kit v3 (Upgraded to SPFx 1.16.1 and MGT 2.9.0) ## Disclaimer **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.** --- ## Minimal Path to Awesome * Clone this repository * Move to solution folder * in the command line run: * `npm install` * `gulp bundle` * `gulp package-solution` * Upload solution to the SharePoint App Catalog * Approve needed permissions in SharePoint Admin Center * `gulp serve` ## Features Description of the web part with possible additional details than in short summary. This Web Part illustrates the following concepts on top of the SharePoint Framework: * Using Microsoft Graph Toolkit from the web parts * Hosting SharePoint Framework components as Microsoft Teams tabs * Using app pages in SharePoint Online ================================================ FILE: source/react-personal-tasks/config/config.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/config.2.0.schema.json", "version": "2.0", "bundles": { "personal-tasks-web-part": { "components": [ { "entrypoint": "./lib/webparts/personalTasks/PersonalTasksWebPart.js", "manifest": "./src/webparts/personalTasks/PersonalTasksWebPart.manifest.json" } ] } }, "externals": {}, "localizedResources": { "PersonalTasksWebPartStrings": "lib/webparts/personalTasks/loc/{locale}.js" } } ================================================ FILE: source/react-personal-tasks/config/deploy-azure-storage.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/deploy-azure-storage.schema.json", "workingDir": "./release/assets/", "account": "", "container": "react-personal-tasks", "accessKey": "" } ================================================ FILE: source/react-personal-tasks/config/package-solution.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/package-solution.schema.json", "solution": { "name": "Starter Kit - Personal Tasks", "id": "95cfc0f9-4052-476f-8443-8f23245e2a87", "version": "3.0.0.0", "includeClientSideAssets": true, "skipFeatureDeployment": true, "isDomainIsolated": false, "developer": { "name": "PnP Starter Kit", "privacyUrl": "", "termsOfUseUrl": "", "websiteUrl": "", "mpnId": "pnpsk" }, "metadata": { "shortDescription": { "default": "react-personal-tasks description" }, "longDescription": { "default": "react-personal-tasks description" }, "screenshotPaths": [], "videoUrl": "", "categories": [] }, "features": [ { "title": "Starter Kit - Personal Tasks Webpart Feature", "description": "The feature that activates Personal Tasks from the Starter Kit - Personal Tasks solution.", "id": "9eac8961-60e7-45b8-990e-175340d7c4a0", "version": "3.0.0.0", "componentIds": [ "9eac8961-60e7-45b8-990e-175340d7c4a0" ] } ], "webApiPermissionRequests": [ { "resource": "Microsoft Graph", "scope": "Group.ReadWrite.All" }, { "resource": "Microsoft Graph", "scope": "Tasks.ReadWrite" }, { "resource": "Microsoft Graph", "scope": "People.Read" }, { "resource": "Microsoft Graph", "scope": "User.ReadBasic.All" } ] }, "paths": { "zippedPackage": "solution/react-personal-tasks.sppkg" } } ================================================ FILE: source/react-personal-tasks/config/sass.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/core-build/sass.schema.json" } ================================================ FILE: source/react-personal-tasks/config/serve.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/spfx-serve.schema.json", "port": 4321, "https": true, "initialPage": "https://enter-your-SharePoint-site/_layouts/workbench.aspx" } ================================================ FILE: source/react-personal-tasks/config/write-manifests.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/write-manifests.schema.json", "cdnBasePath": "" } ================================================ FILE: source/react-personal-tasks/gulpfile.js ================================================ 'use strict'; const build = require('@microsoft/sp-build-web'); build.addSuppression(`Warning - [sass] The local CSS class 'ms-Grid' is not camelCase and will not be type-safe.`); var getTasks = build.rig.getTasks; build.rig.getTasks = function () { var result = getTasks.call(build.rig); result.set('serve', result.get('serve-deprecated')); return result; }; build.initialize(require('gulp')); ================================================ FILE: source/react-personal-tasks/package.json ================================================ { "name": "react-personal-tasks", "version": "3.0.0", "private": true, "main": "lib/index.js", "engines": { "node": ">=16.13.0 <17.0.0" }, "scripts": { "build": "gulp bundle", "clean": "gulp clean", "test": "gulp test" }, "dependencies": { "@microsoft/mgt-react": "2.9.0", "@microsoft/mgt-spfx": "2.9.0", "@microsoft/sp-core-library": "1.16.1", "@microsoft/sp-lodash-subset": "1.16.1", "@microsoft/sp-office-ui-fabric-core": "1.16.1", "@microsoft/sp-property-pane": "1.16.1", "@microsoft/sp-webpart-base": "1.16.1", "react": "17.0.1", "react-dom": "17.0.1", "tslib": "2.3.1" }, "resolutions": { "@types/react": "16.8.8" }, "devDependencies": { "@microsoft/eslint-config-spfx": "1.16.1", "@microsoft/eslint-plugin-spfx": "1.16.1", "@microsoft/rush-stack-compiler-4.5": "0.2.2", "@microsoft/sp-build-web": "1.16.1", "@microsoft/sp-module-interfaces": "1.16.1", "@rushstack/eslint-config": "2.5.1", "@types/react": "17.0.45", "@types/react-dom": "17.0.17", "@types/webpack-env": "~1.15.2", "ajv": "^6.12.5", "eslint-plugin-react-hooks": "4.3.0", "gulp": "4.0.2", "typescript": "4.5.5" } } ================================================ FILE: source/react-personal-tasks/src/index.ts ================================================ // A file is required to be in the root of the /src directory by the TypeScript compiler ================================================ FILE: source/react-personal-tasks/src/webparts/personalTasks/PersonalTasksWebPart.manifest.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx/client-side-web-part-manifest.schema.json", "id": "9eac8961-60e7-45b8-990e-175340d7c4a0", "alias": "PersonalTasksWebPart", "componentType": "WebPart", "supportsThemeVariants": true, // 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, "supportedHosts": ["SharePointWebPart", "SharePointFullPage", "TeamsTab", "TeamsPersonalApp"], "preconfiguredEntries": [{ "groupId": "5c03119e-3074-46fd-976b-c60198311f70", // Other "group": { "default": "Other" }, "title": { "default": "Personal Tasks" }, "description": { "default": "Personal tasks of the user" }, "officeFabricIconFontName": "TaskManager", "properties": { "webPartTitle": "My Tasks", "allowEditing": false, "dataSource": "planner", "hideHeader": true } }] } ================================================ FILE: source/react-personal-tasks/src/webparts/personalTasks/PersonalTasksWebPart.ts ================================================ import * as React from 'react'; import * as ReactDom from 'react-dom'; import { Version } from '@microsoft/sp-core-library'; import { BaseClientSideWebPart } from "@microsoft/sp-webpart-base"; import { IPropertyPaneConfiguration, PropertyPaneTextField, PropertyPaneCheckbox, PropertyPaneDropdown } from "@microsoft/sp-property-pane"; import { ThemeProvider, ThemeChangedEventArgs, IReadonlyTheme } from '@microsoft/sp-component-base'; import * as strings from 'PersonalTasksWebPartStrings'; import { PersonalTasks } from './components/PersonalTasks'; import { IPersonalTasksProps } from './components/IPersonalTasksProps'; // import the providers at the top of the page import { Providers, SharePointProvider } from '@microsoft/mgt-spfx'; import { PropertyPaneHorizontalRule } from '@microsoft/sp-property-pane'; import { TasksSource } from '@microsoft/mgt-spfx'; export interface IPersonalTasksWebPartProps { /** * The web part title */ webPartTitle: string; /** * Tasks' data source - Planner or ToDo */ dataSource: TasksSource; /** * Flag if editing is allowed. Default is false. */ allowEditing: boolean; /** * Flag if the header on MS Graph Toolkit Personal Tasks component should be hidden. * The header contains a filter and "Add" button. * Default is true. */ hideHeader: boolean; /** * A string id to set the initially displayed planner or folder to the provided ID. */ initialId: string; /** * A string id to set the initially displayed bucket (Planner Data-Source Only) to the provided ID. */ initialBucketId: string; /** * A string id to lock the tasks interface to the provided planner or folder ID. */ targetId: string; /** * A string ID to lock the tasks interface to the provided bucket ID (Planner Data-Source Only). */ targetBucketId: string; } export default class PersonalTasksWebPart extends BaseClientSideWebPart { // theme provider private _themeProvider: ThemeProvider; // current theme private _themeVariant: IReadonlyTheme | undefined; public async onInit(): Promise { // initializing authentication provider for MS Graph Toolkit Providers.globalProvider = new SharePointProvider(this.context); // Consume the new ThemeProvider service this._themeProvider = this.context.serviceScope.consume(ThemeProvider.serviceKey); // If it exists, get the theme variant this._themeVariant = this._themeProvider.tryGetTheme(); // Register a handler to be notified if the theme variant changes this._themeProvider.themeChangedEvent.add(this, this._handleThemeChangedEvent); return super.onInit(); } public render(): void { const element: React.ReactElement = React.createElement( PersonalTasks, { onTitleChange: title => { this.properties.webPartTitle = title; }, displayMode: this.displayMode, themeVariant: this._themeVariant, ...this.properties } ); ReactDom.render(element, this.domElement); } protected onDispose(): void { ReactDom.unmountComponentAtNode(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: [ PropertyPaneDropdown('dataSource', { label: strings.DataSourcePropertyLabel, options: [{ key: 'planner', text: strings.DataSourcePlanner }, { key: 'todo', text: strings.DataSourceToDo }] }), PropertyPaneHorizontalRule(), PropertyPaneCheckbox('allowEditing', { text: strings.AllowEditingPropertyLabel }), PropertyPaneCheckbox('hideHeader', { text: strings.HideHeaderPropertyLabel }), PropertyPaneHorizontalRule(), PropertyPaneTextField('initialId', { label: strings.InitialId }), PropertyPaneTextField('initialBucketId', { label: strings.InitialBucketId, disabled: this.properties.dataSource === TasksSource.todo }), PropertyPaneTextField('targetId', { label: strings.TargetId }), PropertyPaneTextField('targetBucketId', { label: strings.TargetBucketId, disabled: this.properties.dataSource === TasksSource.todo }), ] } ] } ] }; } protected _handleThemeChangedEvent = (args: ThemeChangedEventArgs): void => { this._themeVariant = args.theme; this.render(); } } ================================================ FILE: source/react-personal-tasks/src/webparts/personalTasks/components/IPersonalTasksProps.ts ================================================ import { TasksSource } from '@microsoft/mgt-spfx'; import { IReadonlyTheme } from '@microsoft/sp-component-base'; import { DisplayMode } from '@microsoft/sp-core-library'; export interface IPersonalTasksProps { /** * The web part title */ webPartTitle: string; /** * Tasks' data source - Planner or ToDo */ dataSource: TasksSource; /** * Flag if editing is allowed. Default is false. */ allowEditing: boolean; /** * Flag if the header on MS Graph Toolkit Personal Tasks component should be hidden. * The header contains a filter and "Add" button. * Default is true. */ hideHeader: boolean; /** * A string id to set the initially displayed planner or folder to the provided ID. */ initialId: string; /** * A string id to set the initially displayed bucket (Planner Data-Source Only) to the provided ID. */ initialBucketId: string; /** * A string id to lock the tasks interface to the provided planner or folder ID. */ targetId: string; /** * A string ID to lock the tasks interface to the provided bucket ID (Planner Data-Source Only). */ targetBucketId: string; /** * Current display mode of the web part */ displayMode: DisplayMode; /** * Web part's title change handler */ onTitleChange: (value: string) => void; /** * Page's section theme */ themeVariant: IReadonlyTheme | undefined; } ================================================ FILE: source/react-personal-tasks/src/webparts/personalTasks/components/PersonalTasks.module.scss ================================================ @import '~@fluentui/react/dist/sass/References.scss'; .personalTasks { background: inherit; } .webPartHeader { display: flex; align-items: baseline; } .webPartTitle { font-size: 14px; font-weight: 100; margin-bottom: 11px; color: "[theme:neutralPrimary, default: #333333]"; -webkit-box-flex: 1; -ms-flex-positive: 1; flex-grow: 1; overflow-x: hidden; text-overflow: ellipsis; @media (min-width: 320px) { font-size: 21px; } @media (min-width: 480px) { font-size: 24px; } // Edit mode textarea { background-color: transparent; border: none; box-sizing: border-box; color: inherit; display: block; font-family: inherit; font-size: inherit; font-weight: inherit; height: 40px; line-height: inherit; margin: 0; outline: 0; overflow: hidden; resize: none; text-align: inherit; white-space: pre; width: 100%; &::placeholder, &::-webkit-input-placeholder { color: "[theme: neutralSecondary, default: #666666]"!important; } } // View mode span { // Nothing at the moment a:link { text-decoration: none; } } .moreLink { margin-bottom: 11px; } } ================================================ FILE: source/react-personal-tasks/src/webparts/personalTasks/components/PersonalTasks.tsx ================================================ import { DisplayMode } from '@microsoft/sp-core-library'; import * as strings from 'PersonalTasksWebPartStrings'; import * as React from 'react'; import { IPersonalTasksProps } from './IPersonalTasksProps'; import styles from './PersonalTasks.module.scss'; import { TasksProps } from '@microsoft/mgt-react'; import { TasksSource } from '@microsoft/mgt-spfx'; import { wrapMgt } from '@microsoft/mgt-react/dist/es6/spfx'; export const Tasks = wrapMgt('mgt-tasks'); export class PersonalTasks extends React.Component { public render(): React.ReactElement { const { webPartTitle, displayMode, dataSource, allowEditing, hideHeader, initialId, initialBucketId, targetId, targetBucketId, themeVariant } = this.props; // // supporting different themes for page's section // const color: string | null = (!!themeVariant && themeVariant.semanticColors.bodyText) || null; const backgroundColor: string | null = (!!themeVariant && themeVariant.semanticColors.bodyBackground) || null; return (
{(webPartTitle || displayMode === DisplayMode.Edit) &&
{ displayMode === DisplayMode.Edit && ( ) } { displayMode !== DisplayMode.Edit && webPartTitle && {webPartTitle} }
}
); } private _onTitleChange = (event: { target: { value: any; }; }): void => { this.props.onTitleChange(event.target.value); } } ================================================ FILE: source/react-personal-tasks/src/webparts/personalTasks/loc/en-us.js ================================================ define([], function () { return { "PropertyPaneDescription": "Configure parameters of displayed personal tasks", "BasicGroupName": "", "AllowEditingPropertyLabel": "Allow editing", "DataSourcePropertyLabel": "Data source", "DataSourcePlanner": "Planner", "DataSourceToDo": "To Do", "HideHeaderPropertyLabel": "Hide filter", "InitialId": "Initially displayed Plan or To Do Folder id", "InitialBucketId": "Initially displayed bucket id", "TargetId": "Source Plan or To Do Folder id", "TargetBucketId": "Source bucket id", "WebPartTitlePlaceholder": "Web part title", "WebPartTitleLabel": "Add a title" } }); ================================================ FILE: source/react-personal-tasks/src/webparts/personalTasks/loc/mystrings.d.ts ================================================ declare interface IPersonalTasksWebPartStrings { PropertyPaneDescription: string; BasicGroupName: string; AllowEditingPropertyLabel: string; DataSourcePropertyLabel: string; DataSourcePlanner: string; DataSourceToDo: string; HideHeaderPropertyLabel: string; InitialId: string; InitialBucketId: string; TargetId: string; TargetBucketId: string; WebPartTitlePlaceholder: string; WebPartTitleLabel: string; } declare module 'PersonalTasksWebPartStrings' { const strings: IPersonalTasksWebPartStrings; export = strings; } ================================================ FILE: source/react-personal-tasks/tsconfig.json ================================================ { "extends": "./node_modules/@microsoft/rush-stack-compiler-4.5/includes/tsconfig-web.json", "compilerOptions": { "target": "es5", "forceConsistentCasingInFileNames": true, "module": "esnext", "moduleResolution": "node", "jsx": "react", "declaration": true, "sourceMap": true, "experimentalDecorators": true, "skipLibCheck": true, "outDir": "lib", "inlineSources": false, "strictNullChecks": false, "noImplicitAny": true, "typeRoots": [ "./node_modules/@types", "./node_modules/@microsoft" ], "types": [ "webpack-env" ], "lib": [ "es5", "dom", "es2015.collection", "es2015.promise" ] }, "include": [ "src/**/*.ts", "src/**/*.tsx" ] } ================================================ FILE: source/react-recent-contacts/.editorconfig ================================================ # EditorConfig helps developers define and maintain consistent # coding styles between different editors and IDEs # editorconfig.org root = true [*] # change these settings to your own preference indent_style = space indent_size = 2 # we recommend you to keep these unchanged end_of_line = lf charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true [*.md] trim_trailing_whitespace = false [{package,bower}.json] indent_style = space indent_size = 2 ================================================ FILE: source/react-recent-contacts/.eslintrc.js ================================================ require('@rushstack/eslint-config/patch/modern-module-resolution'); module.exports = { extends: ['@microsoft/eslint-config-spfx/lib/profiles/react'], parserOptions: { tsconfigRootDir: __dirname }, overrides: [ { files: ['*.ts', '*.tsx'], parser: '@typescript-eslint/parser', 'parserOptions': { 'project': './tsconfig.json', 'ecmaVersion': 2018, 'sourceType': 'module' }, rules: { // Prevent usage of the JavaScript null value, while allowing code to access existing APIs that may require null. https://www.npmjs.com/package/@rushstack/eslint-plugin '@rushstack/no-new-null': 1, // Require Jest module mocking APIs to be called before any other statements in their code block. https://www.npmjs.com/package/@rushstack/eslint-plugin '@rushstack/hoist-jest-mock': 1, // Require regular expressions to be constructed from string constants rather than dynamically building strings at runtime. https://www.npmjs.com/package/@rushstack/eslint-plugin-security '@rushstack/security/no-unsafe-regexp': 1, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/adjacent-overload-signatures': 1, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // // CONFIGURATION: By default, these are banned: String, Boolean, Number, Object, Symbol '@typescript-eslint/ban-types': [ 1, { 'extendDefaults': false, 'types': { 'String': { 'message': 'Use \'string\' instead', 'fixWith': 'string' }, 'Boolean': { 'message': 'Use \'boolean\' instead', 'fixWith': 'boolean' }, 'Number': { 'message': 'Use \'number\' instead', 'fixWith': 'number' }, 'Object': { 'message': 'Use \'object\' instead, or else define a proper TypeScript type:' }, 'Symbol': { 'message': 'Use \'symbol\' instead', 'fixWith': 'symbol' }, 'Function': { 'message': 'The \'Function\' type accepts any function-like value.\nIt provides no type safety when calling the function, which can be a common source of bugs.\nIt also accepts things like class declarations, which will throw at runtime as they will not be called with \'new\'.\nIf you are expecting the function to accept certain arguments, you should explicitly define the function shape.' } } } ], // RATIONALE: Code is more readable when the type of every variable is immediately obvious. // Even if the compiler may be able to infer a type, this inference will be unavailable // to a person who is reviewing a GitHub diff. This rule makes writing code harder, // but writing code is a much less important activity than reading it. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/explicit-function-return-type': [ 0, { 'allowExpressions': true, 'allowTypedFunctionExpressions': true, 'allowHigherOrderFunctions': false } ], // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // Rationale to disable: although this is a recommended rule, it is up to dev to select coding style. // Set to 1 (warning) or 2 (error) to enable. '@typescript-eslint/explicit-member-accessibility': 0, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/no-array-constructor': 1, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // // RATIONALE: The "any" keyword disables static type checking, the main benefit of using TypeScript. // This rule should be suppressed only in very special cases such as JSON.stringify() // where the type really can be anything. Even if the type is flexible, another type // may be more appropriate such as "unknown", "{}", or "Record". '@typescript-eslint/no-explicit-any': 0, // RATIONALE: The #1 rule of promises is that every promise chain must be terminated by a catch() // handler. Thus wherever a Promise arises, the code must either append a catch handler, // or else return the object to a caller (who assumes this responsibility). Unterminated // promise chains are a serious issue. Besides causing errors to be silently ignored, // they can also cause a NodeJS process to terminate unexpectedly. '@typescript-eslint/no-floating-promises': 2, // RATIONALE: Catches a common coding mistake. '@typescript-eslint/no-for-in-array': 2, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/no-misused-new': 2, // RATIONALE: The "namespace" keyword is not recommended for organizing code because JavaScript lacks // a "using" statement to traverse namespaces. Nested namespaces prevent certain bundler // optimizations. If you are declaring loose functions/variables, it's better to make them // static members of a class, since classes support property getters and their private // members are accessible by unit tests. Also, the exercise of choosing a meaningful // class name tends to produce more discoverable APIs: for example, search+replacing // the function "reverse()" is likely to return many false matches, whereas if we always // write "Text.reverse()" is more unique. For large scale organization, it's recommended // to decompose your code into separate NPM packages, which ensures that component // dependencies are tracked more conscientiously. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/no-namespace': [ 1, { 'allowDeclarations': false, 'allowDefinitionFiles': false } ], // RATIONALE: Parameter properties provide a shorthand such as "constructor(public title: string)" // that avoids the effort of declaring "title" as a field. This TypeScript feature makes // code easier to write, but arguably sacrifices readability: In the notes for // "@typescript-eslint/member-ordering" we pointed out that fields are central to // a class's design, so we wouldn't want to bury them in a constructor signature // just to save some typing. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // Set to 1 (warning) or 2 (error) to enable the rule '@typescript-eslint/no-parameter-properties': 0, // RATIONALE: When left in shipping code, unused variables often indicate a mistake. Dead code // may impact performance. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/no-unused-vars': [ 0, { 'vars': 'all', // Unused function arguments often indicate a mistake in JavaScript code. However in TypeScript code, // the compiler catches most of those mistakes, and unused arguments are fairly common for type signatures // that are overriding a base class method or implementing an interface. 'args': 'none' } ], // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/no-use-before-define': [ 2, { 'functions': false, 'classes': true, 'variables': true, 'enums': true, 'typedefs': true } ], // Disallows require statements except in import statements. // In other words, the use of forms such as var foo = require("foo") are banned. Instead use ES6 style imports or import foo = require("foo") imports. '@typescript-eslint/no-var-requires': 'error', // RATIONALE: The "module" keyword is deprecated except when describing legacy libraries. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/prefer-namespace-keyword': 1, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // Rationale to disable: it's up to developer to decide if he wants to add type annotations // Set to 1 (warning) or 2 (error) to enable the rule '@typescript-eslint/no-inferrable-types': 0, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // Rationale to disable: declaration of empty interfaces may be helpful for generic types scenarios '@typescript-eslint/no-empty-interface': 0, // RATIONALE: This rule warns if setters are defined without getters, which is probably a mistake. 'accessor-pairs': 1, // RATIONALE: In TypeScript, if you write x["y"] instead of x.y, it disables type checking. 'dot-notation': [ 1, { 'allowPattern': '^_' } ], // RATIONALE: Catches code that is likely to be incorrect 'eqeqeq': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'for-direction': 1, // RATIONALE: Catches a common coding mistake. 'guard-for-in': 2, // RATIONALE: If you have more than 2,000 lines in a single source file, it's probably time // to split up your code. 'max-lines': ['warn', { max: 2000 }], // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-async-promise-executor': 2, // RATIONALE: Deprecated language feature. 'no-caller': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-compare-neg-zero': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-cond-assign': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-constant-condition': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-control-regex': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-debugger': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-delete-var': 2, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-duplicate-case': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-empty': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-empty-character-class': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-empty-pattern': 1, // RATIONALE: Eval is a security concern and a performance concern. 'no-eval': 1, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-ex-assign': 2, // RATIONALE: System types are global and should not be tampered with in a scalable code base. // If two different libraries (or two versions of the same library) both try to modify // a type, only one of them can win. Polyfills are acceptable because they implement // a standardized interoperable contract, but polyfills are generally coded in plain // JavaScript. 'no-extend-native': 1, // Disallow unnecessary labels 'no-extra-label': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-fallthrough': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-func-assign': 1, // RATIONALE: Catches a common coding mistake. 'no-implied-eval': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-invalid-regexp': 2, // RATIONALE: Catches a common coding mistake. 'no-label-var': 2, // RATIONALE: Eliminates redundant code. 'no-lone-blocks': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-misleading-character-class': 2, // RATIONALE: Catches a common coding mistake. 'no-multi-str': 2, // RATIONALE: It's generally a bad practice to call "new Thing()" without assigning the result to // a variable. Either it's part of an awkward expression like "(new Thing()).doSomething()", // or else implies that the constructor is doing nontrivial computations, which is often // a poor class design. 'no-new': 1, // RATIONALE: Obsolete language feature that is deprecated. 'no-new-func': 2, // RATIONALE: Obsolete language feature that is deprecated. 'no-new-object': 2, // RATIONALE: Obsolete notation. 'no-new-wrappers': 1, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-octal': 2, // RATIONALE: Catches code that is likely to be incorrect 'no-octal-escape': 2, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-regex-spaces': 2, // RATIONALE: Catches a common coding mistake. 'no-return-assign': 2, // RATIONALE: Security risk. 'no-script-url': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-self-assign': 2, // RATIONALE: Catches a common coding mistake. 'no-self-compare': 2, // RATIONALE: This avoids statements such as "while (a = next(), a && a.length);" that use // commas to create compound expressions. In general code is more readable if each // step is split onto a separate line. This also makes it easier to set breakpoints // in the debugger. 'no-sequences': 1, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-shadow-restricted-names': 2, // RATIONALE: Obsolete language feature that is deprecated. // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-sparse-arrays': 2, // RATIONALE: Although in theory JavaScript allows any possible data type to be thrown as an exception, // such flexibility adds pointless complexity, by requiring every catch block to test // the type of the object that it receives. Whereas if catch blocks can always assume // that their object implements the "Error" contract, then the code is simpler, and // we generally get useful additional information like a call stack. 'no-throw-literal': 2, // RATIONALE: Catches a common coding mistake. 'no-unmodified-loop-condition': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-unsafe-finally': 2, // RATIONALE: Catches a common coding mistake. 'no-unused-expressions': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-unused-labels': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-useless-catch': 1, // RATIONALE: Avoids a potential performance problem. 'no-useless-concat': 1, // RATIONALE: The "var" keyword is deprecated because of its confusing "hoisting" behavior. // Always use "let" or "const" instead. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json 'no-var': 2, // RATIONALE: Generally not needed in modern code. 'no-void': 1, // RATIONALE: Obsolete language feature that is deprecated. // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-with': 2, // RATIONALE: Makes logic easier to understand, since constants always have a known value // @typescript-eslint\eslint-plugin\dist\configs\eslint-recommended.js 'prefer-const': 1, // RATIONALE: Catches a common coding mistake where "resolve" and "reject" are confused. 'promise/param-names': 2, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'require-atomic-updates': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'require-yield': 1, // "Use strict" is redundant when using the TypeScript compiler. 'strict': [ 2, 'never' ], // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'use-isnan': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js // Set to 1 (warning) or 2 (error) to enable. // Rationale to disable: !!{} 'no-extra-boolean-cast': 0, // ==================================================================== // @microsoft/eslint-plugin-spfx // ==================================================================== '@microsoft/spfx/import-requires-chunk-name': 1, '@microsoft/spfx/no-require-ensure': 2, '@microsoft/spfx/pair-react-dom-render-unmount': 0, // ==================================================================== // no-mixed-spaces-and-tabs // ==================================================================== 'no-mixed-spaces-and-tabs': 0 } }, { // For unit tests, we can be a little bit less strict. The settings below revise the // defaults specified in the extended configurations, as well as above. files: [ // Test files '*.test.ts', '*.test.tsx', '*.spec.ts', '*.spec.tsx', // Facebook convention '**/__mocks__/*.ts', '**/__mocks__/*.tsx', '**/__tests__/*.ts', '**/__tests__/*.tsx', // Microsoft convention '**/test/*.ts', '**/test/*.tsx' ], rules: {} } ] }; ================================================ FILE: source/react-recent-contacts/.gitignore ================================================ # Logs logs *.log npm-debug.log* # Dependency directories node_modules # Build generated files dist lib release solution temp *.sppkg .heft # Coverage directory used by tools like istanbul coverage # OSX .DS_Store # Visual Studio files .ntvs_analysis.dat .vs bin obj # Resx Generated Code *.resx.ts # Styles Generated Code *.scss.ts ================================================ FILE: source/react-recent-contacts/.vscode/launch.json ================================================ { "version": "0.2.0", "configurations": [ { "name": "Hosted workbench", "type": "pwa-chrome", "request": "launch", "url": "https://enter-your-SharePoint-site/_layouts/workbench.aspx", "webRoot": "${workspaceRoot}", "sourceMaps": true, "sourceMapPathOverrides": { "webpack:///.././src/*": "${webRoot}/src/*", "webpack:///../../../src/*": "${webRoot}/src/*", "webpack:///../../../../src/*": "${webRoot}/src/*", "webpack:///../../../../../src/*": "${webRoot}/src/*" }, "runtimeArgs": [ "--remote-debugging-port=9222", "-incognito" ] } ] } ================================================ FILE: source/react-recent-contacts/.vscode/settings.json ================================================ // Place your settings in this file to overwrite default and user settings. { // Configure glob patterns for excluding files and folders in the file explorer. "files.exclude": { "**/.git": true, "**/.DS_Store": true, "**/bower_components": true, "**/coverage": true, "**/lib-amd": true, "src/**/*.scss.ts": true }, "typescript.tsdk": ".\\node_modules\\typescript\\lib" } ================================================ FILE: source/react-recent-contacts/.yo-rc.json ================================================ { "@microsoft/generator-sharepoint": { "plusBeta": false, "isCreatingSolution": true, "nodeVersion": "16.19.0", "sdksVersions": { "@microsoft/microsoft-graph-client": "3.0.2", "@microsoft/teams-js": "2.4.1" }, "version": "1.16.1", "environment": "spo", "libraryName": "react-recent-contacts", "libraryId": "a9a1f9c1-f04b-4308-8029-2b15c1f93e20", "packageManager": "npm", "skipFeatureDeployment": true, "isDomainIsolated": false, "componentType": "webpart" } } ================================================ FILE: source/react-recent-contacts/README.md ================================================ # Recent Contacts web part This web part provides you the ability to display list of a particular user's recent contacts on a web page. The web part may be configured to display a pre-defined number of contacts at a time. This web part is powered by the Microsoft Graph, in particular the **/me/people** endpoint This webpart is a technology demostrator of Microsoft Graph Toolkit React components, in particular "Get" and "Person". This webpart uses the @microsoft/mgt-react and @microsoft/mgt-spfx packages, currently version 2.9.0. > `NOTE:` This webpart includes the use the Microsoft Graph Toolkit with React, [@microsoft/mgt-react](https://www.npmjs.com/package/@microsoft/mgt-react). > `NOTE:` This webpart includes the use the Microsoft Graph Toolkit with React SPFx, [@microsoft/mgt-spfx](../mgt-spfx/README.md) with a dependency on [mgt-spfx-2.9.0.sppkg](https://github.com/microsoftgraph/microsoft-graph-toolkit/releases) that must be installed to the tenant app catalog. By default the Starter Kit will install this additional dependency. ![Recent Contacts](../../assets/images/components/part-recent-contacts.gif) ## How to use this web part on your web pages 1. Place the page you want to add this web part to in edit mode. 2. Search for and insert the **Recent Contacts** web part. 3. Configure the web part to update its properties. ## Configurable Properties The `Recent Contacts` web part can be configured with the following properties: | Label | Property | Type | Required | Description | | ---- | ---- | ---- | ---- | ---- | | Recent contacts | title | string | no | The web part title, editable inline with the web part itself | | Specify the number of contacts to show | nrOfContacts | number | no | Default: 5 - The number of contacts to show | ## Used SharePoint Framework Version ![drop](https://img.shields.io/badge/version-1.16.1-green.svg) * Supported in SharePoint Online ## Applies to * [SharePoint Framework](https://learn.microsoft.com/en-us/sharepoint/dev/spfx/sharepoint-framework-overview) * [Office 365 tenant](https://learn.microsoft.com/en-us/sharepoint/dev/spfx/set-up-your-development-environment) ## Prerequisites * [mgt-spfx-2.9.0.sppkg](https://github.com/microsoftgraph/microsoft-graph-toolkit/releases) must be installed to the tenant app catalog. By default the Starter Kit will install this additional dependency. Permissions to Microsoft Graph - scope: "People.Read" and "User.Read" ## Solution Solution|Author(s) --------|--------- solution/src/webparts/recentContacts | Elio Struyf (@estruyf) solution/src/webparts/recentContacts | Waldek Mastykarz (@waldekm) solution/src/webparts/recentContacts | Simon Agren (@agrenpoint) solution/src/webparts/recentContacts | Jérémy Crestel (@j_crestel) solution/src/webparts/recentContacts | Daniel Laskewitz (@laskewitz) solution/src/webparts/recentContacts | Vardhaman Deshpande (@vrdmn) solution/src/webparts/recentContacts | Jakob Nøtseth (@net_freak) solution/src/webparts/recentContacts | Mikael Svenson (@mikaelsvenson) solution/src/webparts/recentContacts | Özgür Ersoy (@moersoy) solution/src/webparts/recentContacts | Guido Zambarda source/react-recent-contacts | Yannick Reekmans (@yannickreekmans) react-recent-contacts | Chandani Prajapati (@Chandani_SPD) ## Version history Version|Date|Comments -------|----|-------- 1.0|April 7, 2018|Initial release 2.0|December 4, 2019|v2.0 3.0|February 2023|Initial release for SharePoint Starter Kit v3 (Upgraded to SPFx 1.16.1) ## Disclaimer **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.** --- ## Minimal Path to Awesome * Clone this repository * Move to solution folder * in the command line run: * `npm install` * `gulp serve` ## Features Description of the web part with possible additional details than in short summary. This Web Part illustrates the following concepts on top of the SharePoint Framework: * Using Microsoft Graph and the Microsoft Graph Toolkit React components within a web part * Using Webpack Chunking for bundle management * Using PnP Property Controls (number) ================================================ FILE: source/react-recent-contacts/config/config.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/config.2.0.schema.json", "version": "2.0", "bundles": { "recent-contacts-web-part": { "components": [ { "entrypoint": "./lib/webparts/recentContacts/RecentContactsWebPart.js", "manifest": "./src/webparts/recentContacts/RecentContactsWebPart.manifest.json" } ] } }, "externals": {}, "localizedResources": { "RecentContactsWebPartStrings": "lib/webparts/recentContacts/loc/{locale}.js", "ControlStrings": "node_modules/@pnp/spfx-controls-react/lib/loc/{locale}.js", "PropertyControlStrings": "node_modules/@pnp/spfx-property-controls/lib/loc/{locale}.js" } } ================================================ FILE: source/react-recent-contacts/config/deploy-azure-storage.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/deploy-azure-storage.schema.json", "workingDir": "./release/assets/", "account": "", "container": "react-recent-contacts", "accessKey": "" } ================================================ FILE: source/react-recent-contacts/config/package-solution.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/package-solution.schema.json", "solution": { "name": "Starter Kit - Recent Contacts", "id": "a9a1f9c1-f04b-4308-8029-2b15c1f93e20", "version": "3.0.0.0", "includeClientSideAssets": true, "skipFeatureDeployment": true, "isDomainIsolated": false, "developer": { "name": "PnP Starter Kit", "privacyUrl": "", "termsOfUseUrl": "", "websiteUrl": "", "mpnId": "pnpsk" }, "metadata": { "shortDescription": { "default": "react-recent-contacts description" }, "longDescription": { "default": "react-recent-contacts description" }, "screenshotPaths": [], "videoUrl": "", "categories": [] }, "features": [ { "title": "Starter Kit Starter Kit - Recent Contacts Webpart Feature", "description": "The feature that activates Recent Contacts Webpart from the Starter Kit - Recent Contacts solution.", "id": "726c9a2a-cf33-4928-86a5-fa7c283c610e", "version": "3.0.0.0", "componentIds": [ "726c9a2a-cf33-4928-86a5-fa7c283c610e" ] } ], "webApiPermissionRequests": [ { "resource": "Microsoft Graph", "scope": "People.Read" }, { "resource": "Microsoft Graph", "scope": "User.Read" } ] }, "paths": { "zippedPackage": "solution/react-recent-contacts.sppkg" } } ================================================ FILE: source/react-recent-contacts/config/sass.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/core-build/sass.schema.json" } ================================================ FILE: source/react-recent-contacts/config/serve.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/spfx-serve.schema.json", "port": 4321, "https": true, "initialPage": "https://enter-your-SharePoint-site/_layouts/workbench.aspx" } ================================================ FILE: source/react-recent-contacts/config/write-manifests.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/write-manifests.schema.json", "cdnBasePath": "" } ================================================ FILE: source/react-recent-contacts/gulpfile.js ================================================ 'use strict'; const build = require('@microsoft/sp-build-web'); build.addSuppression(`Warning - [sass] The local CSS class 'ms-Grid' is not camelCase and will not be type-safe.`); var getTasks = build.rig.getTasks; build.rig.getTasks = function () { var result = getTasks.call(build.rig); result.set('serve', result.get('serve-deprecated')); return result; }; build.initialize(require('gulp')); ================================================ FILE: source/react-recent-contacts/package.json ================================================ { "name": "react-recent-contacts", "version": "3.0.0", "private": true, "main": "lib/index.js", "engines": { "node": ">=16.13.0 <17.0.0" }, "scripts": { "build": "gulp bundle", "clean": "gulp clean", "test": "gulp test" }, "dependencies": { "@microsoft/mgt-react": "2.9.0", "@microsoft/mgt-spfx": "2.9.0", "@microsoft/sp-core-library": "1.16.1", "@microsoft/sp-lodash-subset": "1.16.1", "@microsoft/sp-office-ui-fabric-core": "1.16.1", "@microsoft/sp-property-pane": "1.16.1", "@microsoft/sp-webpart-base": "1.16.1", "@pnp/spfx-controls-react": "3.12.0", "@pnp/spfx-property-controls": "3.11.0", "react": "17.0.1", "react-dom": "17.0.1", "tslib": "2.3.1" }, "resolutions": { "@types/react": "16.8.8" }, "devDependencies": { "@microsoft/eslint-config-spfx": "1.16.1", "@microsoft/eslint-plugin-spfx": "1.16.1", "@microsoft/rush-stack-compiler-4.5": "0.2.2", "@microsoft/sp-build-web": "1.16.1", "@microsoft/sp-module-interfaces": "1.16.1", "@rushstack/eslint-config": "2.5.1", "@types/react": "17.0.45", "@types/react-dom": "17.0.17", "@types/webpack-env": "~1.15.2", "ajv": "^6.12.5", "eslint-plugin-react-hooks": "4.3.0", "gulp": "4.0.2", "typescript": "4.5.5" } } ================================================ FILE: source/react-recent-contacts/src/index.ts ================================================ // A file is required to be in the root of the /src directory by the TypeScript compiler ================================================ FILE: source/react-recent-contacts/src/webparts/recentContacts/RecentContactsWebPart.manifest.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx/client-side-web-part-manifest.schema.json", "id": "726c9a2a-cf33-4928-86a5-fa7c283c610e", "alias": "RecentContactsWebPart", "componentType": "WebPart", "version": "*", "manifestVersion": 2, "requiresCustomScript": false, "supportedHosts": ["SharePointWebPart", "SharePointFullPage", "TeamsTab", "TeamsPersonalApp"], "preconfiguredEntries": [{ "groupId": "5c03119e-3074-46fd-976b-c60198311f70", "group": { "default": "Other" }, "title": { "default": "Recent contacts" }, "description": { "default": "Lists recent contacts of the user" }, "officeFabricIconFontName": "ContactLink", "properties": { "title": "Recent contacts", "nrOfContacts": 5 } }] } ================================================ FILE: source/react-recent-contacts/src/webparts/recentContacts/RecentContactsWebPart.ts ================================================ import * as React from 'react'; import * as ReactDom from 'react-dom'; import { Version } from '@microsoft/sp-core-library'; import { BaseClientSideWebPart } from "@microsoft/sp-webpart-base"; import { IPropertyPaneConfiguration } from "@microsoft/sp-property-pane"; import * as strings from 'RecentContactsWebPartStrings'; import { RecentContacts, IRecentContactsProps } from './components'; import { Providers, SharePointProvider } from '@microsoft/mgt-spfx'; export interface IRecentContactsWebPartProps { title: string; nrOfContacts: number; } export default class RecentContactsWebPart extends BaseClientSideWebPart { private propertyFieldNumber: any; protected onInit(): Promise { if (!Providers.globalProvider) { Providers.globalProvider = new SharePointProvider(this.context); } return super.onInit(); } public render(): void { const element: React.ReactElement = React.createElement( RecentContacts, { title: this.properties.title, nrOfContacts: this.properties.nrOfContacts, displayMode: this.displayMode, updateProperty: (value: string) => { this.properties.title = value; } } ); ReactDom.render(element, this.domElement); } protected get dataVersion(): Version { return Version.parse('1.0'); } //executes only before property pane is loaded. protected async loadPropertyPaneResources(): Promise { // import additional controls/components const { PropertyFieldNumber } = await import( /* webpackChunkName: 'pnp-propcontrols-number' */ '@pnp/spfx-property-controls/lib/propertyFields/number' ); this.propertyFieldNumber = PropertyFieldNumber; } protected getPropertyPaneConfiguration(): IPropertyPaneConfiguration { return { pages: [ { header: { description: strings.PropertyPaneDescription }, groups: [ { groupFields: [ this.propertyFieldNumber("nrOfContacts", { key: "nrOfContacts", label: strings.NrOfContactsToShow, value: this.properties.nrOfContacts, minValue: 1, maxValue: 10 }) ] } ] } ] }; } } ================================================ FILE: source/react-recent-contacts/src/webparts/recentContacts/components/IContacts.ts ================================================ export interface IContacts { '@odata.context': string; value: IContact[]; } export interface IContact { '@odata.etag': string; id: string; displayName: string; phones: Phone[]; scoredEmailAddresses: ScoredEmailAddress[]; personType: PersonType; } export interface ScoredEmailAddress { address: string; relevanceScore: number; selectionLikelihood: string; } export interface Phone { type: string; number: string; } export interface PersonType { class: string; subclass: string; } ================================================ FILE: source/react-recent-contacts/src/webparts/recentContacts/components/IRecentContactsProps.ts ================================================ import { IRecentContactsWebPartProps } from "../RecentContactsWebPart"; import { DisplayMode } from '@microsoft/sp-core-library'; export interface IRecentContactsProps extends IRecentContactsWebPartProps { displayMode: DisplayMode; updateProperty: (value: string) => void; } ================================================ FILE: source/react-recent-contacts/src/webparts/recentContacts/components/IRecentContactsState.ts ================================================ import { IContact } from '.'; export interface IRecentContactsState { recentContacts: IContact[]; error: string; loading: boolean; } ================================================ FILE: source/react-recent-contacts/src/webparts/recentContacts/components/RecentContacts.module.scss ================================================ @import "~@fluentui/react/dist/sass/References.scss"; .recentContacts { .persona { margin-bottom: 5px; } .header { display: flex; align-items: center; margin-bottom: 5px; } .personaDetails { padding: 0px 24px 0px 16px; min-width: 0px; width: 100%; text-align: left; display: flex; flex-direction: column; justify-content: space-around; .titleText { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: rgb(51, 51, 51); font-weight: 400; font-size: 20px; } .emailText { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: $ms-color-themePrimary; font-weight: 400; font-size: 14px; text-overflow: ellipsis; overflow: hidden; } .contactText { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: $ms-color-themePrimary; font-weight: 400; font-size: 14px; } } .noContacts { @include ms-font-m; } .error { @include ms-font-m; color: $ms-color-alert; } mgt-person { --avatar-size: 72px; --font-size: 28px; --font-weight: 800; } } ================================================ FILE: source/react-recent-contacts/src/webparts/recentContacts/components/RecentContacts.tsx ================================================ import * as React from 'react'; import styles from './RecentContacts.module.scss'; import { IRecentContactsProps, IRecentContactsState, IContacts, IContact } from '.'; import { WebPartTitle } from '@pnp/spfx-controls-react/lib/WebPartTitle'; import * as strings from 'RecentContactsWebPartStrings'; import { Spinner, SpinnerSize } from '@fluentui/react/lib/Spinner'; import { List } from '@fluentui/react/lib/List'; import { Get, MgtTemplateProps, Person } from '@microsoft/mgt-react/dist/es6/spfx'; import { Link } from '@fluentui/react/lib/Link'; export class RecentContacts extends React.Component { constructor(props: IRecentContactsProps) { super(props); } private PersonComponent(props: MgtTemplateProps) { const data = props.dataContext; return (
{data.displayName}
{data?.emailAddresses.length && data.emailAddresses[0].address && {data.emailAddresses[0].address}} {data?.phones?.length ? {data.phones[0].number} : ''}
) } private LoaderComponent(props: MgtTemplateProps) { return (); } private ErrorComponent(props: MgtTemplateProps) { return ({JSON.parse(props?.dataContext?.body).message || strings.Error}); } /** * Default React render method */ public render(): React.ReactElement { const noOfContact = this.props.nrOfContacts || 5; const peopleEndpointUrl = `/me/people?$top=${noOfContact}`; const maxPages = 1; return (
); } } ================================================ FILE: source/react-recent-contacts/src/webparts/recentContacts/components/index.ts ================================================ export * from './IRecentContactsProps'; export * from './IRecentContactsState'; export * from './IContacts'; export * from './RecentContacts'; ================================================ FILE: source/react-recent-contacts/src/webparts/recentContacts/components/person/IPersonProps.ts ================================================ import { MSGraphClientV3 } from '@microsoft/sp-http'; import { IContact } from ".."; export interface IPersonProps { className: string; person: IContact; graphClient: MSGraphClientV3; } ================================================ FILE: source/react-recent-contacts/src/webparts/recentContacts/components/person/IPersonState.ts ================================================ export interface IPersonState { image: string; } ================================================ FILE: source/react-recent-contacts/src/webparts/recentContacts/components/person/Person.tsx ================================================ import * as React from 'react'; import { IPersonProps, IPersonState } from '.'; import { Persona, PersonaSize, IPersonaProps } from '@fluentui/react/lib/Persona'; import { Link } from '@fluentui/react/lib/Link'; export class Person extends React.Component { constructor(props: IPersonProps) { super(props); this.state = { image: null }; } /** * Renders the secondary field as mail */ private _renderMail = (props: IPersonaProps) => { if (props.secondaryText) { return {props.secondaryText}; } return
; } /** * Renders the tertiary field as mail */ private _renderPhone = (props: IPersonaProps) => { if (props.tertiaryText) { return {props.tertiaryText}; } return
; } /** * componentDidMount lifecycle hook */ public componentDidMount(): void { const { person, graphClient } = this.props; if (person) { // Check if the image can be retrieved const { personType } = person; if (personType && personType.class.toLowerCase() === "person" && personType.subclass.toLowerCase() === "organizationuser") { graphClient.api(`users/${person.id}/photo/$value`).version("v1.0").responseType('blob').get((err: any, res: any, rawResponse: { xhr: { response: Blob | MediaSource; }; }) => { // Check if the image was retrieved if (rawResponse && rawResponse.xhr && rawResponse.xhr.response) { const url = window.URL; const blobUrl = url.createObjectURL(rawResponse.xhr.response); this.setState({ image: blobUrl }); } }); } } } /** * Default React render */ public render(): React.ReactElement { const { person } = this.props; let phoneNr: string = null; if (person.phones && person.phones.length > 0) { phoneNr = person.phones[0].number; } let email: string = null; if (person.scoredEmailAddresses && person.scoredEmailAddresses.length > 0) { email = person.scoredEmailAddresses[0].address; } return ( ); } } ================================================ FILE: source/react-recent-contacts/src/webparts/recentContacts/components/person/index.ts ================================================ export * from "./IPersonProps"; export * from "./IPersonState"; export * from "./Person"; ================================================ FILE: source/react-recent-contacts/src/webparts/recentContacts/loc/de-de.js ================================================ define([], function() { return { "DescriptionFieldLabel": "Kontakte Web Part Configuration", "NrOfContactsToShow": "Geben Sie die Anzahl der anzuzeigenden Kontakte an", "NoContacts": "Keine Kontake gefunden.", "Loading": "Rufe Ihre Kontakte auf", "Error": "Ein Fehler beim Aufrufen Ihrer Kontakte ist aufgetreten." } }); ================================================ FILE: source/react-recent-contacts/src/webparts/recentContacts/loc/en-us.js ================================================ define([], function() { return { "DescriptionFieldLabel": "Contacts web part configuration", "NrOfContactsToShow": "Specify the number of contacts to show", "NoContacts": "No contacts were found.", "Loading": "Retrieving your contacts", "Error": "Sorry, something failed retrieving your contacts." } }); ================================================ FILE: source/react-recent-contacts/src/webparts/recentContacts/loc/es-es.js ================================================ define([], function() { return { "DescriptionFieldLabel": "Configuracion de elemento web de Contactos", "NrOfContactsToShow": "Especifique el numero de contactos a mostrar", "NoContacts": "No se encontraron contactos.", "Loading": "Obteniendo sus contactos", "Error": "Lo sentimos, algo fallo al obtener sus contactos." } }); ================================================ FILE: source/react-recent-contacts/src/webparts/recentContacts/loc/fr-fr.js ================================================ define([], function() { return { "DescriptionFieldLabel": "Configuration des contacts de la partie Web", "NrOfContactsToShow": "Spécifiez le nombre de contacts à afficher", "NoContacts": "Aucun contact n'a été trouvé.", "Loading": "Récupération de vos contacts", "Error": "Désolé, quelque chose a échoué lors de la récupération de vos contacts." } }); ================================================ FILE: source/react-recent-contacts/src/webparts/recentContacts/loc/mystrings.d.ts ================================================ declare interface IRecentContactsWebPartStrings { PropertyPaneDescription: string; NrOfContactsToShow: string; NoContacts: string; Loading: string; Error: string; } declare module 'RecentContactsWebPartStrings' { const strings: IRecentContactsWebPartStrings; export = strings; } ================================================ FILE: source/react-recent-contacts/src/webparts/recentContacts/loc/nb-no.js ================================================ define([], function() { return { "DescriptionFieldLabel": "Kontakter webdel konfigurasjon", "NrOfContactsToShow": "Angi hvor mange kontakter som skal vises", "NoContacts": "Ingen kontakter funnet.", "Loading": "Henter dine kontakter", "Error": "En feil oppstod ved henting av dine kontakter." } }); ================================================ FILE: source/react-recent-contacts/src/webparts/recentContacts/loc/nl-nl.js ================================================ define([], function() { return { "DescriptionFieldLabel": "Contacten webpart configuratie", "NrOfContactsToShow": "Specificeer het aantal contacten die getoond moeten worden", "NoContacts": "Geen contacten gevonden.", "Loading": "Contacten worden opgehaald", "Error": "Sorry, er is iets fout gegaan tijdens het ophalen van je contacten." } }); ================================================ FILE: source/react-recent-contacts/src/webparts/recentContacts/loc/sv-se.js ================================================ define([], function() { return { "DescriptionFieldLabel": "Kontakter webbdelskonfiguration", "NrOfContactsToShow": "Ange antal kontakter som skall visas", "NoContacts": "Inga kontakter hittades.", "Loading": "Hämtar dina kontakter", "Error": "Tyvärr, något gick fel med att hämta dina kontakter." } }); ================================================ FILE: source/react-recent-contacts/src/webparts/recentContacts/loc/tr-tr.js ================================================ define([], function() { return { "DescriptionFieldLabel": "Rehber web parçası yapılandırması", "NrOfContactsToShow": "Gösterilecek kişi sayısını belirtin", "NoContacts": "Kişi bulunamadı.", "Loading": "Kişilerinizi alınıyor", "Error": "Üzgünüz, kişileriniz bir şeyleri alamadı." } }); ================================================ FILE: source/react-recent-contacts/tsconfig.json ================================================ { "extends": "./node_modules/@microsoft/rush-stack-compiler-4.5/includes/tsconfig-web.json", "compilerOptions": { "target": "es5", "forceConsistentCasingInFileNames": true, "module": "esnext", "moduleResolution": "node", "jsx": "react", "declaration": true, "sourceMap": true, "experimentalDecorators": true, "skipLibCheck": true, "outDir": "lib", "inlineSources": false, "strictNullChecks": false, "noImplicitAny": false, "noUnusedLocals": false, "noUnusedParameters": false, "typeRoots": [ "./node_modules/@types", "./node_modules/@microsoft" ], "types": [ "webpack-env" ], "lib": [ "es5", "dom", "es2015.collection", "es2015.promise" ] }, "include": [ "src/**/*.ts", "src/**/*.tsx" ] } ================================================ FILE: source/react-recently-used-documents/.editorconfig ================================================ # EditorConfig helps developers define and maintain consistent # coding styles between different editors and IDEs # editorconfig.org root = true [*] # change these settings to your own preference indent_style = space indent_size = 2 # we recommend you to keep these unchanged end_of_line = lf charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true [*.md] trim_trailing_whitespace = false [{package,bower}.json] indent_style = space indent_size = 2 ================================================ FILE: source/react-recently-used-documents/.eslintrc.js ================================================ require('@rushstack/eslint-config/patch/modern-module-resolution'); module.exports = { extends: ['@microsoft/eslint-config-spfx/lib/profiles/react'], parserOptions: { tsconfigRootDir: __dirname }, overrides: [ { files: ['*.ts', '*.tsx'], parser: '@typescript-eslint/parser', 'parserOptions': { 'project': './tsconfig.json', 'ecmaVersion': 2018, 'sourceType': 'module' }, rules: { // Prevent usage of the JavaScript null value, while allowing code to access existing APIs that may require null. https://www.npmjs.com/package/@rushstack/eslint-plugin '@rushstack/no-new-null': 1, // Require Jest module mocking APIs to be called before any other statements in their code block. https://www.npmjs.com/package/@rushstack/eslint-plugin '@rushstack/hoist-jest-mock': 1, // Require regular expressions to be constructed from string constants rather than dynamically building strings at runtime. https://www.npmjs.com/package/@rushstack/eslint-plugin-security '@rushstack/security/no-unsafe-regexp': 1, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/adjacent-overload-signatures': 1, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // // CONFIGURATION: By default, these are banned: String, Boolean, Number, Object, Symbol '@typescript-eslint/ban-types': [ 1, { 'extendDefaults': false, 'types': { 'String': { 'message': 'Use \'string\' instead', 'fixWith': 'string' }, 'Boolean': { 'message': 'Use \'boolean\' instead', 'fixWith': 'boolean' }, 'Number': { 'message': 'Use \'number\' instead', 'fixWith': 'number' }, 'Object': { 'message': 'Use \'object\' instead, or else define a proper TypeScript type:' }, 'Symbol': { 'message': 'Use \'symbol\' instead', 'fixWith': 'symbol' }, 'Function': { 'message': 'The \'Function\' type accepts any function-like value.\nIt provides no type safety when calling the function, which can be a common source of bugs.\nIt also accepts things like class declarations, which will throw at runtime as they will not be called with \'new\'.\nIf you are expecting the function to accept certain arguments, you should explicitly define the function shape.' } } } ], // RATIONALE: Code is more readable when the type of every variable is immediately obvious. // Even if the compiler may be able to infer a type, this inference will be unavailable // to a person who is reviewing a GitHub diff. This rule makes writing code harder, // but writing code is a much less important activity than reading it. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/explicit-function-return-type': [ 0, { 'allowExpressions': true, 'allowTypedFunctionExpressions': true, 'allowHigherOrderFunctions': false } ], // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // Rationale to disable: although this is a recommended rule, it is up to dev to select coding style. // Set to 1 (warning) or 2 (error) to enable. '@typescript-eslint/explicit-member-accessibility': 0, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/no-array-constructor': 1, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // // RATIONALE: The "any" keyword disables static type checking, the main benefit of using TypeScript. // This rule should be suppressed only in very special cases such as JSON.stringify() // where the type really can be anything. Even if the type is flexible, another type // may be more appropriate such as "unknown", "{}", or "Record". '@typescript-eslint/no-explicit-any': 0, // RATIONALE: The #1 rule of promises is that every promise chain must be terminated by a catch() // handler. Thus wherever a Promise arises, the code must either append a catch handler, // or else return the object to a caller (who assumes this responsibility). Unterminated // promise chains are a serious issue. Besides causing errors to be silently ignored, // they can also cause a NodeJS process to terminate unexpectedly. '@typescript-eslint/no-floating-promises': 2, // RATIONALE: Catches a common coding mistake. '@typescript-eslint/no-for-in-array': 2, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/no-misused-new': 2, // RATIONALE: The "namespace" keyword is not recommended for organizing code because JavaScript lacks // a "using" statement to traverse namespaces. Nested namespaces prevent certain bundler // optimizations. If you are declaring loose functions/variables, it's better to make them // static members of a class, since classes support property getters and their private // members are accessible by unit tests. Also, the exercise of choosing a meaningful // class name tends to produce more discoverable APIs: for example, search+replacing // the function "reverse()" is likely to return many false matches, whereas if we always // write "Text.reverse()" is more unique. For large scale organization, it's recommended // to decompose your code into separate NPM packages, which ensures that component // dependencies are tracked more conscientiously. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/no-namespace': [ 1, { 'allowDeclarations': false, 'allowDefinitionFiles': false } ], // RATIONALE: Parameter properties provide a shorthand such as "constructor(public title: string)" // that avoids the effort of declaring "title" as a field. This TypeScript feature makes // code easier to write, but arguably sacrifices readability: In the notes for // "@typescript-eslint/member-ordering" we pointed out that fields are central to // a class's design, so we wouldn't want to bury them in a constructor signature // just to save some typing. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // Set to 1 (warning) or 2 (error) to enable the rule '@typescript-eslint/no-parameter-properties': 0, // RATIONALE: When left in shipping code, unused variables often indicate a mistake. Dead code // may impact performance. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/no-unused-vars': [ 1, { 'vars': 'all', // Unused function arguments often indicate a mistake in JavaScript code. However in TypeScript code, // the compiler catches most of those mistakes, and unused arguments are fairly common for type signatures // that are overriding a base class method or implementing an interface. 'args': 'none' } ], // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/no-use-before-define': [ 2, { 'functions': false, 'classes': true, 'variables': true, 'enums': true, 'typedefs': true } ], // Disallows require statements except in import statements. // In other words, the use of forms such as var foo = require("foo") are banned. Instead use ES6 style imports or import foo = require("foo") imports. '@typescript-eslint/no-var-requires': 'error', // RATIONALE: The "module" keyword is deprecated except when describing legacy libraries. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/prefer-namespace-keyword': 1, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // Rationale to disable: it's up to developer to decide if he wants to add type annotations // Set to 1 (warning) or 2 (error) to enable the rule '@typescript-eslint/no-inferrable-types': 0, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // Rationale to disable: declaration of empty interfaces may be helpful for generic types scenarios '@typescript-eslint/no-empty-interface': 0, // RATIONALE: This rule warns if setters are defined without getters, which is probably a mistake. 'accessor-pairs': 1, // RATIONALE: In TypeScript, if you write x["y"] instead of x.y, it disables type checking. 'dot-notation': [ 1, { 'allowPattern': '^_' } ], // RATIONALE: Catches code that is likely to be incorrect 'eqeqeq': 0, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'for-direction': 1, // RATIONALE: Catches a common coding mistake. 'guard-for-in': 2, // RATIONALE: If you have more than 2,000 lines in a single source file, it's probably time // to split up your code. 'max-lines': ['warn', { max: 2000 }], // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-async-promise-executor': 2, // RATIONALE: Deprecated language feature. 'no-caller': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-compare-neg-zero': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-cond-assign': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-constant-condition': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-control-regex': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-debugger': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-delete-var': 2, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-duplicate-case': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-empty': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-empty-character-class': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-empty-pattern': 1, // RATIONALE: Eval is a security concern and a performance concern. 'no-eval': 1, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-ex-assign': 2, // RATIONALE: System types are global and should not be tampered with in a scalable code base. // If two different libraries (or two versions of the same library) both try to modify // a type, only one of them can win. Polyfills are acceptable because they implement // a standardized interoperable contract, but polyfills are generally coded in plain // JavaScript. 'no-extend-native': 1, // Disallow unnecessary labels 'no-extra-label': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-fallthrough': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-func-assign': 1, // RATIONALE: Catches a common coding mistake. 'no-implied-eval': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-invalid-regexp': 2, // RATIONALE: Catches a common coding mistake. 'no-label-var': 2, // RATIONALE: Eliminates redundant code. 'no-lone-blocks': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-misleading-character-class': 2, // RATIONALE: Catches a common coding mistake. 'no-multi-str': 2, // RATIONALE: It's generally a bad practice to call "new Thing()" without assigning the result to // a variable. Either it's part of an awkward expression like "(new Thing()).doSomething()", // or else implies that the constructor is doing nontrivial computations, which is often // a poor class design. 'no-new': 1, // RATIONALE: Obsolete language feature that is deprecated. 'no-new-func': 2, // RATIONALE: Obsolete language feature that is deprecated. 'no-new-object': 2, // RATIONALE: Obsolete notation. 'no-new-wrappers': 1, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-octal': 2, // RATIONALE: Catches code that is likely to be incorrect 'no-octal-escape': 2, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-regex-spaces': 2, // RATIONALE: Catches a common coding mistake. 'no-return-assign': 2, // RATIONALE: Security risk. 'no-script-url': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-self-assign': 2, // RATIONALE: Catches a common coding mistake. 'no-self-compare': 2, // RATIONALE: This avoids statements such as "while (a = next(), a && a.length);" that use // commas to create compound expressions. In general code is more readable if each // step is split onto a separate line. This also makes it easier to set breakpoints // in the debugger. 'no-sequences': 1, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-shadow-restricted-names': 2, // RATIONALE: Obsolete language feature that is deprecated. // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-sparse-arrays': 2, // RATIONALE: Although in theory JavaScript allows any possible data type to be thrown as an exception, // such flexibility adds pointless complexity, by requiring every catch block to test // the type of the object that it receives. Whereas if catch blocks can always assume // that their object implements the "Error" contract, then the code is simpler, and // we generally get useful additional information like a call stack. 'no-throw-literal': 2, // RATIONALE: Catches a common coding mistake. 'no-unmodified-loop-condition': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-unsafe-finally': 2, // RATIONALE: Catches a common coding mistake. 'no-unused-expressions': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-unused-labels': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-useless-catch': 1, // RATIONALE: Avoids a potential performance problem. 'no-useless-concat': 1, // RATIONALE: The "var" keyword is deprecated because of its confusing "hoisting" behavior. // Always use "let" or "const" instead. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json 'no-var': 2, // RATIONALE: Generally not needed in modern code. 'no-void': 1, // RATIONALE: Obsolete language feature that is deprecated. // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-with': 2, // RATIONALE: Makes logic easier to understand, since constants always have a known value // @typescript-eslint\eslint-plugin\dist\configs\eslint-recommended.js 'prefer-const': 1, // RATIONALE: Catches a common coding mistake where "resolve" and "reject" are confused. 'promise/param-names': 2, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'require-atomic-updates': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'require-yield': 1, // "Use strict" is redundant when using the TypeScript compiler. 'strict': [ 2, 'never' ], // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'use-isnan': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js // Set to 1 (warning) or 2 (error) to enable. // Rationale to disable: !!{} 'no-extra-boolean-cast': 0, // ==================================================================== // @microsoft/eslint-plugin-spfx // ==================================================================== '@microsoft/spfx/import-requires-chunk-name': 1, '@microsoft/spfx/no-require-ensure': 2, '@microsoft/spfx/pair-react-dom-render-unmount': 0 } }, { // For unit tests, we can be a little bit less strict. The settings below revise the // defaults specified in the extended configurations, as well as above. files: [ // Test files '*.test.ts', '*.test.tsx', '*.spec.ts', '*.spec.tsx', // Facebook convention '**/__mocks__/*.ts', '**/__mocks__/*.tsx', '**/__tests__/*.ts', '**/__tests__/*.tsx', // Microsoft convention '**/test/*.ts', '**/test/*.tsx' ], rules: {} } ] }; ================================================ FILE: source/react-recently-used-documents/.gitignore ================================================ # Logs logs *.log npm-debug.log* # Dependency directories node_modules # Build generated files dist lib release solution temp *.sppkg .heft # Coverage directory used by tools like istanbul coverage # OSX .DS_Store # Visual Studio files .ntvs_analysis.dat .vs bin obj # Resx Generated Code *.resx.ts # Styles Generated Code *.scss.ts ================================================ FILE: source/react-recently-used-documents/.npmignore ================================================ !dist config gulpfile.js release src temp tsconfig.json tslint.json *.log .yo-rc.json .vscode ================================================ FILE: source/react-recently-used-documents/.vscode/launch.json ================================================ { "version": "0.2.0", "configurations": [ { "name": "Hosted workbench", "type": "pwa-chrome", "request": "launch", "url": "https://enter-your-SharePoint-site/_layouts/workbench.aspx", "webRoot": "${workspaceRoot}", "sourceMaps": true, "sourceMapPathOverrides": { "webpack:///.././src/*": "${webRoot}/src/*", "webpack:///../../../src/*": "${webRoot}/src/*", "webpack:///../../../../src/*": "${webRoot}/src/*", "webpack:///../../../../../src/*": "${webRoot}/src/*" }, "runtimeArgs": [ "--remote-debugging-port=9222", "-incognito" ] } ] } ================================================ FILE: source/react-recently-used-documents/.vscode/settings.json ================================================ // Place your settings in this file to overwrite default and user settings. { // Configure glob patterns for excluding files and folders in the file explorer. "files.exclude": { "**/.git": true, "**/.DS_Store": true, "**/bower_components": true, "**/coverage": true, "**/lib-amd": true, "src/**/*.scss.ts": true }, "typescript.tsdk": ".\\node_modules\\typescript\\lib" } ================================================ FILE: source/react-recently-used-documents/.yo-rc.json ================================================ { "@microsoft/generator-sharepoint": { "plusBeta": false, "isCreatingSolution": true, "nodeVersion": "16.19.0", "sdksVersions": { "@microsoft/microsoft-graph-client": "3.0.2", "@microsoft/teams-js": "2.4.1" }, "version": "1.16.1", "environment": "spo", "libraryName": "react-recently-used-documents", "libraryId": "9ff0a6e2-52d6-40fe-81a0-1df792f81da0", "packageManager": "npm", "isDomainIsolated": false, "skipFeatureDeployment": true, "componentType": "webpart" } } ================================================ FILE: source/react-recently-used-documents/README.md ================================================ # Recently Used Documents web part This web part provides you the ability to display a list of a particular user's recently used documents on a web page. The web part may be configured to display a pre-defined number of documents at a time. This web part is powered by the Microsoft Graph and uses the me/insights/used Graph endpoint, while filtering out document types including: "Web", "spsite", "Folder", "Archive", "Image", and "Other". ![Recently Used Documents](../../assets/images/components/part-recently-used-documents.gif) ## How to use this web part on your web pages 1. Place the page you want to add this web part to in edit mode. 2. Search for and insert the **Recently Used Documents** web part. 3. Configure the web part to update its properties. ## Configurable Properties The `Recently Used Documents` web part can be configured with the following properties: | Label | Property | Type | Required | Description | | ---- | ---- | ---- | ---- | ---- | | Recent Documents | title | string | no | The web part title, editable inline with the web part itself | | Specify the number of documents to show | nrOfItems | number | no | Default: 3 - The number of documents to show | ## Used SharePoint Framework Version ![drop](https://img.shields.io/badge/version-1.16.1-green.svg) * Supported in SharePoint Online ## Applies to * [SharePoint Framework](https://learn.microsoft.com/en-us/sharepoint/dev/spfx/sharepoint-framework-overview) * [Office 365 tenant](https://learn.microsoft.com/en-us/sharepoint/dev/spfx/set-up-your-development-environment) ## Prerequisites Permissions to Microsoft Graph - scope: "Sites.Read.All" ## Solution Solution|Author(s) --------|--------- solution/src/webparts/recentlyUsedDocuments | Elio Struyf (@struyf) react-recently-used-documents | Sébastien Levert (@sebastienlevert) react-recently-used-documents | Chandani Prajapati (@Chandani_SPD) ## Version history Version|Date|Comments -------|----|-------- 1.0|March 28, 2018|Initial release 2.0|December 29, 2019|v2.0 3.0|February 2023|Initial release for SharePoint Starter Kit v3 (Upgraded to SPFx 1.16.1) ## Disclaimer **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.** --- ## Minimal Path to Awesome * Clone this repository * Move to solution folder * in the command line run: * `npm install` * `gulp serve` ## Features Description of the web part with possible additional details than in short summary. This Web Part illustrates the following concepts on top of the SharePoint Framework: * Using Microsoft Graph from the web parts with queries and filters * Using Lists from FluentUI * Using Webpack Chunking for bundle management * Using PnP Property Controls (number) ================================================ FILE: source/react-recently-used-documents/config/config.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/config.2.0.schema.json", "version": "2.0", "bundles": { "recently-used-documents-web-part": { "components": [ { "entrypoint": "./lib/webparts/recentlyUsedDocuments/RecentlyUsedDocumentsWebPart.js", "manifest": "./src/webparts/recentlyUsedDocuments/RecentlyUsedDocumentsWebPart.manifest.json" } ] } }, "externals": {}, "localizedResources": { "RecentlyUsedDocumentsWebPartStrings": "lib/webparts/recentlyUsedDocuments/loc/{locale}.js", "PropertyControlStrings": "node_modules/@pnp/spfx-property-controls/lib/loc/{locale}.js", "ControlStrings": "node_modules/@pnp/spfx-controls-react/lib/loc/{locale}.js" } } ================================================ FILE: source/react-recently-used-documents/config/deploy-azure-storage.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/deploy-azure-storage.schema.json", "workingDir": "./release/assets/", "account": "", "container": "react-recently-used-documents", "accessKey": "" } ================================================ FILE: source/react-recently-used-documents/config/package-solution.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/package-solution.schema.json", "solution": { "name": "Starter Kit - Recently Used Documents", "id": "9ff0a6e2-52d6-40fe-81a0-1df792f81da0", "version": "3.0.0.0", "includeClientSideAssets": true, "skipFeatureDeployment": true, "isDomainIsolated": false, "developer": { "name": "PnP Starter Kit", "privacyUrl": "", "termsOfUseUrl": "", "websiteUrl": "", "mpnId": "pnpsk" }, "metadata": { "shortDescription": { "default": "react-recently-used-documents description" }, "longDescription": { "default": "react-recently-used-documents description" }, "screenshotPaths": [], "videoUrl": "", "categories": [] }, "features": [ { "title": "Starter Kit - Recently Used Documents Webpart Feature", "description": "The feature that activates Recently Used Documents from the Starter Kit - Recently Used Documents solution.", "id": "7b36c4ce-93b6-4f4a-8e66-d760a172333c", "version": "3.0.0.0", "componentIds": [ "7b36c4ce-93b6-4f4a-8e66-d760a172333c" ] } ], "webApiPermissionRequests": [ { "resource": "Microsoft Graph", "scope": "Sites.Read.All" } ] }, "paths": { "zippedPackage": "solution/react-recently-used-documents.sppkg" } } ================================================ FILE: source/react-recently-used-documents/config/sass.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/core-build/sass.schema.json" } ================================================ FILE: source/react-recently-used-documents/config/serve.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/spfx-serve.schema.json", "port": 4321, "https": true, "initialPage": "https://enter-your-SharePoint-site/_layouts/workbench.aspx" } ================================================ FILE: source/react-recently-used-documents/config/write-manifests.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/write-manifests.schema.json", "cdnBasePath": "" } ================================================ FILE: source/react-recently-used-documents/gulpfile.js ================================================ 'use strict'; const build = require('@microsoft/sp-build-web'); build.addSuppression(`Warning - [sass] The local CSS class 'ms-Grid' is not camelCase and will not be type-safe.`); var getTasks = build.rig.getTasks; build.rig.getTasks = function () { var result = getTasks.call(build.rig); result.set('serve', result.get('serve-deprecated')); return result; }; build.initialize(require('gulp')); ================================================ FILE: source/react-recently-used-documents/package.json ================================================ { "name": "react-recently-used-documents", "version": "3.0.0", "private": true, "main": "lib/index.js", "engines": { "node": ">=16.13.0 <17.0.0" }, "scripts": { "build": "gulp bundle", "clean": "gulp clean", "test": "gulp test" }, "dependencies": { "@microsoft/sp-core-library": "1.16.1", "@microsoft/sp-lodash-subset": "1.16.1", "@microsoft/sp-office-ui-fabric-core": "1.16.1", "@microsoft/sp-property-pane": "1.16.1", "@microsoft/sp-webpart-base": "1.16.1", "@pnp/spfx-controls-react": "3.12.0", "@pnp/spfx-property-controls": "3.11.0", "react": "17.0.1", "react-dom": "17.0.1", "tslib": "2.3.1" }, "resolutions": { "@types/react": "16.8.8" }, "devDependencies": { "@microsoft/eslint-config-spfx": "1.16.1", "@microsoft/eslint-plugin-spfx": "1.16.1", "@microsoft/rush-stack-compiler-4.5": "0.2.2", "@microsoft/sp-build-web": "1.16.1", "@microsoft/sp-module-interfaces": "1.16.1", "@rushstack/eslint-config": "2.5.1", "@types/react": "17.0.45", "@types/react-dom": "17.0.17", "@types/webpack-env": "~1.15.2", "ajv": "^6.12.5", "eslint-plugin-react-hooks": "4.3.0", "gulp": "4.0.2", "typescript": "4.5.5" } } ================================================ FILE: source/react-recently-used-documents/src/index.ts ================================================ // A file is required to be in the root of the /src directory by the TypeScript compiler ================================================ FILE: source/react-recently-used-documents/src/webparts/recentlyUsedDocuments/RecentlyUsedDocumentsWebPart.manifest.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx/client-side-web-part-manifest.schema.json", "id": "7b36c4ce-93b6-4f4a-8e66-d760a172333c", "alias": "RecentlyUsedDocumentsWebPart", "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, "supportedHosts": ["SharePointWebPart", "SharePointFullPage", "TeamsTab", "TeamsPersonalApp"], "preconfiguredEntries": [{ "groupId": "5c03119e-3074-46fd-976b-c60198311f70", // Other "group": { "default": "Other" }, "title": { "default": "RecentlyUsedDocuments" }, "description": { "default": "Recently used documents of the user" }, "officeFabricIconFontName": "TextDocumentShared", "properties": { "description": "RecentlyUsedDocuments" } }] } ================================================ FILE: source/react-recently-used-documents/src/webparts/recentlyUsedDocuments/RecentlyUsedDocumentsWebPart.ts ================================================ import * as React from 'react'; import * as ReactDom from 'react-dom'; import { Version } from '@microsoft/sp-core-library'; import { BaseClientSideWebPart } from "@microsoft/sp-webpart-base"; import { IPropertyPaneConfiguration } from "@microsoft/sp-property-pane"; import * as strings from 'RecentlyUsedDocumentsWebPartStrings'; import RecentlyUsedDocuments from './components/RecentlyUsedDocuments'; import { IRecentlyUsedDocumentsProps } from './components/IRecentlyUsedDocumentsProps'; import { MSGraphClientV3 } from '@microsoft/sp-http'; export interface IRecentlyUsedDocumentsWebPartProps { title: string; nrOfItems: number; } export default class RecentlyUsedDocumentsWebPart extends BaseClientSideWebPart { private graphClient: MSGraphClientV3; private propertyFieldNumber : any; public onInit(): Promise { return new Promise((resolve: () => void, reject: (error: any) => void): void => { this.context.msGraphClientFactory .getClient('3') .then((client: MSGraphClientV3): void => { this.graphClient = client; resolve(); }, err => reject(err)); }); } public render(): void { const element: React.ReactElement = React.createElement( RecentlyUsedDocuments, { title: this.properties.title, nrOfItems: this.properties.nrOfItems, context: this.context, graphClient: this.graphClient, displayMode: this.displayMode, updateProperty: (value: string) => { this.properties.title = value; } } ); ReactDom.render(element, this.domElement); } protected get dataVersion(): Version { return Version.parse('1.0'); } //executes only before property pane is loaded. protected async loadPropertyPaneResources(): Promise { // import additional controls/components const { PropertyFieldNumber } = await import( /* webpackChunkName: 'pnp-propcontrols-number' */ '@pnp/spfx-property-controls/lib/propertyFields/number' ); this.propertyFieldNumber = PropertyFieldNumber; } protected getPropertyPaneConfiguration(): IPropertyPaneConfiguration { return { pages: [ { header: { description: strings.PropertyPaneDescription }, groups: [ { groupFields: [ this.propertyFieldNumber("nrOfItems", { key: "nrOfItems", label: strings.NrOfDocumentsToShow, value: this.properties.nrOfItems, minValue: 1, maxValue: 10 }) ] } ] } ] }; } } ================================================ FILE: source/react-recently-used-documents/src/webparts/recentlyUsedDocuments/components/BrandIcons.ts ================================================ /** * Icons enum */ export enum BrandIcons { Word = "https://spoprod-a.akamaihd.net/files/fabric/assets/item-types/32/docx.png", PowerPoint = "https://spoprod-a.akamaihd.net/files/fabric/assets/item-types/32/pptx.png", Excel = "https://spoprod-a.akamaihd.net/files/fabric/assets/item-types/32/xlsx.png", Pdf = "https://spoprod-a.akamaihd.net/files/fabric/assets/item-types/32/pdf.png", OneNote = "https://spoprod-a.akamaihd.net/files/fabric/assets/item-types/32/onetoc.png", OneNotePage = "https://spoprod-a.akamaihd.net/files/fabric/assets/item-types/32/one.png", InfoPath = "https://spoprod-a.akamaihd.net/files/fabric/assets/item-types/32/xsn.png", Visio = "https://spoprod-a.akamaihd.net/files/fabric/assets/item-types/32/vsdx.png", Publisher = "https://spoprod-a.akamaihd.net/files/fabric/assets/item-types/32/pub.png", Project = "https://spoprod-a.akamaihd.net/files/fabric/assets/item-types/32/mpp.png", Access = "https://spoprod-a.akamaihd.net/files/fabric/assets/item-types/32/accdb.png", Mail = "https://spoprod-a.akamaihd.net/files/fabric/assets/item-types/32/email.png", Csv = "https://spoprod-a.akamaihd.net/files/fabric/assets/item-types/32/xlsx.png", Archive = "https://spoprod-a.akamaihd.net/files/fabric/assets/item-types/32/zip.png", Xps = "https://spoprod-a.akamaihd.net/files/fabric/assets/item-types/32/genericfile.png", Audio = "https://spoprod-a.akamaihd.net/files/fabric/assets/item-types/32/audio.png", Video = "https://spoprod-a.akamaihd.net/files/fabric/assets/item-types/32/video.png", Image = "https://spoprod-a.akamaihd.net/files/fabric/assets/item-types/32/photo.png", Text = "https://spoprod-a.akamaihd.net/files/fabric/assets/item-types/32/txt.png", Xml = "https://spoprod-a.akamaihd.net/files/fabric/assets/item-types/32/xml.png" } ================================================ FILE: source/react-recently-used-documents/src/webparts/recentlyUsedDocuments/components/IRecentDocuments.ts ================================================ import { BrandIcons } from "./BrandIcons"; /** * Microsoft Graph Insights Interface */ export interface IRecentDocuments { '@odata.context': string; value: IRecentDocument[]; } export interface IRecentDocument { id: string; lastUsed: LastUsed; resourceVisualization: ResourceVisualization; resourceReference: ResourceReference; } export interface ResourceReference { webUrl: string; id: string; type: string; } export interface ResourceVisualization { title: string; type: keyof typeof BrandIcons; mediaType: string; previewImageUrl: string; previewText: string; containerWebUrl: string; containerDisplayName: string; containerType: string; } export interface LastUsed { lastAccessedDateTime: string; lastModifiedDateTime: string; } ================================================ FILE: source/react-recently-used-documents/src/webparts/recentlyUsedDocuments/components/IRecentlyUsedDocumentsProps.ts ================================================ import { IRecentlyUsedDocumentsWebPartProps } from '../RecentlyUsedDocumentsWebPart'; import { DisplayMode } from '@microsoft/sp-core-library'; import { MSGraphClientV3 } from '@microsoft/sp-http'; import { WebPartContext } from '@microsoft/sp-webpart-base'; export interface IRecentlyUsedDocumentsProps extends IRecentlyUsedDocumentsWebPartProps { context: WebPartContext; displayMode: DisplayMode; graphClient: MSGraphClientV3; updateProperty: (value: string) => void; } ================================================ FILE: source/react-recently-used-documents/src/webparts/recentlyUsedDocuments/components/IRecentlyUsedDocumentsState.ts ================================================ export interface IRecentlyUsedDocumentsState { recentDocs: any[]; error: string; loading: boolean; } ================================================ FILE: source/react-recently-used-documents/src/webparts/recentlyUsedDocuments/components/RecentlyUsedDocuments.module.scss ================================================ @import '~@fluentui/react/dist/sass/References.scss'; .recentlyUsedDocuments { .document { margin-bottom: 15px; } .documentPreview { min-width: 144px; } .documentDetails { display: flex; flex: 1; flex-direction: column; justify-content: space-between; } .noDocs { @include ms-font-m; } .error { @include ms-font-m; color: $ms-color-alert; } } ================================================ FILE: source/react-recently-used-documents/src/webparts/recentlyUsedDocuments/components/RecentlyUsedDocuments.tsx ================================================ import * as React from 'react'; import styles from './RecentlyUsedDocuments.module.scss'; import { WebPartTitle } from '@pnp/spfx-controls-react/lib/WebPartTitle'; import * as strings from 'RecentlyUsedDocumentsWebPartStrings'; import { List } from '@fluentui/react/lib/List'; import { DocumentCard, DocumentCardActivity, DocumentCardPreview, DocumentCardTitle, IDocumentCardPreviewProps } from '@fluentui/react/lib/DocumentCard'; import { ImageFit } from '@fluentui/react/lib/Image'; import { DocumentCardType } from '@fluentui/react/lib/DocumentCard'; import { IRecentlyUsedDocumentsProps, IRecentlyUsedDocumentsState, IRecentDocuments, IRecentDocument, BrandIcons } from '.'; import { Spinner, SpinnerSize } from '@fluentui/react/lib/Spinner'; export default class RecentlyUsedDocuments extends React.Component { private _excludeTypes: string[] = ["Web", "spsite", "Folder", "Archive", "Image", "Other"]; constructor(props: IRecentlyUsedDocumentsProps) { super(props); this.state = { recentDocs: [], error: null, loading: true }; } /** * Fetch the recent documents via the Microsoft Graph client */ private _fetchRecentDocuments() { if (this.props.graphClient) { this.setState({ loading: true, error: null }); const filter = this._excludeTypes.map(type => `resourceVisualization/type ne '${type}'`).join(' and '); this.props.graphClient .api("me/insights/used") .filter(`resourceVisualization/containerType eq 'Site' and ${filter}`) .get((err: { message: string; }, res: IRecentDocuments) => { if (err) { // Something failed calling the MS Graph this.setState({ error: err.message ? err.message : strings.Error, recentDocs: [], loading: false }); return; } // Check if a response was retrieved if (res && res.value && res.value.length > 0) { console.log(res.value); this._processRecentDocuments(res.value); } else { // No documents retrieved this.setState({ recentDocs: [], loading: false }); } }); } } /** * Processes the retrieved document results from the Microsoft Graph * @param recentWebs */ private _processRecentDocuments(recentDocs: IRecentDocument[]): void { // Return the sorted and sliced array this.setState({ recentDocs: recentDocs.sort(this._sortByDate).slice(0, this.props.nrOfItems ? this.props.nrOfItems : 10), loading: false }); } /** * Sort the array by the last accessed date */ private _sortByDate = (a: IRecentDocument, b: IRecentDocument): number => { const aDate = new Date(a.lastUsed.lastAccessedDateTime); const bDate = new Date(b.lastUsed.lastAccessedDateTime); return this._getTime(bDate) - this._getTime(aDate); } /** * Convert the date to a number * @param date */ private _getTime(date?: Date) { return date !== null ? date.getTime() : 0; } /** * Renders the list cell */ private _onRenderCell = (item: IRecentDocument, index: number | undefined): JSX.Element => { // Create the preview image properties const previewProps: IDocumentCardPreviewProps = { previewImages: [ { name: item.resourceVisualization.title, url: item.resourceReference.webUrl, previewImageSrc: item.resourceVisualization.previewImageUrl, iconSrc: BrandIcons[item.resourceVisualization.type], imageFit: ImageFit.cover, width: 318, height: 196 } ], }; // Return a document card for the retrieved item return (
); } /** * Returns the relative date for the document activity */ private _relativeDate(crntDate: string): string { const date = new Date(crntDate); const diff = (((new Date()).getTime() - date.getTime()) / 1000); const day_diff = Math.floor(diff / 86400); if (isNaN(day_diff) || day_diff < 0) { return; } return day_diff === 0 && ( diff < 60 && strings.DateJustNow || diff < 120 && strings.DateMinute || diff < 3600 && `${Math.floor( diff / 60 )} ${strings.DateMinutesAgo}` || diff < 7200 && strings.DateHour || diff < 86400 && `${Math.floor( diff / 3600 )} ${strings.DateHoursAgo}`) || day_diff == 1 && strings.DateDay || day_diff <= 30 && `${day_diff} ${strings.DateDaysAgo}` || day_diff > 30 && `${Math.ceil(day_diff / 7)} ${strings.DateWeeksAgo}`; } /** * componentDidMount lifecycle hook */ public componentDidMount(): void { this._fetchRecentDocuments(); } /** * componentDidUpdate lifecycle hook */ public componentDidUpdate(prevProps: IRecentlyUsedDocumentsProps, prevState: IRecentlyUsedDocumentsState): void { if (prevProps.nrOfItems !== this.props.nrOfItems) { this._fetchRecentDocuments(); } } /** * Default React render method */ public render(): React.ReactElement { return (
{ this.state.loading && } { this.state.recentDocs && this.state.recentDocs.length > 0 ? ( ) : ( !this.state.loading && ( this.state.error ? {this.state.error} : {strings.NoRecentDocuments} ) ) }
); } } ================================================ FILE: source/react-recently-used-documents/src/webparts/recentlyUsedDocuments/components/index.ts ================================================ export * from './BrandIcons'; export * from './IRecentDocuments'; export * from './IRecentlyUsedDocumentsProps'; export * from './IRecentlyUsedDocumentsState'; ================================================ FILE: source/react-recently-used-documents/src/webparts/recentlyUsedDocuments/loc/de-de.js ================================================ define([], function() { return { "PropertyPaneDescription": "Web Part Konfiguration", "NrOfDocumentsToShow": "Geben Sie die Anzahl der anzuzeigenden Dokumente an", "NoRecentDocuments": "Keine Dokumente gefunden.", "LastUsedMsg": "Zuletzt zugegriffen:", "Loading": "Rufe zuletzt genutzte Dokumente auf", "Error": "Ein Fehler beim Aufrufen Ihrer zuletzt genutzte Dokumente ist aufgetreten.", "DateJustNow": "Soeben", "DateMinute": "1 Minute zuvor", "DateMinutesAgo": "Minuten zuvor", "DateHour": "1 Stunde zuvor", "DateHoursAgo": "Stunden zuvor", "DateDay": "Gestern", "DateDaysAgo": "Tage zuvor", "DateWeeksAgo": "Wochen zuvor" } }); ================================================ FILE: source/react-recently-used-documents/src/webparts/recentlyUsedDocuments/loc/en-us.js ================================================ define([], function() { return { "PropertyPaneDescription": "Web part configuration", "NrOfDocumentsToShow": "Specify the number of documents to show", "NoRecentDocuments": "We did not find any documents.", "LastUsedMsg": "Last accessed:", "Loading": "Retrieving your recently used documents", "Error": "Sorry, something failed when retrieving your recently used documents.", "DateJustNow": "just now", "DateMinute": "1 minute ago", "DateMinutesAgo": "minutes ago", "DateHour": "1 hour ago", "DateHoursAgo": "hours ago", "DateDay": "yesterday", "DateDaysAgo": "days ago", "DateWeeksAgo": "weeks ago" } }); ================================================ FILE: source/react-recently-used-documents/src/webparts/recentlyUsedDocuments/loc/es-es.js ================================================ define([], function() { return { "PropertyPaneDescription": "Configuracion del elemento web", "NrOfDocumentsToShow": "Especifique el numero de documentos a mostrar", "NoRecentDocuments": "No encontramos documentos.", "LastUsedMsg": "Accesados ultimamente:", "Loading": "Obteniendo sus documentos recientes", "Error": "Lo sentimos, algo salio mal mientras ibteniamos sus documentos recientes.", "DateJustNow": "justo ahoraw", "DateMinute": "hace 1 minuto", "DateMinutesAgo": "hace unos minutos", "DateHour": "hace 1 hora", "DateHoursAgo": "hace unas horas", "DateDay": "ayer", "DateDaysAgo": "hace unos dias", "DateWeeksAgo": "hace unas semanas" } }); ================================================ FILE: source/react-recently-used-documents/src/webparts/recentlyUsedDocuments/loc/fr-fr.js ================================================ define([], function() { return { "PropertyPaneDescription": "Configuration de la partie Web", "NrOfDocumentsToShow": "Spécifiez le nombre de documents à afficher", "NoRecentDocuments": "Nous n'avons trouvé aucun document.", "LastUsedMsg": "Dernier accès:", "Loading": "Récupération de vos documents récemment utilisés", "Error": "Désolé, une erreur s'est produite lors de la récupération des documents récemment utilisés.", "DateJustNow": "juste maintenant", "DateMinute": "il y a 1 minutes", "DateMinutesAgo": "il y a quelques minutes", "DateHour": "il y a une heure", "DateHoursAgo": "il y a quelques heures", "DateDay": "hier", "DateDaysAgo": "il y a quelques jours", "DateWeeksAgo": "il y a quelques semaines" } }); ================================================ FILE: source/react-recently-used-documents/src/webparts/recentlyUsedDocuments/loc/mystrings.d.ts ================================================ declare interface IRecentlyUsedDocumentsWebPartStrings { PropertyPaneDescription: string; NrOfDocumentsToShow: string; // Web part NoRecentDocuments: string; LastUsedMsg: string; Loading: string; Error: string; // Relative date strings DateJustNow: string; DateMinute: string; DateMinutesAgo: string; DateHour: string; DateHoursAgo: string; DateDay: string; DateDaysAgo: string; DateWeeksAgo: string; } declare module 'RecentlyUsedDocumentsWebPartStrings' { const strings: IRecentlyUsedDocumentsWebPartStrings; export = strings; } ================================================ FILE: source/react-recently-used-documents/src/webparts/recentlyUsedDocuments/loc/nb-no.js ================================================ define([], function() { return { "PropertyPaneDescription": "Webdel konfigurasjon", "NrOfDocumentsToShow": "Angi hvor mange dokument som skal vises", "NoRecentDocuments": "Vi fant ingen dokumenter.", "LastUsedMsg": "Sist brukt:", "Loading": "Henter dine sist brukte dokumenter", "Error": "En feil oppstod ved henting av dine sist brukte dokumenter.", "DateJustNow": "akkurat nå", "DateMinute": "1 minutt siden", "DateMinutesAgo": "minutter siden", "DateHour": "1 time siden", "DateHoursAgo": "timer siden", "DateDay": "igår", "DateDaysAgo": "dager siden", "DateWeeksAgo": "uker siden" } }); ================================================ FILE: source/react-recently-used-documents/src/webparts/recentlyUsedDocuments/loc/nl-nl.js ================================================ define([], function() { return { "PropertyPaneDescription": "Webpart configuratie", "NrOfDocumentsToShow": "Specificeer het aantal documenten die getoond moeten worden", "NoRecentDocuments": "We hebben geen documenten gevonden.", "LastUsedMsg": "Laatst gebruikt:", "Loading": "Laatst gebruikte documenten aan het ophalen", "Error": "Sorry, er is iets fout gegaan bij het ophalen van de laatst gebruikte documenten.", "DateJustNow": "zo net", "DateMinute": "1 minuut geleden", "DateMinutesAgo": "minuten geleden", "DateHour": "1 uur geleden", "DateHoursAgo": "uren geleden", "DateDay": "gisteren", "DateDaysAgo": "dagen geleden", "DateWeeksAgo": "weken geleden" } }); ================================================ FILE: source/react-recently-used-documents/src/webparts/recentlyUsedDocuments/loc/sv-se.js ================================================ define([], function() { return { "PropertyPaneDescription": "Webbdelskonfiguration", "NrOfDocumentsToShow": "Ange antal dokument som skall visas", "NoRecentDocuments": "Vi hittade inga dokument.", "LastUsedMsg": "Senast använda:", "Loading": "Hämtar dina nyligen använda dokument", "Error": "Tyvärr, något gick fel när dina nyligen använda dokument skulle hämtas.", "DateJustNow": "precis nu", "DateMinute": "1 minut sedan", "DateMinutesAgo": "minuter sedan", "DateHour": "1 timme sedan", "DateHoursAgo": "timmar sedan", "DateDay": "igår", "DateDaysAgo": "dagar sedan", "DateWeeksAgo": "veckor sedan" } }); ================================================ FILE: source/react-recently-used-documents/src/webparts/recentlyUsedDocuments/loc/tr-tr.js ================================================ define([], function() { return { "PropertyPaneDescription": "Web bölümü yapılandırması", "NrOfDocumentsToShow": "Gösterilecek belge sayısını belirtin", "NoRecentDocuments": "Herhangi bir doküman bulamadık.", "LastUsedMsg": "Son Erişim:", "Loading": "En son kullanılan belgenizi alınıyor", "Error": "Maalesef, en son kullanılan belgelerinizi alırken bir şeyler başarısız oldu.", "DateJustNow": "Şu anda", "DateMinute": "1 dakika önce", "DateMinutesAgo": "dakika önce", "DateHour": "1 saat önce", "DateHoursAgo": "saat önce", "DateDay": "dün", "DateDaysAgo": "gün önce", "DateWeeksAgo": "hafta önce" } }); ================================================ FILE: source/react-recently-used-documents/tsconfig.json ================================================ { "extends": "./node_modules/@microsoft/rush-stack-compiler-4.5/includes/tsconfig-web.json", "compilerOptions": { "target": "es5", "forceConsistentCasingInFileNames": true, "module": "esnext", "moduleResolution": "node", "jsx": "react", "declaration": true, "sourceMap": true, "experimentalDecorators": true, "skipLibCheck": true, "outDir": "lib", "inlineSources": false, "strictNullChecks": false, "noImplicitAny": true, "typeRoots": [ "./node_modules/@types", "./node_modules/@microsoft" ], "types": [ "webpack-env" ], "lib": [ "es5", "dom", "es2015", "es2015.collection", "es2015.promise" ] }, "include": [ "src/**/*.ts", "src/**/*.tsx" ] } ================================================ FILE: source/react-recently-visited-sites/.editorconfig ================================================ # EditorConfig helps developers define and maintain consistent # coding styles between different editors and IDEs # editorconfig.org root = true [*] # change these settings to your own preference indent_style = space indent_size = 2 # we recommend you to keep these unchanged end_of_line = lf charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true [*.md] trim_trailing_whitespace = false [{package,bower}.json] indent_style = space indent_size = 2 ================================================ FILE: source/react-recently-visited-sites/.eslintrc.js ================================================ require('@rushstack/eslint-config/patch/modern-module-resolution'); module.exports = { extends: ['@microsoft/eslint-config-spfx/lib/profiles/react'], parserOptions: { tsconfigRootDir: __dirname }, overrides: [ { files: ['*.ts', '*.tsx'], parser: '@typescript-eslint/parser', 'parserOptions': { 'project': './tsconfig.json', 'ecmaVersion': 2018, 'sourceType': 'module' }, rules: { // Prevent usage of the JavaScript null value, while allowing code to access existing APIs that may require null. https://www.npmjs.com/package/@rushstack/eslint-plugin '@rushstack/no-new-null': 1, // Require Jest module mocking APIs to be called before any other statements in their code block. https://www.npmjs.com/package/@rushstack/eslint-plugin '@rushstack/hoist-jest-mock': 1, // Require regular expressions to be constructed from string constants rather than dynamically building strings at runtime. https://www.npmjs.com/package/@rushstack/eslint-plugin-security '@rushstack/security/no-unsafe-regexp': 1, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/adjacent-overload-signatures': 1, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // // CONFIGURATION: By default, these are banned: String, Boolean, Number, Object, Symbol '@typescript-eslint/ban-types': [ 1, { 'extendDefaults': false, 'types': { 'String': { 'message': 'Use \'string\' instead', 'fixWith': 'string' }, 'Boolean': { 'message': 'Use \'boolean\' instead', 'fixWith': 'boolean' }, 'Number': { 'message': 'Use \'number\' instead', 'fixWith': 'number' }, 'Object': { 'message': 'Use \'object\' instead, or else define a proper TypeScript type:' }, 'Symbol': { 'message': 'Use \'symbol\' instead', 'fixWith': 'symbol' }, 'Function': { 'message': 'The \'Function\' type accepts any function-like value.\nIt provides no type safety when calling the function, which can be a common source of bugs.\nIt also accepts things like class declarations, which will throw at runtime as they will not be called with \'new\'.\nIf you are expecting the function to accept certain arguments, you should explicitly define the function shape.' } } } ], // RATIONALE: Code is more readable when the type of every variable is immediately obvious. // Even if the compiler may be able to infer a type, this inference will be unavailable // to a person who is reviewing a GitHub diff. This rule makes writing code harder, // but writing code is a much less important activity than reading it. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/explicit-function-return-type': [ 0, { 'allowExpressions': true, 'allowTypedFunctionExpressions': true, 'allowHigherOrderFunctions': false } ], // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // Rationale to disable: although this is a recommended rule, it is up to dev to select coding style. // Set to 1 (warning) or 2 (error) to enable. '@typescript-eslint/explicit-member-accessibility': 0, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/no-array-constructor': 1, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // // RATIONALE: The "any" keyword disables static type checking, the main benefit of using TypeScript. // This rule should be suppressed only in very special cases such as JSON.stringify() // where the type really can be anything. Even if the type is flexible, another type // may be more appropriate such as "unknown", "{}", or "Record". '@typescript-eslint/no-explicit-any': 0, // RATIONALE: The #1 rule of promises is that every promise chain must be terminated by a catch() // handler. Thus wherever a Promise arises, the code must either append a catch handler, // or else return the object to a caller (who assumes this responsibility). Unterminated // promise chains are a serious issue. Besides causing errors to be silently ignored, // they can also cause a NodeJS process to terminate unexpectedly. '@typescript-eslint/no-floating-promises': 2, // RATIONALE: Catches a common coding mistake. '@typescript-eslint/no-for-in-array': 2, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/no-misused-new': 2, // RATIONALE: The "namespace" keyword is not recommended for organizing code because JavaScript lacks // a "using" statement to traverse namespaces. Nested namespaces prevent certain bundler // optimizations. If you are declaring loose functions/variables, it's better to make them // static members of a class, since classes support property getters and their private // members are accessible by unit tests. Also, the exercise of choosing a meaningful // class name tends to produce more discoverable APIs: for example, search+replacing // the function "reverse()" is likely to return many false matches, whereas if we always // write "Text.reverse()" is more unique. For large scale organization, it's recommended // to decompose your code into separate NPM packages, which ensures that component // dependencies are tracked more conscientiously. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/no-namespace': [ 1, { 'allowDeclarations': false, 'allowDefinitionFiles': false } ], // RATIONALE: Parameter properties provide a shorthand such as "constructor(public title: string)" // that avoids the effort of declaring "title" as a field. This TypeScript feature makes // code easier to write, but arguably sacrifices readability: In the notes for // "@typescript-eslint/member-ordering" we pointed out that fields are central to // a class's design, so we wouldn't want to bury them in a constructor signature // just to save some typing. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // Set to 1 (warning) or 2 (error) to enable the rule '@typescript-eslint/no-parameter-properties': 0, // RATIONALE: When left in shipping code, unused variables often indicate a mistake. Dead code // may impact performance. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/no-unused-vars': [ 1, { 'vars': 'all', // Unused function arguments often indicate a mistake in JavaScript code. However in TypeScript code, // the compiler catches most of those mistakes, and unused arguments are fairly common for type signatures // that are overriding a base class method or implementing an interface. 'args': 'none' } ], // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/no-use-before-define': [ 2, { 'functions': false, 'classes': true, 'variables': true, 'enums': true, 'typedefs': true } ], // Disallows require statements except in import statements. // In other words, the use of forms such as var foo = require("foo") are banned. Instead use ES6 style imports or import foo = require("foo") imports. '@typescript-eslint/no-var-requires': 'error', // RATIONALE: The "module" keyword is deprecated except when describing legacy libraries. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/prefer-namespace-keyword': 1, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // Rationale to disable: it's up to developer to decide if he wants to add type annotations // Set to 1 (warning) or 2 (error) to enable the rule '@typescript-eslint/no-inferrable-types': 0, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // Rationale to disable: declaration of empty interfaces may be helpful for generic types scenarios '@typescript-eslint/no-empty-interface': 0, // RATIONALE: This rule warns if setters are defined without getters, which is probably a mistake. 'accessor-pairs': 1, // RATIONALE: In TypeScript, if you write x["y"] instead of x.y, it disables type checking. 'dot-notation': [ 1, { 'allowPattern': '^_' } ], // RATIONALE: Catches code that is likely to be incorrect 'eqeqeq': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'for-direction': 1, // RATIONALE: Catches a common coding mistake. 'guard-for-in': 2, // RATIONALE: If you have more than 2,000 lines in a single source file, it's probably time // to split up your code. 'max-lines': ['warn', { max: 2000 }], // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-async-promise-executor': 2, // RATIONALE: Deprecated language feature. 'no-caller': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-compare-neg-zero': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-cond-assign': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-constant-condition': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-control-regex': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-debugger': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-delete-var': 2, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-duplicate-case': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-empty': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-empty-character-class': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-empty-pattern': 1, // RATIONALE: Eval is a security concern and a performance concern. 'no-eval': 1, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-ex-assign': 2, // RATIONALE: System types are global and should not be tampered with in a scalable code base. // If two different libraries (or two versions of the same library) both try to modify // a type, only one of them can win. Polyfills are acceptable because they implement // a standardized interoperable contract, but polyfills are generally coded in plain // JavaScript. 'no-extend-native': 1, // Disallow unnecessary labels 'no-extra-label': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-fallthrough': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-func-assign': 1, // RATIONALE: Catches a common coding mistake. 'no-implied-eval': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-invalid-regexp': 2, // RATIONALE: Catches a common coding mistake. 'no-label-var': 2, // RATIONALE: Eliminates redundant code. 'no-lone-blocks': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-misleading-character-class': 2, // RATIONALE: Catches a common coding mistake. 'no-multi-str': 2, // RATIONALE: It's generally a bad practice to call "new Thing()" without assigning the result to // a variable. Either it's part of an awkward expression like "(new Thing()).doSomething()", // or else implies that the constructor is doing nontrivial computations, which is often // a poor class design. 'no-new': 1, // RATIONALE: Obsolete language feature that is deprecated. 'no-new-func': 2, // RATIONALE: Obsolete language feature that is deprecated. 'no-new-object': 2, // RATIONALE: Obsolete notation. 'no-new-wrappers': 1, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-octal': 2, // RATIONALE: Catches code that is likely to be incorrect 'no-octal-escape': 2, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-regex-spaces': 2, // RATIONALE: Catches a common coding mistake. 'no-return-assign': 2, // RATIONALE: Security risk. 'no-script-url': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-self-assign': 2, // RATIONALE: Catches a common coding mistake. 'no-self-compare': 2, // RATIONALE: This avoids statements such as "while (a = next(), a && a.length);" that use // commas to create compound expressions. In general code is more readable if each // step is split onto a separate line. This also makes it easier to set breakpoints // in the debugger. 'no-sequences': 1, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-shadow-restricted-names': 2, // RATIONALE: Obsolete language feature that is deprecated. // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-sparse-arrays': 2, // RATIONALE: Although in theory JavaScript allows any possible data type to be thrown as an exception, // such flexibility adds pointless complexity, by requiring every catch block to test // the type of the object that it receives. Whereas if catch blocks can always assume // that their object implements the "Error" contract, then the code is simpler, and // we generally get useful additional information like a call stack. 'no-throw-literal': 2, // RATIONALE: Catches a common coding mistake. 'no-unmodified-loop-condition': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-unsafe-finally': 2, // RATIONALE: Catches a common coding mistake. 'no-unused-expressions': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-unused-labels': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-useless-catch': 1, // RATIONALE: Avoids a potential performance problem. 'no-useless-concat': 1, // RATIONALE: The "var" keyword is deprecated because of its confusing "hoisting" behavior. // Always use "let" or "const" instead. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json 'no-var': 2, // RATIONALE: Generally not needed in modern code. 'no-void': 1, // RATIONALE: Obsolete language feature that is deprecated. // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-with': 2, // RATIONALE: Makes logic easier to understand, since constants always have a known value // @typescript-eslint\eslint-plugin\dist\configs\eslint-recommended.js 'prefer-const': 1, // RATIONALE: Catches a common coding mistake where "resolve" and "reject" are confused. 'promise/param-names': 2, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'require-atomic-updates': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'require-yield': 1, // "Use strict" is redundant when using the TypeScript compiler. 'strict': [ 2, 'never' ], // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'use-isnan': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js // Set to 1 (warning) or 2 (error) to enable. // Rationale to disable: !!{} 'no-extra-boolean-cast': 0, // ==================================================================== // @microsoft/eslint-plugin-spfx // ==================================================================== '@microsoft/spfx/import-requires-chunk-name': 1, '@microsoft/spfx/no-require-ensure': 2, '@microsoft/spfx/pair-react-dom-render-unmount': 0, // ==================================================================== // no-useless-escape // ==================================================================== 'no-useless-escape': 0 } }, { // For unit tests, we can be a little bit less strict. The settings below revise the // defaults specified in the extended configurations, as well as above. files: [ // Test files '*.test.ts', '*.test.tsx', '*.spec.ts', '*.spec.tsx', // Facebook convention '**/__mocks__/*.ts', '**/__mocks__/*.tsx', '**/__tests__/*.ts', '**/__tests__/*.tsx', // Microsoft convention '**/test/*.ts', '**/test/*.tsx' ], rules: {} } ] }; ================================================ FILE: source/react-recently-visited-sites/.gitignore ================================================ # Logs logs *.log npm-debug.log* # Dependency directories node_modules # Build generated files dist lib release solution temp *.sppkg .heft # Coverage directory used by tools like istanbul coverage # OSX .DS_Store # Visual Studio files .ntvs_analysis.dat .vs bin obj # Resx Generated Code *.resx.ts # Styles Generated Code *.scss.ts # Package Lock file package-lock.json ================================================ FILE: source/react-recently-visited-sites/.npmignore ================================================ !dist config gulpfile.js release src temp tsconfig.json tslint.json *.log .yo-rc.json .vscode ================================================ FILE: source/react-recently-visited-sites/.vscode/launch.json ================================================ { "version": "0.2.0", "configurations": [ { "name": "Hosted workbench", "type": "pwa-chrome", "request": "launch", "url": "https://enter-your-SharePoint-site/_layouts/workbench.aspx", "webRoot": "${workspaceRoot}", "sourceMaps": true, "sourceMapPathOverrides": { "webpack:///.././src/*": "${webRoot}/src/*", "webpack:///../../../src/*": "${webRoot}/src/*", "webpack:///../../../../src/*": "${webRoot}/src/*", "webpack:///../../../../../src/*": "${webRoot}/src/*" }, "runtimeArgs": [ "--remote-debugging-port=9222", "-incognito" ] } ] } ================================================ FILE: source/react-recently-visited-sites/.vscode/settings.json ================================================ // Place your settings in this file to overwrite default and user settings. { // Configure glob patterns for excluding files and folders in the file explorer. "files.exclude": { "**/.git": true, "**/.DS_Store": true, "**/bower_components": true, "**/coverage": true, "**/lib-amd": true, "src/**/*.scss.ts": true }, "typescript.tsdk": ".\\node_modules\\typescript\\lib" } ================================================ FILE: source/react-recently-visited-sites/.yo-rc.json ================================================ { "@microsoft/generator-sharepoint": { "plusBeta": false, "isCreatingSolution": true, "nodeVersion": "16.19.0", "sdksVersions": { "@microsoft/microsoft-graph-client": "3.0.2", "@microsoft/teams-js": "2.4.1" }, "version": "1.16.1", "environment": "spo", "libraryName": "react-recently-visited-sites", "libraryId": "d8d9d358-fbb2-4e77-a66d-69f24e508bfa", "packageManager": "npm", "skipFeatureDeployment": true, "isDomainIsolated": false, "componentType": "webpart" } } ================================================ FILE: source/react-recently-visited-sites/README.md ================================================ # Recently Visited Sites web part This web part provides you the ability to display a list of a particular user's recently visited sites on a web page. The web part will display up to the first 30 (thirty) recently visited sites at a time. This web part is powered by the Microsoft Graph and uses the **v1.0/me/insights/used** endpoint. ![Recently Visited Sites](../../assets/images/components/part-recently-visited-sites.gif) ## How to use this web part on your web pages 1. Place the page you want to add this web part to in edit mode. 2. Search for and insert the **Recently Visited Sites** web part. 3. Configure the web part to update its properties. ## Configurable Properties The `Recently Visited Sites` web part can be configured with the following properties: | Label | Property | Type | Required | Description | | ---- | ---- | ---- | ---- | ---- | | Recent Sites | title | string | no | The web part title, editable inline with the web part itself | ## Used SharePoint Framework Version ![drop](https://img.shields.io/badge/version-1.16.1-green.svg) * Supported in SharePoint Online ## Applies to * [SharePoint Framework](https://learn.microsoft.com/en-us/sharepoint/dev/spfx/sharepoint-framework-overview) * [Office 365 tenant](https://learn.microsoft.com/en-us/sharepoint/dev/spfx/set-up-your-development-environment) ## Prerequisites none ## Solution Solution|Author(s) --------|--------- solution/src/webparts/recentContacts | Elio Struyf (@estruyf) solution/src/webparts/recentContacts | Waldek Mastykarz (@waldekm) solution/src/webparts/recentContacts | Simon Agren (@agrenpoint) solution/src/webparts/recentContacts | Jérémy Crestel (@j_crestel) solution/src/webparts/recentContacts | Daniel Laskewitz (@laskewitz) solution/src/webparts/recentContacts | Jakob Nøtseth (@net_freak) solution/src/webparts/recentContacts | Mikael Svenson (@mikaelsvenson) solution/src/webparts/recentContacts | Özgür Ersoy (@moersoy) solution/src/webparts/recentContacts | Guido Zambarda source/react-recent-contacts | Yannick Reekmans (@yannickreekmans) react-recently-visited-sites | Chandani Prajapati (@Chandani_SPD) ## Version history Version|Date|Comments -------|----|-------- 1.0|April 7, 2018|Initial release 2.0|December 4, 2019|v2.0 3.0|February 2023|Initial release for SharePoint Starter Kit v3 (Upgraded to SPFx 1.16.1) ## Disclaimer **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.** --- ## Minimal Path to Awesome * Clone this repository * Move to solution folder * in the command line run: * `npm install` * `gulp serve` > Include any additional steps as needed. ## Features Description of the web part with possible additional details than in short summary. This Web Part illustrates the following concepts on top of the SharePoint Framework: * Using Microsoft Graph from the web parts using msGraphClientFactory ================================================ FILE: source/react-recently-visited-sites/config/config.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/config.2.0.schema.json", "version": "2.0", "bundles": { "recently-visited-sites-web-part": { "components": [ { "entrypoint": "./lib/webparts/recentlyVisitedSites/RecentlyVisitedSitesWebPart.js", "manifest": "./src/webparts/recentlyVisitedSites/RecentlyVisitedSitesWebPart.manifest.json" } ] } }, "externals": {}, "localizedResources": { "RecentlyVisitedSitesWebPartStrings": "lib/webparts/recentlyVisitedSites/loc/{locale}.js", "ControlStrings": "node_modules/@pnp/spfx-controls-react/lib/loc/{locale}.js" } } ================================================ FILE: source/react-recently-visited-sites/config/deploy-azure-storage.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/deploy-azure-storage.schema.json", "workingDir": "./release/assets/", "account": "", "container": "react-recently-visited-sites", "accessKey": "" } ================================================ FILE: source/react-recently-visited-sites/config/package-solution.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/package-solution.schema.json", "solution": { "name": "Starter Kit - Recently Visited Sites", "id": "d8d9d358-fbb2-4e77-a66d-69f24e508bfa", "version": "3.0.0.0", "includeClientSideAssets": true, "skipFeatureDeployment": true, "isDomainIsolated": false, "developer": { "name": "PnP Starter Kit", "privacyUrl": "", "termsOfUseUrl": "", "websiteUrl": "", "mpnId": "pnpsk" }, "metadata": { "shortDescription": { "default": "react-recently-visited-sites description" }, "longDescription": { "default": "react-recently-visited-sites description" }, "screenshotPaths": [], "videoUrl": "", "categories": [] }, "features": [ { "title": "Starter Kit - Recently Visited Sites WebPart Feature", "description": "The feature that activates Recently Visited Sites Webpart from the Starter Kit - Recently Visited Sites solution.", "id": "49089f35-4213-425b-a5c0-706b25803484", "version": "3.0.0.0", "componentIds": [ "49089f35-4213-425b-a5c0-706b25803484" ] } ], "webApiPermissionRequests": [ { "resource": "Microsoft Graph", "scope": "Sites.Read.All" } ] }, "paths": { "zippedPackage": "solution/react-recently-visited-sites.sppkg" } } ================================================ FILE: source/react-recently-visited-sites/config/sass.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/core-build/sass.schema.json" } ================================================ FILE: source/react-recently-visited-sites/config/serve.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/spfx-serve.schema.json", "port": 4321, "https": true, "initialPage": "https://enter-your-SharePoint-site/_layouts/workbench.aspx" } ================================================ FILE: source/react-recently-visited-sites/config/write-manifests.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/write-manifests.schema.json", "cdnBasePath": "" } ================================================ FILE: source/react-recently-visited-sites/gulpfile.js ================================================ 'use strict'; const build = require('@microsoft/sp-build-web'); build.addSuppression(`Warning - [sass] The local CSS class 'ms-Grid' is not camelCase and will not be type-safe.`); var getTasks = build.rig.getTasks; build.rig.getTasks = function () { var result = getTasks.call(build.rig); result.set('serve', result.get('serve-deprecated')); return result; }; build.initialize(require('gulp')); ================================================ FILE: source/react-recently-visited-sites/package.json ================================================ { "name": "react-recently-visited-sites", "version": "3.0.0", "private": true, "main": "lib/index.js", "engines": { "node": ">=16.13.0 <17.0.0" }, "scripts": { "build": "gulp bundle", "clean": "gulp clean", "test": "gulp test" }, "dependencies": { "@microsoft/sp-core-library": "1.16.1", "@microsoft/sp-lodash-subset": "1.16.1", "@microsoft/sp-office-ui-fabric-core": "1.16.1", "@microsoft/sp-property-pane": "1.16.1", "@microsoft/sp-webpart-base": "1.16.1", "@pnp/spfx-controls-react": "3.12.0", "react": "17.0.1", "react-dom": "17.0.1", "tslib": "2.3.1" }, "resolutions": { "@types/react": "16.8.8" }, "devDependencies": { "@microsoft/eslint-config-spfx": "1.16.1", "@microsoft/eslint-plugin-spfx": "1.16.1", "@microsoft/rush-stack-compiler-4.5": "0.2.2", "@microsoft/sp-build-web": "1.16.1", "@microsoft/sp-module-interfaces": "1.16.1", "@rushstack/eslint-config": "2.5.1", "@types/react": "17.0.45", "@types/react-dom": "17.0.17", "@types/webpack-env": "~1.15.2", "ajv": "^6.12.5", "eslint-plugin-react-hooks": "4.3.0", "gulp": "4.0.2", "typescript": "4.5.5" } } ================================================ FILE: source/react-recently-visited-sites/src/index.ts ================================================ // A file is required to be in the root of the /src directory by the TypeScript compiler ================================================ FILE: source/react-recently-visited-sites/src/webparts/recentlyVisitedSites/RecentlyVisitedSitesWebPart.manifest.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx/client-side-web-part-manifest.schema.json", "id": "49089f35-4213-425b-a5c0-706b25803484", "alias": "RecentlyVisitedSitesWebPart", "componentType": "WebPart", "version": "*", "manifestVersion": 2, "requiresCustomScript": false, "supportedHosts": ["SharePointWebPart", "SharePointFullPage", "TeamsTab", "TeamsPersonalApp"], "supportsThemeVariants": true, "preconfiguredEntries": [{ "groupId": "5c03119e-3074-46fd-976b-c60198311f70", "group": { "default": "Other" }, "title": { "default": "Recently visited sites" }, "description": { "default": "Recently visited sites for user" }, "officeFabricIconFontName": "FavoriteList", "properties": { "title": "Recent sites" } }] } ================================================ FILE: source/react-recently-visited-sites/src/webparts/recentlyVisitedSites/RecentlyVisitedSitesWebPart.ts ================================================ import * as React from 'react'; import * as ReactDom from 'react-dom'; import { Version } from '@microsoft/sp-core-library'; import { BaseClientSideWebPart } from "@microsoft/sp-webpart-base"; import { IPropertyPaneConfiguration } from "@microsoft/sp-property-pane"; import { RecentlyVisitedSites, IRecentlyVisitedSitesProps } from './components'; import { MSGraphClientV3 } from '@microsoft/sp-http'; import { ThemeProvider, ThemeChangedEventArgs, IReadonlyTheme } from '@microsoft/sp-component-base'; export interface IRecentlyVisitedSitesWebPartProps { title: string; } export default class RecentlyVisitedSitesWebPart extends BaseClientSideWebPart { private graphClient: MSGraphClientV3; // theme provider private _themeProvider: ThemeProvider; // current theme private _themeVariant: IReadonlyTheme | undefined; public onInit(): Promise { // Consume the new ThemeProvider service this._themeProvider = this.context.serviceScope.consume(ThemeProvider.serviceKey); // If it exists, get the theme variant this._themeVariant = this._themeProvider.tryGetTheme(); // Register a handler to be notified if the theme variant changes this._themeProvider.themeChangedEvent.add(this, this._handleThemeChangedEvent); return new Promise((resolve: () => void, reject: (error: any) => void): void => { this.context.msGraphClientFactory .getClient('3') .then((client: MSGraphClientV3): void => { this.graphClient = client; resolve(); }, err => reject(err)); }); } public render(): void { const element: React.ReactElement = React.createElement( RecentlyVisitedSites, { title: this.properties.title, graphClient: this.graphClient, displayMode: this.displayMode, themeVariant: this._themeVariant, updateProperty: (value: string) => { this.properties.title = value; } } ); ReactDom.render(element, this.domElement); } protected get dataVersion(): Version { return Version.parse('1.0'); } protected getPropertyPaneConfiguration(): IPropertyPaneConfiguration { return { pages: [] }; } protected _handleThemeChangedEvent = (args: ThemeChangedEventArgs): void => { this._themeVariant = args.theme; this.render(); } } ================================================ FILE: source/react-recently-visited-sites/src/webparts/recentlyVisitedSites/components/IRecentWebs.ts ================================================ /** * Microsoft Graph Insights Interface */ export interface IRecentWebs { '@odata.context': string; value: IRecentWeb[]; } export interface IRecentWeb { id: string; lastUsed: LastUsed; resourceVisualization: ResourceVisualization; resourceReference: ResourceReference; } export interface ResourceReference { } export interface ResourceVisualization { title: string; type: string; mediaType: string; previewImageUrl: string; previewText: string; containerWebUrl: string; containerDisplayName: string; } export interface LastUsed { lastAccessedDateTime: string; lastModifiedDateTime: string; } ================================================ FILE: source/react-recently-visited-sites/src/webparts/recentlyVisitedSites/components/IRecentlyVisitedSitesProps.ts ================================================ import { IRecentlyVisitedSitesWebPartProps } from '../RecentlyVisitedSitesWebPart'; import { DisplayMode } from '@microsoft/sp-core-library'; import { MSGraphClientV3 } from '@microsoft/sp-http'; import { IReadonlyTheme } from '@microsoft/sp-component-base'; export interface IRecentlyVisitedSitesProps extends IRecentlyVisitedSitesWebPartProps { displayMode: DisplayMode; graphClient: MSGraphClientV3; themeVariant: IReadonlyTheme | undefined; updateProperty: (value: string) => void; } ================================================ FILE: source/react-recently-visited-sites/src/webparts/recentlyVisitedSites/components/IRecentlyVisitedSitesState.ts ================================================ import { IWebs } from "."; export interface IRecentlyVisitedSitesState { usedSites: IWebs[]; error: string; loading: boolean; } ================================================ FILE: source/react-recently-visited-sites/src/webparts/recentlyVisitedSites/components/IWebs.ts ================================================ export interface IWebs { id: string; title: string; path: string; } ================================================ FILE: source/react-recently-visited-sites/src/webparts/recentlyVisitedSites/components/RecentlyVisitedSites.module.scss ================================================ @import '~@fluentui/react/dist/sass/References.scss'; .recentlyVisitedSites { .list { @include ms-Grid-row; ul { list-style: none; margin: 0; padding: 0; } } .site { @include ms-Grid-col; @include ms-sm12; a { display: block; padding: 5px 12px; &:hover { background-color: "[theme: neutralTertiary, default: #FFF]"; } } } .noSites { @include ms-font-m; } .error { @include ms-font-m; color: $ms-color-alert; } } ================================================ FILE: source/react-recently-visited-sites/src/webparts/recentlyVisitedSites/components/RecentlyVisitedSites.tsx ================================================ import * as React from 'react'; import styles from './RecentlyVisitedSites.module.scss'; import { WebPartTitle } from "@pnp/spfx-controls-react/lib/WebPartTitle"; import { uniqBy } from '@microsoft/sp-lodash-subset'; import * as strings from 'RecentlyVisitedSitesWebPartStrings'; import { Link } from '@fluentui/react/lib/Link'; import { IRecentlyVisitedSitesProps, IRecentlyVisitedSitesState, IRecentWebs, IRecentWeb, IWebs } from '.'; import { Spinner, SpinnerSize } from '@fluentui/react/lib/Spinner'; export class RecentlyVisitedSites extends React.Component { /** * Constructor * @param props */ constructor(props: IRecentlyVisitedSitesProps) { super(props); this.state = { usedSites: [], error: null, loading: true }; } /** * Fetch the recent sites via the Microsoft Graph client */ private _fetchRecentSites() { if (this.props.graphClient) { this.setState({ loading: true }); // Calling: v1.0/me/insights/used?$filter=ResourceVisualization/Type eq 'Web' this.props.graphClient .api("me/insights/used") .filter(`ResourceVisualization/Type eq 'Web'`) .top(30) .get((err: { message: string; }, res: IRecentWebs) => { if (err) { // Something failed calling the MS Graph this.setState({ error: err.message ? err.message : strings.Error, usedSites: [], loading: false }); return; } // Check if a response was retrieved if (res && res.value && res.value.length > 0) { this._processRecentSites(res.value); } else { // No sites retrieved this.setState({ loading: false, usedSites: [] }); } }); } } /** * Processes the retrieved web results from the Microsoft Graph * @param recentWebs */ private _processRecentSites(recentWebs: IRecentWeb[]): void { // Map the MS Graph result const rWebs: IWebs[] = recentWebs.map(w => { return { id: w.id, title: w.resourceVisualization.containerDisplayName, path: this._updateSitePath(w.resourceVisualization.containerWebUrl) }; }); // Only retrieve the unique sites const uWeb = uniqBy(rWebs, 'path'); // Get the latest 10 results this.setState({ usedSites: uWeb.slice(0, 10), loading: false }); } /** * Parse the retrieve URLs to return the site collection URLs * @param path */ private _updateSitePath(path: string): string { if (path) { // Split the site on the sites path const pathSplit = path.split("/sites/"); if (pathSplit.length === 2) { const siteUrlPath = pathSplit[1].substring(0, pathSplit[1].indexOf("/")); // Concatinate the URL return `${pathSplit[0]}/sites/${siteUrlPath}`; } else { // Return the root site const matches = path.match(/^https?\:\/\/([^\/?#]+)(?:[\/?#]|$)/i); if (matches && matches.length > 0) { return matches[0]; } } } return path; } /** * componentDidMount lifecycle hook */ public componentDidMount(): void { this._fetchRecentSites(); } /** * Default React render method */ public render(): React.ReactElement { // // supporting different themes for page's section // const color: string | null = (!!this.props.themeVariant && this.props.themeVariant.semanticColors.bodyText) || null; const backgroundColor: string | null = (!!this.props.themeVariant && this.props.themeVariant.semanticColors.bodyBackground) || null; return (
{ this.state.loading && } { this.state.usedSites && this.state.usedSites.length > 0 ? (
    { this.state.usedSites.map(site => (
  • {site.title}
  • )) }
) : ( !this.state.loading && ( this.state.error ? {this.state.error} : {strings.NoRecentSitesMsg} ) ) }
); } } ================================================ FILE: source/react-recently-visited-sites/src/webparts/recentlyVisitedSites/components/index.ts ================================================ export * from './IRecentlyVisitedSitesProps'; export * from './IRecentlyVisitedSitesState'; export * from './IRecentWebs'; export * from './IWebs'; export * from './RecentlyVisitedSites'; ================================================ FILE: source/react-recently-visited-sites/src/webparts/recentlyVisitedSites/loc/de-de.js ================================================ define([], function() { return { "NoRecentSitesMsg": "Keine kürzlich genutzten Seiten gefunden.", "Loading": "Rufe kürzlich genutzte Seiten auf.", "Error": "Ein Fehler beim Aufrufen Ihrer kürzlich genutzte Seiten ist aufgetreten." } }); ================================================ FILE: source/react-recently-visited-sites/src/webparts/recentlyVisitedSites/loc/en-us.js ================================================ define([], function() { return { "NoRecentSitesMsg": "We did not find any recently used sites.", "Loading": "Retrieving your recently used sites.", "Error": "Sorry, something failed while retrieving your recently used sites." } }); ================================================ FILE: source/react-recently-visited-sites/src/webparts/recentlyVisitedSites/loc/es-es.js ================================================ define([], function() { return { "NoRecentSitesMsg": "No encontramos sitios utilizados recientemente.", "Loading": "Obteniendo los sitios utilizados recientemente.", "Error": "Lo sentimos, algo fallo cuando obteniamos sus sitios recientemente utilizados." } }); ================================================ FILE: source/react-recently-visited-sites/src/webparts/recentlyVisitedSites/loc/fr-fr.js ================================================ define([], function() { return { "NoRecentSitesMsg": "Nous n'avons trouvé aucun site récemment utilisé.", "Loading": "Récupération de vos sites récemment utilisés.", "Error": "Désolé, quelque chose a échoué lors de la récupération des sites récemment utilisés." } }); ================================================ FILE: source/react-recently-visited-sites/src/webparts/recentlyVisitedSites/loc/mystrings.d.ts ================================================ declare interface IRecentlyVisitedSitesWebPartStrings { // Web part NoRecentSitesMsg: string; Loading: string; Error: string; } declare module 'RecentlyVisitedSitesWebPartStrings' { const strings: IRecentlyVisitedSitesWebPartStrings; export = strings; } ================================================ FILE: source/react-recently-visited-sites/src/webparts/recentlyVisitedSites/loc/nb-no.js ================================================ define([], function() { return { "NoRecentSitesMsg": "Vi fant ingen sist besøkte områder.", "Loading": "Henter dine sist besøkte områder.", "Error": "Noe gikk galt ved henting av dine sist besøkte områder." } }); ================================================ FILE: source/react-recently-visited-sites/src/webparts/recentlyVisitedSites/loc/nl-nl.js ================================================ define([], function() { return { "NoRecentSitesMsg": "We hebben geen recent gebruikte sites gevonden.", "Loading": "Recent gebruikte sites aan het ophalen.", "Error": "Sorry, er is iets fout gegaan bij het ophalen van je recent gebruikte sites." } }); ================================================ FILE: source/react-recently-visited-sites/src/webparts/recentlyVisitedSites/loc/sv-se.js ================================================ define([], function() { return { "NoRecentSitesMsg": "Vi hittade inte några nyligen använda webbplatser.", "Loading": "Hämtar dina nyligen använda webbplatser.", "Error": "Tyvärr, något misslyckades när dina nyligen använda webbplatser skulle hämtas." } }); ================================================ FILE: source/react-recently-visited-sites/src/webparts/recentlyVisitedSites/loc/tr-tr.js ================================================ define([], function() { return { "NoRecentSitesMsg": "Son zamanlarda kullanılan siteleri bulamadık.", "Loading": "Son kullandığınız siteleri alınıyor.", "Error": "Maalesef, son kullanılan sitelerinizi alırken bir şey başarısız oldu." } }); ================================================ FILE: source/react-recently-visited-sites/tsconfig.json ================================================ { "extends": "./node_modules/@microsoft/rush-stack-compiler-4.5/includes/tsconfig-web.json", "compilerOptions": { "target": "es5", "forceConsistentCasingInFileNames": true, "module": "esnext", "moduleResolution": "node", "jsx": "react", "declaration": true, "sourceMap": true, "experimentalDecorators": true, "skipLibCheck": true, "outDir": "lib", "inlineSources": false, "strictNullChecks": false, "noImplicitAny": true, "typeRoots": [ "./node_modules/@types", "./node_modules/@microsoft" ], "types": [ "webpack-env" ], "lib": [ "es5", "dom", "es2015.collection", "es2015.promise" ] }, "include": [ "src/**/*.ts", "src/**/*.tsx" ] } ================================================ FILE: source/react-site-information/.editorconfig ================================================ # EditorConfig helps developers define and maintain consistent # coding styles between different editors and IDEs # editorconfig.org root = true [*] # change these settings to your own preference indent_style = space indent_size = 2 # we recommend you to keep these unchanged end_of_line = lf charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true [*.md] trim_trailing_whitespace = false [{package,bower}.json] indent_style = space indent_size = 2 ================================================ FILE: source/react-site-information/.eslintrc.js ================================================ require('@rushstack/eslint-config/patch/modern-module-resolution'); module.exports = { extends: ['@microsoft/eslint-config-spfx/lib/profiles/react'], parserOptions: { tsconfigRootDir: __dirname }, overrides: [ { files: ['*.ts', '*.tsx'], parser: '@typescript-eslint/parser', 'parserOptions': { 'project': './tsconfig.json', 'ecmaVersion': 2018, 'sourceType': 'module' }, rules: { // Prevent usage of the JavaScript null value, while allowing code to access existing APIs that may require null. https://www.npmjs.com/package/@rushstack/eslint-plugin '@rushstack/no-new-null': 1, // Require Jest module mocking APIs to be called before any other statements in their code block. https://www.npmjs.com/package/@rushstack/eslint-plugin '@rushstack/hoist-jest-mock': 1, // Require regular expressions to be constructed from string constants rather than dynamically building strings at runtime. https://www.npmjs.com/package/@rushstack/eslint-plugin-security '@rushstack/security/no-unsafe-regexp': 1, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/adjacent-overload-signatures': 1, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // // CONFIGURATION: By default, these are banned: String, Boolean, Number, Object, Symbol '@typescript-eslint/ban-types': [ 1, { 'extendDefaults': false, 'types': { 'String': { 'message': 'Use \'string\' instead', 'fixWith': 'string' }, 'Boolean': { 'message': 'Use \'boolean\' instead', 'fixWith': 'boolean' }, 'Number': { 'message': 'Use \'number\' instead', 'fixWith': 'number' }, 'Object': { 'message': 'Use \'object\' instead, or else define a proper TypeScript type:' }, 'Symbol': { 'message': 'Use \'symbol\' instead', 'fixWith': 'symbol' }, 'Function': { 'message': 'The \'Function\' type accepts any function-like value.\nIt provides no type safety when calling the function, which can be a common source of bugs.\nIt also accepts things like class declarations, which will throw at runtime as they will not be called with \'new\'.\nIf you are expecting the function to accept certain arguments, you should explicitly define the function shape.' } } } ], // RATIONALE: Code is more readable when the type of every variable is immediately obvious. // Even if the compiler may be able to infer a type, this inference will be unavailable // to a person who is reviewing a GitHub diff. This rule makes writing code harder, // but writing code is a much less important activity than reading it. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/explicit-function-return-type': [ 1, { 'allowExpressions': true, 'allowTypedFunctionExpressions': true, 'allowHigherOrderFunctions': false } ], // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // Rationale to disable: although this is a recommended rule, it is up to dev to select coding style. // Set to 1 (warning) or 2 (error) to enable. '@typescript-eslint/explicit-member-accessibility': 0, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/no-array-constructor': 1, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // // RATIONALE: The "any" keyword disables static type checking, the main benefit of using TypeScript. // This rule should be suppressed only in very special cases such as JSON.stringify() // where the type really can be anything. Even if the type is flexible, another type // may be more appropriate such as "unknown", "{}", or "Record". '@typescript-eslint/no-explicit-any': 0, // RATIONALE: The #1 rule of promises is that every promise chain must be terminated by a catch() // handler. Thus wherever a Promise arises, the code must either append a catch handler, // or else return the object to a caller (who assumes this responsibility). Unterminated // promise chains are a serious issue. Besides causing errors to be silently ignored, // they can also cause a NodeJS process to terminate unexpectedly. '@typescript-eslint/no-floating-promises': 0, // RATIONALE: Catches a common coding mistake. '@typescript-eslint/no-for-in-array': 2, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/no-misused-new': 2, // RATIONALE: The "namespace" keyword is not recommended for organizing code because JavaScript lacks // a "using" statement to traverse namespaces. Nested namespaces prevent certain bundler // optimizations. If you are declaring loose functions/variables, it's better to make them // static members of a class, since classes support property getters and their private // members are accessible by unit tests. Also, the exercise of choosing a meaningful // class name tends to produce more discoverable APIs: for example, search+replacing // the function "reverse()" is likely to return many false matches, whereas if we always // write "Text.reverse()" is more unique. For large scale organization, it's recommended // to decompose your code into separate NPM packages, which ensures that component // dependencies are tracked more conscientiously. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/no-namespace': [ 1, { 'allowDeclarations': false, 'allowDefinitionFiles': false } ], // RATIONALE: Parameter properties provide a shorthand such as "constructor(public title: string)" // that avoids the effort of declaring "title" as a field. This TypeScript feature makes // code easier to write, but arguably sacrifices readability: In the notes for // "@typescript-eslint/member-ordering" we pointed out that fields are central to // a class's design, so we wouldn't want to bury them in a constructor signature // just to save some typing. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // Set to 1 (warning) or 2 (error) to enable the rule '@typescript-eslint/no-parameter-properties': 0, // RATIONALE: When left in shipping code, unused variables often indicate a mistake. Dead code // may impact performance. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/no-unused-vars': [ 1, { 'vars': 'all', // Unused function arguments often indicate a mistake in JavaScript code. However in TypeScript code, // the compiler catches most of those mistakes, and unused arguments are fairly common for type signatures // that are overriding a base class method or implementing an interface. 'args': 'none' } ], // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/no-use-before-define': [ 2, { 'functions': false, 'classes': true, 'variables': true, 'enums': true, 'typedefs': true } ], // Disallows require statements except in import statements. // In other words, the use of forms such as var foo = require("foo") are banned. Instead use ES6 style imports or import foo = require("foo") imports. '@typescript-eslint/no-var-requires': 'error', // RATIONALE: The "module" keyword is deprecated except when describing legacy libraries. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/prefer-namespace-keyword': 1, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // Rationale to disable: it's up to developer to decide if he wants to add type annotations // Set to 1 (warning) or 2 (error) to enable the rule '@typescript-eslint/no-inferrable-types': 0, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // Rationale to disable: declaration of empty interfaces may be helpful for generic types scenarios '@typescript-eslint/no-empty-interface': 0, // RATIONALE: This rule warns if setters are defined without getters, which is probably a mistake. 'accessor-pairs': 1, // RATIONALE: In TypeScript, if you write x["y"] instead of x.y, it disables type checking. 'dot-notation': [ 1, { 'allowPattern': '^_' } ], // RATIONALE: Catches code that is likely to be incorrect 'eqeqeq': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'for-direction': 1, // RATIONALE: Catches a common coding mistake. 'guard-for-in': 2, // RATIONALE: If you have more than 2,000 lines in a single source file, it's probably time // to split up your code. 'max-lines': ['warn', { max: 2000 }], // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-async-promise-executor': 2, // RATIONALE: Deprecated language feature. 'no-caller': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-compare-neg-zero': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-cond-assign': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-constant-condition': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-control-regex': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-debugger': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-delete-var': 2, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-duplicate-case': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-empty': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-empty-character-class': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-empty-pattern': 1, // RATIONALE: Eval is a security concern and a performance concern. 'no-eval': 1, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-ex-assign': 2, // RATIONALE: System types are global and should not be tampered with in a scalable code base. // If two different libraries (or two versions of the same library) both try to modify // a type, only one of them can win. Polyfills are acceptable because they implement // a standardized interoperable contract, but polyfills are generally coded in plain // JavaScript. 'no-extend-native': 1, // Disallow unnecessary labels 'no-extra-label': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-fallthrough': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-func-assign': 1, // RATIONALE: Catches a common coding mistake. 'no-implied-eval': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-invalid-regexp': 2, // RATIONALE: Catches a common coding mistake. 'no-label-var': 2, // RATIONALE: Eliminates redundant code. 'no-lone-blocks': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-misleading-character-class': 2, // RATIONALE: Catches a common coding mistake. 'no-multi-str': 2, // RATIONALE: It's generally a bad practice to call "new Thing()" without assigning the result to // a variable. Either it's part of an awkward expression like "(new Thing()).doSomething()", // or else implies that the constructor is doing nontrivial computations, which is often // a poor class design. 'no-new': 1, // RATIONALE: Obsolete language feature that is deprecated. 'no-new-func': 2, // RATIONALE: Obsolete language feature that is deprecated. 'no-new-object': 2, // RATIONALE: Obsolete notation. 'no-new-wrappers': 1, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-octal': 2, // RATIONALE: Catches code that is likely to be incorrect 'no-octal-escape': 2, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-regex-spaces': 2, // RATIONALE: Catches a common coding mistake. 'no-return-assign': 2, // RATIONALE: Security risk. 'no-script-url': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-self-assign': 2, // RATIONALE: Catches a common coding mistake. 'no-self-compare': 2, // RATIONALE: This avoids statements such as "while (a = next(), a && a.length);" that use // commas to create compound expressions. In general code is more readable if each // step is split onto a separate line. This also makes it easier to set breakpoints // in the debugger. 'no-sequences': 1, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-shadow-restricted-names': 2, // RATIONALE: Obsolete language feature that is deprecated. // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-sparse-arrays': 2, // RATIONALE: Although in theory JavaScript allows any possible data type to be thrown as an exception, // such flexibility adds pointless complexity, by requiring every catch block to test // the type of the object that it receives. Whereas if catch blocks can always assume // that their object implements the "Error" contract, then the code is simpler, and // we generally get useful additional information like a call stack. 'no-throw-literal': 2, // RATIONALE: Catches a common coding mistake. 'no-unmodified-loop-condition': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-unsafe-finally': 2, // RATIONALE: Catches a common coding mistake. 'no-unused-expressions': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-unused-labels': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-useless-catch': 1, // RATIONALE: Avoids a potential performance problem. 'no-useless-concat': 1, // RATIONALE: The "var" keyword is deprecated because of its confusing "hoisting" behavior. // Always use "let" or "const" instead. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json 'no-var': 2, // RATIONALE: Generally not needed in modern code. 'no-void': 1, // RATIONALE: Obsolete language feature that is deprecated. // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-with': 2, // RATIONALE: Makes logic easier to understand, since constants always have a known value // @typescript-eslint\eslint-plugin\dist\configs\eslint-recommended.js 'prefer-const': 1, // RATIONALE: Catches a common coding mistake where "resolve" and "reject" are confused. 'promise/param-names': 2, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'require-atomic-updates': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'require-yield': 1, // "Use strict" is redundant when using the TypeScript compiler. 'strict': [ 2, 'never' ], // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'use-isnan': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js // Set to 1 (warning) or 2 (error) to enable. // Rationale to disable: !!{} 'no-extra-boolean-cast': 0, // ==================================================================== // @microsoft/eslint-plugin-spfx // ==================================================================== '@microsoft/spfx/import-requires-chunk-name': 1, '@microsoft/spfx/no-require-ensure': 2, '@microsoft/spfx/pair-react-dom-render-unmount': 0 } }, { // For unit tests, we can be a little bit less strict. The settings below revise the // defaults specified in the extended configurations, as well as above. files: [ // Test files '*.test.ts', '*.test.tsx', '*.spec.ts', '*.spec.tsx', // Facebook convention '**/__mocks__/*.ts', '**/__mocks__/*.tsx', '**/__tests__/*.ts', '**/__tests__/*.tsx', // Microsoft convention '**/test/*.ts', '**/test/*.tsx' ], rules: {} } ] }; ================================================ FILE: source/react-site-information/.gitignore ================================================ # Logs logs *.log npm-debug.log* # Dependency directories node_modules # Build generated files dist lib release solution temp *.sppkg .heft # Coverage directory used by tools like istanbul coverage # OSX .DS_Store # Visual Studio files .ntvs_analysis.dat .vs bin obj # Resx Generated Code *.resx.ts # Styles Generated Code *.scss.ts ================================================ FILE: source/react-site-information/.npmignore ================================================ !dist config gulpfile.js release src temp tsconfig.json tslint.json *.log .yo-rc.json .vscode ================================================ FILE: source/react-site-information/.vscode/launch.json ================================================ { "version": "0.2.0", "configurations": [ { "name": "Hosted workbench", "type": "pwa-chrome", "request": "launch", "url": "https://enter-your-SharePoint-site/_layouts/workbench.aspx", "webRoot": "${workspaceRoot}", "sourceMaps": true, "sourceMapPathOverrides": { "webpack:///.././src/*": "${webRoot}/src/*", "webpack:///../../../src/*": "${webRoot}/src/*", "webpack:///../../../../src/*": "${webRoot}/src/*", "webpack:///../../../../../src/*": "${webRoot}/src/*" }, "runtimeArgs": [ "--remote-debugging-port=9222", "-incognito" ] } ] } ================================================ FILE: source/react-site-information/.vscode/settings.json ================================================ // Place your settings in this file to overwrite default and user settings. { // Configure glob patterns for excluding files and folders in the file explorer. "files.exclude": { "**/.git": true, "**/.DS_Store": true, "**/bower_components": true, "**/coverage": true, "**/lib-amd": true, "src/**/*.scss.ts": true }, "typescript.tsdk": ".\\node_modules\\typescript\\lib" } ================================================ FILE: source/react-site-information/.yo-rc.json ================================================ { "@microsoft/generator-sharepoint": { "plusBeta": false, "isCreatingSolution": true, "nodeVersion": "16.19.0", "sdksVersions": { "@microsoft/microsoft-graph-client": "3.0.2", "@microsoft/teams-js": "2.4.1" }, "version": "1.16.1", "environment": "spo", "libraryName": "react-site-information", "libraryId": "09938b42-5d02-4ca4-a040-61914367cf6f", "packageManager": "npm", "componentType": "webpart", "skipFeatureDeployment": true, "isDomainIsolated": false } } ================================================ FILE: source/react-site-information/README.md ================================================ # Site Information web part This web part provides you the ability to collect and present additional metadata on a web page for group associated team sites. The web part may be configured to display site title, a site contacts powered by a people picker, and a term from the term store, often used to provide classification for the site. This web part is intended to be used once within a group associated team site to provide additional metadata. This web part provides an extensability framework in which to customize the web part code base to include additional properties and thus site metadata. Additional method demonstrations include the PnP Property Control people picker and the PnP Property Control term picker. The term store must include the term group name, `PnPTermSets`, which incudes a Term Set, `PnP-Organizations`. Terms should be placed within this term set. The term group, term set, and default terms are added by the Starter Kit provisioning process, in particular set within the `./provisioning/terms.xml` provisioning template. You can also create these terms manually, if you independently use this web part without other starter kit capabilities. ![Site Information](../../assets/images/components/part-site-information.gif) ## How to use this web part on your web pages 1. Place the page you want to add this web part to in edit mode. 2. Search for and insert the **Site Information** web part. 3. Configure the web part to update its properties. ## Configurable Properties The `Site Information` web part can be configured with the following properties: | Label | Property | Type | Required | Description | | ---- | ---- | ---- | ---- | ---- | | Site Title | siteTitle | string | no | Default: Contoso Portal - the title of the site | | Site Contact | siteContact | IPropertyFieldGroupOrPerson[] | no | A site contact based on a people picker | | Site Organization | siteOrganization | IPickerTerms | no | The site's organization, based on a taxonomy termset | ## Used SharePoint Framework Version ![drop](https://img.shields.io/badge/version-1.16.1-green.svg) * Supported in SharePoint Online ## Applies to * [SharePoint Framework](https://learn.microsoft.com/en-us/sharepoint/dev/spfx/sharepoint-framework-overview) * [Office 365 tenant](https://learn.microsoft.com/en-us/sharepoint/dev/spfx/set-up-your-development-environment) ## Prerequisites This solution relies on a term set named **PnP-Organizations** found within the term group **PnPTermSets**. These terms are added by default during a standard provisioning of the [PnP Starter Kit](../../provisioning). If you have not applied the starterkit.pnp package you can find the xml used to provision the terms [here](../templates/starterkit.xml) ## Solution Solution|Author(s) --------|--------- react-site-information | Paolo Pialorsi react-site-information | David Warner II react-site-information | Chandani Prajapati ## Version history Version|Date|Comments -------|----|-------- 1.0|April 7, 2018|Initial release 2.0|December 3, 2019|v2.0 3.0|February 2023|Initial release for SharePoint Starter Kit v3 (Upgraded to SPFx 1.16.1) ## Disclaimer **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.** --- ## Minimal Path to Awesome * Clone this repository * Move to solution folder * in the command line run: * `npm install` * `gulp serve` ## Features This Web Part illustrates the following concepts on top of the SharePoint Framework: * PnP Property Controls - @pnp/spfx-property-controls: Term picker and People picker ================================================ FILE: source/react-site-information/config/config.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/config.2.0.schema.json", "version": "2.0", "bundles": { "site-information-web-part": { "components": [ { "entrypoint": "./lib/webparts/siteInformation/SiteInformationWebPart.js", "manifest": "./src/webparts/siteInformation/SiteInformationWebPart.manifest.json" } ] } }, "externals": {}, "localizedResources": { "SiteInformationWebPartStrings": "lib/webparts/siteInformation/loc/{locale}.js", "PropertyControlStrings": "node_modules/@pnp/spfx-property-controls/lib/loc/{locale}.js", "ControlStrings": "node_modules/@pnp/spfx-controls-react/lib/loc/{locale}.js" } } ================================================ FILE: source/react-site-information/config/deploy-azure-storage.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/deploy-azure-storage.schema.json", "workingDir": "./release/assets/", "account": "", "container": "react-site-information", "accessKey": "" } ================================================ FILE: source/react-site-information/config/package-solution.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/package-solution.schema.json", "solution": { "name": "Starter Kit - Site Information", "id": "09938b42-5d02-4ca4-a040-61914367cf6f", "version": "3.0.0.0", "includeClientSideAssets": true, "skipFeatureDeployment": true, "isDomainIsolated": false, "developer": { "name": "PnP Starter Kit", "privacyUrl": "", "termsOfUseUrl": "", "websiteUrl": "", "mpnId": "pnpsk" }, "metadata": { "shortDescription": { "default": "react-site-information description" }, "longDescription": { "default": "react-site-information description" }, "screenshotPaths": [], "videoUrl": "", "categories": [] }, "features": [ { "title": "Starter Kit - Site Information WebPart Feature", "description": "The feature that activates Site Information WebPart from the Starter Kit - Site Information solution.", "id": "f91c48b4-3ffd-4446-8577-375b07a62c9f", "version": "3.0.0.0", "componentIds": [ "f91c48b4-3ffd-4446-8577-375b07a62c9f" ] } ] }, "paths": { "zippedPackage": "solution/react-site-information.sppkg" } } ================================================ FILE: source/react-site-information/config/sass.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/core-build/sass.schema.json" } ================================================ FILE: source/react-site-information/config/serve.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/spfx-serve.schema.json", "port": 4321, "https": true, "initialPage": "https://enter-your-SharePoint-site/_layouts/workbench.aspx" } ================================================ FILE: source/react-site-information/config/write-manifests.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/write-manifests.schema.json", "cdnBasePath": "" } ================================================ FILE: source/react-site-information/gulpfile.js ================================================ 'use strict'; const build = require('@microsoft/sp-build-web'); build.addSuppression(`Warning - [sass] The local CSS class 'ms-Grid' is not camelCase and will not be type-safe.`); var getTasks = build.rig.getTasks; build.rig.getTasks = function () { var result = getTasks.call(build.rig); result.set('serve', result.get('serve-deprecated')); return result; }; build.initialize(require('gulp')); ================================================ FILE: source/react-site-information/package.json ================================================ { "name": "react-site-information", "version": "3.0.0", "private": true, "main": "lib/index.js", "engines": { "node": ">=16.13.0 <17.0.0" }, "scripts": { "build": "gulp bundle", "clean": "gulp clean", "test": "gulp test" }, "dependencies": { "@microsoft/sp-core-library": "1.16.1", "@microsoft/sp-lodash-subset": "1.16.1", "@microsoft/sp-office-ui-fabric-core": "1.16.1", "@microsoft/sp-property-pane": "1.16.1", "@microsoft/sp-webpart-base": "1.16.1", "@pnp/sp": "3.11.0", "@pnp/spfx-controls-react": "3.12.0", "@pnp/spfx-property-controls": "3.11.0", "react": "17.0.1", "react-dom": "17.0.1", "tslib": "2.3.1" }, "resolutions": { "@types/react": "16.8.8" }, "devDependencies": { "@microsoft/eslint-config-spfx": "1.16.1", "@microsoft/eslint-plugin-spfx": "1.16.1", "@microsoft/rush-stack-compiler-4.5": "0.2.2", "@microsoft/sp-build-web": "1.16.1", "@microsoft/sp-module-interfaces": "1.16.1", "@rushstack/eslint-config": "2.5.1", "@types/react": "17.0.45", "@types/react-dom": "17.0.17", "@types/webpack-env": "~1.15.2", "ajv": "^6.12.5", "eslint-plugin-react-hooks": "4.3.0", "gulp": "4.0.2", "typescript": "4.5.5" } } ================================================ FILE: source/react-site-information/src/index.ts ================================================ // A file is required to be in the root of the /src directory by the TypeScript compiler ================================================ FILE: source/react-site-information/src/webparts/siteInformation/ISiteInformationWebPartProps.ts ================================================ import { IPropertyFieldGroupOrPerson } from '@pnp/spfx-property-controls/lib/PropertyFieldPeoplePicker'; import { IPickerTerms } from '@pnp/spfx-property-controls/lib/PropertyFieldTermPicker'; export interface ISiteInformationWebPartProps { // used to represent the site's title siteTitle: string; // used to represent the site's contact siteContact: IPropertyFieldGroupOrPerson[]; // used to represent the site's organization, based on a taxonomy termset siteOrganization: IPickerTerms; } ================================================ FILE: source/react-site-information/src/webparts/siteInformation/SiteInformationWebPart.manifest.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx/client-side-web-part-manifest.schema.json", "id": "f91c48b4-3ffd-4446-8577-375b07a62c9f", "alias": "SiteInformationWebPart", "componentType": "WebPart", // The "*" signifies that the version should be taken from the package.json "version": "*", "manifestVersion": 2, "supportedHosts": ["SharePointWebPart", "SharePointFullPage", "TeamsTab", "TeamsPersonalApp"], // 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": "Site Information" }, "description": { "default": "Metadata around the site" }, "officeFabricIconFontName": "BulletedList", "properties": { "description": "Site Information" } }] } ================================================ FILE: source/react-site-information/src/webparts/siteInformation/SiteInformationWebPart.ts ================================================ import * as React from 'react'; import * as ReactDom from 'react-dom'; import { Version } from '@microsoft/sp-core-library'; import { BaseClientSideWebPart, IWebPartPropertiesMetadata } from "@microsoft/sp-webpart-base"; import { IPropertyPaneConfiguration, PropertyPaneTextField } from "@microsoft/sp-property-pane"; import { DisplayMode } from '@microsoft/sp-core-library'; import * as strings from 'SiteInformationWebPartStrings'; import SiteInformation from './components/SiteInformation'; import { ISiteInformationProps } from './components/ISiteInformationProps'; import { ISiteInformationWebPartProps } from './ISiteInformationWebPartProps'; import "@pnp/sp/webs"; export default class SiteInformationWebPart extends BaseClientSideWebPart { private propertyFieldTermPicker : any; private propertyFieldPeoplePicker : any; private principalType: any; public onInit(): Promise { return super.onInit().then(async (_) => { // chunk shared by all web parts const { spfi, SPFx } = await import( /* webpackChunkName: 'pnp-sp' */ '@pnp/sp'); await super.onInit(); // initialize the PnP JS library const sp = spfi().using(SPFx(this.context)); // initialize the Site Title property reading the current site title via PnP JS if (!this.properties.siteTitle) { sp.web.select('Title')().then((r) => { this.properties.siteTitle = r.Title; }); } }); } protected get propertiesMetadata(): IWebPartPropertiesMetadata { // makes the properties of the web part searchable with the SPO search engine return { 'siteTitle': { isSearchablePlainText: true }, 'siteContact': { isSearchablePlainText: true }, 'siteOrganization': { isSearchablePlainText: true } }; } public render(): void { const element: React.ReactElement = React.createElement( SiteInformation, { siteTitle: this.properties.siteTitle, siteContactLogin: (this.properties.siteContact && this.properties.siteContact.length > 0) ? this.properties.siteContact[0].login : '', siteContactEmail: (this.properties.siteContact && this.properties.siteContact.length > 0) ? this.properties.siteContact[0].email : undefined, siteContactFullName: (this.properties.siteContact && this.properties.siteContact.length > 0) ? this.properties.siteContact[0].fullName : undefined, siteContactImageUrl: (this.properties.siteContact && this.properties.siteContact.length > 0) ? this.properties.siteContact[0].imageUrl : undefined, siteOrganization: (this.properties.siteOrganization && this.properties.siteOrganization.length > 0) ? this.properties.siteOrganization[0].name : '', needsConfiguration: this.needsConfiguration(), configureHandler: () => { this.context.propertyPane.open(); }, errorHandler: (errorMessage: string) => { if (this.displayMode === DisplayMode.Edit) { this.context.statusRenderer.renderError(this.domElement, errorMessage); } else { // nothing to do, if we are not in edit Mode } } } ); ReactDom.render(element, this.domElement); } protected get dataVersion(): Version { return Version.parse('1.0'); } // executes only before property pane is loaded. protected async loadPropertyPaneResources(): Promise { // import additional controls/components const { PropertyFieldTermPicker } = await import ( /* webpackChunkName: 'pnp-propcontrols-termpicker' */ '@pnp/spfx-property-controls/lib/PropertyFieldTermPicker' ); const { PropertyFieldPeoplePicker, PrincipalType } = await import ( /* webpackChunkName: 'pnp-propcontrols-peoplepicker' */ '@pnp/spfx-property-controls/lib/PropertyFieldPeoplePicker' ); this.propertyFieldTermPicker = PropertyFieldTermPicker; this.propertyFieldPeoplePicker = PropertyFieldPeoplePicker; this.principalType = PrincipalType; } protected getPropertyPaneConfiguration(): IPropertyPaneConfiguration { return { pages: [ { header: { description: strings.PropertyPaneDescription }, groups: [ { groupName: strings.BasicGroupName, groupFields: [ PropertyPaneTextField('siteTitle', { label: strings.SiteTitleFieldLabel }), this.propertyFieldPeoplePicker('siteContact', { label: strings.SiteContactFieldLabel, initialData: this.properties.siteContact, allowDuplicate: false, multiSelect: false, principalType: [this.principalType.Users], onPropertyChange: this.onPropertyPaneFieldChanged, context: this.context, properties: this.properties, onGetErrorMessage: undefined, deferredValidationTime: 0, key: 'siteContactId' }), this.propertyFieldTermPicker('siteOrganization', { label: strings.SiteOrganizationFieldLabel, panelTitle: strings.SiteOrganizationPanelTitle, initialValues: this.properties.siteOrganization, allowMultipleSelections: false, excludeSystemGroup: true, onPropertyChange: this.onPropertyPaneFieldChanged, properties: this.properties, context: this.context, onGetErrorMessage: undefined, deferredValidationTime: 0, limitByGroupNameOrID: 'PnPTermSets', limitByTermsetNameOrID: 'PnP-Organizations', key: 'siteOrganizationId' }) ] } ] } ] }; } // method to refresh any error after properties configuration protected onAfterPropertyPaneChangesApplied(): void { this.context.statusRenderer.clearError(this.domElement); } // method to determine if the web part has to be configured private needsConfiguration(): boolean { // as long as we don't have the stock symbol, we need configuration return ((!this.properties.siteTitle || this.properties.siteTitle.length === 0) || (!this.properties.siteContact) || (!this.properties.siteOrganization)); } } ================================================ FILE: source/react-site-information/src/webparts/siteInformation/components/ISiteInformationProps.ts ================================================ export interface ISiteInformationProps { // used to represent the site's title siteTitle: string; // used to represent the site's contact login name siteContactLogin: string; // used to represent the site's contact email siteContactEmail?: string; // used to represent the site's contact fullname siteContactFullName?: string; // used to represent the site's contact image URL siteContactImageUrl?: string; // used to represent the site's organization, based on a taxonomy termset siteOrganization: {}; // used to declare if the web part still needs to be configured needsConfiguration: boolean; // handler to process the request to configure the web part configureHandler: () => void; // handler to process any exception errorHandler: (errorMessage: string) => void; } ================================================ FILE: source/react-site-information/src/webparts/siteInformation/components/SiteInformation.module.scss ================================================ @import '~@fluentui/react/dist/sass/References.scss'; .siteInformation { .siteInformationContent { text-align: left; } .siteTitle { @include ms-font-xl; color: $ms-color-black; font-weight: bold; } .siteOrganization { @include ms-font-l; color: $ms-color-black; } .siteContact { @include ms-font-l; color: $ms-color-black; margin-top: 5px; } } ================================================ FILE: source/react-site-information/src/webparts/siteInformation/components/SiteInformation.tsx ================================================ import * as React from 'react'; import styles from './SiteInformation.module.scss'; import { ISiteInformationProps } from './ISiteInformationProps'; // import strings from localized resources import * as strings from 'SiteInformationWebPartStrings'; // import additional controls/components import { Placeholder } from '@pnp/spfx-controls-react/lib/Placeholder'; import { Persona, PersonaSize, PersonaPresence } from '@fluentui/react/lib/Persona'; export default class SiteInformation extends React.Component { constructor(props: ISiteInformationProps) { super(props); } public render(): React.ReactElement { // show the Placeholder control, if we are missing the configuration, otherwise show the real content return (
{(this.props.needsConfiguration || !this.props.siteTitle || !this.props.siteContactLogin || !this.props.siteContactEmail || !this.props.siteContactFullName || !this.props.siteOrganization) ? :
{this.props.siteTitle}
[{this.props.siteOrganization}]
0))} size={ PersonaSize.size24 } presence={ PersonaPresence.none } />
}
); } private getInitials(fullName: string): string { if (!fullName) { return (undefined); } const parts: string[] = fullName.split(' '); let initials: string = ''; parts.forEach(p => { if (p.length > 0) { initials = initials.concat(p.substring(0, 1).toUpperCase()); } }); return (initials); } } ================================================ FILE: source/react-site-information/src/webparts/siteInformation/loc/de-de.js ================================================ define([], function() { return { "PropertyPaneDescription": "Beschreibung", "BasicGroupName": "Gruppenname", "SiteTitleFieldLabel": "Seitentitel", "SiteContactFieldLabel": "Seiten Kontakt", "SiteOrganizationFieldLabel": "Seiten Organisation", "SiteOrganizationPanelTitle": "Seiten Organisation", "PlaceholderIconName":"Ändern", "PlaceholderIconText":"Konfigurieren Sie Ihren Web Part", "PlaceholderDescription":"Bitte konfigurieren Sie Ihren Web Part.", "PlaceholderButtonLabel":"Konfiguration", "SiteTitleCaption": "Seiten Title:", "SiteContactCaption": "Seiten Kontakt:", "SiteOrganizationCaption": "Seiten Organisation:" } }); ================================================ FILE: source/react-site-information/src/webparts/siteInformation/loc/en-us.js ================================================ define([], function() { return { "PropertyPaneDescription": "Description", "BasicGroupName": "Group Name", "SiteTitleFieldLabel": "Site Title", "SiteContactFieldLabel": "Site Contact", "SiteOrganizationFieldLabel": "Site Organization", "SiteOrganizationPanelTitle": "Site Organization", "PlaceholderIconName":"Edit", "PlaceholderIconText":"Configure your web part", "PlaceholderDescription":"Please configure the web part.", "PlaceholderButtonLabel":"Configure", "SiteTitleCaption": "Site Title:", "SiteContactCaption": "Site Contact:", "SiteOrganizationCaption": "Site Organization:" } }); ================================================ FILE: source/react-site-information/src/webparts/siteInformation/loc/es-es.js ================================================ define([], function() { return { "PropertyPaneDescription": "Descripción", "BasicGroupName": "Nombre del grupo", "SiteTitleFieldLabel": "Título del sitio", "SiteContactFieldLabel": "Contácto del sitio", "SiteOrganizationFieldLabel": "Organización del sitio", "SiteOrganizationPanelTitle": "Organización del sitio", "PlaceholderIconName":"Editr", "PlaceholderIconText":"Configuración delo elemento web", "PlaceholderDescription":"Favor de configurar el elemento web.", "PlaceholderButtonLabel":"Configure", "SiteTitleCaption": "Título del sitio:", "SiteContactCaption": "Contácto del sitio:", "SiteOrganizationCaption": "Organización del sitio:" } }); ================================================ FILE: source/react-site-information/src/webparts/siteInformation/loc/fr-fr.js ================================================ define([], function() { return { "PropertyPaneDescription": "Description", "BasicGroupName": "Nom du groupe", "SiteTitleFieldLabel": "Titre du site", "SiteContactFieldLabel": "Contact du site", "SiteOrganizationFieldLabel": "Organisation du site", "SiteOrganizationPanelTitle": "Organisation du site", "PlaceholderIconName":"Edit", "PlaceholderIconText":"Configurer votre partie Web", "PlaceholderDescription":"Veuillez configurer la partie Web.", "PlaceholderButtonLabel":"Configurer", "SiteTitleCaption": "Titre du site:", "SiteContactCaption": "Contact di site:", "SiteOrganizationCaption": "Organisation du site:" } }); ================================================ FILE: source/react-site-information/src/webparts/siteInformation/loc/mystrings.d.ts ================================================ declare interface ISiteInformationWebPartStrings { // Property Pane labels and strings PropertyPaneDescription: string; BasicGroupName: string; SiteTitleFieldLabel: string; SiteContactFieldLabel: string; SiteOrganizationFieldLabel: string; SiteOrganizationPanelTitle: string; // Placeholder labels and strings PlaceholderIconName: string; PlaceholderIconText: string; PlaceholderDescription: string; PlaceholderButtonLabel: string; // UI labels and strings SiteTitleCaption: string; SiteContactCaption: string; SiteOrganizationCaption: string; } declare module 'SiteInformationWebPartStrings' { const strings: ISiteInformationWebPartStrings; export = strings; } ================================================ FILE: source/react-site-information/src/webparts/siteInformation/loc/nb-no.js ================================================ define([], function() { return { "PropertyPaneDescription": "Beskrivelse", "BasicGroupName": "Gruppenavn", "SiteTitleFieldLabel": "Områdetittel", "SiteContactFieldLabel": "Områdekontakt", "SiteOrganizationFieldLabel": "Område organisasjon", "SiteOrganizationPanelTitle": "Område organisasjon", "PlaceholderIconName":"Rediger", "PlaceholderIconText":"Konfigurer webdel", "PlaceholderDescription":"Vennligst konfigurer webdelen.", "PlaceholderButtonLabel":"Konfigurer", "SiteTitleCaption": "Områdetittel:", "SiteContactCaption": "Områdekontakt:", "SiteOrganizationCaption": "Område organisasjon:" } }); ================================================ FILE: source/react-site-information/src/webparts/siteInformation/loc/nl-nl.js ================================================ define([], function() { return { "PropertyPaneDescription": "Omschrijving", "BasicGroupName": "Groepsnaam", "SiteTitleFieldLabel": "Site Titel", "SiteContactFieldLabel": "Site Contactpersoon", "SiteOrganizationFieldLabel": "Site Organisatie", "SiteOrganizationPanelTitle": "Site Organisatie", "PlaceholderIconName":"Bewerken", "PlaceholderIconText":"Configureer je webpart", "PlaceholderDescription":"Configureer het webpart.", "PlaceholderButtonLabel":"Configureer", "SiteTitleCaption": "Site Titel:", "SiteContactCaption": "Site Contactpersoon:", "SiteOrganizationCaption": "Site Organizatie:" } }); ================================================ FILE: source/react-site-information/src/webparts/siteInformation/loc/sv-se.js ================================================ define([], function() { return { "PropertyPaneDescription": "Beskrivning", "BasicGroupName": "Gruppnamn", "SiteTitleFieldLabel": "Webbplatstitel", "SiteContactFieldLabel": "Webbplatskontakt", "SiteOrganizationFieldLabel": "Webbplatsorganisation", "SiteOrganizationPanelTitle": "Webbplatsorganisation", "PlaceholderIconName":"Redigera", "PlaceholderIconText":"Konfigurera din webbdel", "PlaceholderDescription":"Var god konfigurera din webbdel.", "PlaceholderButtonLabel":"Konfigurera", "SiteTitleCaption": "Webbplatstitel:", "SiteContactCaption": "Webbplatskontakt:", "SiteOrganizationCaption": "Webbplatsorganisation:" } }); ================================================ FILE: source/react-site-information/src/webparts/siteInformation/loc/tr-tr.js ================================================ define([], function() { return { "PropertyPaneDescription": "Açıklama", "BasicGroupName": "Grup ismi", "SiteTitleFieldLabel": "Site Başlığı", "SiteContactFieldLabel": "Site Yetkilisi", "SiteOrganizationFieldLabel": "Site Organizasyonu", "SiteOrganizationPanelTitle": "Site Organizasyonu", "PlaceholderIconName":"Düzenle", "PlaceholderIconText":"Web bölümünü yapılandır", "PlaceholderDescription":"Lütfen web bölümünü yapılandırın.", "PlaceholderButtonLabel":"Yapılandır", "SiteTitleCaption": "Site Başlığı:", "SiteContactCaption": "Site Yetkilisi:", "SiteOrganizationCaption": "Site Organizasyonu:" } }); ================================================ FILE: source/react-site-information/tsconfig.json ================================================ { "extends": "./node_modules/@microsoft/rush-stack-compiler-4.5/includes/tsconfig-web.json", "compilerOptions": { "target": "es5", "forceConsistentCasingInFileNames": true, "module": "esnext", "moduleResolution": "node", "jsx": "react", "declaration": true, "sourceMap": true, "experimentalDecorators": true, "skipLibCheck": true, "outDir": "lib", "inlineSources": false, "strictNullChecks": false, "noImplicitAny": true, "typeRoots": [ "./node_modules/@types", "./node_modules/@microsoft" ], "types": [ "webpack-env" ], "lib": [ "es5", "dom", "es2015.collection", "es2015.promise" ] }, "include": [ "src/**/*.ts", "src/**/*.tsx" ] } ================================================ FILE: source/react-tiles/.editorconfig ================================================ # EditorConfig helps developers define and maintain consistent # coding styles between different editors and IDEs # editorconfig.org root = true [*] # change these settings to your own preference indent_style = space indent_size = 2 # we recommend you to keep these unchanged end_of_line = lf charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true [*.md] trim_trailing_whitespace = false [{package,bower}.json] indent_style = space indent_size = 2 ================================================ FILE: source/react-tiles/.eslintrc.js ================================================ require('@rushstack/eslint-config/patch/modern-module-resolution'); module.exports = { extends: ['@microsoft/eslint-config-spfx/lib/profiles/react'], parserOptions: { tsconfigRootDir: __dirname }, overrides: [ { files: ['*.ts', '*.tsx'], parser: '@typescript-eslint/parser', 'parserOptions': { 'project': './tsconfig.json', 'ecmaVersion': 2018, 'sourceType': 'module' }, rules: { // Prevent usage of the JavaScript null value, while allowing code to access existing APIs that may require null. https://www.npmjs.com/package/@rushstack/eslint-plugin '@rushstack/no-new-null': 1, // Require Jest module mocking APIs to be called before any other statements in their code block. https://www.npmjs.com/package/@rushstack/eslint-plugin '@rushstack/hoist-jest-mock': 1, // Require regular expressions to be constructed from string constants rather than dynamically building strings at runtime. https://www.npmjs.com/package/@rushstack/eslint-plugin-security '@rushstack/security/no-unsafe-regexp': 1, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/adjacent-overload-signatures': 1, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // // CONFIGURATION: By default, these are banned: String, Boolean, Number, Object, Symbol '@typescript-eslint/ban-types': [ 1, { 'extendDefaults': false, 'types': { 'String': { 'message': 'Use \'string\' instead', 'fixWith': 'string' }, 'Boolean': { 'message': 'Use \'boolean\' instead', 'fixWith': 'boolean' }, 'Number': { 'message': 'Use \'number\' instead', 'fixWith': 'number' }, 'Object': { 'message': 'Use \'object\' instead, or else define a proper TypeScript type:' }, 'Symbol': { 'message': 'Use \'symbol\' instead', 'fixWith': 'symbol' }, 'Function': { 'message': 'The \'Function\' type accepts any function-like value.\nIt provides no type safety when calling the function, which can be a common source of bugs.\nIt also accepts things like class declarations, which will throw at runtime as they will not be called with \'new\'.\nIf you are expecting the function to accept certain arguments, you should explicitly define the function shape.' } } } ], // RATIONALE: Code is more readable when the type of every variable is immediately obvious. // Even if the compiler may be able to infer a type, this inference will be unavailable // to a person who is reviewing a GitHub diff. This rule makes writing code harder, // but writing code is a much less important activity than reading it. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/explicit-function-return-type': [ 1, { 'allowExpressions': true, 'allowTypedFunctionExpressions': true, 'allowHigherOrderFunctions': false } ], // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // Rationale to disable: although this is a recommended rule, it is up to dev to select coding style. // Set to 1 (warning) or 2 (error) to enable. '@typescript-eslint/explicit-member-accessibility': 0, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/no-array-constructor': 1, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // // RATIONALE: The "any" keyword disables static type checking, the main benefit of using TypeScript. // This rule should be suppressed only in very special cases such as JSON.stringify() // where the type really can be anything. Even if the type is flexible, another type // may be more appropriate such as "unknown", "{}", or "Record". '@typescript-eslint/no-explicit-any': 0, // RATIONALE: The #1 rule of promises is that every promise chain must be terminated by a catch() // handler. Thus wherever a Promise arises, the code must either append a catch handler, // or else return the object to a caller (who assumes this responsibility). Unterminated // promise chains are a serious issue. Besides causing errors to be silently ignored, // they can also cause a NodeJS process to terminate unexpectedly. '@typescript-eslint/no-floating-promises': 2, // RATIONALE: Catches a common coding mistake. '@typescript-eslint/no-for-in-array': 2, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/no-misused-new': 2, // RATIONALE: The "namespace" keyword is not recommended for organizing code because JavaScript lacks // a "using" statement to traverse namespaces. Nested namespaces prevent certain bundler // optimizations. If you are declaring loose functions/variables, it's better to make them // static members of a class, since classes support property getters and their private // members are accessible by unit tests. Also, the exercise of choosing a meaningful // class name tends to produce more discoverable APIs: for example, search+replacing // the function "reverse()" is likely to return many false matches, whereas if we always // write "Text.reverse()" is more unique. For large scale organization, it's recommended // to decompose your code into separate NPM packages, which ensures that component // dependencies are tracked more conscientiously. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/no-namespace': [ 1, { 'allowDeclarations': false, 'allowDefinitionFiles': false } ], // RATIONALE: Parameter properties provide a shorthand such as "constructor(public title: string)" // that avoids the effort of declaring "title" as a field. This TypeScript feature makes // code easier to write, but arguably sacrifices readability: In the notes for // "@typescript-eslint/member-ordering" we pointed out that fields are central to // a class's design, so we wouldn't want to bury them in a constructor signature // just to save some typing. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // Set to 1 (warning) or 2 (error) to enable the rule '@typescript-eslint/no-parameter-properties': 0, // RATIONALE: When left in shipping code, unused variables often indicate a mistake. Dead code // may impact performance. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/no-unused-vars': [ 1, { 'vars': 'all', // Unused function arguments often indicate a mistake in JavaScript code. However in TypeScript code, // the compiler catches most of those mistakes, and unused arguments are fairly common for type signatures // that are overriding a base class method or implementing an interface. 'args': 'none' } ], // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/no-use-before-define': [ 2, { 'functions': false, 'classes': true, 'variables': true, 'enums': true, 'typedefs': true } ], // Disallows require statements except in import statements. // In other words, the use of forms such as var foo = require("foo") are banned. Instead use ES6 style imports or import foo = require("foo") imports. '@typescript-eslint/no-var-requires': 'error', // RATIONALE: The "module" keyword is deprecated except when describing legacy libraries. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/prefer-namespace-keyword': 1, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // Rationale to disable: it's up to developer to decide if he wants to add type annotations // Set to 1 (warning) or 2 (error) to enable the rule '@typescript-eslint/no-inferrable-types': 0, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // Rationale to disable: declaration of empty interfaces may be helpful for generic types scenarios '@typescript-eslint/no-empty-interface': 0, // RATIONALE: This rule warns if setters are defined without getters, which is probably a mistake. 'accessor-pairs': 1, // RATIONALE: In TypeScript, if you write x["y"] instead of x.y, it disables type checking. 'dot-notation': [ 1, { 'allowPattern': '^_' } ], // RATIONALE: Catches code that is likely to be incorrect 'eqeqeq': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'for-direction': 1, // RATIONALE: Catches a common coding mistake. 'guard-for-in': 2, // RATIONALE: If you have more than 2,000 lines in a single source file, it's probably time // to split up your code. 'max-lines': ['warn', { max: 2000 }], // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-async-promise-executor': 2, // RATIONALE: Deprecated language feature. 'no-caller': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-compare-neg-zero': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-cond-assign': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-constant-condition': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-control-regex': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-debugger': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-delete-var': 2, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-duplicate-case': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-empty': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-empty-character-class': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-empty-pattern': 1, // RATIONALE: Eval is a security concern and a performance concern. 'no-eval': 1, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-ex-assign': 2, // RATIONALE: System types are global and should not be tampered with in a scalable code base. // If two different libraries (or two versions of the same library) both try to modify // a type, only one of them can win. Polyfills are acceptable because they implement // a standardized interoperable contract, but polyfills are generally coded in plain // JavaScript. 'no-extend-native': 1, // Disallow unnecessary labels 'no-extra-label': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-fallthrough': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-func-assign': 1, // RATIONALE: Catches a common coding mistake. 'no-implied-eval': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-invalid-regexp': 2, // RATIONALE: Catches a common coding mistake. 'no-label-var': 2, // RATIONALE: Eliminates redundant code. 'no-lone-blocks': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-misleading-character-class': 2, // RATIONALE: Catches a common coding mistake. 'no-multi-str': 2, // RATIONALE: It's generally a bad practice to call "new Thing()" without assigning the result to // a variable. Either it's part of an awkward expression like "(new Thing()).doSomething()", // or else implies that the constructor is doing nontrivial computations, which is often // a poor class design. 'no-new': 1, // RATIONALE: Obsolete language feature that is deprecated. 'no-new-func': 2, // RATIONALE: Obsolete language feature that is deprecated. 'no-new-object': 2, // RATIONALE: Obsolete notation. 'no-new-wrappers': 1, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-octal': 2, // RATIONALE: Catches code that is likely to be incorrect 'no-octal-escape': 2, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-regex-spaces': 2, // RATIONALE: Catches a common coding mistake. 'no-return-assign': 2, // RATIONALE: Security risk. 'no-script-url': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-self-assign': 2, // RATIONALE: Catches a common coding mistake. 'no-self-compare': 2, // RATIONALE: This avoids statements such as "while (a = next(), a && a.length);" that use // commas to create compound expressions. In general code is more readable if each // step is split onto a separate line. This also makes it easier to set breakpoints // in the debugger. 'no-sequences': 1, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-shadow-restricted-names': 2, // RATIONALE: Obsolete language feature that is deprecated. // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-sparse-arrays': 2, // RATIONALE: Although in theory JavaScript allows any possible data type to be thrown as an exception, // such flexibility adds pointless complexity, by requiring every catch block to test // the type of the object that it receives. Whereas if catch blocks can always assume // that their object implements the "Error" contract, then the code is simpler, and // we generally get useful additional information like a call stack. 'no-throw-literal': 2, // RATIONALE: Catches a common coding mistake. 'no-unmodified-loop-condition': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-unsafe-finally': 2, // RATIONALE: Catches a common coding mistake. 'no-unused-expressions': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-unused-labels': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-useless-catch': 1, // RATIONALE: Avoids a potential performance problem. 'no-useless-concat': 1, // RATIONALE: The "var" keyword is deprecated because of its confusing "hoisting" behavior. // Always use "let" or "const" instead. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json 'no-var': 2, // RATIONALE: Generally not needed in modern code. 'no-void': 1, // RATIONALE: Obsolete language feature that is deprecated. // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-with': 2, // RATIONALE: Makes logic easier to understand, since constants always have a known value // @typescript-eslint\eslint-plugin\dist\configs\eslint-recommended.js 'prefer-const': 1, // RATIONALE: Catches a common coding mistake where "resolve" and "reject" are confused. 'promise/param-names': 2, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'require-atomic-updates': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'require-yield': 1, // "Use strict" is redundant when using the TypeScript compiler. 'strict': [ 2, 'never' ], // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'use-isnan': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js // Set to 1 (warning) or 2 (error) to enable. // Rationale to disable: !!{} 'no-extra-boolean-cast': 0, // ==================================================================== // @microsoft/eslint-plugin-spfx // ==================================================================== '@microsoft/spfx/import-requires-chunk-name': 1, '@microsoft/spfx/no-require-ensure': 2, '@microsoft/spfx/pair-react-dom-render-unmount': 0 } }, { // For unit tests, we can be a little bit less strict. The settings below revise the // defaults specified in the extended configurations, as well as above. files: [ // Test files '*.test.ts', '*.test.tsx', '*.spec.ts', '*.spec.tsx', // Facebook convention '**/__mocks__/*.ts', '**/__mocks__/*.tsx', '**/__tests__/*.ts', '**/__tests__/*.tsx', // Microsoft convention '**/test/*.ts', '**/test/*.tsx' ], rules: {} } ] }; ================================================ FILE: source/react-tiles/.gitignore ================================================ # Logs logs *.log npm-debug.log* # Dependency directories node_modules # Build generated files dist lib release solution temp *.sppkg .heft # Coverage directory used by tools like istanbul coverage # OSX .DS_Store # Visual Studio files .ntvs_analysis.dat .vs bin obj # Resx Generated Code *.resx.ts # Styles Generated Code *.scss.ts ================================================ FILE: source/react-tiles/.npmignore ================================================ !dist config gulpfile.js release src temp tsconfig.json tslint.json *.log .yo-rc.json .vscode ================================================ FILE: source/react-tiles/.vscode/launch.json ================================================ { "version": "0.2.0", "configurations": [ { "name": "Hosted workbench", "type": "pwa-chrome", "request": "launch", "url": "https://enter-your-SharePoint-site/_layouts/workbench.aspx", "webRoot": "${workspaceRoot}", "sourceMaps": true, "sourceMapPathOverrides": { "webpack:///.././src/*": "${webRoot}/src/*", "webpack:///../../../src/*": "${webRoot}/src/*", "webpack:///../../../../src/*": "${webRoot}/src/*", "webpack:///../../../../../src/*": "${webRoot}/src/*" }, "runtimeArgs": [ "--remote-debugging-port=9222", "-incognito" ] } ] } ================================================ FILE: source/react-tiles/.vscode/settings.json ================================================ // Place your settings in this file to overwrite default and user settings. { // Configure glob patterns for excluding files and folders in the file explorer. "files.exclude": { "**/.git": true, "**/.DS_Store": true, "**/bower_components": true, "**/coverage": true, "**/lib-amd": true, "src/**/*.scss.ts": true }, "typescript.tsdk": ".\\node_modules\\typescript\\lib" } ================================================ FILE: source/react-tiles/.yo-rc.json ================================================ { "@microsoft/generator-sharepoint": { "plusBeta": false, "isCreatingSolution": true, "nodeVersion": "16.19.0", "sdksVersions": { "@microsoft/microsoft-graph-client": "3.0.2", "@microsoft/teams-js": "2.4.1" }, "version": "1.16.1", "libraryName": "react-tiles", "libraryId": "b0c8359d-6380-4b12-baba-c79e4fd5f179", "environment": "spo", "packageManager": "npm", "componentType": "webpart", "skipFeatureDeployment": true, "isDomainIsolated": false } } ================================================ FILE: source/react-tiles/README.md ================================================ # Tiles web part This web part provides you the ability to add a per instance listing of tiled links. Tiles are stored as a collection of tiles within the web part's properties, removing the need for link storage within SharePoint lists, tenant properties, or other external link storage requirements. Icons are from Fluent UI Icons, those icons that should be available within at least Fluent UI version 7.3. View [Fluent UI Icons](https://developer.microsoft.com/en-us/fluentui#/styles/web/icons) for icon names. ![Tiles](../../assets/images/components/part-tiles.gif) ## How to use this web part on your web pages 1. Place the page you want to add this web part to in edit mode. 2. Search for and insert the **Tiles** web part. 3. Configure the web part to update its properties. ## Configurable Properties The `Tiles` web part can be configured with the following properties: | Label | Property | Type | Required | Description | | ---- | ---- | ---- | ---- | ---- | | Useful Tools | title | string | no | The web part title, editable inline with the web part itself | | Specify the height of the tiles | tileHeight | number | no | Default: 200, the height in pixels of each tile | | Tile data | collectionData | collection | no | Collection of tiles | ### collectionData Collection Properties Configurable properties for each tile row within the `collectionData` collection: | Label | Property | Type | Required | Description | | ---- | ---- | ---- | ---- | ---- | | Title | title | string | yes | The text / title of the tile | | Description | description | string | no | Optional tile description | | URL | url | string | yes | The tile link url | | Fluent UI icon name | icon | fabricIcon | no | Optional Fluent UI icon name | | Target | target | dropdown | no | Optional target for this link, current or new window | ## Used SharePoint Framework Version ![drop](https://img.shields.io/badge/version-1.16.1-green.svg) * Supported in SharePoint Online ## Applies to * [SharePoint Framework](https://learn.microsoft.com/en-us/sharepoint/dev/spfx/sharepoint-framework-overview) * [Office 365 tenant](https://learn.microsoft.com/en-us/sharepoint/dev/spfx/set-up-your-development-environment) ## Prerequisites none ## Solution Solution|Author(s) --------|--------- react-tiles V1 | Elio Struyf (@estruyf) react-tiles V2 | Fabio Franzini (@fabiofranzini) react-tiles V3 | Chandani Prajapati (@Chandani_SPD) ## Version history Version|Date|Comments -------|----|-------- 1.0|April 13th, 2018|Initial release 2.0|January 24, 2020|Initial release (extract web part from Starter Kit v1) 3.0|February 2023|Upgraded to SPFx 1.16.1 ## Disclaimer **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.** --- ## Minimal Path to Awesome * Clone this repository * Move to solution folder * in the command line run: * `npm install` * `gulp serve` > Include any additional steps as needed. ## Features Description of the web part with possible additional details than in short summary. This Web Part illustrates the following concepts on top of the SharePoint Framework: * PnP property control usage ================================================ FILE: source/react-tiles/config/config.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/config.2.0.schema.json", "version": "2.0", "bundles": { "tiles-web-part": { "components": [ { "entrypoint": "./lib/webparts/tiles/TilesWebPart.js", "manifest": "./src/webparts/tiles/TilesWebPart.manifest.json" } ] } }, "externals": {}, "localizedResources": { "TilesWebPartStrings": "lib/webparts/tiles/loc/{locale}.js", "PropertyControlStrings": "node_modules/@pnp/spfx-property-controls/lib/loc/{locale}.js", "ControlStrings": "node_modules/@pnp/spfx-controls-react/lib/loc/{locale}.js" } } ================================================ FILE: source/react-tiles/config/deploy-azure-storage.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/deploy-azure-storage.schema.json", "workingDir": "./release/assets/", "account": "", "container": "react-tiles", "accessKey": "" } ================================================ FILE: source/react-tiles/config/package-solution.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/package-solution.schema.json", "solution": { "name": "Starter Kit - Tiles", "id": "b0c8359d-6380-4b12-baba-c79e4fd5f179", "version": "3.0.0.0", "includeClientSideAssets": true, "skipFeatureDeployment": true, "developer": { "name": "PnP Starter Kit", "privacyUrl": "", "termsOfUseUrl": "", "websiteUrl": "", "mpnId": "pnpsk" }, "metadata": { "shortDescription": { "default": "react-tiles description" }, "longDescription": { "default": "react-tiles description" }, "screenshotPaths": [], "videoUrl": "", "categories": [] }, "features": [ { "title": "react-tiles Tiles WebPart Feature", "description": "The feature that activates TilesWebPart from the react-tiles solution.", "id": "61c36e66-16fd-4542-b50a-b8cd61359737", "version": "3.0.0.0", "componentIds": [ "61c36e66-16fd-4542-b50a-b8cd61359737" ] } ] }, "paths": { "zippedPackage": "solution/react-tiles.sppkg" } } ================================================ FILE: source/react-tiles/config/sass.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/core-build/sass.schema.json" } ================================================ FILE: source/react-tiles/config/serve.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/spfx-serve.schema.json", "port": 4321, "https": true, "initialPage": "https://enter-your-SharePoint-site/_layouts/workbench.aspx" } ================================================ FILE: source/react-tiles/config/write-manifests.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/write-manifests.schema.json", "cdnBasePath": "" } ================================================ FILE: source/react-tiles/gulpfile.js ================================================ 'use strict'; const build = require('@microsoft/sp-build-web'); build.addSuppression(`Warning - [sass] The local CSS class 'ms-Grid' is not camelCase and will not be type-safe.`); var getTasks = build.rig.getTasks; build.rig.getTasks = function () { var result = getTasks.call(build.rig); result.set('serve', result.get('serve-deprecated')); return result; }; build.initialize(require('gulp')); ================================================ FILE: source/react-tiles/package.json ================================================ { "name": "react-tiles", "version": "3.0.0", "private": true, "engines": { "node": ">=16.13.0 <17.0.0" }, "scripts": { "build": "gulp bundle", "clean": "gulp clean", "test": "gulp test" }, "dependencies": { "@microsoft/sp-core-library": "1.16.1", "@microsoft/sp-lodash-subset": "1.16.1", "@microsoft/sp-office-ui-fabric-core": "1.16.1", "@microsoft/sp-property-pane": "1.16.1", "@microsoft/sp-webpart-base": "1.16.1", "@pnp/spfx-controls-react": "3.12.0", "@pnp/spfx-property-controls": "3.11.0", "@types/es6-promise": "0.0.33", "@types/react": "15.6.6", "@types/react-dom": "15.5.6", "@types/webpack-env": "1.13.1", "react": "17.0.1", "react-dom": "17.0.1", "tslib": "2.3.1" }, "resolutions": { "@types/react": "16.8.8" }, "devDependencies": { "@microsoft/eslint-config-spfx": "1.16.1", "@microsoft/eslint-plugin-spfx": "1.16.1", "@microsoft/rush-stack-compiler-4.5": "0.2.2", "@microsoft/sp-build-web": "1.16.1", "@microsoft/sp-module-interfaces": "1.16.1", "@rushstack/eslint-config": "2.5.1", "@types/chai": "3.4.34", "@types/mocha": "2.2.38", "@types/react": "17.0.45", "@types/react-dom": "17.0.17", "@types/webpack-env": "~1.15.2", "ajv": "^6.12.5", "eslint-plugin-react-hooks": "4.3.0", "gulp": "4.0.2", "typescript": "4.5.5" } } ================================================ FILE: source/react-tiles/src/index.ts ================================================ // A file is required to be in the root of the /src directory by the TypeScript compiler ================================================ FILE: source/react-tiles/src/webparts/tiles/ITileInfo.ts ================================================ export interface ITileInfo { title: string; description: string; url: string; icon: string; target: LinkTarget; } export enum LinkTarget { parent = '', blank = '_blank' } ================================================ FILE: source/react-tiles/src/webparts/tiles/TilesWebPart.manifest.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx/client-side-web-part-manifest.schema.json", "id": "61c36e66-16fd-4542-b50a-b8cd61359737", "alias": "TilesWebPart", "componentType": "WebPart", // The "*" signifies that the version should be taken from the package.json "version": "*", "manifestVersion": 2, "supportedHosts": ["SharePointWebPart", "TeamsPersonalApp", "TeamsTab", "SharePointFullPage"], // 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": "Tiles" }, "description": { "default": "Lists links in tile format" }, "officeFabricIconFontName": "Tiles", "properties": { "title": "Useful tools", "tileHeight": 200 } }] } ================================================ FILE: source/react-tiles/src/webparts/tiles/TilesWebPart.ts ================================================ import * as React from 'react'; import * as ReactDom from 'react-dom'; import { Version } from '@microsoft/sp-core-library'; import { BaseClientSideWebPart } from "@microsoft/sp-webpart-base"; import { IPropertyPaneConfiguration } from "@microsoft/sp-property-pane"; import * as strings from 'TilesWebPartStrings'; import { ITilesProps } from './components/ITilesProps'; import { ITileInfo, LinkTarget } from './ITileInfo'; import { Tiles } from './components/Tiles'; export interface ITilesWebPartProps { collectionData: ITileInfo[]; tileHeight: number; title: string; } export default class TilesWebPart extends BaseClientSideWebPart { // Just for suppress the tslint validation of dinamically loading of this field by using loadPropertyPaneResources() // tslint:disable-next-line: no-any private propertyFieldNumber: any; // Just for suppress the tslint validation of dinamically loading of this field by using loadPropertyPaneResources() // tslint:disable-next-line: no-any private propertyFieldCollectionData: any; // Just for suppress the tslint validation of dinamically loading of this field by using loadPropertyPaneResources() // tslint:disable-next-line: no-any private customCollectionFieldType: any; public render(): void { const element: React.ReactElement = React.createElement( Tiles, { title: this.properties.title, tileHeight: this.properties.tileHeight, collectionData: this.properties.collectionData, displayMode: this.displayMode, fUpdateProperty: (value: string) => { this.properties.title = value; }, fPropertyPaneOpen: this.context.propertyPane.open } ); ReactDom.render(element, this.domElement); } protected get dataVersion(): Version { return Version.parse('1.0'); } // executes only before property pane is loaded. protected async loadPropertyPaneResources(): Promise { // import additional controls/components const { PropertyFieldNumber } = await import( /* webpackChunkName: 'pnp-propcontrols-number' */ '@pnp/spfx-property-controls/lib/propertyFields/number' ); const { PropertyFieldCollectionData, CustomCollectionFieldType } = await import( /* webpackChunkName: 'pnp-propcontrols-colldata' */ '@pnp/spfx-property-controls/lib/PropertyFieldCollectionData' ); this.propertyFieldNumber = PropertyFieldNumber; this.propertyFieldCollectionData = PropertyFieldCollectionData; this.customCollectionFieldType = CustomCollectionFieldType; } protected getPropertyPaneConfiguration(): IPropertyPaneConfiguration { return { pages: [ { header: { description: strings.PropertyPaneDescription }, groups: [ { groupFields: [ this.propertyFieldCollectionData('collectionData', { key: 'collectionData', label: strings.tilesDataLabel, panelHeader: strings.tilesPanelHeader, // tslint:disable-next-line:max-line-length panelDescription: `${strings.iconInformation} https://developer.microsoft.com/en-us/fabric#/styles/icons`, manageBtnLabel: strings.tilesManageBtn, value: this.properties.collectionData, fields: [ { id: 'title', title: strings.titleField, type: this.customCollectionFieldType.string, required: true }, { id: 'description', title: strings.descriptionField, type: this.customCollectionFieldType.string, required: false }, { id: 'url', title: strings.urlField, type: this.customCollectionFieldType.string, required: true }, { id: 'icon', title: strings.iconField, type: this.customCollectionFieldType.fabricIcon, required: true }, { id: 'target', title: strings.targetField, type: this.customCollectionFieldType.dropdown, options: [ { key: LinkTarget.parent, text: strings.targetCurrent }, { key: LinkTarget.blank, text: strings.targetNew } ] } ] }), this.propertyFieldNumber('tileHeight', { key: 'tileHeight', label: strings.TileHeight, value: this.properties.tileHeight }) ] } ] } ] }; } } ================================================ FILE: source/react-tiles/src/webparts/tiles/components/ITilesProps.ts ================================================ import { ITilesWebPartProps } from './../TilesWebPart'; import { DisplayMode } from '@microsoft/sp-core-library'; export interface ITilesProps extends ITilesWebPartProps { displayMode: DisplayMode; fUpdateProperty: (value: string) => void; fPropertyPaneOpen: () => void; } ================================================ FILE: source/react-tiles/src/webparts/tiles/components/Tile/ITileProps.ts ================================================ import { ITileInfo } from '../../ITileInfo'; export interface ITileProps { item: ITileInfo; height: number; } ================================================ FILE: source/react-tiles/src/webparts/tiles/components/Tile/Tile.module.scss ================================================ @import "~@microsoft/sp-office-ui-fabric-core/dist/sass/SPFabricCore.scss"; .tile { @include ms-Grid-col; @include ms-sm4; display: flex; margin-bottom: 16px; flex-basis: 130px; a { background-color: $ms-color-themePrimary; box-sizing: border-box; color: $ms-color-white; display: block; min-height: 123px; overflow: hidden; padding: 15px; position: relative; text-decoration: none; width: 100%; &:hover, &:visited { color: $ms-color-white; text-decoration: none; } } .tileIcon { @include ms-fontSize-su; text-align: center; } .tileTitle { @include ms-fontSize-m; bottom: 0; left: 0; padding: 15px; position: absolute; right: 0; text-align: center; } .overflow { background-color: rgba(0, 0, 0, 0.8); box-sizing: border-box; color: white; height: 100%; left: 0; padding: 15px; position: absolute; right: 0; top: 100%; transition: all 0.5s ease; } &:hover { .overflow { top: 0; } } } ================================================ FILE: source/react-tiles/src/webparts/tiles/components/Tile/Tile.tsx ================================================ import * as React from 'react'; import styles from './Tile.module.scss'; import { Icon } from '@fluentui/react/lib/Icon'; import { ITileProps } from './ITileProps'; export class Tile extends React.Component { public render(): React.ReactElement { const tileStyle: React.CSSProperties = {}; if (this.props.height) { tileStyle.height = `${this.props.height}px`; } return ( ); } } ================================================ FILE: source/react-tiles/src/webparts/tiles/components/Tiles.module.scss ================================================ @import '~@fluentui/react/dist/sass/References.scss'; .tiles { .message { @include ms-font-m; } .error { @include ms-font-m; color: $ms-color-alert; } .tilesList { @include ms-Grid-row; display: block; flex-wrap: wrap; } } ================================================ FILE: source/react-tiles/src/webparts/tiles/components/Tiles.tsx ================================================ import * as React from 'react'; import * as strings from 'TilesWebPartStrings'; import styles from './Tiles.module.scss'; import { Tile } from './Tile/Tile'; import { WebPartTitle } from '@pnp/spfx-controls-react/lib/WebPartTitle'; import { Placeholder } from '@pnp/spfx-controls-react/lib/Placeholder'; import { ITilesProps } from './ITilesProps'; export class Tiles extends React.Component { public render(): React.ReactElement { return (
{ this.props.collectionData && this.props.collectionData.length > 0 ? (
{ this.props.collectionData.map((tile, idx) => ) }
) : ( ) }
); } } ================================================ FILE: source/react-tiles/src/webparts/tiles/loc/de-de.js ================================================ define([], function() { return { "PropertyPaneDescription": "Kachel Web Part Konfiguration", "TilesListDescription": "Die Liste zum konfigurieren der Kacheln kann unter folgendem Link gefunden werden:", "TileHeight": "Geben Sie die Höhe der Kacheln an", "iconInformation": "Die Namen zum angeben des Icon Feldes können unter der folgenden URL gefunden werden:", "tilesDataLabel": "Kacheldaten", "tilesPanelHeader": "Konfigurieren Sie Ihre Kachel", "tilesManageBtn": "Kacheln konfigurieren", "titleField": "Title", "descriptionField": "Description", "urlField": "URL", "iconField": "UI Fabric icon name", "targetField": "Target", "targetCurrent": "Aktuelles Fenster", "targetNew": "Neuer Tab", "noTilesIconText": "Konfigurieren Sie Ihre Kachel", "noTilesConfigured": "Konfigurieren Sie den Webpart damit Kacheln angezeigt werden können", "noTilesBtn": "Konfigurieren", } }); ================================================ FILE: source/react-tiles/src/webparts/tiles/loc/en-us.js ================================================ define([], function() { return { "PropertyPaneDescription": "Tiles web part configuration", "TilesListDescription": "The list for configuring the tiles can be found on the following link:", "TileHeight": "Specify the height of the tiles", "iconInformation": "The names to specify for the icon field can be found on the following URL:", "tilesDataLabel": "Tile data", "tilesPanelHeader": "Configure your tiles", "tilesManageBtn": "Configure the tiles", "titleField": "Title", "descriptionField": "Description", "urlField": "URL", "iconField": "UI Fabric icon name", "targetField": "Target", "targetCurrent": "Current window", "targetNew": "New tab", "noTilesIconText": "Configure your tiles", "noTilesConfigured": "Please configure the web part in order to show tiles", "noTilesBtn": "Configure", } }); ================================================ FILE: source/react-tiles/src/webparts/tiles/loc/es-es.js ================================================ define([], function() { return { "PropertyPaneDescription": "Configuraación del elemento web de Recuadros", "TilesListDescription": "La lista para configurar los recuadros se puede encontar en el siguiente enlace:", "TileHeight": "Especifique el alto de los recuadros", "iconInformation": "Los nombres a especificar para el campo icono poueden encontrarse en la siguiente direccion URL:", "tilesDataLabel": "Datos del recuadro", "tilesPanelHeader": "Configure sus recuadros", "tilesManageBtn": "Configure los recuadros", "titleField": "Título", "descriptionField": "Descripción", "urlField": "URL", "iconField": "Nombre de icono de UI Fabric", "targetField": "Destino", "targetCurrent": "Ventana actual", "targetNew": "Nueva ventana", "noTilesIconText": "Configure sus recuadros", "noTilesConfigured": "Favor de configurar el elemento web en el orden a mostrar los recuadros", "noTilesBtn": "Configure", } }); ================================================ FILE: source/react-tiles/src/webparts/tiles/loc/fr-fr.js ================================================ define([], function() { return { "PropertyPaneDescription": "Configuration des tuiles de la partie Web", "TilesListDescription": "La liste de configuration des tuiles est disponible sur le lien suivant:", "TileHeight": "Spécifiez la hauteur des tuiles", "iconInformation": "Les noms à spécifier pour le champ d'icône se trouvent à l'URL suivante:", "tilesDataLabel": "Données de tuiles", "tilesPanelHeader": "Configurez vos tuiles", "tilesManageBtn": "Configurer les tuiles", "titleField": "Titre", "descriptionField": "Description", "urlField": "URL", "iconField": "Nom de l'icône d'UI Fabric", "targetField": "Cible", "targetCurrent": "Page fenêtre", "targetNew": "Nouvel onglet", "noTilesIconText": "Configurez vos tuiles", "noTilesConfigured": "Veuillez configurer la partie Web pour afficher les tuiles.", "noTilesBtn": "Configurer", } }); ================================================ FILE: source/react-tiles/src/webparts/tiles/loc/mystrings.d.ts ================================================ declare interface ITilesWebPartStrings { PropertyPaneDescription: string; TilesListDescription: string; TileHeight: string; iconInformation: string; // Properties tilesDataLabel: string; tilesPanelHeader: string; tilesManageBtn: string; // Tile fields titleField: string; descriptionField: string; urlField: string; iconField: string; targetField: string; targetCurrent: string; targetNew: string; // Component noTilesIconText: string; noTilesConfigured: string; noTilesBtn: string; } declare module 'TilesWebPartStrings' { const strings: ITilesWebPartStrings; export = strings; } ================================================ FILE: source/react-tiles/src/webparts/tiles/loc/nb-no.js ================================================ define([], function() { return { "PropertyPaneDescription": "Flis webdel konfigurasjon", "TilesListDescription": "Listen med fliskonfigurasjoner finnes på følgende lenke:", "TileHeight": "Angi høyden på flisene", "iconInformation": "Navnene som skal angis i ikonfeltet finnes på følgende URL:", "tilesDataLabel": "Flisdata", "tilesPanelHeader": "Konfigurer dine fliser", "tilesManageBtn": "Konfigurer flisene", "titleField": "Tittel", "descriptionField": "Beskrivelse", "urlField": "URL", "iconField": "UI Fabric ikonnavn", "targetField": "Mål", "targetCurrent": "Gjeldende vindu", "targetNew": "Nytt vindu", "noTilesIconText": "Konfigurer dine fliser", "noTilesConfigured": "Vennligst konfigurer webdelen for å vise dine fliser", "noTilesBtn": "Konfigurer", } }); ================================================ FILE: source/react-tiles/src/webparts/tiles/loc/nl-nl.js ================================================ define([], function() { return { "PropertyPaneDescription": "Tegel webpart configuratie", "TilesListDescription": "De lijst voor het configureren van de tegels kan gevonden worden via de volgende link:", "TileHeight": "Specificeer de hoogte van de tegels", "iconInformation": "De icoonnamen kan je vinden via de volgende URL:", "tilesDataLabel": "Tegel data", "tilesPanelHeader": "Configureer je tegels", "tilesManageBtn": "Configureer je tegels", "titleField": "Titel", "descriptionField": "Omschrijving", "urlField": "URL", "iconField": "UI Fabric icoonnaam", "targetField": "Doel", "targetCurrent": "Huidig venster", "targetNew": "Nieuw tabblad", "noTilesIconText": "Configureer je tegels", "noTilesConfigured": "Configureer de webpart om tegels te tonen", "noTilesBtn": "Configureer", } }); ================================================ FILE: source/react-tiles/src/webparts/tiles/loc/sv-se.js ================================================ define([], function() { return { "PropertyPaneDescription": "Tiles webbdelskonfiguration", "TilesListDescription": "Listan för att konfigurera tiles finns på följande länk", "TileHeight": "Ange höjden på tilesen", "iconInformation": "Namnen som ska anges i ikonfältet finns på följande webbadress:", "tilesDataLabel": "Tiledata", "tilesPanelHeader": "Konfigurera dina tiles", "tilesManageBtn": "Konfigurera tilesen", "titleField": "Titel", "descriptionField": "Beskrivning", "urlField": "URL", "iconField": "UI Fabric ikonnamn", "targetField": "Mål", "targetCurrent": "Aktuellt fönster", "targetNew": "Ny flik", "noTilesIconText": "Konfigurera dina tiles", "noTilesConfigured": "Var god konfigurera webbdelen för att tilesen skall kunna visas", "noTilesBtn": "Konfigurera", } }); ================================================ FILE: source/react-tiles/src/webparts/tiles/loc/tr-tr.js ================================================ define([], function() { return { "PropertyPaneDescription": "Döşeme web parçası yapılandırması", "TilesListDescription": "Döşemeleri yapılandırma listesi aşağıdaki linkte bulunabilir.:", "TileHeight": "Döşemenin yüksekliğini belirtin", "iconInformation": "İkon alanı için belirtilecek isimler aşağıdaki URL’de bulunabilir:", "tilesDataLabel": "Döşeme Verisi", "tilesPanelHeader": "Döşemelerini yapılandır", "tilesManageBtn": "Döşemeleri yapılandırın", "titleField": "Başlık", "descriptionField": "Açıklama", "urlField": "URL", "iconField": "UI Fabric ikon adı", "targetField": "Hedef", "targetCurrent": "Geçerli pencere ", "targetNew": "Yeni sekme", "noTilesIconText": "Döşemelerini yapılandır", "noTilesConfigured": "Döşemeleri göstermek için lütfen web bölümünü yapılandırın", "noTilesBtn": "Yapılandır", } }); ================================================ FILE: source/react-tiles/tsconfig.json ================================================ { "extends": "./node_modules/@microsoft/rush-stack-compiler-4.5/includes/tsconfig-web.json", "compilerOptions": { "target": "es5", "forceConsistentCasingInFileNames": true, "module": "esnext", "moduleResolution": "node", "jsx": "react", "declaration": true, "sourceMap": true, "experimentalDecorators": true, "skipLibCheck": true, "outDir": "lib", "inlineSources": false, "strictNullChecks": false, "noImplicitAny": true, "typeRoots": [ "./node_modules/@types", "./node_modules/@microsoft" ], "types": [ "webpack-env" ], "lib": [ "es5", "dom", "es2015.collection", "es2015.promise" ] }, "include": [ "src/**/*.ts", "src/**/*.tsx" ] } ================================================ FILE: source/react-weather/.editorconfig ================================================ # EditorConfig helps developers define and maintain consistent # coding styles between different editors and IDEs # editorconfig.org root = true [*] # change these settings to your own preference indent_style = space indent_size = 2 # we recommend you to keep these unchanged end_of_line = lf charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true [*.md] trim_trailing_whitespace = false [{package,bower}.json] indent_style = space indent_size = 2 ================================================ FILE: source/react-weather/.eslintrc.js ================================================ require('@rushstack/eslint-config/patch/modern-module-resolution'); module.exports = { extends: ['@microsoft/eslint-config-spfx/lib/profiles/react'], parserOptions: { tsconfigRootDir: __dirname }, overrides: [ { files: ['*.ts', '*.tsx'], parser: '@typescript-eslint/parser', 'parserOptions': { 'project': './tsconfig.json', 'ecmaVersion': 2018, 'sourceType': 'module' }, rules: { // Prevent usage of the JavaScript null value, while allowing code to access existing APIs that may require null. https://www.npmjs.com/package/@rushstack/eslint-plugin '@rushstack/no-new-null': 1, // Require Jest module mocking APIs to be called before any other statements in their code block. https://www.npmjs.com/package/@rushstack/eslint-plugin '@rushstack/hoist-jest-mock': 1, // Require regular expressions to be constructed from string constants rather than dynamically building strings at runtime. https://www.npmjs.com/package/@rushstack/eslint-plugin-security '@rushstack/security/no-unsafe-regexp': 1, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/adjacent-overload-signatures': 1, '@typescript-eslint/no-explicit-any': 0, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // // CONFIGURATION: By default, these are banned: String, Boolean, Number, Object, Symbol '@typescript-eslint/ban-types': [ 1, { 'extendDefaults': false, 'types': { 'String': { 'message': 'Use \'string\' instead', 'fixWith': 'string' }, 'Boolean': { 'message': 'Use \'boolean\' instead', 'fixWith': 'boolean' }, 'Number': { 'message': 'Use \'number\' instead', 'fixWith': 'number' }, 'Object': { 'message': 'Use \'object\' instead, or else define a proper TypeScript type:' }, 'Symbol': { 'message': 'Use \'symbol\' instead', 'fixWith': 'symbol' }, 'Function': { 'message': 'The \'Function\' type accepts any function-like value.\nIt provides no type safety when calling the function, which can be a common source of bugs.\nIt also accepts things like class declarations, which will throw at runtime as they will not be called with \'new\'.\nIf you are expecting the function to accept certain arguments, you should explicitly define the function shape.' } } } ], // RATIONALE: Code is more readable when the type of every variable is immediately obvious. // Even if the compiler may be able to infer a type, this inference will be unavailable // to a person who is reviewing a GitHub diff. This rule makes writing code harder, // but writing code is a much less important activity than reading it. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/explicit-function-return-type': [ 1, { 'allowExpressions': true, 'allowTypedFunctionExpressions': true, 'allowHigherOrderFunctions': false } ], // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // Rationale to disable: although this is a recommended rule, it is up to dev to select coding style. // Set to 1 (warning) or 2 (error) to enable. '@typescript-eslint/explicit-member-accessibility': 0, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/no-array-constructor': 1, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // // RATIONALE: The "any" keyword disables static type checking, the main benefit of using TypeScript. // This rule should be suppressed only in very special cases such as JSON.stringify() // where the type really can be anything. Even if the type is flexible, another type // may be more appropriate such as "unknown", "{}", or "Record". '@typescript-eslint/no-explicit-any': 1, // RATIONALE: The #1 rule of promises is that every promise chain must be terminated by a catch() // handler. Thus wherever a Promise arises, the code must either append a catch handler, // or else return the object to a caller (who assumes this responsibility). Unterminated // promise chains are a serious issue. Besides causing errors to be silently ignored, // they can also cause a NodeJS process to terminate unexpectedly. '@typescript-eslint/no-floating-promises': 2, // RATIONALE: Catches a common coding mistake. '@typescript-eslint/no-for-in-array': 2, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/no-misused-new': 2, // RATIONALE: The "namespace" keyword is not recommended for organizing code because JavaScript lacks // a "using" statement to traverse namespaces. Nested namespaces prevent certain bundler // optimizations. If you are declaring loose functions/variables, it's better to make them // static members of a class, since classes support property getters and their private // members are accessible by unit tests. Also, the exercise of choosing a meaningful // class name tends to produce more discoverable APIs: for example, search+replacing // the function "reverse()" is likely to return many false matches, whereas if we always // write "Text.reverse()" is more unique. For large scale organization, it's recommended // to decompose your code into separate NPM packages, which ensures that component // dependencies are tracked more conscientiously. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/no-namespace': [ 1, { 'allowDeclarations': false, 'allowDefinitionFiles': false } ], // RATIONALE: Parameter properties provide a shorthand such as "constructor(public title: string)" // that avoids the effort of declaring "title" as a field. This TypeScript feature makes // code easier to write, but arguably sacrifices readability: In the notes for // "@typescript-eslint/member-ordering" we pointed out that fields are central to // a class's design, so we wouldn't want to bury them in a constructor signature // just to save some typing. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // Set to 1 (warning) or 2 (error) to enable the rule '@typescript-eslint/no-parameter-properties': 0, // RATIONALE: When left in shipping code, unused variables often indicate a mistake. Dead code // may impact performance. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/no-unused-vars': [ 1, { 'vars': 'all', // Unused function arguments often indicate a mistake in JavaScript code. However in TypeScript code, // the compiler catches most of those mistakes, and unused arguments are fairly common for type signatures // that are overriding a base class method or implementing an interface. 'args': 'none' } ], // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/no-use-before-define': [ 2, { 'functions': false, 'classes': true, 'variables': true, 'enums': true, 'typedefs': true } ], // Disallows require statements except in import statements. // In other words, the use of forms such as var foo = require("foo") are banned. Instead use ES6 style imports or import foo = require("foo") imports. '@typescript-eslint/no-var-requires': 'error', // RATIONALE: The "module" keyword is deprecated except when describing legacy libraries. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/prefer-namespace-keyword': 1, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // Rationale to disable: it's up to developer to decide if he wants to add type annotations // Set to 1 (warning) or 2 (error) to enable the rule '@typescript-eslint/no-inferrable-types': 0, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // Rationale to disable: declaration of empty interfaces may be helpful for generic types scenarios '@typescript-eslint/no-empty-interface': 0, // RATIONALE: This rule warns if setters are defined without getters, which is probably a mistake. '@typescript-eslint/no-explicit-any': 0, 'react/no-deprecated': 0, 'accessor-pairs': 1, // RATIONALE: In TypeScript, if you write x["y"] instead of x.y, it disables type checking. 'dot-notation': [ 1, { 'allowPattern': '^_' } ], // RATIONALE: Catches code that is likely to be incorrect 'eqeqeq': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'for-direction': 1, // RATIONALE: Catches a common coding mistake. 'guard-for-in': 2, // RATIONALE: If you have more than 2,000 lines in a single source file, it's probably time // to split up your code. 'max-lines': ['warn', { max: 2000 }], // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-async-promise-executor': 2, // RATIONALE: Deprecated language feature. 'no-caller': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-compare-neg-zero': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-cond-assign': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-constant-condition': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-control-regex': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-debugger': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-delete-var': 2, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-duplicate-case': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-empty': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-empty-character-class': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-empty-pattern': 1, // RATIONALE: Eval is a security concern and a performance concern. 'no-eval': 1, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-ex-assign': 2, // RATIONALE: System types are global and should not be tampered with in a scalable code base. // If two different libraries (or two versions of the same library) both try to modify // a type, only one of them can win. Polyfills are acceptable because they implement // a standardized interoperable contract, but polyfills are generally coded in plain // JavaScript. 'no-extend-native': 1, // Disallow unnecessary labels 'no-extra-label': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-fallthrough': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-func-assign': 1, // RATIONALE: Catches a common coding mistake. 'no-implied-eval': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-invalid-regexp': 2, // RATIONALE: Catches a common coding mistake. 'no-label-var': 2, // RATIONALE: Eliminates redundant code. 'no-lone-blocks': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-misleading-character-class': 2, // RATIONALE: Catches a common coding mistake. 'no-multi-str': 2, // RATIONALE: It's generally a bad practice to call "new Thing()" without assigning the result to // a variable. Either it's part of an awkward expression like "(new Thing()).doSomething()", // or else implies that the constructor is doing nontrivial computations, which is often // a poor class design. 'no-new': 1, // RATIONALE: Obsolete language feature that is deprecated. 'no-new-func': 2, // RATIONALE: Obsolete language feature that is deprecated. 'no-new-object': 2, // RATIONALE: Obsolete notation. 'no-new-wrappers': 1, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-octal': 2, // RATIONALE: Catches code that is likely to be incorrect 'no-octal-escape': 2, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-regex-spaces': 2, // RATIONALE: Catches a common coding mistake. 'no-return-assign': 2, // RATIONALE: Security risk. 'no-script-url': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-self-assign': 2, // RATIONALE: Catches a common coding mistake. 'no-self-compare': 2, // RATIONALE: This avoids statements such as "while (a = next(), a && a.length);" that use // commas to create compound expressions. In general code is more readable if each // step is split onto a separate line. This also makes it easier to set breakpoints // in the debugger. 'no-sequences': 1, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-shadow-restricted-names': 2, // RATIONALE: Obsolete language feature that is deprecated. // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-sparse-arrays': 2, // RATIONALE: Although in theory JavaScript allows any possible data type to be thrown as an exception, // such flexibility adds pointless complexity, by requiring every catch block to test // the type of the object that it receives. Whereas if catch blocks can always assume // that their object implements the "Error" contract, then the code is simpler, and // we generally get useful additional information like a call stack. 'no-throw-literal': 2, // RATIONALE: Catches a common coding mistake. 'no-unmodified-loop-condition': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-unsafe-finally': 2, // RATIONALE: Catches a common coding mistake. 'no-unused-expressions': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-unused-labels': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-useless-catch': 1, // RATIONALE: Avoids a potential performance problem. 'no-useless-concat': 1, // RATIONALE: The "var" keyword is deprecated because of its confusing "hoisting" behavior. // Always use "let" or "const" instead. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json 'no-var': 2, // RATIONALE: Generally not needed in modern code. 'no-void': 1, // RATIONALE: Obsolete language feature that is deprecated. // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-with': 2, // RATIONALE: Makes logic easier to understand, since constants always have a known value // @typescript-eslint\eslint-plugin\dist\configs\eslint-recommended.js 'prefer-const': 1, // RATIONALE: Catches a common coding mistake where "resolve" and "reject" are confused. 'promise/param-names': 2, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'require-atomic-updates': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'require-yield': 1, // "Use strict" is redundant when using the TypeScript compiler. 'strict': [ 2, 'never' ], // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'use-isnan': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js // Set to 1 (warning) or 2 (error) to enable. // Rationale to disable: !!{} 'no-extra-boolean-cast': 0, // ==================================================================== // @microsoft/eslint-plugin-spfx // ==================================================================== '@microsoft/spfx/import-requires-chunk-name': 1, '@microsoft/spfx/no-require-ensure': 2, '@microsoft/spfx/pair-react-dom-render-unmount': 1 } }, { // For unit tests, we can be a little bit less strict. The settings below revise the // defaults specified in the extended configurations, as well as above. files: [ // Test files '*.test.ts', '*.test.tsx', '*.spec.ts', '*.spec.tsx', // Facebook convention '**/__mocks__/*.ts', '**/__mocks__/*.tsx', '**/__tests__/*.ts', '**/__tests__/*.tsx', // Microsoft convention '**/test/*.ts', '**/test/*.tsx' ], rules: {} } ] }; ================================================ FILE: source/react-weather/.gitignore ================================================ # Logs logs *.log npm-debug.log* # Dependency directories node_modules # Build generated files dist lib release solution temp *.sppkg .heft # Coverage directory used by tools like istanbul coverage # OSX .DS_Store # Visual Studio files .ntvs_analysis.dat .vs bin obj # Resx Generated Code *.resx.ts # Styles Generated Code *.scss.ts ================================================ FILE: source/react-weather/.npmignore ================================================ !dist config gulpfile.js release src temp tsconfig.json tslint.json *.log .yo-rc.json .vscode ================================================ FILE: source/react-weather/.vscode/launch.json ================================================ { "version": "0.2.0", "configurations": [ { "name": "Hosted workbench", "type": "pwa-chrome", "request": "launch", "url": "https://enter-your-SharePoint-site/_layouts/workbench.aspx", "webRoot": "${workspaceRoot}", "sourceMaps": true, "sourceMapPathOverrides": { "webpack:///.././src/*": "${webRoot}/src/*", "webpack:///../../../src/*": "${webRoot}/src/*", "webpack:///../../../../src/*": "${webRoot}/src/*", "webpack:///../../../../../src/*": "${webRoot}/src/*" }, "runtimeArgs": [ "--remote-debugging-port=9222", "-incognito" ] } ] } ================================================ FILE: source/react-weather/.vscode/settings.json ================================================ // Place your settings in this file to overwrite default and user settings. { // Configure glob patterns for excluding files and folders in the file explorer. "files.exclude": { "**/.git": true, "**/.DS_Store": true, "**/bower_components": true, "**/coverage": true, "**/lib-amd": true, "src/**/*.scss.ts": true }, "typescript.tsdk": ".\\node_modules\\typescript\\lib" } ================================================ FILE: source/react-weather/.yo-rc.json ================================================ { "@microsoft/generator-sharepoint": { "plusBeta": false, "isCreatingSolution": true, "nodeVersion": "16.19.0", "sdksVersions": { "@microsoft/microsoft-graph-client": "3.0.2", "@microsoft/teams-js": "2.4.1" }, "version": "1.16.1", "libraryName": "react-weather", "libraryId": "d47b1e90-b473-4855-bcd2-aa34ae942e5d", "environment": "onprem19", "packageManager": "npm", "solutionName": "react-weather", "solutionShortDescription": "react-weather description", "skipFeatureDeployment": true, "isDomainIsolated": false, "componentType": "webpart" } } ================================================ FILE: source/react-weather/README.md ================================================ # Weather Information web part This web part provides you the ability to display basic weather information for one location on a web page. The web part depends on a service provided by [OpenWeatherMap API](https://openweathermap.org/current/). The API requires authentication, and for that reason it is necessary to register for free plan to be able to obtain API Key that will be used to authenticate the calls. API Key has to be entered in web part configuration. ![Weather Information](../../assets/images/components/part-weather.gif) ## How to use this web part on your web pages 1. Place the page you want to add this web part to in edit mode. 2. Search for and insert the **Weather** web part. 3. Configure the web part to update its properties - location name, unit and API key. ## Configurable Properties The `Weather Information` web part can be configured with the following properties: | Label | Property | Type | Required | Description | | ---- | ---- | ---- | ---- | ---- | | Add a location | location | string | yes | Inline editable location for weather request | | Display temperature as | unit | choice | yes | The requested temperature unit, Celsius or Fahrenheit | | API Key | apikey | string | yes | API key to authenticate the API call | ## Installing the web part See getting started from [SP-Starter-Kit repository readme](https://github.com/SharePoint/sp-starter-kit). You can also download just the [SharePoint Framework solution package (spppkg) file](https://github.com/SharePoint/sp-starter-kit/blob/master/package/sharepoint-starter-kit.sppkg) and install that to your tenant. ## Screenshots ![Weather Information](../../assets/images/components/part-weather.png) ## Used SharePoint Framework Version ![drop](https://img.shields.io/badge/version-1.4-green.svg) * Works also at SharePoint 2019 ## Applies to * [SharePoint Framework](https:/dev.office.com/sharepoint) * [Office 365 tenant](https://dev.office.com/sharepoint/docs/spfx/set-up-your-development-environment) * [SharePoint 2019](https://docs.microsoft.com/en-us/sharepoint/dev/general-development/sharepoint-2019-development-platform) ## Prerequisites none ## Solution Solution|Author(s) --------|--------- /solution/src/webparts/weatherInformation/ | Waldek Mastykarz (@waldekmastykarz), Vardhaman Deshpande (@vman) react-weather | Dragan Panjkov (@panjkov) react-weather | Chandani Prajapati(@Chandani_SPD) ## Version history Version|Date|Comments -------|----|-------- 1.0|April 2018|Initial release 2.0|December 2019/January 2020|Standalone web part, OpenWeatherMap API 3.0|January 2023|Upgraded to SPFx 1.16.1 ## Disclaimer **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.** --- ## Minimal Path to Awesome * Clone this repository * Move to solution folder * in the command line run: * `npm install` * `gulp serve` > Include any additional steps as needed. ## Features Description of the web part with possible additional details than in short summary. This Web Part illustrates the following concepts on top of the SharePoint Framework: * PnP property control usage ================================================ FILE: source/react-weather/config/config.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/config.2.0.schema.json", "version": "2.0", "bundles": { "weather-web-part": { "components": [ { "entrypoint": "./lib/webparts/weather/WeatherWebPart.js", "manifest": "./src/webparts/weather/WeatherWebPart.manifest.json" } ] } }, "externals": {}, "localizedResources": { "WeatherWebPartStrings": "lib/webparts/weather/loc/{locale}.js", "ControlStrings": "node_modules/@pnp/spfx-controls-react/lib/loc/{locale}.js" } } ================================================ FILE: source/react-weather/config/copy-assets.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/core-build/sass.schema.json" } ================================================ FILE: source/react-weather/config/deploy-azure-storage.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/deploy-azure-storage.schema.json", "workingDir": "./release/assets/", "account": "", "container": "react-weather", "accessKey": "" } ================================================ FILE: source/react-weather/config/package-solution.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/package-solution.schema.json", "solution": { "name": "Starter Kit - Weather", "id": "d47b1e90-b473-4855-bcd2-aa34ae942e5d", "version": "3.0.0.0", "includeClientSideAssets": true, "skipFeatureDeployment": true, "isDomainIsolated": false, "developer": { "name": "PnP Starter Kit", "websiteUrl": "", "privacyUrl": "", "termsOfUseUrl": "", "mpnId": "pnpsk" }, "metadata": { "shortDescription": { "default": "react-weather description" }, "longDescription": { "default": "react-weather description" }, "screenshotPaths": [], "videoUrl": "", "categories": [] }, "features": [ { "title": "Starter Kit - Weather webpart Feature", "description": "The feature that activates Weather webpart from the Starter Kit - Weather solution.", "id": "3ec11027-02d1-4595-97d3-d758095cb52b", "version": "3.0.0.0", "componentIds": [ "3ec11027-02d1-4595-97d3-d758095cb52b" ] } ] }, "paths": { "zippedPackage": "solution/react-weather.sppkg" } } ================================================ FILE: source/react-weather/config/sass.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/core-build/sass.schema.json" } ================================================ FILE: source/react-weather/config/serve.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/spfx-serve.schema.json", "port": 4321, "https": true, "initialPage": "https://enter-your-SharePoint-site/_layouts/workbench.aspx" } ================================================ FILE: source/react-weather/config/write-manifests.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/write-manifests.schema.json", "cdnBasePath": "" } ================================================ FILE: source/react-weather/gulpfile.js ================================================ 'use strict'; const build = require('@microsoft/sp-build-web'); build.addSuppression(`Warning - [sass] The local CSS class 'ms-Grid' is not camelCase and will not be type-safe.`); var getTasks = build.rig.getTasks; build.rig.getTasks = function () { var result = getTasks.call(build.rig); result.set('serve', result.get('serve-deprecated')); return result; }; build.initialize(require('gulp')); ================================================ FILE: source/react-weather/package.json ================================================ { "name": "react-weather", "version": "3.0.0", "private": true, "main": "lib/index.js", "engines": { "node": ">=16.13.0 <17.0.0" }, "scripts": { "build": "gulp bundle", "clean": "gulp clean", "test": "gulp test" }, "dependencies": { "tslib": "2.3.1", "react": "17.0.1", "react-dom": "17.0.1", "@microsoft/sp-core-library": "1.16.1", "@microsoft/sp-property-pane": "1.16.1", "@microsoft/sp-webpart-base": "1.16.1", "@microsoft/sp-lodash-subset": "1.16.1", "@microsoft/sp-office-ui-fabric-core": "1.16.1", "@types/react": "15.6.6", "@types/react-dom": "15.5.6", "@pnp/spfx-controls-react": "3.12.0", "@types/webpack-env": "1.13.1", "@types/es6-promise": "0.0.33" }, "resolutions": { "@types/react": "15.6.6" }, "devDependencies": { "@microsoft/rush-stack-compiler-4.5": "0.2.2", "@rushstack/eslint-config": "2.5.1", "@microsoft/eslint-plugin-spfx": "1.16.1", "@microsoft/eslint-config-spfx": "1.16.1", "@microsoft/sp-build-web": "1.16.1", "@types/webpack-env": "~1.15.2", "ajv": "^6.12.5", "gulp": "4.0.2", "typescript": "4.5.5", "@types/react": "17.0.45", "@types/react-dom": "17.0.17", "eslint-plugin-react-hooks": "4.3.0", "@microsoft/sp-module-interfaces": "1.16.1", "@types/chai": "3.4.34", "@types/mocha": "2.2.38" } } ================================================ FILE: source/react-weather/src/index.ts ================================================ // A file is required to be in the root of the /src directory by the TypeScript compiler ================================================ FILE: source/react-weather/src/webparts/weather/WeatherWebPart.manifest.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx/client-side-web-part-manifest.schema.json", "id": "3ec11027-02d1-4595-97d3-d758095cb52b", "alias": "WeatherWebPart", "componentType": "WebPart", // The "*" signifies that the version should be taken from the package.json "version": "*", "manifestVersion": 2, "supportedHosts": ["SharePointWebPart", "TeamsPersonalApp", "TeamsTab", "SharePointFullPage"], // 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": "Weather" }, "description": { "default": "Shows weather information for the specified location" }, "officeFabricIconFontName": "Sunny", "properties": { "location": "", "unit": "c" } }] } ================================================ FILE: source/react-weather/src/webparts/weather/WeatherWebPart.ts ================================================ import * as React from 'react'; import * as ReactDom from 'react-dom'; import { Version } from '@microsoft/sp-core-library'; import { BaseClientSideWebPart } from "@microsoft/sp-webpart-base"; import { IPropertyPaneConfiguration, PropertyPaneTextField, PropertyPaneChoiceGroup } from '@microsoft/sp-property-pane'; import * as strings from 'WeatherWebPartStrings'; import Weather from './components/Weather'; import { IWeatherProps } from './components/IWeatherProps'; export interface IWeatherWebPartProps { location: string; unit: string; apikey: string; } export default class WeatherWebPart extends BaseClientSideWebPart { public render(): void { const element: React.ReactElement = React.createElement( Weather, { needsConfiguration: this._needsConfiguration(), location: this.properties.location, unit: this.properties.unit, apikey: this.properties.apikey, httpClient: this.context.httpClient, configureHandler: this._onConfigure, errorHandler: this._onError } ); ReactDom.render(element, this.domElement); } protected onDispose(): void { ReactDom.unmountComponentAtNode(this.domElement); } protected get dataVersion(): Version { return Version.parse('1.0'); } protected getPropertyPaneConfiguration(): IPropertyPaneConfiguration { return { pages: [ { header: { description: strings.PropertyPaneDescription }, groups: [ { groupName: strings.DataGroupName, groupFields: [ PropertyPaneTextField('location', { label: strings.LocationFieldLabel, onGetErrorMessage: this._validateLocation.bind(this) }), PropertyPaneChoiceGroup('unit', { label: strings.UnitFieldLabel, options: [ { text: strings.UnitFieldCelsius, key: 'c' }, { text: strings.UnitFieldFahrenheit, key: 'f' } ] }) ] }, { groupName: strings.ConfigGroupName, groupFields: [ PropertyPaneTextField('apikey', { label: strings.ApiKeyFieldLabel, }) ] } ] } ] }; } /** * Set the web part property pane to non-reactive, to avoid excessive retrieval * of data from the third party API when typing the name of the location for * which to retrieve weather information */ protected get disableReactivePropertyChanges(): boolean { return true; } protected onAfterPropertyPaneChangesApplied(): void { // after one or more web part properties have been changed // clear any error messages displayed in the web part this.context.statusRenderer.clearError(this.domElement); } /** * Handles clicking the Configure button in the placeholder */ private _onConfigure = (): void => { // open the property pane to let the user configure the web part this.context.propertyPane.open(); } /** * Handles any error that occurred in the component */ private _onError = (errorMessage: string): void => { // render the message for the error that occurred in the web part this.context.statusRenderer.renderError(this.domElement, errorMessage); } /** * Verify if the specified location is valid * @param value Location specified in the web part properties */ private _validateLocation(value: string): string { if (value === null || value.trim().length === 0) { return strings.LocationNotSpecifiedError; } if (value.indexOf('"') > -1) { return strings.LocationDoubleQuoteNotAllowed; } return ''; } /** * Check if the web part has been configured */ private _needsConfiguration(): boolean { return !this.properties.location || this.properties.location.length === 0 || !this.properties.unit || this.properties.unit.length === 0 || !this.properties.apikey || this.properties.apikey.length === 0; } } ================================================ FILE: source/react-weather/src/webparts/weather/components/IWeatherData.ts ================================================ export interface IWeatherData { coord: IWeatherLocation; weather: [IWeatherDescription]; main: IWeatherCondition; timezone: number; name: string; } export interface IWeatherLocation { lon: number; lat: number; } export interface IWeatherDescription { main: string; description: string; icon: string; } export interface IWeatherCondition { temp: number; feels_like: number; temp_min: number; temp_max: number; pressure: number; humidity: number; } ================================================ FILE: source/react-weather/src/webparts/weather/components/IWeatherProps.ts ================================================ import { HttpClient } from '@microsoft/sp-http'; export interface IWeatherProps { /** * The location for which the weather should be displayed */ location: string; /** * Unit in which the temperature should be displayed. * 'c' for Celsius and 'f' for Fahrenheit */ unit: string; /** * API Key for the API call */ apikey: string; /** * True if the web part requires configuration * (eg. the location hasn't been specified) */ needsConfiguration: boolean; /** * Instance of the HttpClient used to retrieve weather information * from a third party API */ httpClient: HttpClient; /** * Event handler for clicking the Configure button in the placeholder */ configureHandler: () => void; /** * Event handler for an error that occurred while loading weather information */ errorHandler: (errorMessage: string) => void; } ================================================ FILE: source/react-weather/src/webparts/weather/components/IWeatherState.ts ================================================ import { IWeatherLocation, IWeatherDescription, IWeatherCondition } from "."; /** * State for the weather information component */ export interface IWeatherState { /** * True if the component is loading its data, false otherwise */ loading: boolean; /** * Weather information retrieved from the third party API. * Undefined, if no information has been loaded */ // weatherInfo?: IWeatherQueryResults; coord?: IWeatherLocation; weather?: IWeatherDescription; main?: IWeatherCondition; timezone?: number; name?: string; } ================================================ FILE: source/react-weather/src/webparts/weather/components/Weather.module.scss ================================================ @font-face { font-family: 'weather'; src: url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/93/artill_clean_icons-webfont.eot'); src: url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/93/artill_clean_icons-webfont.eot?#iefix') format('embedded-opentype'), url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/93/artill_clean_icons-webfont.woff') format('woff'), url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/93/artill_clean_icons-webfont.ttf') format('truetype'), url('https://s3-us-west-2.amazonaws.com/s.cdpn.io/93/artill_clean_icons-webfont.svg#artill_clean_weather_iconsRg') format('svg'); font-weight: normal; font-style: normal; } .weatherInformation { .weather { font-size: 40px; text-align: center; i { font-family: weather; font-size: 100px; font-weight: normal; font-style: normal; line-height: 1.0; text-transform: initial; &[class=icon0]:before { content: ":"; } &[class=icon1]:before { content: "p"; } &[class=icon2]:before { content: "S"; } &[class=icon3]:before { content: "Q"; } &[class=icon4]:before { content: "S"; } &[class=icon5]:before { content: "W"; } &[class=icon6]:before { content: "W"; } &[class=icon7]:before { content: "W"; } &[class=icon8]:before { content: "W"; } &[class=icon9]:before { content: "I"; } &[class=icon10]:before { content: "W"; } &[class=icon11]:before { content: "I"; } &[class=icon12]:before { content: "I"; } &[class=icon13]:before { content: "I"; } &[class=icon14]:before { content: "I"; } &[class=icon15]:before { content: "W"; } &[class=icon16]:before { content: "I"; } &[class=icon17]:before { content: "W"; } &[class=icon18]:before { content: "U"; } &[class=icon19]:before { content: "Z"; } &[class=icon20]:before { content: "Z"; } &[class=icon21]:before { content: "Z"; } &[class=icon22]:before { content: "Z"; } &[class=icon23]:before { content: "Z"; } &[class=icon24]:before { content: "E"; } &[class=icon25]:before { content: "E"; } &[class=icon26]:before { content: "3"; } &[class=icon27]:before { content: "a"; } &[class=icon28]:before { content: "A"; } &[class=icon29]:before { content: "a"; } &[class=icon30]:before { content: "A"; } &[class=icon31]:before { content: "6"; } &[class=icon32]:before { content: "1"; } &[class=icon33]:before { content: "6"; } &[class=icon34]:before { content: "1"; } &[class=icon35]:before { content: "W"; } &[class=icon36]:before { content: "1"; } &[class=icon37]:before { content: "S"; } &[class=icon38]:before { content: "S"; } &[class=icon39]:before { content: "S"; } &[class=icon40]:before { content: "M"; } &[class=icon41]:before { content: "W"; } &[class=icon42]:before { content: "I"; } &[class=icon43]:before { content: "W"; } &[class=icon44]:before { content: "a"; } &[class=icon45]:before { content: "S"; } &[class=icon46]:before { content: "U"; } &[class=icon47]:before { content: "S"; } } .location { font-size: 0.5em; padding-bottom: 0.2em; } } } ================================================ FILE: source/react-weather/src/webparts/weather/components/Weather.tsx ================================================ import * as React from 'react'; import styles from './Weather.module.scss'; import { Placeholder } from "@pnp/spfx-controls-react/lib/Placeholder"; import { Spinner, SpinnerSize } from '@fluentui/react/lib/Spinner'; import { HttpClientResponse, HttpClient } from '@microsoft/sp-http'; import { IWeatherState, IWeatherData, IWeatherProps, IWeatherCondition, IWeatherLocation, IWeatherDescription } from '.'; import * as strings from 'WeatherWebPartStrings'; export default class Weather extends React.Component < IWeatherProps, IWeatherState > { constructor(props: IWeatherProps) { super(props); this.state = { loading: false }; } /** * Loads weather information for the specified location from a third party API * @param location Location for which to load weather information * @param unit Unit to display the current temperature. * @param apikey API key to authenticate the API call */ private _loadWeatherInfo(location: string, unit: string, apikey: string): void { // notify the user that the component will load its data this.setState({ loading: true }); let coord: IWeatherLocation; let weather: IWeatherDescription; let main: IWeatherCondition; let timezone: number; let name: string; // retrieve weather information from the OpenWeatherMap weather API this.props.httpClient .get(`https://api.openweathermap.org/data/2.5/weather?q=${location}&appid=${apikey}`, HttpClient.configurations.v1) .then((response: HttpClientResponse): Promise => { return response.json(); }) .then((data: IWeatherData): void => { if (data) { coord = data.coord; weather = data.weather[0]; main = data.main; timezone = data.timezone; name = data.name; this.setState({ loading: false, coord: coord, weather: weather, main: main, timezone: timezone, name: name }); } else { // No weather information for the specified location has been found. // Notify the user that loading the data is finished. this.setState({ loading: false, coord: null, weather: null, main: null, timezone: null, name: null }); // Return an error message stating that no weather information has been found this.props.errorHandler(`${strings.NoWeatherInformationFoundMessage}${location}`); } }, (error: any): void => { // An error has occurred when calling the weather API. // Notify the user that loading the data is finished this.setState({ loading: false, coord: null, weather: null, main: null, timezone: null, name: null }); // Return the error message this.props.errorHandler(error); }) .catch((error: any): void => { // An exception has occurred when calling the weather API. // Notify the user that loading the data is finished this.setState({ loading: false, coord: null, weather: null, main: null, timezone: null, name: null }); // Return the exception message this.props.errorHandler(error); }); } public componentDidMount(): void { if (!this.props.needsConfiguration) { // The web part has been configured. Load the weather information // for the specified location. this._loadWeatherInfo(this.props.location, this.props.unit, this.props.apikey); } } public componentWillReceiveProps(nextProps: IWeatherProps): void { // If the location or the temperature unit have changed, // refresh the weather information if (nextProps.location && nextProps.unit) { this._loadWeatherInfo(nextProps.location, nextProps.unit, nextProps.apikey); } } public render(): React.ReactElement { let contents: JSX.Element; // Check if the web part has been configured. Also check, // if the weather information has been initiated. This is // necessary, because the first time the component renders, // it's not loading its data but there is also no weather // information available yet if (this.props.needsConfiguration === false && this.state.weather) { if (this.state.loading) { // Component is loading its data. Show spinner to communicate this to the user contents = ; } else { // render the retrieved weather information const weather: IWeatherDescription = this.state.weather; const location: IWeatherLocation = this.state.coord; console.log(location) const main: IWeatherCondition = this.state.main; const name: string = this.state.name; const image: any = 'http://openweathermap.org/img/w/' + weather.icon + '.png'; const tempUnit: string = this.props.unit.toUpperCase(); let tempValue: number = 0; // Convert temperature to selected unit scale if(tempUnit === 'C') { tempValue = main.temp - 273.16; } else { tempValue = (main.temp * 1.8) - 459.67; } contents = (
{Math.round(tempValue)}°{tempUnit}
{name}
); } } return (
{this.props.needsConfiguration && // The web part hasn't been configured yet. // Show a placeholder to have the user configure the web part } {contents}
); } } ================================================ FILE: source/react-weather/src/webparts/weather/components/index.ts ================================================ export * from './IWeatherData'; export * from './IWeatherProps'; export * from './IWeatherState'; export * from './Weather'; ================================================ FILE: source/react-weather/src/webparts/weather/loc/en-us.js ================================================ define([], function() { return { "PropertyPaneDescription": "Weather", "DataGroupName": "Data", "LocationFieldLabel": "Add a location", "UnitFieldLabel": "Display temperature as", "UnitFieldCelsius": "Celsius", "UnitFieldFahrenheit": "Fahrenheit", "ConfigGroupName": "Configuration", "ApiKeyFieldLabel": "API Key", "NoWeatherInformationFoundMessage": "No weather information found for ", "LoadingSpinnerLabel": "Loading weather information...", "PlaceholderIconText": "Configure your web part", "PlaceholderDescription": "Please configure the web part.", "PlaceholderButtonLabel": "Configure", "LocationNotSpecifiedError": "Specify a location", "LocationDoubleQuoteNotAllowed": "\" (double quote) is not allowed in the location name" } }); ================================================ FILE: source/react-weather/src/webparts/weather/loc/mystrings.d.ts ================================================ declare interface IWeatherWebPartStrings { PropertyPaneDescription: string; DataGroupName: string; LocationFieldLabel: string; UnitFieldLabel: string; UnitFieldCelsius: string; UnitFieldFahrenheit: string; ConfigGroupName: string; ApiKeyFieldLabel: string; NoWeatherInformationFoundMessage: string; LoadingSpinnerLabel: string; PlaceholderIconText: string; PlaceholderDescription: string; PlaceholderButtonLabel: string; LocationNotSpecifiedError: string; LocationDoubleQuoteNotAllowed: string; } declare module 'WeatherWebPartStrings' { const strings: IWeatherWebPartStrings; export = strings; } ================================================ FILE: source/react-weather/tsconfig.json ================================================ { "extends": "./node_modules/@microsoft/rush-stack-compiler-4.5/includes/tsconfig-web.json", "compilerOptions": { "target": "es5", "forceConsistentCasingInFileNames": true, "module": "esnext", "moduleResolution": "node", "jsx": "react", "declaration": true, "sourceMap": true, "experimentalDecorators": true, "noUnusedLocals": false, "skipLibCheck": true, "outDir": "lib", "inlineSources": false, "strictNullChecks": false, "noImplicitAny": true, "typeRoots": [ "./node_modules/@types", "./node_modules/@microsoft" ], "types": [ "webpack-env" ], "lib": [ "es5", "dom", "es2015.collection", "es2015.promise" ] }, "include": [ "src/**/*.ts", "src/**/*.tsx" ], "exclude": [ "node_modules", "lib" ] } ================================================ FILE: source/react-world-clock/.editorconfig ================================================ # EditorConfig helps developers define and maintain consistent # coding styles between different editors and IDEs # editorconfig.org root = true [*] # change these settings to your own preference indent_style = space indent_size = 2 # we recommend you to keep these unchanged end_of_line = lf charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true [*.md] trim_trailing_whitespace = false [{package,bower}.json] indent_style = space indent_size = 2 ================================================ FILE: source/react-world-clock/.eslintrc.js ================================================ require('@rushstack/eslint-config/patch/modern-module-resolution'); module.exports = { extends: ['@microsoft/eslint-config-spfx/lib/profiles/react'], parserOptions: { tsconfigRootDir: __dirname }, overrides: [ { files: ['*.ts', '*.tsx'], parser: '@typescript-eslint/parser', 'parserOptions': { 'project': './tsconfig.json', 'ecmaVersion': 2018, 'sourceType': 'module' }, rules: { // Prevent usage of the JavaScript null value, while allowing code to access existing APIs that may require null. https://www.npmjs.com/package/@rushstack/eslint-plugin '@rushstack/no-new-null': 1, // Require Jest module mocking APIs to be called before any other statements in their code block. https://www.npmjs.com/package/@rushstack/eslint-plugin '@rushstack/hoist-jest-mock': 1, // Require regular expressions to be constructed from string constants rather than dynamically building strings at runtime. https://www.npmjs.com/package/@rushstack/eslint-plugin-security '@rushstack/security/no-unsafe-regexp': 1, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/adjacent-overload-signatures': 1, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // // CONFIGURATION: By default, these are banned: String, Boolean, Number, Object, Symbol '@typescript-eslint/ban-types': [ 1, { 'extendDefaults': false, 'types': { 'String': { 'message': 'Use \'string\' instead', 'fixWith': 'string' }, 'Boolean': { 'message': 'Use \'boolean\' instead', 'fixWith': 'boolean' }, 'Number': { 'message': 'Use \'number\' instead', 'fixWith': 'number' }, 'Object': { 'message': 'Use \'object\' instead, or else define a proper TypeScript type:' }, 'Symbol': { 'message': 'Use \'symbol\' instead', 'fixWith': 'symbol' }, 'Function': { 'message': 'The \'Function\' type accepts any function-like value.\nIt provides no type safety when calling the function, which can be a common source of bugs.\nIt also accepts things like class declarations, which will throw at runtime as they will not be called with \'new\'.\nIf you are expecting the function to accept certain arguments, you should explicitly define the function shape.' } } } ], // RATIONALE: Code is more readable when the type of every variable is immediately obvious. // Even if the compiler may be able to infer a type, this inference will be unavailable // to a person who is reviewing a GitHub diff. This rule makes writing code harder, // but writing code is a much less important activity than reading it. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/explicit-function-return-type': [ 1, { 'allowExpressions': true, 'allowTypedFunctionExpressions': true, 'allowHigherOrderFunctions': false } ], // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // Rationale to disable: although this is a recommended rule, it is up to dev to select coding style. // Set to 1 (warning) or 2 (error) to enable. '@typescript-eslint/explicit-member-accessibility': 0, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/no-array-constructor': 1, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // // RATIONALE: The "any" keyword disables static type checking, the main benefit of using TypeScript. // This rule should be suppressed only in very special cases such as JSON.stringify() // where the type really can be anything. Even if the type is flexible, another type // may be more appropriate such as "unknown", "{}", or "Record". '@typescript-eslint/no-explicit-any': 1, // RATIONALE: The #1 rule of promises is that every promise chain must be terminated by a catch() // handler. Thus wherever a Promise arises, the code must either append a catch handler, // or else return the object to a caller (who assumes this responsibility). Unterminated // promise chains are a serious issue. Besides causing errors to be silently ignored, // they can also cause a NodeJS process to terminate unexpectedly. '@typescript-eslint/no-floating-promises': 2, // RATIONALE: Catches a common coding mistake. '@typescript-eslint/no-for-in-array': 2, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/no-misused-new': 2, // RATIONALE: The "namespace" keyword is not recommended for organizing code because JavaScript lacks // a "using" statement to traverse namespaces. Nested namespaces prevent certain bundler // optimizations. If you are declaring loose functions/variables, it's better to make them // static members of a class, since classes support property getters and their private // members are accessible by unit tests. Also, the exercise of choosing a meaningful // class name tends to produce more discoverable APIs: for example, search+replacing // the function "reverse()" is likely to return many false matches, whereas if we always // write "Text.reverse()" is more unique. For large scale organization, it's recommended // to decompose your code into separate NPM packages, which ensures that component // dependencies are tracked more conscientiously. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/no-namespace': [ 1, { 'allowDeclarations': false, 'allowDefinitionFiles': false } ], // RATIONALE: Parameter properties provide a shorthand such as "constructor(public title: string)" // that avoids the effort of declaring "title" as a field. This TypeScript feature makes // code easier to write, but arguably sacrifices readability: In the notes for // "@typescript-eslint/member-ordering" we pointed out that fields are central to // a class's design, so we wouldn't want to bury them in a constructor signature // just to save some typing. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // Set to 1 (warning) or 2 (error) to enable the rule '@typescript-eslint/no-parameter-properties': 0, // RATIONALE: When left in shipping code, unused variables often indicate a mistake. Dead code // may impact performance. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/no-unused-vars': [ 1, { 'vars': 'all', // Unused function arguments often indicate a mistake in JavaScript code. However in TypeScript code, // the compiler catches most of those mistakes, and unused arguments are fairly common for type signatures // that are overriding a base class method or implementing an interface. 'args': 'none' } ], // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/no-use-before-define': [ 2, { 'functions': false, 'classes': true, 'variables': true, 'enums': true, 'typedefs': true } ], // Disallows require statements except in import statements. // In other words, the use of forms such as var foo = require("foo") are banned. Instead use ES6 style imports or import foo = require("foo") imports. '@typescript-eslint/no-var-requires': 'error', // RATIONALE: The "module" keyword is deprecated except when describing legacy libraries. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json '@typescript-eslint/prefer-namespace-keyword': 1, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // Rationale to disable: it's up to developer to decide if he wants to add type annotations // Set to 1 (warning) or 2 (error) to enable the rule '@typescript-eslint/no-inferrable-types': 0, // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json // Rationale to disable: declaration of empty interfaces may be helpful for generic types scenarios '@typescript-eslint/no-empty-interface': 0, '@typescript-eslint/no-explicit-any': 0, // RATIONALE: This rule warns if setters are defined without getters, which is probably a mistake. 'accessor-pairs': 1, // RATIONALE: In TypeScript, if you write x["y"] instead of x.y, it disables type checking. 'dot-notation': [ 1, { 'allowPattern': '^_' } ], // RATIONALE: Catches code that is likely to be incorrect 'eqeqeq': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'for-direction': 1, // RATIONALE: Catches a common coding mistake. 'guard-for-in': 2, // RATIONALE: If you have more than 2,000 lines in a single source file, it's probably time // to split up your code. 'max-lines': ['warn', { max: 2000 }], // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-async-promise-executor': 2, // RATIONALE: Deprecated language feature. 'no-caller': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-compare-neg-zero': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-cond-assign': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-constant-condition': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-control-regex': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-debugger': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-delete-var': 2, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-duplicate-case': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-empty': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-empty-character-class': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-empty-pattern': 1, // RATIONALE: Eval is a security concern and a performance concern. 'no-eval': 1, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-ex-assign': 2, // RATIONALE: System types are global and should not be tampered with in a scalable code base. // If two different libraries (or two versions of the same library) both try to modify // a type, only one of them can win. Polyfills are acceptable because they implement // a standardized interoperable contract, but polyfills are generally coded in plain // JavaScript. 'no-extend-native': 1, // Disallow unnecessary labels 'no-extra-label': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-fallthrough': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-func-assign': 1, // RATIONALE: Catches a common coding mistake. 'no-implied-eval': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-invalid-regexp': 2, // RATIONALE: Catches a common coding mistake. 'no-label-var': 2, // RATIONALE: Eliminates redundant code. 'no-lone-blocks': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-misleading-character-class': 2, // RATIONALE: Catches a common coding mistake. 'no-multi-str': 2, // RATIONALE: It's generally a bad practice to call "new Thing()" without assigning the result to // a variable. Either it's part of an awkward expression like "(new Thing()).doSomething()", // or else implies that the constructor is doing nontrivial computations, which is often // a poor class design. 'no-new': 1, // RATIONALE: Obsolete language feature that is deprecated. 'no-new-func': 2, // RATIONALE: Obsolete language feature that is deprecated. 'no-new-object': 2, // RATIONALE: Obsolete notation. 'no-new-wrappers': 1, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-octal': 2, // RATIONALE: Catches code that is likely to be incorrect 'no-octal-escape': 2, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-regex-spaces': 2, // RATIONALE: Catches a common coding mistake. 'no-return-assign': 2, // RATIONALE: Security risk. 'no-script-url': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-self-assign': 2, // RATIONALE: Catches a common coding mistake. 'no-self-compare': 2, // RATIONALE: This avoids statements such as "while (a = next(), a && a.length);" that use // commas to create compound expressions. In general code is more readable if each // step is split onto a separate line. This also makes it easier to set breakpoints // in the debugger. 'no-sequences': 1, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-shadow-restricted-names': 2, // RATIONALE: Obsolete language feature that is deprecated. // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-sparse-arrays': 2, // RATIONALE: Although in theory JavaScript allows any possible data type to be thrown as an exception, // such flexibility adds pointless complexity, by requiring every catch block to test // the type of the object that it receives. Whereas if catch blocks can always assume // that their object implements the "Error" contract, then the code is simpler, and // we generally get useful additional information like a call stack. 'no-throw-literal': 2, // RATIONALE: Catches a common coding mistake. 'no-unmodified-loop-condition': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-unsafe-finally': 2, // RATIONALE: Catches a common coding mistake. 'no-unused-expressions': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-unused-labels': 1, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-useless-catch': 1, // RATIONALE: Avoids a potential performance problem. 'no-useless-concat': 1, // RATIONALE: The "var" keyword is deprecated because of its confusing "hoisting" behavior. // Always use "let" or "const" instead. // // STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json 'no-var': 2, // RATIONALE: Generally not needed in modern code. 'no-void': 1, // RATIONALE: Obsolete language feature that is deprecated. // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'no-with': 2, // RATIONALE: Makes logic easier to understand, since constants always have a known value // @typescript-eslint\eslint-plugin\dist\configs\eslint-recommended.js 'prefer-const': 1, // RATIONALE: Catches a common coding mistake where "resolve" and "reject" are confused. 'promise/param-names': 2, // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'require-atomic-updates': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'require-yield': 1, // "Use strict" is redundant when using the TypeScript compiler. 'strict': [ 2, 'never' ], // RATIONALE: Catches code that is likely to be incorrect // STANDARDIZED BY: eslint\conf\eslint-recommended.js 'use-isnan': 2, // STANDARDIZED BY: eslint\conf\eslint-recommended.js // Set to 1 (warning) or 2 (error) to enable. // Rationale to disable: !!{} 'no-extra-boolean-cast': 0, 'react/self-closing-comp': 0, // ==================================================================== // @microsoft/eslint-plugin-spfx // ==================================================================== '@microsoft/spfx/import-requires-chunk-name': 1, '@microsoft/spfx/no-require-ensure': 2, '@microsoft/spfx/pair-react-dom-render-unmount': 0 } }, { // For unit tests, we can be a little bit less strict. The settings below revise the // defaults specified in the extended configurations, as well as above. files: [ // Test files '*.test.ts', '*.test.tsx', '*.spec.ts', '*.spec.tsx', // Facebook convention '**/__mocks__/*.ts', '**/__mocks__/*.tsx', '**/__tests__/*.ts', '**/__tests__/*.tsx', // Microsoft convention '**/test/*.ts', '**/test/*.tsx' ], rules: {} } ] }; ================================================ FILE: source/react-world-clock/.gitignore ================================================ # Logs logs *.log npm-debug.log* # Dependency directories node_modules # Build generated files dist lib release solution temp *.sppkg .heft # Coverage directory used by tools like istanbul coverage # OSX .DS_Store # Visual Studio files .ntvs_analysis.dat .vs bin obj # Resx Generated Code *.resx.ts # Styles Generated Code *.scss.ts ================================================ FILE: source/react-world-clock/.npmignore ================================================ !dist config gulpfile.js release src temp tsconfig.json tslint.json *.log .yo-rc.json .vscode ================================================ FILE: source/react-world-clock/.vscode/launch.json ================================================ { "version": "0.2.0", "configurations": [ { "name": "Hosted workbench", "type": "pwa-chrome", "request": "launch", "url": "https://enter-your-SharePoint-site/_layouts/workbench.aspx", "webRoot": "${workspaceRoot}", "sourceMaps": true, "sourceMapPathOverrides": { "webpack:///.././src/*": "${webRoot}/src/*", "webpack:///../../../src/*": "${webRoot}/src/*", "webpack:///../../../../src/*": "${webRoot}/src/*", "webpack:///../../../../../src/*": "${webRoot}/src/*" }, "runtimeArgs": [ "--remote-debugging-port=9222", "-incognito" ] } ] } ================================================ FILE: source/react-world-clock/.vscode/settings.json ================================================ // Place your settings in this file to overwrite default and user settings. { // Configure glob patterns for excluding files and folders in the file explorer. "files.exclude": { "**/.git": true, "**/.DS_Store": true, "**/bower_components": true, "**/coverage": true, "**/lib-amd": true, "src/**/*.scss.ts": true }, "typescript.tsdk": ".\\node_modules\\typescript\\lib" } ================================================ FILE: source/react-world-clock/.yo-rc.json ================================================ { "@microsoft/generator-sharepoint": { "plusBeta": false, "isCreatingSolution": true, "nodeVersion": "14.15.1", "sdksVersions": { "@microsoft/microsoft-graph-client": "3.0.2", "@microsoft/teams-js": "2.4.1" }, "version": "1.16.1", "environment": "spo", "libraryName": "world-clock", "libraryId": "55d6757f-94de-4bde-95bf-f8802db4a8f4", "packageManager": "npm", "componentType": "webpart" } } ================================================ FILE: source/react-world-clock/README.md ================================================ # World Time web part This web part provides you the ability to display basic clock for a given time zone on a web page. The clock is based on the user's workstation time with an offset from UTC to the selected time zone. ![World Time](../../assets/images/components/part-world-time.gif) ## How to use this web part on your web pages 1. Place the page you want to add this web part to in edit mode. 2. Search for and insert the **World Time** web part. 3. Configure the web part to update its properties. ## Configurable Properties The `World Time` web part can be configured with the following properties: | Label | Property | Type | Required | Description | | ---- | ---- | ---- | ---- | ---- | | Description | description | string | no | Default: UTC Time - The clock description | | Time Zone | timeZoneOffset | number | no | Default: 0 - The clock offset where 0 = UTC, -8 = PST (UTC−08:00), etc | ## Installing the web part See getting started from [SP-Starter-Kit repository readme](https://github.com/SharePoint/sp-starter-kit). You can also download just the [SharePoint Framework solution package (spppkg) file](https://github.com/SharePoint/sp-starter-kit/blob/master/package/sharepoint-starter-kit.sppkg) and install that to your tenant. ## Screenshots ![World Time](../../assets/images/components/part-world-time.png) ## Used SharePoint Framework Version ![drop](https://img.shields.io/badge/version-1.16.1-green.svg) * Supported in SharePoint Online ## Applies to * [SharePoint Framework](https://learn.microsoft.com/en-us/sharepoint/dev/spfx/sharepoint-framework-overview) * [Office 365 tenant](https://learn.microsoft.com/en-us/sharepoint/dev/spfx/set-up-your-development-environment) ## Prerequisites none ## Solution Solution|Author(s) --------|--------- react-world-clock | Dragan Panjkov (@panjkov) react-world-clock | Chandani Prajapati (@Chandani_SPD) ## Version history Version|Date|Comments -------|----|-------- 1.0|January 5, 2020|Initial release (extract web part from Starter Kit v1) 3.0|February 2023|Initial release for SharePoint Starter Kit v3 (Upgraded to SPFx 1.16.1) ## Disclaimer **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.** --- ## Minimal Path to Awesome * Clone this repository * Move to solution folder * in the command line run: * `npm install` * `gulp serve` > Include any additional steps as needed. ## Features Description of the web part with possible additional details than in short summary. This Web Part illustrates the following concepts on top of the SharePoint Framework: * Use of SVG and CSS rotation to display a ticking clock ================================================ FILE: source/react-world-clock/config/config.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/config.2.0.schema.json", "version": "2.0", "bundles": { "world-clock-web-part": { "components": [ { "entrypoint": "./lib/webparts/worldClock/WorldClockWebPart.js", "manifest": "./src/webparts/worldClock/WorldClockWebPart.manifest.json" } ] } }, "externals": {}, "localizedResources": { "WorldClockWebPartStrings": "lib/webparts/worldClock/loc/{locale}.js" } } ================================================ FILE: source/react-world-clock/config/deploy-azure-storage.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/deploy-azure-storage.schema.json", "workingDir": "./release/assets/", "account": "", "container": "world-clock", "accessKey": "" } ================================================ FILE: source/react-world-clock/config/package-solution.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/package-solution.schema.json", "solution": { "name": "Starter Kit - World Clock", "id": "55d6757f-94de-4bde-95bf-f8802db4a8f4", "version": "3.0.0.0", "includeClientSideAssets": true, "skipFeatureDeployment": true, "isDomainIsolated": false, "developer": { "name": "PnP Starter Kit", "privacyUrl": "", "termsOfUseUrl": "", "websiteUrl": "", "mpnId": "pnpsk" }, "metadata": { "shortDescription": { "default": "world-clock description" }, "longDescription": { "default": "world-clock description" }, "screenshotPaths": [], "videoUrl": "", "categories": [] }, "features": [ { "title": "Starter Kit - World Clock webpart Feature", "description": "The feature that activates World Clock WebPart from the Starter Kit - World Clock solution.", "id": "7d2fb8db-010c-41d1-a464-e98b80e87647", "version": "3.0.0.0", "componentIds": [ "7d2fb8db-010c-41d1-a464-e98b80e87647" ] } ] }, "paths": { "zippedPackage": "solution/react-world-clock.sppkg" } } ================================================ FILE: source/react-world-clock/config/sass.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/core-build/sass.schema.json" } ================================================ FILE: source/react-world-clock/config/serve.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/spfx-serve.schema.json", "port": 4321, "https": true, "initialPage": "https://enter-your-SharePoint-site/_layouts/workbench.aspx" } ================================================ FILE: source/react-world-clock/config/write-manifests.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/write-manifests.schema.json", "cdnBasePath": "" } ================================================ FILE: source/react-world-clock/gulpfile.js ================================================ 'use strict'; const build = require('@microsoft/sp-build-web'); build.addSuppression(`Warning - [sass] The local CSS class 'ms-Grid' is not camelCase and will not be type-safe.`); var getTasks = build.rig.getTasks; build.rig.getTasks = function () { var result = getTasks.call(build.rig); result.set('serve', result.get('serve-deprecated')); return result; }; build.initialize(require('gulp')); ================================================ FILE: source/react-world-clock/package.json ================================================ { "name": "react-world-clock", "version": "3.0.0", "private": true, "main": "lib/index.js", "engines": { "node": ">=16.13.0 <17.0.0" }, "scripts": { "build": "gulp bundle", "clean": "gulp clean", "test": "gulp test" }, "dependencies": { "tslib": "2.3.1", "react": "17.0.1", "react-dom": "17.0.1", "@microsoft/sp-core-library": "1.16.1", "@microsoft/sp-property-pane": "1.16.1", "@microsoft/sp-webpart-base": "1.16.1", "@microsoft/sp-lodash-subset": "1.16.1", "@microsoft/sp-office-ui-fabric-core": "1.16.1" }, "resolutions": { "@types/react": "16.8.8" }, "devDependencies": { "@microsoft/rush-stack-compiler-4.5": "0.2.2", "@rushstack/eslint-config": "2.5.1", "@microsoft/eslint-plugin-spfx": "1.16.1", "@microsoft/eslint-config-spfx": "1.16.1", "@microsoft/sp-build-web": "1.16.1", "@types/webpack-env": "~1.15.2", "ajv": "^6.12.5", "gulp": "4.0.2", "typescript": "4.5.5", "@types/react": "17.0.45", "@types/react-dom": "17.0.17", "eslint-plugin-react-hooks": "4.3.0", "@microsoft/sp-module-interfaces": "1.16.1" } } ================================================ FILE: source/react-world-clock/src/index.ts ================================================ // A file is required to be in the root of the /src directory by the TypeScript compiler ================================================ FILE: source/react-world-clock/src/webparts/worldClock/IWorldClockWebPartProps.ts ================================================ export interface IWorldClockWebPartProps { description: string; timeZoneOffset: number; } ================================================ FILE: source/react-world-clock/src/webparts/worldClock/WorldClockWebPart.manifest.json ================================================ { "$schema": "https://developer.microsoft.com/json-schemas/spfx/client-side-web-part-manifest.schema.json", "id": "7d2fb8db-010c-41d1-a464-e98b80e87647", "alias": "WorldClockWebPart", "componentType": "WebPart", // The "*" signifies that the version should be taken from the package.json "version": "*", "manifestVersion": 2, "supportedHosts": ["SharePointWebPart", "TeamsPersonalApp", "TeamsTab", "SharePointFullPage"], // 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": "World Clock" }, "description": { "default": "Time across the world" }, "officeFabricIconFontName": "WorldClock", "properties": { "description": "UTC Time", "timeZoneOffset": 0 } }] } ================================================ FILE: source/react-world-clock/src/webparts/worldClock/WorldClockWebPart.ts ================================================ import * as React from 'react'; import * as ReactDom from 'react-dom'; import { Version } from '@microsoft/sp-core-library'; import { BaseClientSideWebPart } from "@microsoft/sp-webpart-base"; import { IPropertyPaneConfiguration, PropertyPaneTextField, PropertyPaneDropdown, IPropertyPaneDropdownOption } from "@microsoft/sp-property-pane"; import * as strings from 'WorldClockWebPartStrings'; import WorldClock from './components/WorldClock'; import { IWorldClockProps } from './components/IWorldClockProps'; import {IWorldClockWebPartProps} from './IWorldClockWebPartProps'; import * as timeZones from './components/Timezones'; export default class WorldClockWebPart extends BaseClientSideWebPart { public render(): void { const element: React.ReactElement = React.createElement( WorldClock, { description: this.properties.description, timeZoneOffset: this.properties.timeZoneOffset, errorHandler: (errorMessage: string) => { this.context.statusRenderer.renderError(this.domElement, errorMessage); } } ); ReactDom.render(element, this.domElement); } // protected onDispose(): void { // ReactDom.unmountComponentAtNode(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 }), PropertyPaneDropdown('timeZoneOffset', { label: strings.TimeZoneOffsetFieldLabel, options: this.getTimeZones() }) ] } ] } ] }; } private getTimeZones(): Array { const result: Array = new Array(); for (const tz of timeZones.TimeZones.zones) { result.push({ key: tz.id, text: tz.displayName}); } return(result); } } ================================================ FILE: source/react-world-clock/src/webparts/worldClock/components/Clock.module.scss ================================================ @import '~@fluentui/react/dist/sass/References.scss'; @import url('https://fonts.googleapis.com/css?family=Roboto'); .clockContainer { position: relative; width: 20%; overflow: hidden; background: #fff; margin-left: auto; margin-right: auto; display: block; &.styling{ box-shadow: 0px 0px 10px #888888; border-radius: 50%; min-width: 100px; margin-top: 1%; } &:before { content: ""; display: block; padding-top: 100%; } } .clockContent { position: absolute; top: 0; left: 0; bottom: 0; right: 0; display: flex; justify-content: center; align-items: center; .backgroundNumbers { position: absolute; width: 90%; height: 90%; top: 5%; left: 5%; z-index: 1; .numbers { fill: grey; } } .indicator { border-radius: 10px; transform-origin: bottom; outline: 1px solid transparent; // Firefox fix on rotation position: absolute; bottom: 50%; &.secondsIndicator { width: 0.5%; height: 37.5%; z-index: 2; background-color: #dfc48c; &.transitionEffect { } } &.minutesIndicator { width: 1%; height: 30%; z-index: 3; background-color: #cd6a51; &.transitionEffect { } } &.hoursIndicator { width: 1.5%; height: 22.5%; z-index: 4; background-color: #8f9c6c; &.transitionEffect { } } } .indicatorCover { position: absolute; bottom: 48.5%; /*(50% - (3% /2)) */ border-radius: 50%; width: 3%; height: 3%; background-color: lightgrey; z-index: 5; } } .digital { color: $ms-color-black; font-size: 15px; margin-top: 2%; text-align: center; } ================================================ FILE: source/react-world-clock/src/webparts/worldClock/components/Clock.tsx ================================================ import * as React from 'react'; import styles from './Clock.module.scss'; import { escape } from '@microsoft/sp-lodash-subset'; export interface IClockProps { // defines the timeZone offset in minutes from UTC timeZoneOffset?: number; } export interface IClockState { date: Date; } export class Clock extends React.Component { private _timerID: number; constructor(props: IClockProps) { super(props); this.state = { date: this.getDateTimeWithOffset() }; } public componentDidMount(): void { this._timerID = setInterval(() => this.tick(), 1000); } public componentWillUnmount(): void { clearInterval(this._timerID); } public render(): React.ReactElement { const hoursDegrees: number = this.state.date.getHours() * 30 + this.state.date.getMinutes() / 2; const minutesDegrees: number = this.state.date.getMinutes() * 6 + this.state.date.getSeconds() / 10; const secondsDegrees: number = this.state.date.getSeconds() * 6; const divStyleHours: any = { transform: "rotateZ(" + hoursDegrees + "deg)" }; const divStyleMinutes: any = { transform: "rotateZ(" + minutesDegrees + "deg)" }; const divStyleSeconds: any = { transform: "rotateZ(" + secondsDegrees + "deg)" }; return (
{escape(this.state.date.toLocaleTimeString())}
); } private tick(): void { this.setState({ date: this.getDateTimeWithOffset() }); } // this method converts the current date and time into the right time zone, based on the offset configured in the properties private getDateTimeWithOffset(): Date { const now: Date = new Date(); // on Jan 01 of the current year there is no DST const withoutDSTDate: Date = new Date(now.getFullYear(), 0, 1); // on Jul 01 of the current year there is DST const withDSTDate: Date = new Date(now.getFullYear(), 6, 1); // determine if now there is DST const isDST: boolean = now.getTimezoneOffset() < Math.max(withoutDSTDate.getTimezoneOffset(), withDSTDate.getTimezoneOffset()); // convert now to UTC const utcNow: Date = new Date(now.getTime() + now.getTimezoneOffset() * 60000); // determine the final date and time, considering DST, too const dateTimeWithOffset: Date = new Date(utcNow.getTime() + (this.props.timeZoneOffset * 60000) + (isDST ? 60 * 60000 : 0)); return(dateTimeWithOffset); } } ================================================ FILE: source/react-world-clock/src/webparts/worldClock/components/IWorldClockProps.ts ================================================ export interface IWorldClockProps { description: string; timeZoneOffset: number; errorHandler: (errorMessage: string) => void; } ================================================ FILE: source/react-world-clock/src/webparts/worldClock/components/Timezones.ts ================================================ export interface ITimeZone { id: number; displayName: string; name: string; offsetMinutes: number; } export class TimeZones { public static zones: ITimeZone[] = [ { offsetMinutes: -720, name: 'Dateline Standard Time', id: 1, displayName: '(UTC-12:00) International Date Line West' }, { offsetMinutes: -660, name: 'UTC-11', id: 2, displayName: '(UTC-11:00) Coordinated Universal Time-11' }, { offsetMinutes: -600, name: 'Aleutian Standard Time', id: 3, displayName: '(UTC-10:00) Aleutian Islands' }, { offsetMinutes: -600, name: 'Hawaiian Standard Time', id: 4, displayName: '(UTC-10:00) Hawaii' }, { offsetMinutes: -570, name: 'Marquesas Standard Time', id: 5, displayName: '(UTC-09:30) Marquesas Islands' }, { offsetMinutes: -540, name: 'Alaskan Standard Time', id: 6, displayName: '(UTC-09:00) Alaska' }, { offsetMinutes: -540, name: 'UTC-09', id: 7, displayName: '(UTC-09:00) Coordinated Universal Time-09' }, { offsetMinutes: -480, name: 'Pacific Standard Time (Mexico)', id: 8, displayName: '(UTC-08:00) Baja California' }, { offsetMinutes: -480, name: 'UTC-08', id: 9, displayName: '(UTC-08:00) Coordinated Universal Time-08' }, { offsetMinutes: -480, name: 'Pacific Standard Time', id: 10, displayName: '(UTC-08:00) Pacific Time (US \u0026 Canada)' }, { offsetMinutes: -420, name: 'US Mountain Standard Time', id: 11, displayName: '(UTC-07:00) Arizona' }, { offsetMinutes: -420, name: 'Mountain Standard Time (Mexico)', id: 12, displayName: '(UTC-07:00) Chihuahua, La Paz, Mazatlan' }, { offsetMinutes: -420, name: 'Mountain Standard Time', id: 13, displayName: '(UTC-07:00) Mountain Time (US \u0026 Canada)' }, { offsetMinutes: -360, name: 'Central America Standard Time', id: 14, displayName: '(UTC-06:00) Central America' }, { offsetMinutes: -360, name: 'Central Standard Time', id: 15, displayName: '(UTC-06:00) Central Time (US \u0026 Canada)' }, { offsetMinutes: -360, name: 'Easter Island Standard Time', id: 16, displayName: '(UTC-06:00) Easter Island' }, { offsetMinutes: -360, name: 'Central Standard Time (Mexico)', id: 17, displayName: '(UTC-06:00) Guadalajara, Mexico City, Monterrey' }, { offsetMinutes: -360, name: 'Canada Central Standard Time', id: 18, displayName: '(UTC-06:00) Saskatchewan' }, { offsetMinutes: -300, name: 'SA Pacific Standard Time', id: 19, displayName: '(UTC-05:00) Bogota, Lima, Quito, Rio Branco' }, { offsetMinutes: -300, name: 'Eastern Standard Time (Mexico)', id: 20, displayName: '(UTC-05:00) Chetumal' }, { offsetMinutes: -300, name: 'Eastern Standard Time', id: 21, displayName: '(UTC-05:00) Eastern Time (US \u0026 Canada)' }, { offsetMinutes: -300, name: 'Haiti Standard Time', id: 22, displayName: '(UTC-05:00) Haiti' }, { offsetMinutes: -300, name: 'Cuba Standard Time', id: 23, displayName: '(UTC-05:00) Havana' }, { offsetMinutes: -300, name: 'US Eastern Standard Time', id: 24, displayName: '(UTC-05:00) Indiana (East)' }, { offsetMinutes: -300, name: 'Turks And Caicos Standard Time', id: 25, displayName: '(UTC-05:00) Turks and Caicos' }, { offsetMinutes: -240, name: 'Paraguay Standard Time', id: 26, displayName: '(UTC-04:00) Asuncion' }, { offsetMinutes: -240, name: 'Atlantic Standard Time', id: 27, displayName: '(UTC-04:00) Atlantic Time (Canada)' }, { offsetMinutes: -240, name: 'Venezuela Standard Time', id: 28, displayName: '(UTC-04:00) Caracas' }, { offsetMinutes: -240, name: 'Central Brazilian Standard Time', id: 29, displayName: '(UTC-04:00) Cuiaba' }, { offsetMinutes: -240, name: 'SA Western Standard Time', id: 30, displayName: '(UTC-04:00) Georgetown, La Paz, Manaus, San Juan' }, { offsetMinutes: -240, name: 'Pacific SA Standard Time', id: 31, displayName: '(UTC-04:00) Santiago' }, { offsetMinutes: -210, name: 'Newfoundland Standard Time', id: 32, displayName: '(UTC-03:30) Newfoundland' }, { offsetMinutes: -180, name: 'Tocantins Standard Time', id: 33, displayName: '(UTC-03:00) Araguaina' }, { offsetMinutes: -180, name: 'E. South America Standard Time', id: 34, displayName: '(UTC-03:00) Brasilia' }, { offsetMinutes: -180, name: 'SA Eastern Standard Time', id: 35, displayName: '(UTC-03:00) Cayenne, Fortaleza' }, { offsetMinutes: -180, name: 'Argentina Standard Time', id: 36, displayName: '(UTC-03:00) City of Buenos Aires' }, { offsetMinutes: -180, name: 'Greenland Standard Time', id: 37, displayName: '(UTC-03:00) Greenland' }, { offsetMinutes: -180, name: 'Montevideo Standard Time', id: 38, displayName: '(UTC-03:00) Montevideo' }, { offsetMinutes: -180, name: 'Magallanes Standard Time', id: 39, displayName: '(UTC-03:00) Punta Arenas' }, { offsetMinutes: -180, name: 'Saint Pierre Standard Time', id: 40, displayName: '(UTC-03:00) Saint Pierre and Miquelon' }, { offsetMinutes: -180, name: 'Bahia Standard Time', id: 41, displayName: '(UTC-03:00) Salvador' }, { offsetMinutes: -120, name: 'UTC-02', id: 42, displayName: '(UTC-02:00) Coordinated Universal Time-02' }, { offsetMinutes: -120, name: 'Mid-Atlantic Standard Time', id: 43, displayName: '(UTC-02:00) Mid-Atlantic - Old' }, { offsetMinutes: -60, name: 'Azores Standard Time', id: 44, displayName: '(UTC-01:00) Azores' }, { offsetMinutes: -60, name: 'Cape Verde Standard Time', id: 45, displayName: '(UTC-01:00) Cabo Verde Is.' }, { offsetMinutes: 0, name: 'UTC', id: 46, displayName: '(UTC) Coordinated Universal Time' }, { offsetMinutes: 0, name: 'Morocco Standard Time', id: 47, displayName: '(UTC+00:00) Casablanca' }, { offsetMinutes: 0, name: 'GMT Standard Time', id: 48, displayName: '(UTC+00:00) Dublin, Edinburgh, Lisbon, London' }, { offsetMinutes: 0, name: 'Greenwich Standard Time', id: 49, displayName: '(UTC+00:00) Monrovia, Reykjavik' }, { offsetMinutes: 60, name: 'W. Europe Standard Time', id: 50, displayName: '(UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna' }, { offsetMinutes: 60, name: 'Central Europe Standard Time', id: 51, displayName: '(UTC+01:00) Belgrade, Bratislava, Budapest, Ljubljana, Prague' }, { offsetMinutes: 60, name: 'Romance Standard Time', id: 52, displayName: '(UTC+01:00) Brussels, Copenhagen, Madrid, Paris' }, { offsetMinutes: 60, name: 'Central European Standard Time', id: 53, displayName: '(UTC+01:00) Sarajevo, Skopje, Warsaw, Zagreb' }, { offsetMinutes: 60, name: 'W. Central Africa Standard Time', id: 54, displayName: '(UTC+01:00) West Central Africa' }, { offsetMinutes: 120, name: 'Jordan Standard Time', id: 55, displayName: '(UTC+02:00) Amman' }, { offsetMinutes: 120, name: 'GTB Standard Time', id: 56, displayName: '(UTC+02:00) Athens, Bucharest' }, { offsetMinutes: 120, name: 'Middle East Standard Time', id: 57, displayName: '(UTC+02:00) Beirut' }, { offsetMinutes: 120, name: 'Egypt Standard Time', id: 58, displayName: '(UTC+02:00) Cairo' }, { offsetMinutes: 120, name: 'E. Europe Standard Time', id: 59, displayName: '(UTC+02:00) Chisinau' }, { offsetMinutes: 120, name: 'Syria Standard Time', id: 60, displayName: '(UTC+02:00) Damascus' }, { offsetMinutes: 120, name: 'West Bank Standard Time', id: 61, displayName: '(UTC+02:00) Gaza, Hebron' }, { offsetMinutes: 120, name: 'South Africa Standard Time', id: 62, displayName: '(UTC+02:00) Harare, Pretoria' }, { offsetMinutes: 120, name: 'FLE Standard Time', id: 63, displayName: '(UTC+02:00) Helsinki, Kyiv, Riga, Sofia, Tallinn, Vilnius' }, { offsetMinutes: 120, name: 'Israel Standard Time', id: 64, displayName: '(UTC+02:00) Jerusalem' }, { offsetMinutes: 120, name: 'Kaliningrad Standard Time', id: 65, displayName: '(UTC+02:00) Kaliningrad' }, { offsetMinutes: 120, name: 'Sudan Standard Time', id: 66, displayName: '(UTC+02:00) Khartoum' }, { offsetMinutes: 120, name: 'Libya Standard Time', id: 67, displayName: '(UTC+02:00) Tripoli' }, { offsetMinutes: 120, name: 'Namibia Standard Time', id: 68, displayName: '(UTC+02:00) Windhoek' }, { offsetMinutes: 180, name: 'Arabic Standard Time', id: 69, displayName: '(UTC+03:00) Baghdad' }, { offsetMinutes: 180, name: 'Turkey Standard Time', id: 70, displayName: '(UTC+03:00) Istanbul' }, { offsetMinutes: 180, name: 'Arab Standard Time', id: 71, displayName: '(UTC+03:00) Kuwait, Riyadh' }, { offsetMinutes: 180, name: 'Belarus Standard Time', id: 72, displayName: '(UTC+03:00) Minsk' }, { offsetMinutes: 180, name: 'Russian Standard Time', id: 73, displayName: '(UTC+03:00) Moscow, St. Petersburg, Volgograd' }, { offsetMinutes: 180, name: 'E. Africa Standard Time', id: 74, displayName: '(UTC+03:00) Nairobi' }, { offsetMinutes: 210, name: 'Iran Standard Time', id: 75, displayName: '(UTC+03:30) Tehran' }, { offsetMinutes: 240, name: 'Arabian Standard Time', id: 76, displayName: '(UTC+04:00) Abu Dhabi, Muscat' }, { offsetMinutes: 240, name: 'Astrakhan Standard Time', id: 77, displayName: '(UTC+04:00) Astrakhan, Ulyanovsk' }, { offsetMinutes: 240, name: 'Azerbaijan Standard Time', id: 78, displayName: '(UTC+04:00) Baku' }, { offsetMinutes: 240, name: 'Russia Time Zone 3', id: 79, displayName: '(UTC+04:00) Izhevsk, Samara' }, { offsetMinutes: 240, name: 'Mauritius Standard Time', id: 80, displayName: '(UTC+04:00) Port Louis' }, { offsetMinutes: 240, name: 'Saratov Standard Time', id: 81, displayName: '(UTC+04:00) Saratov' }, { offsetMinutes: 240, name: 'Georgian Standard Time', id: 82, displayName: '(UTC+04:00) Tbilisi' }, { offsetMinutes: 240, name: 'Caucasus Standard Time', id: 83, displayName: '(UTC+04:00) Yerevan' }, { offsetMinutes: 270, name: 'Afghanistan Standard Time', id: 84, displayName: '(UTC+04:30) Kabul' }, { offsetMinutes: 300, name: 'West Asia Standard Time', id: 85, displayName: '(UTC+05:00) Ashgabat, Tashkent' }, { offsetMinutes: 300, name: 'Ekaterinburg Standard Time', id: 86, displayName: '(UTC+05:00) Ekaterinburg' }, { offsetMinutes: 300, name: 'Pakistan Standard Time', id: 87, displayName: '(UTC+05:00) Islamabad, Karachi' }, { offsetMinutes: 330, name: 'India Standard Time', id: 88, displayName: '(UTC+05:30) Chennai, Kolkata, Mumbai, New Delhi' }, { offsetMinutes: 330, name: 'Sri Lanka Standard Time', id: 89, displayName: '(UTC+05:30) Sri Jayawardenepura' }, { offsetMinutes: 345, name: 'Nepal Standard Time', id: 90, displayName: '(UTC+05:45) Kathmandu' }, { offsetMinutes: 360, name: 'Central Asia Standard Time', id: 91, displayName: '(UTC+06:00) Astana' }, { offsetMinutes: 360, name: 'Bangladesh Standard Time', id: 92, displayName: '(UTC+06:00) Dhaka' }, { offsetMinutes: 360, name: 'Omsk Standard Time', id: 93, displayName: '(UTC+06:00) Omsk' }, { offsetMinutes: 390, name: 'Myanmar Standard Time', id: 94, displayName: '(UTC+06:30) Yangon (Rangoon)' }, { offsetMinutes: 420, name: 'SE Asia Standard Time', id: 95, displayName: '(UTC+07:00) Bangkok, Hanoi, Jakarta' }, { offsetMinutes: 420, name: 'Altai Standard Time', id: 96, displayName: '(UTC+07:00) Barnaul, Gorno-Altaysk' }, { offsetMinutes: 420, name: 'W. Mongolia Standard Time', id: 97, displayName: '(UTC+07:00) Hovd' }, { offsetMinutes: 420, name: 'North Asia Standard Time', id: 98, displayName: '(UTC+07:00) Krasnoyarsk' }, { offsetMinutes: 420, name: 'N. Central Asia Standard Time', id: 99, displayName: '(UTC+07:00) Novosibirsk' }, { offsetMinutes: 420, name: 'Tomsk Standard Time', id: 100, displayName: '(UTC+07:00) Tomsk' }, { offsetMinutes: 480, name: 'China Standard Time', id: 101, displayName: '(UTC+08:00) Beijing, Chongqing, Hong Kong, Urumqi' }, { offsetMinutes: 480, name: 'North Asia East Standard Time', id: 102, displayName: '(UTC+08:00) Irkutsk' }, { offsetMinutes: 480, name: 'Singapore Standard Time', id: 103, displayName: '(UTC+08:00) Kuala Lumpur, Singapore' }, { offsetMinutes: 480, name: 'W. Australia Standard Time', id: 104, displayName: '(UTC+08:00) Perth' }, { offsetMinutes: 480, name: 'Taipei Standard Time', id: 105, displayName: '(UTC+08:00) Taipei' }, { offsetMinutes: 480, name: 'Ulaanbaatar Standard Time', id: 106, displayName: '(UTC+08:00) Ulaanbaatar' }, { offsetMinutes: 510, name: 'North Korea Standard Time', id: 107, displayName: '(UTC+08:30) Pyongyang' }, { offsetMinutes: 525, name: 'Aus Central W. Standard Time', id: 108, displayName: '(UTC+08:45) Eucla' }, { offsetMinutes: 540, name: 'Transbaikal Standard Time', id: 109, displayName: '(UTC+09:00) Chita' }, { offsetMinutes: 540, name: 'Tokyo Standard Time', id: 110, displayName: '(UTC+09:00) Osaka, Sapporo, Tokyo' }, { offsetMinutes: 540, name: 'Korea Standard Time', id: 111, displayName: '(UTC+09:00) Seoul' }, { offsetMinutes: 540, name: 'Yakutsk Standard Time', id: 112, displayName: '(UTC+09:00) Yakutsk' }, { offsetMinutes: 570, name: 'Cen. Australia Standard Time', id: 113, displayName: '(UTC+09:30) Adelaide' }, { offsetMinutes: 570, name: 'AUS Central Standard Time', id: 114, displayName: '(UTC+09:30) Darwin' }, { offsetMinutes: 600, name: 'E. Australia Standard Time', id: 115, displayName: '(UTC+10:00) Brisbane' }, { offsetMinutes: 600, name: 'AUS Eastern Standard Time', id: 116, displayName: '(UTC+10:00) Canberra, Melbourne, Sydney' }, { offsetMinutes: 600, name: 'West Pacific Standard Time', id: 117, displayName: '(UTC+10:00) Guam, Port Moresby' }, { offsetMinutes: 600, name: 'Tasmania Standard Time', id: 118, displayName: '(UTC+10:00) Hobart' }, { offsetMinutes: 600, name: 'Vladivostok Standard Time', id: 119, displayName: '(UTC+10:00) Vladivostok' }, { offsetMinutes: 630, name: 'Lord Howe Standard Time', id: 120, displayName: '(UTC+10:30) Lord Howe Island' }, { offsetMinutes: 660, name: 'Bougainville Standard Time', id: 121, displayName: '(UTC+11:00) Bougainville Island' }, { offsetMinutes: 660, name: 'Russia Time Zone 10', id: 122, displayName: '(UTC+11:00) Chokurdakh' }, { offsetMinutes: 660, name: 'Magadan Standard Time', id: 123, displayName: '(UTC+11:00) Magadan' }, { offsetMinutes: 660, name: 'Norfolk Standard Time', id: 124, displayName: '(UTC+11:00) Norfolk Island' }, { offsetMinutes: 660, name: 'Sakhalin Standard Time', id: 125, displayName: '(UTC+11:00) Sakhalin' }, { offsetMinutes: 660, name: 'Central Pacific Standard Time', id: 126, displayName: '(UTC+11:00) Solomon Is., New Caledonia' }, { offsetMinutes: 720, name: 'Russia Time Zone 11', id: 127, displayName: '(UTC+12:00) Anadyr, Petropavlovsk-Kamchatsky' }, { offsetMinutes: 720, name: 'New Zealand Standard Time', id: 128, displayName: '(UTC+12:00) Auckland, Wellington' }, { offsetMinutes: 720, name: 'UTC+12', id: 129, displayName: '(UTC+12:00) Coordinated Universal Time+12' }, { offsetMinutes: 720, name: 'Fiji Standard Time', id: 130, displayName: '(UTC+12:00) Fiji' }, { offsetMinutes: 720, name: 'Kamchatka Standard Time', id: 131, displayName: '(UTC+12:00) Petropavlovsk-Kamchatsky - Old' }, { offsetMinutes: 765, name: 'Chatham Islands Standard Time', id: 132, displayName: '(UTC+12:45) Chatham Islands' }, { offsetMinutes: 780, name: 'UTC+13', id: 133, displayName: '(UTC+13:00) Coordinated Universal Time+13' }, { offsetMinutes: 780, name: 'Tonga Standard Time', id: 134, displayName: '(UTC+13:00) Nuku\u0027alofa' }, { offsetMinutes: 780, name: 'Samoa Standard Time', id: 135, displayName: '(UTC+13:00) Samoa' }, { offsetMinutes: 840, name: 'Line Islands Standard Time', id: 136, displayName: '(UTC+14:00) Kiritimati Island' } ]; } ================================================ FILE: source/react-world-clock/src/webparts/worldClock/components/WorldClock.module.scss ================================================ @import '~@microsoft/sp-office-ui-fabric-core/dist/sass/SPFabricCore.scss'; .worldTime { .container { max-width: 700px; margin: 0px auto; } .description { @include ms-font-l; color: $ms-color-black; text-align: center; margin-bottom: 20px; } } ================================================ FILE: source/react-world-clock/src/webparts/worldClock/components/WorldClock.tsx ================================================ import * as React from 'react'; import styles from './WorldClock.module.scss'; import { IWorldClockProps } from './IWorldClockProps'; // import strings from localized resources import * as strings from 'WorldClockWebPartStrings'; // import additional controls/components import { Clock } from './Clock'; import * as timeZones from './Timezones'; export default class WorldClock extends React.Component < IWorldClockProps, {} > { public render(): React.ReactElement { return (
{(this.props.description) ? this.props.description : strings.LocalTimeDescription}
); } // this method determines the minutes offset of the selected time zone private convertTimeZoneIdToOffset(id: number): number { let result: number = 0; const matchingItems: timeZones.ITimeZone[] = timeZones.TimeZones.zones.filter((e: timeZones.ITimeZone, i: number) => { return(e.id === id); }); if (matchingItems && matchingItems.length > 0) { result = matchingItems[0].offsetMinutes; } return(result); } } ================================================ FILE: source/react-world-clock/src/webparts/worldClock/loc/en-us.js ================================================ define([], function() { return { "PropertyPaneDescription": "World Time", "BasicGroupName": "General Settings", "DescriptionFieldLabel": "Description", "TimeZoneOffsetFieldLabel": "Time Zone", "PlaceholderIconName":"Edit", "PlaceholderIconText":"Configure your web part", "PlaceholderDescription":"Please configure the web part.", "PlaceholderButtonLabel":"Configure", "LocalTimeDescription": "UTC Time" } }); ================================================ FILE: source/react-world-clock/src/webparts/worldClock/loc/mystrings.d.ts ================================================ declare interface IWorldClockWebPartStrings { // Property Pane labels and strings PropertyPaneDescription: string; BasicGroupName: string; DescriptionFieldLabel: string; TimeZoneOffsetFieldLabel: string; // Placeholder labels and strings PlaceholderIconName: string; PlaceholderIconText: string; PlaceholderDescription: string; PlaceholderButtonLabel: string; // Default strings for UI LocalTimeDescription: string; } declare module 'WorldClockWebPartStrings' { const strings: IWorldClockWebPartStrings; export = strings; } ================================================ FILE: source/react-world-clock/tsconfig.json ================================================ { "extends": "./node_modules/@microsoft/rush-stack-compiler-4.5/includes/tsconfig-web.json", "compilerOptions": { "target": "es5", "forceConsistentCasingInFileNames": true, "module": "esnext", "moduleResolution": "node", "jsx": "react", "declaration": true, "sourceMap": true, "experimentalDecorators": true, "skipLibCheck": true, "outDir": "lib", "inlineSources": false, "strictNullChecks": false, "noImplicitAny": true, "typeRoots": [ "./node_modules/@types", "./node_modules/@microsoft" ], "types": [ "webpack-env" ], "lib": [ "es5", "dom", "es2015.collection", "es2015.promise" ] }, "include": [ "src/**/*.ts", "src/**/*.tsx" ] } ================================================ FILE: source/templates/resources/collabcommunicationsite.json ================================================ { "$schema": "schema.json", "actions": [ { "verb": "associateExtension", "title": "Portal Footer", "location": "ClientSideExtension.ApplicationCustomizer", "clientSideComponentId": "df889434-1b1c-4f5b-ada3-086d948e4270", "clientSideComponentProperties": "{\"linksListTitle\": \"PnP-PortalFooter-Links\", \"copyright\": \"(c) Copyright {parameter:Company}, 2018\", \"support\": \"support@contoso.com\", \"personalItemsStorageProperty\": \"PnP-CollabFooter-MyLinks\"}", "scope": "Site" } ], "bindata": {}, "version": 1 } ================================================ FILE: source/templates/resources/collabteamsite.json ================================================ { "$schema": "schema.json", "actions": [ { "verb": "associateExtension", "title": "Collab Footer", "location": "ClientSideExtension.ApplicationCustomizer", "clientSideComponentId": "6638da67-06f4-4f55-a1df-485d568e8b72", "clientSideComponentProperties": "{\"sourceTermSet\":\"PnP-CollabFooter-SharedLinks\",\"personalItemsStorageProperty\":\"PnP-CollabFooter-MyLinks\"}", "scope": "Site" } ], "bindata": {}, "version": 1 } ================================================ FILE: source/templates/resources/resources-core.de-de.resx ================================================  text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 Ereignisse Freigegebene Dokumente ================================================ FILE: source/templates/resources/resources-core.en-us.resx ================================================  text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 Events Shared Documents ================================================ FILE: source/templates/resources/resources-core.es-es.resx ================================================  text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 Eventos Documentos compartidos ================================================ FILE: source/templates/resources/resources-core.fr-fr.resx ================================================  text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 Événements Documents partages ================================================ FILE: source/templates/resources/resources-core.nb-no.resx ================================================  text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 Hendelser Delte dokumenter ================================================ FILE: source/templates/resources/resources-core.nl-nl.resx ================================================  text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 Gebeurtenissen Gedeelde documenten ================================================ FILE: source/templates/resources/resources-core.sv-se.resx ================================================ text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 Händelser Delade dokument ================================================ FILE: source/templates/resources/resources-core.tr-tr.resx ================================================  text/microsoft-resx 2.0 System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 Etkinlikler Paylaşılan dokümanlar ================================================ FILE: source/templates/starterkit-spfx-only.xml ================================================  1033 ================================================ FILE: source/templates/starterkit.xml ================================================  Contoso Electronics /sites/contosoportal contosomarketing contosohr MSFT 1033 Main Links 30 clienttemplates.js Find My Customers Applications https://find.customers CRM Applications https://company.crm ERP Applications https://company.erp Technical Procedures Applications https://tech.procs Expense Report Module Internal Modules https://expense.report Company Car Replacement Internal Modules https://need.new.car Vacation Request Module Internal Modules https://need.some.rest CNN News https://www.cnn.com/ BBC News https://www.bbc.co.uk/ New York Times News https://www.nytimes.com/ Forbes News http://www.forbes.com/ [today] Information Information Urgent [today] Current window New window 12PointStar 6PointStar AADLogo Accept Accounts 30 clienttemplates.js clienttemplates.js SharePoint Conference North America true 2018-05-21 00:00:00 2018-05-23 23:59:00 European Collaboration Summit true 2018-05-28 00:00:00 2018-05-30 23:59:00 Microsoft Ignite true 2018-09-24 00:00:00 2018-09-28 23:59:00 European SharePoint Conference true 2018-11-26 00:00:00 2018-11-29 23:59:00 SharePoint Conference true 2019-05-21 00:00:00 2019-05-23 23:59:00 European Collaboration Summit true 2019-05-27 00:00:00 2019-05-29 23:59:00 30 clienttemplates.js 30 clienttemplates.js { "neutralQuaternaryAlt": "#dadada", "themeLighterAlt": "#f1f9fb", "themeSecondary": "#168caa", "themePrimary": "#017e9d", "bodyText": "#333333", "themeDarker": "#014759", "themeDark": "#016078", "themeLight": "#9fd5e2", "error": "#e93333", "neutralLighter": "#f4f4f4", "neutralLighterAlt": "#f8f8f8", "themeLighter": "#cae8ef", "themeDarkAlt": "#01728e", "themeTertiary": "#50adc5", "primaryText": "#333333", "accent": "#864B7A", "bodyBackground": "#ffffff", "neutralSecondary": "#858585", "neutralQuaternary": "#d0d0d0", "neutralLight": "#eaeaea", "neutralPrimaryAlt": "#4b4b4b", "white": "#ffffff", "neutralDark": "#272727", "neutralPrimary": "#333333", "neutralTertiaryAlt": "#c8c8c8", "neutralTertiary": "#c2c2c2", "black": "#1d1d1d" } { "neutralQuaternaryAlt": "#dadada", "themeLighterAlt": "#fdf7f4", "themeSecondary": "#d06228", "themePrimary": "#ca5010", "bodyText": "#333333", "themeDarker": "#712d09", "themeDark": "#993e0c", "themeLight": "#efc4ad", "error": "#e93333", "neutralLighter": "#f4f4f4", "neutralLighterAlt": "#f8f8f8", "themeLighter": "#f6dfd2", "themeDarkAlt": "#b5490f", "themeTertiary": "#df8f64", "primaryText": "#333333", "accent": "#7A7574", "bodyBackground": "#ffffff", "neutralSecondary": "#858585", "neutralQuaternary": "#d0d0d0", "neutralLight": "#eaeaea", "neutralPrimaryAlt": "#4b4b4b", "white": "#ffffff", "neutralDark": "#272727", "neutralPrimary": "#333333", "neutralTertiaryAlt": "#c8c8c8", "neutralTertiary": "#c2c2c2", "black": "#1d1d1d" }