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

Avoid displaying question page titles for Smartdown flows #2029

Merged

Conversation

chrisroos
Copy link
Contributor

I'm hoping this'll make it easier to convert pay-leave-for-parents from Smartdown to a Ruby Smart Answer.

By not displaying question page titles for Smartdown flows (pay-leave-for-parents is the only Smartdown flow left) I hope we have a set of regression test artefacts that remain constant after the conversion to Ruby.

I think it's OK to remove these question page titles as I don't think they've been adding much value since we converted the last remaining Smartdown flow with multiple questions per page to use single questions per page.

Expected changes

  • Example URL
    • The current Question page title ("Due date") has been removed from the page
    • The previous Question page title ("Your circumstances") has been removed from the "Previous answers" section

Before

1-pr-2029-before

After

2-pr-2029-after

@floehopper floehopper self-assigned this Oct 21, 2015
@floehopper
Copy link
Contributor

LGTM 👍

This removes the `h2.page-title` element from appearing on a question page.
Specifically, it means that the conditional (`<% if @presenter.page_title %>`)
on line 20 of the _content.html.erb partial is never true.

This mirrors the behaviour in Ruby Smart Answers and will (hopefully) make it
easier to convert pay-leave-for-parents from Smartdown to Ruby. This is because
it'll be easier to see any differences in the regression test output if we're
expecting them to be identical.

I considered implementing SmartAnswerPresenter#page_title instead but don't
think the concept of a page title is so useful now that we only have single
questions per page.

I've regenerated the test artefacts for pay-leave-for-parents (the only
remaining Smartdown flow) as part of this commit as there weren't many changes.
The effect of this change is to remove the question page title from the
"Previous answers" section that appears at the bottom of each question page.
Specifically, it means that the first conditional (`<%- if question_page.title -%>`)
in the _collapsed_question.html.erb partial is never true.

This mirrors the behaviour in Ruby Smart Answers and will (hopefully) make it
easier to convert pay-leave-for-parents from Smartdown to Ruby. This is because
it'll be easier to see any differences in the regression test output if we're
expecting them to be identical.

I considered implementing this same functionality in Ruby Smart Answers instead
but don't think the concept of a page title is so useful now that we only have
single questions per page.

I've regenerated the test artefacts for pay-leave-for-parents (the only
remaining Smartdown flow) as part of this commit as there weren't many changes.
@chrisroos chrisroos force-pushed the avoid-displaying-question-page-titles-for-smartdown-flows branch from d308973 to 5c5d4fc Compare October 22, 2015 09:13
@chrisroos
Copy link
Contributor Author

I've rebased and force pushed in preparation for merging.

chrisroos added a commit that referenced this pull request Oct 22, 2015
…-titles-for-smartdown-flows

Avoid displaying question page titles for Smartdown flows
@chrisroos chrisroos merged commit 6004723 into master Oct 22, 2015
@chrisroos chrisroos deleted the avoid-displaying-question-page-titles-for-smartdown-flows branch October 22, 2015 09:24
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