Skip to content

Conversation

@tanmayk
Copy link

@tanmayk tanmayk commented Nov 10, 2025

#783

The widget is ready with required changes. Working on add route still.

image

TB: 6h

Copy link
Member

@amitaibu amitaibu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, bump to total 10h.

@amitaibu
Copy link
Member

As we are on 11h, bump to total 15h. Ideally that could also include tests

@tanmayk
Copy link
Author

tanmayk commented Nov 11, 2025

Added controller with add form.
Need to implement access check as anyone can access the route as if now.
Form is there but ajax in form (adding new items) isn't working. Also submitting the form gives validation constraint error.

Checking the problems.

TB: 12/15h

@tanmayk
Copy link
Author

tanmayk commented Nov 11, 2025

@amitaibu I found a module Paragraphs Modal Add. This module provides a route for adding a paragraph. We can use the route provided by this module in our field widget for add links. I tested on my local & the add form works fine.

TB: 12.5/15

@tanmayk
Copy link
Author

tanmayk commented Nov 11, 2025

I thought about using the module for add form, but it only opens up paragraph type selection in modal & then show the form in field widget which we don't want. See video below:

para-edit.mp4

So our field widget is still needed with route from Paragraphs Modal Add.

If we don't want the dependency of the module, we can just use the code in our module.

My recommendation would be using the route from module by keeping the dependency instead of writing all the code again. The module already has add form implemented.

@amitaibu
Copy link
Member

Thanks, for now we can add a dependency on paragraphs_modal_add

@tanmayk
Copy link
Author

tanmayk commented Nov 11, 2025

Changes for settings & phpstan/phpcs fixes.

TB: 13.5/15h

@amitaibu
Copy link
Member

Thanks, can you please share a video of how it looks so far

@tanmayk
Copy link
Author

tanmayk commented Nov 11, 2025

Here it is:

paragraph-working.mp4

For new nodes, it is showing default paragraph widget since add/edit/delete route needs parent entity id & we don't have it at the time. We need to think on this.

Added tests but trying to set up phpunit that includes files from paragraphs as well since our test is depend on it.

TB: 14.5/15h

@amitaibu
Copy link
Member

  1. I can't see the mouse cusror on the video
  2. Doen't the create/ edit open in a modal?

Bump to total 17h

@tanmayk
Copy link
Author

tanmayk commented Nov 11, 2025

  1. I need to get another tool for video then.
  2. No, it opens up on standalone page & not in modal. Do you want it on modal? Or perhaps the widget config for user to configure modal or page?

@amitaibu
Copy link
Member

np, I thought, by the name Paragraphs Modal Add, that it would provide a modal.

Let's first get it to work without a modal, and then we can decide if we want to switch.

@tanmayk
Copy link
Author

tanmayk commented Nov 11, 2025

It is working in standalone page. We are just using route from Paragraphs Modal Add.

@tanmayk
Copy link
Author

tanmayk commented Nov 12, 2025

We now have working widget for paragraphps add/edit/delete links to open on standalone pages. The UX is as per video in #938 (comment).

Limitations:

  1. Works only on entity edit forms.
    This functionality is limited to entity edit forms. On entity add forms (e.g., /node/add/TYPE), the entity does not yet have an ID, so paragraph operations cannot be performed. The create form will display the default Paragraphs widget (with AJAX buttons/links as configured).

  2. Unsaved changes are lost when modifying paragraphs.
    On entity edit forms, data changes are not yet persisted. If a field is modified and then a paragraph is added, edited, or deleted, the unsaved changes in other fields will be lost because the entity has not been saved yet.

TB: 16.5/17h

@amitaibu
Copy link
Member

If the host isNew() then lets have the field widget change to a text, something like "Save the Landing page first to add Paragraphs".

image

Bump to 18h

@tanmayk
Copy link
Author

tanmayk commented Nov 13, 2025

Added info text for new entities.
Landing page node - Paragraph plural title = Paragraphs
image

User - Paragraph plural title = Items
image

TB: 17/18h

@tanmayk tanmayk requested a review from amitaibu November 13, 2025 10:56
@amitaibu
Copy link
Member

Let's add a test to check the widget appears correctly in different scenarios. Bump to 19h

@tanmayk
Copy link
Author

tanmayk commented Nov 13, 2025

Added more tests.

TB: 17.5/19h

@amitaibu
Copy link
Member

amitaibu commented Dec 2, 2025

@codex resolve conflicts and review

@chatgpt-codex-connector
Copy link

Codex couldn't complete this request. Try again later.

@amitaibu
Copy link
Member

amitaibu commented Dec 2, 2025

@codex resolve conflicts

@chatgpt-codex-connector
Copy link

Codex couldn't complete this request. Try again later.

@amitaibu
Copy link
Member

amitaibu commented Dec 2, 2025

@tanmayk can you please resolve the conflicts

@tanmayk
Copy link
Author

tanmayk commented Dec 3, 2025

Resolved conflicts.

TB: 17.75/19h

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants