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
Boris Kocherov
erp5
Commits
3bf9d9d1
Commit
3bf9d9d1
authored
Sep 21, 2017
by
Tomáš Peterka
Committed by
Tomáš Peterka
Oct 26, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[renderjs] Page Form rechecks form page template on "displayValidationErrors"
parent
40848b9e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
17 deletions
+31
-17
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
+24
-10
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_erp5_pt_form_dialog_js.js
...Item/web_page_module/rjs_gadget_erp5_pt_form_dialog_js.js
+3
-3
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_dialog_js.xml
...tem/web_page_module/rjs_gadget_erp5_pt_form_dialog_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 @
3bf9d9d1
...
...
@@ -68,6 +68,13 @@
.
allowPublicAcquisition
(
'
notifySubmit
'
,
function
()
{
return
this
.
triggerSubmit
();
})
/**
* Render obtain ERP5 Document and assigned Form Definition.
*
* Arguments:
* `erp5_document` or parameters to obtain one: `jio_key`, `view`
* `editable`
*/
.
declareMethod
(
"
render
"
,
function
(
options
)
{
var
gadget
=
this
,
promise_queue
=
new
RSVP
.
Queue
(),
...
...
@@ -82,6 +89,7 @@
// if we get erp5 document during rendering then no need to fetch it
new_state
.
erp5_document
=
options
.
erp5_document
;
// remove reference to erp5_document from options (and new_state.options)
// otherwise we get infinite loop
delete
options
.
erp5_document
;
}
else
{
promise_queue
...
...
@@ -136,12 +144,10 @@
gadget
=
this
,
options
=
this
.
state
.
options
,
page_template_gadget
,
// clean_dom === false only in case of displaying errors
clean_dom
=
modification_dict
.
hasOwnProperty
(
'
url
'
),
erp5_document
=
JSON
.
parse
(
gadget
.
state
.
erp5_document
),
erp5_form
=
JSON
.
parse
(
gadget
.
state
.
erp5_form
);
if
(
clean_dom
)
{
if
(
modification_dict
.
hasOwnProperty
(
'
url
'
)
)
{
queue
=
gadget
.
declareGadget
(
gadget
.
state
.
url
,
{
scope
:
"
fg
"
});
}
else
{
queue
=
gadget
.
getDeclaredGadget
(
"
fg
"
);
...
...
@@ -164,7 +170,7 @@
return
page_template_gadget
.
render
(
sub_options
);
})
.
push
(
function
()
{
if
(
clean_dom
)
{
if
(
modification_dict
.
hasOwnProperty
(
'
url
'
)
)
{
return
page_template_gadget
.
getElement
()
.
push
(
function
(
fragment
)
{
var
element
=
gadget
.
element
;
...
...
@@ -189,12 +195,20 @@
});
})
.
allowPublicAcquisition
(
"
displayFormulatorValidationError
"
,
function
(
param_list
)
{
var
erp5_document
=
JSON
.
parse
(
this
.
state
.
erp5_document
);
var
erp5_document
=
JSON
.
parse
(
this
.
state
.
erp5_document
),
options
=
this
.
state
.
options
;
erp5_document
.
_embedded
.
_view
=
param_list
[
0
];
// Force refresh
erp5_document
.
_now
=
Date
.
now
();
return
this
.
changeState
({
erp5_document
:
JSON
.
stringify
(
erp5_document
)});
});
erp5_document
.
_now
=
Date
.
now
();
// force refresh
// We choose render instead of changeState because the new form can use
// different page_template (reports are setup in form_dialog but rendered
// in report_view).
// Validation provides document updated for error texts but uses the same
// form thus the same view thus the same url - no DOM modifications
//
// We modify inplace state.options because in render we remove this
// exceeding document.
options
.
erp5_document
=
erp5_document
;
return
this
.
render
(
options
);
})
}(
window
,
rJS
,
URI
,
RSVP
));
\ No newline at end of file
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_form_js.xml
View file @
3bf9d9d1
...
...
@@ -230,7 +230,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
96
1.16455.47614.10018
</string>
</value>
<value>
<string>
96
2.15790.20434.8686
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>
150
2198575.84
</float>
<float>
150
6008583.91
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_dialog_js.js
View file @
3bf9d9d1
...
...
@@ -23,7 +23,7 @@
.
declareAcquiredMethod
(
"
notifySubmitted
"
,
"
notifySubmitted
"
)
.
declareAcquiredMethod
(
"
translate
"
,
"
translate
"
)
.
declareAcquiredMethod
(
"
notifyChange
"
,
"
notifyChange
"
)
.
declareAcquiredMethod
(
"
forcePageChange
"
,
"
displayFormulatorValidationError
"
)
.
declareAcquiredMethod
(
"
displayFormulatorValidationError
"
,
"
displayFormulatorValidationError
"
)
/////////////////////////////////////////////////////////////////
// Proxy methods to the child gadget
...
...
@@ -268,7 +268,7 @@
return
jIO
.
util
.
readBlobAsText
(
attachment
.
target
.
response
);
})
.
push
(
function
(
response_text
)
{
return
form_gadget
.
forcePageChange
(
JSON
.
parse
(
response_text
.
target
.
result
));
return
form_gadget
.
displayFormulatorValidationError
(
JSON
.
parse
(
response_text
.
target
.
result
));
});
}
...
...
@@ -321,7 +321,7 @@
return
{
target
:
{
result
:
error
.
target
.
response
}};
})
.
push
(
function
(
event
)
{
return
form_gadget
.
forcePageChange
(
JSON
.
parse
(
event
.
target
.
result
));
return
form_gadget
.
displayFormulatorValidationError
(
JSON
.
parse
(
event
.
target
.
result
));
});
}
return
promise
;
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_dialog_js.xml
View file @
3bf9d9d1
...
...
@@ -230,7 +230,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
962.153
78.64583.403
45
</string>
</value>
<value>
<string>
962.153
91.22775.524
45
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>
150
5984600.
8
</float>
<float>
150
6008825.1
8
</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