From 02537a34d10bd53b7535729ea89241354aabfce0 Mon Sep 17 00:00:00 2001 From: Gunjan Datta Date: Fri, 21 Aug 2026 20:56:45 -0400 Subject: [PATCH 1/4] Added optional SPFx properties. --- .../webparts/siteAdmin/SiteAdminWebPart.ts | 125 ++++++++++++++++++ 1 file changed, 125 insertions(+) diff --git a/spfx/src/webparts/siteAdmin/SiteAdminWebPart.ts b/spfx/src/webparts/siteAdmin/SiteAdminWebPart.ts index 7abaeaf..57be952 100644 --- a/spfx/src/webparts/siteAdmin/SiteAdminWebPart.ts +++ b/spfx/src/webparts/siteAdmin/SiteAdminWebPart.ts @@ -104,6 +104,20 @@ export interface ISiteAdminWebPartProps { ReportsDocSearchFileExt: string; ReportsDocSearchKeywords: string; ReportsDocSearchRegexPatterns: string; + ReportNameDLP: string; + ReportNameDocRetention: string; + ReportNameExternalShares: string; + ReportNameExternalUsers: string; + ReportNamePermissions: string; + ReportNameRetention: string; + ReportNameSearchAgents: string; + ReportNameSearchDocs: string; + ReportNameSearchEEEU: string; + ReportNameSearchProp: string; + ReportNameSearchUsers: string; + ReportNameSensitivityLabels: string; + ReportNameSharingLinks: string; + ReportNameUniquePermissions: string; ReportsSecureFileText: string; ReportsOversharedGroups: string; SensitivityLabelFileExt: string; @@ -234,6 +248,22 @@ declare const SiteAdmin: { maxStorageSize?: number; siteAttestation?: boolean; siteAttestationText?: string; + reportNames?: { + dlp: string; + docRetention: string; + externalShares: string; + externalUsers: string; + permissions: string; + retention: string; + searchAgents: string; + searchDocs: string; + searchEEEU: string; + searchProp: string; + searchUsers: string; + sensitivityLabels: string; + sharingLinks: string; + uniquePermissions: string; + } reportProps?: { docRententionYears?: string; dlpFileExt?: string; @@ -815,6 +845,85 @@ export default class SiteAdminWebPart extends BaseClientSideWebPart Date: Fri, 21 Aug 2026 21:03:22 -0400 Subject: [PATCH 2/4] Added the report names to the SPFx config --- .../src/webparts/siteAdmin/SiteAdminWebPart.manifest.json | 1 - spfx/src/webparts/siteAdmin/SiteAdminWebPart.ts | 8 -------- spfx/src/webparts/siteAdmin/loc/en-us.js | 1 - spfx/src/webparts/siteAdmin/loc/mystrings.d.ts | 1 - 4 files changed, 11 deletions(-) diff --git a/spfx/src/webparts/siteAdmin/SiteAdminWebPart.manifest.json b/spfx/src/webparts/siteAdmin/SiteAdminWebPart.manifest.json index 6c5469f..b6495bd 100644 --- a/spfx/src/webparts/siteAdmin/SiteAdminWebPart.manifest.json +++ b/spfx/src/webparts/siteAdmin/SiteAdminWebPart.manifest.json @@ -113,7 +113,6 @@ "WebPropSearchPropertyDescription": "The custom property to set for search.", "WebPropSearchPropertyKey": "", "WebPropSearchPropertyLabel": "Search Property:", - "WebPropSearchPropertyReportName": "Search Property", "WebPropSearchPropertyTabName": "", "WebPropSearchScope": false, "WebPropSearchScopeDescription": "The search scope for the site to target. Default is 'Site'.", diff --git a/spfx/src/webparts/siteAdmin/SiteAdminWebPart.ts b/spfx/src/webparts/siteAdmin/SiteAdminWebPart.ts index 57be952..781c546 100644 --- a/spfx/src/webparts/siteAdmin/SiteAdminWebPart.ts +++ b/spfx/src/webparts/siteAdmin/SiteAdminWebPart.ts @@ -191,7 +191,6 @@ export interface ISiteAdminWebPartProps { WebPropSearchPropertyKey: string; WebPropSearchPropertyLabel: string; WebPropSearchPropertyManagedProperty: string; - WebPropSearchPropertyReportName: string; WebPropSearchPropertyTabName: string; WebPropSearchPropertyValues: string; WebPropSearchScope: boolean; @@ -279,7 +278,6 @@ declare const SiteAdmin: { key: string; label: string; managedProperty: string; - reportName: string; tabName: string; values: string; } @@ -718,11 +716,6 @@ export default class SiteAdminWebPart extends BaseClientSideWebPart Date: Fri, 21 Aug 2026 21:03:41 -0400 Subject: [PATCH 3/4] Updated the report names to reference the new SPFx config properties. --- src/app.ts | 3 ++- src/tabs/reports.ts | 46 +++++++++++++++++++++++++++++------------- src/tabs/searchProp.ts | 1 - 3 files changed, 34 insertions(+), 16 deletions(-) diff --git a/src/app.ts b/src/app.ts index 8f219bc..0e3f161 100644 --- a/src/app.ts +++ b/src/app.ts @@ -8,7 +8,7 @@ import Strings from "./strings"; import { Security } from "./security"; import { SiteAttestationForm } from "./siteAttestationForm"; import { Tabs } from "./tabs"; -import { IReportProps } from "./tabs/reports"; +import { IReportNames, IReportProps } from "./tabs/reports"; import { ISearchProps } from "./tabs/searchProp"; // App Properties @@ -55,6 +55,7 @@ export interface IAppProps { maxRequests?: number; maxStorageDesc?: string; maxStorageSize?: number; + reportNames?: IReportNames; reportProps?: IReportProps; searchProps?: ISearchProps; siteAttestation?: boolean; diff --git a/src/tabs/reports.ts b/src/tabs/reports.ts index c691347..fc42b4d 100644 --- a/src/tabs/reports.ts +++ b/src/tabs/reports.ts @@ -5,6 +5,24 @@ import * as Reports from "../reports"; import { ViewPermissions } from "../reports/viewPermissions"; import { ISearchProps } from "./searchProp"; +// Report Names +export interface IReportNames { + dlp: string; + docRetention: string; + externalShares: string; + externalUsers: string; + permissions: string; + retention: string; + searchAgents: string; + searchDocs: string; + searchEEEU: string; + searchProp: string; + searchUsers: string; + sensitivityLabels: string; + sharingLinks: string; + uniquePermissions: string; +} + // Report Properties export interface IReportProps { dlpFileExt?: string; @@ -85,65 +103,65 @@ export class ReportsTab { // Add the reports if (typeof (this._appProps.hideReports.dlp) === "undefined" || this._appProps.hideReports.dlp != true) { items.push({ - text: "Data Loss Prevention", + text: this._appProps.reportNames.dlp || "Data Loss Prevention", data: "Finds files that has DLP applied to it.", value: ReportTypes.DLP }); } if (typeof (this._appProps.hideReports.docRetention) === "undefined" || this._appProps.hideReports.docRetention != true) { items.push({ - text: "Document Retention", + text: this._appProps.reportNames.docRetention || "Document Retention", data: "Find documents older than a specified date.", value: ReportTypes.DocRetention }); } if (typeof (this._appProps.hideReports.externalShares) === "undefined" || this._appProps.hideReports.externalShares != true) { items.push({ - text: "External Shares", + text: this._appProps.reportNames.externalShares || "External Shares", data: "Scans for documents that have been shared externally.", value: ReportTypes.ExternalShares }); } if (typeof (this._appProps.hideReports.externalUsers) === "undefined" || this._appProps.hideReports.externalUsers != true) { items.push({ - text: "External Users", + text: this._appProps.reportNames.externalUsers || "External Users", data: "Scans the user information list for 'external' user accounts.", value: ReportTypes.ExternalUsers }); } if (typeof (this._appProps.hideReports.permissions) === "undefined" || this._appProps.hideReports.permissions != true) { items.push({ - text: "Permissions", + text: this._appProps.reportNames.permissions || "Permissions", data: "Scans all users/groups that have permissions to the site.", value: ReportTypes.Permissions }); } if (typeof (this._appProps.hideReports.searchAgents) === "undefined" || this._appProps.hideReports.searchAgents != true) { items.push({ - text: "Search Agents", + text: this._appProps.reportNames.searchAgents || "Search Agents", data: "Searches all libraries for agent files in the site.", value: ReportTypes.SearchAgents }); } if (typeof (this._appProps.hideReports.searchDocs) === "undefined" || this._appProps.hideReports.searchDocs != true) { items.push({ - text: "Search Documents", + text: this._appProps.reportNames.searchDocs || "Search Documents", data: "Find documents by keywords.", value: ReportTypes.SearchDocs }); } if (typeof (this._appProps.hideReports.searchEEEU) === "undefined" || this._appProps.hideReports.searchEEEU != true) { items.push({ - text: "Search EEEU", + text: this._appProps.reportNames.searchEEEU || "Search EEEU", data: "Search for the 'Every' and 'Everyone exception external users' accounts.", value: ReportTypes.SearchEEEU }); } if (typeof (this._appProps.hideReports.searchProp) === "undefined" || this._appProps.hideReports.searchProp != true) { // Ensure the property is set - if (this._searchProps.reportName) { + if (this._searchProps.key) { items.push({ - text: this._searchProps.reportName || "Search Property", + text: this._appProps.reportNames.searchProp || "Search Property", data: "Find sites by search property.", value: ReportTypes.SearchProp, isDisabled: this._searchProps.managedProperty && DataSource.SearchPropItems ? false : true @@ -152,28 +170,28 @@ export class ReportsTab { } if (typeof (this._appProps.hideReports.searchUsers) === "undefined" || this._appProps.hideReports.searchUsers != true) { items.push({ - text: "Search Users", + text: this._appProps.reportNames.searchUsers || "Search Users", data: "Search users by keyword or account.", value: ReportTypes.SearchUsers }); } if (typeof (this._appProps.hideReports.sensitivityLabels) === "undefined" || this._appProps.hideReports.sensitivityLabels != true) { items.push({ - text: "Sensitivity Labels", + text: this._appProps.reportNames.sensitivityLabels || "Sensitivity Labels", data: "Search for files that have sensitivity labels.", value: ReportTypes.SensitivityLabels }); } if (typeof (this._appProps.hideReports.sharingLinks) === "undefined" || this._appProps.hideReports.sharingLinks != true) { items.push({ - text: "Sharing Links", + text: this._appProps.reportNames.sharingLinks || "Sharing Links", data: "Scans for any 'Sharing Link' groups.", value: ReportTypes.SharingLinks }); } if (typeof (this._appProps.hideReports.uniquePermissions) === "undefined" || this._appProps.hideReports.uniquePermissions != true) { items.push({ - text: "Unique Permissions", + text: this._appProps.reportNames.uniquePermissions || "Unique Permissions", data: "Scans for items that have unique permissions.", value: ReportTypes.UniquePermissions }); diff --git a/src/tabs/searchProp.ts b/src/tabs/searchProp.ts index d2c4c18..deb1754 100644 --- a/src/tabs/searchProp.ts +++ b/src/tabs/searchProp.ts @@ -7,7 +7,6 @@ export interface ISearchProps { key: string; label: string; managedProperty: string; - reportName: string; tabName: string; values: string; } From 8be509afabe473582489fc2d0f6997d2e51a58f7 Mon Sep 17 00:00:00 2001 From: Gunjan Datta Date: Fri, 21 Aug 2026 21:05:25 -0400 Subject: [PATCH 4/4] Updated the list report dropdown to reference the custom SPFx properties. --- src/tabs/lists.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/tabs/lists.ts b/src/tabs/lists.ts index f979155..86175ea 100644 --- a/src/tabs/lists.ts +++ b/src/tabs/lists.ts @@ -601,7 +601,7 @@ export class ListsTab { // DLP if (typeof (this._appProps.hideReports.dlp) === "undefined" || this._appProps.hideReports.dlp != true) { items.push({ - text: "Data Loss Prevention", + text: this._appProps.reportNames.dlp || "Data Loss Prevention", data: "Finds files that has DLP applied to it.", value: ReportTypes.DLP }); @@ -612,7 +612,7 @@ export class ListsTab { // Ensure it's a library if (isLibrary) { items.push({ - text: "Search Agents", + text: this._appProps.reportNames.searchAgents || "Search Agents", data: "Search the library for agents.", value: ReportTypes.SearchAgents }); @@ -623,7 +623,7 @@ export class ListsTab { if (isLibrary && item.DriveId) { if (typeof (this._appProps.hideReports.searchDocs) === "undefined" || this._appProps.hideReports.searchDocs != true) { items.push({ - text: "Search Documents", + text: this._appProps.reportNames.searchDocs || "Search Documents", data: "Search for documents using regex patterns.", value: ReportTypes.SearchDocs }); @@ -633,7 +633,7 @@ export class ListsTab { // Search EEEU if (typeof (this._appProps.hideReports.searchEEEU) === "undefined" || this._appProps.hideReports.searchEEEU != true) { items.push({ - text: "Search EEEU", + text: this._appProps.reportNames.searchEEEU || "Search EEEU", data: "Search for the 'Every' and 'Everyone exception external users' accounts.", value: ReportTypes.SearchEEEU }); @@ -644,7 +644,7 @@ export class ListsTab { // See if we are displaying this option if (typeof (this._appProps.hideReports.sensitivityLabels) === "undefined" || this._appProps.hideReports.sensitivityLabels != true) { items.push({ - text: "Sensitivity Labels", + text: this._appProps.reportNames.sensitivityLabels || "Sensitivity Labels", data: "Click to view sensitivity label options.", value: ReportTypes.SensitivityLabels }); @@ -654,7 +654,7 @@ export class ListsTab { // Unique Permissions if (typeof (this._appProps.hideReports.uniquePermissions) === "undefined" || this._appProps.hideReports.uniquePermissions != true) { items.push({ - text: "Unique Permissions", + text: this._appProps.reportNames.uniquePermissions || "Unique Permissions", data: "Scans for items that have unique permissions.", value: ReportTypes.UniquePermissions });