Commit 3ea8d425 authored by Jérome Perrin's avatar Jérome Perrin

core: don't show list of items in initial business template install

During initial install in most cases we just want to install everything,
showing the listbox to choose install options is not necessary. The
problem is that this listbox is really big when installing multiple
business templates.

This introduces a "detailed install" checkbox, that is unchecked by
default, to make it possible to show the list to choose from anyway.
parent 74d1fbd0
......@@ -66,6 +66,16 @@
<td>Business Template test_core, test_accounting, test_accounting_fr installed</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${base_url}/portal_skins/erp5_test/test_file</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>test2</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${base_url}/portal_templates/TemplateTool_callViewInstallRepositoryBusinessTemplateListDialog</td>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="_reconstructor" module="copy_reg"/>
</klass>
<tuple>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
<global name="object" module="__builtin__"/>
<none/>
</tuple>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>expand</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>testInstallDetailed</string> </value>
</item>
<item>
<key> <string>output_encoding</string> </key>
<value> <string>utf-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <unicode></unicode> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<html xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Test Install Detailed</title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">Test Install Detailed<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/expected_failure_for_anonymous_selection" /></td></tr>
</thead><tbody>
<tal:block tal:condition="python: context.TestTool_getSkinName()!='Mobile'">
<tal:block metal:use-macro="here/BTZuite_CommonTemplate/macros/init" />
<tr>
<td>open</td>
<td>${base_url}/portal_templates/TemplateTool_viewUpdateRepositoryBusinessTemplateListDialog?dialog_category=object_exchange</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>Base_callDialogMethod:method</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Business templates updated successfully.</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${base_url}/portal_templates/TemplateTool_callViewInstallRepositoryBusinessTemplateListDialog</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>field_your_detailed_install</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//tr[@class='listbox-data-line-5 DataB']//input[@type='checkbox']</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>Base_callDialogMethod:method</td>
<td></td>
</tr>
<tr>
<td>assertElementPresent</td>
<td>//*[contains(@class, "listbox")]</td>
<td></td>
</tr>
<tr>
<td>assertText</td>
<td>//tr[@class="listbox-data-line-0 DataA"]/td</td>
<td>portal_skins/erp5_test</td>
</tr>
<tr>
<td>assertChecked</td>
<td>//tr[@class="listbox-data-line-0 DataA"]/td[5]//input[@type="checkbox"]</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>Base_callDialogMethod:method</td>
<td></td>
</tr>
<tr>
<td>assertPortalStatusMessage</td>
<td>Business Template test_core installed</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${base_url}/portal_skins/erp5_test/test_file</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>test2</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td tal:content="string: ${here/portal_url}/foo_module/BTZuite_reset?end=1"/>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Reset Successfully.</td>
<td></td>
</tr>
</tal:block>
</body>
</html>
\ No newline at end of file
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ZopePageTemplate" module="Products.PageTemplates.ZopePageTemplate"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="_reconstructor" module="copy_reg"/>
</klass>
<tuple>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
<global name="object" module="__builtin__"/>
<none/>
</tuple>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>expand</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>testInstallNotDetailed</string> </value>
</item>
<item>
<key> <string>output_encoding</string> </key>
<value> <string>utf-8</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <unicode></unicode> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<html xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Test Install not Detailed</title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">Test Install not Detailed<tal:block metal:use-macro="here/Zuite_CommonTemplate/macros/expected_failure_for_anonymous_selection" /></td></tr>
</thead><tbody>
<tal:block tal:condition="python: context.TestTool_getSkinName()!='Mobile'">
<tal:block metal:use-macro="here/BTZuite_CommonTemplate/macros/init" />
<tr>
<td>open</td>
<td>${base_url}/portal_templates/TemplateTool_viewUpdateRepositoryBusinessTemplateListDialog?dialog_category=object_exchange</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>Base_callDialogMethod:method</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Business templates updated successfully.</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${base_url}/portal_templates/TemplateTool_callViewInstallRepositoryBusinessTemplateListDialog</td>
<td></td>
</tr>
<tr>
<td>assertNotChecked</td>
<td>field_your_detailed_install</td>
<td></td>
</tr>
<tr>
<td>click</td>
<td>//tr[@class='listbox-data-line-5 DataB']//input[@type='checkbox']</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>Base_callDialogMethod:method</td>
<td></td>
</tr>
<tr>
<td>assertElementNotPresent</td>
<td>//*[contains(@class, "listbox")]</td>
<td></td>
</tr>
<tr>
<td>assertTextNotPresent</td>
<td>records</td>
<td></td>
</tr>
<tr>
<td>clickAndWait</td>
<td>Base_callDialogMethod:method</td>
<td></td>
</tr>
<tr>
<td>assertPortalStatusMessage</td>
<td>Business Template test_core installed</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td>${base_url}/portal_skins/erp5_test/test_file</td>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>test2</td>
<td></td>
</tr>
<tr>
<td>open</td>
<td tal:content="string: ${here/portal_url}/foo_module/BTZuite_reset?end=1"/>
<td></td>
</tr>
<tr>
<td>assertTextPresent</td>
<td>Reset Successfully.</td>
<td></td>
</tr>
</tal:block>
</body>
</html>
\ No newline at end of file
......@@ -6,10 +6,8 @@ bt_id_list = getattr(REQUEST, 'bt_list', ())
if len(bt_id_list) == 0:
bt_id_list = kw.get('bt_list', ())
if 'MultiInstallationDialog' in getattr(REQUEST, 'current_form_id', ''):
check_dependencies = 0
else:
check_dependencies = 1
if check_dependencies is None:
check_dependencies = 'MultiInstallationDialog' not in getattr(REQUEST, 'current_form_id', '')
from Products.ERP5Type.Document import newTempBase
from Products.ERP5Type.Cache import CachingMethod
......
......@@ -50,7 +50,7 @@
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>**kw</string> </value>
<value> <string>check_dependencies=None, **kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......
......@@ -3,6 +3,13 @@ update_catalog = update_translation = 0
bt_id_list = getattr(context.REQUEST, 'bt_list', ())
bt_dict = {}
if not listbox:
listbox = [
{'choice': item.choice_item_list[0], 'listbox_key': item.object_id}
for item in context.TemplateTool_getModifiedObjectList(**dict(kw, check_dependencies=False))
]
for item in listbox:
# backward compatibility
if not same_type(item['choice'], []):
......
......@@ -79,4 +79,4 @@ for repository, id_ in tuple_list:
RESPONSE.redirect(
'%s/TemplateTool_viewMultiInstallationDialog?%s&form_id=BusinessTemplate_installationChoice'
% (context.absolute_url(), make_query({'bt_list' : bt_list})))
% (context.absolute_url(), make_query({'bt_list' : bt_list, 'detailed_install': detailed_install})))
......@@ -50,7 +50,7 @@
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>**kw</string> </value>
<value> <string>detailed_install=False, **kw</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......
......@@ -63,6 +63,7 @@
<key> <string>group_list</string> </key>
<value>
<list>
<string>center</string>
<string>bottom</string>
<string>hidden</string>
</list>
......@@ -80,6 +81,14 @@
</list>
</value>
</item>
<item>
<key> <string>center</string> </key>
<value>
<list>
<string>your_detailed_install</string>
</list>
</value>
</item>
<item>
<key> <string>hidden</string> </key>
<value>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="CheckBoxField" module="Products.Formulator.StandardFields"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>your_detailed_install</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
<item>
<key> <string>required_not_found</string> </key>
<value> <string>This field is mandatory.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string>Show the full list of installed paths, making it possible to choose which paths to install or not</string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Detailed Installation</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -222,7 +222,9 @@
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>external_validator</string> </key>
......@@ -460,7 +462,7 @@
<item>
<key> <string>list_method</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
......@@ -583,6 +585,19 @@
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python: request.get(\'detailed_install\', True)</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="Method" module="Products.Formulator.MethodField"/>
</pickle>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment