Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update PageCommentsWebPart.ts #4828

Merged
merged 2 commits into from
Mar 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading