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
Xavier Thompson
erp5
Commits
e25887c4
Commit
e25887c4
authored
Sep 24, 2020
by
Romain Courteaud
🐸
Committed by
Gabriel Monnerat
May 17, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_web_renderjs_ui: Query and display tools by catalog if developer mode is activated
parent
b1dfe137
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
282 additions
and
16 deletions
+282
-16
bt5/erp5_web_renderjs_ui/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/SQLCatalog_makeModuleListQuery.catalog_keys.xml
...ql_innodb/SQLCatalog_makeModuleListQuery.catalog_keys.xml
+2
-0
bt5/erp5_web_renderjs_ui/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/SQLCatalog_makeModuleListQuery.py
...talog/erp5_mysql_innodb/SQLCatalog_makeModuleListQuery.py
+32
-0
bt5/erp5_web_renderjs_ui/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/SQLCatalog_makeModuleListQuery.xml
...alog/erp5_mysql_innodb/SQLCatalog_makeModuleListQuery.xml
+97
-0
bt5/erp5_web_renderjs_ui/CatalogScriptableKeyTemplateItem/scriptable_key_list.xml
.../CatalogScriptableKeyTemplateItem/scriptable_key_list.xml
+3
-0
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_frontpage_html.html
...em/web_page_module/rjs_gadget_erp5_pt_frontpage_html.html
+1
-0
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_frontpage_html.xml
...tem/web_page_module/rjs_gadget_erp5_pt_frontpage_html.xml
+2
-2
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_frontpage_js.js
...teItem/web_page_module/rjs_gadget_erp5_pt_frontpage_js.js
+26
-12
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_frontpage_js.xml
...eItem/web_page_module/rjs_gadget_erp5_pt_frontpage_js.xml
+2
-2
bt5/erp5_web_renderjs_ui/bt/template_catalog_method_id_list
bt5/erp5_web_renderjs_ui/bt/template_catalog_method_id_list
+1
-0
bt5/erp5_web_renderjs_ui/bt/template_catalog_scriptable_key_list
...5_web_renderjs_ui/bt/template_catalog_scriptable_key_list
+1
-0
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_developer_mode_zuite/testDisplayToolsSection.xml
...derjs_ui_developer_mode_zuite/testDisplayToolsSection.xml
+58
-0
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_developer_mode_zuite/testDisplayToolsSection.zpt
...derjs_ui_developer_mode_zuite/testDisplayToolsSection.zpt
+57
-0
No files found.
bt5/erp5_web_renderjs_ui/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/SQLCatalog_makeModuleListQuery.catalog_keys.xml
0 → 100644
View file @
e25887c4
<catalog_method>
</catalog_method>
bt5/erp5_web_renderjs_ui/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/SQLCatalog_makeModuleListQuery.py
0 → 100644
View file @
e25887c4
from
Products.ZSQLCatalog.SQLCatalog
import
ComplexQuery
,
SimpleQuery
is_developer_mode
=
(
context
.
getPortalObject
().
portal_preferences
.
getPreferredHtmlStyleDevelopperMode
())
simple_query
=
SimpleQuery
(
parent_uid
=
0
)
module_query
=
ComplexQuery
(
SimpleQuery
(
id
=
"%
\
\
_module"
,
comparison_operator
=
"like"
),
SimpleQuery
(
meta_type
=
"ERP5 Folder"
),
logical_operator
=
'AND'
)
if
is_developer_mode
:
query
=
ComplexQuery
(
simple_query
,
ComplexQuery
(
module_query
,
SimpleQuery
(
id
=
"portal
\
\
_%"
,
comparison_operator
=
"like"
),
logical_operator
=
'OR'
),
logical_operator
=
'AND'
)
else
:
query
=
ComplexQuery
(
simple_query
,
module_query
,
logical_operator
=
'AND'
)
return
ComplexQuery
(
query
,
SimpleQuery
(
id
=
value
,
comparison_operator
=
"like"
),
logical_operator
=
'AND'
)
bt5/erp5_web_renderjs_ui/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/SQLCatalog_makeModuleListQuery.xml
0 → 100644
View file @
e25887c4
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Python Script"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
Script_magic
</string>
</key>
<value>
<int>
3
</int>
</value>
</item>
<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_container
</string>
</key>
<value>
<string>
container
</string>
</value>
</item>
<item>
<key>
<string>
name_context
</string>
</key>
<value>
<string>
context
</string>
</value>
</item>
<item>
<key>
<string>
name_m_self
</string>
</key>
<value>
<string>
script
</string>
</value>
</item>
<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>
_local_properties
</string>
</key>
<value>
<tuple>
<dictionary>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
reference
</string>
</value>
</item>
<item>
<key>
<string>
type
</string>
</key>
<value>
<string>
string
</string>
</value>
</item>
</dictionary>
</tuple>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
value
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
SQLCatalog_makeModuleListQuery
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Python Script
</string>
</value>
</item>
<item>
<key>
<string>
reference
</string>
</key>
<value>
<string>
SQLCatalog_makeModuleListQuery
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
SQLCatalog_makeModuleListQuery
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_web_renderjs_ui/CatalogScriptableKeyTemplateItem/scriptable_key_list.xml
0 → 100644
View file @
e25887c4
<key_list>
<key>
module_id | SQLCatalog_makeModuleListQuery
</key>
</key_list>
\ No newline at end of file
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_frontpage_html.html
View file @
e25887c4
...
...
@@ -2,6 +2,7 @@
<html>
<!--
data-i18n=Others
data-i18n=Tools
-->
<head>
<meta
http-equiv=
"Content-type"
content=
"text/html; charset=utf-8"
/>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_frontpage_html.xml
View file @
e25887c4
...
...
@@ -238,7 +238,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
98
9.60433.59989.54698
</string>
</value>
<value>
<string>
98
6.51245.10858.8089
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -256,7 +256,7 @@
</tuple>
<state>
<tuple>
<float>
16
12969553.17
</float>
<float>
16
05547612.43
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_frontpage_js.js
View file @
e25887c4
...
...
@@ -38,7 +38,7 @@
// Acquired methods
/////////////////////////////////////////////////////////////////
.
declareAcquiredMethod
(
"
updateHeader
"
,
"
updateHeader
"
)
.
declareAcquiredMethod
(
"
translate
"
,
"
translate
"
)
.
declareAcquiredMethod
(
"
getTranslationList
"
,
"
getTranslationList
"
)
.
declareAcquiredMethod
(
"
getUrlForList
"
,
"
getUrlForList
"
)
.
declareAcquiredMethod
(
"
jio_allDocs
"
,
"
jio_allDocs
"
)
...
...
@@ -52,7 +52,7 @@
// First, get the list of modules
return
gadget
.
jio_allDocs
({
select_list
:
select_list
,
query
:
'
(parent_uid:"0" AND meta_type:"ERP5 Folder" AND id:"%_module")
'
,
query
:
'
module_id:%
'
,
limit
:
1000
})
.
push
(
function
(
result_list
)
{
...
...
@@ -96,19 +96,21 @@
url_dict_list
.
push
({
command
:
'
display
'
,
options
:
{
page
:
'
language
'
}});
return
RSVP
.
all
([
document_list
,
gadget
.
translate
(
'
Others
'
),
gadget
.
getTranslationList
([
'
Others
'
,
'
Tools
'
]
),
gadget
.
getUrlForList
(
url_dict_list
)
]);
})
.
push
(
function
(
result_list
)
{
var
document_list
=
result_list
[
0
],
translated_other_title
=
result_list
[
1
],
translated_other_title
=
result_list
[
1
][
0
],
translated_tool_title
=
result_list
[
1
][
1
],
url_list
=
result_list
[
2
],
len
=
document_list
.
length
,
i
,
card_list
=
[],
module_list
=
[],
other_module_list
=
[],
tool_list
=
[],
current_business_application_title
=
''
;
function
pushNewCard
()
{
...
...
@@ -128,15 +130,21 @@
for
(
i
=
0
;
i
<
len
;
i
+=
1
)
{
// Inject the module url into the document
document_list
[
i
].
link
=
url_list
[
i
];
// Create card if needed
if
(
document_list
[
i
].
business_application_translated_title
!==
current_business_application_title
)
{
pushNewCard
();
module_list
=
[];
current_business_application_title
=
document_list
[
i
].
business_application_translated_title
;
// Tools do not have any business application
// Workaround this limitation
if
(
document_list
[
i
].
id
.
indexOf
(
'
portal_
'
)
===
0
)
{
tool_list
.
push
(
document_list
[
i
]);
}
else
{
// Create card if needed
if
(
document_list
[
i
].
business_application_translated_title
!==
current_business_application_title
)
{
pushNewCard
();
module_list
=
[];
current_business_application_title
=
document_list
[
i
].
business_application_translated_title
;
}
module_list
.
push
(
document_list
[
i
]);
}
module_list
.
push
(
document_list
[
i
]);
}
pushNewCard
();
if
(
other_module_list
.
length
)
{
...
...
@@ -145,6 +153,12 @@
module_list
:
other_module_list
});
}
if
(
tool_list
.
length
)
{
card_list
.
push
({
business_application_translated_title
:
translated_tool_title
,
module_list
:
tool_list
});
}
generateCardList
(
gadget
.
element
.
querySelector
(
'
ul
'
),
card_list
);
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_frontpage_js.xml
View file @
e25887c4
...
...
@@ -234,7 +234,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
9
86.54125.60966.30924
</string>
</value>
<value>
<string>
9
91.59254.15114.55603
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -252,7 +252,7 @@
</tuple>
<state>
<tuple>
<float>
16
00957441.42
</float>
<float>
16
20402959.3
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_web_renderjs_ui/bt/template_catalog_method_id_list
0 → 100644
View file @
e25887c4
erp5_mysql_innodb/SQLCatalog_makeModuleListQuery
\ No newline at end of file
bt5/erp5_web_renderjs_ui/bt/template_catalog_scriptable_key_list
0 → 100644
View file @
e25887c4
module_id | SQLCatalog_makeModuleListQuery
\ No newline at end of file
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_developer_mode_zuite/testDisplayToolsSection.xml
0 → 100644
View file @
e25887c4
<?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>
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>
testDisplayToolsSection
</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>
Test Display Tools Section
</unicode>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_developer_mode_zuite/testDisplayToolsSection.zpt
0 → 100644
View file @
e25887c4
<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"
>
</head>
<body>
<table
cellpadding=
"1"
cellspacing=
"1"
border=
"1"
>
<thead>
<tr><td
rowspan=
"1"
colspan=
"3"
>
Test Display Tools Section
</td></tr>
</thead><tbody>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplate/macros/init"
/>
<tr>
<td>
open
</td>
<td>
${base_url}/web_site_module/renderjs_runner/#/?page=preference
</td>
<td></td>
</tr>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/enable_developer_mode"
/>
<tal:block
tal:define=
"click_configuration python: {'text': 'Modules'}"
>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/click_on_panel_link"
/>
</tal:block>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded"
/>
<tr>
<td>
assertElementPresent
</td>
<td>
//ul[@class="ui-list-grid"]/li[2]/h2[text()="Tools"]
</td>
<td></td>
</tr>
<tr>
<td>
assertElementPresent
</td>
<td>
//a[text()="Business Templates" and href=contains(text(), "n.jio_key=portal_templates")]
</td>
<td></td>
</tr>
<tal:block
tal:define=
"click_configuration python: {'text': 'Preferences'}"
>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/click_on_panel_link"
/>
</tal:block>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded"
/>
<tal:block
tal:define=
"click_configuration python: {'text': 'User Interface'}"
>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/click_on_panel_link"
/>
</tal:block>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded"
/>
<tr>
<td>
uncheck
</td>
<td>
//input[@id="field_my_preferred_html_style_developper_mode"]
</td>
<td></td>
</tr>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/save"
/>
<tal:block
tal:define=
"click_configuration python: {'text': 'Modules'}"
>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/click_on_panel_link"
/>
</tal:block>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded"
/>
<tr>
<td>
assertElementNotPresent
</td>
<td>
//ul[@class="ui-list-grid"]/li[2]/h2[text()="Tools"]
</td>
<td></td>
</tr>
</tbody></table>
</body>
</html>
\ 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