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
Labels
Merge Requests
138
Merge Requests
138
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
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
35ba51d4
Commit
35ba51d4
authored
Jun 19, 2019
by
Roque
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_officejs: only show one view "View" when portal type has several
parent
3d350c00
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
8 deletions
+22
-8
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_action_officejs_js.js
...eb_page_module/gadget_officejs_page_action_officejs_js.js
+20
-6
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_action_officejs_js.xml
...b_page_module/gadget_officejs_page_action_officejs_js.xml
+2
-2
No files found.
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_action_officejs_js.js
View file @
35ba51d4
...
...
@@ -39,12 +39,25 @@
}
function
filterViews
(
views_dict
,
app_view
,
default_view
)
{
//
TODO:
there must be only one "View" action (title = "View")
// there must be only one "View" action (title = "View")
// this is for scenarios were the portal type has several "View" (like view, jio_view, custom_view)
// priority: app_view ; default_view ; other (reference=view)
// if views_dict contains app_view -> remove all "View" entries
// else if contains default_view -> remove all "View" entries
// else get first "View" and remove all other "View" entries
// priority: app_view ; default_view ; other
var
only_view
,
key
,
view_list
=
Object
.
keys
(
views_dict
).
map
(
function
(
key
)
{
if
(
views_dict
[
key
].
title
===
"
View
"
)
{
return
key
;
}
});
if
(
view_list
.
includes
(
app_view
))
{
only_view
=
app_view
;
}
else
if
(
view_list
.
includes
(
default_view
))
{
only_view
=
default_view
;
}
else
{
only_view
=
view_list
[
0
];
}
for
(
key
in
view_list
)
{
if
(
view_list
[
key
]
!==
only_view
)
{
delete
views_dict
[
view_list
[
key
]];
}
}
return
views_dict
;
}
...
...
@@ -95,7 +108,8 @@
})
.
declareMethod
(
"
getAllViewsAndActions
"
,
function
(
portal_type
,
options
)
{
//TODO for now this takes also views. Views should be handle in another gadget like "..tab_office.js"
// TODO views are also listed here
// should views be handled in another gadget like "..tab_office.js" ?
var
gadget
=
this
,
action_info_dict
=
{
views
:
{},
actions
:
{}},
//TODO use Query to avoid strings
...
...
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_action_officejs_js.xml
View file @
35ba51d4
...
...
@@ -228,7 +228,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
976.3
1395.21170.7816
</string>
</value>
<value>
<string>
976.3
2499.44430.52411
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -246,7 +246,7 @@
</tuple>
<state>
<tuple>
<float>
1560
871889.71
</float>
<float>
1560
938148.99
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
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