From 3c8f4bf6fd858132dc4f31283384bec53622aed8 Mon Sep 17 00:00:00 2001 From: Abderahman88 Date: Wed, 3 Mar 2021 01:19:18 +0100 Subject: [PATCH 1/2] Fix undefined listItem --- samples/react-feedback/README.md | 6 ++++-- samples/react-feedback/config/package-solution.json | 2 +- .../react-feedback/src/webparts/feedback/FeedbackWebPart.ts | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/samples/react-feedback/README.md b/samples/react-feedback/README.md index b59c5f27b..d6d52f3ba 100644 --- a/samples/react-feedback/README.md +++ b/samples/react-feedback/README.md @@ -34,13 +34,15 @@ This is an application that supports Feedback through a web part that can be use Solution|Author(s) --------|--------- -react-feedback | Perry Kankam +react-feedback | Perry Kankam +react-feedback | Abderahman Moujahid ## Version history Version|Date|Comments -------|----|-------- -1.0|December 15, 2020|Initial release +1.0.0|December 15, 2020|Initial release +1.0.1|March 3, 2021|Fix undefined listItem ## Disclaimer diff --git a/samples/react-feedback/config/package-solution.json b/samples/react-feedback/config/package-solution.json index 74c58f6be..32e31164e 100644 --- a/samples/react-feedback/config/package-solution.json +++ b/samples/react-feedback/config/package-solution.json @@ -3,7 +3,7 @@ "solution": { "name": "feedback-webpart-client-side-solution", "id": "d5e255e1-7071-49a8-b50d-b06c80e4ac02", - "version": "1.0.0.0", + "version": "1.0.1.0", "includeClientSideAssets": true, "isDomainIsolated": false, "developer": { diff --git a/samples/react-feedback/src/webparts/feedback/FeedbackWebPart.ts b/samples/react-feedback/src/webparts/feedback/FeedbackWebPart.ts index 6cbb36a0c..6c55e7f59 100644 --- a/samples/react-feedback/src/webparts/feedback/FeedbackWebPart.ts +++ b/samples/react-feedback/src/webparts/feedback/FeedbackWebPart.ts @@ -50,7 +50,7 @@ export default class FeedbackWebPart extends BaseWebPart buttonLabel: escape(this.properties.buttonLabel), showCategory: showCategory, themeVariant: this.themeVariant, - listitemid: this.context.pageContext.listItem.id, //Replace with "1" if you're running this in a workbench + listitemid: !!this.context.pageContext.listItem ? this.context.pageContext.listItem.id : null, selectedCategory: escape(this.properties.feedbackCategory), currentUser: this.context.pageContext.user } From 62c2ad8560f812a9e13e3f9b4644faa2a6e5b8bf Mon Sep 17 00:00:00 2001 From: Hugo Bernier Date: Thu, 11 Mar 2021 00:03:55 -0500 Subject: [PATCH 2/2] Fixed readme --- samples/react-feedback/README.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/samples/react-feedback/README.md b/samples/react-feedback/README.md index d6d52f3ba..595c3e21b 100644 --- a/samples/react-feedback/README.md +++ b/samples/react-feedback/README.md @@ -9,13 +9,9 @@ This is an application that supports Feedback through a web part that can be use ## Compatibility ![SPFx 1.11](https://img.shields.io/badge/SPFx-1.11-green.svg) - ![Node.js LTS 10.x](https://img.shields.io/badge/Node.js-LTS%2010.x-green.svg) - ![SharePoint Online](https://img.shields.io/badge/SharePoint-Online-red.svg) - ![Teams N/A](https://img.shields.io/badge/Teams-N%2FA-lightgrey.svg) - ![Workbench Not supported](https://img.shields.io/badge/Workbench-Not%20Supported-lightgrey.svg)