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
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Romain Courteaud
erp5
Commits
e17ea712
Commit
e17ea712
authored
Jun 13, 2019
by
Romain Courteaud
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
cb19dfe9
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
69 deletions
+6
-69
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_erp5_page_form_js.xml
...lateItem/web_page_module/rjs_gadget_erp5_page_form_js.xml
+2
-2
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 @
e17ea712
...
@@ -92,35 +92,6 @@ and handling data send&receive.
...
@@ -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
)
{
function
warmupGadgetList
(
gadget
,
url_list
)
{
var
i
;
var
i
;
for
(
i
=
0
;
i
<
url_list
.
length
;
i
+=
1
)
{
for
(
i
=
0
;
i
<
url_list
.
length
;
i
+=
1
)
{
...
@@ -192,10 +163,6 @@ and handling data send&receive.
...
@@ -192,10 +163,6 @@ and handling data send&receive.
.
allowPublicAcquisition
(
'
notifySubmit
'
,
function
notifySubmit
()
{
.
allowPublicAcquisition
(
'
notifySubmit
'
,
function
notifySubmit
()
{
return
this
.
triggerSubmit
();
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.
* Render obtain ERP5 Document and assigned Form Definition.
*
*
...
@@ -319,8 +286,7 @@ and handling data send&receive.
...
@@ -319,8 +286,7 @@ and handling data send&receive.
.
push
(
function
(
result
)
{
.
push
(
function
(
result
)
{
page_template_gadget
=
result
;
page_template_gadget
=
result
;
var
sub_options
=
options
.
fg
||
{},
var
sub_options
=
options
.
fg
||
{};
sub_queue
=
null
;
loadFormContent
(
gadget
,
erp5_document
.
_embedded
.
_view
);
loadFormContent
(
gadget
,
erp5_document
.
_embedded
.
_view
);
...
@@ -331,23 +297,7 @@ and handling data send&receive.
...
@@ -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
.
jio_key
=
options
.
jio_key
;
// jIO identifier of currently rendered ERP5 document
sub_options
.
editable
=
options
.
editable
;
// form decides on editability of its fields
sub_options
.
editable
=
options
.
editable
;
// form decides on editability of its fields
if
(
gadget
.
state
.
changing
&&
gadget
.
state
.
last_submitted_content
)
{
return
page_template_gadget
.
render
(
sub_options
);
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
()
{
.
push
(
function
()
{
if
(
modification_dict
.
hasOwnProperty
(
'
url
'
))
{
if
(
modification_dict
.
hasOwnProperty
(
'
url
'
))
{
...
@@ -408,13 +358,6 @@ and handling data send&receive.
...
@@ -408,13 +358,6 @@ and handling data send&receive.
return
gadget
.
notifySubmitting
()
return
gadget
.
notifySubmitting
()
.
push
(
function
()
{
.
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
);
return
gadget
.
jio_putAttachment
(
jio_key
,
target_url
,
content_dict
);
})
})
.
push
(
function
(
attachment
)
{
.
push
(
function
(
attachment
)
{
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_form_js.xml
View file @
e17ea712
...
@@ -228,7 +228,7 @@
...
@@ -228,7 +228,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
975.5
5180.61738.11520
</string>
</value>
<value>
<string>
975.5
6533.48127.29525
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -246,7 +246,7 @@
...
@@ -246,7 +246,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
1558
366871.01
</float>
<float>
1558
448080.86
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_html5_input_js.js
View file @
e17ea712
...
@@ -207,12 +207,6 @@
...
@@ -207,12 +207,6 @@
.
declareAcquiredMethod
(
"
notifyChange
"
,
"
notifyChange
"
)
.
declareAcquiredMethod
(
"
notifyChange
"
,
"
notifyChange
"
)
.
onEvent
(
'
change
'
,
function
change
()
{
.
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
([
return
RSVP
.
all
([
this
.
checkValidity
(),
this
.
checkValidity
(),
this
.
notifyChange
(
"
change
"
)
this
.
notifyChange
(
"
change
"
)
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_html5_input_js.xml
View file @
e17ea712
...
@@ -228,7 +228,7 @@
...
@@ -228,7 +228,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<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>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -246,7 +246,7 @@
...
@@ -246,7 +246,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
15
57839422.8
</float>
<float>
15
26653024.9
</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