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
c31922d1
Commit
c31922d1
authored
Dec 29, 2021
by
Gabriel Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_web_renderjs_ui: set graphic type in the URL and render it automatically if exists
parent
6ba5182d
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
169 additions
and
149 deletions
+169
-149
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
+158
-143
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_js.js
...PathTemplateItem/web_page_module/rjs_gadget_graphic_js.js
+7
-2
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_js.js
View file @
c31922d1
...
@@ -520,7 +520,8 @@
...
@@ -520,7 +520,8 @@
}
}
}
}
}
}
return
gadget
.
getUrlParameter
(
"
graphic_type
"
)
.
push
(
function
(
graphic_type
)
{
return
gadget
.
changeState
({
return
gadget
.
changeState
({
key
:
field_json
.
key
,
key
:
field_json
.
key
,
title
:
field_json
.
title
,
title
:
field_json
.
title
,
...
@@ -568,13 +569,17 @@
...
@@ -568,13 +569,17 @@
// Force line calculation in any case
// Force line calculation in any case
render_timestamp
:
new
Date
().
getTime
(),
render_timestamp
:
new
Date
().
getTime
(),
allDocs_result
:
undefined
,
allDocs_result
:
undefined
,
default_value
:
field_json
.
default
,
default_value
:
field_json
[
"
default
"
]
,
// No error message
// No error message
has_error
:
false
,
has_error
:
false
,
show_line_selector
:
false
,
show_line_selector
:
false
,
show_select_action
:
false
,
show_select_action
:
false
,
show_clipboard_action
:
false
show_clipboard_action
:
false
,
// graphic
graphic_type
:
graphic_type
});
});
});
});
});
return
queue
;
return
queue
;
...
@@ -1186,14 +1191,16 @@
...
@@ -1186,14 +1191,16 @@
);
);
}
}
domsugar
(
gadget
.
element
.
querySelector
(
"
.graphic_section
"
),
[
domsugar
(
gadget
.
element
.
querySelector
(
"
.graphic_section
"
),
[
domsugar
(
"
select
"
,
sub_element_list
),
domsugar
(
"
select
"
,
{
"
name
"
:
"
GraphicSelect
"
,
"
value
"
:
gadget
.
state
.
graphic_type
},
sub_element_list
),
domsugar
(
"
div
"
,
{
"
class
"
:
"
graphic_area
"
})
domsugar
(
"
div
"
,
{
"
class
"
:
"
graphic_area
"
})
]);
]);
});
});
});
});
}
else
if
(
modification_dict
.
hasOwnProperty
(
"
graphic_type
"
)
&&
if
(
gadget
.
state
.
graphic_type
&&
gadget
.
state
.
graphic_type
!==
""
)
{
modification_dict
.
graphic_type
!==
""
)
{
result_queue
return
result_queue
.
push
(
function
()
{
.
push
(
function
()
{
return
gadget
.
declareGadget
(
'
gadget_graphic.html
'
,
{
return
gadget
.
declareGadget
(
'
gadget_graphic.html
'
,
{
scope
:
'
gadget_graphic
'
,
scope
:
'
gadget_graphic
'
,
...
@@ -1210,7 +1217,7 @@
...
@@ -1210,7 +1217,7 @@
domain
;
domain
;
for
(
i
=
0
;
i
<
column_list_json
.
length
;
i
+=
1
)
{
for
(
i
=
0
;
i
<
column_list_json
.
length
;
i
+=
1
)
{
if
(
column_list_json
[
i
][
0
]
===
modification_dict
.
graphic_type
)
{
if
(
column_list_json
[
i
][
0
]
===
gadget
.
state
.
graphic_type
)
{
group_by
=
column_list_json
[
i
][
0
];
group_by
=
column_list_json
[
i
][
0
];
group_by_title
=
column_list_json
[
i
][
1
];
group_by_title
=
column_list_json
[
i
][
1
];
return
graphic_gadget
.
render
({
return
graphic_gadget
.
render
({
...
@@ -1231,7 +1238,6 @@
...
@@ -1231,7 +1238,6 @@
});
});
}
}
}
}
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
=
{
...
@@ -1253,7 +1259,7 @@
...
@@ -1253,7 +1259,7 @@
}
}
}
}
for
(
i
=
0
;
i
<
domain_list
.
length
;
i
+=
1
)
{
for
(
i
=
0
;
i
<
domain_list
.
length
;
i
+=
1
)
{
if
(
domain_list
[
i
].
domain_id
===
modification_dict
.
graphic_type
)
{
if
(
domain_list
[
i
].
domain_id
===
gadget
.
state
.
graphic_type
)
{
return
graphic_gadget
.
render
({
return
graphic_gadget
.
render
({
group_by
:
group_by
,
group_by
:
group_by
,
query_by
:
{},
query_by
:
{},
...
@@ -1277,6 +1283,7 @@
...
@@ -1277,6 +1283,7 @@
}
}
});
});
}
}
}
return
result_queue
;
return
result_queue
;
})
})
...
@@ -1458,6 +1465,21 @@
...
@@ -1458,6 +1465,21 @@
return
result
;
return
result
;
});
});
},
{
mutex
:
'
changestate
'
})
},
{
mutex
:
'
changestate
'
})
.
onEvent
(
'
change
'
,
function
change
(
evt
)
{
var
gadget
=
this
,
graphic_select
=
gadget
.
element
.
querySelector
(
'
select[name="GraphicSelect"]
'
);
if
(
evt
.
target
==
graphic_select
)
{
return
gadget
.
redirect
({
command
:
'
change
'
,
options
:
{
graphic_type
:
evt
.
target
.
value
}
});
}
})
.
onEvent
(
'
click
'
,
function
click
(
evt
)
{
.
onEvent
(
'
click
'
,
function
click
(
evt
)
{
// For some reason, Zelenium can click even if button has the disabled
// For some reason, Zelenium can click even if button has the disabled
// attribute. So, it is needed for now to manually checks
// attribute. So, it is needed for now to manually checks
...
@@ -1521,13 +1543,6 @@
...
@@ -1521,13 +1543,6 @@
});
});
}
}
if
(
evt
.
target
.
type
===
"
select-one
"
)
{
// XXX Move it to onEvent > "change" probably
return
gadget
.
changeState
({
"
graphic_type
"
:
evt
.
target
.
value
});
}
if
((
evt
.
target
.
type
===
'
button
'
)
&&
if
((
evt
.
target
.
type
===
'
button
'
)
&&
((
evt
.
target
.
name
===
'
SelectAction
'
)
||
(
evt
.
target
.
name
===
'
ClipboardAction
'
)))
{
((
evt
.
target
.
name
===
'
SelectAction
'
)
||
(
evt
.
target
.
name
===
'
ClipboardAction
'
)))
{
evt
.
preventDefault
();
evt
.
preventDefault
();
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_listbox_js.xml
View file @
c31922d1
...
@@ -240,7 +240,7 @@
...
@@ -240,7 +240,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
99
4.25329.16170.62481
</string>
</value>
<value>
<string>
99
7.9256.52516.32426
</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>
16
30077204.4
</float>
<float>
16
40736604.19
</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 @
c31922d1
...
@@ -179,8 +179,13 @@
...
@@ -179,8 +179,13 @@
"
select_list
"
:
select_list
"
select_list
"
:
select_list
};
};
}
}
return
gadget
.
getUrlParameter
(
'
extended_search
'
)
return
new
RSVP
.
Queue
(
RSVP
.
all
([
.
push
(
function
(
extended_search
)
{
gadget
.
getUrlParameter
(
'
extended_search
'
),
gadget
.
getUrlParameter
(
'
graphic_select_id
'
)
]))
.
push
(
function
(
result_list
)
{
var
extended_search
=
result_list
[
0
],
graphic_select_id
=
result_list
[
1
];
if
(
extended_search
)
{
if
(
extended_search
)
{
jio_query_list
.
push
(
Query
.
parseStringToObject
(
extended_search
));
jio_query_list
.
push
(
Query
.
parseStringToObject
(
extended_search
));
}
}
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_graphic_js.xml
View file @
c31922d1
...
@@ -246,7 +246,7 @@
...
@@ -246,7 +246,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
997.
7486.55612.53862
</string>
</value>
<value>
<string>
997.
9171.49361.29986
</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>
1640
630356.79
</float>
<float>
1640
731509.5
</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