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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Tristan Cavelier
erp5
Commits
fd0281c5
Commit
fd0281c5
authored
Jun 13, 2019
by
Romain Courteaud
Committed by
Tristan Cavelier
Jul 29, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[erp5_web_renderjs_ui] Revert partially
It seems the commit reimplement a kind of adhoc changeState
parent
2b53b9a0
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
67 deletions
+4
-67
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_form_js.js
...plateItem/web_page_module/rjs_gadget_erp5_page_form_js.js
+2
-59
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_html5_input_js.js
...TemplateItem/web_page_module/rjs_gadget_html5_input_js.js
+0
-6
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_html5_input_js.xml
...emplateItem/web_page_module/rjs_gadget_html5_input_js.xml
+2
-2
No files found.
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_form_js.js
View file @
fd0281c5
...
...
@@ -92,35 +92,6 @@ and handling data send&receive.
}
}
function
ensureComparable
(
value
,
field_type
)
{
// For LinesField, getContent returns string, but we may give an array of strings to the render method.
if
(
field_type
===
"
LinesField
"
)
{
return
value
.
join
?
value
.
join
(
"
\n
"
)
:
value
;
}
if
(
typeof
value
===
"
object
"
)
{
return
JSON
.
stringify
(
value
);
}
return
value
;
}
function
updateErp5DocumentForAfterSave
(
new_erp5_document
,
submitted_content
,
current_content
)
{
var
view
=
new_erp5_document
.
_embedded
.
_view
,
content_key_list
=
Object
.
keys
(
current_content
),
document_reference_dict
=
{},
document_key_list
=
Object
.
keys
(
view
),
i
=
0
,
field
=
null
,
key
=
""
;
for
(
i
=
0
;
i
<
document_key_list
.
length
;
i
+=
1
)
{
field
=
view
[
document_key_list
[
i
]];
document_reference_dict
[
field
.
key
]
=
field
;
}
for
(
i
=
0
;
i
<
content_key_list
.
length
;
i
+=
1
)
{
key
=
content_key_list
[
i
];
if
(
document_reference_dict
[
key
]
&&
ensureComparable
(
submitted_content
[
key
],
document_reference_dict
[
key
].
type
)
===
ensureComparable
(
document_reference_dict
[
key
].
default
,
document_reference_dict
[
key
].
type
))
{
document_reference_dict
[
key
].
default
=
current_content
[
key
];
}
}
}
function
warmupGadgetList
(
gadget
,
url_list
)
{
var
i
;
for
(
i
=
0
;
i
<
url_list
.
length
;
i
+=
1
)
{
...
...
@@ -192,10 +163,6 @@ and handling data send&receive.
.
allowPublicAcquisition
(
'
notifySubmit
'
,
function
notifySubmit
()
{
return
this
.
triggerSubmit
();
})
.
allowPublicAcquisition
(
"
notifyChange
"
,
function
notifyChange
(
argument_list
)
{
this
.
state
.
changing
=
true
;
return
this
.
notifyChange
.
apply
(
this
,
argument_list
);
})
/**
* Render obtain ERP5 Document and assigned Form Definition.
*
...
...
@@ -319,8 +286,7 @@ and handling data send&receive.
.
push
(
function
(
result
)
{
page_template_gadget
=
result
;
var
sub_options
=
options
.
fg
||
{},
sub_queue
=
null
;
var
sub_options
=
options
.
fg
||
{};
loadFormContent
(
gadget
,
erp5_document
.
_embedded
.
_view
);
...
...
@@ -331,23 +297,7 @@ and handling data send&receive.
sub_options
.
jio_key
=
options
.
jio_key
;
// jIO identifier of currently rendered ERP5 document
sub_options
.
editable
=
options
.
editable
;
// form decides on editability of its fields
if
(
gadget
.
state
.
changing
&&
gadget
.
state
.
last_submitted_content
)
{
sub_queue
=
page_template_gadget
.
getContent
()
.
push
(
function
(
content
)
{
updateErp5DocumentForAfterSave
(
sub_options
.
erp5_document
,
JSON
.
parse
(
gadget
.
state
.
last_submitted_content
),
content
);
gadget
.
state
.
last_submitted_content
=
null
;
// free some memory
gadget
.
state
.
changing
=
false
;
});
}
return
(
sub_queue
||
new
RSVP
.
Queue
())
.
push
(
function
()
{
return
page_template_gadget
.
render
(
sub_options
);
});
})
.
push
(
function
()
{
if
(
modification_dict
.
hasOwnProperty
(
'
url
'
))
{
...
...
@@ -408,13 +358,6 @@ and handling data send&receive.
return
gadget
.
notifySubmitting
()
.
push
(
function
()
{
return
gadget
.
getDeclaredGadget
(
"
fg
"
);
})
.
push
(
function
(
sub_gadget
)
{
return
sub_gadget
.
getContent
();
})
.
push
(
function
(
content
)
{
gadget
.
state
.
last_submitted_content
=
JSON
.
stringify
(
content
);
return
gadget
.
jio_putAttachment
(
jio_key
,
target_url
,
content_dict
);
})
.
push
(
function
(
attachment
)
{
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_html5_input_js.js
View file @
fd0281c5
...
...
@@ -210,12 +210,6 @@
.
declareAcquiredMethod
(
"
notifyChange
"
,
"
notifyChange
"
)
.
onEvent
(
'
change
'
,
function
change
()
{
var
input
=
this
.
element
.
querySelector
(
"
input
"
);
if
(
input
)
{
// force the state to have the current edited value
this
.
state
.
checked
=
input
.
checked
;
this
.
state
.
value
=
input
.
value
;
}
return
RSVP
.
all
([
this
.
checkValidity
(),
this
.
notifyChange
(
"
change
"
)
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_html5_input_js.xml
View file @
fd0281c5
...
...
@@ -228,7 +228,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
9
75.45053.32644.40618
</string>
</value>
<value>
<string>
9
67.40700.16743.2833
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -246,7 +246,7 @@
</tuple>
<state>
<tuple>
<float>
15
57839422.8
</float>
<float>
15
26653024.9
</float>
<string>
UTC
</string>
</tuple>
</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