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
144
Merge Requests
144
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
42715434
Commit
42715434
authored
Jan 28, 2020
by
Roque
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_web_project_ui: refactoring on query to get project home page
parent
c54cb531
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
13 deletions
+22
-13
bt5/erp5_web_project_ui/SkinTemplateItem/portal_skins/erp5_web_project/gadget_project_info.js.js
...m/portal_skins/erp5_web_project/gadget_project_info.js.js
+22
-13
No files found.
bt5/erp5_web_project_ui/SkinTemplateItem/portal_skins/erp5_web_project/gadget_project_info.js.js
View file @
42715434
...
...
@@ -111,14 +111,15 @@
}
//TODO fully remove project_reference (render options, TALES exp, etc)
function
getWebPageInfo
(
gadget
,
project_reference
,
home_page_preference
)
{
function
getWebPageInfo
(
gadget
,
project_reference
,
home_page_preference
,
project_pages
)
{
var
id
,
content
,
edit_view
,
redirector_ulr
,
i
,
query
,
query_list
=
[],
i
,
i
d_query_list
=
[]
,
validation_state_query_list
=
[],
valid_state_list
=
[
"
shared_alive
"
,
"
released_alive
"
,
"
published_alive
"
];
query_list
.
push
(
new
SimpleQuery
({
...
...
@@ -140,23 +141,30 @@
query_list
:
validation_state_query_list
,
type
:
"
complex
"
}));
query_list
.
push
(
new
SimpleQuery
({
key
:
"
publication_section
"
,
operator
:
"
=
"
,
type
:
"
simple
"
,
value
:
'
project_home_page
'
for
(
i
=
0
;
i
<
project_pages
.
length
;
i
+=
1
)
{
id_query_list
.
push
(
new
SimpleQuery
({
key
:
"
id
"
,
type
:
"
simple
"
,
operator
:
"
=
"
,
value
:
project_pages
[
i
]
}));
}
query_list
.
push
(
new
ComplexQuery
({
operator
:
"
OR
"
,
query_list
:
id_query_list
,
type
:
"
complex
"
}));
query
=
new
ComplexQuery
({
query
=
Query
.
objectToSearchText
(
new
ComplexQuery
({
operator
:
"
AND
"
,
query_list
:
query_list
,
type
:
"
complex
"
});
})
)
;
return
gadget
.
getUrlFor
({
command
:
'
push_history
'
,
options
:
{
page
:
"
project_redirector
"
}})
.
push
(
function
(
url
)
{
redirector_ulr
=
url
;
return
gadget
.
jio_allDocs
({
query
:
Query
.
objectToSearchText
(
query
)
,
select_list
:
[
'
validation_state
'
,
'
text_content
'
,
'
publication_section
'
]
query
:
query
,
select_list
:
[
'
text_content
'
,
'
publication_section
'
]
});
})
.
push
(
function
(
result_list
)
{
...
...
@@ -213,7 +221,8 @@
jio_key
:
options
.
jio_key
||
""
,
project_title
:
options
.
project_title
,
project_reference
:
options
.
project_reference
,
home_page_preference
:
options
.
home_page_preference
home_page_preference
:
options
.
home_page_preference
,
project_pages
:
options
.
project_pages
};
return
this
.
changeState
(
state_dict
);
})
...
...
@@ -225,7 +234,7 @@
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
return
RSVP
.
all
([
getWebPageInfo
(
gadget
,
modification_dict
.
project_reference
,
modification_dict
.
home_page_preference
),
getWebPageInfo
(
gadget
,
modification_dict
.
project_reference
,
modification_dict
.
home_page_preference
,
modification_dict
.
project_pages
),
gadget
.
getDeclaredGadget
(
"
editor
"
),
gadget
.
getSetting
(
"
hateoas_url
"
)
]);
...
...
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