This commit is contained in:
Nick Brown 2022-09-23 09:55:54 +01:00
commit 921d68331b
205 changed files with 861085 additions and 392221 deletions

18
.github/workflows/sample-scanner.yml vendored Normal file
View File

@ -0,0 +1,18 @@
# This is a basic workflow to help you get started with Actions
name: Sample Scanner
# Controls when the workflow will run
on:
workflow_dispatch:
jobs:
sample-scan:
runs-on: ubuntu-latest
steps:
- name: 'Checkout Repository'
uses: actions/checkout@v3
- name: Sample Scanner
uses: pnp/action-sample-scanner@main
with:
dirs: '["samples"]'
token: ${{ secrets.GITHUB_TOKEN }}

View File

@ -17,11 +17,11 @@
<package id="Microsoft.CodeDom.Providers.DotNetCompilerPlatform" version="1.0.0" targetFramework="net452" /> <package id="Microsoft.CodeDom.Providers.DotNetCompilerPlatform" version="1.0.0" targetFramework="net452" />
<package id="Microsoft.IdentityModel.Protocol.Extensions" version="1.0.0" targetFramework="net452" /> <package id="Microsoft.IdentityModel.Protocol.Extensions" version="1.0.0" targetFramework="net452" />
<package id="Microsoft.Net.Compilers" version="1.0.0" targetFramework="net452" developmentDependency="true" /> <package id="Microsoft.Net.Compilers" version="1.0.0" targetFramework="net452" developmentDependency="true" />
<package id="Microsoft.Owin" version="4.0.0" targetFramework="net452" /> <package id="Microsoft.Owin" version="4.2.2" targetFramework="net452" />
<package id="Microsoft.Owin.Host.SystemWeb" version="3.0.1" targetFramework="net452" /> <package id="Microsoft.Owin.Host.SystemWeb" version="3.0.1" targetFramework="net452" />
<package id="Microsoft.Owin.Security" version="3.1.0" targetFramework="net452" /> <package id="Microsoft.Owin.Security" version="3.1.0" targetFramework="net452" />
<package id="Microsoft.Owin.Security.ActiveDirectory" version="3.0.1" targetFramework="net452" /> <package id="Microsoft.Owin.Security.ActiveDirectory" version="3.0.1" targetFramework="net452" />
<package id="Microsoft.Owin.Security.Cookies" version="3.1.0" targetFramework="net452" /> <package id="Microsoft.Owin.Security.Cookies" version="4.2.2" targetFramework="net452" />
<package id="Microsoft.Owin.Security.Jwt" version="3.0.1" targetFramework="net452" /> <package id="Microsoft.Owin.Security.Jwt" version="3.0.1" targetFramework="net452" />
<package id="Microsoft.Owin.Security.OAuth" version="3.0.1" targetFramework="net452" /> <package id="Microsoft.Owin.Security.OAuth" version="3.0.1" targetFramework="net452" />
<package id="Microsoft.Owin.Security.OpenIdConnect" version="3.1.0" targetFramework="net452" /> <package id="Microsoft.Owin.Security.OpenIdConnect" version="3.1.0" targetFramework="net452" />

View File

@ -23,11 +23,11 @@
<package id="Microsoft.CodeDom.Providers.DotNetCompilerPlatform" version="1.0.0" targetFramework="net45" /> <package id="Microsoft.CodeDom.Providers.DotNetCompilerPlatform" version="1.0.0" targetFramework="net45" />
<package id="Microsoft.jQuery.Unobtrusive.Validation" version="3.2.3" targetFramework="net45" /> <package id="Microsoft.jQuery.Unobtrusive.Validation" version="3.2.3" targetFramework="net45" />
<package id="Microsoft.Net.Compilers" version="1.0.0" targetFramework="net45" developmentDependency="true" /> <package id="Microsoft.Net.Compilers" version="1.0.0" targetFramework="net45" developmentDependency="true" />
<package id="Microsoft.Owin" version="4.0.0" targetFramework="net45" /> <package id="Microsoft.Owin" version="4.2.2" targetFramework="net45" />
<package id="Microsoft.Owin.Host.SystemWeb" version="3.0.1" targetFramework="net45" /> <package id="Microsoft.Owin.Host.SystemWeb" version="3.0.1" targetFramework="net45" />
<package id="Microsoft.Owin.Security" version="3.0.1" targetFramework="net45" /> <package id="Microsoft.Owin.Security" version="3.0.1" targetFramework="net45" />
<package id="Microsoft.Owin.Security.ActiveDirectory" version="3.0.1" targetFramework="net45" /> <package id="Microsoft.Owin.Security.ActiveDirectory" version="3.0.1" targetFramework="net45" />
<package id="Microsoft.Owin.Security.Cookies" version="3.0.1" targetFramework="net45" /> <package id="Microsoft.Owin.Security.Cookies" version="4.2.2" targetFramework="net45" />
<package id="Microsoft.Owin.Security.Facebook" version="3.0.1" targetFramework="net45" /> <package id="Microsoft.Owin.Security.Facebook" version="3.0.1" targetFramework="net45" />
<package id="Microsoft.Owin.Security.Google" version="3.0.1" targetFramework="net45" /> <package id="Microsoft.Owin.Security.Google" version="3.0.1" targetFramework="net45" />
<package id="Microsoft.Owin.Security.Jwt" version="3.0.1" targetFramework="net45" /> <package id="Microsoft.Owin.Security.Jwt" version="3.0.1" targetFramework="net45" />

File diff suppressed because it is too large Load Diff

View File

@ -19,7 +19,7 @@
}, },
"devDependencies": { "devDependencies": {
"@microsoft/rush-stack-compiler-3.7": "0.2.3", "@microsoft/rush-stack-compiler-3.7": "0.2.3",
"@microsoft/sp-build-web": "1.12.1", "@microsoft/sp-build-web": "1.15.2",
"@microsoft/sp-module-interfaces": "1.12.1", "@microsoft/sp-module-interfaces": "1.12.1",
"@microsoft/sp-tslint-rules": "1.12.1", "@microsoft/sp-tslint-rules": "1.12.1",
"@microsoft/sp-webpart-workbench": "1.12.1", "@microsoft/sp-webpart-workbench": "1.12.1",

File diff suppressed because it is too large Load Diff

View File

@ -34,9 +34,9 @@
"zone.js": "^0.8.26" "zone.js": "^0.8.26"
}, },
"devDependencies": { "devDependencies": {
"@microsoft/sp-build-web": "~1.4.1", "@microsoft/sp-build-web": "~1.15.2",
"@microsoft/sp-module-interfaces": "~1.4.1", "@microsoft/sp-module-interfaces": "~1.4.1",
"@microsoft/sp-webpart-workbench": "~1.4.1", "@microsoft/sp-webpart-workbench": "~1.12.1",
"@types/chai": ">=3.4.34 <3.6.0", "@types/chai": ">=3.4.34 <3.6.0",
"@types/mocha": ">=2.2.33 <2.6.0", "@types/mocha": ">=2.2.33 <2.6.0",
"ajv": "~5.2.2", "ajv": "~5.2.2",

File diff suppressed because it is too large Load Diff

View File

@ -13,9 +13,9 @@
"handlebars": "^4.7.7" "handlebars": "^4.7.7"
}, },
"devDependencies": { "devDependencies": {
"@microsoft/sp-build-web": "~1.4.1", "@microsoft/sp-build-web": "~1.15.2",
"@microsoft/sp-module-interfaces": "~1.4.1", "@microsoft/sp-module-interfaces": "~1.4.1",
"@microsoft/sp-webpart-workbench": "~1.4.1", "@microsoft/sp-webpart-workbench": "~1.12.1",
"@types/chai": "~4.1.2", "@types/chai": "~4.1.2",
"@types/es6-collections": "^0.5.31", "@types/es6-collections": "^0.5.31",
"@types/mocha": "~2.2.48", "@types/mocha": "~2.2.48",

File diff suppressed because it is too large Load Diff

View File

@ -25,10 +25,10 @@
"moment": "^2.29.2" "moment": "^2.29.2"
}, },
"devDependencies": { "devDependencies": {
"@microsoft/sp-build-web": "1.9.1", "@microsoft/sp-build-web": "1.15.2",
"@microsoft/sp-tslint-rules": "1.9.1", "@microsoft/sp-tslint-rules": "1.9.1",
"@microsoft/sp-module-interfaces": "1.9.1", "@microsoft/sp-module-interfaces": "1.9.1",
"@microsoft/sp-webpart-workbench": "1.9.1", "@microsoft/sp-webpart-workbench": "1.12.1",
"@microsoft/rush-stack-compiler-2.9": "0.7.16", "@microsoft/rush-stack-compiler-2.9": "0.7.16",
"gulp": "~3.9.1", "gulp": "~3.9.1",
"@types/chai": "3.4.34", "@types/chai": "3.4.34",

File diff suppressed because it is too large Load Diff

View File

@ -17,10 +17,10 @@
}, },
"devDependencies": { "devDependencies": {
"@microsoft/rush-stack-compiler-3.3": "0.3.5", "@microsoft/rush-stack-compiler-3.3": "0.3.5",
"@microsoft/sp-build-web": "1.11.0", "@microsoft/sp-build-web": "1.15.2",
"@microsoft/sp-module-interfaces": "1.11.0", "@microsoft/sp-module-interfaces": "1.11.0",
"@microsoft/sp-tslint-rules": "1.11.0", "@microsoft/sp-tslint-rules": "1.11.0",
"@microsoft/sp-webpart-workbench": "1.11.0", "@microsoft/sp-webpart-workbench": "1.12.1",
"@types/chai": ">=3.4.34 <3.6.0", "@types/chai": ">=3.4.34 <3.6.0",
"@types/es6-promise": "0.0.33", "@types/es6-promise": "0.0.33",
"@types/mocha": ">=2.2.33 <2.6.0", "@types/mocha": ">=2.2.33 <2.6.0",

File diff suppressed because it is too large Load Diff

View File

@ -25,10 +25,10 @@
"@types/webpack-env": "1.13.1" "@types/webpack-env": "1.13.1"
}, },
"devDependencies": { "devDependencies": {
"@microsoft/sp-build-web": "1.10.0", "@microsoft/sp-build-web": "1.15.2",
"@microsoft/sp-tslint-rules": "1.10.0", "@microsoft/sp-tslint-rules": "1.10.0",
"@microsoft/sp-module-interfaces": "1.10.0", "@microsoft/sp-module-interfaces": "1.10.0",
"@microsoft/sp-webpart-workbench": "1.10.0", "@microsoft/sp-webpart-workbench": "1.12.1",
"@microsoft/rush-stack-compiler-3.3": "0.3.5", "@microsoft/rush-stack-compiler-3.3": "0.3.5",
"gulp": "~3.9.1", "gulp": "~3.9.1",
"@types/chai": "3.4.34", "@types/chai": "3.4.34",

File diff suppressed because it is too large Load Diff

View File

@ -20,10 +20,10 @@
"@types/es6-promise": "0.0.33" "@types/es6-promise": "0.0.33"
}, },
"devDependencies": { "devDependencies": {
"@microsoft/sp-build-web": "1.8.2", "@microsoft/sp-build-web": "1.15.2",
"@microsoft/sp-tslint-rules": "1.8.2", "@microsoft/sp-tslint-rules": "1.8.2",
"@microsoft/sp-module-interfaces": "1.8.2", "@microsoft/sp-module-interfaces": "1.8.2",
"@microsoft/sp-webpart-workbench": "1.8.2", "@microsoft/sp-webpart-workbench": "1.12.1",
"@microsoft/rush-stack-compiler-2.9": "0.7.7", "@microsoft/rush-stack-compiler-2.9": "0.7.7",
"gulp": "~3.9.1", "gulp": "~3.9.1",
"@types/chai": "3.4.34", "@types/chai": "3.4.34",

File diff suppressed because it is too large Load Diff

View File

@ -19,10 +19,10 @@
"@types/es6-promise": "0.0.33" "@types/es6-promise": "0.0.33"
}, },
"devDependencies": { "devDependencies": {
"@microsoft/sp-build-web": "1.7.1-plusbeta", "@microsoft/sp-build-web": "1.15.2",
"@microsoft/sp-tslint-rules": "1.7.1-plusbeta", "@microsoft/sp-tslint-rules": "1.7.1-plusbeta",
"@microsoft/sp-module-interfaces": "1.7.1-plusbeta", "@microsoft/sp-module-interfaces": "1.7.1-plusbeta",
"@microsoft/sp-webpart-workbench": "1.7.1-plusbeta", "@microsoft/sp-webpart-workbench": "1.12.1",
"gulp": "~3.9.1", "gulp": "~3.9.1",
"@types/chai": "3.4.34", "@types/chai": "3.4.34",
"@types/mocha": "2.2.38", "@types/mocha": "2.2.38",

File diff suppressed because it is too large Load Diff

View File

@ -21,10 +21,10 @@
}, },
"devDependencies": { "devDependencies": {
"@microsoft/rush-stack-compiler-2.7": "0.4.0", "@microsoft/rush-stack-compiler-2.7": "0.4.0",
"@microsoft/sp-build-web": "1.8.0", "@microsoft/sp-build-web": "1.15.2",
"@microsoft/sp-module-interfaces": "1.8.0", "@microsoft/sp-module-interfaces": "1.8.0",
"@microsoft/sp-tslint-rules": "1.8.0", "@microsoft/sp-tslint-rules": "1.8.0",
"@microsoft/sp-webpart-workbench": "1.8.0", "@microsoft/sp-webpart-workbench": "1.12.1",
"@types/chai": "3.4.34", "@types/chai": "3.4.34",
"@types/jquery": "^3.3.4", "@types/jquery": "^3.3.4",
"@types/mocha": "2.2.38", "@types/mocha": "2.2.38",

File diff suppressed because it is too large Load Diff

View File

@ -16,7 +16,7 @@
"@microsoft/sp-office-ui-fabric-core": "1.12.1-rc.3" "@microsoft/sp-office-ui-fabric-core": "1.12.1-rc.3"
}, },
"devDependencies": { "devDependencies": {
"@microsoft/sp-build-web": "1.12.1-rc.3", "@microsoft/sp-build-web": "1.15.2",
"@microsoft/sp-tslint-rules": "1.12.1-rc.3", "@microsoft/sp-tslint-rules": "1.12.1-rc.3",
"@microsoft/sp-module-interfaces": "1.12.1-rc.3", "@microsoft/sp-module-interfaces": "1.12.1-rc.3",
"@microsoft/sp-webpart-workbench": "1.12.1-rc.3", "@microsoft/sp-webpart-workbench": "1.12.1-rc.3",

File diff suppressed because it is too large Load Diff

View File

@ -19,9 +19,9 @@
"@types/es6-promise": "0.0.33" "@types/es6-promise": "0.0.33"
}, },
"devDependencies": { "devDependencies": {
"@microsoft/sp-build-web": "~1.4.1", "@microsoft/sp-build-web": "~1.15.2",
"@microsoft/sp-module-interfaces": "~1.4.1", "@microsoft/sp-module-interfaces": "~1.4.1",
"@microsoft/sp-webpart-workbench": "~1.4.1", "@microsoft/sp-webpart-workbench": "~1.12.1",
"gulp": "~3.9.1", "gulp": "~3.9.1",
"@types/chai": "3.4.34", "@types/chai": "3.4.34",
"@types/mocha": "2.2.38", "@types/mocha": "2.2.38",

File diff suppressed because it is too large Load Diff

View File

@ -22,10 +22,10 @@
}, },
"devDependencies": { "devDependencies": {
"@microsoft/rush-stack-compiler-3.3": "0.3.5", "@microsoft/rush-stack-compiler-3.3": "0.3.5",
"@microsoft/sp-build-web": "1.10.0", "@microsoft/sp-build-web": "1.15.2",
"@microsoft/sp-module-interfaces": "1.10.0", "@microsoft/sp-module-interfaces": "1.10.0",
"@microsoft/sp-tslint-rules": "1.10.0", "@microsoft/sp-tslint-rules": "1.10.0",
"@microsoft/sp-webpart-workbench": "1.10.0", "@microsoft/sp-webpart-workbench": "1.12.1",
"@types/chai": "3.4.34", "@types/chai": "3.4.34",
"@types/mocha": "2.2.38", "@types/mocha": "2.2.38",
"ajv": "~5.2.2", "ajv": "~5.2.2",

File diff suppressed because it is too large Load Diff

View File

@ -23,10 +23,10 @@
}, },
"devDependencies": { "devDependencies": {
"@microsoft/rush-stack-compiler-3.3": "0.3.5", "@microsoft/rush-stack-compiler-3.3": "0.3.5",
"@microsoft/sp-build-web": "1.10.0", "@microsoft/sp-build-web": "1.15.2",
"@microsoft/sp-module-interfaces": "1.10.0", "@microsoft/sp-module-interfaces": "1.10.0",
"@microsoft/sp-tslint-rules": "1.10.0", "@microsoft/sp-tslint-rules": "1.10.0",
"@microsoft/sp-webpart-workbench": "1.10.0", "@microsoft/sp-webpart-workbench": "1.12.1",
"@types/chai": "3.4.34", "@types/chai": "3.4.34",
"@types/mocha": "2.2.38", "@types/mocha": "2.2.38",
"ajv": "~5.2.2", "ajv": "~5.2.2",

File diff suppressed because it is too large Load Diff

View File

@ -25,10 +25,10 @@
"knockout": "3.5.0" "knockout": "3.5.0"
}, },
"devDependencies": { "devDependencies": {
"@microsoft/sp-build-web": "1.7.0", "@microsoft/sp-build-web": "1.15.2",
"@microsoft/sp-tslint-rules": "1.7.0", "@microsoft/sp-tslint-rules": "1.7.0",
"@microsoft/sp-module-interfaces": "1.7.0", "@microsoft/sp-module-interfaces": "1.7.0",
"@microsoft/sp-webpart-workbench": "1.7.0", "@microsoft/sp-webpart-workbench": "1.12.1",
"gulp": "~3.9.1", "gulp": "~3.9.1",
"@types/chai": "3.4.34", "@types/chai": "3.4.34",
"@types/mocha": "2.2.38", "@types/mocha": "2.2.38",

View File

@ -23,11 +23,11 @@
<package id="Microsoft.IdentityModel.Tokens" version="5.2.1" targetFramework="net461" /> <package id="Microsoft.IdentityModel.Tokens" version="5.2.1" targetFramework="net461" />
<package id="Microsoft.jQuery.Unobtrusive.Validation" version="3.2.3" targetFramework="net461" /> <package id="Microsoft.jQuery.Unobtrusive.Validation" version="3.2.3" targetFramework="net461" />
<package id="Microsoft.Net.Compilers" version="2.1.0" targetFramework="net461" developmentDependency="true" /> <package id="Microsoft.Net.Compilers" version="2.1.0" targetFramework="net461" developmentDependency="true" />
<package id="Microsoft.Owin" version="4.0.0" targetFramework="net461" /> <package id="Microsoft.Owin" version="4.2.2" targetFramework="net461" />
<package id="Microsoft.Owin.Host.SystemWeb" version="3.0.1" targetFramework="net461" /> <package id="Microsoft.Owin.Host.SystemWeb" version="3.0.1" targetFramework="net461" />
<package id="Microsoft.Owin.Security" version="3.0.1" targetFramework="net461" /> <package id="Microsoft.Owin.Security" version="3.0.1" targetFramework="net461" />
<package id="Microsoft.Owin.Security.ActiveDirectory" version="3.0.1" targetFramework="net461" /> <package id="Microsoft.Owin.Security.ActiveDirectory" version="3.0.1" targetFramework="net461" />
<package id="Microsoft.Owin.Security.Cookies" version="3.0.1" targetFramework="net461" /> <package id="Microsoft.Owin.Security.Cookies" version="4.2.2" targetFramework="net461" />
<package id="Microsoft.Owin.Security.Jwt" version="3.0.1" targetFramework="net461" /> <package id="Microsoft.Owin.Security.Jwt" version="3.0.1" targetFramework="net461" />
<package id="Microsoft.Owin.Security.OAuth" version="3.0.1" targetFramework="net461" /> <package id="Microsoft.Owin.Security.OAuth" version="3.0.1" targetFramework="net461" />
<package id="Microsoft.Owin.Security.OpenIdConnect" version="3.0.1" targetFramework="net461" /> <package id="Microsoft.Owin.Security.OpenIdConnect" version="3.0.1" targetFramework="net461" />

File diff suppressed because it is too large Load Diff

View File

@ -39,10 +39,10 @@
"devDependencies": { "devDependencies": {
"@microsoft/rush-stack-compiler-2.9": "0.7.7", "@microsoft/rush-stack-compiler-2.9": "0.7.7",
"@microsoft/rush-stack-compiler-3.3": "0.3.5", "@microsoft/rush-stack-compiler-3.3": "0.3.5",
"@microsoft/sp-build-web": "1.10.0", "@microsoft/sp-build-web": "1.15.2",
"@microsoft/sp-module-interfaces": "1.10.0", "@microsoft/sp-module-interfaces": "1.10.0",
"@microsoft/sp-tslint-rules": "1.10.0", "@microsoft/sp-tslint-rules": "1.10.0",
"@microsoft/sp-webpart-workbench": "1.10.0", "@microsoft/sp-webpart-workbench": "1.12.1",
"@types/chai": "3.4.34", "@types/chai": "3.4.34",
"@types/mocha": "2.2.38", "@types/mocha": "2.2.38",
"ajv": "~5.2.2", "ajv": "~5.2.2",

File diff suppressed because it is too large Load Diff

View File

@ -38,10 +38,10 @@
"devDependencies": { "devDependencies": {
"@microsoft/rush-stack-compiler-2.9": "0.7.7", "@microsoft/rush-stack-compiler-2.9": "0.7.7",
"@microsoft/rush-stack-compiler-3.3": "0.3.5", "@microsoft/rush-stack-compiler-3.3": "0.3.5",
"@microsoft/sp-build-web": "1.10.0", "@microsoft/sp-build-web": "1.15.2",
"@microsoft/sp-module-interfaces": "1.10.0", "@microsoft/sp-module-interfaces": "1.10.0",
"@microsoft/sp-tslint-rules": "1.10.0", "@microsoft/sp-tslint-rules": "1.10.0",
"@microsoft/sp-webpart-workbench": "1.10.0", "@microsoft/sp-webpart-workbench": "1.12.1",
"@types/chai": "3.4.34", "@types/chai": "3.4.34",
"@types/mocha": "2.2.38", "@types/mocha": "2.2.38",
"ajv": "~5.2.2", "ajv": "~5.2.2",

File diff suppressed because it is too large Load Diff

View File

@ -32,10 +32,10 @@
}, },
"devDependencies": { "devDependencies": {
"@microsoft/rush-stack-compiler-3.3": "0.3.5", "@microsoft/rush-stack-compiler-3.3": "0.3.5",
"@microsoft/sp-build-web": "1.10.0", "@microsoft/sp-build-web": "1.15.2",
"@microsoft/sp-module-interfaces": "1.10.0", "@microsoft/sp-module-interfaces": "1.10.0",
"@microsoft/sp-tslint-rules": "1.10.0", "@microsoft/sp-tslint-rules": "1.10.0",
"@microsoft/sp-webpart-workbench": "1.10.0", "@microsoft/sp-webpart-workbench": "1.12.1",
"@types/chai": "3.4.34", "@types/chai": "3.4.34",
"@types/mocha": "2.2.38", "@types/mocha": "2.2.38",
"ajv": "~5.2.2", "ajv": "~5.2.2",

File diff suppressed because it is too large Load Diff

View File

@ -33,10 +33,10 @@
}, },
"devDependencies": { "devDependencies": {
"@microsoft/rush-stack-compiler-3.3": "0.3.5", "@microsoft/rush-stack-compiler-3.3": "0.3.5",
"@microsoft/sp-build-web": "1.10.0", "@microsoft/sp-build-web": "1.15.2",
"@microsoft/sp-module-interfaces": "1.10.0", "@microsoft/sp-module-interfaces": "1.10.0",
"@microsoft/sp-tslint-rules": "1.10.0", "@microsoft/sp-tslint-rules": "1.10.0",
"@microsoft/sp-webpart-workbench": "1.10.0", "@microsoft/sp-webpart-workbench": "1.12.1",
"@types/chai": "3.4.34", "@types/chai": "3.4.34",
"@types/mocha": "2.2.38", "@types/mocha": "2.2.38",
"ajv": "~5.2.2", "ajv": "~5.2.2",

File diff suppressed because it is too large Load Diff

View File

@ -33,10 +33,10 @@
}, },
"devDependencies": { "devDependencies": {
"@microsoft/rush-stack-compiler-3.3": "0.3.5", "@microsoft/rush-stack-compiler-3.3": "0.3.5",
"@microsoft/sp-build-web": "1.11.0", "@microsoft/sp-build-web": "1.15.2",
"@microsoft/sp-module-interfaces": "1.11.0", "@microsoft/sp-module-interfaces": "1.11.0",
"@microsoft/sp-tslint-rules": "1.11.0", "@microsoft/sp-tslint-rules": "1.11.0",
"@microsoft/sp-webpart-workbench": "1.11.0", "@microsoft/sp-webpart-workbench": "1.12.1",
"@types/chai": "3.4.34", "@types/chai": "3.4.34",
"@types/es6-promise": "0.0.33", "@types/es6-promise": "0.0.33",
"@types/mocha": "2.2.38", "@types/mocha": "2.2.38",

File diff suppressed because it is too large Load Diff

View File

@ -30,7 +30,7 @@
"devDependencies": { "devDependencies": {
"@types/react": "16.9.36", "@types/react": "16.9.36",
"@types/react-dom": "16.9.8", "@types/react-dom": "16.9.8",
"@microsoft/sp-build-web": "1.12.1", "@microsoft/sp-build-web": "1.15.2",
"@microsoft/sp-tslint-rules": "1.12.1", "@microsoft/sp-tslint-rules": "1.12.1",
"@microsoft/sp-module-interfaces": "1.12.1", "@microsoft/sp-module-interfaces": "1.12.1",
"@microsoft/sp-webpart-workbench": "1.12.1", "@microsoft/sp-webpart-workbench": "1.12.1",

File diff suppressed because it is too large Load Diff

View File

@ -30,10 +30,10 @@
"react-dom": "16.8.5" "react-dom": "16.8.5"
}, },
"devDependencies": { "devDependencies": {
"@microsoft/sp-build-web": "1.9.1", "@microsoft/sp-build-web": "1.15.2",
"@microsoft/sp-tslint-rules": "1.9.1", "@microsoft/sp-tslint-rules": "1.9.1",
"@microsoft/sp-module-interfaces": "1.9.1", "@microsoft/sp-module-interfaces": "1.9.1",
"@microsoft/sp-webpart-workbench": "1.9.1", "@microsoft/sp-webpart-workbench": "1.12.1",
"@microsoft/rush-stack-compiler-2.9": "0.7.16", "@microsoft/rush-stack-compiler-2.9": "0.7.16",
"gulp": "~3.9.1", "gulp": "~3.9.1",
"@types/chai": "3.4.34", "@types/chai": "3.4.34",

File diff suppressed because it is too large Load Diff

View File

@ -34,10 +34,10 @@
"@types/react": "16.8.8" "@types/react": "16.8.8"
}, },
"devDependencies": { "devDependencies": {
"@microsoft/sp-build-web": "1.9.1", "@microsoft/sp-build-web": "1.15.2",
"@microsoft/sp-tslint-rules": "1.9.1", "@microsoft/sp-tslint-rules": "1.9.1",
"@microsoft/sp-module-interfaces": "1.9.1", "@microsoft/sp-module-interfaces": "1.9.1",
"@microsoft/sp-webpart-workbench": "1.9.1", "@microsoft/sp-webpart-workbench": "1.12.1",
"@microsoft/rush-stack-compiler-2.9": "0.7.16", "@microsoft/rush-stack-compiler-2.9": "0.7.16",
"gulp": "~3.9.1", "gulp": "~3.9.1",
"@types/chai": "3.4.34", "@types/chai": "3.4.34",

File diff suppressed because it is too large Load Diff

View File

@ -28,10 +28,10 @@
"devDependencies": { "devDependencies": {
"@types/react": "16.8.8", "@types/react": "16.8.8",
"@types/react-dom": "16.8.3", "@types/react-dom": "16.8.3",
"@microsoft/sp-build-web": "1.11.0", "@microsoft/sp-build-web": "1.15.2",
"@microsoft/sp-tslint-rules": "1.11.0", "@microsoft/sp-tslint-rules": "1.11.0",
"@microsoft/sp-module-interfaces": "1.11.0", "@microsoft/sp-module-interfaces": "1.11.0",
"@microsoft/sp-webpart-workbench": "1.11.0", "@microsoft/sp-webpart-workbench": "1.12.1",
"@microsoft/rush-stack-compiler-3.3": "0.3.5", "@microsoft/rush-stack-compiler-3.3": "0.3.5",
"gulp": "~3.9.1", "gulp": "~3.9.1",
"@types/chai": "3.4.34", "@types/chai": "3.4.34",

File diff suppressed because it is too large Load Diff

View File

@ -26,9 +26,9 @@
"sp-client-custom-fields": "^1.3.7" "sp-client-custom-fields": "^1.3.7"
}, },
"devDependencies": { "devDependencies": {
"@microsoft/sp-build-web": "~1.4.1", "@microsoft/sp-build-web": "~1.15.2",
"@microsoft/sp-module-interfaces": "~1.4.1", "@microsoft/sp-module-interfaces": "~1.4.1",
"@microsoft/sp-webpart-workbench": "~1.4.1", "@microsoft/sp-webpart-workbench": "~1.12.1",
"@types/chai": ">=3.4.34 <3.6.0", "@types/chai": ">=3.4.34 <3.6.0",
"@types/mocha": ">=2.2.33 <2.6.0", "@types/mocha": ">=2.2.33 <2.6.0",
"ajv": "~5.2.2", "ajv": "~5.2.2",

File diff suppressed because it is too large Load Diff

View File

@ -32,10 +32,10 @@
"@types/react": "16.8.8" "@types/react": "16.8.8"
}, },
"devDependencies": { "devDependencies": {
"@microsoft/sp-build-web": "1.10.0", "@microsoft/sp-build-web": "1.15.2",
"@microsoft/sp-tslint-rules": "1.10.0", "@microsoft/sp-tslint-rules": "1.10.0",
"@microsoft/sp-module-interfaces": "1.10.0", "@microsoft/sp-module-interfaces": "1.10.0",
"@microsoft/sp-webpart-workbench": "1.10.0", "@microsoft/sp-webpart-workbench": "1.12.1",
"@microsoft/rush-stack-compiler-3.3": "0.3.5", "@microsoft/rush-stack-compiler-3.3": "0.3.5",
"gulp": "~3.9.1", "gulp": "~3.9.1",
"@types/chai": "3.4.34", "@types/chai": "3.4.34",

File diff suppressed because it is too large Load Diff

View File

@ -33,10 +33,10 @@
}, },
"devDependencies": { "devDependencies": {
"@microsoft/rush-stack-compiler-3.3": "0.3.5", "@microsoft/rush-stack-compiler-3.3": "0.3.5",
"@microsoft/sp-build-web": "1.10.0", "@microsoft/sp-build-web": "1.15.2",
"@microsoft/sp-module-interfaces": "1.10.0", "@microsoft/sp-module-interfaces": "1.10.0",
"@microsoft/sp-tslint-rules": "1.10.0", "@microsoft/sp-tslint-rules": "1.10.0",
"@microsoft/sp-webpart-workbench": "1.10.0", "@microsoft/sp-webpart-workbench": "1.12.1",
"@types/chai": "3.4.34", "@types/chai": "3.4.34",
"@types/mocha": "2.2.38", "@types/mocha": "2.2.38",
"ajv": "~5.2.2", "ajv": "~5.2.2",

File diff suppressed because it is too large Load Diff

View File

@ -46,10 +46,10 @@
"@babel/preset-env": "^7.10.4", "@babel/preset-env": "^7.10.4",
"@microsoft/rush-stack-compiler-2.9": "0.7.16", "@microsoft/rush-stack-compiler-2.9": "0.7.16",
"@microsoft/rush-stack-compiler-3.3": "0.3.5", "@microsoft/rush-stack-compiler-3.3": "0.3.5",
"@microsoft/sp-build-web": "1.10.0", "@microsoft/sp-build-web": "1.15.2",
"@microsoft/sp-module-interfaces": "1.10.0", "@microsoft/sp-module-interfaces": "1.10.0",
"@microsoft/sp-tslint-rules": "1.10.0", "@microsoft/sp-tslint-rules": "1.10.0",
"@microsoft/sp-webpart-workbench": "1.10.0", "@microsoft/sp-webpart-workbench": "1.12.1",
"@types/chai": "3.4.34", "@types/chai": "3.4.34",
"@types/mocha": "2.2.38", "@types/mocha": "2.2.38",
"ajv": "~5.2.2", "ajv": "~5.2.2",

File diff suppressed because it is too large Load Diff

View File

@ -53,7 +53,7 @@
"@microsoft/rush-stack-compiler-3.2": "0.3.17", "@microsoft/rush-stack-compiler-3.2": "0.3.17",
"@microsoft/rush-stack-compiler-3.3": "0.3.5", "@microsoft/rush-stack-compiler-3.3": "0.3.5",
"@microsoft/rush-stack-compiler-3.7": "0.2.3", "@microsoft/rush-stack-compiler-3.7": "0.2.3",
"@microsoft/sp-build-web": "1.12.1", "@microsoft/sp-build-web": "1.15.2",
"@microsoft/sp-module-interfaces": "1.12.1", "@microsoft/sp-module-interfaces": "1.12.1",
"@microsoft/sp-tslint-rules": "1.12.1", "@microsoft/sp-tslint-rules": "1.12.1",
"@microsoft/sp-webpart-workbench": "1.12.1", "@microsoft/sp-webpart-workbench": "1.12.1",

File diff suppressed because it is too large Load Diff

View File

@ -44,7 +44,7 @@
"devDependencies": { "devDependencies": {
"@microsoft/rush-stack-compiler-3.3": "0.3.5", "@microsoft/rush-stack-compiler-3.3": "0.3.5",
"@microsoft/rush-stack-compiler-3.7": "0.2.3", "@microsoft/rush-stack-compiler-3.7": "0.2.3",
"@microsoft/sp-build-web": "1.12.1", "@microsoft/sp-build-web": "1.15.2",
"@microsoft/sp-module-interfaces": "1.12.1", "@microsoft/sp-module-interfaces": "1.12.1",
"@microsoft/sp-tslint-rules": "1.12.1", "@microsoft/sp-tslint-rules": "1.12.1",
"@microsoft/sp-webpart-workbench": "1.12.1", "@microsoft/sp-webpart-workbench": "1.12.1",

File diff suppressed because it is too large Load Diff

View File

@ -33,10 +33,10 @@
"@types/react": "16.8.8" "@types/react": "16.8.8"
}, },
"devDependencies": { "devDependencies": {
"@microsoft/sp-build-web": "1.9.1", "@microsoft/sp-build-web": "1.15.2",
"@microsoft/sp-tslint-rules": "1.9.1", "@microsoft/sp-tslint-rules": "1.9.1",
"@microsoft/sp-module-interfaces": "1.9.1", "@microsoft/sp-module-interfaces": "1.9.1",
"@microsoft/sp-webpart-workbench": "1.9.1", "@microsoft/sp-webpart-workbench": "1.12.1",
"@microsoft/rush-stack-compiler-2.9": "0.7.16", "@microsoft/rush-stack-compiler-2.9": "0.7.16",
"gulp": "~3.9.1", "gulp": "~3.9.1",
"@types/chai": "3.4.34", "@types/chai": "3.4.34",

File diff suppressed because it is too large Load Diff

View File

@ -34,10 +34,10 @@
"@types/react": "16.4.2" "@types/react": "16.4.2"
}, },
"devDependencies": { "devDependencies": {
"@microsoft/sp-build-web": "1.7.1", "@microsoft/sp-build-web": "1.15.2",
"@microsoft/sp-tslint-rules": "1.7.1", "@microsoft/sp-tslint-rules": "1.7.1",
"@microsoft/sp-module-interfaces": "1.7.1", "@microsoft/sp-module-interfaces": "1.7.1",
"@microsoft/sp-webpart-workbench": "1.7.1", "@microsoft/sp-webpart-workbench": "1.12.1",
"gulp": "~3.9.1", "gulp": "~3.9.1",
"@types/chai": "3.4.34", "@types/chai": "3.4.34",
"@types/mocha": "2.2.38", "@types/mocha": "2.2.38",

File diff suppressed because it is too large Load Diff

View File

@ -25,9 +25,9 @@
"react-dom": "15.6.2" "react-dom": "15.6.2"
}, },
"devDependencies": { "devDependencies": {
"@microsoft/sp-build-web": "1.6.0", "@microsoft/sp-build-web": "1.15.2",
"@microsoft/sp-module-interfaces": "1.6.0", "@microsoft/sp-module-interfaces": "1.6.0",
"@microsoft/sp-webpart-workbench": "1.6.0", "@microsoft/sp-webpart-workbench": "1.12.1",
"tslint-microsoft-contrib": "~5.0.0", "tslint-microsoft-contrib": "~5.0.0",
"gulp": "~3.9.1", "gulp": "~3.9.1",
"@types/chai": "3.4.34", "@types/chai": "3.4.34",

File diff suppressed because it is too large Load Diff

View File

@ -65,10 +65,10 @@
"devDependencies": { "devDependencies": {
"@microsoft/rush-stack-compiler-2.9": "0.7.16", "@microsoft/rush-stack-compiler-2.9": "0.7.16",
"@microsoft/rush-stack-compiler-3.3": "0.3.5", "@microsoft/rush-stack-compiler-3.3": "0.3.5",
"@microsoft/sp-build-web": "1.11.0", "@microsoft/sp-build-web": "1.15.2",
"@microsoft/sp-module-interfaces": "1.11.0", "@microsoft/sp-module-interfaces": "1.11.0",
"@microsoft/sp-tslint-rules": "1.11.0", "@microsoft/sp-tslint-rules": "1.11.0",
"@microsoft/sp-webpart-workbench": "1.11.0", "@microsoft/sp-webpart-workbench": "1.12.1",
"@types/chai": "3.4.34", "@types/chai": "3.4.34",
"@types/es6-promise": "0.0.33", "@types/es6-promise": "0.0.33",
"@types/mocha": "2.2.38", "@types/mocha": "2.2.38",

View File

@ -27,7 +27,7 @@
{ {
"type": "image", "type": "image",
"order": 100, "order": 100,
"url": "https://github.com/pnp/sp-dev-fx-webparts/raw/main/samples/react-content-query-onprem/Misc/toolpart.gif", "url": "https://github.com/pnp/sp-dev-fx-webparts/blob/main/samples/react-content-query-onprem/Misc/toolpart.gif?raw=true",
"alt": "Content Query Web Part (On-Premises SharePoint)" "alt": "Content Query Web Part (On-Premises SharePoint)"
} }
], ],

View File

@ -0,0 +1,47 @@
FROM mcr.microsoft.com/powershell:7.1.0-ubuntu-focal
ENV NPM_CONFIG_PREFIX=/home/copy-views-container/.npm-global \
PATH=$PATH:/home/copy-views-container/.npm-global/bin
RUN apt-get update && apt-get install -y \
git \
curl \
sudo \
zsh \
jq \
vim \
&& curl -sL https://deb.nodesource.com/setup_16.x | sudo -E bash - \
&& apt-get install nodejs -y \
&& rm -rf /var/lib/apt/lists/*
RUN useradd \
--user-group \
--system \
--create-home \
--no-log-init \
copy-views-container
USER copy-views-container
EXPOSE 5432 4321 35729
WORKDIR /home/copy-views-container
# ********************************************************
# * Anything else you want to do like clean up goes here *
# ********************************************************
RUN npm install -g gulp-cli@latest yo@4 @microsoft/generator-sharepoint@1.15.x spfx-fast-serve@3 @pnp/cli-microsoft365 --unsafe-perm
RUN zsh -c "$(curl https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" --unattended \
&& git clone https://github.com/denysdovhan/spaceship-prompt.git "$HOME/.oh-my-zsh/custom/themes/spaceship-prompt" --depth=1 \
&& ln -s "$HOME/.oh-my-zsh/custom/themes/spaceship-prompt/spaceship.zsh-theme" "$HOME/.oh-my-zsh/custom/themes/spaceship.zsh-theme" \
&& cp "$HOME/.oh-my-zsh/templates/zshrc.zsh-template" $HOME/.zshrc \
&& git clone https://github.com/zsh-users/zsh-syntax-highlighting.git $HOME/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting \
&& git clone https://github.com/zsh-users/zsh-autosuggestions $HOME/.oh-my-zsh/custom/plugins/zsh-autosuggestions \
&& sed -i "11s/ZSH_THEME=\"robbyrussell\"/ZSH_THEME=\"spaceship\"/" ~/.zshrc \
&& sed -i "27s/# DISABLE_AUTO_UPDATE=\"true\"/DISABLE_AUTO_UPDATE=\"true\"/" ~/.zshrc \
&& sed -i "73s/plugins=(git)/plugins=(git zsh-autosuggestions zsh-syntax-highlighting)/" ~/.zshrc \
&& sed -i "50s/# COMPLETION_WAITING_DOTS/COMPLETION_WAITING_DOTS/" ~/.zshrc
CMD [ "/bin/zsh", "-l" ]

View File

@ -0,0 +1,42 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.194.0/containers/typescript-node
{
"name": "copy-views-container",
"build": {
"dockerfile": "Dockerfile",
// Update 'VARIANT' to pick a Node version: 12, 14, 16
"args": {
"VARIANT": "14"
}
},
// Set *default* container specific settings.json values on container create.
"settings": {
"terminal.integrated.profiles.linux": {
"zsh": {
"path": "/bin/zsh",
"args": [
"-l"
]
}
},
"terminal.integrated.defaultProfile.linux": "zsh"
},
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"dbaeumer.vscode-eslint",
"mhutchie.git-graph",
"eamodio.gitlens"
],
// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [5432, 4321, 35729],
// Use 'postCreateCommand' to run commands after the container is created.
//"postCreateCommand": "npm install",
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "copy-views-container"
}

View File

@ -0,0 +1,384 @@
require('@rushstack/eslint-config/patch/modern-module-resolution');
module.exports = {
extends: ['@microsoft/eslint-config-spfx/lib/profiles/react'],
parserOptions: { tsconfigRootDir: __dirname },
rules: {
"no-unused-vars": "error",
"@microsoft/spfx/no-async-await": "off",
"@typescript-eslint/typedef": "off",
"@typescript-eslint/no-explicit-any": "off"
},
overrides: [
{
files: ['*.ts', '*.tsx'],
parser: '@typescript-eslint/parser',
'parserOptions': {
'project': './tsconfig.json',
'ecmaVersion': 2018,
'sourceType': 'module'
},
rules: {
// Prevent usage of the JavaScript null value, while allowing code to access existing APIs that may require null. https://www.npmjs.com/package/@rushstack/eslint-plugin
'@rushstack/no-new-null': 1,
// Require Jest module mocking APIs to be called before any other statements in their code block. https://www.npmjs.com/package/@rushstack/eslint-plugin
'@rushstack/hoist-jest-mock': 1,
// Require regular expressions to be constructed from string constants rather than dynamically building strings at runtime. https://www.npmjs.com/package/@rushstack/eslint-plugin-security
'@rushstack/security/no-unsafe-regexp': 1,
// STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json
'@typescript-eslint/adjacent-overload-signatures': 1,
// STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json
//
// CONFIGURATION: By default, these are banned: String, Boolean, Number, Object, Symbol
'@typescript-eslint/ban-types': [
1,
{
'extendDefaults': false,
'types': {
'String': {
'message': 'Use \'string\' instead',
'fixWith': 'string'
},
'Boolean': {
'message': 'Use \'boolean\' instead',
'fixWith': 'boolean'
},
'Number': {
'message': 'Use \'number\' instead',
'fixWith': 'number'
},
'Object': {
'message': 'Use \'object\' instead, or else define a proper TypeScript type:'
},
'Symbol': {
'message': 'Use \'symbol\' instead',
'fixWith': 'symbol'
},
'Function': {
'message': 'The \'Function\' type accepts any function-like value. It provides no type safety when calling the function, which can be a common source of bugs. It also accepts things like class declarations, which will throw at runtime as they will not be called with new. If you are expecting the function to accept certain arguments, you should explicitly define the function shape.'
}
}
}
],
// RATIONALE: Code is more readable when the type of every variable is immediately obvious.
// Even if the compiler may be able to infer a type, this inference will be unavailable
// to a person who is reviewing a GitHub diff. This rule makes writing code harder,
// but writing code is a much less important activity than reading it.
//
// STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json
'@typescript-eslint/explicit-function-return-type': [
1,
{
'allowExpressions': true,
'allowTypedFunctionExpressions': true,
'allowHigherOrderFunctions': false
}
],
// STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json
// Rationale to disable: although this is a recommended rule, it is up to dev to select coding style.
// Set to 1 (warning) or 2 (error) to enable.
'@typescript-eslint/explicit-member-accessibility': 0,
// STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json
'@typescript-eslint/no-array-constructor': 1,
// STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json
//
// RATIONALE: The "any" keyword disables static type checking, the main benefit of using TypeScript.
// This rule should be suppressed only in very special cases such as JSON.stringify()
// where the type really can be anything. Even if the type is flexible, another type
// may be more appropriate such as "unknown", "{}", or "Record<k,V>".
'@typescript-eslint/no-explicit-any': 1,
// RATIONALE: The #1 rule of promises is that every promise chain must be terminated by a catch()
// handler. Thus wherever a Promise arises, the code must either append a catch handler,
// or else return the object to a caller (who assumes this responsibility). Unterminated
// promise chains are a serious issue. Besides causing errors to be silently ignored,
// they can also cause a NodeJS process to terminate unexpectedly.
'@typescript-eslint/no-floating-promises': 2,
// RATIONALE: Catches a common coding mistake.
'@typescript-eslint/no-for-in-array': 2,
// STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json
'@typescript-eslint/no-misused-new': 2,
// RATIONALE: The "namespace" keyword is not recommended for organizing code because JavaScript lacks
// a "using" statement to traverse namespaces. Nested namespaces prevent certain bundler
// optimizations. If you are declaring loose functions/variables, it's better to make them
// static members of a class, since classes support property getters and their private
// members are accessible by unit tests. Also, the exercise of choosing a meaningful
// class name tends to produce more discoverable APIs: for example, search+replacing
// the function "reverse()" is likely to return many false matches, whereas if we always
// write "Text.reverse()" is more unique. For large scale organization, it's recommended
// to decompose your code into separate NPM packages, which ensures that component
// dependencies are tracked more conscientiously.
//
// STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json
'@typescript-eslint/no-namespace': [
1,
{
'allowDeclarations': false,
'allowDefinitionFiles': false
}
],
// RATIONALE: Parameter properties provide a shorthand such as "constructor(public title: string)"
// that avoids the effort of declaring "title" as a field. This TypeScript feature makes
// code easier to write, but arguably sacrifices readability: In the notes for
// "@typescript-eslint/member-ordering" we pointed out that fields are central to
// a class's design, so we wouldn't want to bury them in a constructor signature
// just to save some typing.
//
// STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json
// Set to 1 (warning) or 2 (error) to enable the rule
'@typescript-eslint/no-parameter-properties': 0,
// RATIONALE: When left in shipping code, unused variables often indicate a mistake. Dead code
// may impact performance.
//
// STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json
'@typescript-eslint/no-unused-vars': [
1,
{
'vars': 'all',
// Unused function arguments often indicate a mistake in JavaScript code. However in TypeScript code,
// the compiler catches most of those mistakes, and unused arguments are fairly common for type signatures
// that are overriding a base class method or implementing an interface.
'args': 'none'
}
],
// STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json
'@typescript-eslint/no-use-before-define': [
2,
{
'functions': false,
'classes': true,
'variables': true,
'enums': true,
'typedefs': true
}
],
// Disallows require statements except in import statements.
// In other words, the use of forms such as var foo = require("foo") are banned. Instead use ES6 style imports or import foo = require("foo") imports.
'@typescript-eslint/no-var-requires': 'error',
// RATIONALE: The "module" keyword is deprecated except when describing legacy libraries.
//
// STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json
'@typescript-eslint/prefer-namespace-keyword': 1,
// STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json
// Rationale to disable: it's up to developer to decide if he wants to add type annotations
// Set to 1 (warning) or 2 (error) to enable the rule
'@typescript-eslint/no-inferrable-types': 0,
// STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json
// Rationale to disable: declaration of empty interfaces may be helpful for generic types scenarios
'@typescript-eslint/no-empty-interface': 0,
// RATIONALE: This rule warns if setters are defined without getters, which is probably a mistake.
'accessor-pairs': 1,
// RATIONALE: In TypeScript, if you write x["y"] instead of x.y, it disables type checking.
'dot-notation': [
1,
{
'allowPattern': '^_'
}
],
// RATIONALE: Catches code that is likely to be incorrect
'eqeqeq': 1,
// STANDARDIZED BY: eslint\conf\eslint-recommended.js
'for-direction': 1,
// RATIONALE: Catches a common coding mistake.
'guard-for-in': 2,
// RATIONALE: If you have more than 2,000 lines in a single source file, it's probably time
// to split up your code.
'max-lines': ['warn', { max: 2000 }],
// STANDARDIZED BY: eslint\conf\eslint-recommended.js
'no-async-promise-executor': 2,
// RATIONALE: Deprecated language feature.
'no-caller': 2,
// STANDARDIZED BY: eslint\conf\eslint-recommended.js
'no-compare-neg-zero': 2,
// STANDARDIZED BY: eslint\conf\eslint-recommended.js
'no-cond-assign': 2,
// STANDARDIZED BY: eslint\conf\eslint-recommended.js
'no-constant-condition': 1,
// STANDARDIZED BY: eslint\conf\eslint-recommended.js
'no-control-regex': 2,
// STANDARDIZED BY: eslint\conf\eslint-recommended.js
'no-debugger': 1,
// STANDARDIZED BY: eslint\conf\eslint-recommended.js
'no-delete-var': 2,
// RATIONALE: Catches code that is likely to be incorrect
// STANDARDIZED BY: eslint\conf\eslint-recommended.js
'no-duplicate-case': 2,
// STANDARDIZED BY: eslint\conf\eslint-recommended.js
'no-empty': 1,
// STANDARDIZED BY: eslint\conf\eslint-recommended.js
'no-empty-character-class': 2,
// STANDARDIZED BY: eslint\conf\eslint-recommended.js
'no-empty-pattern': 1,
// RATIONALE: Eval is a security concern and a performance concern.
'no-eval': 1,
// RATIONALE: Catches code that is likely to be incorrect
// STANDARDIZED BY: eslint\conf\eslint-recommended.js
'no-ex-assign': 2,
// RATIONALE: System types are global and should not be tampered with in a scalable code base.
// If two different libraries (or two versions of the same library) both try to modify
// a type, only one of them can win. Polyfills are acceptable because they implement
// a standardized interoperable contract, but polyfills are generally coded in plain
// JavaScript.
'no-extend-native': 1,
// Disallow unnecessary labels
'no-extra-label': 1,
// STANDARDIZED BY: eslint\conf\eslint-recommended.js
'no-fallthrough': 2,
// STANDARDIZED BY: eslint\conf\eslint-recommended.js
'no-func-assign': 1,
// RATIONALE: Catches a common coding mistake.
'no-implied-eval': 2,
// STANDARDIZED BY: eslint\conf\eslint-recommended.js
'no-invalid-regexp': 2,
// RATIONALE: Catches a common coding mistake.
'no-label-var': 2,
// RATIONALE: Eliminates redundant code.
'no-lone-blocks': 1,
// STANDARDIZED BY: eslint\conf\eslint-recommended.js
'no-misleading-character-class': 2,
// RATIONALE: Catches a common coding mistake.
'no-multi-str': 2,
// RATIONALE: It's generally a bad practice to call "new Thing()" without assigning the result to
// a variable. Either it's part of an awkward expression like "(new Thing()).doSomething()",
// or else implies that the constructor is doing nontrivial computations, which is often
// a poor class design.
'no-new': 1,
// RATIONALE: Obsolete language feature that is deprecated.
'no-new-func': 2,
// RATIONALE: Obsolete language feature that is deprecated.
'no-new-object': 2,
// RATIONALE: Obsolete notation.
'no-new-wrappers': 1,
// RATIONALE: Catches code that is likely to be incorrect
// STANDARDIZED BY: eslint\conf\eslint-recommended.js
'no-octal': 2,
// RATIONALE: Catches code that is likely to be incorrect
'no-octal-escape': 2,
// RATIONALE: Catches code that is likely to be incorrect
// STANDARDIZED BY: eslint\conf\eslint-recommended.js
'no-regex-spaces': 2,
// RATIONALE: Catches a common coding mistake.
'no-return-assign': 2,
// RATIONALE: Security risk.
'no-script-url': 1,
// STANDARDIZED BY: eslint\conf\eslint-recommended.js
'no-self-assign': 2,
// RATIONALE: Catches a common coding mistake.
'no-self-compare': 2,
// RATIONALE: This avoids statements such as "while (a = next(), a && a.length);" that use
// commas to create compound expressions. In general code is more readable if each
// step is split onto a separate line. This also makes it easier to set breakpoints
// in the debugger.
'no-sequences': 1,
// RATIONALE: Catches code that is likely to be incorrect
// STANDARDIZED BY: eslint\conf\eslint-recommended.js
'no-shadow-restricted-names': 2,
// RATIONALE: Obsolete language feature that is deprecated.
// STANDARDIZED BY: eslint\conf\eslint-recommended.js
'no-sparse-arrays': 2,
// RATIONALE: Although in theory JavaScript allows any possible data type to be thrown as an exception,
// such flexibility adds pointless complexity, by requiring every catch block to test
// the type of the object that it receives. Whereas if catch blocks can always assume
// that their object implements the "Error" contract, then the code is simpler, and
// we generally get useful additional information like a call stack.
'no-throw-literal': 2,
// RATIONALE: Catches a common coding mistake.
'no-unmodified-loop-condition': 1,
// STANDARDIZED BY: eslint\conf\eslint-recommended.js
'no-unsafe-finally': 2,
// RATIONALE: Catches a common coding mistake.
'no-unused-expressions': 1,
// STANDARDIZED BY: eslint\conf\eslint-recommended.js
'no-unused-labels': 1,
// STANDARDIZED BY: eslint\conf\eslint-recommended.js
'no-useless-catch': 1,
// RATIONALE: Avoids a potential performance problem.
'no-useless-concat': 1,
// RATIONALE: The "var" keyword is deprecated because of its confusing "hoisting" behavior.
// Always use "let" or "const" instead.
//
// STANDARDIZED BY: @typescript-eslint\eslint-plugin\dist\configs\recommended.json
'no-var': 2,
// RATIONALE: Generally not needed in modern code.
'no-void': 1,
// RATIONALE: Obsolete language feature that is deprecated.
// STANDARDIZED BY: eslint\conf\eslint-recommended.js
'no-with': 2,
// RATIONALE: Makes logic easier to understand, since constants always have a known value
// @typescript-eslinteslint-plugindistconfigseslint-recommended.js
'prefer-const': 1,
// RATIONALE: Catches a common coding mistake where "resolve" and "reject" are confused.
'promise/param-names': 2,
// RATIONALE: Catches code that is likely to be incorrect
// STANDARDIZED BY: eslint\conf\eslint-recommended.js
'require-atomic-updates': 2,
// STANDARDIZED BY: eslint\conf\eslint-recommended.js
'require-yield': 1,
// "Use strict" is redundant when using the TypeScript compiler.
'strict': [
2,
'never'
],
// RATIONALE: Catches code that is likely to be incorrect
// STANDARDIZED BY: eslint\conf\eslint-recommended.js
'use-isnan': 2,
// STANDARDIZED BY: eslint\conf\eslint-recommended.js
// Set to 1 (warning) or 2 (error) to enable.
// Rationale to disable: !!{}
'no-extra-boolean-cast': 0,
// ====================================================================
// @microsoft/eslint-plugin-spfx
// ====================================================================
'@microsoft/spfx/import-requires-chunk-name': 1,
'@microsoft/spfx/no-require-ensure': 2,
'@microsoft/spfx/pair-react-dom-render-unmount': 1
}
},
{
// For unit tests, we can be a little bit less strict. The settings below revise the
// defaults specified in the extended configurations, as well as above.
files: [
// Test files
'*.test.ts',
'*.test.tsx',
'*.spec.ts',
'*.spec.tsx',
// Facebook convention
'**/__mocks__/*.ts',
'**/__mocks__/*.tsx',
'**/__tests__/*.ts',
'**/__tests__/*.tsx',
// Microsoft convention
'**/test/*.ts',
'**/test/*.tsx'
],
rules: {
'no-new': 0,
'class-name': 0,
'export-name': 0,
forin: 0,
'label-position': 0,
'member-access': 2,
'no-arg': 0,
'no-console': 0,
'no-construct': 0,
'no-duplicate-variable': 2,
'no-eval': 0,
'no-function-expression': 2,
'no-internal-module': 2,
'no-shadowed-variable': 2,
'no-switch-case-fall-through': 2,
'no-unnecessary-semicolons': 2,
'no-unused-expression': 2,
'no-with-statement': 2,
semicolon: 2,
'trailing-comma': 0,
typedef: 0,
'typedef-whitespace': 0,
'use-named-parameter': 2,
'variable-name': 0,
whitespace: 0
}
}
]
};

34
samples/react-copy-views/.gitignore vendored Normal file
View File

@ -0,0 +1,34 @@
# Logs
logs
*.log
npm-debug.log*
# Dependency directories
node_modules
# Build generated files
dist
lib
release
solution
temp
*.sppkg
.heft
# Coverage directory used by tools like istanbul
coverage
# OSX
.DS_Store
# Visual Studio files
.ntvs_analysis.dat
.vs
bin
obj
# Resx Generated Code
*.resx.ts
# Styles Generated Code
*.scss.ts

View File

@ -0,0 +1,16 @@
!dist
config
gulpfile.js
release
src
temp
tsconfig.json
tslint.json
*.log
.yo-rc.json
.vscode

View File

@ -0,0 +1,16 @@
{
"@microsoft/generator-sharepoint": {
"plusBeta": false,
"isCreatingSolution": false,
"version": "1.15.2",
"libraryName": "copy-views",
"libraryId": "f9a94606-ce1c-487c-ab87-550b240421de",
"environment": "spo",
"packageManager": "npm",
"solutionName": "copy-views",
"solutionShortDescription": "copy-views description",
"skipFeatureDeployment": true,
"isDomainIsolated": false,
"componentType": "webpart"
}
}

View File

@ -0,0 +1,92 @@
# Copy Views
## Summary
This solution enables a user to copy views from one list/library to another across site collections. It can be used as a webpart on a page, or as a ListView Command Set extension. The user can select multiple views to copy to multiple target lists.
![Copy Views extension](./assets/copy-views-screenshot.png)
![Copy Views](./assets/copy-views.gif)
## Used Versions
![SPFx 1.15.2](https://img.shields.io/badge/SPFx-1.15.2-green.svg)
![pnpjs](https://img.shields.io/badge/pnpjs-3.6-green.svg)
![Node.js v14 | v12](https://img.shields.io/badge/Node.js-v14%20%7C%20v12-green.svg)
![Compatible with SharePoint Online](https://img.shields.io/badge/SharePoint%20Online-Compatible-green.svg)
![Does not work with SharePoint 2019](https://img.shields.io/badge/SharePoint%20Server%202019-Unknown-red.svg "SharePoint Server 2019 requires SPFx 1.4.1 or lower")
![Does not work with SharePoint 2016 (Feature Pack 2)](https://img.shields.io/badge/SharePoint%20Server%202016%20(Feature%20Pack%202)-Unknown-red.svg "SharePoint Server 2016 Feature Pack 2 requires SPFx 1.1")
![Local Workbench Unsupported](https://img.shields.io/badge/Local%20Workbench-Unsupported-red.svg "Local workbench is no longer available as of SPFx 1.13 and above")
![Hosted Workbench Compatible](https://img.shields.io/badge/Hosted%20Workbench-Compatible-green.svg)
![Compatible with Remote Containers](https://img.shields.io/badge/Remote%20Containers-Compatible-green.svg)
## Applies to
- [SharePoint Framework](https://aka.ms/spfx)
- [Microsoft 365 tenant](https://docs.microsoft.com/en-us/sharepoint/dev/spfx/set-up-your-developer-tenant)
> Get your own free development tenant by subscribing to [Microsoft 365 developer program](http://aka.ms/o365devprogram)
## Solution
| Solution | Author(s) |
| ----------- | ------------------------------------------------------- |
| Copy Views | [Martin Lingstuyl](https://github.com/martinlingstuyl) ([@martinlingstuyl](https://twitter.com/martinlingstuyl)), I4-YOU Business Solutions b.v. |
## Version history
| Version | Date | Comments |
| ------- | ---------------- | --------------- |
| 1.0 | August 29, 2022 | Initial release |
## Minimal Path to Awesome
- Clone this repository
- Ensure that you are at the solution folder
- in the command-line run:
- `npm install`
- `gulp serve`
- To package and deploy:
- Use `gulp bundle --ship` & `gulp package-solution --ship`
- Add the `.sppkg` to your SharePoint App Catalog
> This sample can also be opened with [VS Code Remote Development](https://code.visualstudio.com/docs/remote/remote-overview). Visit https://aka.ms/spfx-devcontainer for further instructions.
## Features
- Views can be copied from one list or library to other lists or libraries across site collections.
- List views can only be copied to other *lists* and library views can only be copied to other *libraries*.
- When opening the component using the List view Command Set extension, the current site, list and view will be preselected. When opening the component from a webpart, the current site will be preselected.
- When copying views, the following things will be included:
- Field references.
- Sort and filter settings.
- Column formatting and view formatting.
- Fields that are not available on the target list are excluded from the copied view. The view query is cleaned of these fields so as not to break the view when columns are used to filter on. *
- Views of type 'Kanban board' and 'modern calendar' are currently **not** supported.
- Views that are set to default on the source list will not automatically be set to default on the target list. The checkbox 'Set as default' will need to be used.
> *The component uses the DOM parser to parse the ViewQuery XML, and removes any filter conditions that reference fields that are not available on the target list. The component can even clean filter queries with multiple And/Or CAML-conditions.
## 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-copy-views%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-copy-views) 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-copy-views&template=bug-report.yml&sample=react-copy-views&authors=@martinlingstuyl&title=react-copy-views%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-copy-views&template=question.yml&sample=react-copy-views&authors=@martinlingstuyl&title=react-copy-views%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-copy-views&template=suggestion.yml&sample=react-copy-views&authors=@martinlingstuyl&title=react-copy-views%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.**
---
<img src="https://pnptelemetry.azurewebsites.net/sp-dev-fx-webparts/samples/react-copy-views" />

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 593 KiB

View File

@ -0,0 +1,56 @@
[
{
"name": "pnp-sp-dev-spfx-web-parts-react-copy-views",
"source": "pnp",
"title": "Copy Views",
"shortDescription": "The Copy Views solution enables a user to copy views from one list/library to another across site collections.",
"url": "https://github.com/pnp/sp-dev-fx-webparts/tree/main/samples/react-copy-views",
"longDescription": [
"The Copy Views solution enables a user to copy views from one list/library to another across site collections. It can be used as a webpart on a page, or as a ListView Command Set extension. The user can select multiple views to copy to multiple target lists."
],
"creationDateTime": "2022-08-29",
"updateDateTime": "2022-09-12",
"products": [
"SharePoint"
],
"metadata": [
{
"key": "CLIENT-SIDE-DEV",
"value": "React"
},
{
"key": "SPFX-VERSION",
"value": "1.15.2"
}
],
"thumbnails": [
{
"type": "image",
"order": 100,
"url": "https://github.com/pnp/sp-dev-fx-webparts/raw/main/samples/react-copy-views/assets/copy-views.gif",
"alt": "Copy Views solution"
},
{
"type": "image",
"order": 101,
"url": "https://github.com/pnp/sp-dev-fx-webparts/raw/main/samples/react-copy-views/assets/copy-views-screenshot.png",
"alt": "Copy Views solution"
}
],
"authors": [
{
"gitHubAccount": "martinlingstuyl",
"company": "I4-YOU Business Solutions b.v.",
"pictureUrl": "https://avatars.githubusercontent.com/u/5267487?v=4",
"name": "Martin Lingstuyl"
}
],
"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/en-us/sharepoint/dev/spfx/web-parts/get-started/build-a-hello-world-web-part"
}
]
}
]

View File

@ -0,0 +1,28 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/spfx-build/config.2.0.schema.json",
"version": "2.0",
"bundles": {
"copy-views-web-part": {
"components": [
{
"entrypoint": "./lib/webparts/copyViews/CopyViewsWebPart.js",
"manifest": "./src/webparts/copyViews/CopyViewsWebPart.manifest.json"
}
]
},
"copy-views-command-set": {
"components": [
{
"entrypoint": "./lib/extensions/copyViews/CopyViewsCommandSet.js",
"manifest": "./src/extensions/copyViews/CopyViewsCommandSet.manifest.json"
}
]
}
},
"externals": {},
"localizedResources": {
"CopyViewsSharedStrings": "lib/shared/loc/{locale}.js",
"CopyViewsWebPartStrings": "lib/webparts/copyViews/loc/{locale}.js",
"CopyViewsCommandSetStrings": "lib/extensions/copyViews/loc/{locale}.js"
}
}

View File

@ -0,0 +1,7 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/spfx-build/deploy-azure-storage.schema.json",
"workingDir": "./release/assets/",
"account": "<!-- STORAGE ACCOUNT NAME -->",
"container": "copy-views",
"accessKey": "<!-- ACCESS KEY -->"
}

View File

@ -0,0 +1,46 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/spfx-build/package-solution.schema.json",
"solution": {
"name": "copy-views-client-side-solution",
"id": "f9a94606-ce1c-487c-ab87-550b240421de",
"version": "1.0.1.5",
"includeClientSideAssets": true,
"skipFeatureDeployment": true,
"isDomainIsolated": false,
"developer": {
"name": "Martin Lingstuyl",
"websiteUrl": "https://www.blimped.nl",
"privacyUrl": "",
"termsOfUseUrl": "",
"mpnId": "Undefined-1.15.0"
},
"metadata": {
"shortDescription": {
"default": "Webpart and extension to copy views between lists and libraries."
},
"longDescription": {
"default": "Webpart and extension to copy views between lists and libraries."
},
"screenshotPaths": [],
"videoUrl": "",
"categories": []
},
"features": [
{
"title": "copy-views Feature",
"description": "The feature that activates elements of the copy-views solution.",
"id": "13252aea-fba5-4919-b962-045954817a5b",
"version": "1.0.0.0",
"assets": {
"elementManifests": [
"elements.xml",
"ClientSideInstance.xml"
]
}
}
]
},
"paths": {
"zippedPackage": "solution/copy-views.sppkg"
}
}

View File

@ -0,0 +1,28 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/spfx-build/spfx-serve.schema.json",
"port": 4321,
"https": true,
"initialPage": "https://enter-your-SharePoint-site/_layouts/workbench.aspx",
"serveConfigurations": {
"default": {
"pageUrl": "https://contoso.sharepoint.com/sites/mySite/SitePages/myPage.aspx",
"customActions": {
"8e99be83-ad7e-4706-a8e1-d72df435d7e9": {
"location": "ClientSideExtension.ListViewCommandSet.CommandBar",
"properties": {
}
}
}
},
"extension": {
"pageUrl": "https://contoso.sharepoint.com/sites/mySite/Shared Documents",
"customActions": {
"8e99be83-ad7e-4706-a8e1-d72df435d7e9": {
"location": "ClientSideExtension.ListViewCommandSet.CommandBar",
"properties": {
}
}
}
}
}
}

View File

@ -0,0 +1,4 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/spfx-build/write-manifests.schema.json",
"cdnBasePath": "<!-- PATH TO CDN -->"
}

23
samples/react-copy-views/gulpfile.js vendored Normal file
View File

@ -0,0 +1,23 @@
'use strict';
const build = require('@microsoft/sp-build-web');
build.addSuppression(`Warning - [sass] The local CSS class 'ms-Grid' is not camelCase and will not be type-safe.`);
var getTasks = build.rig.getTasks;
build.rig.getTasks = function () {
var result = getTasks.call(build.rig);
result.set('serve', result.get('serve-deprecated'));
return result;
};
/* fast-serve */
const { addFastServe } = require("spfx-fast-serve-helpers");
addFastServe(build);
/* end of fast-serve */
// disable eslint
build.lintCmd.enabled = false;
build.initialize(require('gulp'));

64541
samples/react-copy-views/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,45 @@
{
"name": "copy-views",
"version": "0.0.1",
"private": true,
"main": "lib/index.js",
"scripts": {
"build": "gulp bundle",
"clean": "gulp clean",
"test": "gulp test",
"serve": "gulp bundle --custom-serve --max_old_space_size=4096 && fast-serve"
},
"dependencies": {
"@fluentui/react-icons-mdl2": "^1.3.16",
"@microsoft/decorators": "1.15.2",
"@microsoft/sp-adaptive-card-extension-base": "1.15.2",
"@microsoft/sp-core-library": "1.15.2",
"@microsoft/sp-dialog": "1.15.2",
"@microsoft/sp-listview-extensibility": "1.15.2",
"@microsoft/sp-lodash-subset": "1.15.2",
"@microsoft/sp-office-ui-fabric-core": "1.15.2",
"@microsoft/sp-property-pane": "1.15.2",
"@microsoft/sp-webpart-base": "1.15.2",
"@pnp/sp": "^3.6.0",
"office-ui-fabric-react": "7.185.7",
"react": "16.13.1",
"react-dom": "16.13.1",
"tslib": "2.3.1"
},
"devDependencies": {
"@microsoft/eslint-config-spfx": "1.15.2",
"@microsoft/eslint-plugin-spfx": "1.15.2",
"@microsoft/rush-stack-compiler-4.5": "0.2.2",
"@microsoft/sp-build-web": "1.15.2",
"@microsoft/sp-module-interfaces": "1.15.2",
"@rushstack/eslint-config": "2.5.1",
"@types/react": "16.9.51",
"@types/react-dom": "16.9.8",
"@types/webpack-env": "~1.15.2",
"ajv": "^6.12.5",
"eslint-plugin-react-hooks": "4.3.0",
"gulp": "4.0.2",
"spfx-fast-serve-helpers": "^1.15.3",
"typescript": "4.5.5"
}
}

View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<ClientSideComponentInstance
Title="CopyViews for lists"
Location="ClientSideExtension.ListViewCommandSet.CommandBar"
ListTemplateId="100"
Properties="{}"
ComponentId="8e99be83-ad7e-4706-a8e1-d72df435d7e9" />
<ClientSideComponentInstance
Title="CopyViews for libraries"
Location="ClientSideExtension.ListViewCommandSet.CommandBar"
ListTemplateId="101"
Properties="{}"
ComponentId="8e99be83-ad7e-4706-a8e1-d72df435d7e9" />
</Elements>

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<CustomAction
Title="CopyViews"
RegistrationId="100"
RegistrationType="List"
Location="ClientSideExtension.ListViewCommandSet.CommandBar"
ClientSideComponentId="8e99be83-ad7e-4706-a8e1-d72df435d7e9"
ClientSideComponentProperties="{&quot;sampleTextOne&quot;:&quot;One item is selected in the list.&quot;, &quot;sampleTextTwo&quot;:&quot;This command is always visible.&quot;}">
</CustomAction>
</Elements>

View File

@ -0,0 +1,17 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/spfx/command-set-extension-manifest.schema.json",
"id": "8e99be83-ad7e-4706-a8e1-d72df435d7e9",
"alias": "CopyViewsCommandSet",
"componentType": "Extension",
"extensionType": "ListViewCommandSet",
"version": "*",
"manifestVersion": 2,
"requiresCustomScript": false,
"items": {
"COPYVIEWS": {
"title": { "default": "Copy views", "nl-nl": "Weergaven kopiëren" },
"iconImageUrl": "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMDQ4IDIwNDgiIGNsYXNzPSJzdmdfZGQ3OTBlZTMiIGZvY3VzYWJsZT0iZmFsc2UiPjxwYXRoIGQ9Ik0xOTIwIDgwNXYxMjQzSDY0MHYtMzg0SDEyOFYwaDg1OWwzODQgMzg0aDEyOGw0MjEgNDIxem0tMzg0LTM3aDE2NWwtMTY1LTE2NXYxNjV6TTY0MCAzODRoNTQ5TDkzMyAxMjhIMjU2djE0MDhoMzg0VjM4NHptMTE1MiA1MTJoLTM4NFY1MTJINzY4djE0MDhoMTAyNFY4OTZ6Ij48L3BhdGg+PC9zdmc+",
"type": "command"
}
}
}

View File

@ -0,0 +1,50 @@
import { Log } from '@microsoft/sp-core-library';
import { BaseListViewCommandSet, IListViewCommandSetExecuteEventParameters } from '@microsoft/sp-listview-extensibility';
import { IDefaults } from '../../shared/interfaces';
import CopyViewsDialog from './CopyViewsDialog';
/**
* If your command set uses the ClientSideComponentProperties JSON input,
* it will be deserialized into the BaseExtension.properties object.
* You can define an interface to describe it.
*/
export interface ICopyViewsCommandSetProperties {
resultSourceId?: string;
}
const LOG_SOURCE: string = 'CopyViewsCommandSet';
export default class CopyViewsCommandSet extends BaseListViewCommandSet<ICopyViewsCommandSetProperties> {
public onInit(): Promise<void> {
Log.info(LOG_SOURCE, 'Initialized CopyViewsCommandSet');
return Promise.resolve();
}
public onExecute(event: IListViewCommandSetExecuteEventParameters): void {
const defaultValues = {
viewId: this.context.listView.view.id.toString(),
listId: this.context.listView.list.guid.toString(),
siteUrl: this.context.pageContext.site.absoluteUrl
} as IDefaults;
const dialog = new CopyViewsDialog(this.context.serviceScope, defaultValues, this.properties.resultSourceId);
switch (event.itemId) {
case 'COPYVIEWS':
dialog.show().then(() => {
//
}, (error: Error) => {
if (console && console.error && error) {
console.error(error);
}
});
break;
default:
throw new Error('Unknown command');
}
}
}

View File

@ -0,0 +1,45 @@
import { ServiceScope } from '@microsoft/sp-core-library';
import { BaseDialog, IDialogConfiguration } from '@microsoft/sp-dialog';
import * as React from 'react';
import * as ReactDOM from 'react-dom';
import { CopyViewsContainer } from '../../shared/components';
import { IDefaults } from '../../shared/interfaces';
export default class CopyViewsDialog extends BaseDialog {
private _serviceScope: ServiceScope;
private _resultSourceId?: string;
private _defaultValues: IDefaults;
public constructor(serviceScope: ServiceScope, defaultValues: IDefaults, resultSourceId?: string) {
super({ isBlocking: true });
this._serviceScope = serviceScope;
this._resultSourceId = resultSourceId;
this._defaultValues = defaultValues;
}
public render(): void {
const element = <div style={{ width: 1000, padding: 20 }}>
<CopyViewsContainer serviceScope={this._serviceScope} showCancel={true} defaultValues={this._defaultValues} resultSourceId={this._resultSourceId} onCopied={this._onCopied} onCancel={this.close} />
</div>;
ReactDOM.render(element, this.domElement);
}
private _onCopied = async (): Promise<void> => {
await this.close();
}
public getConfig(): IDialogConfiguration {
return { isBlocking: false };
}
protected onAfterClose(): void {
super.onAfterClose();
// Clean up the element for the next dialog
ReactDOM.unmountComponentAtNode(this.domElement);
}
}

View File

@ -0,0 +1,6 @@
define([], function() {
return {
"Command1": "Command 1",
"Command2": "Command 2"
}
});

View File

@ -0,0 +1,9 @@
declare interface ICopyViewsCommandSetStrings {
Command1: string;
Command2: string;
}
declare module 'CopyViewsCommandSetStrings' {
const strings: ICopyViewsCommandSetStrings;
export = strings;
}

View File

@ -0,0 +1 @@
// A file is required to be in the root of the /src directory by the TypeScript compiler

View File

@ -0,0 +1,89 @@
@import '~office-ui-fabric-react/dist/sass/References.scss';
@import '~@microsoft/sp-office-ui-fabric-core/dist/sass/SPFabricCore.scss';
.row {
@include ms-Grid-row;
}
.formHidden {
display: none;
}
.column {
@include ms-Grid-col;
@include ms-sm12;
@include ms-md12;
@include ms-lg6;
@include ms-xl6;
}
.checkboxSetDefaultView {
margin-top: 10px;
}
.checkboxSelectionContainer {
border-width: 1px;
border-style: solid;
border-color: #a19f9d;
height: 300px;
padding: 10px;
overflow: auto;
&:hover {
border-color: #323130;
}
}
.SiteSuggestion {
padding: 5px 5px;
text-align: left;
}
.selectedSite {
background: #f2f2f2;
padding: 0px 5px;
margin: 2px;
line-height: 26px;
}
.copyStatusContainer {
height: 300px;
overflow-y: auto;
overflow-x: hidden;
}
.copyTaskLine {
width: 100%;
position: relative;
.copyTaskIcon {
position: absolute;
right: 0;
top: 0;
}
}
.searchBox {
height: 38.66px;
:global {
.ms-SearchBox-iconContainer {
display: none;
}
}
}
.sitePicker {
visibility: inherit;
// height: 38.66px;
}
.title {
color: "[theme:bodyText, default: #323130]";
color: var(--bodyText);
font-family: $ms-font-family-fallbacks;
-webkit-font-smoothing: antialiased;
font-size: 20px;
font-weight: 600;
}

View File

@ -0,0 +1,108 @@
/* eslint-disable react/jsx-no-bind */
import { CheckMarkIcon, DecreaseIndentArrowMirroredIcon, ErrorBadgeIcon } from '@fluentui/react-icons-mdl2';
import * as strings from 'CopyViewsSharedStrings';
import { Link } from 'office-ui-fabric-react/lib/Link';
import { MessageBar, MessageBarType } from 'office-ui-fabric-react/lib/MessageBar';
import { ProgressIndicator } from 'office-ui-fabric-react/lib/ProgressIndicator';
import { Spinner } from 'office-ui-fabric-react/lib/Spinner';
import { Stack } from 'office-ui-fabric-react/lib/Stack';
import * as React from 'react';
import { CopyTaskState } from '../enums';
import { ICopyTask } from '../interfaces';
import styles from '../SharedStyles.module.scss';
interface ICopyStatusProps {
copyTasks: ICopyTask[];
onRetry: (copyTask: ICopyTask) => Promise<void>;
}
interface ICopyStatusState {
showErrors: number[];
}
export class CopyStatus extends React.Component<ICopyStatusProps, ICopyStatusState> {
public constructor(props: ICopyStatusProps) {
super(props);
this.state = {
showErrors: []
};
}
public render(): React.ReactElement<ICopyStatusProps> {
const { copyTasks } = this.props;
const { showErrors } = this.state;
const busy = copyTasks.some(t => t.state === CopyTaskState.Busy);
return <div className={styles.copyStatusContainer}>
{
busy
? <ProgressIndicator label={strings.BusyCopyingViews} />
: <MessageBar messageBarType={MessageBarType.info}>
{ strings.DoneCopyingViews }
</MessageBar>
}
<br/>
{
copyTasks.map((copyTask) => {
return <div key={copyTask.index} className={styles.copyTaskLine}>
<Stack tokens={{ childrenGap: 5 }} horizontal>
<span>{copyTask.index}.</span>
<Link href={copyTask.sourceView.viewUrl} target='_blank'>{copyTask.sourceView.title}</Link>
<DecreaseIndentArrowMirroredIcon style={{ fontSize: 25, marginRight: 15 }} />
<Link href={copyTask.targetList.listUrl} target='_blank'>{copyTask.targetList.title}</Link>
</Stack>
<div className={styles.copyTaskIcon}>
{
copyTask.state === CopyTaskState.Busy && <Spinner />
}
{
copyTask.state === CopyTaskState.Done && <CheckMarkIcon style={{ color: 'green' }} />
}
{
copyTask.state === CopyTaskState.Error && <ErrorBadgeIcon style={{ color: 'indianred' }} />
}
</div>
{copyTask.state === CopyTaskState.Error &&
<MessageBar
messageBarType={MessageBarType.error}
isMultiline={false}
actions={
<div>
<Link onClick={() => this._toggleErrorDetails(copyTask)}>{strings.SeeMore}</Link>
<Link onClick={() => this._retry(copyTask)}>{strings.Retry}</Link>
</div>
}
overflowButtonAriaLabel={strings.SeeMore}>
{strings.ErrorOccurred}
{ showErrors.some(i => copyTask.index === i) && <><br />{copyTask.error}</> }
</MessageBar>
}
</div>
})
}
</div>;
}
private _toggleErrorDetails = (copyTask: ICopyTask): void => {
const { showErrors } = this.state;
if (showErrors.some(i => i === copyTask.index)) {
const newShowErrors = showErrors.filter(i => i !== copyTask.index);
this.setState({ showErrors: newShowErrors});
}
else {
const newShowErrors = [...showErrors, copyTask.index];
this.setState({ showErrors: newShowErrors});
}
}
private _retry = async (copyTask: ICopyTask): Promise<void> => {
await this.props.onRetry(copyTask);
}
}

View File

@ -0,0 +1,181 @@
/* eslint-disable react/jsx-no-bind */
import * as React from 'react';
import { IList, IListView, ICopyTask, IDefaults } from '../interfaces';
import { CopyTaskState } from '../enums';
import { ServiceScope } from '@microsoft/sp-core-library';
import { IListViewsService, ListViewsService } from '../services';
import * as strings from 'CopyViewsSharedStrings';
import styles from './../SharedStyles.module.scss';
import { SourceListViewForm, TargetListForm, CopyStatus } from '.';
import { Stack } from 'office-ui-fabric-react/lib/Stack';
import { DefaultButton, PrimaryButton } from 'office-ui-fabric-react/lib/Button';
import { MessageBar, MessageBarType } from 'office-ui-fabric-react/lib/MessageBar';
import { Link } from 'office-ui-fabric-react/lib/Link';
import { Checkbox } from 'office-ui-fabric-react/lib/Checkbox';
interface ICopyViewsContainerProps {
serviceScope: ServiceScope;
resultSourceId?: string;
showCancel?: boolean;
defaultValues?: IDefaults;
onCopied: () => void;
onCancel?: () => void;
}
interface ICopyViewsContainerState {
sourceList?: IList;
sourceViews?: IListView[];
targetLists?: IList[];
showCopyStatus: boolean;
copyTasks?: ICopyTask[];
error?: string;
showErrorDetails: boolean;
setAsDefaultView: boolean;
}
export class CopyViewsContainer extends React.Component<ICopyViewsContainerProps, ICopyViewsContainerState> {
private _listViewsService: IListViewsService;
public constructor(props: ICopyViewsContainerProps) {
super(props);
this._listViewsService = props.serviceScope.consume(ListViewsService.serviceKey);
this.state = {
showCopyStatus: false,
showErrorDetails: false,
setAsDefaultView: false,
sourceViews: null
}
}
public render(): React.ReactElement<ICopyViewsContainerProps> {
const { serviceScope, resultSourceId, defaultValues, showCancel, onCancel } = this.props;
const { sourceViews, targetLists, error, showErrorDetails, showCopyStatus, copyTasks, sourceList, setAsDefaultView } = this.state;
const copyingDisabled = !(targetLists?.length > 0 && sourceViews?.length > 0);
return <>
<h2 className={styles.title}>{ !showCopyStatus ? strings.CopyViews : strings.CopyStatus }</h2>
{
error && <MessageBar
messageBarType={MessageBarType.error}
isMultiline={false}
actions={
<div>
<Link onClick={() => this.setState({ showErrorDetails: !showErrorDetails })}>{strings.SeeMore}</Link>
</div>
}
onDismiss={() => this.setState({ error: undefined })}
overflowButtonAriaLabel={strings.SeeMore}>
{strings.ErrorOccurred}
{ showErrorDetails && <><br/>{error}</> }
</MessageBar>
}
{
<div className={showCopyStatus && styles.formHidden}>
<div className={styles.row}>
<div className={styles.column}>
<SourceListViewForm serviceScope={serviceScope} defaultValues={defaultValues} resultSourceId={resultSourceId} onSelectionUpdate={this._onSelectionUpdate} onError={this._onError} />
<Checkbox label={strings.SetAsDefaultView} disabled={sourceViews?.length > 1} checked={setAsDefaultView} onChange={() => this.setState({ setAsDefaultView: !setAsDefaultView})} className={styles.checkboxSetDefaultView} />
</div>
<div className={styles.column}>
<TargetListForm serviceScope={serviceScope} baseType={sourceList?.type} exclude={sourceList} resultSourceId={resultSourceId} onSelectionUpdate={(lists: IList[]) => this.setState({ targetLists: lists })} onError={this._onError} />
</div>
</div>
<div>
<Stack tokens={{ childrenGap: 10 }} horizontal reversed style={{marginTop: 10}}>
<PrimaryButton disabled={copyingDisabled} text={strings.Copy} onClick={this._copyViews} />
{ showCancel && <DefaultButton text={strings.CloseDialog} onClick={() => onCancel()} /> }
</Stack>
</div>
</div>
}
{
showCopyStatus && <>
<CopyStatus copyTasks={copyTasks} onRetry={this._retryCopyTask} />
<div>
<Stack tokens={{ childrenGap: 10 }} horizontal reversed style={{marginTop: 10}}>
<PrimaryButton disabled={copyTasks.some(t => t.state === CopyTaskState.Busy)} text={strings.CopyAnotherView} onClick={() => this.setState({ showCopyStatus: false, copyTasks: [] })} />
{ showCancel && <DefaultButton disabled={copyTasks.some(t => t.state === CopyTaskState.Busy)} text={strings.CloseDialog} onClick={() => onCancel()} /> }
</Stack>
</div>
</>
}
</>;
}
private _onSelectionUpdate = (listViews: IListView[], list: IList): void => {
const { setAsDefaultView } = this.state;
this.setState({ sourceViews: listViews, sourceList: list, setAsDefaultView: listViews?.length > 1 ? false : setAsDefaultView });
}
private _copyViews = async (): Promise<void> => {
const { sourceViews, targetLists } = this.state;
const copyingDisabled = !(targetLists?.length > 0 && sourceViews?.length > 0);
if (copyingDisabled) {
return;
}
const copyTasks: ICopyTask[] = [];
let index = 0;
sourceViews.forEach(sourceView => {
targetLists.forEach(targetList => {
index++;
copyTasks.push({ index, sourceView, targetList, state: CopyTaskState.Busy });
});
});
this.setState({ showCopyStatus: true, copyTasks }, async () => {
await Promise.all(copyTasks.map(copyTask => this._copyView(copyTask)));
});
}
private _copyView = async (copyTask: ICopyTask): Promise<void> => {
const { setAsDefaultView } = this.state;
try {
await this._listViewsService.copy(copyTask.sourceView, copyTask.targetList.siteUrl, copyTask.targetList.id, setAsDefaultView);
const { copyTasks } = this.state;
const currentCopyTask = copyTasks.filter(c => c.index === copyTask.index)[0];
currentCopyTask.state = CopyTaskState.Done;
this.setState({ copyTasks });
}
catch (error) {
if (console && console.error && error) {
console.error(error);
}
const { copyTasks } = this.state;
const currentCopyTask = copyTasks.filter(c => c.index === copyTask.index)[0];
currentCopyTask.state = CopyTaskState.Error;
currentCopyTask.error = error?.message;
this.setState({ copyTasks });
}
}
private _onError = (error: Error): void => {
if (console && console.error && error) {
console.error(error);
}
this.setState({ error: error?.message, showErrorDetails: false });
}
private _retryCopyTask = async (copyTask: ICopyTask): Promise<void> => {
const { copyTasks } = this.state;
const currentCopyTask = copyTasks.filter(c => c.index === copyTask.index)[0];
currentCopyTask.state = CopyTaskState.Busy;
currentCopyTask.error = undefined;
this.setState({ copyTasks }, async () => {
await this._copyView(currentCopyTask);
});
}
}

Some files were not shown because too many files have changed in this diff Show More