backoffice: add class to rows of backoffice-submitted formdata (#18410)
This commit is contained in:
parent
e081de62f3
commit
0a11b771d3
|
@ -2859,6 +2859,40 @@ def test_backoffice_resume_folded(pub):
|
|||
resp = resp.follow()
|
||||
assert '<h2 class="foldable folded">Summary</h2>' in resp.body
|
||||
|
||||
def test_backoffice_backoffice_submission_in_listings(pub):
|
||||
create_superuser(pub)
|
||||
create_environment(pub)
|
||||
|
||||
app = login(get_app(pub))
|
||||
resp = app.get('/backoffice/management/form-title/')
|
||||
first_link = re.findall('data-link="(\d+)/?"', resp.body)[0]
|
||||
assert not 'backoffice-submission' in resp.body
|
||||
|
||||
formdata = FormDef.get_by_urlname('form-title').data_class().get(first_link)
|
||||
formdata.backoffice_submission = True
|
||||
formdata.store()
|
||||
|
||||
resp = app.get('/backoffice/management/form-title/')
|
||||
assert 'backoffice-submission' in resp.body
|
||||
|
||||
def test_backoffice_backoffice_submission_in_global_listing(pub):
|
||||
if not pub.is_using_postgresql():
|
||||
pytest.skip('this requires SQL')
|
||||
return
|
||||
create_superuser(pub)
|
||||
create_environment(pub)
|
||||
|
||||
app = login(get_app(pub))
|
||||
resp = app.get('/backoffice/management/listing?limit=100')
|
||||
assert not 'backoffice-submission' in resp.body
|
||||
|
||||
formdata = FormDef.get_by_urlname('form-title').data_class().select()[0]
|
||||
formdata.backoffice_submission = True
|
||||
formdata.store()
|
||||
|
||||
resp = app.get('/backoffice/management/listing?limit=100')
|
||||
assert 'backoffice-submission' in resp.body
|
||||
|
||||
def test_backoffice_advisory_lock(pub):
|
||||
create_superuser(pub)
|
||||
create_environment(pub)
|
||||
|
|
|
@ -830,6 +830,8 @@ class ManagementDirectory(Directory):
|
|||
object_key = 'formdata-%s-%s' % (formdata.formdef.url_name, formdata.id)
|
||||
if object_key in visited_objects:
|
||||
classes.append('advisory-lock')
|
||||
if formdata.backoffice_submission:
|
||||
classes.append('backoffice-submission')
|
||||
style = ''
|
||||
if include_criticality_level:
|
||||
try:
|
||||
|
|
|
@ -212,6 +212,8 @@ class FormDefUI(object):
|
|||
object_key = 'formdata-%s-%s' % (filled.formdef.url_name, filled.id)
|
||||
if object_key in visited_objects:
|
||||
classes.append('advisory-lock')
|
||||
if filled.backoffice_submission:
|
||||
classes.append('backoffice-submission')
|
||||
|
||||
style = ''
|
||||
if include_criticality_level:
|
||||
|
|
Loading…
Reference in New Issue