From dd8bcce4af7a9c6c1e2e2f711ce312d08063b0a4 Mon Sep 17 00:00:00 2001 From: Gunjan Datta Date: Sun, 2 Aug 2026 17:05:28 -0400 Subject: [PATCH 01/24] Updated the template class to be reusable. Created data-readiness component. --- src/page-generator/data-readiness.ts | 429 ++++++++++++++++++++++ src/page-generator/index.ts | 25 +- src/page-generator/template.ts | 510 ++------------------------- 3 files changed, 473 insertions(+), 491 deletions(-) create mode 100644 src/page-generator/data-readiness.ts diff --git a/src/page-generator/data-readiness.ts b/src/page-generator/data-readiness.ts new file mode 100644 index 0000000..6bcde99 --- /dev/null +++ b/src/page-generator/data-readiness.ts @@ -0,0 +1,429 @@ +import { PageTemplate } from "./template"; + +// The html content for the webpart +const CanvasContent = `
+
+
+
+
+
+
+
+
+

For Copilot to be enabled in the SPO + environment, the site administrators will need to take action for protecting content from over-sharing. +

+
    +
  • +

    Cleanup Content

    +
  • +
  • +

    Analyze Permissions

    +
  • +
  • +

    Apply Site Configurations

    +
  • +
+

This is critical for ensuring AI does + not expose data to users who do not have a need to know.

+

Audit Tools

+ +
+

 

+

The Audit Tools tab has + many reports available to the site administrator. We will utilize these reports for completing the + requested tasks.

+
+
+
+
+

More content, more problems. We need to + ensure the most active/relevant data is referenced by AI, when responding to you.

+ +

Purge Old Content

+
+

We will be using the Document Retention report to find content older than 3 years. Run + this report, and export the data for review with the site owner(s). Purge data following records + management policy.

+

Find Inactive Sites

+

 

+
+

 

+

The first task to complete, is to set + the custom search property for all sites owned by the grouping. This will allow you to run the report to + find inactive sites. This may take some time for the search api to refresh.

+

 

+
+

Tagging your sites will allow you to run a report against the search api to find the usage of them.

+

 

+
+

The report will have the last 7/14/30/60/90 views, lifetime views and last modified time. This + information will allow the site owners determine which sites should be purged and archived.

+
+
+
+
+

Oversharing is a major issue with + content. We have various reports available to help identify and secure the content.

+

Review External Sharing

+
+

 

+

The External Shares + report will display content where its search metadata property ViewableByExternalUsers + is set. This will help identify content that is viewable by external users. There are actions that can + be taken to view/download/delete the content. Export this report and review it with the site owners to + review the content.

+

Review External Users

+
+

 

+

The External Users + report will inspect the User Information List for any users that have an external + account. Export this report and review it with the site owners to determine which external users still + need access to the site.

+

Review Sharing Links Site Groups

+
+

When files are shared, a hidden + Sharing Links site group is created. The Sharing Links report will + show these hidden groups and the associated file with the group. There are actions to view the + file/group and delete the group. Export this report and review it with the site owners to determine if + these shared need to be removed.

+

Review EEEU Usage

+
+

The use of Everyone and + EEEU (Everyone Except External Users) groups have been used incorrectly. There are + actions to remove the group from the site, which will remove it from all site groups, or to remove it + from a group. Export this report and review it with the site owners to determine if everyone within the + tenant should have access to the content.

+

Review Site Permissions

+
+

The Permissions report + will give an overview of all site users/groups and m365 users/groups that have access to your site. + There are flags for the Everyone and EEEU accounts being referenced by + either site/m365 group. It's recommended to reduce the use of “Site Groups” and replace them with + existing M365 Groups, to help better manage permissions. The View Users action will + display all users from the site/m365 groups. Export this report and review it with the site owners to + determine if content is being over shared.

+

Review Unique Permissions

+
+

The Unique Permissions report may take some time to run, based on the number of + sub-sites and lists/libraries. This report will contain all items that no longer inherit its + permissions. There are actions to view the item, file and to restore the permissions to inherit from its + parent. Export this list and review it with the site owners to determine if they require broken + inheritance.

+
+
+
+
+

Management Tab

+
+

The Management tab has two properties to help address over sharing. The Enable + Guest Access option can be used to ensure content is not shared externally. The ability to + set the default Sensitivity Label is also found here.

+

Features Tab

+
+

The Features tab has two properties to help address over sharing. The Disable + Company Wide Sharing Links can be set to reduce the over sharing of content. The + Show/Hide Content From Search Results can be set to hide content from global search. If + you want to set this option on a sub-site, then you can select the sub-site and set this property in the + Sub-Site tab.

+
+
+
+
+

Based on content stored within the site, + we will provide recommendations for Purview sensitivity labelling.

+

Keyword Search

+
+

The Search Documents audit tool report will allow you to find content by keyword. Based + on content found, you can set the default sensitivity label for the site/library or apply a sensitivity + label to all files within a library or folder.

