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
19 changes: 17 additions & 2 deletions assets/function-app.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -372,10 +372,11 @@ if ($item -ne $null) {
Write-Host "Setting NoCrawl to $value...";

# See if we are setting turning it off
if($value -eq "true") {
if ($value -eq "true") {
# Set the no crawl property
Set-PnPWeb -NoCrawl:$true;
} else {
}
else {
# Set the no crawl property
Set-PnPWeb -NoCrawl:$false;
}
Expand All @@ -386,6 +387,20 @@ if ($item -ne $null) {
# Disable custom scripts
Set-PnPSite -Identity $siteUrl -NoScriptSite $true;
}
"Restrict Content Discovery" {
# Log
Write-Host "Setting RestrictContentOrgWideSearch to $value...";

# See if we are setting turning it off
if ($value -eq "true") {
# Set the no crawl property
Set-PnPSite -Identity $siteUrl -RestrictContentOrgWideSearch:$true;
}
else {
# Set the no crawl property
Set-PnPSite -Identity $siteUrl -RestrictContentOrgWideSearch:$false;
}
}
"Site Attestation" {
# Log
Write-Host "Setting NoScriptSite to false...";
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"datatables.net": "^2.3.2",
"datatables.net-bs5": "^2.3.2",
"dattatable": "^2.11.45",
"gd-sprest-bs": "^10.15.16",
"gd-sprest-bs": "^10.15.17",
"jquery": "^3.7.1",
"moment": "^2.30.1"
},
Expand Down
3 changes: 3 additions & 0 deletions spfx/src/webparts/siteAdmin/SiteAdminWebPart.manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@
"SitePropNoCrawl": false,
"SitePropNoCrawlDescription": "If true, content from this site collection will be excluded from search.",
"SitePropNoCrawlLabel": "Remove Site From Search Results:",
"SitePropRestrictContentDiscovery": false,
"SitePropRestrictContentDiscoveryDescription": "If true, content from this site collection will be excluded from global search.",
"SitePropRestrictContentDiscoveryLabel": "Restrict Content Discovery",
"SitePropSensitivityLabelId": false,
"SitePropSensitivityLabelIdDescription": "Sets the default sensitivity label for this site.",
"SitePropSensitivityLabelIdLabel": "Sensitivity Label:",
Expand Down
4 changes: 4 additions & 0 deletions spfx/src/webparts/siteAdmin/SiteAdminWebPart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ export interface ISiteAdminWebPartProps {
SitePropNoCrawl: boolean;
SitePropNoCrawlDescription: string;
SitePropNoCrawlLabel: string;
SitePropRestrictContentDiscovery: boolean;
SitePropRestrictContentDiscoveryDescription: string;
SitePropRestrictContentDiscoveryLabel: string;
SitePropSensitivityLabelId: boolean;
SitePropSensitivityLabelIdDescription: string;
SitePropSensitivityLabelIdLabel: string;
Expand Down Expand Up @@ -276,6 +279,7 @@ export default class SiteAdminWebPart extends BaseClientSideWebPart<ISiteAdminWe
"SitePropIncreaseStorage",
"SitePropLockState",
"SitePropNoCrawl",
"SitePropRestrictContentDiscovery",
"SitePropSensitivityLabelId",
"SitePropShareByEmailEnabled",
"SitePropSocialBarOnSitePagesDisabled",
Expand Down
1 change: 1 addition & 0 deletions spfx/src/webparts/siteAdmin/loc/en-us.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ define([], function () {
"SitePropIncreaseStorage": "Increase Site Storage",
"SitePropLockState": "Lock State",
"SitePropNoCrawl": "Exclude From Search",
"SitePropRestrictContentDiscovery": "Restrict Content Discovery",
"SitePropSensitivityLabelId": "Sensitivity Label",
"SitePropShareByEmailEnabled": "Shared By Email",
"SitePropSocialBarOnSitePagesDisabled": "Social Bar on Site Pages",
Expand Down
1 change: 1 addition & 0 deletions spfx/src/webparts/siteAdmin/loc/mystrings.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ declare interface ISiteAdminWebPartStrings {
SitePropIncreaseStorage: string;
SitePropLockState: string;
SitePropNoCrawl: string;
SitePropRestrictContentDiscovery: string;
SitePropSensitivityLabelId: string;
SitePropShareByEmailEnabled: string;
SitePropSocialBarOnSitePagesDisabled: string;
Expand Down
3 changes: 2 additions & 1 deletion src/cfg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ export const Configuration = Helper.SPConfig({
showInEditForm: false,
choices: [
"App Catalog", "Client Side Assets", "Custom Script", "Company Wide Sharing Links",
"Increase Storage", "Lock State", "No Crawl", "Custom Search Property", "Teams Connected"
"Increase Storage", "Lock State", "No Crawl", "Custom Search Property", "Restrict Content Discovery",
"Teams Connected"
]
} as Helper.IFieldInfoChoice,
{
Expand Down
2 changes: 2 additions & 0 deletions src/ds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ export enum RequestTypes {
IncreaseStorage = "Increase Storage",
LockState = "Lock State",
NoCrawl = "No Crawl",
RestrictContentDiscovery = "Restrict Content Discovery",
SearchProperty = "Custom Search Property",
SiteAttestation = "Site Attestation",
TeamsConnected = "Teams Connected"
Expand Down Expand Up @@ -582,6 +583,7 @@ export class DataSource {
"HubSiteId",
"Id",
"IsHubSite",
"IsRestrictContentOrgWideSearchPolicyEnforcedOnSite",
"MediaTranscriptionDisabled",
"Owner",
"ReadOnly",
Expand Down
104 changes: 60 additions & 44 deletions src/tabs/features.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ export class FeaturesTab extends Tab<{
CommentsOnSitePagesDisabled: boolean;
DisableCompanyWideSharingLinks: boolean;
ExcludeFromOfflineClient: string;
NoCrawl: string;
NoCrawl: boolean;
RestrictContentDiscovery: boolean;
SocialBarOnSitePagesDisabled: boolean;
}, {
ClientSideAssets: IRequest;
Expand All @@ -32,7 +33,8 @@ export class FeaturesTab extends Tab<{
CommentsOnSitePagesDisabled: DataSource.Site.CommentsOnSitePagesDisabled,
DisableCompanyWideSharingLinks: DataSource.Site.DisableCompanyWideSharingLinks,
ExcludeFromOfflineClient: null,
NoCrawl: null,
NoCrawl: DataSource.Web.NoCrawl,
RestrictContentDiscovery: DataSource.Site.IsRestrictContentOrgWideSearchPolicyEnforcedOnSite,
SocialBarOnSitePagesDisabled: DataSource.Site.SocialBarOnSitePagesDisabled
}

Expand All @@ -58,24 +60,6 @@ export class FeaturesTab extends Tab<{
});
}

// Check the no crawl property
if (this._currValues.NoCrawl) {
let hideContent = this._currValues.NoCrawl == "Hide";

// Add the request
requests.push({
oldValue: "",
newValue: !hideContent,
request: {
key: RequestTypes.NoCrawl,
message: `The request to ${hideContent ? "hide" : "show"} content from search will be processed within 5 minutes.`,
value: !hideContent
},
scope: "Web",
url: DataSource.SiteContext.SiteFullUrl
});
}

// Return the requests
return requests;
}
Expand Down Expand Up @@ -157,37 +141,53 @@ export class FeaturesTab extends Tab<{
}
} as Components.IFormControlPropsSwitch,
{
name: "ExcludeFromOfflineClient",
label: this._props["ExcludeFromOfflineClient"].label,
description: "This will apply to all sites.",
isDisabled: this._props["ExcludeFromOfflineClient"].disabled,
type: Components.FormControlTypes.Dropdown,
items: [
{ text: "", value: "" },
{ text: "Show", value: "Show" },
{ text: "Hide", value: "Hide" }
],
name: "RestrictContentDiscovery",
label: this._props["RestrictContentDiscovery"].label,
description: this._props["RestrictContentDiscovery"].description,
isDisabled: this._props["RestrictContentDiscovery"].disabled,
type: Components.FormControlTypes.Switch,
value: this._currValues.RestrictContentDiscovery,
onChange: item => {
// Set the value
this._currValues.ExcludeFromOfflineClient = item ? item.value : null;
let value = item ? true : false;

// See if we are changing the value
if (this._currValues.DisableCompanyWideSharingLinks != value) {
// Set the value
this._requestItems.DisableCompanyWideSharingLinks = {
key: RequestTypes.DisableCompanyWideSharingLinks,
message: `The request to ${value ? "enable" : "disable"} the restriction from global search will be processed within 5 minutes.`,
value
};
} else {
// Remove the value
delete this._requestItems.DisableCompanyWideSharingLinks;
}
}
} as Components.IFormControlPropsDropdown,
} as Components.IFormControlPropsSwitch,
{
name: "NoCrawl",
label: this._props["NoCrawl"].label,
description: "This will apply to all sites.",
description: "This will remove all content for this site from global search.",
isDisabled: this._props["NoCrawl"].disabled,
type: Components.FormControlTypes.Dropdown,
items: [
{ text: "", value: "" },
{ text: "Show", value: "Show" },
{ text: "Hide", value: "Hide" }
],
type: Components.FormControlTypes.Switch,
value: this._currValues.NoCrawl,
onChange: item => {
// Set the value
this._currValues.NoCrawl = item ? item.value : null;
let value = item ? true : false;

// See if we are changing the value
if (this._currValues.NoCrawl != value) {
// Set the value
this._requestItems.DisableCompanyWideSharingLinks = {
key: RequestTypes.NoCrawl,
message: `The request to ${value ? "hide" : "show"} content from search will be processed within 5 minutes.`,
value
};
} else {
// Remove the value
delete this._requestItems.NoCrawl;
}
}
} as Components.IFormControlPropsDropdown,
} as Components.IFormControlPropsSwitch,
{
name: "SocialBarOnSitePagesDisabled",
label: this._props["SocialBarOnSitePagesDisabled"].label,
Expand All @@ -207,7 +207,23 @@ export class FeaturesTab extends Tab<{
delete this._newValues.SocialBarOnSitePagesDisabled;
}
}
} as Components.IFormControlPropsSwitch
} as Components.IFormControlPropsSwitch,
{
name: "ExcludeFromOfflineClient",
label: this._props["ExcludeFromOfflineClient"].label,
description: "This will apply to all sites.",
isDisabled: this._props["ExcludeFromOfflineClient"].disabled,
type: Components.FormControlTypes.Dropdown,
items: [
{ text: "", value: "" },
{ text: "Show", value: "Show" },
{ text: "Hide", value: "Hide" }
],
onChange: item => {
// Set the value
this._currValues.ExcludeFromOfflineClient = item ? item.value : null;
}
} as Components.IFormControlPropsDropdown
]
});
}
Expand Down
33 changes: 18 additions & 15 deletions src/tabs/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,24 +189,27 @@ export class Tabs {

// Method to refresh the web tab
refreshWebTab(url: string) {
// Show a loading dialog
LoadingDialog.setHeader("Loading Web");
LoadingDialog.setBody("Loading the selected web...");
LoadingDialog.show();

// Update the requests
this._webRequests = this._webRequests.concat(this._tabWeb.getRequests());
if (this._tabWeb) {
// Show a loading dialog
LoadingDialog.setHeader("Loading Web");
LoadingDialog.setBody("Loading the selected web...");
LoadingDialog.show();

// Load the web
DataSource.loadWebInfo(url).then(() => {
// Update the tab name
this._elWebTab.innerHTML = DataSource.Site.RootWeb.Id == DataSource.Web.Id ? "Top Site" : "Sub Site";
// Append the sub-webs
this._webRequests = this._webRequests.concat(this._tabWeb.getRequests());

// Refresh the web tab
this._tabWeb.refresh();
// Load the web
DataSource.loadWebInfo(url).then(() => {
// Update the tab name
this._elWebTab.innerHTML = DataSource.Site.RootWeb.Id == DataSource.Web.Id ? "Top Site" : "Sub Site";

// Hide the loading dialog
LoadingDialog.hide();
});
// Refresh the web tab
this._tabWeb.refresh();

// Hide the loading dialog
LoadingDialog.hide();
});
}
}
}