wcs: add message for empty states in drafts/forms cells (#13974)
This commit is contained in:
parent
74f5c41b57
commit
5a729a4c7e
|
@ -17,5 +17,6 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
{% if not drafts %}<div class="empty-message"><p>{% trans "There are no current drafts." %}</p></div>{% endif %}
|
||||||
{% include "combo/pagination.html" %}
|
{% include "combo/pagination.html" %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
|
@ -6,5 +6,6 @@
|
||||||
{% include "combo/wcs/list_of_forms.html" with forms=forms %}
|
{% include "combo/wcs/list_of_forms.html" with forms=forms %}
|
||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
{% if not forms %}<div class="empty-message"><p>{% trans "There are no current forms." %}</p></div>{% endif %}
|
||||||
{% include "combo/pagination.html" %}
|
{% include "combo/pagination.html" %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
|
@ -6,5 +6,6 @@
|
||||||
{% include "combo/wcs/list_of_forms.html" with forms=forms %}
|
{% include "combo/wcs/list_of_forms.html" with forms=forms %}
|
||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
{% if not forms %}<div class="empty-message"><p>{% trans "There are no forms." %}</p></div>{% endif %}
|
||||||
{% include "combo/pagination.html" %}
|
{% include "combo/pagination.html" %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
|
@ -6,5 +6,6 @@
|
||||||
{% include "combo/wcs/list_of_forms.html" with forms=forms %}
|
{% include "combo/wcs/list_of_forms.html" with forms=forms %}
|
||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
{% if not forms %}<div class="empty-message"><p>{% trans "There are no done forms or they have been removed." %}</p></div>{% endif %}
|
||||||
{% include "combo/pagination.html" %}
|
{% include "combo/pagination.html" %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
|
@ -495,6 +495,20 @@ def test_current_forms_cell_render(context):
|
||||||
cell.get_cell_extra_context(context)
|
cell.get_cell_extra_context(context)
|
||||||
assert requests_get.call_args_list[0][0][0] == '/api/user/forms?limit=100&sort=desc&include-drafts=on'
|
assert requests_get.call_args_list[0][0][0] == '/api/user/forms?limit=100&sort=desc&include-drafts=on'
|
||||||
|
|
||||||
|
# check empty messages
|
||||||
|
cell.categories = {'data': ['default:test-3']}
|
||||||
|
cell.current_forms = True
|
||||||
|
cell.done_forms = False
|
||||||
|
cell.include_drafts = False
|
||||||
|
result = cell.render(context)
|
||||||
|
assert 'There are no current forms.' in result
|
||||||
|
cell.done_forms = True
|
||||||
|
result = cell.render(context)
|
||||||
|
assert 'There are no forms.' in result
|
||||||
|
cell.current_forms = False
|
||||||
|
result = cell.render(context)
|
||||||
|
assert 'There are no done forms' in result
|
||||||
|
|
||||||
|
|
||||||
@wcs_present
|
@wcs_present
|
||||||
def test_current_forms_cell_validity(context):
|
def test_current_forms_cell_validity(context):
|
||||||
|
@ -844,6 +858,7 @@ def test_current_drafts_cell_render_unlogged(context):
|
||||||
result = cell.render(context)
|
result = cell.render(context)
|
||||||
assert not 'http://127.0.0.1:8999/third-form-title' in result # no form
|
assert not 'http://127.0.0.1:8999/third-form-title' in result # no form
|
||||||
|
|
||||||
|
|
||||||
@wcs_present
|
@wcs_present
|
||||||
def test_current_drafts_cell_render_logged_in(context):
|
def test_current_drafts_cell_render_logged_in(context):
|
||||||
page = Page(title='xxx', slug='test_current_drafts_cell_render', template_name='standard')
|
page = Page(title='xxx', slug='test_current_drafts_cell_render', template_name='standard')
|
||||||
|
@ -874,6 +889,10 @@ def test_current_drafts_cell_render_logged_in(context):
|
||||||
extra_context = cell.get_cell_extra_context(context)
|
extra_context = cell.get_cell_extra_context(context)
|
||||||
assert len(extra_context['drafts']) == 0
|
assert len(extra_context['drafts']) == 0
|
||||||
|
|
||||||
|
# check empty message
|
||||||
|
result = cell.render(context)
|
||||||
|
assert 'There are no current drafts.' in result
|
||||||
|
|
||||||
|
|
||||||
@wcs_present
|
@wcs_present
|
||||||
def test_current_drafts_cell_check_validity(context):
|
def test_current_drafts_cell_check_validity(context):
|
||||||
|
|
Loading…
Reference in New Issue