Commit 888adb89 authored by Jérome Perrin's avatar Jérome Perrin

officejs_support_request_ui: always update list of services on "New Support Request"

If we only refresh this list when user selects another project, we don't
support the case where there's only one project available for user, because
the list of services is the default one, not the one filtered for the
select project.
parent cd4b868f
...@@ -41,20 +41,21 @@ ...@@ -41,20 +41,21 @@
}) })
.push(function (hateoas_url) { .push(function (hateoas_url) {
gadget.hateoas_url = hateoas_url; gadget.hateoas_url = hateoas_url;
}).push(function () {
gadget.updateResourceListField();
}); });
}) })
.declareMethod('triggerSubmit', function () { .declareMethod('triggerSubmit', function () {
return this.form.triggerSubmit(); return this.form.triggerSubmit();
}) })
.onEvent('change', function (evt) { .declareJob('updateResourceListField', function () {
if (evt.target.id === "field_your_project") { var gadget = this,
var gadget = this; selectedProject = document.getElementById('field_your_project').value;
return gadget.jio_getAttachment( return gadget.jio_getAttachment(
'support_request_module', 'support_request_module',
gadget.hateoas_url + 'support_request_module' gadget.hateoas_url + 'support_request_module'
+ "/SupportRequest_getSupportTypeList" + "/SupportRequest_getSupportTypeList"
+ "?project_id=" + evt.target.value + "&json_flag=True" + "?project_id=" + selectedProject + "&json_flag=True"
).push(function (sp_list) { ).push(function (sp_list) {
var i, j, var i, j,
sp_select = document.getElementById('field_your_resource'); sp_select = document.getElementById('field_your_resource');
...@@ -66,6 +67,11 @@ ...@@ -66,6 +67,11 @@
sp_select.options[j] = new Option(sp_list[j][0], sp_list[j][1]); sp_select.options[j] = new Option(sp_list[j][0], sp_list[j][1]);
} }
}); });
})
.onEvent('change', function (evt) {
var gadget = this;
if (evt.target.id === "field_your_project") {
gadget.updateResourceListField();
} }
}, false, false); }, false, false);
}(window, rJS)); }(window, rJS));
\ No newline at end of file
...@@ -260,8 +260,8 @@ ...@@ -260,8 +260,8 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1540524000.73</float> <float>1607511772.31</float>
<string>GMT+9</string> <string>GMT+1</string>
</tuple> </tuple>
</state> </state>
</object> </object>
......
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