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

ClientSidePage editing is broken #558

Closed
1 of 4 tasks
pedro-pedrosa opened this issue Mar 18, 2019 · 7 comments · Fixed by #561
Closed
1 of 4 tasks

ClientSidePage editing is broken #558

pedro-pedrosa opened this issue Mar 18, 2019 · 7 comments · Fixed by #561

Comments

@pedro-pedrosa
Copy link
Contributor

pedro-pedrosa commented Mar 18, 2019

Category

  • Enhancement
  • Bug
  • Question
  • Documentation gap/issue

Version

Please specify what version of the library you are using: [1.3.0]

Please specify what version(s) of SharePoint you are targeting: [SPO]

Expected / Desired Behavior / Question

I expect to be able to edit certain parts of a client side page by loading the page, making edits, then saving the page

Observed Behavior

Loading a page then saving it immediately after without any changes breaks the layout of the page.

Steps to Reproduce

Build the page:

const home = await pnp.ClientSidePage.fromFile(pnp.sp.web.getFileByServerRelativeUrl('/sites/test/SitePages/Home.aspx'));
home.sections = [];
const section1 = home.addSection();
const section1column1 = section1.addColumn(12);
section1column1.addControl(new pnp.ClientSideText('<p>Full width</p>'));
const section2 = home.addSection();
const section2column1 = section2.addColumn(4);
section2column1.addControl(new pnp.ClientSideText('<p>Left</p>'));
const section2column2 = section2.addColumn(4);
section2column2.addControl(new pnp.ClientSideText('<p>Middle</p>'));
const section2column3 = section2.addColumn(4);
section2column3.addControl(new pnp.ClientSideText('<p>Right</p>'));
await home.save(true);

Break it:

const home = await pnp.ClientSidePage.fromFile(pnp.sp.web.getFileByServerRelativeUrl('/sites/test/SitePages/Home.aspx'));
await home.save(true);

I have also noticed that the internal functions getControls() and setControls() make weird assumptions about section/column layout, causing similar bugs on copyPage().

Using open source libraries is all a matter of trust. Trusting that they work as they are supposed to. As a professional SharePoint developer I expected a Microsoft supported library would provide that kind of trust but apparently that's not the case with this library unfortunately.

@tavikukko
Copy link
Contributor

"Using open source libraries is all a matter of trust."
Using open source libraries is all about open source contributors.

Screenshot 2019-03-18 at 13 11 06

watch it with sound

@pedro-pedrosa
Copy link
Contributor Author

pedro-pedrosa commented Mar 18, 2019

This wasn't meant to offend anyone. I know everyone involved in the project is doing what they can with what they have, so apologies if my comment offended anyone.

I have contributed to this project out of my own free time as well so obviously I know that what I was saying may sound disrespectful if you take it personally.

That said, with the deprecation of the CSOM/JSOM API for working with SharePoint resources and by promoting the REST APIs, I would expect that Microsoft would support this library like they said they would.

If there is no support whatsoever from Microsoft as the image you posted above implies and this is 100% supported by the free will of some developers, then the Microsoft Docs are lying and I withdraw my comment.

@patrick-rodgers
Copy link
Member

@pedro-pedrosa - I am really not sure how to respond. Your attitude is 100% unacceptable. I would encourage you to have a listen to the recording where I comment on the recent spike in this kind of behavior. We are not here to absorb your abuse. Despite what you want to believe to justify your righteous anger, PnPjs is not supported by Microsoft and we have never made that claim. The document you link to does not make that claim, in fact it specifically says it is not officially supported.

Regarding the issue you report, this was discussed in #504 where it was discovered the back-end API was changed. I then spent two very late nights rewriting everything related to client side pages from scratch to get a fix out for folks. I mention in that thread that there is no way I got it perfect on the first try and if folks saw issues to please report them. That part of what you did is right, thank you for letting us know there is an issue.

@pedro-pedrosa
Copy link
Contributor Author

I understand where you are coming from but as I said I do not mean to offend you personally in any way. The last thing I wanted to do was devalue your efforts in creating and maintaining this library.

SharePoint is huge and ever-changing, and there fore it's really difficult to keep up with it. Having this library did save me a lot of head aches and for that I really appreciate all the work mostly you and in part the rest of the community put into this.

However, you need to separate criticism from disrespect. The page I linked mentions that PnP projects are created and maintained by Microsoft and the community. If they are only being maintained by the community, then my criticism goes towards Microsoft and not you personally.

I'm assuming you closed my long-lived PR as some sort of retaliation or maybe you wanted me to feel a little bit of what you feel when someone devalues your work but honestly I don't think that was a correct decision and I'll ask you to re-consider that action. I wasn't working on that entirely for myself or expecting you to work for me or anything... Like the PR mentioned I was waiting for feedback from the community to work on it and give back to this project some of what it has given me the past few years.

@patrick-rodgers
Copy link
Member

Closing this as a duplicate of #550. Issue is addressed there and your example code now works with the fixes applied. Those fixes will be in an upcoming beta and the next major release.

@patrick-rodgers
Copy link
Member

Just published a new beta, v1.3.1-1, which contains the updates mentioned in this issue. Please give it a try if you have time and let us know if you see any further issues. Thanks!

@github-actions
Copy link

This issue is locked for inactivity or age. If you have a related issue please open a new issue and reference this one. Closed issues are not tracked.

@github-actions github-actions bot locked and limited conversation to collaborators Apr 20, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants