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 @@
(function (window, rJS, RSVP, URI, calculatePageTitle, Blob, URL, document, jIO) {
"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) {
// text = " ATTACHMENT; FILENAME = MyFile "
// Returns -> [" ATTACHMENT", " FILENAME = MyFile "]
......@@ -98,7 +105,7 @@
selector = form_gadget.element.querySelector("h3"),
title,
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;
......@@ -127,7 +134,6 @@
}
}
// Calculate the h3 properties
return new RSVP.Queue()
.push(function () {
......
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>960.5523.58984.43537</string> </value>
<value> <string>961.657.32982.5239</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1499170448.42</float>
<float>1501168424.28</float>
<string>UTC</string>
</tuple>
</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