From 1e4c675f96e3af4c962774b58147525993855103 Mon Sep 17 00:00:00 2001
From: Oliver Bartsch <bo@cedev.de>
Date: Mon, 31 May 2021 13:56:59 +0200
Subject: [PATCH] [BUGFIX] Fix recipients checkboxes in "Send to stage" dialog

Classes and positioning of the recipients checkboxes
in the EXT:workspaces "Send to stage" dialog are
adjusted to be bootstrap 5 compatible, restoring
proper space between checkbox and label.

Resolves: #94241
Related: #93119
Releases: master
Change-Id: If38f03f8c39c830ee5a1292667e8d942b446daff
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/69335
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: core-ci <typo3@b13.com>
Tested-by: Jochen <rothjochen@gmail.com>
Tested-by: Oliver Bartsch <bo@cedev.de>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Jochen <rothjochen@gmail.com>
Reviewed-by: Oliver Bartsch <bo@cedev.de>
---
 .../Resources/Public/TypeScript/Workspaces.ts | 22 ++++++++++---------
 .../Resources/Public/JavaScript/Workspaces.js |  2 +-
 2 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/Build/Sources/TypeScript/workspaces/Resources/Public/TypeScript/Workspaces.ts b/Build/Sources/TypeScript/workspaces/Resources/Public/TypeScript/Workspaces.ts
