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

Make it easier to do branching #576

Closed
Tracked by #669
joelanman opened this issue Aug 8, 2018 · 9 comments
Closed
Tracked by #669

Make it easier to do branching #576

joelanman opened this issue Aug 8, 2018 · 9 comments
Labels
🕔 Days A few unknowns, but we roughly know what’s involved. Feature Request User requests a new feature Submitted by user issues on behalf of users

Comments

@joelanman
Copy link
Contributor

For example, we could let people add URLs to radio buttons. If a user selects that radio button, it automatically redirects to that URL, with no need for back end coding.

@etheya
Copy link

etheya commented Jan 18, 2019

Has this moved at all? be good to have this feature moving forward...

@aliuk2012 aliuk2012 added the Submitted by user issues on behalf of users label Jan 23, 2019
@kellylee-gds kellylee-gds added 🕔 Days A few unknowns, but we roughly know what’s involved. Priority: Low and removed new labels Jan 30, 2019
@joelanman
Copy link
Contributor Author

joelanman commented Apr 9, 2019

One potential solution is to significantly improve the documentation and examples for branching

@joelanman
Copy link
Contributor Author

from #338:

[using radios to automatically redirect] has some more disadvantages:

It only works for radio buttons. This could influence people to design prototypes to use radios even if thats not the right solution, as its significantly easier. For any other kind of branching people will have to learn server-side code for branching anyway.

@alexnewmannn
Copy link

One product that does this really well is, https://github.com/DEFRA/digital-form-builder, it's a UI which decreases any learning curve, but we could take inspiration from the way they do branches and implement it into the prototype kit.

Initial suggestion is have a file specifically for adding branches, that file needs to be changed and everything else will work.

A really simple, rushed design for that could be something like

const redirects = branchRedirect([
  {
    fieldName: 'eligibilityQuestion',
    route: '/question-asked-here',
    values: {
      yes: '/go-here',
      no: '/go-there',
      'dont-know: 'go-anywhere',
    },
  }
]);

module.exports = redirects;
/question-asked-here.html

{{ govukRadios({
  classes: "govuk-radios--inline",
  idPrefix: "eligibilityQuestion",
  name: "eligibilityQuestion",
  fieldset: {
    legend: {
      text: "Are you the person paying?",
      isPageHeading: true,
      classes: "govuk-fieldset__legend--xl"
    }
  },
  items: [
    {
      value: "yes",
      text: "Yes"
    },
    {
      value: "no",
      text: "No"
    },
    {
      value: "dont-know",
      text: "I don't know"
    }
  ]
}) }}

@joelanman
Copy link
Contributor Author

Another risk that would be good to get more research on: if we do radio button branching, is it then confusing to have 2 different ways to do branching? (radios vs routes)

@lfdebrux
Copy link
Member

This needs a kickoff.

@Izabela-16
Copy link

Kick off session this week, 45min, whole team. @Izabela-16

@lfdebrux
Copy link
Member

We discussed. Agreed following

  • want to do user research
  • try and find a technical solution to reduce amount of code first, fallback on better docs if that doesn't work
  • maybe we can have a hack-a-thon, maybe including community?
  • good way to test extensions also, maybe?

I'll create a new ticket for this.

Also @natcarey thinks it would be worth having a separate chat about extensions with the team, will organise that.

@lfdebrux
Copy link
Member

Closing in favour of a new issue looking at the same thing, #1317.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🕔 Days A few unknowns, but we roughly know what’s involved. Feature Request User requests a new feature Submitted by user issues on behalf of users
Projects
None yet
Development

No branches or pull requests

9 participants