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
139
Merge Requests
139
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
fe5b49f4
Commit
fe5b49f4
authored
Nov 22, 2019
by
Roque
Committed by
Roque
Nov 22, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_officejs: reduce calls to getSetting method
parent
2df7e77b
Pipeline
#6762
failed with stage
in 0 seconds
Changes
6
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
84 additions
and
72 deletions
+84
-72
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_common_util_js.js
...ateItem/web_page_module/gadget_officejs_common_util_js.js
+56
-59
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_common_util_js.xml
...teItem/web_page_module/gadget_officejs_common_util_js.xml
+2
-2
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_controller_page_local_controller_js.js
...le/gadget_officejs_controller_page_local_controller_js.js
+10
-3
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_controller_page_local_controller_js.xml
...e/gadget_officejs_controller_page_local_controller_js.xml
+2
-2
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_action_officejs_js.js
...eb_page_module/gadget_officejs_page_action_officejs_js.js
+12
-4
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_common_util_js.js
View file @
fe5b49f4
...
@@ -128,22 +128,13 @@
...
@@ -128,22 +128,13 @@
// declared methods
// declared methods
/////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////
.
declareMethod
(
"
getViewAndActionDict
"
,
function
(
portal_type
,
jio_key
)
{
.
declareMethod
(
"
getViewAndActionDict
"
,
function
(
portal_type
,
app_view
,
default_view
,
app_actions_string
,
jio_key
)
{
var
gadget
=
this
,
var
gadget
=
this
,
action_info_dict
=
{
view_list
:
{},
action_list
:
{}},
action_info_dict
=
{
view_list
:
{},
action_list
:
{}},
query
=
buildSearchQuery
(
portal_type
),
query
=
buildSearchQuery
(
portal_type
),
app_actions
,
app_actions
,
app_view
,
app_actions_result
=
formatSettingList
(
app_actions_string
,
portal_type
);
default_view
;
return
gadget
.
getSettingList
([
'
app_view_reference
'
,
'
default_view_reference
'
,
'
app_actions
'
])
.
push
(
function
(
result_list
)
{
app_view
=
result_list
[
0
];
default_view
=
result_list
[
1
];
return
formatSettingList
(
result_list
[
2
],
portal_type
);
})
.
push
(
function
(
app_actions_result
)
{
app_actions
=
app_actions_result
.
map
(
function
(
pair
)
{
app_actions
=
app_actions_result
.
map
(
function
(
pair
)
{
return
pair
[
1
];
return
pair
[
1
];
});
});
...
@@ -153,8 +144,7 @@
...
@@ -153,8 +144,7 @@
for
(
row
in
action_list
.
data
.
rows
)
{
for
(
row
in
action_list
.
data
.
rows
)
{
if
(
action_list
.
data
.
rows
.
hasOwnProperty
(
row
))
{
if
(
action_list
.
data
.
rows
.
hasOwnProperty
(
row
))
{
path_for_jio_get_list
.
push
(
gadget
.
jio_get
(
action_list
path_for_jio_get_list
.
push
(
gadget
.
jio_get
(
action_list
.
data
.
rows
[
row
]
.
data
.
rows
[
row
].
id
));
.
id
));
}
}
}
}
return
RSVP
.
all
(
path_for_jio_get_list
);
return
RSVP
.
all
(
path_for_jio_get_list
);
...
@@ -174,8 +164,7 @@
...
@@ -174,8 +164,7 @@
action_type
:
action_doc
.
action_type
,
action_type
:
action_doc
.
action_type
,
parent_portal_type
:
portal_type
parent_portal_type
:
portal_type
};
};
if
(
view_categorie_list
.
includes
(
action_settings
if
(
view_categorie_list
.
includes
(
action_settings
.
action_type
))
{
.
action_type
))
{
action_settings
.
page
=
"
ojs_local_controller
"
;
action_settings
.
page
=
"
ojs_local_controller
"
;
action_info_dict
.
view_list
[
action_settings
.
action
]
=
action_info_dict
.
view_list
[
action_settings
.
action
]
=
action_settings
;
action_settings
;
...
@@ -188,11 +177,9 @@
...
@@ -188,11 +177,9 @@
}
}
}
}
action_info_dict
.
view_list
=
action_info_dict
.
view_list
=
filterViewList
(
action_info_dict
.
view_list
,
filterViewList
(
action_info_dict
.
view_list
,
app_view
,
default_view
);
app_view
,
default_view
);
return
action_info_dict
;
return
action_info_dict
;
});
});
});
})
})
.
declareMethod
(
"
getDialogFormDefinition
"
,
function
(
form_name
,
category
)
{
.
declareMethod
(
"
getDialogFormDefinition
"
,
function
(
form_name
,
category
)
{
...
@@ -234,13 +221,22 @@
...
@@ -234,13 +221,22 @@
form_definition
,
form_definition
,
portal_skin_folder
,
portal_skin_folder
,
app_allowed_sub_types
,
app_allowed_sub_types
,
app_view
,
default_view
,
app_actions_string
,
form_info
,
form_info
,
error
;
error
;
return
gadget
.
getSettingList
([
portal_type_dict_setting
,
return
gadget
.
getSettingList
([
portal_type_dict_setting
,
'
portal_skin_folder
'
,
'
portal_skin_folder
'
,
'
app_allowed_sub_types
'
])
'
app_allowed_sub_types
'
,
'
app_view_reference
'
,
'
default_view_reference
'
,
'
app_actions
'
])
.
push
(
function
(
result_list
)
{
.
push
(
function
(
result_list
)
{
app_allowed_sub_types
=
result_list
[
2
];
app_allowed_sub_types
=
result_list
[
2
];
app_view
=
result_list
[
3
];
default_view
=
result_list
[
4
];
app_actions_string
=
result_list
[
5
];
if
(
!
result_list
[
1
])
{
if
(
!
result_list
[
1
])
{
throw
new
Error
(
"
Missing site configuration 'portal_skin_folder'
"
);
throw
new
Error
(
"
Missing site configuration 'portal_skin_folder'
"
);
}
}
...
@@ -312,7 +308,8 @@
...
@@ -312,7 +308,8 @@
.
new_content_dialog_form
;
.
new_content_dialog_form
;
form_definition
.
new_content_category
=
portal_type_dict
form_definition
.
new_content_category
=
portal_type_dict
.
new_content_category
;
.
new_content_category
;
return
gadget
.
getViewAndActionDict
(
portal_type
);
return
gadget
.
getViewAndActionDict
(
portal_type
,
app_view
,
default_view
,
app_actions_string
);
})
})
.
push
(
function
(
action_view_dict
)
{
.
push
(
function
(
action_view_dict
)
{
form_definition
.
portal_type_dict
.
has_more_views
=
form_definition
.
portal_type_dict
.
has_more_views
=
...
...
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_common_util_js.xml
View file @
fe5b49f4
...
@@ -269,7 +269,7 @@
...
@@ -269,7 +269,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
979.
7531.30512.4637
0
</string>
</value>
<value>
<string>
979.
63531.55269.925
0
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -287,7 +287,7 @@
...
@@ -287,7 +287,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
157
1065275.72
</float>
<float>
157
4423791.17
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
...
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_controller_page_local_controller_js.js
View file @
fe5b49f4
...
@@ -27,6 +27,8 @@
...
@@ -27,6 +27,8 @@
jio_document
,
jio_document
,
portal_type
,
portal_type
,
parent_portal_type
,
parent_portal_type
,
default_view
,
app_action_list
,
form_definition
,
form_definition
,
current_version
,
current_version
,
index
;
index
;
...
@@ -36,10 +38,14 @@
...
@@ -36,10 +38,14 @@
current_version
=
current_version
.
substr
(
index
);
current_version
=
current_version
.
substr
(
index
);
return
gadget
.
getSettingList
([
"
migration_version
"
,
return
gadget
.
getSettingList
([
"
migration_version
"
,
"
app_view_reference
"
,
"
app_view_reference
"
,
"
parent_portal_type
"
])
"
parent_portal_type
"
,
'
default_view_reference
'
,
'
app_actions
'
])
.
push
(
function
(
setting_list
)
{
.
push
(
function
(
setting_list
)
{
app_view
=
options
.
action
||
setting_list
[
1
];
app_view
=
options
.
action
||
setting_list
[
1
];
parent_portal_type
=
setting_list
[
2
];
parent_portal_type
=
setting_list
[
2
];
default_view
=
setting_list
[
3
];
app_action_list
=
setting_list
[
4
];
if
(
setting_list
[
0
]
!==
current_version
)
{
if
(
setting_list
[
0
]
!==
current_version
)
{
//if app version has changed, force storage selection
//if app version has changed, force storage selection
return
gadget
.
redirect
({
return
gadget
.
redirect
({
...
@@ -82,7 +88,8 @@
...
@@ -82,7 +88,8 @@
})
})
.
push
(
function
(
result
)
{
.
push
(
function
(
result
)
{
form_definition
=
result
;
form_definition
=
result
;
return
gadget_util
.
getViewAndActionDict
(
portal_type
,
return
gadget_util
.
getViewAndActionDict
(
portal_type
,
app_view
,
default_view
,
app_action_list
,
options
.
jio_key
);
options
.
jio_key
);
})
})
.
push
(
function
(
view_action_dict
)
{
.
push
(
function
(
view_action_dict
)
{
...
...
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_controller_page_local_controller_js.xml
View file @
fe5b49f4
...
@@ -228,7 +228,7 @@
...
@@ -228,7 +228,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
979.
53364.49548.7526
</string>
</value>
<value>
<string>
979.
63498.47896.7901
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -246,7 +246,7 @@
...
@@ -246,7 +246,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
157
3813846.58
</float>
<float>
157
4423725.43
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
...
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_action_officejs_js.js
View file @
fe5b49f4
...
@@ -75,6 +75,7 @@
...
@@ -75,6 +75,7 @@
.
declareAcquiredMethod
(
"
getUrlFor
"
,
"
getUrlFor
"
)
.
declareAcquiredMethod
(
"
getUrlFor
"
,
"
getUrlFor
"
)
.
declareAcquiredMethod
(
"
getUrlForList
"
,
"
getUrlForList
"
)
.
declareAcquiredMethod
(
"
getUrlForList
"
,
"
getUrlForList
"
)
.
declareAcquiredMethod
(
"
updateHeader
"
,
"
updateHeader
"
)
.
declareAcquiredMethod
(
"
updateHeader
"
,
"
updateHeader
"
)
.
declareAcquiredMethod
(
"
getSettingList
"
,
"
getSettingList
"
)
/////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////
// declared methods
// declared methods
...
@@ -83,7 +84,8 @@
...
@@ -83,7 +84,8 @@
.
declareMethod
(
"
render
"
,
function
(
options
)
{
.
declareMethod
(
"
render
"
,
function
(
options
)
{
var
gadget
=
this
,
var
gadget
=
this
,
portal_type
,
portal_type
,
document_title
;
document_title
,
gadget_utils
;
return
gadget
.
jio_get
(
options
.
jio_key
)
return
gadget
.
jio_get
(
options
.
jio_key
)
.
push
(
function
(
document
)
{
.
push
(
function
(
document
)
{
document_title
=
document
.
title
;
document_title
=
document
.
title
;
...
@@ -96,11 +98,17 @@
...
@@ -96,11 +98,17 @@
portal_type
=
result
;
portal_type
=
result
;
return
gadget
.
declareGadget
(
"
gadget_officejs_common_util.html
"
);
return
gadget
.
declareGadget
(
"
gadget_officejs_common_util.html
"
);
})
})
.
push
(
function
(
gadget_utils
)
{
.
push
(
function
(
result
)
{
gadget_utils
=
result
;
return
gadget
.
getSettingList
([
'
app_view_reference
'
,
'
default_view_reference
'
,
'
app_actions
'
]);
})
.
push
(
function
(
setting_list
)
{
// TODO views are also listed here
// TODO views are also listed here
// should views be handled in another gadget like "..tab_office.js" ?
// should views be handled in another gadget like "..tab_office.js" ?
return
gadget_utils
.
getViewAndActionDict
(
portal_type
,
return
gadget_utils
.
getViewAndActionDict
(
portal_type
,
setting_list
[
0
],
options
.
jio_key
);
setting_list
[
1
],
setting_list
[
2
],
options
.
jio_key
);
})
})
.
push
(
function
(
action_info_dict
)
{
.
push
(
function
(
action_info_dict
)
{
return
RSVP
.
all
([
return
RSVP
.
all
([
...
...
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_action_officejs_js.xml
View file @
fe5b49f4
...
@@ -228,7 +228,7 @@
...
@@ -228,7 +228,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
97
6.41484.14260.5085
</string>
</value>
<value>
<string>
97
9.63524.32203.29269
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -246,7 +246,7 @@
...
@@ -246,7 +246,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
15
61477231.0
</float>
<float>
15
74423701.42
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</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