Skip to content
Merged
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
7 changes: 6 additions & 1 deletion src/reports/dlp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export class DLP {
private static _elSubNav: HTMLElement = null;
private static _items: IDLPItem[] = [];
private static _loadOneDrive: boolean = false;
private static _maxItemCount: number = 0;
private static _stopFl: boolean = false;

// Gets the form fields to display
Expand Down Expand Up @@ -79,6 +80,9 @@ export class DLP {
// See if we are stopping this process
if (this._stopFl) { return; }

// See if we are skipping large lists
if (this._maxItemCount > 0 && lib.ItemCount > this._maxItemCount) { return; }

// Update the dialog
this._elSubNav.children[0].innerHTML = `${siteText} [Analyzing Library ${++counter} of ${libraries.length}]: ${lib.Title}`;

Expand Down Expand Up @@ -540,6 +544,7 @@ export class DLP {
static run(el: HTMLElement, auditOnly: boolean, values: { [key: string]: string }, onClose: () => void) {
let data: IWebItem[] = [];
this._loadOneDrive = values["LoadOneDrive"] == "true";
this._maxItemCount = parseInt(values["SkipLargeLists"]) || 0;
this._stopFl = false;

// Clear the items
Expand Down Expand Up @@ -586,7 +591,7 @@ export class DLP {
web.Lists().query({
Filter: `Hidden eq false and BaseTemplate eq ${SPTypes.ListTemplateType.DocumentLibrary} or BaseTemplate eq ${SPTypes.ListTemplateType.MySiteDocumentLibrary} or BaseTemplate eq ${SPTypes.ListTemplateType.PageLibrary}`,
GetAllItems: true,
Select: ["Id", "Title"],
Select: ["Id", "Title", "ItemCount"],
Top: 5000
}).execute(libs => {
// Add the libraries to analyze
Expand Down
5 changes: 5 additions & 0 deletions src/reports/searchAgents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export class SearchAgents {
private static _elSubNav: HTMLElement = null;
private static _items: IAgentItem[] = null;
private static _loadOneDrive: boolean = null;
private static _maxItemCount: number = 0;
private static _stopFl: boolean = false;

// Analyzes a library
Expand Down Expand Up @@ -92,6 +93,9 @@ export class SearchAgents {
// See if we are stopping this process
if (this._stopFl) { return; }

// See if we are skipping large lists
if (this._maxItemCount > 0 && lib.ItemCount > this._maxItemCount) { return; }

// Show a dialog
this._elSubNav.children[0].innerHTML = `${siteText} - [Analyzing Library ${++ctrList} of ${libs.length}]: ${lib.Title}`;

Expand Down Expand Up @@ -218,6 +222,7 @@ export class SearchAgents {
// Runs the report
static run(el: HTMLElement, auditOnly: boolean, values: { [key: string]: any }, onClose: () => void) {
this._loadOneDrive = values["LoadOneDrive"] == "true";
this._maxItemCount = parseInt(values["SkipLargeLists"]) || 0;
this._stopFl = false;

// Show a loading dialog
Expand Down
7 changes: 6 additions & 1 deletion src/reports/sensitivityLabels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export class SensitivityLabels {
private static _filterLabels: string[] = [];
private static _items: ISensitivityLabelItem[] = [];
private static _loadOneDrive: boolean = false;
private static _maxItemCount: number = 0;
private static _stopFl: boolean = false;

// Analyzes the libraries
Expand All @@ -66,6 +67,9 @@ export class SensitivityLabels {
// See if we are stopping this process
if (this._stopFl) { return; }

// See if we are skipping large lists
if (this._maxItemCount > 0 && lib.ItemCount > this._maxItemCount) { return; }

// Update the dialog
this._elSubNav.children[0].innerHTML = `${siteText} [Analyzing Library ${++counter} of ${libraries.length}]: ${lib.Title}`;

Expand Down Expand Up @@ -460,6 +464,7 @@ export class SensitivityLabels {
static run(el: HTMLElement, auditOnly: boolean, values: { [key: string]: string }, onClose: () => void) {
let data: IWebItem[] = [];
this._loadOneDrive = values["LoadOneDrive"] == "true";
this._maxItemCount = parseInt(values["SkipLargeLists"]) || 0;
this._stopFl = false;

// Clear the items
Expand Down Expand Up @@ -529,7 +534,7 @@ export class SensitivityLabels {
Filter: filter,
Expand: ["RootFolder"],
GetAllItems: true,
Select: ["Id", "Title", "RootFolder/ServerRelativeUrl"],
Select: ["Id", "ItemCount", "Title", "RootFolder/ServerRelativeUrl"],
Top: 5000
}).execute(libs => {
// Add the libraries to analyze
Expand Down
7 changes: 6 additions & 1 deletion src/reports/uniquePermissions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export class UniquePermissions {
private static _elSubNav: HTMLElement = null;
private static _items: IPermission[] = [];
private static _loadOneDrive: boolean = false;
private static _maxItemCount: number = 0;
private static _stopFl: boolean = false;

// Analyzes a list
Expand Down Expand Up @@ -333,6 +334,7 @@ export class UniquePermissions {
// Runs the report
static run(el: HTMLElement, auditOnly: boolean, values: { [key: string]: string }, onClose: () => void) {
this._loadOneDrive = values["LoadOneDrive"] == "true";
this._maxItemCount = parseInt(values["SkipLargeLists"]) || 0;
this._stopFl = false;

// Show a loading dialog
Expand Down Expand Up @@ -378,7 +380,7 @@ export class UniquePermissions {
web.Lists().query({
Filter: "Hidden eq false",
Expand: ["DefaultDisplayFormUrl", "DefaultViewFormUrl", "RootFolder"],
Select: ["BaseTemplate", "Id", "Title", "HasUniqueRoleAssignments", "RootFolder/ServerRelativeUrl"]
Select: ["BaseTemplate", "Id", "ItemCount", "Title", "HasUniqueRoleAssignments", "RootFolder/ServerRelativeUrl"]
}).execute(lists => {
let ctrList = 0;

Expand All @@ -390,6 +392,9 @@ export class UniquePermissions {
// See if we are stopping this process
if (this._stopFl) { return; }

// See if we are skipping large lists
if (this._maxItemCount > 0 && list.ItemCount > this._maxItemCount) { return; }

// Update the dialog
this._elSubNav.children[0].innerHTML = `${siteText} - [Analyzing Library ${++ctrList} of ${lists.results.length}]: ${list.Title}`;

Expand Down
28 changes: 28 additions & 0 deletions src/tabs/reports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,33 @@ export class ReportsTab {
}
}

// See if this is a report is analyzing lists
switch (this._selectedReport) {
case ReportTypes.DLP:
case ReportTypes.SearchAgents:
case ReportTypes.SearchDocs:
case ReportTypes.SensitivityLabels:
case ReportTypes.UniquePermissions:
// Add a control to skip large lists/libraries
this._form.appendControls([{
name: "SkipLargeLists",
label: "Skip Large Lists",
description: "Skips lists/libraries that have more than the items specified.",
type: Components.FormControlTypes.Dropdown,
items: [
{ text: "All Lists", value: "0", isSelected: true },
{ text: ">500 Items", value: "500" },
{ text: ">1000 Items", value: "1000" },
{ text: ">5000 Items", value: "1000" },
{ text: ">10000 Items", value: "10000" },
{ text: ">25000 Items", value: "25000" },
{ text: ">50000 Items", value: "50000" },
{ text: ">100000 Items", value: "100000" },
]
} as Components.IFormControlPropsDropdown]);
break;
}

// Add the controls
switch (this._selectedReport) {
case ReportTypes.DLP:
Expand Down Expand Up @@ -292,6 +319,7 @@ export class ReportsTab {
// Set the form values
let formValues = this._form.getValues();
formValues["LoadOneDrive"] = this._loadOneDrive ? "true" : "false";
formValues["SkipLargeLists"] = formValues["SkipLargeLists"]?.value || "0";

// See if we are targeting a sub-web
if (DataSource.WebOnly) {
Expand Down
Loading