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
0
Issues
0
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
Frederic Thoma
erp5
Commits
8d3c403e
Commit
8d3c403e
authored
Aug 25, 2021
by
Gabriel Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_web_renderjs_ui: improve code to every change in select, display the graphic related to it
parent
a198b99c
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
65 additions
and
73 deletions
+65
-73
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_listbox_html.html
...ateItem/web_page_module/rjs_gadget_erp5_listbox_html.html
+2
-2
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_listbox_html.xml
...lateItem/web_page_module/rjs_gadget_erp5_listbox_html.xml
+2
-2
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_listbox_js.js
...emplateItem/web_page_module/rjs_gadget_erp5_listbox_js.js
+44
-56
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_listbox_js.xml
...mplateItem/web_page_module/rjs_gadget_erp5_listbox_js.xml
+2
-2
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_graphic_html.html
...TemplateItem/web_page_module/rjs_gadget_graphic_html.html
+0
-3
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_graphic_html.xml
...hTemplateItem/web_page_module/rjs_gadget_graphic_html.xml
+2
-2
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_graphic_js.js
...PathTemplateItem/web_page_module/rjs_gadget_graphic_js.js
+11
-4
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_graphic_js.xml
...athTemplateItem/web_page_module/rjs_gadget_graphic_js.xml
+2
-2
No files found.
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_listbox_html.html
View file @
8d3c403e
...
@@ -34,7 +34,7 @@
...
@@ -34,7 +34,7 @@
</head>
</head>
<body>
<body>
<div
class=
"
document_table"
>
<div
class=
"
graphic_section"
></div
>
</div>
<
div
class=
"document_table"
><
/div>
</body>
</body>
</html>
</html>
\ No newline at end of file
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_listbox_html.xml
View file @
8d3c403e
...
@@ -238,7 +238,7 @@
...
@@ -238,7 +238,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
99
3.55171.44758.6877
</string>
</value>
<value>
<string>
99
4.9738.18277.17732
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -256,7 +256,7 @@
...
@@ -256,7 +256,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
162
8545474.29
</float>
<float>
162
9923258.92
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_listbox_js.js
View file @
8d3c403e
...
@@ -1182,49 +1182,54 @@
...
@@ -1182,49 +1182,54 @@
})
})
);
);
}
}
gadget
.
element
.
insertBefore
(
domsugar
(
gadget
.
element
.
querySelector
(
"
.graphic_section
"
),
[
domsugar
(
"
select
"
,
sub_element_list
),
domsugar
(
"
select
"
,
sub_element_list
),
gadget
.
element
.
firstChild
domsugar
(
"
div
"
,
{
"
class
"
:
"
graphic_area
"
})
);
]
);
});
});
});
});
}
else
if
(
modification_dict
.
hasOwnProperty
(
"
graphic_type
"
)
&&
}
else
if
(
modification_dict
.
hasOwnProperty
(
"
graphic_type
"
)
&&
modification_dict
.
graphic_type
!==
""
)
{
modification_dict
.
graphic_type
!==
""
)
{
return
result_queue
return
result_queue
.
push
(
function
()
{
.
push
(
function
()
{
var
div
=
domsugar
(
"
div
"
,
{
"
class
"
:
"
graphic-section
"
}),
return
gadget
.
declareGadget
(
'
gadget_graphic.html
'
,
{
gadget_list
=
[],
domain_list
=
JSON
.
parse
(
gadget
.
state
.
domain_list_json
);
gadget
.
element
.
insertBefore
(
div
,
gadget
.
element
.
firstChild
);
gadget_list
.
push
(
gadget
.
declareGadget
(
'
gadget_graphic.html
'
,
{
scope
:
'
gadget_graphic
'
,
scope
:
'
gadget_graphic
'
,
element
:
div
element
:
gadget
.
element
.
querySelector
(
"
.graphic_area
"
)
})
);
for
(
i
=
0
;
i
<
domain_list
.
length
;
i
+=
1
)
{
div
=
domsugar
(
"
div
"
,
{
"
class
"
:
"
graphic-section
"
+
domain_list
[
i
][
0
]
});
});
gadget
.
element
.
insertBefore
(
div
,
gadget
.
element
.
firstChild
);
gadget_list
.
push
(
gadget
.
declareGadget
(
'
gadget_graphic.html
'
,
{
scope
:
'
gadget_graphic_
'
+
domain_list
[
i
][
0
],
element
:
div
})
);
}
return
RSVP
.
all
(
gadget_list
);
})
})
.
push
(
function
(
gadget_list
)
{
.
push
(
function
(
graphic_gadget
)
{
var
default_param_list
=
JSON
.
parse
(
gadget
.
state
.
column_list_json
),
var
group_by
,
group_by_title
,
column_list_json
=
JSON
.
parse
(
gadget
.
state
.
column_list_json
),
domain_dict
=
JSON
.
parse
(
gadget
.
state
.
domain_dict_json
),
domain_dict
=
JSON
.
parse
(
gadget
.
state
.
domain_dict_json
),
domain_list
=
[],
domain_list
=
[],
queue_list
=
[],
group_by
,
group_by_title
,
domain_id
,
domain_id
,
domain
;
domain
;
for
(
i
=
0
;
i
<
column_list_json
.
length
;
i
+=
1
)
{
if
(
column_list_json
[
i
][
0
]
===
modification_dict
.
graphic_type
)
{
group_by
=
column_list_json
[
i
][
0
];
group_by_title
=
column_list_json
[
i
][
1
];
return
graphic_gadget
.
render
({
group_by
:
group_by
,
query_by
:
{},
title
:
group_by_title
,
list_method_template
:
gadget
.
state
.
list_method_template
,
list_method
:
gadget
.
state
.
list_method
,
layout
:
{
x
:
{
"
title
"
:
group_by_title
,
"
key
"
:
group_by
},
y
:
{
"
title
"
:
"
Quantity
"
}
}
});
}
}
for
(
domain_id
in
domain_dict
)
{
for
(
domain_id
in
domain_dict
)
{
if
(
domain_dict
.
hasOwnProperty
(
domain_id
))
{
if
(
domain_dict
.
hasOwnProperty
(
domain_id
))
{
domain
=
{
domain
=
{
...
@@ -1239,31 +1244,15 @@
...
@@ -1239,31 +1244,15 @@
domain_list
.
push
(
domain
);
domain_list
.
push
(
domain
);
}
}
}
}
for
(
i
=
0
;
i
<
default_param_list
.
length
;
i
+=
1
)
{
for
(
i
=
0
;
i
<
column_list_json
.
length
;
i
+=
1
)
{
if
(
default_param_list
[
i
][
0
].
indexOf
(
"
_state
"
)
!==
-
1
)
{
if
(
column_list_json
[
i
][
0
].
indexOf
(
"
_state
"
)
!==
-
1
)
{
group_by
=
default_param_list
[
i
][
0
];
group_by
=
column_list_json
[
i
][
0
];
group_by_title
=
default_param_list
[
i
][
1
];
group_by_title
=
column_list_json
[
i
][
1
];
}
}
}
}
if
(
gadget_list
)
{
queue_list
.
push
(
gadget_list
[
0
].
render
({
group_by
:
group_by
,
query_by
:
{},
title
:
gadget
.
state
.
title
,
list_method_template
:
gadget
.
state
.
list_method_template
,
list_method
:
gadget
.
state
.
list_method
,
layout
:
{
x
:
{
"
title
"
:
group_by_title
,
"
key
"
:
group_by
},
y
:
{
"
title
"
:
"
Quantity
"
}
}
}));
for
(
i
=
0
;
i
<
domain_list
.
length
;
i
+=
1
)
{
for
(
i
=
0
;
i
<
domain_list
.
length
;
i
+=
1
)
{
queue_list
.
push
(
gadget_list
[
i
+
1
].
render
({
if
(
domain_list
[
i
].
domain_id
===
modification_dict
.
graphic_type
)
{
return
graphic_gadget
.
render
({
group_by
:
group_by
,
group_by
:
group_by
,
query_by
:
{},
query_by
:
{},
title
:
gadget
.
state
.
title
,
title
:
gadget
.
state
.
title
,
...
@@ -1281,9 +1270,8 @@
...
@@ -1281,9 +1270,8 @@
"
title
"
:
"
Quantity
"
"
title
"
:
"
Quantity
"
}
}
}
}
})
)
;
});
}
}
return
RSVP
.
all
(
queue_list
);
}
}
});
});
}
}
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_listbox_js.xml
View file @
8d3c403e
...
@@ -240,7 +240,7 @@
...
@@ -240,7 +240,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
994.2
1596.49508.22784
</string>
</value>
<value>
<string>
994.2
2782.45811.61201
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -258,7 +258,7 @@
...
@@ -258,7 +258,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
1629
853271.2
4
</float>
<float>
1629
924514.4
4
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_graphic_html.html
View file @
8d3c403e
...
@@ -24,8 +24,5 @@
...
@@ -24,8 +24,5 @@
<div
class=
"wrap"
></div>
<div
class=
"wrap"
></div>
</div>
</div>
</div>
</div>
<!--div class="bottom">
<input type="submit" class="ui-disabled" data-i18n="[value]Reset Filter" value="Reset Filter" disabled />
</div-->
</body>
</body>
</html>
</html>
\ No newline at end of file
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_graphic_html.xml
View file @
8d3c403e
...
@@ -244,7 +244,7 @@
...
@@ -244,7 +244,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
994.1
231.55372.30208
</string>
</value>
<value>
<string>
994.1
5023.5523.52002
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -262,7 +262,7 @@
...
@@ -262,7 +262,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
162
8710935.39
</float>
<float>
162
9926033.28
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_graphic_js.js
View file @
8d3c403e
/*global document, window, Option, rJS, RSVP, console, Array, SimpleQuery, Query,
/*global document, window, Option, rJS, RSVP, console, Array, SimpleQuery, Query,
ComplexQuery, loopEventListener */
ComplexQuery, loopEventListener
, domsugar
*/
/*jslint nomen: true, indent: 2, maxerr: 3 */
/*jslint nomen: true, indent: 2, maxerr: 3 */
(
function
(
window
,
rJS
,
RSVP
,
Array
,
SimpleQuery
,
Query
,
ComplexQuery
,
(
function
(
window
,
rJS
,
RSVP
,
Array
,
SimpleQuery
,
Query
,
ComplexQuery
,
loopEventListener
)
{
loopEventListener
,
domsugar
)
{
"
use strict
"
;
"
use strict
"
;
var
color_list
=
[
"
#CCA08D
"
,
"
#58ADC4
"
,
"
#F9B39B
"
,
"
#B75937
"
,
var
color_list
=
[
"
#CCA08D
"
,
"
#58ADC4
"
,
"
#F9B39B
"
,
"
#B75937
"
,
...
@@ -257,6 +257,7 @@
...
@@ -257,6 +257,7 @@
}
}
return
new
RSVP
.
Queue
(
RSVP
.
all
(
queue_list
))
return
new
RSVP
.
Queue
(
RSVP
.
all
(
queue_list
))
.
push
(
function
(
result_list
)
{
.
push
(
function
(
result_list
)
{
console
.
log
(
result_list
);
var
bar_chart
=
gadget
.
element
.
querySelector
(
"
.wrap
"
),
var
bar_chart
=
gadget
.
element
.
querySelector
(
"
.wrap
"
),
loader
=
gadget
.
element
.
querySelector
(
"
.graph-spinner
"
),
loader
=
gadget
.
element
.
querySelector
(
"
.graph-spinner
"
),
graph_gadget
=
result_list
[
0
],
graph_gadget
=
result_list
[
0
],
...
@@ -375,7 +376,13 @@
...
@@ -375,7 +376,13 @@
});
});
}
}
}
}
console
.
log
(
data_list
);
if
(
data_list
.
length
===
0
)
{
console
.
log
(
"
I am here
"
);
return
domsugar
(
gadget
.
element
,
[
domsugar
(
"
p
"
,
{
"
text
"
:
"
No data
"
})
]);
}
console
.
log
(
data_list
,
data_list
.
length
);
return
graph_gadget
.
render
({
return
graph_gadget
.
render
({
value
:
{
value
:
{
data
:
data_list
,
data
:
data_list
,
...
@@ -395,4 +402,4 @@
...
@@ -395,4 +402,4 @@
});
});
}(
window
,
rJS
,
RSVP
,
Array
,
SimpleQuery
,
Query
,
ComplexQuery
,
}(
window
,
rJS
,
RSVP
,
Array
,
SimpleQuery
,
Query
,
ComplexQuery
,
rJS
.
loopEventListener
));
rJS
.
loopEventListener
,
domsugar
));
\ No newline at end of file
\ No newline at end of file
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_graphic_js.xml
View file @
8d3c403e
...
@@ -246,7 +246,7 @@
...
@@ -246,7 +246,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
994.
4064.4979.38536
</string>
</value>
<value>
<string>
994.
22799.44674.238
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -264,7 +264,7 @@
...
@@ -264,7 +264,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
162
8808066.07
</float>
<float>
162
9926042.93
</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