Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5-Boxiang
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
Hamza
erp5-Boxiang
Commits
58248225
Commit
58248225
authored
Apr 05, 2016
by
Cédric Le Ninivin
Browse files
Options
Browse Files
Download
Plain Diff
ERP5JS: Tab gadget display jump and is used in form_view
/reviewed-on
nexedi/erp5!94
parents
347cac18
9b88da4c
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
78 additions
and
23 deletions
+78
-23
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_view_js.js
...teItem/web_page_module/rjs_gadget_erp5_pt_form_view_js.js
+2
-2
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_tabpage_js.js
...lateItem/web_page_module/rjs_gadget_erp5_pt_tabpage_js.js
+42
-17
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_page_templates_zuite/testFormViewEditableTabsLink.zpt
..._ui_page_templates_zuite/testFormViewEditableTabsLink.zpt
+15
-0
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_page_templates_zuite/testFormViewTabsLink.xml
...renderjs_ui_page_templates_zuite/testFormViewTabsLink.xml
+1
-1
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_page_templates_zuite/testFormViewTabsLink.zpt
...renderjs_ui_page_templates_zuite/testFormViewTabsLink.zpt
+18
-3
No files found.
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_view_js.js
View file @
58248225
...
@@ -57,13 +57,13 @@
...
@@ -57,13 +57,13 @@
gadget
.
getUrlFor
({
command
:
'
history_previous
'
}),
gadget
.
getUrlFor
({
command
:
'
history_previous
'
}),
gadget
.
getUrlFor
({
command
:
'
selection_previous
'
}),
gadget
.
getUrlFor
({
command
:
'
selection_previous
'
}),
gadget
.
getUrlFor
({
command
:
'
selection_next
'
}),
gadget
.
getUrlFor
({
command
:
'
selection_next
'
}),
gadget
.
getUrlFor
({
command
:
'
change
'
,
options
:
{
page
:
"
jump
"
}})
gadget
.
getUrlFor
({
command
:
'
change
'
,
options
:
{
page
:
"
tab
"
}})
]);
]);
})
})
.
push
(
function
(
all_result
)
{
.
push
(
function
(
all_result
)
{
return
gadget
.
updateHeader
({
return
gadget
.
updateHeader
({
jump
_url
:
all_result
[
7
],
tab
_url
:
all_result
[
7
],
actions_url
:
all_result
[
2
],
actions_url
:
all_result
[
2
],
previous_url
:
all_result
[
5
],
previous_url
:
all_result
[
5
],
next_url
:
all_result
[
6
],
next_url
:
all_result
[
6
],
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_tabpage_js.js
View file @
58248225
/*global window, rJS, RSVP, Handlebars */
/*global window, rJS, RSVP, Handlebars
, URI
*/
/*jslint nomen: true, indent: 2, maxerr: 3 */
/*jslint nomen: true, indent: 2, maxerr: 3 */
(
function
(
window
,
rJS
,
RSVP
,
Handlebars
)
{
(
function
(
window
,
rJS
,
RSVP
,
Handlebars
,
URI
)
{
"
use strict
"
;
"
use strict
"
;
/////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////
...
@@ -44,22 +44,33 @@
...
@@ -44,22 +44,33 @@
.
declareMethod
(
"
render
"
,
function
(
options
)
{
.
declareMethod
(
"
render
"
,
function
(
options
)
{
var
view_list
,
var
view_list
,
tab_list
=
[],
tab_list
=
[],
jump_action_list
=
[],
gadget
=
this
,
gadget
=
this
,
erp5_document
;
erp5_document
,
jump_list
;
return
gadget
.
jio_getAttachment
(
options
.
jio_key
,
"
links
"
)
return
gadget
.
jio_getAttachment
(
options
.
jio_key
,
"
links
"
)
.
push
(
function
(
result
)
{
.
push
(
function
(
result
)
{
var
i
,
var
i
,
promise_list
=
[];
promise_list
=
[];
erp5_document
=
result
,
erp5_document
=
result
;
view_list
=
erp5_document
.
_links
.
view
;
view_list
=
erp5_document
.
_links
.
view
||
[];
jump_list
=
erp5_document
.
_links
.
action_object_jump
||
[];
// All ERP5 document should at least have one view.
// All ERP5 document should at least have one view.
// So, no need normally to test undefined
// So, no need normally to test undefined
if
(
view_list
.
constructor
!==
Array
)
{
if
(
view_list
.
constructor
!==
Array
)
{
view_list
=
[
view_list
];
view_list
=
[
view_list
];
}
}
if
(
jump_list
.
constructor
!==
Array
)
{
jump_list
=
[
jump_list
];
}
promise_list
.
push
(
gadget
.
getUrlFor
({
command
:
'
change
'
,
options
:
{
view
:
"
view
"
,
page
:
undefined
,
editable
:
undefined
}}));
for
(
i
=
0
;
i
<
view_list
.
length
;
i
+=
1
)
{
for
(
i
=
0
;
i
<
view_list
.
length
;
i
+=
1
)
{
promise_list
.
push
(
gadget
.
getUrlFor
({
command
:
'
change
'
,
options
:
{
promise_list
.
push
(
gadget
.
getUrlFor
({
command
:
'
change
'
,
options
:
{
view
:
view_list
[
i
].
href
,
view
:
view_list
[
i
].
href
,
...
@@ -67,37 +78,51 @@
...
@@ -67,37 +78,51 @@
page
:
undefined
page
:
undefined
}}));
}}));
}
}
promise_list
.
push
(
gadget
.
getUrlFor
({
command
:
'
change
'
,
options
:
{
for
(
i
=
0
;
i
<
jump_list
.
length
;
i
+=
1
)
{
view
:
"
view
"
,
promise_list
.
push
(
gadget
.
getUrlFor
({
command
:
'
push_history
'
,
options
:
{
page
:
undefined
,
extended_search
:
new
URI
(
jump_list
[
i
].
href
).
query
(
true
).
query
,
editable
:
undefined
page
:
'
search
'
}}));
}}));
}
return
RSVP
.
all
(
promise_list
);
return
RSVP
.
all
(
promise_list
);
})
})
.
push
(
function
(
all_result
)
{
.
push
(
function
(
all_result
)
{
var
i
;
var
i
,
j
;
j
=
1
;
for
(
i
=
0
;
i
<
all_result
.
length
-
1
;
i
+=
1
)
{
for
(
i
=
0
;
i
<
view_list
.
length
;
i
+=
1
)
{
tab_list
.
push
({
tab_list
.
push
({
title
:
view_list
[
i
].
title
,
title
:
view_list
[
i
].
title
,
i18n
:
view_list
[
i
].
title
,
i18n
:
view_list
[
i
].
title
,
link
:
all_result
[
i
]
link
:
all_result
[
j
]
});
});
j
+=
1
;
}
for
(
i
=
0
;
i
<
jump_list
.
length
;
i
+=
1
)
{
jump_action_list
.
push
({
title
:
jump_list
[
i
].
title
,
link
:
all_result
[
j
],
i18n
:
jump_list
[
i
].
title
});
j
+=
1
;
}
}
return
gadget
.
translateHtml
(
table_template
({
return
gadget
.
translateHtml
(
table_template
({
definition_title
:
"
Views
"
,
definition_title
:
"
Views
"
,
definition_i18n
:
"
Views
"
,
definition_i18n
:
"
Views
"
,
definition_icon
:
"
eye
"
,
definition_icon
:
"
eye
"
,
documentlist
:
[{
documentlist
:
[{
title
:
view_list
[
0
].
title
,
title
:
view_list
[
0
].
title
,
link
:
all_result
[
all_result
.
length
-
1
]
link
:
all_result
[
0
]
}]
}]
})
+
table_template
({
})
+
table_template
({
definition_title
:
"
Editables
"
,
definition_title
:
"
Editables
"
,
definition_i18n
:
"
Editables
"
,
definition_i18n
:
"
Editables
"
,
definition_icon
:
"
edit
"
,
definition_icon
:
"
edit
"
,
documentlist
:
tab_list
documentlist
:
tab_list
})
+
table_template
({
definition_title
:
"
Jumps
"
,
documentlist
:
jump_action_list
,
definition_icon
:
"
plane
"
,
definition_i18n
:
"
Jumps
"
}));
}));
})
})
.
push
(
function
(
my_translated_html
)
{
.
push
(
function
(
my_translated_html
)
{
...
@@ -119,4 +144,4 @@
...
@@ -119,4 +144,4 @@
});
});
});
});
}(
window
,
rJS
,
RSVP
,
Handlebars
));
}(
window
,
rJS
,
RSVP
,
Handlebars
,
URI
));
\ No newline at end of file
\ No newline at end of file
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_page_templates_zuite/testFormViewEditableTabsLink.zpt
View file @
58248225
...
@@ -50,6 +50,21 @@
...
@@ -50,6 +50,21 @@
<td>
Dummy Report
</td>
<td>
Dummy Report
</td>
<td></td>
<td></td>
</tr>
</tr>
<tr>
<td>
assertTextPresent
</td>
<td>
Views
</td>
<td></td>
</tr>
<tr>
<td>
assertTextPresent
</td>
<td>
Editables
</td>
<td></td>
</tr>
<tr>
<td>
assertTextPresent
</td>
<td>
Jumps
</td>
<td></td>
</tr>
</tbody></table>
</tbody></table>
</body>
</body>
...
...
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_page_templates_zuite/testFormView
Jump
sLink.xml
→
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_page_templates_zuite/testFormView
Tab
sLink.xml
View file @
58248225
...
@@ -42,7 +42,7 @@
...
@@ -42,7 +42,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
id
</string>
</key>
<key>
<string>
id
</string>
</key>
<value>
<string>
testFormView
Jump
sLink
</string>
</value>
<value>
<string>
testFormView
Tab
sLink
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
output_encoding
</string>
</key>
<key>
<string>
output_encoding
</string>
</key>
...
...
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_page_templates_zuite/testFormView
Jump
sLink.zpt
→
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_page_templates_zuite/testFormView
Tab
sLink.zpt
View file @
58248225
...
@@ -32,17 +32,17 @@
...
@@ -32,17 +32,17 @@
<!-- Header has a link to the action page -->
<!-- Header has a link to the action page -->
<tr>
<tr>
<td>
assertElementPresent
</td>
<td>
assertElementPresent
</td>
<td>
//div[@data-gadget-scope='header']//a[text()='
Jump' and contains(@href, '#!change') and contains(@href, 'n.page=jump
')]
</td>
<td>
//div[@data-gadget-scope='header']//a[text()='
Tabs' and contains(@href, '#!change') and contains(@href, 'n.page=tab
')]
</td>
<td></td>
<td></td>
</tr>
</tr>
<tr>
<tr>
<td>
click
</td>
<td>
click
</td>
<td>
//div[@data-gadget-scope='header']//a[text()='
Jump' and contains(@href, '#!change') and contains(@href, 'n.page=jump
')]
</td>
<td>
//div[@data-gadget-scope='header']//a[text()='
Tabs' and contains(@href, '#!change') and contains(@href, 'n.page=tab
')]
</td>
<td></td>
<td></td>
</tr>
</tr>
<tr>
<tr>
<td>
waitForElementPresent
</td>
<td>
waitForElementPresent
</td>
<td>
//div[@data-gadget-url='${base_url}/web_site_module/renderjs_runner/gadget_erp5_page_
jump
.html']
</td>
<td>
//div[@data-gadget-url='${base_url}/web_site_module/renderjs_runner/gadget_erp5_page_
tab
.html']
</td>
<td></td>
<td></td>
</tr>
</tr>
<tr>
<tr>
...
@@ -50,6 +50,21 @@
...
@@ -50,6 +50,21 @@
<td>
Title 1
</td>
<td>
Title 1
</td>
<td></td>
<td></td>
</tr>
</tr>
<tr>
<td>
assertTextPresent
</td>
<td>
Views
</td>
<td></td>
</tr>
<tr>
<td>
assertTextPresent
</td>
<td>
Editables
</td>
<td></td>
</tr>
<tr>
<td>
assertTextPresent
</td>
<td>
Jumps
</td>
<td></td>
</tr>
</tbody></table>
</tbody></table>
</body>
</body>
...
...
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