From 71840dcfe898a95da6b103ff4f4cbee2f9afb2bb Mon Sep 17 00:00:00 2001 From: pattonwebz Date: Mon, 18 Nov 2024 21:05:08 +0000 Subject: [PATCH 1/2] Pass an editor url via data attribute on fix button for open issues fixes --- src/admin/summary/summary-tab-input-event-handlers.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/admin/summary/summary-tab-input-event-handlers.js b/src/admin/summary/summary-tab-input-event-handlers.js index 4ca766dd..cbd2f022 100644 --- a/src/admin/summary/summary-tab-input-event-handlers.js +++ b/src/admin/summary/summary-tab-input-event-handlers.js @@ -135,6 +135,10 @@ export const initFixButtonEventHandlers = () => { if ( ! fixSettings ) { return; } + // if this button has a data-editor attribute, then we need to set the value of the fix setting to the value of the data-editor attribute + if ( button.hasAttribute( 'data-editor' ) ) { + window.edac_script_vars.editorLink = button.getAttribute( 'data-editor' ); + } fixSettings.classList.toggle( 'active' ); document.querySelector( 'body' ).classList.add( 'edac-fix-modal-present' ); From d7b4e97756d0bb810749bad9b6dc4afe309264d2 Mon Sep 17 00:00:00 2001 From: pattonwebz Date: Mon, 18 Nov 2024 21:06:38 +0000 Subject: [PATCH 2/2] Handle editor link set in edac_script_vars when saving fix settings from modal --- src/common/saveFixSettingsRest.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/common/saveFixSettingsRest.js b/src/common/saveFixSettingsRest.js index a860be2d..80d65246 100644 --- a/src/common/saveFixSettingsRest.js +++ b/src/common/saveFixSettingsRest.js @@ -60,10 +60,11 @@ export const saveFixSettings = ( fixSettingsContainer ) => { fixSettingsContainer.classList.add( 'edac-fix-settings--saved--success' ); // find the aria-live region and update the text if ( liveRegion ) { - if ( window?.edacFrontendHighlighterApp?.editorLink?.length ) { + const editLink = window?.edacFrontendHighlighterApp?.editorLink || window?.edac_script_vars?.editorLink; + if ( editLink ) { liveRegion.innerHTML = sprintf( __( 'Settings saved successfully. You must %svisit the editor%s and save the post to rescan and remove fixed issues from Accessibility Checker reports.', 'accessibility-checker' ), - ``, + ``, '' ); } else {