Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Thomas Gambier
erp5
Commits
a8470353
Commit
a8470353
authored
Feb 26, 2016
by
Xiaowu Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_web_renderjs_ui: redirect to first object_view when no view defined
parent
0409ed1f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
195 additions
and
42 deletions
+195
-42
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_formpage_js.xml
...teItem/web_page_module/rjs_gadget_erp5_pt_formpage_js.xml
+59
-41
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_zuite/testRedirectWhenNoViewDefined.xml
...tests/renderjs_ui_zuite/testRedirectWhenNoViewDefined.xml
+133
-0
bt5/erp5_web_renderjs_ui_test/TestTemplateItem/portal_components/test.erp5.testFunctionalRJSCore.py
...Item/portal_components/test.erp5.testFunctionalRJSCore.py
+1
-0
bt5/erp5_web_renderjs_ui_test/bt/dependency_list
bt5/erp5_web_renderjs_ui_test/bt/dependency_list
+2
-1
No files found.
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_formpage_js.xml
View file @
a8470353
...
@@ -131,6 +131,7 @@
...
@@ -131,6 +131,7 @@
/////////////////////////////////////////////////////////////////\n
/////////////////////////////////////////////////////////////////\n
.declareAcquiredMethod("jio_getAttachment", "jio_getAttachment")\n
.declareAcquiredMethod("jio_getAttachment", "jio_getAttachment")\n
.declareAcquiredMethod("updateHeader", "updateHeader")\n
.declareAcquiredMethod("updateHeader", "updateHeader")\n
.declareAcquiredMethod("redirect", "redirect")\n
\n
\n
/////////////////////////////////////////////////////////////////\n
/////////////////////////////////////////////////////////////////\n
// declared methods\n
// declared methods\n
...
@@ -146,59 +147,76 @@
...
@@ -146,59 +147,76 @@
element = gadget.props.element,\n
element = gadget.props.element,\n
erp5_document,\n
erp5_document,\n
erp5_form,\n
erp5_form,\n
queue,\n
form_gadget;\n
form_gadget;\n
\n
\n
gadget.props.jio_key = options.jio_key;\n
gadget.props.jio_key = options.jio_key;\n
gadget.props.options = options;\n
gadget.props.options = options;\n
\n
\n
return gadget.jio_getAttachment(options.jio_key, options.view)\n
queue = gadget.jio_getAttachment(options.jio_key, options.view);\n
queue\n
.push(function (result) {\n
.push(function (result) {\n
var uri;\n
if (!result._embedded) {\n
return gadget.jio_getAttachment(options.jio_key, "links")\n
.push(function (result) {\n
return gadget.redirect({command: \'change\', options: {\n
view: result._links.view[0].href,\n
editable: undefined,\n
page: undefined\n
}});\n
});\n
}\n
if (options.hasOwnProperty("form_validation_error")) {\n
if (options.hasOwnProperty("form_validation_error")) {\n
result._embedded._view = options.form_validation_error;\n
result._embedded._view = options.form_validation_error;\n
}\n
}\n
var
uri = new URI(result._embedded._view._links.form_definition.href);\n
uri = new URI(result._embedded._view._links.form_definition.href);\n
erp5_document = result;\n
erp5_document = result;\n
return gadget.jio_getAttachment(uri.segment(2), "view");\n
queue\n
})\n
.push(function () {\n
.push(function (result) {\n
return gadget.jio_getAttachment(uri.segment(2), "view");\n
erp5_form = result;\n
})\n
.push(function (result) {\n
erp5_form = result;\n
\n
\n
var url = "gadget_erp5_pt_" + erp5_form.pt;\n
var url = "gadget_erp5_pt_" + erp5_form.pt;\n
// XXX Hardcoded specific behaviour for form_view\n
// XXX Hardcoded specific behaviour for form_view\n
if ((options.editable !== undefined) && (erp5_form.pt === "form_view")) {\n
if ((options.editable !== undefined) && (erp5_form.pt === "form_view")) {\n
url += "_editable";\n
url += "_editable";\n
}\n
}\n
url += ".html";\n
url += ".html";\n
\n
\n
return gadget.declareGadget(url, {\n
return gadget.declareGadget(url, {\n
scope: "fg"\n
scope: "fg"\n
});\n
});\n
})\n
})\n
.push(function (result) {\n
.push(function (result) {\n
var sub_options = options.fg || {};\n
var sub_options = options.fg || {};\n
sub_options.erp5_document = erp5_document;\n
sub_options.erp5_document = erp5_document;\n
sub_options.form_definition = erp5_form;\n
sub_options.form_definition = erp5_form;\n
sub_options.view = options.view;\n
sub_options.view = options.view;\n
sub_options.action_view = options.action_view;\n
sub_options.action_view = options.action_view;\n
sub_options.jio_key = options.jio_key;\n
sub_options.jio_key = options.jio_key;\n
sub_options.editable = options.editable;\n
sub_options.editable = options.editable;\n
\n
\n
form_gadget = result;\n
form_gadget = result;\n
return form_gadget.render(sub_options);\n
return form_gadget.render(sub_options);\n
})\n
})\n
.push(function () {\n
.push(function () {\n
return form_gadget.getElement();\n
return form_gadget.getElement();\n
})\n
})\n
.push(function (fragment) {\n
.push(function (fragment) {\n
// Clear first to DOM, append after to reduce flickering/manip\n
// Clear first to DOM, append after to reduce flickering/manip\n
while (element.firstChild) {\n
while (element.firstChild) {\n
element.removeChild(element.firstChild);\n
element.removeChild(element.firstChild);\n
}\n
}\n
element.appendChild(fragment);\n
element.appendChild(fragment);\n
if (options.hasOwnProperty("form_validation_error")) {\n
if (options.hasOwnProperty("form_validation_error")) {\n
$(element).trigger("create");\n
$(element).trigger("create");\n
}\n
}\n
});\n
});\n
});\n
return queue;\n
})\n
})\n
\n
\n
.allowPublicAcquisition("displayFormulatorValidationError", function (param_list) {\n
.allowPublicAcquisition("displayFormulatorValidationError", function (param_list) {\n
...
@@ -344,7 +362,7 @@
...
@@ -344,7 +362,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
94
8.17480.10033.5534
7
</string>
</value>
<value>
<string>
94
9.26608.26326.1281
7
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -362,7 +380,7 @@
...
@@ -362,7 +380,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
145
2010103.81
</float>
<float>
145
6489995.58
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
...
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_zuite/testRedirectWhenNoViewDefined.xml
0 → 100644
View file @
a8470353
<?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=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
</klass>
<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>
_text
</string>
</key>
<value>
<unicode
encoding=
"cdata"
>
<![CDATA[
<html xmlns:tal="http://xml.zope.org/namespaces/tal"\n
xmlns:metal="http://xml.zope.org/namespaces/metal">
\n
<head>
\n
<meta
http-equiv=
"Content-Type"
content=
"text/html; charset=UTF-8"
>
\n
<title>
Test RenderJS UI
</title>
\n
</head>
\n
<body>
\n
<table
cellpadding=
"1"
cellspacing=
"1"
border=
"1"
>
\n
<thead>
\n
<tr><td
rowspan=
"1"
colspan=
"3"
>
Test RenderJS UI
</td></tr>
\n
</thead><tbody>
\n
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplate/macros/init"
/>
\n
\n
\n
<tr>
\n
<td>
open
</td>
\n
<td>
${base_url}/web_site_module/renderjs_runner/#/accounting_module
</td>
\n
<td></td>
\n
</tr>
\n
\n
<tr>
\n
<td>
waitForElementPresent
</td>
\n
<td>
//a[@data-i18n=\'Add\']
</td>
\n
<td></td>
\n
</tr>
\n
\n
<tr>
\n
<td>
click
</td>
\n
<td>
link=Add
</td>
\n
<td></td>
\n
</tr>
\n
\n
<tr>
\n
<td>
waitForElementPresent
</td>
\n
<td>
//button[@data-i18n=\'Proceed\']
</td>
\n
<td></td>
\n
</tr>
\n
\n
<tr>
\n
<td>
select
</td>
\n
<td>
//select[@name=\'field_your_portal_type\']
</td>
\n
<td>
label=Sale Invoice Transaction
</td>
\n
</tr>
\n
\n
<tr>
\n
<td>
click
</td>
\n
<td>
//button[@data-i18n=\'Proceed\']
</td>
\n
<td></td>
\n
</tr>
\n
\n
\n
\n
<tr>
\n
<td>
waitForElementPresent
</td>
\n
<td>
//button[@data-i18n=\'Proceed\']
</td>
\n
<td></td>
\n
</tr>
\n
\n
<tr>
\n
<td>
waitForElementPresent
</td>
\n
<td>
//div[@data-gadget-scope="field_my_translated_simulation_state_title"]
</td>
\n
<td></td>
\n
</tr>
\n
\n
\n
</tbody></table>
\n
</body>
\n
</html>
]]>
</unicode>
</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>
testRedirectWhenNoViewDefined
</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>
bt5/erp5_web_renderjs_ui_test/TestTemplateItem/portal_components/test.erp5.testFunctionalRJSCore.py
View file @
a8470353
...
@@ -39,6 +39,7 @@ class TestRenderJSUICore(ERP5TypeFunctionalTestCase):
...
@@ -39,6 +39,7 @@ class TestRenderJSUICore(ERP5TypeFunctionalTestCase):
'erp5_web_renderjs_ui'
,
'erp5_web_renderjs_ui'
,
'erp5_web_renderjs_ui_test'
,
'erp5_web_renderjs_ui_test'
,
'erp5_ui_test_core'
,
'erp5_ui_test_core'
,
'erp5_accounting'
,
)
)
def
test_suite
():
def
test_suite
():
...
...
bt5/erp5_web_renderjs_ui_test/bt/dependency_list
View file @
a8470353
erp5_ui_test_core
erp5_ui_test_core
erp5_ui_test
erp5_ui_test
erp5_web_renderjs_ui
erp5_web_renderjs_ui
\ No newline at end of file
erp5_accounting
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment