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
ff5681e1
Commit
ff5681e1
authored
Feb 12, 2020
by
Roque
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_web_project_ui: new front page gadget (WIP)
parent
84bd681e
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
522 additions
and
4 deletions
+522
-4
bt5/erp5_web_project_ui/PathTemplateItem/web_page_module/project_gadget_erp5_appcache.xml
...lateItem/web_page_module/project_gadget_erp5_appcache.xml
+6
-4
bt5/erp5_web_project_ui/SkinTemplateItem/portal_skins/erp5_web_project/ProjectModule_viewProjectManagementList.xml
...5_web_project/ProjectModule_viewProjectManagementList.xml
+1
-0
bt5/erp5_web_project_ui/SkinTemplateItem/portal_skins/erp5_web_project/ProjectModule_viewProjectManagementList/my_front_page_gadget_field.xml
..._viewProjectManagementList/my_front_page_gadget_field.xml
+246
-0
bt5/erp5_web_project_ui/SkinTemplateItem/portal_skins/erp5_web_project/gadget_front_page_info.html.html
...l_skins/erp5_web_project/gadget_front_page_info.html.html
+20
-0
bt5/erp5_web_project_ui/SkinTemplateItem/portal_skins/erp5_web_project/gadget_front_page_info.html.xml
...al_skins/erp5_web_project/gadget_front_page_info.html.xml
+28
-0
bt5/erp5_web_project_ui/SkinTemplateItem/portal_skins/erp5_web_project/gadget_front_page_info.js.js
...ortal_skins/erp5_web_project/gadget_front_page_info.js.js
+193
-0
bt5/erp5_web_project_ui/SkinTemplateItem/portal_skins/erp5_web_project/gadget_front_page_info.js.xml
...rtal_skins/erp5_web_project/gadget_front_page_info.js.xml
+28
-0
No files found.
bt5/erp5_web_project_ui/PathTemplateItem/web_page_module/project_gadget_erp5_appcache.xml
View file @
ff5681e1
...
...
@@ -111,12 +111,14 @@ CACHE:\n
\n
gadget_erp5_page_project_controller.html\n
gadget_erp5_page_project_controller.js\n
gadget_project_info.html\n
gadget_project_info.js\n
gadget_erp5_page_project_redirector.html\n
gadget_erp5_page_project_redirector.js\n
gadget_erp5_project_panel.html\n
gadget_erp5_project_panel.js\n
gadget_front_page_info.html\n
gadget_front_page_info.js\n
gadget_project_info.html\n
gadget_project_info.js\n
\n
favicon.ico\n
font-awesome/font-awesome-webfont.eot\n
...
...
@@ -405,7 +407,7 @@ NETWORK:\n
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
9
79.50747.65222.58094
</string>
</value>
<value>
<string>
9
81.52234.40735.41557
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -423,7 +425,7 @@ NETWORK:\n
</tuple>
<state>
<tuple>
<float>
15
77216049.89
</float>
<float>
15
81523847.97
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_web_project_ui/SkinTemplateItem/portal_skins/erp5_web_project/ProjectModule_viewProjectManagementList.xml
View file @
ff5681e1
...
...
@@ -62,6 +62,7 @@
<key>
<string>
bottom
</string>
</key>
<value>
<list>
<string>
my_front_page_gadget_field
</string>
<string>
listbox
</string>
</list>
</value>
...
...
bt5/erp5_web_project_ui/SkinTemplateItem/portal_skins/erp5_web_project/ProjectModule_viewProjectManagementList/my_front_page_gadget_field.xml
0 → 100644
View file @
ff5681e1
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"GadgetField"
module=
"Products.ERP5Form.GadgetField"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
my_front_page_gadget_field
</string>
</value>
</item>
<item>
<key>
<string>
message_values
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
external_validator_failed
</string>
</key>
<value>
<string>
The input failed the external validator.
</string>
</value>
</item>
<item>
<key>
<string>
no_validator
</string>
</key>
<value>
<string>
Does not support this operation.
</string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
overrides
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
alternate_name
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
css_class
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
data_url
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
default
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
editable
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
enabled
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
external_validator
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
extra
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
gadget_url
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
hidden
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
js_sandbox
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
renderjs_extra
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
validator_field_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
validator_form_id
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
tales
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
alternate_name
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
css_class
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
data_url
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
default
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
editable
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
enabled
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
external_validator
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
extra
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
gadget_url
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
hidden
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
js_sandbox
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
renderjs_extra
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
validator_field_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
validator_form_id
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</value>
</item>
<item>
<key>
<string>
values
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
alternate_name
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
css_class
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
data_url
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
default
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
editable
</string>
</key>
<value>
<int>
1
</int>
</value>
</item>
<item>
<key>
<string>
enabled
</string>
</key>
<value>
<int>
1
</int>
</value>
</item>
<item>
<key>
<string>
external_validator
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
extra
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
gadget_url
</string>
</key>
<value>
<string>
gadget_front_page_info.html
</string>
</value>
</item>
<item>
<key>
<string>
hidden
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
js_sandbox
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
renderjs_extra
</string>
</key>
<value>
<list/>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
my_info_gadget_field
</string>
</value>
</item>
<item>
<key>
<string>
validator_field_id
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
validator_form_id
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_web_project_ui/SkinTemplateItem/portal_skins/erp5_web_project/gadget_front_page_info.html.html
0 → 100644
View file @
ff5681e1
<!DOCTYPE html>
<html>
<head>
<meta
charset=
"utf-8"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
>
<title>
Project front page gadget
</title>
<script
src=
"rsvp.js"
></script>
<script
src=
"renderjs.js"
></script>
<script
src=
"gadget_front_page_info.js"
></script>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"gadget_project_info.css"
>
</head>
<body>
<div>
<p>
</p>
</div>
</body>
</html>
bt5/erp5_web_project_ui/SkinTemplateItem/portal_skins/erp5_web_project/gadget_front_page_info.html.xml
0 → 100644
View file @
ff5681e1
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"File"
module=
"OFS.Image"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
__name__
</string>
</key>
<value>
<string>
gadget_front_page_info.html
</string>
</value>
</item>
<item>
<key>
<string>
content_type
</string>
</key>
<value>
<string>
text/html
</string>
</value>
</item>
<item>
<key>
<string>
precondition
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_web_project_ui/SkinTemplateItem/portal_skins/erp5_web_project/gadget_front_page_info.js.js
0 → 100644
View file @
ff5681e1
/*jslint nomen: true, indent: 2 */
/*global window, rJS, RSVP, document, ensureArray, DOMParser, XMLSerializer, SimpleQuery, ComplexQuery, Query*/
(
function
(
window
,
rJS
,
RSVP
,
document
,
ensureArray
,
DOMParser
,
XMLSerializer
,
SimpleQuery
,
ComplexQuery
,
Query
)
{
"
use strict
"
;
function
getProjectDict
(
gadget
)
{
var
query
,
i
,
milestone_query
,
non_milestone_query
,
aux_complex_query
,
aux_query_list
=
[],
query_list
=
[],
//TODO: test result will need a differet query because we only need the last test per project, no all
portal_type_list
=
[
"
Task
"
,
"
Bug
"
,
"
Task Report
"
,
"
Benchmark Result
"
],
valid_state_list
=
[
"
planned
"
,
"
ordered
"
,
"
confirmed
"
,
"
started
"
,
"
stopped
"
,
"
delivered
"
,
"
ready
"
,
"
failed
"
,
"
public_stopped
"
];
//validated project milestones
aux_query_list
.
push
(
new
SimpleQuery
({
key
:
"
parent__validation_state
"
,
operator
:
"
=
"
,
type
:
"
simple
"
,
value
:
"
validated
"
}));
aux_query_list
.
push
(
new
SimpleQuery
({
key
:
"
portal_type
"
,
operator
:
"
=
"
,
type
:
"
simple
"
,
value
:
"
Project Milestone
"
}));
milestone_query
=
new
ComplexQuery
({
operator
:
"
AND
"
,
query_list
:
aux_query_list
,
type
:
"
complex
"
});
//validated project tasks, bugs, etc
aux_query_list
=
[];
query_list
.
push
(
new
SimpleQuery
({
key
:
"
source_project__validation_state
"
,
operator
:
"
=
"
,
type
:
"
simple
"
,
value
:
"
validated
"
}));
//portal types
for
(
i
=
0
;
i
<
portal_type_list
.
length
;
i
+=
1
)
{
aux_query_list
.
push
(
new
SimpleQuery
({
key
:
"
portal_type
"
,
operator
:
"
=
"
,
type
:
"
simple
"
,
value
:
portal_type_list
[
i
]
}));
}
aux_complex_query
=
new
ComplexQuery
({
operator
:
"
OR
"
,
query_list
:
aux_query_list
,
type
:
"
complex
"
});
query_list
.
push
(
aux_complex_query
);
//states
aux_query_list
=
[];
//for tasks, bugs, reports, tests
for
(
i
=
0
;
i
<
valid_state_list
.
length
;
i
+=
1
)
{
aux_query_list
.
push
(
new
SimpleQuery
({
key
:
"
simulation_state
"
,
operator
:
"
=
"
,
type
:
"
simple
"
,
value
:
valid_state_list
[
i
]
}));
}
aux_complex_query
=
new
ComplexQuery
({
operator
:
"
OR
"
,
query_list
:
aux_query_list
,
type
:
"
complex
"
});
query_list
.
push
(
aux_complex_query
);
non_milestone_query
=
new
ComplexQuery
({
operator
:
"
AND
"
,
query_list
:
query_list
,
type
:
"
complex
"
});
// TODO: filter result by too old creation/end date? to reduce results
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
var
promise_list
=
[],
//TODO: review limit and fields
limit
=
[
0
,
1000
],
select_list
=
[
'
source_project
'
,
'
source_project_title
'
,
'
portal_type
'
,
'
stop_date
'
,
'
modification_date
'
,
'
simulation_state
'
];
// XXX: two separated queries because this query fails with not implemented error:
// ( parent__validation_state = "validated" OR source_project__validation_state = "validated" )
// TODO: do some research
promise_list
.
push
(
gadget
.
jio_allDocs
({
query
:
Query
.
objectToSearchText
(
milestone_query
),
limit
:
limit
,
select_list
:
select_list
,
sort_on
:
[[
"
modification_date
"
,
"
descending
"
]]
}));
promise_list
.
push
(
gadget
.
jio_allDocs
({
query
:
Query
.
objectToSearchText
(
non_milestone_query
),
limit
:
limit
,
select_list
:
select_list
,
sort_on
:
[[
"
modification_date
"
,
"
descending
"
]]
}));
return
RSVP
.
all
(
promise_list
);
})
.
push
(
function
(
result_list
)
{
var
element_list
=
result_list
[
0
].
data
.
rows
.
concat
(
result_list
[
1
].
data
.
rows
);
var
project_list_dict
=
{};
function
getProjectId
(
id
)
{
var
segments
=
id
.
split
(
"
/
"
);
if
(
segments
.
length
===
2
)
{
return
id
;
}
else
{
return
segments
.
slice
(
0
,
-
1
).
join
(
"
/
"
);
}
}
function
setStatus
(
item
)
{
//TODO check modification date and return item with status 0, 1 or 2 (green, orange, red)
//we need 2 limit dates that should be based on portal type (e.g. Milestones segmented by months, maybe Taks by weeks)
//where to set this limits dates? a manifest? site configuration?
item
.
status
=
0
;
//for quick testing purposes
if
(
item
.
id
===
"
project_module/1/7
"
)
{
item
.
status
=
2
;
}
if
(
item
.
id
===
"
project_module/1/6
"
)
{
item
.
status
=
1
;
}
//for test results, check validation state (0 = pass, 2 = fail)
return
item
;
}
for
(
i
=
0
;
i
<
element_list
.
length
;
i
+=
1
)
{
var
item
=
setStatus
(
element_list
[
i
]),
status_ok
=
((
item
.
status
>
0
)
?
0
:
1
),
project_id
=
((
item
.
value
.
source_project
)
?
getProjectId
(
item
.
value
.
source_project
)
:
getProjectId
(
item
.
id
));
if
(
project_id
in
project_list_dict
)
{
if
(
item
.
value
.
portal_type
in
project_list_dict
[
project_id
])
{
var
project_row
=
project_list_dict
[
project_id
][
item
.
value
.
portal_type
];
if
(
status_ok
)
{
project_row
.
ok_count
++
;
}
else
{
project_row
.
out_count
++
;
if
(
project_row
.
status
<
item
.
status
)
{
project_row
.
status
=
item
.
status
;
}
}
project_row
.
list
.
push
(
item
);
}
else
{
project_list_dict
[
project_id
][
item
.
value
.
portal_type
]
=
{
"
status
"
:
item
.
status
,
"
ok_count
"
:
0
+
status_ok
,
"
out_count
"
:
0
+
!
status_ok
,
"
list
"
:
[
item
]
};
}
}
else
{
project_list_dict
[
project_id
]
=
{};
project_list_dict
[
project_id
][
item
.
value
.
portal_type
]
=
{
"
status
"
:
item
.
status
,
"
ok_count
"
:
0
+
status_ok
,
"
out_count
"
:
0
+
!
status_ok
,
"
list
"
:
[
item
]
};
}
}
return
project_list_dict
;
});
}
rJS
(
window
)
.
declareAcquiredMethod
(
"
getUrlForList
"
,
"
getUrlForList
"
)
.
declareAcquiredMethod
(
"
getUrlFor
"
,
"
getUrlFor
"
)
.
declareAcquiredMethod
(
"
jio_allDocs
"
,
"
jio_allDocs
"
)
.
declareAcquiredMethod
(
"
jio_getAttachment
"
,
"
jio_getAttachment
"
)
.
declareAcquiredMethod
(
"
getSetting
"
,
"
getSetting
"
)
.
declareMethod
(
'
render
'
,
function
(
options
)
{
return
this
.
changeState
(
options
);
})
.
onStateChange
(
function
(
modification_dict
)
{
var
gadget
=
this
;
return
getProjectDict
(
gadget
)
.
push
(
function
(
project_dict
)
{
console
.
log
(
project_dict
);
});
})
.
declareMethod
(
'
getContent
'
,
function
()
{
return
{};
})
.
declareMethod
(
'
checkValidity
'
,
function
()
{
return
true
;
});
}(
window
,
rJS
,
RSVP
,
document
,
ensureArray
,
DOMParser
,
XMLSerializer
,
SimpleQuery
,
ComplexQuery
,
Query
));
\ No newline at end of file
bt5/erp5_web_project_ui/SkinTemplateItem/portal_skins/erp5_web_project/gadget_front_page_info.js.xml
0 → 100644
View file @
ff5681e1
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"File"
module=
"OFS.Image"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
__name__
</string>
</key>
<value>
<string>
gadget_front_page_info.js
</string>
</value>
</item>
<item>
<key>
<string>
content_type
</string>
</key>
<value>
<string>
application/javascript
</string>
</value>
</item>
<item>
<key>
<string>
precondition
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string></string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
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