Skip to content

Separate shared copy that is re-used in multiple nodes #5376

@theseanything

Description

@theseanything

We have copy that is relevant for the entire flow and is re-used in multiple nodes. Currently we have no place to put shared copy and with existing copy tied to particular nodes or hard coded in view templates.

For example, flow title is used on the start pages and the captions above questions, however is specified in the "Start page" content file. Another example is the banner text for the "Next steps for you business", which appears on every node, however is hard coded in the view template for lack of a better place.

This leads to confusing patterns in the code, for example creating a StartNodePresenter just to access the flow title.

I'd like to propose introducing a separate file to specific shared content within the flow. This content is then accessible on any node. I'm unsure whether this should formatted like an existing ERB file, or just have a YAML files similar to locales.

We could re-purpose the top level lib/smart_answer_flows/<flow_name>.erb file (currently used for start page) for generic content and move the start page content to another file alongside the question and result content files e.g. lib/smart_answer_flows/<flow-name>/start.erb

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions