mysociety / alaveteli

Provide a Freedom of Information request system for your jurisdiction
https://alaveteli.org
Other
389 stars 195 forks source link

Handling of pre-identified exemptions OR asking the user which ones have been used #5940

Closed garethrees closed 3 years ago

garethrees commented 4 years ago

We've come to a direction for the general interface for the refusal advice Q&A in https://github.com/mysociety/alaveteli/issues/5939.

One specific thing we'll want to do, in the event that we can automatically identify exemptions, is pre-select the relevant exemption advice to short-circuit some of the questions.

If we can't automatically identify exemptions, we'll need to ask which ones have been used. There are ~30 possibilities, and many can be selected.

We'll want to handle the case where multiple exemptions are used within a single response. How do we do this?

In some cases we'll be able to pre-identify them all, in some cases we won't be able to identify any, and some cases where we only catch a proposition of those used (#5940).

garethrees commented 4 years ago

@zarino I've just been working on https://github.com/mysociety/alaveteli/issues/5937 and I've come to a decision point which is reliant on this.

I need to know whether we want to organise the questions for each section under a YAML key, or whether we use the show_if functionality to decide.

I think the latter is preferable, given show_if allows multiple conditions, but this might not make sense depending on what you have in mind for the UI.

YAML Key

# config/refusal_advice/section_12.yml
foi:
  section_12:
  - # question data
  - # question data

show_if

# config/refusal_advice/section_12.yml
foi:
  - # question data
    show_if:
      - id: refusal_reasons
        operator: include
        value: section_12
  - # question data
garethrees commented 4 years ago

We've decided that the show_if approach is less complex (no nesting hell) and gives us more flexibility.

gbp commented 4 years ago

If wanted to ask the same question for different sections or use the same show_if conditional for mulpile questions we can use YAML node anchors.

garethrees commented 3 years ago

Closing as we've figured put the mechanics of this.