Projet

Général

Profil

0001-backoffice-wf-inspect-render-html-for-backoffice_inf.patch

Lauréline Guérin, 07 mars 2022 17:15

Télécharger (1,99 ko)

Voir les différences:

Subject: [PATCH] backoffice: wf inspect, render html for backoffice_info_text
 (#58790)

 tests/admin_pages/test_workflow.py | 7 +++++++
 wcs/workflows.py                   | 2 +-
 2 files changed, 8 insertions(+), 1 deletion(-)
tests/admin_pages/test_workflow.py
3203 3203
    workflow.variables_formdef.fields.append(fields.StringField(label='Test', type='string'))
3204 3204

  
3205 3205
    foo_status = workflow.add_status(name='foo')
3206
    jump = ChoiceWorkflowStatusItem()
3207
    jump.parent = foo_status
3208
    jump.backoffice_info_text = '<p>Hello</p>'
3209
    foo_status.items.append(jump)
3206 3210

  
3207 3211
    baz_status = workflow.add_status(name='baz')
3208 3212
    baz_status.backoffice_info_text = 'Info text'
......
3265 3269

  
3266 3270
    app = login(get_app(pub))
3267 3271
    resp = app.get('/backoffice/workflows/%s/inspect' % workflow.id)
3272
    assert (
3273
        '<li><span class="parameter">Information Text for Backoffice:</span> <p>Hello</p></li>' in resp.text
3274
    )
3268 3275
    assert (
3269 3276
        '<li><span class="parameter">Dispatch Type:</span> Multiple</li>'
3270 3277
        '<li><span class="parameter">Rules:</span> '
wcs/workflows.py
2322 2322
        return r.getvalue()
2323 2323

  
2324 2324
    def get_backoffice_info_text_parameter_view_value(self):
2325
        return htmltext('<pre>%s</pre>') % self.backoffice_info_text
2325
        return htmltext(self.backoffice_info_text)
2326 2326

  
2327 2327
    def get_by_parameter_view_value(self):
2328 2328
        return self.render_list_of_roles(self.by)
2329
-