nextcloud / tables

🍱 Nextcloud tables app
https://apps.nextcloud.com/apps/tables
GNU Affero General Public License v3.0
148 stars 23 forks source link

feat: edit/create rows from tables interactive content widget #952

Closed elzody closed 4 months ago

elzody commented 7 months ago

Issue(s)

Fixes #879

Overview

If a user has the ability to create/edit rows on a table/view, the user can also do so from the interactive table widget. The same "create row" button is used, as well as the "edit row" action button when hovering over a row. I made some edits to other components to better support this feature, such as dynamic importing of store.js and data.js and styling of the CreateRow.vue and EditRow.vue components (mostly from within ContentReferenceWidget.vue so as to not alter the original components elsewhere).

juliusknorr commented 7 months ago

@elzody just a small hint, if you prefix the issue if with "fixes" or "resolves" in the description github will automatically add a reference that is also visible on the team board :)

enjeck commented 7 months ago

Might be a dumb question, but what is the "interactive content widget"? Is that what pops up when I use the smartpicker? I ask because I have no idea how to view what this PR changes :sweat_smile:

juliusknorr commented 7 months ago

Might be a dumb question, but what is the "interactive content widget"? Is that what pops up when I use the smartpicker? I ask because I have no idea how to view what this PR changes 😅

When you open the smart picker and insert a table you will first see a custom picker element which is unrelated to the PR but just for understanding. The widgets then define the rendering of a preview for a link inserted through the smart picker or manually. We already have those widgets for a while but now make them more interactive by adding the ability to create/edit rows directly from the link preview widget. Hope that makes it a bit clearer :)

In short, to test it use the smart picker to insert a table link with content preview in a text document and toggle the preview on.

github-actions[bot] commented 7 months ago

Hello there, Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.

We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process.

Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6

Thank you for contributing to Nextcloud and we hope to hear from you soon!

elzody commented 5 months ago

I don't think the failing Cypress tests are related, they are also failing on main it seems. Unsure what caused it 😔

elzody commented 5 months ago

@mejo- Thanks for bringing these up. A lot of the styling issues were present before I even started; I tried to fix some up as best I could, but there are definitely still some present. I will look at it some more

elzody commented 5 months ago

I made some styling changes which I think make the widget look better than before. Specifically, I made the following changes:

The other things that you mentioned were not reproducible on my end. I tried the following:

Maybe it would be worth it to expand the tests a bit to check for the read-only permissions or something? Also, I rebased onto main and resolved a small merge conflict.

@mejo-

juliusknorr commented 4 months ago

Pushed a small backend commit to ensure that the rich text fields are properly rendered, otherwise 👍

juliusknorr commented 4 months ago

Editing in view mode is still possible. When switching to view mode in Collectives, all the buttons to edit the table in place are still there, and when editing the table the changes are pushed to the server.

I'd not consider this one a blocker for now. We also have this behaviour in other interactive widgets and it would require larger work to make the context of the widget exposed to the rendering provider.