Browse Source

implement the fix on 22/23 form also

pull/1368/head
Arthur Campbell 3 years ago
parent
commit
f8f2dadf2d
  1. 11
      app/models/form/subsection.rb
  2. 10
      config/forms/2022_2023.json

11
app/models/form/subsection.rb

@ -7,6 +7,7 @@ class Form::Subsection
if hsh if hsh
@label = hsh["label"] @label = hsh["label"]
@depends_on = hsh["depends_on"] @depends_on = hsh["depends_on"]
@displayed_in_tasklist_from_json = hsh["displayed_in_tasklist"]
@pages = hsh["pages"].map { |s_id, p| Form::Page.new(s_id, p, self) } @pages = hsh["pages"].map { |s_id, p| Form::Page.new(s_id, p, self) }
end end
end end
@ -48,7 +49,13 @@ class Form::Subsection
end end
end end
def displayed_in_tasklist?(_log) def displayed_in_tasklist?(log)
true return true unless @displayed_in_tasklist_from_json
@displayed_in_tasklist_from_json.any? do |conditions|
conditions.all? do |method, expected_return_value|
log.send(method) == expected_return_value
end
end
end end
end end

10
config/forms/2022_2023.json

@ -939,7 +939,15 @@
} }
} }
} }
} },
"displayed_in_tasklist": [
{
"is_supported_housing?": false
},
{
"is_renewal?": false
}
]
}, },
"tenancy_information": { "tenancy_information": {
"label": "Tenancy information", "label": "Tenancy information",

Loading…
Cancel
Save