mirror of https://github.com/zulip/zulip.git
edit bot: Fix UI element shows incorrect interface for outgoing webhook.
Dropdown element for outgoing interface type was not showing correct value, cause the way default value was set to dropdown was incorrect (it should have been setting the selected parameter on the selected option if it were going to be selected via the template code). Fixes #9419.
This commit is contained in:
parent
c6909fb99c
commit
3b09dda879
|
@ -1573,8 +1573,8 @@ run_test('handlebars_bug', () => {
|
||||||
interface: "1"},
|
interface: "1"},
|
||||||
};
|
};
|
||||||
var html = render('edit-outgoing-webhook-service', args);
|
var html = render('edit-outgoing-webhook-service', args);
|
||||||
assert.equal($(html).find('#edit_service_base_url').attr('value'), args.service.base_url);
|
assert.equal($(html).find('#edit_service_base_url').val(), args.service.base_url);
|
||||||
assert.equal($(html).find('#edit_service_interface').attr('value'), args.service.interface);
|
assert.equal($(html).find('#edit_service_interface').val(), args.service.interface);
|
||||||
}());
|
}());
|
||||||
|
|
||||||
(function edit_embedded_bot_service() {
|
(function edit_embedded_bot_service() {
|
||||||
|
|
|
@ -373,6 +373,7 @@ exports.set_up = function () {
|
||||||
if (bot.bot_type.toString() === OUTGOING_WEBHOOK_BOT_TYPE) {
|
if (bot.bot_type.toString() === OUTGOING_WEBHOOK_BOT_TYPE) {
|
||||||
$("#service_data").append(templates.render("edit-outgoing-webhook-service",
|
$("#service_data").append(templates.render("edit-outgoing-webhook-service",
|
||||||
{service: service}));
|
{service: service}));
|
||||||
|
$("#edit_service_interface").val(service.interface);
|
||||||
}
|
}
|
||||||
if (bot.bot_type.toString() === EMBEDDED_BOT_TYPE) {
|
if (bot.bot_type.toString() === EMBEDDED_BOT_TYPE) {
|
||||||
$("#service_data").append(templates.render("edit-embedded-bot-service",
|
$("#service_data").append(templates.render("edit-embedded-bot-service",
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="">
|
<div class="">
|
||||||
<label for="edit_service_interface">{{t "Interface" }}</label>
|
<label for="edit_service_interface">{{t "Interface" }}</label>
|
||||||
<select id="edit_service_interface" name="service_interface" value="{{service.interface}}">
|
<select id="edit_service_interface" name="service_interface">
|
||||||
<option value="1">{{t "Generic" }}</option>
|
<option value="1">{{t "Generic" }}</option>
|
||||||
<option value="2">{{t "Slack's outgoing webhooks" }}</option>
|
<option value="2">{{t "Slack's outgoing webhooks" }}</option>
|
||||||
</select>
|
</select>
|
||||||
|
|
Loading…
Reference in New Issue