misc: add workflow categories to site export/import (#56275)
This commit is contained in:
parent
908c958907
commit
19a4da86a6
|
@ -18,7 +18,7 @@ from webtest import Upload
|
|||
from wcs import fields
|
||||
from wcs.api_access import ApiAccess
|
||||
from wcs.carddef import CardDef
|
||||
from wcs.categories import CardDefCategory, Category
|
||||
from wcs.categories import CardDefCategory, Category, WorkflowCategory
|
||||
from wcs.data_sources import NamedDataSource
|
||||
from wcs.formdef import FormDef
|
||||
from wcs.qommon.form import UploadedFile
|
||||
|
@ -96,6 +96,7 @@ def test_settings_export_import(pub):
|
|||
pub.role_class.wipe()
|
||||
Category.wipe()
|
||||
CardDefCategory.wipe()
|
||||
WorkflowCategory.wipe()
|
||||
NamedDataSource.wipe()
|
||||
NamedWsCall.wipe()
|
||||
ApiAccess.wipe()
|
||||
|
@ -130,6 +131,7 @@ def test_settings_export_import(pub):
|
|||
Category(name='baz').store()
|
||||
Category(name='baz2').store()
|
||||
CardDefCategory(name='foobar').store()
|
||||
WorkflowCategory(name='foobaz').store()
|
||||
pub.role_class(name='qux').store()
|
||||
NamedDataSource(name='quux').store()
|
||||
ds = NamedDataSource(name='agenda')
|
||||
|
@ -177,6 +179,7 @@ def test_settings_export_import(pub):
|
|||
assert 'roles_xml/1' in filelist
|
||||
assert 'categories/1' in filelist
|
||||
assert 'carddef_categories/1' in filelist
|
||||
assert 'workflow_categories/1' in filelist
|
||||
assert 'datasources/1' in filelist
|
||||
assert 'datasources/2' not in filelist # agenda datasource, not exported
|
||||
assert 'wscalls/corge' in filelist
|
||||
|
@ -204,6 +207,7 @@ def test_settings_export_import(pub):
|
|||
assert '1 card' in resp.text
|
||||
assert '2 categories' in resp.text
|
||||
assert '1 card category' in resp.text
|
||||
assert '1 workflow category' in resp.text
|
||||
assert FormDef.count() == 1
|
||||
assert FormDef.select()[0].url_name == 'foo'
|
||||
assert CardDef.count() == 1
|
||||
|
|
|
@ -994,6 +994,7 @@ class SettingsDirectory(QommonSettingsDirectory):
|
|||
form.add(CheckboxWidget, 'roles', title=_('Roles'), value=True)
|
||||
form.add(CheckboxWidget, 'categories', title=_('Categories'), value=True)
|
||||
form.add(CheckboxWidget, 'carddef_categories', title=_('Card Model Categories'), value=True)
|
||||
form.add(CheckboxWidget, 'workflow_categories', title=_('Workflow Categories'), value=True)
|
||||
form.add(CheckboxWidget, 'settings', title=_('Settings'), value=False)
|
||||
form.add(CheckboxWidget, 'datasources', title=_('Data sources'), value=True)
|
||||
form.add(CheckboxWidget, 'mail-templates', title=_('Mail templates'), value=True)
|
||||
|
@ -1025,6 +1026,7 @@ class SettingsDirectory(QommonSettingsDirectory):
|
|||
if d not in (
|
||||
'categories',
|
||||
'carddef_categories',
|
||||
'workflow_categories',
|
||||
'wscalls',
|
||||
'mail-templates',
|
||||
'apiaccess',
|
||||
|
@ -1119,6 +1121,7 @@ class SettingsDirectory(QommonSettingsDirectory):
|
|||
'roles',
|
||||
'categories',
|
||||
'carddef_categories',
|
||||
'workflow_categories',
|
||||
'datasources',
|
||||
'wscalls',
|
||||
'mail-templates',
|
||||
|
|
|
@ -169,6 +169,7 @@ class WcsPublisher(QommonPublisher):
|
|||
'workflows': 0,
|
||||
'categories': 0,
|
||||
'carddef_categories': 0,
|
||||
'workflow_categories': 0,
|
||||
'roles': 0,
|
||||
'settings': 0,
|
||||
'datasources': 0,
|
||||
|
|
|
@ -30,6 +30,9 @@
|
|||
{% if results.carddef_categories %}
|
||||
<li>{% blocktrans count counter=results.carddef_categories %}1 card category{% plural %}{{ counter }} card categories{% endblocktrans %}</li>
|
||||
{% endif %}
|
||||
{% if results.workflow_categories %}
|
||||
<li>{% blocktrans count counter=results.workflow_categories %}1 workflow category{% plural %}{{ counter }} workflow categories{% endblocktrans %}</li>
|
||||
{% endif %}
|
||||
{% if results.datasources %}
|
||||
<li>{% blocktrans count counter=results.datasources %}1 data source{% plural %}{{ counter }} data sources{% endblocktrans %}</li>
|
||||
{% endif %}
|
||||
|
|
Loading…
Reference in New Issue