+
+

The sample output report will have the ability to view/download the file, as well as delete it. Discuss + this report with the site owners and apply sensitivity labels per their guidance or to delete the + content.

+

Set Site Default Sensitivity Label

+
+

Under the Management tab, you can set the default sensitivity label. You must apply the + changes in the Changes tab to apply it.

+

Set Library Default Sensitivity Label

+
+
+

 

+

Run the Lists/Libraries + audit tool report, and select the Default Label option for the target library.

+
+

A form will be displayed for you to select the default sensitivity label.

+

Set Folder/Files Sensitivity Label

+
+

Similar to setting the default label for a library, you have another option to apply sensitivity labels + to the files in the library. The default label applied doesn't update the content within the library, it + will only apply to new or updates to existing content. Clicking on the Label Files + option, will display a form to apply sensitivity labels.

+
+

By default, files that haven't been tagged will apply the selected label. There is an option to override + existing labels applied to files, but this may not work based on the current label. This follows rules + set by Purview and will show the error message in the output report. The ability to select a folder (at + the root level only) to target is also available, instead of the entire library.

+
+
+
+
+
`; + +// Export the page +export const DataReadiness = new PageTemplate(CanvasContent, "4d5a1bbe-e47a-43b4-b3a1-3ff33d0c2fcb", + "8d297e14-676c-4fc3-880f-b4873451ccbb", "47e1d508-a230-4984-8c41-2a272a5b255c", + "/sites/Dev/SiteAssets/SitePages/CopilotDataReadiness", { + "1004145298": "20eef9f5-daae-4c4b-8e2e-99fcd2f724d9", + "178240801": "f06e61dc-1933-452d-9cda-1a9dfd14c47e", + "1439995666": "d4440c71-3b19-4245-aeff-b5c82a1c1ab3", + "2009954068": "45d11c06-e977-4ecf-8f18-5ef7f9fa357f", + "2403381788": "03bfff8a-355a-45f7-bfeb-5f388541e472", + "2492974796": "1e575195-9b15-423b-90d7-7eb26ba90042", + "2498076700": "c2e27e9e-2c2f-413e-877b-0b3d1514643d", + "3194998129": "c13f26e3-5d11-444b-bfea-d65c0285cfc4", + "3423846637": "ff0c726d-307b-4f7f-a007-a2880713f5e0", + "3608935117": "3548b591-6f2d-48ed-82cb-4511d14d1112", + "3614134656": "9578c9cd-90f1-4de8-8429-0a924708011c", + "3639654909": "c9d0727f-e330-4999-8e8f-f9164d1ccf32", + "3707825808": "f0ff99b6-3ddd-4d1e-8c1a-0a5161135d0a", + "394511437": "b5039e67-e155-41fd-bf46-7423bc33c3cd", + "4193189816": "764ec5e0-430b-4de2-9f4d-cce3738bf310", + "704156399": "9fff543e-e3b6-4015-97e6-f8b368feb186", + "734992370": "4f4d503d-9524-42ae-9fe8-afe52bdfbe95", + "782453716": "c732bee6-491d-4f1e-b4c5-ccfb3012e88f", + "878621426": "bde8a163-4d8c-46f7-802a-c49c8e9ae14b", + "926485291": "48a4e7be-7aa1-4b65-81ea-dcf493f23fb4", + "956444907": "e3a17d56-0de4-4449-854d-160b546c19f0" +}); \ No newline at end of file diff --git a/src/page-generator/index.ts b/src/page-generator/index.ts index 6dc8f08..8688171 100644 --- a/src/page-generator/index.ts +++ b/src/page-generator/index.ts @@ -1,7 +1,8 @@ import { LoadingDialog, Modal } from "dattatable"; import { Components, ContextInfo, Helper, SitePages, SPTypes, Web } from "gd-sprest-bs"; import Strings from "../strings"; -import { Template } from "./template"; +import { DataReadiness } from "./data-readiness"; +import { PageTemplate } from "./template"; /** * Page Generator @@ -28,13 +29,13 @@ export class PageGenerator { // Get the folder url of the page let pageFolderName = page.file.Name.replace('.aspx', ""); - // Upload the images for the page - this.uploadImages(pageFolderName, page.item.Id).then(template => { - // Update the loading dialog - LoadingDialog.setBody("Configuring the page..."); + // Update the loading dialog + LoadingDialog.setBody("Configuring the page..."); + // Upload the images + this.uploadImages(pageFolderName, page.item.Id, DataReadiness).then(pageTemplate => { // Set the content for the page - page.item.update(template.CanvasContent1).execute(() => { + page.item.update({ CanvasContent1: pageTemplate.Content }).execute(() => { // Show the page in a new tab window.open(page.page.AbsoluteUrl, "_blank"); @@ -146,13 +147,13 @@ export class PageGenerator { } // Uploads the images for the site page - private uploadImages(pageFolderName: string, pageItemId: number): PromiseLike