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
1
Issues
1
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
Roque
erp5
Commits
fc0cef42
Commit
fc0cef42
authored
Jul 10, 2019
by
Roque
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_hal_json_style: grouping appcache code into a separated if
parent
b67b3250
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
16 deletions
+14
-16
bt5/erp5_hal_json_style/SkinTemplateItem/portal_skins/erp5_hal_json_style/ERP5Document_getHateoas.py
...rtal_skins/erp5_hal_json_style/ERP5Document_getHateoas.py
+14
-16
No files found.
bt5/erp5_hal_json_style/SkinTemplateItem/portal_skins/erp5_hal_json_style/ERP5Document_getHateoas.py
View file @
fc0cef42
...
...
@@ -1555,20 +1555,6 @@ def calculateHateoas(is_portal=None, is_site_root=None, traversed_document=None,
response
.
setHeader
(
"Vary"
,
"Cookie,Authorization,Accept-Encoding"
)
response
.
setHeader
(
"Last-Modified"
,
DateTime
().
rfc822
())
REQUEST
.
set
(
"X-HATEOAS-CACHE"
,
1
)
# appcache ----------------------------------------------------------------------------
if
view
==
"definition_view"
:
fields_raw_properties
=
{}
for
group
in
traversed_document
.
Form_getGroupTitleAndId
():
if
'hidden'
in
group
[
"gid"
]:
for
field
in
traversed_document
.
get_fields_in_group
(
group
[
"goid"
]):
if
field
.
id
==
"gadget_field_action_js_script"
:
fields_raw_properties
[
field
.
id
]
=
getFieldRawProperties
(
field
,
key_prefix
=
None
)
continue
for
field
in
traversed_document
.
get_fields_in_group
(
group
[
"goid"
]):
fields_raw_properties
[
field
.
id
]
=
getFieldRawProperties
(
field
,
key_prefix
=
None
)
if
fields_raw_properties
:
result_dict
[
"fields_raw_properties"
]
=
fields_raw_properties
# /appcache ----------------------------------------------------------------------------
elif
relative_url
==
'portal_workflow'
:
result_dict
[
'_links'
][
'action_worklist'
]
=
{
"href"
:
url_template_dict
[
'worklist_template'
]
%
{
...
...
@@ -1602,7 +1588,19 @@ def calculateHateoas(is_portal=None, is_site_root=None, traversed_document=None,
# appcache ----------------------------------------------------------------------------
if
view
==
"definition_view"
:
# my_form_definition will be used for rendering in JS side
traversed_document_portal_type
=
traversed_document
.
getPortalType
()
if
traversed_document_portal_type
in
(
"ERP5 Form"
,
"ERP5 Report"
):
fields_raw_properties
=
{}
for
group
in
traversed_document
.
Form_getGroupTitleAndId
():
if
'hidden'
in
group
[
"gid"
]:
for
field
in
traversed_document
.
get_fields_in_group
(
group
[
"goid"
]):
if
field
.
id
==
"gadget_field_action_js_script"
:
fields_raw_properties
[
field
.
id
]
=
getFieldRawProperties
(
field
,
key_prefix
=
None
)
continue
for
field
in
traversed_document
.
get_fields_in_group
(
group
[
"goid"
]):
fields_raw_properties
[
field
.
id
]
=
getFieldRawProperties
(
field
,
key_prefix
=
None
)
if
fields_raw_properties
:
result_dict
[
"fields_raw_properties"
]
=
fields_raw_properties
if
"_embedded"
in
result_dict
and
"_view"
in
result_dict
[
"_embedded"
]
and
"my_form_definition"
in
result_dict
[
"_embedded"
][
"_view"
]:
default_form_definition
=
result_dict
[
"_embedded"
][
"_view"
][
"_embedded"
][
"form_definition"
].
copy
()
if
"group_list"
in
result_dict
:
...
...
@@ -2232,6 +2230,7 @@ def calculateHateoas(is_portal=None, is_site_root=None, traversed_document=None,
return result_dict
mime_type = '
application
/
hal
+
json
'
portal = context.getPortalObject()
sql_catalog = portal.portal_catalog.getSQLCatalog()
...
...
@@ -2256,7 +2255,6 @@ hateoas = calculateHateoas(relative_url=relative_url,
default_param_json=default_param_json,
form_relative_url=form_relative_url,
extra_param_json=extra_param_json)
if hateoas == "":
return hateoas
else:
...
...
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