Commit d2ed779f authored by Tomáš Peterka's avatar Tomáš Peterka Committed by Tomáš Peterka

[renderjs_ui] Submit button under (workflow) form will have correct title

even if there is only one workflow action

/reviewed-on nexedi/erp5!335
parent 14f2d31f
...@@ -3,6 +3,13 @@ ...@@ -3,6 +3,13 @@
(function (window, rJS, RSVP, URI, calculatePageTitle, Blob, URL, document, jIO) { (function (window, rJS, RSVP, URI, calculatePageTitle, Blob, URL, document, jIO) {
"use strict"; "use strict";
/* Make sure that returned object is an Array instance. */
function ensureArray(obj) {
if (!obj) {return []; }
if (!Array.isArray(obj)) {return [obj]; }
return obj;
}
function extractParamListFromContentDisposition(text) { function extractParamListFromContentDisposition(text) {
// text = " ATTACHMENT; FILENAME = MyFile " // text = " ATTACHMENT; FILENAME = MyFile "
// Returns -> [" ATTACHMENT", " FILENAME = MyFile "] // Returns -> [" ATTACHMENT", " FILENAME = MyFile "]
...@@ -98,7 +105,7 @@ ...@@ -98,7 +105,7 @@
selector = form_gadget.element.querySelector("h3"), selector = form_gadget.element.querySelector("h3"),
title, title,
i, i,
view_list = this.state.erp5_document._links.action_workflow || []; view_list = ensureArray(this.state.erp5_document._links.action_workflow);
title = this.state.form_definition.title; title = this.state.form_definition.title;
...@@ -127,7 +134,6 @@ ...@@ -127,7 +134,6 @@
} }
} }
// Calculate the h3 properties // Calculate the h3 properties
return new RSVP.Queue() return new RSVP.Queue()
.push(function () { .push(function () {
......
...@@ -230,7 +230,7 @@ ...@@ -230,7 +230,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>960.5523.58984.43537</string> </value> <value> <string>961.657.32982.5239</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -248,7 +248,7 @@ ...@@ -248,7 +248,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1499170448.42</float> <float>1501168424.28</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment