Merge branch 'v20260203-02-autotask-resolve-button-enabled' into main

This commit is contained in:
Ivo Oskamp 2026-02-06 13:23:31 +01:00
commit 52cd75e420
3 changed files with 18 additions and 7 deletions

View File

@ -1 +1 @@
v20260203-01-autotask-resolve-note
v20260203-02-autotask-resolve-button-enabled

View File

@ -913,8 +913,6 @@ table.addEventListener('change', function (e) {
function setDisabled(disabled) {
if (btnAutotask) btnAutotask.disabled = disabled;
if (btnAutotaskResolveNote) btnAutotaskResolveNote.disabled = disabled;
if (btnAutotaskLink) btnAutotaskLink.disabled = disabled;
if (btnTicket) btnTicket.disabled = disabled;
if (tCode) tCode.disabled = disabled;
if (btnRemark) btnRemark.disabled = disabled;
@ -972,6 +970,9 @@ table.addEventListener('change', function (e) {
// Resolve note is only meaningful when there is an active linked PSA ticket.
btnAutotaskResolveNote.style.display = (hasTicket && !isResolved && !isDeleted) ? '' : 'none';
}
if (btnAutotaskLink) btnAutotaskLink.disabled = !currentRunId;
if (btnAutotaskResolveNote) btnAutotaskResolveNote.disabled = !currentRunId;
}
window.__rcmRenderAutotaskInfo = renderAutotaskInfo;
@ -1290,11 +1291,15 @@ table.addEventListener('change', function (e) {
if (window.__rcmRenderAutotaskInfo) window.__rcmRenderAutotaskInfo(run);
if (window.__rcmSetAutotaskCreateLabel) window.__rcmSetAutotaskCreateLabel(run);
if (window.__rcmSetCreateDisabled) {
if (autotaskEnabled) {
var canCreateAt = !!currentRunId && (!run.autotask_ticket_id || !!run.autotask_ticket_is_resolved);
window.__rcmSetCreateDisabled(!canCreateAt);
} else {
// Only disable inputs when no run is selected.
window.__rcmSetCreateDisabled(!currentRunId);
if (autotaskEnabled) {
// Autotask ticket creation is only possible when there is no active linked PSA ticket,
// or when the existing PSA ticket is already resolved/deleted.
var canCreateAt = !!currentRunId && (!run.autotask_ticket_id || !!run.autotask_ticket_is_resolved || !!run.autotask_ticket_is_deleted);
var btnAutotask = document.getElementById('rcm_autotask_create');
if (btnAutotask) btnAutotask.disabled = !canCreateAt;
}
}
if (btnMarkSuccessOverride) {

View File

@ -465,6 +465,12 @@ Changes:
- Added backend API endpoint to handle the resolve-note action.
- Extended Autotask client with a helper to update existing tickets via PUT.
## v20260203-02-autotask-resolve-button-enabled
- Fixed an issue where the Autotask Resolve button was incorrectly disabled.
- Updated UI disable logic so only the Create action is disabled when an active Autotask ticket exists.
- Ensured the Resolve button remains clickable for existing linked Autotask tickets.
***
## v0.1.21