Problem/Motivation

Improve existing architecture before implementing advanced inheritance feature (#3461075: Inheriting segments of parent prompt in user interface).

Proposed resolution

Repeat same architecture like was done with new arguments feature (#3443027: Allow to pass arguments to aiprompt programatically), enabling to cleanly load segments of the parent prompt.

Make getSegments() return plugin instances instead of segments data, while new getSegmentsData() return the data instead.

Move getSegments() from entity classes to a common trait (same like getArguments() already is).

Redo all places which use getSegments().

Result will also be less and simpler code where objects are already instantiated, or in other places setter methods being used instead of processing raw data.

Remaining tasks

User interface changes

API changes

Data model changes

Comments

mindaugasd created an issue. See original summary.

mindaugasd’s picture

  • mindaugasd committed 80b505d6 on 1.0.x
    Issue #3465345: Rework getSegments() to return objects instead of data,...
mindaugasd’s picture

Status: Active » Fixed
mindaugasd’s picture

Status: Fixed » Active

Will upgrade segment forms as well to use objects instead of data.

  • mindaugasd committed d4a67c4a on 1.0.x
    Issue #3465345 by mindaugasd: Rework getSegments() to return objects...
mindaugasd’s picture

Status: Active » Fixed

  • mindaugasd committed 34d5fcb9 on 1.0.x
    Issue #3465345 by mindaugasd: Rework getSegments() to return objects...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.