Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
theseanything opened this issue May 17, 2021 · 0 comments
Open

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

theseanything opened this issue May 17, 2021 · 0 comments

Comments

@theseanything
Copy link
Contributor

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

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

No branches or pull requests

1 participant