Skip to content

Add initial files for April Fools application customizer #1483

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
319 changes: 319 additions & 0 deletions samples/react-copilot-aprils-fool/.eslintrc.js

Large diffs are not rendered by default.

34 changes: 34 additions & 0 deletions samples/react-copilot-aprils-fool/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# 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
16 changes: 16 additions & 0 deletions samples/react-copilot-aprils-fool/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
!dist
config

gulpfile.js

release
src
temp

tsconfig.json
tslint.json

*.log

.yo-rc.json
.vscode
25 changes: 25 additions & 0 deletions samples/react-copilot-aprils-fool/.yo-rc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"@microsoft/generator-sharepoint": {
"whichFolder": "subdir",
"solutionName": "react-copilot-aprils-fool",
"componentType": "extension",
"extensionType": "ApplicationCustomizer",
"template": "none",
"componentName": "Copilot April Fools",
"plusBeta": false,
"isCreatingSolution": true,
"nodeVersion": "20.16.0",
"sdksVersions": {
"@microsoft/microsoft-graph-client": "3.0.2",
"@microsoft/teams-js": "2.24.0"
},
"version": "1.20.0",
"libraryName": "react-copilot-aprils-fool",
"libraryId": "4389f8df-31ed-4999-8fc5-42fcdc338894",
"environment": "spo",
"packageManager": "npm",
"solutionShortDescription": "react-copilot-aprils-fool description",
"skipFeatureDeployment": true,
"isDomainIsolated": false
}
}
63 changes: 63 additions & 0 deletions samples/react-copilot-aprils-fool/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# react-copilot-aprils-fool

## Summary

This solution is a sample of an SPFx application customizer that display message in the header of the SharePoint site with sample of button which inverts colors for 5sec. The message is displayed only on April 1st.

![Sample](./assets/Sample.png)

## Used SharePoint Framework Version

