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
Paul Graydon
erp5
Commits
62863ce9
Commit
62863ce9
authored
Dec 27, 2017
by
Tomáš Peterka
Committed by
Tomáš Peterka
Dec 27, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[renderjs_ui] Datetime field puts date in ISO format into non-editable field
/reviewed-on
nexedi/erp5!538
parent
696e7ea7
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
34 additions
and
71 deletions
+34
-71
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_datetimefield_js.js
...eItem/web_page_module/rjs_gadget_erp5_datetimefield_js.js
+5
-0
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_datetimefield_js.xml
...Item/web_page_module/rjs_gadget_erp5_datetimefield_js.xml
+3
-3
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_html5_element_js.js
...mplateItem/web_page_module/rjs_gadget_html5_element_js.js
+17
-2
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_html5_element_js.xml
...plateItem/web_page_module/rjs_gadget_html5_element_js.xml
+3
-66
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_date_time_field_zuite/testSetDateTimeZone.zpt
...renderjs_ui_date_time_field_zuite/testSetDateTimeZone.zpt
+6
-0
No files found.
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_datetimefield_js.js
View file @
62863ce9
...
...
@@ -247,6 +247,11 @@
}
}
p_state
.
text_content
=
text_content
;
// for noneditable element, attach data-date attribute in ISO format
// so we can use it in tests
p_state
.
data
=
{
'
date
'
:
input_state
.
value
};
return
gadget_list
[
0
].
render
(
p_state
);
});
}
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_datetimefield_js.xml
View file @
62863ce9
...
...
@@ -179,7 +179,7 @@
</tuple>
<state>
<tuple>
<float>
1
465381409.4
1
</float>
<float>
1
514233879.3
1
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
@@ -224,7 +224,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
964.
14294.33061.3324
5
</string>
</value>
<value>
<string>
964.
26946.11355.1160
5
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -242,7 +242,7 @@
</tuple>
<state>
<tuple>
<float>
151
3610328.86
</float>
<float>
151
4370341.04
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_html5_element_js.js
View file @
62863ce9
...
...
@@ -26,13 +26,20 @@
append
:
options
.
append
||
''
,
prepend
:
options
.
prepend
||
''
};
// data are dictionary thus include it only when defined so it appears
// in modification_dict only when necessary
// keys are expected to be camelCase
if
(
options
.
data
!==
undefined
)
{
state_dict
.
data
=
JSON
.
stringify
(
options
.
data
);
}
return
this
.
changeState
(
state_dict
);
})
.
onStateChange
(
function
()
{
.
onStateChange
(
function
(
modification_dict
)
{
var
element
=
this
.
element
,
new_element
=
document
.
createElement
(
this
.
state
.
tag
),
content
=
this
.
state
.
text_content
;
content
=
this
.
state
.
text_content
,
data
,
data_attr
;
if
(
this
.
state
.
text_content
)
{
if
(
this
.
state
.
prepend
)
{
...
...
@@ -51,6 +58,14 @@
if
(
this
.
state
.
alt
)
{
new_element
.
setAttribute
(
'
alt
'
,
this
.
state
.
alt
);
}
if
(
modification_dict
.
hasOwnProperty
(
"
data
"
))
{
data
=
JSON
.
parse
(
modification_dict
.
data
);
for
(
data_attr
in
data
)
{
if
(
data
.
hasOwnProperty
(
data_attr
))
{
new_element
.
dataset
[
data_attr
]
=
data
[
data_attr
];
}
}
}
// Clear first to DOM, append after to reduce flickering/manip
while
(
element
.
firstChild
)
{
element
.
removeChild
(
element
.
firstChild
);
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_html5_element_js.xml
View file @
62863ce9
...
...
@@ -136,12 +136,6 @@
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAQ=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
processing_status_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAU=
</string>
</persistent>
</value>
</item>
</dictionary>
</value>
</item>
...
...
@@ -185,7 +179,7 @@
</tuple>
<state>
<tuple>
<float>
1
474443135.5
7
</float>
<float>
1
514233719.2
7
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
@@ -230,7 +224,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
96
1.46335.40182.23005
</string>
</value>
<value>
<string>
96
4.27113.53962.34457
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -248,64 +242,7 @@
</tuple>
<state>
<tuple>
<float>
1503909097.14
</float>
<string>
UTC
</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
<record
id=
"5"
aka=
"AAAAAAAAAAU="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.patches.WorkflowTool"
/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
detect_converted_file
</string>
</value>
</item>
<item>
<key>
<string>
actor
</string>
</key>
<value>
<string>
zope
</string>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
error_message
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
external_processing_state
</string>
</key>
<value>
<string>
converted
</string>
</value>
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
0.0.0.0
</string>
</value>
</item>
<item>
<key>
<string>
time
</string>
</key>
<value>
<object>
<klass>
<global
name=
"DateTime"
module=
"DateTime.DateTime"
/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>
1474442686.66
</float>
<float>
1514379841.99
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_web_renderjs_ui_test/PathTemplateItem/portal_tests/renderjs_ui_date_time_field_zuite/testSetDateTimeZone.zpt
View file @
62863ce9
...
...
@@ -81,6 +81,12 @@
<td></td>
</tr>
<tr>
<td>
assertElementPresent
</td>
<td>
//div[@data-gadget-scope='field_my_start_date']//div[@data-gadget-scope='field']//p[@data-date='2015-12-21T11:00:00']
</td>
<td></td>
</tr>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/toggle_editable_mode"
/>
<tal:block
metal:use-macro=
"here/Zuite_CommonTemplateForRenderjsUi/macros/wait_for_content_loaded"
/>
...
...
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