From 3202ab23092c48ac4cb651ea75b9f6a238f67921 Mon Sep 17 00:00:00 2001 From: Hugo Bernier Date: Wed, 29 Nov 2023 22:01:15 -0500 Subject: [PATCH] Added container, sample.json, and nvmrc --- .../.devcontainer/devcontainer.json | 31 +++ .../.devcontainer/spfx-startup.sh | 33 ++++ samples/react-governor-sharing/.nvmrc | 1 + samples/react-governor-sharing/README.md | 139 ++++++------- .../react-governor-sharing/assets/sample.json | 182 ++++++++++++++++++ .../src/webparts/sharing/SharingWebPart.ts | 4 +- .../components/SharingView/DataProvider.ts | 3 + .../components/SharingView/ISharingResult.ts | 1 + .../SharingView/ISharingViewProps.ts | 1 + .../SharingView/ISharingViewState.ts | 1 + .../SharingView/SharingViewSingle.tsx | 11 +- .../sharing/components/SharingView/Utils.ts | 4 + 12 files changed, 341 insertions(+), 70 deletions(-) create mode 100644 samples/react-governor-sharing/.devcontainer/devcontainer.json create mode 100644 samples/react-governor-sharing/.devcontainer/spfx-startup.sh create mode 100644 samples/react-governor-sharing/.nvmrc create mode 100644 samples/react-governor-sharing/assets/sample.json diff --git a/samples/react-governor-sharing/.devcontainer/devcontainer.json b/samples/react-governor-sharing/.devcontainer/devcontainer.json new file mode 100644 index 000000000..e43c0816c --- /dev/null +++ b/samples/react-governor-sharing/.devcontainer/devcontainer.json @@ -0,0 +1,31 @@ +{ + "name": "SPFx 1.18.0", + "image": "docker.io/m365pnp/spfx:1.18.0", + "settings": { + + }, + "extensions": [ + "editorconfig.editorconfig", + "dbaeumer.vscode-eslint" + ], + "forwardPorts": [ + 4321, + 35729 + ], + "portsAttributes": { + "4321": { + "protocol": "https", + "label": "Manifest", + "onAutoForward": "silent", + "requireLocalPort": true + }, + "35729": { + "protocol": "https", + "label": "LiveReload", + "onAutoForward": "silent", + "requireLocalPort": true + } + }, + "postCreateCommand": "bash .devcontainer/spfx-startup.sh", + "remoteUser": "node" +} diff --git a/samples/react-governor-sharing/.devcontainer/spfx-startup.sh b/samples/react-governor-sharing/.devcontainer/spfx-startup.sh new file mode 100644 index 000000000..456d6aea8 --- /dev/null +++ b/samples/react-governor-sharing/.devcontainer/spfx-startup.sh @@ -0,0 +1,33 @@ +echo +echo -e "\e[1;94mInstalling Node dependencies\e[0m" +npm install + +## commands to create dev certificate and copy it to the root folder of the project +echo +echo -e "\e[1;94mGenerating dev certificate\e[0m" +gulp trust-dev-cert + +# Convert the generated PEM certificate to a CER certificate +openssl x509 -inform PEM -in ~/.rushstack/rushstack-serve.pem -outform DER -out ./spfx-dev-cert.cer + +# Copy the PEM ecrtificate for non-Windows hosts +cp ~/.rushstack/rushstack-serve.pem ./spfx-dev-cert.pem + +## add *.cer to .gitignore to prevent certificates from being saved in repo +if ! grep -Fxq '*.cer' ./.gitignore + then + echo "# .CER Certificates" >> .gitignore + echo "*.cer" >> .gitignore +fi + +## add *.pem to .gitignore to prevent certificates from being saved in repo +if ! grep -Fxq '*.pem' ./.gitignore + then + echo "# .PEM Certificates" >> .gitignore + echo "*.pem" >> .gitignore +fi + +echo +echo -e "\e[1;92mReady!\e[0m" + +echo -e "\n\e[1;94m**********\nOptional: if you plan on using gulp serve, don't forget to add the container certificate to your local machine. Please visit https://aka.ms/spfx-devcontainer for more information\n**********" \ No newline at end of file diff --git a/samples/react-governor-sharing/.nvmrc b/samples/react-governor-sharing/.nvmrc new file mode 100644 index 000000000..9e15be387 --- /dev/null +++ b/samples/react-governor-sharing/.nvmrc @@ -0,0 +1 @@ +v16.20.0 diff --git a/samples/react-governor-sharing/README.md b/samples/react-governor-sharing/README.md index d39625bd5..8f4f18564 100644 --- a/samples/react-governor-sharing/README.md +++ b/samples/react-governor-sharing/README.md @@ -5,15 +5,16 @@ SPFx WebPart shows documents which have been (explicitly) shared within a SharePoint site or Team. It does this by using the following steps: -- Issueing a Search Query (KQL) against the Graph API to retrieve documents where the managed property SharedWithUsersOWSUSER contains a value -- Iterate through the result of the search query to get the permissions (e.g. sharing information) per file (/permissions endpoint of driveItems on GraphAPI) -- Show the results in a ShimmeredDetailsList and the Pagination control for paging the results -- By selecting a document and clicking on the Sharing Settings button will open the Manage Access pane for further review of the sharing + +- Issuing a Search Query (KQL) against the Graph API to retrieve documents where the managed property `SharedWithUsersOWSUSER` contains a value +- Iterate through the result of the search query to get the permissions (e.g. sharing information) per file (`/permissions` endpoint of `driveItems` on GraphAPI) +- Show the results in a `ShimmeredDetailsList` and the Pagination control for paging the results +- By selecting a document and clicking on the **Sharing Settings** button will open the **Manage Access** pane for further review of the sharing Here is an example with a list of shared documents, with a clear distinction when they are shared with external users (notice the tooltip & icon in front of the document) ![Example Image](/assets/screenshot.png) -When you want to know more about the sharing settings of a particlar document, you can select the document and then click on the Sharing Settings button, this will open up the Manage Access page for the selected document which tells you that a sharing link was created for the external user. +When you want to know more about the sharing settings of a particular document, you can select the document and then click on the ==Sharing Settings<== button, this will open up the Manage Access page for the selected document which tells you that a sharing link was created for the external user. ![Example Image](/assets/screenshot2.png) ## Compatibility @@ -43,7 +44,7 @@ This sample is optimally compatible with the following environment configuration ## Contributors -* [Robin Meure](https://github.com/robinmeure) +- [Robin Meure](https://github.com/robinmeure) ## Version history @@ -53,114 +54,107 @@ This sample is optimally compatible with the following environment configuration ## Minimal Path to Awesome -* Clone this repository -* Move to right solution folder -* in the command line run: - * `npm install` - * `gulp serve` +- Clone this repository +- Move to right solution folder +- in the command line run: + - `npm install` + - `gulp serve` -## Deployment Overview -- [SharePoint App Deployment](#sharepoint-app-deployment) - - [Prerequisites](#prerequisites-1) - - [Step 1 - Add the app to the SharePoint App catalog](#step-1---add-the-app-to-the-sharepoint-app-catalog) - - [Step 2 - Provide API consent](#step-2---provide-api-consent) - - [Step 3 - Adding the app to a SharePoint site](#step-3---adding-the-app-to-a-sharepoint-site) +## SharePoint App Deployment -- [Teams App Deployment](#teams-app-deployment) - - [Prerequisites](#prerequisites-2) - - [Step 1 - Add the app to Teams App Catalog](#step-1---add-the-app-to-teams-app-catalog) - - [Step 2 - Add the app to a Teams a tab](#step-2---add-the-app-to-a-teams-a-tab) +### Prerequisites -# SharePoint App Deployment - -## Prerequisites - A copy of the solution .sppkg package. -- The user deploying an app must be a SharePoint Administrator or Global Administrator in Microsoft 365. +- The user deploying an app must be a SharePoint Administrator or Global Administrator in Microsoft 365. - The same user needs to approve and provide consent for the API permissions (this to call the Graph Search endpoint). -## Step 1 - Add the app to the SharePoint App catalog +### Step 1 - Add the app to the SharePoint App catalog Follow the steps below to add the app to the SharePoint App catalog: - Go to [More features](https://go.microsoft.com/fwlink/?linkid=2185077) in the SharePoint admin center, and sign in with an account that has the SharePoint Administrator or Global Administrator for your organization. - Under Apps, select Open. If you didn’t have an app catalog before, it might take a few minutes to load. - +![Manage Apps](assets/SharePoint_Admin_Center_Manage_apps.png) -- On the Manage apps page, click Upload, and browse to location fo the app package. The package file should have .sppkg extension. -- Select Enable this app and add it to all sites. This will automatically add the app to the sites, so that site owners will not need to do it themselves. Unchecked the box Add to Teams. If you want to add the App to Teams you need to follow these instructions. Click Enable app at the bottom of the side panel. +- On the Manage apps page, click **Upload**, and browse to location for the app package. The package file should have .sppkg extension. +- Select **Enable this app and add it to all sites**. This will automatically add the app to the sites, so that site owners will not need to do it themselves. Uncheck the box **Add to Teams**. If you want to add the App to Teams, you need to follow these instructions. Click **Enable app** at the bottom of the side panel. - +![Enable app](assets/SharePoint_Admin_Center_Enable_app.png) -## Step 2 - Provide API consent +### Step 2 - Provide API consent After the API is Enable you will need to provide consent. For this step you need the Global Administrator role. -You will provide delegated permissions that will allow the application to act on a user's behalf. The application will never be able to access anything the signed in user themselves couldn't access. To learn more about delegated permissions see: https://learn.microsoft.com/en-us/entra/identity-platform/permissions-consent-overview#types-of-permissions +You will provide delegated permissions that will allow the application to act on a user's behalf. The application will never be able to access anything the signed in user themselves couldn't access. To learn more about delegated permissions see: -- Click on Go to the API access page. +- Click on **Go to the API access** page. - +![SharePoint Admin Center API Consent](assets/SharePoint_Admin_Center_API_Consent.png | width=300) -- Click Approve to provide consent. +- Click **Approve** to provide consent. - +![SharePoint Admin Center API Consent](assets/SharePoint_Admin_Center_API_Consent_Approve.png | width=600) -## Step 3 - Adding the app to a SharePoint site +### Step 3 - Adding the app to a SharePoint site - On the site where you want to use the app go to a page and open it for editing or create a new page for this purpose. -- Click on the “+” to add a new web part and search for “Governor sharing”. Click on it to add it to the page. +- Click on the **"+"** to add a new web part and search for "Governor sharing". Click on it to add it to the page. - +![Governor Sharing Add to SharePoint Site](assets/Governor_Sharing_AddtoSharePointSite.png) - The webpart should now be added to your page. - +![Shared Items Example](assets/Governor_Sharing_SharedItemsExample.png) - Save or Republish the page to see the changes applied. -# Teams App Deployment +## Teams App Deployment For the Teams App deployment, the app needs to be deployed to the SharePoint App Catalog first (Step 1 and Step 2). -## Prerequisites +### Prerequisites + - A copy of the Teams Apps solution [package](/assets/governorsharing_teamspackage.zip) - The user deploying the app must be a Teams Administrator or Global Administrator in Microsoft 365. -## Step 1 - Add the app to Teams App Catalog +### Step 1 - Add the app to Teams App Catalog -- Browse to the Manage Apps page in the Teams Admin Center: https://admin.teams.microsoft.com/policies/manage-apps -- Click Upload new App, Click Upload and browse to the teams app package location. The package file should have .zip extension. After selecting the package click Open. The app will be uploaded. +- Browse to the Manage Apps page in the Teams Admin Center: +- Click **Upload new App**, click **Upload** and browse to the teams app package location. The package file should have .zip extension. After selecting the package, click **Open**. The app will be uploaded. - +![Teams Admin Center Manage Apps](assets/Teams_Admin_Center_Manage_apps.png) - +![Teams Admin Center Manage Apps Upload](assets/Teams_Admin_Center_Manage_apps_Upload.png) - +![Teams Admin Center Manage Apps Uploaded](assets/Teams_Admin_Center_Manage_apps_Uploaded.png) -- You may need to adjust your Teams App policies to make the app availabe for you organisation. For more information see https://learn.microsoft.com/en-us/microsoftteams/teams-app-permission-policies. +- You may need to adjust your Teams App policies to make the app available for you organization. For more information see . -## Step 2 - Add the app to a Teams a tab +### Step 2 - Add the app to a Teams a tab -- Go to MS Teams and click on the Apps on the left bar to open the App store of Teams. -- On the left menu choose Built for your Org option to prefilter the apps and select “Governor sharing”. Click Add. +- Go to MS Teams and click on the **Apps** on the left bar to open the App store of Teams. +- On the left menu choose **Built for your Org** option to pre-filter the apps and select "Governor sharing". Click **Add**. - +![Governor Sharing Add to Team](assets/Governor_Sharing_AddtoTeam.png | width=500) -- Click on Add to a team, choose a team and a channel where you want the app to be added and click Set up a tab on the bottom right of the pop-up window. - +- Click on **Add to a team**, choose a team and a channel where you want the app to be added and click **Set up a tab** on the bottom right of the pop-up window. + - + -- Click on Save +- Click on **Save** + + +![Governor Sharing Add to Team Save](assets/Governor_Sharing_AddtoTeam_Save.png) - - The app has been added to a Team. The settings panel on the right side can be closed. - + +![Governor Sharing Added to Team](assets/Governor_Sharing_AddedtoTeam.png) -# Troubleshooting +## Troubleshooting If you face any other errors, you can enable the debugging mode from the configuration pane. When this is enabled, there is a lot more details being outputted to the written to the console. @@ -168,19 +162,34 @@ If you face any other errors, you can enable the debugging mode from the configu - In yellow, you see the search results - In blue, you see the transformation of combining the searchresults and the permission calls - +![Debug](assets/debug.png) -## Known errors +### Known errors Issue: We can't upload the app because there's already an app in the catalog with the same app ID. To upload a new app, change the app ID and try again. To update an existing app, go to the app details page. -Solution: Detele the app in the Teams Apps overview and re-add the package. +Solution: Delete the app in the Teams Apps overview and re-add the package. -More information about deleting apps in Teams can found here: https://learn.microsoft.com/en-us/microsoftteams/teams-custom-app-policies-and-settings#delete-custom-apps-from-your-organizations-catalog +More information about deleting apps in Teams can found here: +## Help + +We do not support samples, but this community is always willing to help, and we want to improve these samples. We use GitHub to track issues, which makes it easy for community members to volunteer their time and help resolve issues. + +If you're having issues building the solution, please run [spfx doctor](https://pnp.github.io/cli-microsoft365/cmd/spfx/spfx-doctor/) from within the solution folder to diagnose incompatibility issues with your environment. + +You can try looking at [issues related to this sample](https://github.com/pnp/sp-dev-fx-webparts/issues?q=label%3A%22sample%3A%20react-governor-sharing%22) to see if anybody else is having the same issues. + +You can also try looking at [discussions related to this sample](https://github.com/pnp/sp-dev-fx-webparts/discussions?discussions_q=react-governor-sharing) and see what the community is saying. + +If you encounter any issues using this sample, [create a new issue](https://github.com/pnp/sp-dev-fx-webparts/issues/new?assignees=&labels=Needs%3A+Triage+%3Amag%3A%2Ctype%3Abug-suspected%2Csample%3A%20react-governor-sharing&template=bug-report.yml&sample=react-governor-sharing&authors=@robinmeure&title=react-governor-sharing%20-%20). + +For questions regarding this sample, [create a new question](https://github.com/pnp/sp-dev-fx-webparts/issues/new?assignees=&labels=Needs%3A+Triage+%3Amag%3A%2Ctype%3Aquestion%2Csample%3A%20react-governor-sharing&template=question.yml&sample=react-governor-sharing&authors=@robinmeure&title=react-governor-sharing%20-%20). + +Finally, if you have an idea for improvement, [make a suggestion](https://github.com/pnp/sp-dev-fx-webparts/issues/new?assignees=&labels=Needs%3A+Triage+%3Amag%3A%2Ctype%3Aenhancement%2Csample%3A%20react-governor-sharing&template=suggestion.yml&sample=react-governor-sharing&authors=@robinmeure&title=react-governor-sharing%20-%20). ## Disclaimer **THIS CODE IS PROVIDED _AS IS_ WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.** - \ No newline at end of file + diff --git a/samples/react-governor-sharing/assets/sample.json b/samples/react-governor-sharing/assets/sample.json new file mode 100644 index 000000000..9ce291ef3 --- /dev/null +++ b/samples/react-governor-sharing/assets/sample.json @@ -0,0 +1,182 @@ +{ + "name": "pnp-sp-dev-spfx-web-parts-react-governor-sharing", + "source": "pnp", + "title": "Governor Sharing", + "shortDescription": "Shows documents which have been (explicitly) shared within a SharePoint site or Team.", + "url": "https://github.com/pnp/sp-dev-fx-webparts/tree/main/samples/react-governor-sharing", + "downloadUrl": "https://pnp.github.io/download-partial/?url=https://github.com/pnp/sp-dev-fx-webparts/tree/main/samples/react-governor-sharing", + "longDescription": [ + "Shows documents which have been (explicitly) shared within a SharePoint site or Team." + ], + "creationDateTime": "2023-11-24", + "updateDateTime": "2023-11-24", + "products": [ + "SharePoint" + ], + "metadata": [ + { + "key": "CLIENT-SIDE-DEV", + "value": "React" + }, + { + "key": "SPFX-VERSION", + "value": "1.18.0" + } + ], + "thumbnails": [ + { + "name": "Govenor_Sharing_SharedItemsExample.png", + "type": "image", + "order": 100, + "url": "https://github.com/pnp/sp-dev-fx-webparts/raw/main/samples/react-governor-sharing/assets/Govenor_Sharing_SharedItemsExample.png", + "alt": "Web Part Preview" + }, + { + "name": "debug.png", + "type": "image", + "order": 108, + "url": "https://github.com/pnp/sp-dev-fx-webparts/raw/main/samples/react-governor-sharing/assets/debug.png", + "alt": "Web Part Preview" + }, + { + "name": "Govenor_Sharing_AddedtoTeam.png", + "type": "image", + "order": 101, + "url": "https://github.com/pnp/sp-dev-fx-webparts/raw/main/samples/react-governor-sharing/assets/Govenor_Sharing_AddedtoTeam.png", + "alt": "Web Part Preview" + }, + { + "name": "Govenor_Sharing_AddtoSharePointSite.png", + "type": "image", + "order": 102, + "url": "https://github.com/pnp/sp-dev-fx-webparts/raw/main/samples/react-governor-sharing/assets/Govenor_Sharing_AddtoSharePointSite.png", + "alt": "Web Part Preview" + }, + { + "name": "Govenor_Sharing_AddtoTeam.png", + "type": "image", + "order": 103, + "url": "https://github.com/pnp/sp-dev-fx-webparts/raw/main/samples/react-governor-sharing/assets/Govenor_Sharing_AddtoTeam.png", + "alt": "Web Part Preview" + }, + { + "name": "Govenor_Sharing_AddtoTeamTab.png", + "type": "image", + "order": 104, + "url": "https://github.com/pnp/sp-dev-fx-webparts/raw/main/samples/react-governor-sharing/assets/Govenor_Sharing_AddtoTeamTab.png", + "alt": "Web Part Preview" + }, + { + "name": "Govenor_Sharing_AddtoTeam_Save.png", + "type": "image", + "order": 105, + "url": "https://github.com/pnp/sp-dev-fx-webparts/raw/main/samples/react-governor-sharing/assets/Govenor_Sharing_AddtoTeam_Save.png", + "alt": "Web Part Preview" + }, + { + "name": "Govenor_Sharing_AddtoTeam_Search.png", + "type": "image", + "order": 106, + "url": "https://github.com/pnp/sp-dev-fx-webparts/raw/main/samples/react-governor-sharing/assets/Govenor_Sharing_AddtoTeam_Search.png", + "alt": "Web Part Preview" + }, + { + "name": "Govenor_Sharing_AddtoTeam_SelectTeam.png", + "type": "image", + "order": 107, + "url": "https://github.com/pnp/sp-dev-fx-webparts/raw/main/samples/react-governor-sharing/assets/Govenor_Sharing_AddtoTeam_SelectTeam.png", + "alt": "Web Part Preview" + }, + { + "name": "screenshot.png", + "type": "image", + "order": 109, + "url": "https://github.com/pnp/sp-dev-fx-webparts/raw/main/samples/react-governor-sharing/assets/screenshot.png", + "alt": "Web Part Preview" + }, + { + "name": "screenshot2.png", + "type": "image", + "order": 110, + "url": "https://github.com/pnp/sp-dev-fx-webparts/raw/main/samples/react-governor-sharing/assets/screenshot2.png", + "alt": "Web Part Preview" + }, + { + "name": "SharePoint_Admin_Center_API_Consent.png", + "type": "image", + "order": 111, + "url": "https://github.com/pnp/sp-dev-fx-webparts/raw/main/samples/react-governor-sharing/assets/SharePoint_Admin_Center_API_Consent.png", + "alt": "Web Part Preview" + }, + { + "name": "SharePoint_Admin_Center_API_Consent_Approve.png", + "type": "image", + "order": 112, + "url": "https://github.com/pnp/sp-dev-fx-webparts/raw/main/samples/react-governor-sharing/assets/SharePoint_Admin_Center_API_Consent_Approve.png", + "alt": "Web Part Preview" + }, + { + "name": "SharePoint_Admin_Center_Enable_app.png", + "type": "image", + "order": 113, + "url": "https://github.com/pnp/sp-dev-fx-webparts/raw/main/samples/react-governor-sharing/assets/SharePoint_Admin_Center_Enable_app.png", + "alt": "Web Part Preview" + }, + { + "name": "SharePoint_Admin_Center_Manage_apps.png", + "type": "image", + "order": 114, + "url": "https://github.com/pnp/sp-dev-fx-webparts/raw/main/samples/react-governor-sharing/assets/SharePoint_Admin_Center_Manage_apps.png", + "alt": "Web Part Preview" + }, + { + "name": "SharePoint_Admin_Center__Remove_API_Consent.png", + "type": "image", + "order": 115, + "url": "https://github.com/pnp/sp-dev-fx-webparts/raw/main/samples/react-governor-sharing/assets/SharePoint_Admin_Center__Remove_API_Consent.png", + "alt": "Web Part Preview" + }, + { + "name": "Teams_Admin_Center_Manage_apps.png", + "type": "image", + "order": 116, + "url": "https://github.com/pnp/sp-dev-fx-webparts/raw/main/samples/react-governor-sharing/assets/Teams_Admin_Center_Manage_apps.png", + "alt": "Web Part Preview" + }, + { + "name": "Teams_Admin_Center_Manage_apps_Upload.png", + "type": "image", + "order": 117, + "url": "https://github.com/pnp/sp-dev-fx-webparts/raw/main/samples/react-governor-sharing/assets/Teams_Admin_Center_Manage_apps_Upload.png", + "alt": "Web Part Preview" + }, + { + "name": "Teams_Admin_Center_Manage_apps_Uploaded.png", + "type": "image", + "order": 118, + "url": "https://github.com/pnp/sp-dev-fx-webparts/raw/main/samples/react-governor-sharing/assets/Teams_Admin_Center_Manage_apps_Uploaded.png", + "alt": "Web Part Preview" + }, + { + "name": "Troubleshooting_Teams_App_Already_Exists.png", + "type": "image", + "order": 119, + "url": "https://github.com/pnp/sp-dev-fx-webparts/raw/main/samples/react-governor-sharing/assets/Troubleshooting_Teams_App_Already_Exists.png", + "alt": "Web Part Preview" + } + ], + "authors": [ + { + "gitHubAccount": "robinmeure", + "pictureUrl": "https://github.com/robinmeure.png", + "name": "Robin Meure" + } + ], + "references": [ + { + "name": "Build your first SharePoint client-side web part", + "description": "Client-side web parts are client-side components that run in the context of a SharePoint page. Client-side web parts can be deployed to SharePoint environments that support the SharePoint Framework. You can also use modern JavaScript web frameworks, tools, and libraries to build them.", + "url": "https://docs.microsoft.com/sharepoint/dev/spfx/web-parts/get-started/build-a-hello-world-web-part" + } + ] +} \ No newline at end of file diff --git a/samples/react-governor-sharing/src/webparts/sharing/SharingWebPart.ts b/samples/react-governor-sharing/src/webparts/sharing/SharingWebPart.ts index c943de08f..1c677af29 100644 --- a/samples/react-governor-sharing/src/webparts/sharing/SharingWebPart.ts +++ b/samples/react-governor-sharing/src/webparts/sharing/SharingWebPart.ts @@ -1,3 +1,4 @@ +/* eslint-disable @microsoft/spfx/pair-react-dom-render-unmount */ /* eslint-disable @typescript-eslint/typedef */ import * as React from 'react' import * as ReactDom from 'react-dom'; @@ -7,7 +8,6 @@ import "@pnp/graph/groups"; import { ISharingViewProps } from './components/SharingView/ISharingViewProps'; import { initializeIcons } from '@fluentui/react/lib/Icons'; -import PnPTelemetry from "@pnp/telemetry-js"; import "@pnp/sp/webs"; import "@pnp/sp/search"; import IDataProvider from './components/SharingView/DataProvider'; @@ -19,7 +19,7 @@ import { ConsoleListener, LogLevel } from "@pnp/logging"; -import { IPropertyPaneConfiguration, PropertyPaneToggle, PropertyPaneTextField } from '@microsoft/sp-property-pane'; +import { IPropertyPaneConfiguration, PropertyPaneToggle } from '@microsoft/sp-property-pane'; import SharingViewSingle from './components/SharingView/SharingViewSingle'; const LOG_SOURCE: string = 'Microsoft-Governance-Sharing'; diff --git a/samples/react-governor-sharing/src/webparts/sharing/components/SharingView/DataProvider.ts b/samples/react-governor-sharing/src/webparts/sharing/components/SharingView/DataProvider.ts index d232d255d..beef7ea2d 100644 --- a/samples/react-governor-sharing/src/webparts/sharing/components/SharingView/DataProvider.ts +++ b/samples/react-governor-sharing/src/webparts/sharing/components/SharingView/DataProvider.ts @@ -1,3 +1,6 @@ +/* eslint-disable @typescript-eslint/no-floating-promises */ +/* eslint-disable eqeqeq */ +/* eslint-disable @typescript-eslint/no-explicit-any */ import { WebPartContext } from "@microsoft/sp-webpart-base"; import { spfi, SPFx } from '@pnp/sp'; import { ISearchResultExtended } from "./ISearchResultExtended"; diff --git a/samples/react-governor-sharing/src/webparts/sharing/components/SharingView/ISharingResult.ts b/samples/react-governor-sharing/src/webparts/sharing/components/SharingView/ISharingResult.ts index e95256252..30a36b746 100644 --- a/samples/react-governor-sharing/src/webparts/sharing/components/SharingView/ISharingResult.ts +++ b/samples/react-governor-sharing/src/webparts/sharing/components/SharingView/ISharingResult.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ import { IFacepilePersona } from "@fluentui/react"; export interface ISharingResult { diff --git a/samples/react-governor-sharing/src/webparts/sharing/components/SharingView/ISharingViewProps.ts b/samples/react-governor-sharing/src/webparts/sharing/components/SharingView/ISharingViewProps.ts index c5789f4b9..3a8274033 100644 --- a/samples/react-governor-sharing/src/webparts/sharing/components/SharingView/ISharingViewProps.ts +++ b/samples/react-governor-sharing/src/webparts/sharing/components/SharingView/ISharingViewProps.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ import IDataProvider from "./DataProvider"; export interface ISharingViewProps { diff --git a/samples/react-governor-sharing/src/webparts/sharing/components/SharingView/ISharingViewState.ts b/samples/react-governor-sharing/src/webparts/sharing/components/SharingView/ISharingViewState.ts index ef7ad917e..728f192ca 100644 --- a/samples/react-governor-sharing/src/webparts/sharing/components/SharingView/ISharingViewState.ts +++ b/samples/react-governor-sharing/src/webparts/sharing/components/SharingView/ISharingViewState.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ import { ISharingResult } from "./ISharingResult"; import { IContextualMenuProps } from '@fluentui/react'; diff --git a/samples/react-governor-sharing/src/webparts/sharing/components/SharingView/SharingViewSingle.tsx b/samples/react-governor-sharing/src/webparts/sharing/components/SharingView/SharingViewSingle.tsx index 925c021a5..daf863bee 100644 --- a/samples/react-governor-sharing/src/webparts/sharing/components/SharingView/SharingViewSingle.tsx +++ b/samples/react-governor-sharing/src/webparts/sharing/components/SharingView/SharingViewSingle.tsx @@ -1,3 +1,6 @@ +/* eslint-disable @typescript-eslint/no-non-null-assertion */ +/* eslint-disable eqeqeq */ +/* eslint-disable @typescript-eslint/no-explicit-any */ import { DialogType, Facepile, @@ -209,6 +212,7 @@ export default class SharingViewSingle extends React.Component { } @@ -245,9 +249,10 @@ export default class SharingViewSingle extends React.Component { // get the default group titles, this is used to later determine if documents have inherited permissions diff --git a/samples/react-governor-sharing/src/webparts/sharing/components/SharingView/Utils.ts b/samples/react-governor-sharing/src/webparts/sharing/components/SharingView/Utils.ts index 6ee47d3a6..031091fed 100644 --- a/samples/react-governor-sharing/src/webparts/sharing/components/SharingView/Utils.ts +++ b/samples/react-governor-sharing/src/webparts/sharing/components/SharingView/Utils.ts @@ -1,3 +1,7 @@ +/* eslint-disable dot-notation */ +/* eslint-disable eqeqeq */ +/* eslint-disable @typescript-eslint/no-explicit-any */ +/* eslint-disable no-prototype-builtins */ import { IColumn, IContextualMenuItem, IFacepilePersona } from '@fluentui/react'; import { IdentitySet } from '@microsoft/microsoft-graph-types';