Tightly integrate WhatsApp selectors into existing UIs

This commit is contained in:
2026-02-16 10:51:57 +00:00
parent 35a781dcfc
commit cf651a3bd4
19 changed files with 2846 additions and 156 deletions

View File

@@ -388,7 +388,23 @@
<input type="hidden" name="active_tab" value="{{ active_tab|default:'engage' }}">
<input type="hidden" id="engage-action-input-{{ person.id }}" name="action" value="preview">
<input type="hidden" id="engage-force-send-{{ person.id }}" name="force_send" value="0">
<input type="hidden" id="engage-target-input-{{ person.id }}" name="target_identifier_id" value="{{ engage_form.target_identifier_id }}">
<div class="columns is-multiline" style="margin: 0 -0.3rem;">
{% if send_target_bundle.options %}
<div class="column is-12-mobile is-6-tablet" style="padding: 0.3rem;">
<label class="label is-small" style="margin-bottom: 0.25rem;">Target Platform</label>
<div class="select is-small is-fullwidth">
<select id="engage-target-select-{{ person.id }}" onchange="giaEngageSetTarget('{{ person.id }}', this.value);">
{% for option in send_target_bundle.options %}
<option value="{{ option.id }}" {% if option.id == engage_form.target_identifier_id %}selected{% endif %}>
{{ option.service_label }} · {{ option.identifier }}
</option>
{% endfor %}
</select>
</div>
</div>
{% endif %}
<div class="column is-12-mobile is-6-tablet" style="padding: 0.3rem;">
<label class="label is-small" style="margin-bottom: 0.25rem;">Source</label>
<div class="select is-small is-fullwidth">
@@ -897,6 +913,19 @@
form.requestSubmit();
};
window.giaEngageSetTarget = function(pid, targetId) {
if (pid !== personId) return;
const normalized = String(targetId || "").trim();
const input = document.getElementById("engage-target-input-" + pid);
if (input) {
input.value = normalized;
}
const parentSelect = document.getElementById("ai-target-select-" + pid);
if (parentSelect && normalized) {
parentSelect.value = normalized;
}
};
window.giaEngageSelect = function(pid, kind, value, node) {
if (pid !== personId) return;
let inputId = "";
@@ -922,6 +951,14 @@
window.giaMitigationShowTab(personId, "{{ active_tab|default:'plan_board' }}");
resizeEditableTextareas(document.getElementById("mitigation-shell-" + personId));
const parentTarget = document.getElementById("ai-target-select-" + personId);
if (parentTarget) {
window.giaEngageSetTarget(personId, parentTarget.value);
}
const localTarget = document.getElementById("engage-target-select-" + personId);
if (localTarget) {
window.giaEngageSetTarget(personId, localTarget.value);
}
window.giaEngageSyncSendOverride(personId);
})();
</script>