Skip to content

Commit

Permalink
Merge pull request #4828 from wideserg/patch-1
Browse files Browse the repository at this point in the history
Update PageCommentsWebPart.ts
  • Loading branch information
hugoabernier authored Mar 11, 2024
2 parents 0271864 + cc74a1f commit 0336f96
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions samples/js-advanced-commenting/.nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v16.13.0
5 changes: 3 additions & 2 deletions samples/js-advanced-commenting/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,9 @@ None

## Contributors

* [Sudharsan K.](https://github.com/sudharsank)
* [Aimery Thomas](https://github.com/a1mery)
* [Sergey Shiroky](https://github.com/wideserg)
* [Sudharsan K.](https://github.com/sudharsank)

## Version history

Expand All @@ -83,6 +84,7 @@ Version|Date|Comments
1.1.0.0|Oct 06, 2022|Upgraded to 1.15.2
1.2.0.0|March 09, 2023|Upgraded to 1.16.1
1.3.0.0|June 10, 2023|Upgraded to 1.17.0
1.3.0.1|March 11, 2024|`this.pageurl` must be initialized before building `this.pastAtachmentPath`

## Minimal Path to Awesome

Expand All @@ -102,7 +104,6 @@ Version|Date|Comments
* Used [jquery-comments](https://viima.github.io/jquery-comments/) for comments control with some customization.
* Used [Moment.js](https://momentjs.com/) for datetime formatting.


## Video

[![Building an enhanced commenting web part with SPFx](./assets/video-thumbnail.jpg)](https://www.youtube.com/watch?v=ndHMdfFscsk "Building an enhanced commenting web part with SPFx")
Expand Down
7 changes: 6 additions & 1 deletion samples/js-advanced-commenting/assets/sample.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"This component is developed for the advanced usage of commenting the page or article etc. Page Comments lists will be created to store the comments."
],
"creationDateTime": "2020-02-05",
"updateDateTime": "2023-06-09",
"updateDateTime": "2024-03-11",
"products": [
"SharePoint"
],
Expand Down Expand Up @@ -53,6 +53,11 @@
"gitHubAccount": "a1mery",
"name": "Aimery Thomas",
"pictureUrl": "https://github.com/a1mery.png"
},
{
"gitHubAccount": "wideserg",
"name": "Sergey Shiroky",
"pictureUrl": "https://github.com/wideserg.png"
}
],
"references": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,12 @@ export default class PageCommentsWebPart extends BaseClientSideWebPart<IPageComm
</div>
</div>`;
var self = this;
this.pageurl = this.context.pageContext.legacyPageContext.serverRequestPath;
if (this.properties.enableAttachments) {
await this.helper.getDocLibInfo();
this.postAttachmentPath = await this.helper.getPostAttachmentFilePath(this.pageurl);
this.pageFolderExists = await this.helper.checkForPageFolder(this.postAttachmentPath);
}
this.pageurl = this.context.pageContext.legacyPageContext.serverRequestPath;
this.currentUserInfo = await this.helper.getCurrentUserInfo();
this.siteUsers = await this.helper.getSiteUsers(self.currentUserInfo.ID);
require(['jquery', './js/jquery-comments.min'], (jQuery, comments) => {
Expand Down

0 comments on commit 0336f96

Please sign in to comment.