Commit b5b35a97 authored by JC Brand's avatar JC Brand

Bugfix. Ad-hoc form fields didn't render.

Also... clear info message before executing ad-hoc command so that user
gets visiual indication.
parent 58c5e967
...@@ -108,7 +108,7 @@ async function fetchCommandForm (command) { ...@@ -108,7 +108,7 @@ async function fetchCommandForm (command) {
command.sessionid = cmd_el.getAttribute('sessionid'); command.sessionid = cmd_el.getAttribute('sessionid');
command.instructions = sizzle('x[type="form"][xmlns="jabber:x:data"] instructions', cmd_el).pop()?.textContent; command.instructions = sizzle('x[type="form"][xmlns="jabber:x:data"] instructions', cmd_el).pop()?.textContent;
command.fields = sizzle('x[type="form"][xmlns="jabber:x:data"] field', cmd_el) command.fields = sizzle('x[type="form"][xmlns="jabber:x:data"] field', cmd_el)
.map(f => u.xForm2webForm(f, cmd_el)); .map(f => u.xForm2TemplateResult(f, cmd_el));
} catch (e) { } catch (e) {
if (e === null) { if (e === null) {
...@@ -206,6 +206,9 @@ export default class AdHocCommands extends CustomElement { ...@@ -206,6 +206,9 @@ export default class AdHocCommands extends CustomElement {
const node = form_data.get('command_node').trim(); const node = form_data.get('command_node').trim();
const cmd = this.commands.filter(c => c.node === node)[0]; const cmd = this.commands.filter(c => c.node === node)[0];
cmd.alert = null;
this.nonce = u.getUniqueId();
const inputs = sizzle(':input:not([type=button]):not([type=submit])', ev.target); const inputs = sizzle(':input:not([type=button]):not([type=submit])', ev.target);
const config_array = inputs const config_array = inputs
.filter(i => !['command_jid', 'command_node'].includes(i.getAttribute('name'))) .filter(i => !['command_jid', 'command_node'].includes(i.getAttribute('name')))
......
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