Refactor field widget code to reduce duplication and make theme abstract

Created on 21 February 2017, about 8 years ago
Updated 2 March 2025, about 1 month ago

Problem/Motivation

Both "widgets" duplicate a LOT of code. Making it seemingly impossible to effectively work on it without fear of major regressions.

Proposed resolution

Make InlineParagraphsWidget a subclass of ParagraphsWidget and simply reuse existing methods that are the same between the two.

Also, create an additional helper class, like ParagraphsWidgetItem or something to wrap a lot of the boilerplate code so it doesn't have to be determined again in the various methods called (plus it will give constraints).

Remaining tasks

  • Create a patch

User interface changes

None

API changes

Technically making InlineParagraphsWidget a subclass of ParagraphsWidget is a "change", however no actual code/logic would change.

Data model changes

None

📌 Task
Status

Fixed

Version

1.0

Component

Code

Created by

🇨🇭Switzerland drobnjak

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024