upgrade to spfx 1.16.1

This commit is contained in:
a1mery 2023-03-10 13:39:26 +01:00
parent 2fc17a2e23
commit 643bf996f9
18 changed files with 24757 additions and 6793 deletions

View File

@ -0,0 +1,5 @@
require('@rushstack/eslint-config/patch/modern-module-resolution');
module.exports = {
extends: ['@microsoft/eslint-config-spfx/lib/profiles/react'],
parserOptions: { tsconfigRootDir: __dirname }
};

View File

@ -11,6 +11,7 @@ dist
lib
solution
temp
release
*.sppkg
# Coverage directory used by tools like istanbul
@ -30,3 +31,5 @@ obj
# Styles Generated Code
*.scss.ts
.heft

View File

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

View File

@ -1,12 +1,17 @@
{
"@microsoft/generator-sharepoint": {
"version": "1.11.0",
"version": "1.16.1",
"libraryName": "react-graph-telephonedirectory",
"libraryId": "e1a26cc8-a086-454f-9f16-9aeb0a276bcc",
"environment": "spo",
"packageManager": "npm",
"isCreatingSolution": true,
"isDomainIsolated": false,
"componentType": "webpart"
"componentType": "webpart",
"nodeVersion": "14.18.2",
"sdkVersions": {
"@microsoft/microsoft-graph-client": "3.0.2",
"@microsoft/teams-js": "2.4.1"
}
}
}

View File

@ -14,8 +14,8 @@ The web part will fetch data from directory using Graph API and display in detai
| Every SPFx version is only compatible with specific version(s) of Node.js. In order to be able to build this sample, please ensure that the version of Node on your workstation matches one of the versions listed in this section. This sample will not work on a different version of Node.|
|Refer to <https://aka.ms/spfx-matrix> for more information on SPFx compatibility. |
![SPFx 1.11](https://img.shields.io/badge/SPFx-1.11.0-green.svg)
![Node.js v10](https://img.shields.io/badge/Node.js-v10-green.svg)
![SPFx 1.16.1](https://img.shields.io/badge/SPFx-1.16.1-green.svg)
![Node.js v16 | v14 | v12](https://img.shields.io/badge/Node.js-v16%20%7C%20v14%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-Incompatible-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)-Incompatible-red.svg "SharePoint Server 2016 Feature Pack 2 requires SPFx 1.1")
@ -52,6 +52,7 @@ Version|Date|Comments
1.0|July 14,2020 | Initial Release
1.1|November 7,2020 | Upgraded to SPFx 1.11
1.2|August 7, 2021|Adding the Title from the Property Pane into the Web Part
1.3|March 10,2023 | Upgraded to SPFx 1.16.1
## Minimal Path to Awesome

View File

@ -1,4 +0,0 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/spfx-build/copy-assets.schema.json",
"deployCdnPath": "temp/deploy"
}

View File

@ -1,6 +1,6 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/spfx-build/deploy-azure-storage.schema.json",
"workingDir": "./temp/deploy/",
"workingDir": "./release/assets/",
"account": "<!-- STORAGE ACCOUNT NAME -->",
"container": "react-graph-telephonedirectory",
"accessKey": "<!-- ACCESS KEY -->"

View File

@ -3,7 +3,7 @@
"solution": {
"name": "react-graph-telephonedirectory-client-side-solution",
"id": "e1a26cc8-a086-454f-9f16-9aeb0a276bcc",
"version": "1.1.0.0",
"version": "1.3.0.0",
"includeClientSideAssets": true,
"isDomainIsolated": true,
"developer": {
@ -22,6 +22,28 @@
"resource": "Microsoft Graph",
"scope": "User.Read"
}
],
"metadata": {
"shortDescription": {
"default": "react-graph-telephonedirectory description"
},
"longDescription": {
"default": "react-graph-telephonedirectory description"
},
"screenshotPaths": [],
"videoUrl": "",
"categories": []
},
"features": [
{
"title": "react-graph-telephonedirectory TelephonedirectoryWebPart Feature",
"description": "The feature that activates TelephonedirectoryWebPart from the react-graph-telephonedirectory solution.",
"id": "586d82f7-79c3-4fc6-be7b-290fa1e4f1f6",
"version": "1.3.0.0",
"componentIds": [
"586d82f7-79c3-4fc6-be7b-290fa1e4f1f6"
]
}
]
},
"paths": {

View File

@ -0,0 +1,3 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/core-build/sass.schema.json"
}

View File

@ -1,10 +1,6 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/core-build/serve.schema.json",
"$schema": "https://developer.microsoft.com/json-schemas/spfx-build/spfx-serve.schema.json",
"port": 4321,
"https": true,
"initialPage": "https://localhost:5432/workbench",
"api": {
"port": 5432,
"entryPath": "node_modules/@microsoft/sp-webpart-workbench/lib/api/"
}
"initialPage": "https://enter-your-SharePoint-site/_layouts/workbench.aspx"
}

View File

@ -4,4 +4,12 @@ const gulp = require('gulp');
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;
};
build.initialize(gulp);

File diff suppressed because it is too large Load Diff

View File

