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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Sven Franck
erp5
Commits
abb66a5f
Commit
abb66a5f
authored
Jun 02, 2015
by
Xiaowu Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_web_renderjs_ui: remove the way to clean input after submit since it's not correct
parent
e1e39679
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
160 deletions
+15
-160
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_form_js.xml
...hTemplateItem/web_page_module/rjs_gadget_erp5_form_js.xml
+2
-83
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_view_editable_js.xml
..._page_module/rjs_gadget_erp5_pt_form_view_editable_js.xml
+5
-30
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_formpage_js.xml
...teItem/web_page_module/rjs_gadget_erp5_pt_formpage_js.xml
+5
-27
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_relationstringfield_js.xml
...eb_page_module/rjs_gadget_erp5_relationstringfield_js.xml
+3
-20
No files found.
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_form_js.xml
View file @
abb66a5f
...
@@ -341,87 +341,6 @@
...
@@ -341,87 +341,6 @@
return
data;\n
return
data;\n
});\n
});\n
})\n
})\n
.declareMethod("refresh",
function
(options)
{\n
var
form_gadget =
this,\n
j,\n
i,\n
index =
0,\n
erp5_document =
options.erp5_document,\n
form_definition =
options.form_definition,\n
rendered_form =
erp5_document._embedded._view,\n
group_list =
form_definition.group_list,\n
refresh_queue =
new
RSVP.Queue(),\n
suboption_dict =
{},\n
suboptions,\n
renderered_field,\n
field,\n
refresh_list =
this.props.refresh_list;\n
delete
options.erp5_document;\n
delete
options.form_definition;\n
\n
form_gadget.state_parameter_dict =
options.form_gadget
||
{};\n
//
XXX
Hardcoded
for
searchfield
-
remove
later!\n
if
(form_definition.extended_search)
{\n
suboption_dict.extended_search =
form_definition.extended_search;\n
}\n
\n
function
refresh_gadget(options,
gadget_index)
{\n
if
(form_gadget.props.gadget_list[gadget_index].refresh
!==
undefined)
{\n
refresh_queue.push(function
()
{\n
return
form_gadget.props.gadget_list[gadget_index].refresh(options);\n
});\n
}\n
}\n
for
(
i =
0;
i
<
group_list.length;
i
+=
1)
{\n
for
(
j =
0;
j
<
group_list[i][1].length;
j
+=
1)
{\n
field =
group_list[i][1][j];\n
if
(rendered_form.hasOwnProperty(field[0]))
{\n
if
(refresh_list[index])
{\n
renderered_field =
rendered_form[field[0]];\n
suboptions =
options[renderered_field.key]
||
suboption_dict;\n
suboptions.field_json =
renderered_field;\n
refresh_gadget(suboptions,
index);\n
}\n
index
+=
1;\n
}\n
}\n
}\n
return
refresh_queue;\n
})\n
.declareMethod("checkRefresh",
function
()
{\n
var
form_gadget =
this,\n
k,\n
field_gadget,\n
count =
form_gadget.props.gadget_list.length,\n
result =
false,\n
refresh_list =
[],\n
queue =
new
RSVP.Queue();\n
function
extendData(needToRefresh)
{\n
result =
result
||
needToRefresh;\n
refresh_list[refresh_list.length]
=
needToRefresh;\n
}\n
function
dontNeedToRefresh()
{\n
return
false;\n
}\n
for
(
k =
0;
k
<
count;
k
+=
1)
{\n
field_gadget =
form_gadget.props.gadget_list[k];\n
//
XXX
Hack
until
better
defined\n
if
(field_gadget.checkRefresh
!==
undefined)
{\n
queue\n
.push(field_gadget.checkRefresh.bind(field_gadget));\n
}
else
{\n
queue\n
.push(dontNeedToRefresh);\n
}\n
queue.push(extendData);\n
}\n
return
queue\n
.push(function
()
{\n
form_gadget.props.refresh_list =
refresh_list;\n
return
result;\n
});\n
\n
})\n
.declareMethod("checkValidity",
function
()
{\n
.declareMethod("checkValidity",
function
()
{\n
var
form_gadget =
this,\n
var
form_gadget =
this,\n
k,\n
k,\n
...
@@ -587,7 +506,7 @@
...
@@ -587,7 +506,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
943.1
8921.17173.42154
</string>
</value>
<value>
<string>
943.1
9028.41746.46353
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -605,7 +524,7 @@
...
@@ -605,7 +524,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
143
2701398.16
</float>
<float>
143
3215002.43
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_form_view_editable_js.xml
View file @
abb66a5f
...
@@ -135,7 +135,6 @@
...
@@ -135,7 +135,6 @@
.declareAcquiredMethod("renderPageHeader", "renderPageHeader")\n
.declareAcquiredMethod("renderPageHeader", "renderPageHeader")\n
.declareAcquiredMethod("notifySubmitting", "notifySubmitting")\n
.declareAcquiredMethod("notifySubmitting", "notifySubmitting")\n
.declareAcquiredMethod("notifySubmitted", "notifySubmitted")\n
.declareAcquiredMethod("notifySubmitted", "notifySubmitted")\n
.declareAcquiredMethod("pleaseRefreshFields", "pleaseRefreshFields")\n
\n
\n
/////////////////////////////////////////////////////////////////\n
/////////////////////////////////////////////////////////////////\n
// declared methods\n
// declared methods\n
...
@@ -194,18 +193,6 @@
...
@@ -194,18 +193,6 @@
});\n
});\n
});\n
});\n
})\n
})\n
.declareMethod(\'refresh\', function (options) {\n
return this.getDeclaredGadget("erp5_form")\n
.push(function (erp5_form) {\n
var form_options = options.erp5_form || {};\n
\n
form_options.erp5_document = options.erp5_document;\n
form_options.form_definition = options.form_definition;\n
form_options.view = options.view;\n
\n
return erp5_form.refresh(form_options);\n
});\n
})\n
\n
\n
\n
\n
.declareService(function () {\n
.declareService(function () {\n
...
@@ -215,20 +202,13 @@
...
@@ -215,20 +202,13 @@
var form_gadget = this;\n
var form_gadget = this;\n
\n
\n
function formSubmit() {\n
function formSubmit() {\n
var erp5_form,\n
var erp5_form;\n
validity,\n
need_to_refresh;\n
return form_gadget.getDeclaredGadget("erp5_form")\n
return form_gadget.getDeclaredGadget("erp5_form")\n
.push(function (gadget) {\n
.push(function (gadget) {\n
erp5_form = gadget;\n
erp5_form = gadget;\n
return RSVP.all([\n
return erp5_form.checkValidity();\n
erp5_form.checkValidity(),\n
erp5_form.checkRefresh()\n
]);\n
})\n
})\n
.push(function (result) {\n
.push(function (validity) {\n
validity = result[0];\n
need_to_refresh = result[1];\n
if (validity) {\n
if (validity) {\n
return erp5_form.getContent()\n
return erp5_form.getContent()\n
.push(function (data) {\n
.push(function (data) {\n
...
@@ -245,11 +225,6 @@
...
@@ -245,11 +225,6 @@
})\n
})\n
]);\n
]);\n
})\n
})\n
.push(function () {\n
if (need_to_refresh) {\n
return form_gadget.pleaseRefreshFields();\n
}\n
})\n
.push(form_gadget.notifySubmitted.bind(form_gadget));\n
.push(form_gadget.notifySubmitted.bind(form_gadget));\n
}\n
}\n
});\n
});\n
...
@@ -399,7 +374,7 @@
...
@@ -399,7 +374,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
94
2.56412.30506.44083
</string>
</value>
<value>
<string>
94
3.1808.36899.34116
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -417,7 +392,7 @@
...
@@ -417,7 +392,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
143
1046040.15
</float>
<float>
143
3215251.09
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_pt_formpage_js.xml
View file @
abb66a5f
...
@@ -128,29 +128,7 @@
...
@@ -128,29 +128,7 @@
// Acquired methods\n
// Acquired methods\n
/////////////////////////////////////////////////////////////////\n
/////////////////////////////////////////////////////////////////\n
.declareAcquiredMethod("jio_getAttachment", "jio_getAttachment")\n
.declareAcquiredMethod("jio_getAttachment", "jio_getAttachment")\n
.allowPublicAcquisition("pleaseRefreshFields", function () {\n
\n
var gadget = this,\n
options = this.props.options,\n
erp5_document,\n
form_gadget = this.props.form_gadget;\n
return gadget.jio_getAttachment({"_id": options.jio_key, "_attachment": options.view})\n
.push(function (result) {\n
var uri = new URI(result.data._embedded._view._links.form_definition.href);\n
erp5_document = result.data;\n
return gadget.jio_getAttachment({"_id": uri.segment(2), "_attachment": "view"});\n
})\n
.push(function (result) {\n
var new_options;\n
new_options = options.fg || {};\n
new_options.erp5_document = erp5_document;\n
new_options.form_definition = result.data;\n
new_options.view = options.view;\n
new_options.action_view = options.action_view;\n
new_options.jio_key = options.jio_key;\n
new_options.editable = options.editable;\n
return form_gadget.refresh(new_options);\n
});\n
})\n
/////////////////////////////////////////////////////////////////\n
/////////////////////////////////////////////////////////////////\n
// declared methods\n
// declared methods\n
/////////////////////////////////////////////////////////////////\n
/////////////////////////////////////////////////////////////////\n
...
@@ -166,7 +144,7 @@
...
@@ -166,7 +144,7 @@
erp5_document,\n
erp5_document,\n
erp5_form,\n
erp5_form,\n
form_gadget;\n
form_gadget;\n
gadget.props.options = options;
\n
\n
return gadget.jio_getAttachment({"_id": options.jio_key, "_attachment": options.view})\n
return gadget.jio_getAttachment({"_id": options.jio_key, "_attachment": options.view})\n
.push(function (result) {\n
.push(function (result) {\n
var uri = new URI(result.data._embedded._view._links.form_definition.href);\n
var uri = new URI(result.data._embedded._view._links.form_definition.href);\n
...
@@ -195,7 +173,7 @@
...
@@ -195,7 +173,7 @@
sub_options.action_view = options.action_view;\n
sub_options.action_view = options.action_view;\n
sub_options.jio_key = options.jio_key;\n
sub_options.jio_key = options.jio_key;\n
sub_options.editable = options.editable;\n
sub_options.editable = options.editable;\n
gadget.props.form_gadget = result;
\n
\n
form_gadget = result;\n
form_gadget = result;\n
return form_gadget.render(sub_options);\n
return form_gadget.render(sub_options);\n
})\n
})\n
...
@@ -348,7 +326,7 @@
...
@@ -348,7 +326,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
94
2.55908.31920.60569
</string>
</value>
<value>
<string>
94
3.5835.57925.8345
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -366,7 +344,7 @@
...
@@ -366,7 +344,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
143
1045870.59
</float>
<float>
143
3215427.98
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
...
bt5/erp5_web_renderjs_ui/PathTemplateItem/web_page_module/rjs_gadget_erp5_relationstringfield_js.xml
View file @
abb66a5f
...
@@ -322,7 +322,6 @@ promiseEventListener */\n
...
@@ -322,7 +322,6 @@ promiseEventListener */\n
//
show
"new"
tag,
clicking
it
will
remove
it
and
reset
the
field!\n
//
show
"new"
tag,
clicking
it
will
remove
it
and
reset
the
field!\n
//
XXX
Not
active
-
reset
should
be
handled
by
a
generic
reset
method!\n
//
XXX
Not
active
-
reset
should
be
handled
by
a
generic
reset
method!\n
if
(no_results
&&
field_json.allow_creation)
{\n
if
(no_results
&&
field_json.allow_creation)
{\n
props.need_to_refresh =
true;\n
return
new
RSVP.Queue()\n
return
new
RSVP.Queue()\n
.push(function
()
{\n
.push(function
()
{\n
props.wrapper.appendChild(createNewTag(my_gadget));\n
props.wrapper.appendChild(createNewTag(my_gadget));\n
...
@@ -350,7 +349,6 @@ promiseEventListener */\n
...
@@ -350,7 +349,6 @@ promiseEventListener */\n
return
setRelationJump(my_gadget,
undefined);\n
return
setRelationJump(my_gadget,
undefined);\n
});\n
});\n
}\n
}\n
props.need_to_refresh =
false;\n
//
default
autocomplete\n
//
default
autocomplete\n
return
new
RSVP.Queue()\n
return
new
RSVP.Queue()\n
.push(function
()
{\n
.push(function
()
{\n
...
@@ -399,7 +397,6 @@ promiseEventListener */\n
...
@@ -399,7 +397,6 @@ promiseEventListener */\n
//
Init
local
properties\n
//
Init
local
properties\n
.ready(function
(my_gadget)
{\n
.ready(function
(my_gadget)
{\n
my_gadget.property_dict =
{};\n
my_gadget.property_dict =
{};\n
my_gadget.property_dict.need_to_refresh =
false;\n
})\n
})\n
\n
\n
.ready(function
(my_gadget)
{\n
.ready(function
(my_gadget)
{\n
...
@@ -476,20 +473,6 @@ promiseEventListener */\n
...
@@ -476,20 +473,6 @@ promiseEventListener */\n
}\n
}\n
return
result;\n
return
result;\n
})\n
})\n
.declareMethod(\'refresh\',
function
(options)
{\n
var
wrapper =
this.property_dict.wrapper,\n
tag_list;\n
tag_list =
wrapper.querySelector(".ui-tag-list");\n
if
(tag_list
!==
null)
{\n
tag_list.parentNode.removeChild(tag_list);\n
}\n
return
this.render(options);\n
})\n
.declareMethod(\'checkRefresh\',
function
()
{\n
var
tmp =
this.property_dict.need_to_refresh;\n
this.property_dict.need_to_refresh =
false;\n
return
tmp;\n
})\n
.declareMethod(\'checkValidity\',
function
()
{\n
.declareMethod(\'checkValidity\',
function
()
{\n
var
result;\n
var
result;\n
result =
(this.element.querySelector(\'input\').checkValidity())
&&\n
result =
(this.element.querySelector(\'input\').checkValidity())
&&\n
...
@@ -624,7 +607,7 @@ promiseEventListener */\n
...
@@ -624,7 +607,7 @@ promiseEventListener */\n
- keyboard speed test\n
- keyboard speed test\n
- add generic text and translations\n
- add generic text and translations\n
- do multiRelationfield\n
- do multiRelationfield\n
-
ok
find way to digest response of erp5? submit should clean input\n
- find way to digest response of erp5? submit should clean input\n
- add column_list parameter to pass more than title = "John Smith", render?\n
- add column_list parameter to pass more than title = "John Smith", render?\n
\n
\n
\n
\n
...
@@ -767,7 +750,7 @@ promiseEventListener */\n
...
@@ -767,7 +750,7 @@ promiseEventListener */\n
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
943.1
1588.15892.23876
</string>
</value>
<value>
<string>
943.1
8921.17173.42154
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -785,7 +768,7 @@ promiseEventListener */\n
...
@@ -785,7 +768,7 @@ promiseEventListener */\n
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
143
2255062.93
</float>
<float>
143
3215555.91
</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