Skip to content
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
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
22.14.0
39 changes: 39 additions & 0 deletions samples/react-intranet-announcements-notification-center/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Intranet Announcements and Targeted Notification Center

An SPFx 1.23.2 React 17 / Fluent UI v9 presentation and review sample. It reads announcement list items with SharePoint REST `GET` only. It never sends, creates, updates, dismisses, or deletes notifications.

## Setup

```bash
npm ci
npm test
npm run verify
npm run build
npm run package
```

Deploy the generated package from `sharepoint/solution` to the tenant App Catalog, then add the web part to a page. Use Node `>=22.14.0 <23.0.0`.

## Configuration

In the property pane, provide up to four server-relative list paths, one per line (for example `/sites/intranet/Lists/Announcements`). The web part requests a fixed allow-list of fields, at most 50 rows per page, 5 pages, and 200 rows per source. It ignores unsafe paths, unsafe URLs, malformed rows, untrusted next links, and unsafe external images/links.

The optional reference date makes review and tests repeatable. If it is empty, the current date at load time is used. An item is shown when `IsPublished` is not false, `PublishDate` is not in the future, and `ExpiryDate` is not in the past. Missing publish/expiry fields mean that boundary is not applied; this is only a fallback, not proof that an item is published.

The optional current audience label is compared with labels present in the item’s `Audience` or `TargetAudience` field. A blank item audience is treated as a match. This is a configured audience-label match only: the sample does not resolve Microsoft 365 group membership, authorize access, or make authorization decisions.

## Read-only and security/privacy scope

This sample is a bounded read-only presentation. SharePoint permissions still control whether the signed-in user can read each list. Do not put secrets, credentials, personal data, or sensitive audience information into web part properties. Validate list paths, tenant URLs, list permissions, retention requirements, and privacy impact with your tenant administrators before use.

This sample does not replace Viva Engage, Teams notifications, SharePoint news distribution, or Microsoft 365 audience authorization.

## Tenant validation checklist

- Confirm each configured path is server-relative, points to the intended tenant, and contains only approved announcement data.
- Confirm the signed-in test accounts have the expected read permissions and verify 401/403 behavior.
- Test future publish dates, expired items, missing dates, malformed rows, empty lists, partial pages, throttling, and service unavailable responses.
- Confirm the audience label is maintained by the content owner and is not treated as group-membership or authorization evidence.
- Confirm external images and links are intentionally rejected; review accessibility, privacy, retention, and page performance.

<img src="https://m365-visitor-stats.azurewebsites.net/sp-dev-fx-webparts/samples/react-intranet-announcements-notification-center" />
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[
{
"name": "pnp-sp-dev-spfx-web-parts-react-intranet-announcements-notification-center",
"source": "pnp",
"title": "Intranet Announcements and Targeted Notification Center",
"shortDescription": "A bounded, read-only SharePoint announcements presentation and review sample.",
"url": "https://github.com/pnp/sp-dev-fx-webparts/tree/main/samples/react-intranet-announcements-notification-center",
"downloadUrl": "https://pnp.github.io/download-partial/?url=https://github.com/pnp/sp-dev-fx-webparts/tree/main/samples/react-intranet-announcements-notification-center",
"longDescription": ["Reads configured SharePoint announcement lists with SharePoint REST GET only and presents eligible items with safe, bounded filtering."],
"creationDateTime": "2026-08-30",
"updateDateTime": "2026-08-30",
"products": ["SharePoint", "SPFx"],
"metadata": [{ "key": "SAMPLE-TYPE", "value": "SPFx-WebPart" }, { "key": "CLIENT-SIDE-DEV", "value": "React" }, { "key": "SPFX-VERSION", "value": "1.23.2" }],
"thumbnails": [],
"authors": [{ "gitHubAccount": "vystartasv", "pictureUrl": "https://github.com/vystartasv.png", "name": "Vilius Vystartas" }],
"references": [{ "name": "Build your first SharePoint client-side web part", "description": "Official Microsoft guide to building a SharePoint Framework client-side web part.", "url": "https://learn.microsoft.com/sharepoint/dev/spfx/web-parts/get-started/build-a-hello-world-web-part" }]
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/spfx-build/config.2.0.schema.json",
"version": "2.0",
"bundles": { "intranet-announcements-notification-center-web-part": { "components": [{ "entrypoint": "./lib/webparts/intranetAnnouncementsNotificationCenter/IntranetAnnouncementsNotificationCenterWebPart.js", "manifest": "./src/webparts/intranetAnnouncementsNotificationCenter/IntranetAnnouncementsNotificationCenterWebPart.manifest.json" }] } },
"externals": {},
"localizedResources": { "IntranetAnnouncementsNotificationCenterWebPartStrings": "lib/webparts/intranetAnnouncementsNotificationCenter/loc/{locale}.js" }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/spfx-build/package-solution.schema.json",
"solution": { "name": "react-intranet-announcements-notification-center-client-side-solution", "id": "7a954a0e-8be3-4cfb-ba42-54e1bc792421", "version": "1.0.0.0", "includeClientSideAssets": true, "skipFeatureDeployment": true, "isDomainIsolated": false, "developer": { "name": "Microsoft 365 Platform Community", "websiteUrl": "https://github.com/pnp", "privacyUrl": "", "termsOfUseUrl": "", "mpnId": "m365pnp" } },
"paths": { "zippedPackage": "solution/react-intranet-announcements-notification-center.sppkg" }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ "$schema": "https://developer.microsoft.com/json-schemas/spfx-build/serve.schema.json", "port": 4321, "https": true, "initialPage": "https://{tenantDomain}/_layouts/workbench.aspx" }
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
'use strict';
const build = require('@microsoft/sp-build-web');
build.initialize(require('gulp'));
Loading
Loading