@ -1,10 +1,10 @@
{
"name": "react-graph-telephonedirectory",
"version": "1.1.0",
"version": "1.3.0",
"private": true,
"main": "lib/index.js",
"engines": {
"node": ">=0.10.0"
"node": ">=16.13.0 <17.0.0"
},
"scripts": {
"build": "gulp bundle",
@ -12,15 +12,13 @@
"test": "gulp test"
},
"dependencies": {
"@fluentui/react": "^8.61.0",
"@microsoft/sp-core-library": "^1.11.0",
"@microsoft/sp-lodash-subset": "^1.11.0",
"@microsoft/sp-office-ui-fabric-core": "^1.11.0",
"@microsoft/sp-webpart-base": "^1.11.0",
"@pnp/spfx-controls-react": "^2.1.0",
"@types/es6-promise": "0.0.33",
"@types/react": "16.8.8",
"@types/react-dom": "16.8.3",
"@types/webpack-env": "1.13.1",
"office-ui-fabric-react": "6.189.2",
"react": "16.8.5",
"react-dom": "16.8.5"
@ -29,14 +27,24 @@
"@types/react": "16.8.8"
},
"devDependencies": {
"@microsoft/eslint-config-spfx": "1.16.1",
"@microsoft/eslint-plugin-spfx": "1.16.1",
"@microsoft/rush-stack-compiler-2.9": "^0.14.31",
"@microsoft/sp-build-web": "^1.11.0",
"@microsoft/sp-module-interfaces": "^1.11.0",
"@microsoft/rush-stack-compiler-4.5": "0.2.2",
"@microsoft/sp-build-web": "1.16.1",
"@microsoft/sp-module-interfaces": "1.16.1",
"@microsoft/sp-tslint-rules": "^1.11.0",
"@microsoft/sp-webpart-workbench": "^1.11.0",
"@rushstack/eslint-config": "2.5.1",
"@types/chai": "3.4.34",
"@types/mocha": "2.2.38",
"ajv": "~5.2.2",
"gulp": "~3.9.1"
"@types/react": "17.0.45",
"@types/react-dom": "17.0.17",
"@types/webpack-env": "1.15.2",
"ajv": "6.12.5",
"eslint": "8.7.0",
"eslint-plugin-react-hooks": "4.3.0",
"gulp": "4.0.2",
"typescript": "4.5.5"
}
}

View File

@ -37,7 +37,7 @@ export class MSGraphService implements IMSGraphService{
.version("v1.0")
.filter(`(startswith(surname,'${escape(searchFor)}'))`).get();
if(res.value.length !== 0){
res.value.map((_userProperty,_index)=>{
res.value.map((_userProperty:any,_index:any)=>{
if(_userProperty.mail !== null){
userProperties.push({
businessPhone:_userProperty.businessPhones[0],
@ -66,7 +66,7 @@ export class MSGraphService implements IMSGraphService{
.version("v1.0")
.filter(`(startswith(givenName,'${escape(searchFor)}'))`).get();
if(res.value.length !== 0){
res.value.map((_userProperty,_index)=>{
res.value.map((_userProperty:any,_index:any)=>{
if(_userProperty.mail !== null){
userProperties.push({
businessPhone:_userProperty.businessPhones[0],
@ -94,7 +94,7 @@ export class MSGraphService implements IMSGraphService{
.version("v1.0")
.filter(`(startswith(displayName,'${escape(searchFor)}'))`).get();
if(res.value.length !== 0){
res.value.map((_userProperty,_index)=>{
res.value.map((_userProperty:any,_index:any)=>{
userProperties.push({
businessPhone:_userProperty.businessPhones[0],
displayName:_userProperty.displayName,

View File

@ -46,7 +46,7 @@ export default class TelephonedirectoryWebPart extends BaseClientSideWebPart<ITe
ReactDom.unmountComponentAtNode(this.domElement);
}
protected get dataVersion(): Version {
protected get _dataVersion(): Version {
return Version.parse('1.0');
}

View File

@ -1,4 +1,4 @@
@import '~office-ui-fabric-react/dist/sass/References.scss';
@import '~@fluentui/react/dist/sass/References.scss';
.telephonedirectory {
.container {

View File

@ -1,5 +1,5 @@
{
"extends": "./node_modules/@microsoft/rush-stack-compiler-2.9/includes/tsconfig-web.json",
"extends": "./node_modules/@microsoft/rush-stack-compiler-4.5/includes/tsconfig-web.json",
"compilerOptions": {
"target": "es5",
"forceConsistentCasingInFileNames": true,
@ -14,26 +14,23 @@
"inlineSources": false,
"strictNullChecks": false,
"noUnusedLocals": false,
"noImplicitAny": true,
"typeRoots": [
"./node_modules/@types",
"./node_modules/@microsoft"
],
"types": [
"es6-promise",
"webpack-env"
],
"lib": [
"es5",
"dom",
"es2015.collection"
"es2015.collection",
"es2015.promise"
]
},
"include": [
"src/**/*.ts",
"declarations.d.ts"
],
"exclude": [
"node_modules",
"lib"
]
}

View File

@ -1,29 +0,0 @@
{
"extends": "@microsoft/sp-tslint-rules/base-tslint.json",
"rules": {
"class-name": false,
"export-name": false,
"forin": false,
"label-position": false,
"member-access": true,
"no-arg": false,
"no-console": false,
"no-construct": false,
"no-duplicate-variable": true,
"no-eval": false,
"no-function-expression": true,
"no-internal-module": true,
"no-shadowed-variable": true,
"no-switch-case-fall-through": true,
"no-unnecessary-semicolons": true,
"no-unused-expression": true,
"no-with-statement": true,
"semicolon": true,
"trailing-comma": false,
"typedef": false,
"typedef-whitespace": false,
"use-named-parameter": true,
"variable-name": false,
"whitespace": false
}
}