![version](https://img.shields.io/badge/version-1.20.0-green.svg)

## Applies to

- [SharePoint Framework](https://aka.ms/spfx)
- [Microsoft 365 tenant](https://docs.microsoft.com/en-us/sharepoint/dev/spfx/set-up-your-developer-tenant)

> Get your own free development tenant by subscribing to [Microsoft 365 developer program](http://aka.ms/o365devprogram)

## Solution

| Solution | Author(s) |
| ----------- | ------------------------------------------------------- |
| react-copilot-aprils-fool | Valeras Narbutas |

## Version history

| Version | Date | Comments |
| ------- | ---------------- | --------------- |
| 1.0 | March 23, 2025 | Initial release |

## 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
- Ensure that you are at the 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:

- Display custom banners (informational, alerts, notifications)
- Add floating buttons for shortcuts or actions (like theme switchers, accessibility tools)

> Share your web part with others through Microsoft 365 Patterns and Practices program to get visibility and exposure. More details on the community, open-source projects and other activities from http://aka.ms/m365pnp.

## References

- [Getting started with SharePoint Framework](https://docs.microsoft.com/en-us/sharepoint/dev/spfx/set-up-your-developer-tenant)
- [Building for Microsoft teams](https://docs.microsoft.com/en-us/sharepoint/dev/spfx/build-for-teams-overview)
- [Use Microsoft Graph in your solution](https://docs.microsoft.com/en-us/sharepoint/dev/spfx/web-parts/get-started/using-microsoft-graph-apis)
- [Publish SharePoint Framework applications to the Marketplace](https://docs.microsoft.com/en-us/sharepoint/dev/spfx/publish-to-marketplace-overview)
- [Microsoft 365 Patterns and Practices](https://aka.ms/m365pnp) - Guidance, tooling, samples and open-source controls for your Microsoft 365 development
50 changes: 50 additions & 0 deletions samples/react-copilot-aprils-fool/assets/sample.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
[
{
"name": "pnp-sp-dev-spfx-extensions-react-copilot-aprils-fool",
"source": "pnp",
"title": "Copilot April's Fool",
"shortDescription": "An extention to privide a simple approach to display custom messages in SharePoint Online.",
"url": "https://github.com/pnp/sp-dev-fx-extensions/tree/main/samples/react-copilot-aprils-fool",
"downloadUrl": "https://pnp.github.io/download-partial/?url=https://github.com/pnp/sp-dev-fx-extensions/tree/main/samples/react-copilot-aprils-fool",
"longDescription": [
"An extention to privide a simple approach to display custom messages in SharePoint Online."
],
"creationDateTime": "2025-03-23",
"updateDateTime": "2025-03-23",
"products": [
"SharePoint"
],
"metadata": [
{
"key": "CLIENT-SIDE-DEV",
"value": "React"
},
{
"key": "SPFX-VERSION",
"value": "1.20.0"
}
],
"thumbnails": [
{
"type": "image",
"order": 100,
"url": "https://github.com/pnp/sp-dev-fx-extensions/raw/main/samples/react-copilot-aprils-fool/assets/sample.png",
"alt": "Extension Preview"
}
],
"authors": [
{
"gitHubAccount": "ValerasNarbutas",
"pictureUrl": "https://github.com/ValerasNarbutas.png",
"name": "Valeras Narbutas"
}
],
"references": [
{
"name": "Overview of SharePoint Framework Extensions",
"description": "You can use SharePoint Framework (SPFx) Extensions to extend the SharePoint user experience. With SPFx Extensions, you can customize more facets of the SharePoint experience, including notification areas, toolbars, and list data views. SPFx Extensions are available in all Microsoft 365 subscriptions for production usage.",
"url": "https://docs.microsoft.com/sharepoint/dev/spfx/extensions/overview-extensions?WT.mc_id=m365-15741-cxa"
}
]
}
]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions samples/react-copilot-aprils-fool/config/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/spfx-build/config.2.0.schema.json",
"version": "2.0",
"bundles": {
"copilot-april-fools-application-customizer": {
"components": [
{
"entrypoint": "./lib/extensions/copilotAprilFools/CopilotAprilFoolsApplicationCustomizer.js",
"manifest": "./src/extensions/copilotAprilFools/CopilotAprilFoolsApplicationCustomizer.manifest.json"
}
]
}
},
"externals": {},
"localizedResources": {
"CopilotAprilFoolsApplicationCustomizerStrings": "lib/extensions/copilotAprilFools/loc/{locale}.js"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/spfx-build/deploy-azure-storage.schema.json",
"workingDir": "./release/assets/",
"account": "<!-- STORAGE ACCOUNT NAME -->",
"container": "react-copilot-aprils-fool",
"accessKey": "<!-- ACCESS KEY -->"
}
46 changes: 46 additions & 0 deletions samples/react-copilot-aprils-fool/config/package-solution.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/spfx-build/package-solution.schema.json",
"solution": {
"name": "react-copilot-aprils-fool-client-side-solution",
"id": "4389f8df-31ed-4999-8fc5-42fcdc338894",
"version": "1.0.0.0",
"includeClientSideAssets": true,
"skipFeatureDeployment": true,
"isDomainIsolated": false,
"developer": {
"name": "",
"websiteUrl": "",
"privacyUrl": "",
"termsOfUseUrl": "",
"mpnId": "Undefined-1.20.0"
},
"metadata": {
"shortDescription": {
"default": "react-copilot-aprils-fool description"
},
"longDescription": {
"default": "react-copilot-aprils-fool description"
},
"screenshotPaths": [],
"videoUrl": "",
"categories": []
},
"features": [
{
"title": "Application Extension - Deployment of custom action",
"description": "Deploys a custom action with ClientSideComponentId association",
"id": "695ef80e-f50f-4957-865d-98b6bd3d2042",
"version": "1.0.0.0",
"assets": {
"elementManifests": [
"elements.xml",
"ClientSideInstance.xml"
]
}
}
]
},
"paths": {
"zippedPackage": "solution/react-copilot-aprils-fool.sppkg"
}
}
3 changes: 3 additions & 0 deletions samples/react-copilot-aprils-fool/config/sass.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/core-build/sass.schema.json"
}
29 changes: 29 additions & 0 deletions samples/react-copilot-aprils-fool/config/serve.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/spfx-build/spfx-serve.schema.json",
"port": 4321,
"https": true,
"serveConfigurations": {
"default": {
"pageUrl": "https://{tenantDomain}/SitePages/myPage.aspx",
"customActions": {
"2d2e1a0b-88b4-40ad-8f55-91055395b77c": {
"location": "ClientSideExtension.ApplicationCustomizer",
"properties": {
"testMessage": "Test message"
}
}
}
},
"copilotAprilFools": {
"pageUrl": "https://{tenantDomain}/SitePages/myPage.aspx",
"customActions": {
"2d2e1a0b-88b4-40ad-8f55-91055395b77c": {
"location": "ClientSideExtension.ApplicationCustomizer",
"properties": {
"testMessage": "Test message"
}
}
}
}
}
}
4 changes: 4 additions & 0 deletions samples/react-copilot-aprils-fool/config/write-manifests.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/spfx-build/write-manifests.schema.json",
"cdnBasePath": "<!-- PATH TO CDN -->"
}
16 changes: 16 additions & 0 deletions samples/react-copilot-aprils-fool/gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
'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'));
Loading
Loading