diff --git a/tools/floodgate/css/floodgate.css b/tools/floodgate/css/floodgate.css index 37f2d5c6d0..801ee6775a 100644 --- a/tools/floodgate/css/floodgate.css +++ b/tools/floodgate/css/floodgate.css @@ -30,10 +30,15 @@ margin: 15% auto; padding: 20px; border: 1px solid #888; - width: 20%; + width: 25%; text-align: center; } .fg-modal-buttons button { margin: 10px; } + +.promote-publish-options { + display: none; + padding-top: 20px; +} diff --git a/tools/floodgate/index.html b/tools/floodgate/index.html index ac7891c247..480556bbc0 100644 --- a/tools/floodgate/index.html +++ b/tools/floodgate/index.html @@ -79,6 +79,10 @@

Project Status

+
+ Promote Only? + Promote and Publish Promoted Pages? +
diff --git a/tools/floodgate/js/floodgate.js b/tools/floodgate/js/floodgate.js index 5968dbde8a..90459c07ef 100644 --- a/tools/floodgate/js/floodgate.js +++ b/tools/floodgate/js/floodgate.js @@ -32,6 +32,10 @@ async function promoteContentAction(project, config) { params.spToken = getAccessToken(); // consider fgRoot as the project path for promote action. params.projectRoot = config.sp.fgRootFolder; + // Based on User selection on the Promote Dialog, + // passing the param if user also wants to Publish the Promoted pages. + params.doPublish = 'promotePublish' === + document.querySelector('input[name="promotePublishRadio"]:checked')?.value; const promoteStatus = await postData(config.sp.aioPromoteAction, params); updateProjectStatusUIFromAction({ promoteStatus }); } @@ -89,14 +93,23 @@ function setListeners(project, config) { document.querySelector('#promoteFiles button').addEventListener('click', (e) => { modal.getElementsByTagName('p')[0].innerText = `Confirm to ${e.target.textContent}`; modal.style.display = 'block'; + togglePromotePublishRadioVisibility('block'); document.querySelector('#fg-modal #yes-btn').addEventListener('click', handlePromoteConfirm); }); document.querySelector('#fg-modal #no-btn').addEventListener('click', () => { modal.style.display = 'none'; + togglePromotePublishRadioVisibility('none'); }); document.querySelector('#loading').addEventListener('click', loadingOFF); } +function togglePromotePublishRadioVisibility(visibility) { + const promotePublishOptions = document.getElementById('promote-publish-options'); + promotePublishOptions.style.display = visibility; + const promotePublishRadio = document.getElementById('promotePublishRadio'); + promotePublishRadio.checked = true; +} + async function init() { try { // Read the Floodgate Sharepoint Config