index 9ae676652c38..df0f979ce3cb 100644
--- a/Build/Sources/TypeScript/workspaces/Resources/Public/TypeScript/Workspaces.ts
+++ b/Build/Sources/TypeScript/workspaces/Resources/Public/TypeScript/Workspaces.ts
@@ -45,16 +45,18 @@ export default class Workspaces {
 
       for (const recipient of result.sendMailTo) {
         $form.append(
-          $('<div />', {class: 'checkbox'}).append(
-            $('<label />').text(recipient.label).prepend(
-              $('<input />', {
-                type: 'checkbox',
-                name: 'recipients',
-                class: 't3js-workspace-recipient',
-                id: recipient.name,
-                value: recipient.value,
-              }).prop('checked', recipient.checked).prop('disabled', recipient.disabled),
-            ),
+          $('<div />', {class: 'form-check'}).append(
+            $('<input />', {
+              type: 'checkbox',
+              name: 'recipients',
+              class: 'form-check-input t3js-workspace-recipient',
+              id: recipient.name,
+              value: recipient.value,
+            }).prop('checked', recipient.checked).prop('disabled', recipient.disabled),
+            $('<label />', {
+              class: 'form-check-label',
+              for: recipient.name
+            }).text(recipient.label),
           ),
         );
       }
diff --git a/typo3/sysext/workspaces/Resources/Public/JavaScript/Workspaces.js b/typo3/sysext/workspaces/Resources/Public/JavaScript/Workspaces.js
index d1bf199e0d0d..3bef194f192a 100644
--- a/typo3/sysext/workspaces/Resources/Public/JavaScript/Workspaces.js
+++ b/typo3/sysext/workspaces/Resources/Public/JavaScript/Workspaces.js
@@ -10,4 +10,4 @@
  *
  * The TYPO3 project - inspiring people to share!
  */
-var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};define(["require","exports","TYPO3/CMS/Core/Ajax/AjaxRequest","TYPO3/CMS/Backend/Enum/Severity","jquery","TYPO3/CMS/Backend/Modal"],(function(e,t,a,n,o,l){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),o=__importDefault(o);t.default=class{constructor(){this.tid=0}renderSendToStageWindow(e){const t=e[0].result,a=o.default("<form />");if(void 0!==t.sendMailTo&&t.sendMailTo.length>0){a.append(o.default("<label />",{class:"control-label"}).text(TYPO3.lang["window.sendToNextStageWindow.itemsWillBeSentTo"])),a.append(o.default("<div />",{class:"form-group"}).append(o.default('<button type="button" class="btn btn-default btn-xs t3js-workspace-recipients-selectall" />').text(TYPO3.lang["window.sendToNextStageWindow.selectAll"]),"&nbsp;",o.default('<button type="button" class="btn btn-default btn-xs t3js-workspace-recipients-deselectall" />').text(TYPO3.lang["window.sendToNextStageWindow.deselectAll"])));for(const e of t.sendMailTo)a.append(o.default("<div />",{class:"checkbox"}).append(o.default("<label />").text(e.label).prepend(o.default("<input />",{type:"checkbox",name:"recipients",class:"t3js-workspace-recipient",id:e.name,value:e.value}).prop("checked",e.checked).prop("disabled",e.disabled))))}void 0!==t.additional&&a.append(o.default("<div />",{class:"form-group"}).append(o.default("<label />",{class:"control-label",for:"additional"}).text(TYPO3.lang["window.sendToNextStageWindow.additionalRecipients"]),o.default("<textarea />",{class:"form-control",name:"additional",id:"additional"}).text(t.additional.value),o.default("<span />",{class:"help-block"}).text(TYPO3.lang["window.sendToNextStageWindow.additionalRecipients.hint"]))),a.append(o.default("<div />",{class:"form-group"}).append(o.default("<label />",{class:"control-label",for:"comments"}).text(TYPO3.lang["window.sendToNextStageWindow.comments"]),o.default("<textarea />",{class:"form-control",name:"comments",id:"comments"}).text(t.comments.value)));const s=l.show(TYPO3.lang.actionSendToStage,a,n.SeverityEnum.info,[{text:TYPO3.lang.cancel,active:!0,btnClass:"btn-default",name:"cancel",trigger:()=>{s.modal("hide")}},{text:TYPO3.lang.ok,btnClass:"btn-info",name:"ok"}]);return s}checkIntegrity(e){return this.sendRemoteRequest(this.generateRemotePayload("checkIntegrity",e))}sendRemoteRequest(e){return new a(TYPO3.settings.ajaxUrls.workspace_dispatch).post(e,{headers:{"Content-Type":"application/json; charset=utf-8"}})}generateRemotePayload(e,t={}){return this.generateRemotePayloadBody("RemoteServer",e,t)}generateRemoteMassActionsPayload(e,t={}){return this.generateRemotePayloadBody("MassActions",e,t)}generateRemoteActionsPayload(e,t={}){return this.generateRemotePayloadBody("Actions",e,t)}generateRemotePayloadBody(e,t,a){return a instanceof Array?a.push(TYPO3.settings.Workspaces.token):a=[a,TYPO3.settings.Workspaces.token],{action:e,data:a,method:t,type:"rpc",tid:this.tid++}}}}));
\ No newline at end of file
+var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};define(["require","exports","TYPO3/CMS/Core/Ajax/AjaxRequest","TYPO3/CMS/Backend/Enum/Severity","jquery","TYPO3/CMS/Backend/Modal"],(function(e,t,a,n,o,l){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),o=__importDefault(o);t.default=class{constructor(){this.tid=0}renderSendToStageWindow(e){const t=e[0].result,a=o.default("<form />");if(void 0!==t.sendMailTo&&t.sendMailTo.length>0){a.append(o.default("<label />",{class:"control-label"}).text(TYPO3.lang["window.sendToNextStageWindow.itemsWillBeSentTo"])),a.append(o.default("<div />",{class:"form-group"}).append(o.default('<button type="button" class="btn btn-default btn-xs t3js-workspace-recipients-selectall" />').text(TYPO3.lang["window.sendToNextStageWindow.selectAll"]),"&nbsp;",o.default('<button type="button" class="btn btn-default btn-xs t3js-workspace-recipients-deselectall" />').text(TYPO3.lang["window.sendToNextStageWindow.deselectAll"])));for(const e of t.sendMailTo)a.append(o.default("<div />",{class:"form-check"}).append(o.default("<input />",{type:"checkbox",name:"recipients",class:"form-check-input t3js-workspace-recipient",id:e.name,value:e.value}).prop("checked",e.checked).prop("disabled",e.disabled),o.default("<label />",{class:"form-check-label",for:e.name}).text(e.label)))}void 0!==t.additional&&a.append(o.default("<div />",{class:"form-group"}).append(o.default("<label />",{class:"control-label",for:"additional"}).text(TYPO3.lang["window.sendToNextStageWindow.additionalRecipients"]),o.default("<textarea />",{class:"form-control",name:"additional",id:"additional"}).text(t.additional.value),o.default("<span />",{class:"help-block"}).text(TYPO3.lang["window.sendToNextStageWindow.additionalRecipients.hint"]))),a.append(o.default("<div />",{class:"form-group"}).append(o.default("<label />",{class:"control-label",for:"comments"}).text(TYPO3.lang["window.sendToNextStageWindow.comments"]),o.default("<textarea />",{class:"form-control",name:"comments",id:"comments"}).text(t.comments.value)));const s=l.show(TYPO3.lang.actionSendToStage,a,n.SeverityEnum.info,[{text:TYPO3.lang.cancel,active:!0,btnClass:"btn-default",name:"cancel",trigger:()=>{s.modal("hide")}},{text:TYPO3.lang.ok,btnClass:"btn-info",name:"ok"}]);return s}checkIntegrity(e){return this.sendRemoteRequest(this.generateRemotePayload("checkIntegrity",e))}sendRemoteRequest(e){return new a(TYPO3.settings.ajaxUrls.workspace_dispatch).post(e,{headers:{"Content-Type":"application/json; charset=utf-8"}})}generateRemotePayload(e,t={}){return this.generateRemotePayloadBody("RemoteServer",e,t)}generateRemoteMassActionsPayload(e,t={}){return this.generateRemotePayloadBody("MassActions",e,t)}generateRemoteActionsPayload(e,t={}){return this.generateRemotePayloadBody("Actions",e,t)}generateRemotePayloadBody(e,t,a){return a instanceof Array?a.push(TYPO3.settings.Workspaces.token):a=[a,TYPO3.settings.Workspaces.token],{action:e,data:a,method:t,type:"rpc",tid:this.tid++}}}}));
\ No newline at end of file
-- 
GitLab