diff --git a/Build/Sources/TypeScript/workspaces/backend.ts b/Build/Sources/TypeScript/workspaces/backend.ts
index 8135d8316f72..306849e2ab6e 100644
--- a/Build/Sources/TypeScript/workspaces/backend.ts
+++ b/Build/Sources/TypeScript/workspaces/backend.ts
@@ -49,14 +49,7 @@ enum Identifiers {
}
type Diff = { field: string, label: string, content: string, html: string };
-type Comment = {
- user_comment: string;
- previous_stage_title: string;
- stage_title: string;
- tstamp: number;
- user_username: string;
- user_avatar: string
-}
+
type History = {
differences: string | Diff[];
datetime: string;
@@ -93,6 +86,7 @@ class Backend extends Workspaces {
super();
topLevelModuleImport('@typo3/workspaces/renderable/send-to-stage-form.js');
+ topLevelModuleImport('@typo3/workspaces/renderable/comment-view.js');
DocumentService.ready().then((): void => {
this.getElements();
@@ -144,36 +138,11 @@ class Backend extends Workspaces {
* @param {Object} comments
* @return {$}
*/
- private static generateCommentView(comments: Comment[]): JQuery {
- const $comments = $('
');
-
- for (const comment of comments) {
- const $panel = $('
', { class: 'panel panel-default' });
-
- if (comment.user_comment.length > 0) {
- $panel.append(
- $('
', { class: 'panel-body' }).html(comment.user_comment),
- );
- }
-
- $panel.append(
- $('
', { class: 'panel-footer' }).append(
- $(' ', { class: 'badge badge-success me-2' }).text(comment.previous_stage_title + ' > ' + comment.stage_title),
- $(' ', { class: 'badge badge-info' }).text(comment.tstamp),
- ),
- );
-
- $comments.append(
- $('
', { class: 'media' }).append(
- $('
', { class: 'media-left text-center' }).text(comment.user_username).prepend(
- $('
').html(comment.user_avatar),
- ),
- $('
', { class: 'media-body' }).append($panel),
- ),
- );
- }
+ private static generateCommentView(comments: any[]): HTMLElement {
+ const commentView = document.createElement('typo3-workspaces-comment-view');
+ commentView.comments = comments;
- return $comments;
+ return commentView;
}
/**
diff --git a/Build/Sources/TypeScript/workspaces/renderable/comment-view.ts b/Build/Sources/TypeScript/workspaces/renderable/comment-view.ts
new file mode 100644
index 000000000000..f40736cc1433
--- /dev/null
+++ b/Build/Sources/TypeScript/workspaces/renderable/comment-view.ts
@@ -0,0 +1,78 @@
+/*
+ * This file is part of the TYPO3 CMS project.
+ *
+ * It is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License, either version 2
+ * of the License, or any later version.
+ *
+ * For the full copyright and license information, please read the
+ * LICENSE.txt file that was distributed with this source code.
+ *
+ * The TYPO3 project - inspiring people to share!
+ */
+
+import { customElement, property } from 'lit/decorators';
+import { html, LitElement, nothing, TemplateResult } from 'lit';
+import { repeat } from 'lit/directives/repeat';
+import { unsafeHTML } from 'lit/directives/unsafe-html';
+
+type Comment = {
+ user_comment: string;
+ previous_stage_title: string;
+ stage_title: string;
+ tstamp: number;
+ user_username: string;
+ user_avatar: string
+}
+
+@customElement('typo3-workspaces-comment-view')
+export class CommentViewElement extends LitElement {
+ @property({ type: Array })
+ public comments: Comment[] = [];
+
+ protected createRenderRoot(): HTMLElement | ShadowRoot {
+ // @todo Switch to Shadow DOM once Bootstrap CSS style can be applied correctly
+ return this;
+ }
+
+ protected render(): TemplateResult {
+ return html`
+
+ ${repeat(this.comments, (comment) => comment.tstamp, (comment) => this.renderComment(comment))}
+
+ `;
+ }
+
+ protected renderComment(comment: Comment): TemplateResult {
+ return html`
+
+ `;
+ }
+}
+
+declare global {
+ interface HTMLElementTagNameMap {
+ 'typo3-workspaces-comment-view': CommentViewElement;
+ }
+}
diff --git a/typo3/sysext/workspaces/Resources/Public/JavaScript/backend.js b/typo3/sysext/workspaces/Resources/Public/JavaScript/backend.js
index f59826f1ec5d..df8f96b69f58 100644
--- a/typo3/sysext/workspaces/Resources/Public/JavaScript/backend.js
+++ b/typo3/sysext/workspaces/Resources/Public/JavaScript/backend.js
@@ -10,4 +10,4 @@
*
* The TYPO3 project - inspiring people to share!
*/
-import DocumentService from"@typo3/core/document-service.js";import $ from"jquery";import"@typo3/backend/element/icon-element.js";import{SeverityEnum}from"@typo3/backend/enum/severity.js";import"@typo3/backend/input/clearable.js";import"@typo3/workspaces/renderable/record-table.js";import Workspaces from"@typo3/workspaces/workspaces.js";import{default as Modal}from"@typo3/backend/modal.js";import Persistent from"@typo3/backend/storage/persistent.js";import Utility from"@typo3/backend/utility.js";import Wizard from"@typo3/backend/wizard.js";import SecurityUtility from"@typo3/core/security-utility.js";import windowManager from"@typo3/backend/window-manager.js";import RegularEvent from"@typo3/core/event/regular-event.js";import{topLevelModuleImport}from"@typo3/backend/utility/top-level-module-import.js";import{selector}from"@typo3/core/literals.js";import IconHelper from"@typo3/workspaces/utility/icon-helper.js";var Identifiers;!function(e){e.searchForm="#workspace-settings-form",e.searchTextField='#workspace-settings-form input[name="search-text"]',e.searchSubmitBtn='#workspace-settings-form button[type="submit"]',e.depthSelector='#workspace-settings-form [name="depth"]',e.languageSelector='#workspace-settings-form select[name="languages"]',e.stagesSelector='#workspace-settings-form select[name="stages"]',e.workspaceActions=".workspace-actions",e.chooseStageAction='.workspace-actions [name="stage-action"]',e.chooseSelectionAction='.workspace-actions [name="selection-action"]',e.chooseMassAction='.workspace-actions [name="mass-action"]',e.container="#workspace-panel",e.contentsContainer="#workspace-contents",e.noContentsContainer="#workspace-contents-empty",e.previewLinksButton=".t3js-preview-link",e.pagination="#workspace-pagination"}(Identifiers||(Identifiers={}));class Backend extends Workspaces{constructor(){super(),this.elements={},this.settings={dir:"ASC",id:TYPO3.settings.Workspaces.id,depth:1,language:"all",limit:30,query:"",sort:"label_Live",start:0,filterTxt:""},this.paging={currentPage:1,totalPages:1,totalItems:0},this.markedRecordsForMassAction=[],this.indentationPadding=26,this.handleCheckboxStateChanged=e=>{const t=$(e.target),a=t.parents("tr"),s=t.prop("checked"),n=a.data("table")+":"+a.data("uid")+":"+a.data("t3ver_oid");if(s)this.markedRecordsForMassAction.push(n);else{const e=this.markedRecordsForMassAction.indexOf(n);e>-1&&this.markedRecordsForMassAction.splice(e,1)}a.data("collectionCurrent")?Backend.changeCollectionChildrenState(a.data("collectionCurrent"),s):a.data("collection")&&(Backend.changeCollectionChildrenState(a.data("collection"),s),Backend.changeCollectionParentState(a.data("collection"),s)),this.elements.$chooseMassAction.prop("disabled",this.markedRecordsForMassAction.length>0)},this.viewChanges=e=>{e.preventDefault();const t=$(e.currentTarget).closest("tr");this.sendRemoteRequest(this.generateRemotePayload("getRowDetails",{stage:t.data("stage"),t3ver_oid:t.data("t3ver_oid"),table:t.data("table"),uid:t.data("uid"),filterFields:!0})).then((async e=>{const a=(await e.resolve())[0].result.data[0],s=$("
"),n=$("",{class:"nav nav-tabs",role:"tablist"}),i=$("
",{class:"tab-content"}),o=[];s.append($("
").html(TYPO3.lang.path.replace("{0}",a.path_Live)),$("
").html(TYPO3.lang.current_step.replace("{0}",a.label_Stage).replace("{1}",a.stage_position).replace("{2}",a.stage_count))),a.diff.length>0&&(n.append($(" ",{role:"presentation",class:"nav-item"}).append($(" ",{class:"nav-link",href:"#workspace-changes","aria-controls":"workspace-changes",role:"tab","data-bs-toggle":"tab"}).text(TYPO3.lang["window.recordChanges.tabs.changeSummary"]))),i.append($("
",{role:"tabpanel",class:"tab-pane",id:"workspace-changes"}).append($("
",{class:"form-section"}).append(Backend.generateDiffView(a.diff))))),a.comments.length>0&&(n.append($(" ",{role:"presentation",class:"nav-item"}).append($(" ",{class:"nav-link",href:"#workspace-comments","aria-controls":"workspace-comments",role:"tab","data-bs-toggle":"tab"}).html(TYPO3.lang["window.recordChanges.tabs.comments"]+" ").append($(" ",{class:"badge"}).text(a.comments.length)))),i.append($("
",{role:"tabpanel",class:"tab-pane",id:"workspace-comments"}).append($("
",{class:"form-section"}).append(Backend.generateCommentView(a.comments))))),a.history.total>0&&(n.append($(" ",{role:"presentation",class:"nav-item"}).append($(" ",{class:"nav-link",href:"#workspace-history","aria-controls":"workspace-history",role:"tab","data-bs-toggle":"tab"}).text(TYPO3.lang["window.recordChanges.tabs.history"]))),i.append($("
",{role:"tabpanel",class:"tab-pane",id:"workspace-history"}).append($("
",{class:"form-section"}).append(Backend.generateHistoryView(a.history.data))))),n.find("li > a").first().addClass("active"),i.find(".tab-pane").first().addClass("active"),s.append($("
").append(n,i)),!1!==a.label_PrevStage&&t.data("stage")!==t.data("prevStage")&&o.push({text:a.label_PrevStage.title,active:!0,btnClass:"btn-default",name:"prevstage",trigger:(e,a)=>{a.hideModal(),this.sendToStage(t,"prev")}}),!1!==a.label_NextStage&&o.push({text:a.label_NextStage.title,active:!0,btnClass:"btn-default",name:"nextstage",trigger:(e,a)=>{a.hideModal(),this.sendToStage(t,"next")}}),o.push({text:TYPO3.lang.close,active:!0,btnClass:"btn-info",name:"cancel",trigger:(e,t)=>t.hideModal()}),Modal.advanced({type:Modal.types.default,title:TYPO3.lang["window.recordInformation"].replace("{0}",t.find(".t3js-title-live").text().trim()),content:s,severity:SeverityEnum.info,buttons:o,size:Modal.sizes.medium})}))},this.confirmDeleteRecordFromWorkspace=e=>{const t=$(e.target).closest("tr"),a=Modal.confirm(TYPO3.lang["window.discard.title"],TYPO3.lang["window.discard.message"],SeverityEnum.warning,[{text:TYPO3.lang.cancel,active:!0,btnClass:"btn-default",name:"cancel",trigger:()=>{a.hideModal()}},{text:TYPO3.lang.ok,btnClass:"btn-warning",name:"ok"}]);a.addEventListener("button.clicked",(e=>{"ok"===e.target.name&&this.sendRemoteRequest([this.generateRemoteActionsPayload("deleteSingleRecord",[t.data("table"),t.data("uid")])]).then((()=>{a.hideModal(),this.getWorkspaceInfos(),Backend.refreshPageTree()}))}))},this.runSelectionAction=e=>{const t=$(e.currentTarget).val(),a="discard"!==t;if(0===t.length)return;const s=[];for(let e=0;e{Wizard.setForceSelection(!1),"warning"===(await e.resolve())[0].result.result&&this.addIntegrityCheckWarningToWizard(),this.renderSelectionActionWizard(t,s)})):(Wizard.setForceSelection(!1),this.renderSelectionActionWizard(t,s))},this.addIntegrityCheckWarningToWizard=()=>{Wizard.addSlide("integrity-warning","Warning",TYPO3.lang["integrity.hasIssuesDescription"]+" "+TYPO3.lang["integrity.hasIssuesQuestion"],SeverityEnum.warning)},this.runMassAction=e=>{const t=$(e.currentTarget).val(),a="discard"!==t;0!==t.length&&(a?this.checkIntegrity({language:this.settings.language,type:t}).then((async e=>{Wizard.setForceSelection(!1),"warning"===(await e.resolve())[0].result.result&&this.addIntegrityCheckWarningToWizard(),this.renderMassActionWizard(t)})):(Wizard.setForceSelection(!1),this.renderMassActionWizard(t)))},this.sendToSpecificStageAction=e=>{const t=[],a=$(e.currentTarget).val();for(let e=0;e{const s=this.renderSendToStageWindow(await e.resolve());s.addEventListener("button.clicked",(e=>{if("ok"===e.target.name){const e=Utility.convertFormToObject(s.querySelector("form"));e.affects={elements:t,nextStage:a},this.sendRemoteRequest([this.generateRemoteActionsPayload("sendToSpecificStageExecute",[e]),this.generateRemotePayload("getWorkspaceInfos",this.settings)]).then((async e=>{const t=await e.resolve();s.hideModal(),this.renderWorkspaceInfos(t[1].result),Backend.refreshPageTree()}))}})),s.addEventListener("typo3-modal-hide",(()=>{this.elements.$chooseStageAction.val("")}))}))},this.generatePreviewLinks=()=>{this.sendRemoteRequest(this.generateRemoteActionsPayload("generateWorkspacePreviewLinksForAllLanguages",[this.settings.id])).then((async e=>{const t=(await e.resolve())[0].result,a=$(" ");for(const[e,s]of Object.entries(t))a.append($(" ").text(e),$(" ").append($(" ",{href:s,target:"_blank"}).text(s)));Modal.show(TYPO3.lang.previewLink,a,SeverityEnum.info,[{text:TYPO3.lang.ok,active:!0,btnClass:"btn-info",name:"ok",trigger:(e,t)=>t.hideModal()}],["modal-inner-scroll"])}))},topLevelModuleImport("@typo3/workspaces/renderable/send-to-stage-form.js"),DocumentService.ready().then((()=>{this.getElements(),this.registerEvents(),this.notifyWorkspaceSwitchAction(),this.settings.depth=this.elements.$depthSelector.val(),this.settings.language=this.elements.$languageSelector.val(),this.settings.stage=this.elements.$stagesSelector.val(),this.elements.$container.length&&this.getWorkspaceInfos()}))}static refreshPageTree(){top.document.dispatchEvent(new CustomEvent("typo3:pagetree:refresh"))}static generateDiffView(e){const t=$("
",{class:"diff"});for(const a of e)t.append($("
",{class:"diff-item"}).append($("
",{class:"diff-item-title"}).text(a.label),$("
",{class:"diff-item-result"}).html(a.content)));return t}static generateCommentView(e){const t=$("
");for(const a of e){const e=$("
",{class:"panel panel-default"});a.user_comment.length>0&&e.append($("
",{class:"panel-body"}).html(a.user_comment)),e.append($("
",{class:"panel-footer"}).append($(" ",{class:"badge badge-success me-2"}).text(a.previous_stage_title+" > "+a.stage_title),$(" ",{class:"badge badge-info"}).text(a.tstamp))),t.append($("
",{class:"media"}).append($("
",{class:"media-left text-center"}).text(a.user_username).prepend($("
").html(a.user_avatar)),$("
",{class:"media-body"}).append(e)))}return t}static generateHistoryView(e){const t=$("
");for(const a of e){const e=$("
",{class:"panel panel-default"});let s;if("object"==typeof a.differences){if(0===a.differences.length)continue;s=$("
",{class:"diff"});for(let e=0;e ",{class:"diff-item"}).append($("
",{class:"diff-item-title"}).text(a.differences[e].label),$("
",{class:"diff-item-result"}).html(a.differences[e].html)));e.append($("
").append(s))}else e.append($("
",{class:"panel-body"}).text(a.differences));e.append($("
",{class:"panel-footer"}).append($(" ",{class:"badge badge-info"}).text(a.datetime))),t.append($("
",{class:"media"}).append($("
",{class:"media-left text-center"}).text(a.user).prepend($("
").html(a.user_avatar)),$("
",{class:"media-body"}).append(e)))}return t}static changeCollectionParentState(e,t){const a=document.querySelector('tr[data-collection-current="'+e+'"] input[type=checkbox]');null!==a&&a.checked!==t&&(a.checked=t,a.dataset.manuallyChanged="true",a.dispatchEvent(new CustomEvent("multiRecordSelection:checkbox:state:changed",{bubbles:!0,cancelable:!1})))}static changeCollectionChildrenState(e,t){const a=document.querySelectorAll(selector`tr[data-collection="${e}"] input[type=checkbox]`);a.length&&a.forEach((e=>{e.checked!==t&&(e.checked=t,e.dataset.manuallyChanged="true",e.dispatchEvent(new CustomEvent("multiRecordSelection:checkbox:state:changed",{bubbles:!0,cancelable:!1})))}))}notifyWorkspaceSwitchAction(){const e=document.querySelector("main[data-workspace-switch-action]");if(e.dataset.workspaceSwitchAction){const t=JSON.parse(e.dataset.workspaceSwitchAction);top.TYPO3.WorkspacesMenu.performWorkspaceSwitch(t.id,t.title),top.document.dispatchEvent(new CustomEvent("typo3:pagetree:refresh")),top.TYPO3.ModuleMenu.App.refreshMenu()}}checkIntegrity(e){return this.sendRemoteRequest(this.generateRemotePayload("checkIntegrity",e))}getElements(){this.elements.$searchForm=$(Identifiers.searchForm),this.elements.$searchTextField=$(Identifiers.searchTextField),this.elements.$searchSubmitBtn=$(Identifiers.searchSubmitBtn),this.elements.$depthSelector=$(Identifiers.depthSelector),this.elements.$languageSelector=$(Identifiers.languageSelector),this.elements.$stagesSelector=$(Identifiers.stagesSelector),this.elements.$container=$(Identifiers.container),this.elements.$contentsContainer=$(Identifiers.contentsContainer),this.elements.$noContentsContainer=$(Identifiers.noContentsContainer),this.elements.$tableBody=this.elements.$contentsContainer.find("tbody"),this.elements.$workspaceActions=$(Identifiers.workspaceActions),this.elements.$chooseStageAction=$(Identifiers.chooseStageAction),this.elements.$chooseSelectionAction=$(Identifiers.chooseSelectionAction),this.elements.$chooseMassAction=$(Identifiers.chooseMassAction),this.elements.$previewLinksButton=$(Identifiers.previewLinksButton),this.elements.$pagination=$(Identifiers.pagination)}registerEvents(){$(document).on("click",'[data-action="publish"]',(e=>{const t=e.target.closest("tr");this.checkIntegrity({selection:[{liveId:t.dataset.uid,versionId:t.dataset.t3ver_oid,table:t.dataset.table}],type:"selection"}).then((async e=>{"warning"===(await e.resolve())[0].result.result&&this.addIntegrityCheckWarningToWizard(),Wizard.setForceSelection(!1),Wizard.addSlide("publish-confirm","Publish",TYPO3.lang["window.publish.message"],SeverityEnum.info),Wizard.addFinalProcessingSlide((()=>{this.sendRemoteRequest(this.generateRemoteActionsPayload("publishSingleRecord",[t.dataset.table,t.dataset.t3ver_oid,t.dataset.uid])).then((()=>{Wizard.dismiss(),this.getWorkspaceInfos(),Backend.refreshPageTree()}))})).then((()=>{Wizard.show()}))}))})).on("click",'[data-action="prevstage"]',(e=>{this.sendToStage($(e.currentTarget).closest("tr"),"prev")})).on("click",'[data-action="nextstage"]',(e=>{this.sendToStage($(e.currentTarget).closest("tr"),"next")})).on("click",'[data-action="changes"]',this.viewChanges).on("click",'[data-action="preview"]',this.openPreview.bind(this)).on("click",'[data-action="open"]',(e=>{const t=e.currentTarget.closest("tr"),a=TYPO3.settings.FormEngine.moduleUrl+"&returnUrl="+encodeURIComponent(document.location.href)+"&id="+TYPO3.settings.Workspaces.id+"&edit["+t.dataset.table+"]["+t.dataset.uid+"]=edit";window.location.href=a})).on("click",'[data-action="version"]',(e=>{const t=e.currentTarget.closest("tr"),a="pages"===t.dataset.table?t.dataset.t3ver_oid:t.dataset.pid;window.location.href=TYPO3.settings.WebLayout.moduleUrl+"&id="+a})).on("click",'[data-action="remove"]',this.confirmDeleteRecordFromWorkspace).on("click",'[data-action="expand"]',(e=>{const t=$(e.currentTarget);let a;a="true"===t.first().attr("aria-expanded")?"actions-caret-down":"actions-caret-right",t.empty().append(IconHelper.getIcon(a))})),$(window.top.document).on("click",".t3js-workspace-recipients-selectall",(()=>{$(".t3js-workspace-recipient",window.top.document).not(":disabled").prop("checked",!0)})).on("click",".t3js-workspace-recipients-deselectall",(()=>{$(".t3js-workspace-recipient",window.top.document).not(":disabled").prop("checked",!1)})),this.elements.$searchForm.on("submit",(e=>{e.preventDefault(),this.settings.filterTxt=this.elements.$searchTextField.val(),this.getWorkspaceInfos()})),this.elements.$searchTextField.on("keyup",(e=>{""!==e.target.value?this.elements.$searchSubmitBtn.removeClass("disabled"):(this.elements.$searchSubmitBtn.addClass("disabled"),this.getWorkspaceInfos())}));const e=this.elements.$searchTextField.get(0);void 0!==e&&e.clearable({onClear:()=>{this.elements.$searchSubmitBtn.addClass("disabled"),this.settings.filterTxt="",this.getWorkspaceInfos()}}),new RegularEvent("multiRecordSelection:checkbox:state:changed",this.handleCheckboxStateChanged).bindTo(document),this.elements.$depthSelector.on("change",(e=>{const t=e.target.value;Persistent.set("moduleData.workspaces_admin.depth",t),this.settings.depth=t,this.getWorkspaceInfos()})),this.elements.$previewLinksButton.on("click",this.generatePreviewLinks),this.elements.$languageSelector.on("change",(e=>{const t=$(e.target);Persistent.set("moduleData.workspaces_admin.language",t.val()),this.settings.language=t.val(),this.sendRemoteRequest(this.generateRemotePayload("getWorkspaceInfos",this.settings)).then((async e=>{const a=await e.resolve();this.elements.$languageSelector.prev().html(t.find(":selected").data("icon")),this.renderWorkspaceInfos(a[0].result)}))})),this.elements.$stagesSelector.on("change",(e=>{const t=e.target.value;Persistent.set("moduleData.workspaces_admin.stage",t),this.settings.stage=t,this.getWorkspaceInfos()})),this.elements.$chooseStageAction.on("change",this.sendToSpecificStageAction),this.elements.$chooseSelectionAction.on("change",this.runSelectionAction),this.elements.$chooseMassAction.on("change",this.runMassAction),this.elements.$pagination.on("click","[data-action]",(e=>{e.preventDefault();const t=$(e.currentTarget);let a=!1;switch(t.data("action")){case"previous":this.paging.currentPage>1&&(this.paging.currentPage--,a=!0);break;case"next":this.paging.currentPage{const s=this.renderSendToStageWindow(await t.resolve());s.addEventListener("button.clicked",(t=>{if("ok"===t.target.name){const t=Utility.convertFormToObject(s.querySelector("form"));t.affects={table:e.data("table"),nextStage:a,t3ver_oid:e.data("t3ver_oid"),uid:e.data("uid"),elements:[]},this.sendRemoteRequest([this.generateRemoteActionsPayload(n,[t]),this.generateRemotePayload("getWorkspaceInfos",this.settings)]).then((async e=>{const t=await e.resolve();s.hideModal(),this.renderWorkspaceInfos(t[1].result),Backend.refreshPageTree()}))}}))}))}getWorkspaceInfos(){this.sendRemoteRequest(this.generateRemotePayload("getWorkspaceInfos",this.settings)).then((async e=>{this.renderWorkspaceInfos((await e.resolve())[0].result)}))}renderWorkspaceInfos(e){this.resetMassActionState(e.data.length),this.buildPagination(e.total),0===e.total?(this.elements.$contentsContainer.hide(),this.elements.$noContentsContainer.show()):(this.elements.$contentsContainer.show(),this.elements.$noContentsContainer.hide());document.querySelector("typo3-workspaces-record-table").results=e.data}buildPagination(e){if(0===e)return void this.elements.$pagination.contents().remove();if(this.paging.totalItems=e,this.paging.totalPages=Math.ceil(e/parseInt(this.settings.limit.toString(),10)),1===this.paging.totalPages)return void this.elements.$pagination.contents().remove();const t=$("",{class:"pagination"}),a=[],s=$(" ",{class:"page-item"}).append($(" ",{class:"page-link",type:"button","data-action":"previous"}).append($(" ",{identifier:"actions-arrow-left-alt",size:"small"}))),n=$(" ",{class:"page-item"}).append($(" ",{class:"page-link",type:"button","data-action":"next"}).append($(" ",{identifier:"actions-arrow-right-alt",size:"small"})));1===this.paging.currentPage&&s.addClass("disabled").find("button").prop("disabled",!0),this.paging.currentPage===this.paging.totalPages&&n.addClass("disabled").find("button").prop("disabled",!0);for(let e=1;e<=this.paging.totalPages;e++){const t=$(" ",{class:"page-item"+(this.paging.currentPage===e?" active":"")});t.append($(" ",{class:"page-link",type:"button","data-action":"page","data-page":e}).append($(" ").text(e))),a.push(t)}t.append(s,a,n),this.elements.$pagination.empty().append(t)}openPreview(e){const t=$(e.currentTarget).closest("tr");this.sendRemoteRequest(this.generateRemoteActionsPayload("viewSingleRecord",[t.data("table"),t.data("uid")])).then((async e=>{const t=(await e.resolve())[0].result;windowManager.localOpen(t)}))}renderSelectionActionWizard(e,t){Wizard.addSlide("mass-action-confirmation",TYPO3.lang["window.selectionAction.title"],""+(new SecurityUtility).encodeHtml(TYPO3.lang["tooltip."+e+"Selected"])+"
",SeverityEnum.warning),Wizard.addFinalProcessingSlide((()=>{this.sendRemoteRequest(this.generateRemoteActionsPayload("executeSelectionAction",{action:e,selection:t})).then((()=>{this.markedRecordsForMassAction=[],this.getWorkspaceInfos(),Wizard.dismiss(),Backend.refreshPageTree()}))})).then((()=>{Wizard.show(),Wizard.getComponent().on("wizard-dismissed",(()=>{this.elements.$chooseSelectionAction.val("")}))}))}renderMassActionWizard(e){let t;switch(e){case"publish":t="publishWorkspace";break;case"discard":t="flushWorkspace";break;default:throw"Invalid mass action "+e+" called."}const a=new SecurityUtility;Wizard.setForceSelection(!1),Wizard.addSlide("mass-action-confirmation",TYPO3.lang["window.massAction.title"],""+a.encodeHtml(TYPO3.lang["tooltip."+e+"All"])+" "+a.encodeHtml(TYPO3.lang["tooltip.affectWholeWorkspace"])+"
",SeverityEnum.warning);const s=async e=>{const a=(await e.resolve())[0].result;a.processed{this.sendRemoteRequest(this.generateRemoteMassActionsPayload(t,{init:!0,total:0,processed:0,language:this.settings.language})).then(s)})).then((()=>{Wizard.show(),Wizard.getComponent().on("wizard-dismissed",(()=>{this.elements.$chooseMassAction.val("")}))}))}resetMassActionState(e){this.markedRecordsForMassAction=[],e&&(this.elements.$workspaceActions.removeClass("hidden"),this.elements.$chooseMassAction.prop("disabled",!1)),document.dispatchEvent(new CustomEvent("multiRecordSelection:actions:hide"))}}export default new Backend;
\ No newline at end of file
+import DocumentService from"@typo3/core/document-service.js";import $ from"jquery";import"@typo3/backend/element/icon-element.js";import{SeverityEnum}from"@typo3/backend/enum/severity.js";import"@typo3/backend/input/clearable.js";import"@typo3/workspaces/renderable/record-table.js";import Workspaces from"@typo3/workspaces/workspaces.js";import{default as Modal}from"@typo3/backend/modal.js";import Persistent from"@typo3/backend/storage/persistent.js";import Utility from"@typo3/backend/utility.js";import Wizard from"@typo3/backend/wizard.js";import SecurityUtility from"@typo3/core/security-utility.js";import windowManager from"@typo3/backend/window-manager.js";import RegularEvent from"@typo3/core/event/regular-event.js";import{topLevelModuleImport}from"@typo3/backend/utility/top-level-module-import.js";import{selector}from"@typo3/core/literals.js";import IconHelper from"@typo3/workspaces/utility/icon-helper.js";var Identifiers;!function(e){e.searchForm="#workspace-settings-form",e.searchTextField='#workspace-settings-form input[name="search-text"]',e.searchSubmitBtn='#workspace-settings-form button[type="submit"]',e.depthSelector='#workspace-settings-form [name="depth"]',e.languageSelector='#workspace-settings-form select[name="languages"]',e.stagesSelector='#workspace-settings-form select[name="stages"]',e.workspaceActions=".workspace-actions",e.chooseStageAction='.workspace-actions [name="stage-action"]',e.chooseSelectionAction='.workspace-actions [name="selection-action"]',e.chooseMassAction='.workspace-actions [name="mass-action"]',e.container="#workspace-panel",e.contentsContainer="#workspace-contents",e.noContentsContainer="#workspace-contents-empty",e.previewLinksButton=".t3js-preview-link",e.pagination="#workspace-pagination"}(Identifiers||(Identifiers={}));class Backend extends Workspaces{constructor(){super(),this.elements={},this.settings={dir:"ASC",id:TYPO3.settings.Workspaces.id,depth:1,language:"all",limit:30,query:"",sort:"label_Live",start:0,filterTxt:""},this.paging={currentPage:1,totalPages:1,totalItems:0},this.markedRecordsForMassAction=[],this.indentationPadding=26,this.handleCheckboxStateChanged=e=>{const t=$(e.target),a=t.parents("tr"),s=t.prop("checked"),n=a.data("table")+":"+a.data("uid")+":"+a.data("t3ver_oid");if(s)this.markedRecordsForMassAction.push(n);else{const e=this.markedRecordsForMassAction.indexOf(n);e>-1&&this.markedRecordsForMassAction.splice(e,1)}a.data("collectionCurrent")?Backend.changeCollectionChildrenState(a.data("collectionCurrent"),s):a.data("collection")&&(Backend.changeCollectionChildrenState(a.data("collection"),s),Backend.changeCollectionParentState(a.data("collection"),s)),this.elements.$chooseMassAction.prop("disabled",this.markedRecordsForMassAction.length>0)},this.viewChanges=e=>{e.preventDefault();const t=$(e.currentTarget).closest("tr");this.sendRemoteRequest(this.generateRemotePayload("getRowDetails",{stage:t.data("stage"),t3ver_oid:t.data("t3ver_oid"),table:t.data("table"),uid:t.data("uid"),filterFields:!0})).then((async e=>{const a=(await e.resolve())[0].result.data[0],s=$("
"),n=$("",{class:"nav nav-tabs",role:"tablist"}),i=$("
",{class:"tab-content"}),o=[];s.append($("
").html(TYPO3.lang.path.replace("{0}",a.path_Live)),$("
").html(TYPO3.lang.current_step.replace("{0}",a.label_Stage).replace("{1}",a.stage_position).replace("{2}",a.stage_count))),a.diff.length>0&&(n.append($(" ",{role:"presentation",class:"nav-item"}).append($(" ",{class:"nav-link",href:"#workspace-changes","aria-controls":"workspace-changes",role:"tab","data-bs-toggle":"tab"}).text(TYPO3.lang["window.recordChanges.tabs.changeSummary"]))),i.append($("
",{role:"tabpanel",class:"tab-pane",id:"workspace-changes"}).append($("
",{class:"form-section"}).append(Backend.generateDiffView(a.diff))))),a.comments.length>0&&(n.append($(" ",{role:"presentation",class:"nav-item"}).append($(" ",{class:"nav-link",href:"#workspace-comments","aria-controls":"workspace-comments",role:"tab","data-bs-toggle":"tab"}).html(TYPO3.lang["window.recordChanges.tabs.comments"]+" ").append($(" ",{class:"badge"}).text(a.comments.length)))),i.append($("
",{role:"tabpanel",class:"tab-pane",id:"workspace-comments"}).append($("
",{class:"form-section"}).append(Backend.generateCommentView(a.comments))))),a.history.total>0&&(n.append($(" ",{role:"presentation",class:"nav-item"}).append($(" ",{class:"nav-link",href:"#workspace-history","aria-controls":"workspace-history",role:"tab","data-bs-toggle":"tab"}).text(TYPO3.lang["window.recordChanges.tabs.history"]))),i.append($("
",{role:"tabpanel",class:"tab-pane",id:"workspace-history"}).append($("
",{class:"form-section"}).append(Backend.generateHistoryView(a.history.data))))),n.find("li > a").first().addClass("active"),i.find(".tab-pane").first().addClass("active"),s.append($("
").append(n,i)),!1!==a.label_PrevStage&&t.data("stage")!==t.data("prevStage")&&o.push({text:a.label_PrevStage.title,active:!0,btnClass:"btn-default",name:"prevstage",trigger:(e,a)=>{a.hideModal(),this.sendToStage(t,"prev")}}),!1!==a.label_NextStage&&o.push({text:a.label_NextStage.title,active:!0,btnClass:"btn-default",name:"nextstage",trigger:(e,a)=>{a.hideModal(),this.sendToStage(t,"next")}}),o.push({text:TYPO3.lang.close,active:!0,btnClass:"btn-info",name:"cancel",trigger:(e,t)=>t.hideModal()}),Modal.advanced({type:Modal.types.default,title:TYPO3.lang["window.recordInformation"].replace("{0}",t.find(".t3js-title-live").text().trim()),content:s,severity:SeverityEnum.info,buttons:o,size:Modal.sizes.medium})}))},this.confirmDeleteRecordFromWorkspace=e=>{const t=$(e.target).closest("tr"),a=Modal.confirm(TYPO3.lang["window.discard.title"],TYPO3.lang["window.discard.message"],SeverityEnum.warning,[{text:TYPO3.lang.cancel,active:!0,btnClass:"btn-default",name:"cancel",trigger:()=>{a.hideModal()}},{text:TYPO3.lang.ok,btnClass:"btn-warning",name:"ok"}]);a.addEventListener("button.clicked",(e=>{"ok"===e.target.name&&this.sendRemoteRequest([this.generateRemoteActionsPayload("deleteSingleRecord",[t.data("table"),t.data("uid")])]).then((()=>{a.hideModal(),this.getWorkspaceInfos(),Backend.refreshPageTree()}))}))},this.runSelectionAction=e=>{const t=$(e.currentTarget).val(),a="discard"!==t;if(0===t.length)return;const s=[];for(let e=0;e{Wizard.setForceSelection(!1),"warning"===(await e.resolve())[0].result.result&&this.addIntegrityCheckWarningToWizard(),this.renderSelectionActionWizard(t,s)})):(Wizard.setForceSelection(!1),this.renderSelectionActionWizard(t,s))},this.addIntegrityCheckWarningToWizard=()=>{Wizard.addSlide("integrity-warning","Warning",TYPO3.lang["integrity.hasIssuesDescription"]+" "+TYPO3.lang["integrity.hasIssuesQuestion"],SeverityEnum.warning)},this.runMassAction=e=>{const t=$(e.currentTarget).val(),a="discard"!==t;0!==t.length&&(a?this.checkIntegrity({language:this.settings.language,type:t}).then((async e=>{Wizard.setForceSelection(!1),"warning"===(await e.resolve())[0].result.result&&this.addIntegrityCheckWarningToWizard(),this.renderMassActionWizard(t)})):(Wizard.setForceSelection(!1),this.renderMassActionWizard(t)))},this.sendToSpecificStageAction=e=>{const t=[],a=$(e.currentTarget).val();for(let e=0;e{const s=this.renderSendToStageWindow(await e.resolve());s.addEventListener("button.clicked",(e=>{if("ok"===e.target.name){const e=Utility.convertFormToObject(s.querySelector("form"));e.affects={elements:t,nextStage:a},this.sendRemoteRequest([this.generateRemoteActionsPayload("sendToSpecificStageExecute",[e]),this.generateRemotePayload("getWorkspaceInfos",this.settings)]).then((async e=>{const t=await e.resolve();s.hideModal(),this.renderWorkspaceInfos(t[1].result),Backend.refreshPageTree()}))}})),s.addEventListener("typo3-modal-hide",(()=>{this.elements.$chooseStageAction.val("")}))}))},this.generatePreviewLinks=()=>{this.sendRemoteRequest(this.generateRemoteActionsPayload("generateWorkspacePreviewLinksForAllLanguages",[this.settings.id])).then((async e=>{const t=(await e.resolve())[0].result,a=$(" ");for(const[e,s]of Object.entries(t))a.append($(" ").text(e),$(" ").append($(" ",{href:s,target:"_blank"}).text(s)));Modal.show(TYPO3.lang.previewLink,a,SeverityEnum.info,[{text:TYPO3.lang.ok,active:!0,btnClass:"btn-info",name:"ok",trigger:(e,t)=>t.hideModal()}],["modal-inner-scroll"])}))},topLevelModuleImport("@typo3/workspaces/renderable/send-to-stage-form.js"),topLevelModuleImport("@typo3/workspaces/renderable/comment-view.js"),DocumentService.ready().then((()=>{this.getElements(),this.registerEvents(),this.notifyWorkspaceSwitchAction(),this.settings.depth=this.elements.$depthSelector.val(),this.settings.language=this.elements.$languageSelector.val(),this.settings.stage=this.elements.$stagesSelector.val(),this.elements.$container.length&&this.getWorkspaceInfos()}))}static refreshPageTree(){top.document.dispatchEvent(new CustomEvent("typo3:pagetree:refresh"))}static generateDiffView(e){const t=$("
",{class:"diff"});for(const a of e)t.append($("
",{class:"diff-item"}).append($("
",{class:"diff-item-title"}).text(a.label),$("
",{class:"diff-item-result"}).html(a.content)));return t}static generateCommentView(e){const t=document.createElement("typo3-workspaces-comment-view");return t.comments=e,t}static generateHistoryView(e){const t=$("
");for(const a of e){const e=$("
",{class:"panel panel-default"});let s;if("object"==typeof a.differences){if(0===a.differences.length)continue;s=$("
",{class:"diff"});for(let e=0;e ",{class:"diff-item"}).append($("
",{class:"diff-item-title"}).text(a.differences[e].label),$("
",{class:"diff-item-result"}).html(a.differences[e].html)));e.append($("
").append(s))}else e.append($("
",{class:"panel-body"}).text(a.differences));e.append($("
",{class:"panel-footer"}).append($(" ",{class:"badge badge-info"}).text(a.datetime))),t.append($("
",{class:"media"}).append($("
",{class:"media-left text-center"}).text(a.user).prepend($("
").html(a.user_avatar)),$("
",{class:"media-body"}).append(e)))}return t}static changeCollectionParentState(e,t){const a=document.querySelector('tr[data-collection-current="'+e+'"] input[type=checkbox]');null!==a&&a.checked!==t&&(a.checked=t,a.dataset.manuallyChanged="true",a.dispatchEvent(new CustomEvent("multiRecordSelection:checkbox:state:changed",{bubbles:!0,cancelable:!1})))}static changeCollectionChildrenState(e,t){const a=document.querySelectorAll(selector`tr[data-collection="${e}"] input[type=checkbox]`);a.length&&a.forEach((e=>{e.checked!==t&&(e.checked=t,e.dataset.manuallyChanged="true",e.dispatchEvent(new CustomEvent("multiRecordSelection:checkbox:state:changed",{bubbles:!0,cancelable:!1})))}))}notifyWorkspaceSwitchAction(){const e=document.querySelector("main[data-workspace-switch-action]");if(e.dataset.workspaceSwitchAction){const t=JSON.parse(e.dataset.workspaceSwitchAction);top.TYPO3.WorkspacesMenu.performWorkspaceSwitch(t.id,t.title),top.document.dispatchEvent(new CustomEvent("typo3:pagetree:refresh")),top.TYPO3.ModuleMenu.App.refreshMenu()}}checkIntegrity(e){return this.sendRemoteRequest(this.generateRemotePayload("checkIntegrity",e))}getElements(){this.elements.$searchForm=$(Identifiers.searchForm),this.elements.$searchTextField=$(Identifiers.searchTextField),this.elements.$searchSubmitBtn=$(Identifiers.searchSubmitBtn),this.elements.$depthSelector=$(Identifiers.depthSelector),this.elements.$languageSelector=$(Identifiers.languageSelector),this.elements.$stagesSelector=$(Identifiers.stagesSelector),this.elements.$container=$(Identifiers.container),this.elements.$contentsContainer=$(Identifiers.contentsContainer),this.elements.$noContentsContainer=$(Identifiers.noContentsContainer),this.elements.$tableBody=this.elements.$contentsContainer.find("tbody"),this.elements.$workspaceActions=$(Identifiers.workspaceActions),this.elements.$chooseStageAction=$(Identifiers.chooseStageAction),this.elements.$chooseSelectionAction=$(Identifiers.chooseSelectionAction),this.elements.$chooseMassAction=$(Identifiers.chooseMassAction),this.elements.$previewLinksButton=$(Identifiers.previewLinksButton),this.elements.$pagination=$(Identifiers.pagination)}registerEvents(){$(document).on("click",'[data-action="publish"]',(e=>{const t=e.target.closest("tr");this.checkIntegrity({selection:[{liveId:t.dataset.uid,versionId:t.dataset.t3ver_oid,table:t.dataset.table}],type:"selection"}).then((async e=>{"warning"===(await e.resolve())[0].result.result&&this.addIntegrityCheckWarningToWizard(),Wizard.setForceSelection(!1),Wizard.addSlide("publish-confirm","Publish",TYPO3.lang["window.publish.message"],SeverityEnum.info),Wizard.addFinalProcessingSlide((()=>{this.sendRemoteRequest(this.generateRemoteActionsPayload("publishSingleRecord",[t.dataset.table,t.dataset.t3ver_oid,t.dataset.uid])).then((()=>{Wizard.dismiss(),this.getWorkspaceInfos(),Backend.refreshPageTree()}))})).then((()=>{Wizard.show()}))}))})).on("click",'[data-action="prevstage"]',(e=>{this.sendToStage($(e.currentTarget).closest("tr"),"prev")})).on("click",'[data-action="nextstage"]',(e=>{this.sendToStage($(e.currentTarget).closest("tr"),"next")})).on("click",'[data-action="changes"]',this.viewChanges).on("click",'[data-action="preview"]',this.openPreview.bind(this)).on("click",'[data-action="open"]',(e=>{const t=e.currentTarget.closest("tr"),a=TYPO3.settings.FormEngine.moduleUrl+"&returnUrl="+encodeURIComponent(document.location.href)+"&id="+TYPO3.settings.Workspaces.id+"&edit["+t.dataset.table+"]["+t.dataset.uid+"]=edit";window.location.href=a})).on("click",'[data-action="version"]',(e=>{const t=e.currentTarget.closest("tr"),a="pages"===t.dataset.table?t.dataset.t3ver_oid:t.dataset.pid;window.location.href=TYPO3.settings.WebLayout.moduleUrl+"&id="+a})).on("click",'[data-action="remove"]',this.confirmDeleteRecordFromWorkspace).on("click",'[data-action="expand"]',(e=>{const t=$(e.currentTarget);let a;a="true"===t.first().attr("aria-expanded")?"actions-caret-down":"actions-caret-right",t.empty().append(IconHelper.getIcon(a))})),$(window.top.document).on("click",".t3js-workspace-recipients-selectall",(()=>{$(".t3js-workspace-recipient",window.top.document).not(":disabled").prop("checked",!0)})).on("click",".t3js-workspace-recipients-deselectall",(()=>{$(".t3js-workspace-recipient",window.top.document).not(":disabled").prop("checked",!1)})),this.elements.$searchForm.on("submit",(e=>{e.preventDefault(),this.settings.filterTxt=this.elements.$searchTextField.val(),this.getWorkspaceInfos()})),this.elements.$searchTextField.on("keyup",(e=>{""!==e.target.value?this.elements.$searchSubmitBtn.removeClass("disabled"):(this.elements.$searchSubmitBtn.addClass("disabled"),this.getWorkspaceInfos())}));const e=this.elements.$searchTextField.get(0);void 0!==e&&e.clearable({onClear:()=>{this.elements.$searchSubmitBtn.addClass("disabled"),this.settings.filterTxt="",this.getWorkspaceInfos()}}),new RegularEvent("multiRecordSelection:checkbox:state:changed",this.handleCheckboxStateChanged).bindTo(document),this.elements.$depthSelector.on("change",(e=>{const t=e.target.value;Persistent.set("moduleData.workspaces_admin.depth",t),this.settings.depth=t,this.getWorkspaceInfos()})),this.elements.$previewLinksButton.on("click",this.generatePreviewLinks),this.elements.$languageSelector.on("change",(e=>{const t=$(e.target);Persistent.set("moduleData.workspaces_admin.language",t.val()),this.settings.language=t.val(),this.sendRemoteRequest(this.generateRemotePayload("getWorkspaceInfos",this.settings)).then((async e=>{const a=await e.resolve();this.elements.$languageSelector.prev().html(t.find(":selected").data("icon")),this.renderWorkspaceInfos(a[0].result)}))})),this.elements.$stagesSelector.on("change",(e=>{const t=e.target.value;Persistent.set("moduleData.workspaces_admin.stage",t),this.settings.stage=t,this.getWorkspaceInfos()})),this.elements.$chooseStageAction.on("change",this.sendToSpecificStageAction),this.elements.$chooseSelectionAction.on("change",this.runSelectionAction),this.elements.$chooseMassAction.on("change",this.runMassAction),this.elements.$pagination.on("click","[data-action]",(e=>{e.preventDefault();const t=$(e.currentTarget);let a=!1;switch(t.data("action")){case"previous":this.paging.currentPage>1&&(this.paging.currentPage--,a=!0);break;case"next":this.paging.currentPage{const s=this.renderSendToStageWindow(await t.resolve());s.addEventListener("button.clicked",(t=>{if("ok"===t.target.name){const t=Utility.convertFormToObject(s.querySelector("form"));t.affects={table:e.data("table"),nextStage:a,t3ver_oid:e.data("t3ver_oid"),uid:e.data("uid"),elements:[]},this.sendRemoteRequest([this.generateRemoteActionsPayload(n,[t]),this.generateRemotePayload("getWorkspaceInfos",this.settings)]).then((async e=>{const t=await e.resolve();s.hideModal(),this.renderWorkspaceInfos(t[1].result),Backend.refreshPageTree()}))}}))}))}getWorkspaceInfos(){this.sendRemoteRequest(this.generateRemotePayload("getWorkspaceInfos",this.settings)).then((async e=>{this.renderWorkspaceInfos((await e.resolve())[0].result)}))}renderWorkspaceInfos(e){this.resetMassActionState(e.data.length),this.buildPagination(e.total),0===e.total?(this.elements.$contentsContainer.hide(),this.elements.$noContentsContainer.show()):(this.elements.$contentsContainer.show(),this.elements.$noContentsContainer.hide());document.querySelector("typo3-workspaces-record-table").results=e.data}buildPagination(e){if(0===e)return void this.elements.$pagination.contents().remove();if(this.paging.totalItems=e,this.paging.totalPages=Math.ceil(e/parseInt(this.settings.limit.toString(),10)),1===this.paging.totalPages)return void this.elements.$pagination.contents().remove();const t=$("",{class:"pagination"}),a=[],s=$(" ",{class:"page-item"}).append($(" ",{class:"page-link",type:"button","data-action":"previous"}).append($(" ",{identifier:"actions-arrow-left-alt",size:"small"}))),n=$(" ",{class:"page-item"}).append($(" ",{class:"page-link",type:"button","data-action":"next"}).append($(" ",{identifier:"actions-arrow-right-alt",size:"small"})));1===this.paging.currentPage&&s.addClass("disabled").find("button").prop("disabled",!0),this.paging.currentPage===this.paging.totalPages&&n.addClass("disabled").find("button").prop("disabled",!0);for(let e=1;e<=this.paging.totalPages;e++){const t=$(" ",{class:"page-item"+(this.paging.currentPage===e?" active":"")});t.append($(" ",{class:"page-link",type:"button","data-action":"page","data-page":e}).append($(" ").text(e))),a.push(t)}t.append(s,a,n),this.elements.$pagination.empty().append(t)}openPreview(e){const t=$(e.currentTarget).closest("tr");this.sendRemoteRequest(this.generateRemoteActionsPayload("viewSingleRecord",[t.data("table"),t.data("uid")])).then((async e=>{const t=(await e.resolve())[0].result;windowManager.localOpen(t)}))}renderSelectionActionWizard(e,t){Wizard.addSlide("mass-action-confirmation",TYPO3.lang["window.selectionAction.title"],""+(new SecurityUtility).encodeHtml(TYPO3.lang["tooltip."+e+"Selected"])+"
",SeverityEnum.warning),Wizard.addFinalProcessingSlide((()=>{this.sendRemoteRequest(this.generateRemoteActionsPayload("executeSelectionAction",{action:e,selection:t})).then((()=>{this.markedRecordsForMassAction=[],this.getWorkspaceInfos(),Wizard.dismiss(),Backend.refreshPageTree()}))})).then((()=>{Wizard.show(),Wizard.getComponent().on("wizard-dismissed",(()=>{this.elements.$chooseSelectionAction.val("")}))}))}renderMassActionWizard(e){let t;switch(e){case"publish":t="publishWorkspace";break;case"discard":t="flushWorkspace";break;default:throw"Invalid mass action "+e+" called."}const a=new SecurityUtility;Wizard.setForceSelection(!1),Wizard.addSlide("mass-action-confirmation",TYPO3.lang["window.massAction.title"],""+a.encodeHtml(TYPO3.lang["tooltip."+e+"All"])+" "+a.encodeHtml(TYPO3.lang["tooltip.affectWholeWorkspace"])+"
",SeverityEnum.warning);const s=async e=>{const a=(await e.resolve())[0].result;a.processed{this.sendRemoteRequest(this.generateRemoteMassActionsPayload(t,{init:!0,total:0,processed:0,language:this.settings.language})).then(s)})).then((()=>{Wizard.show(),Wizard.getComponent().on("wizard-dismissed",(()=>{this.elements.$chooseMassAction.val("")}))}))}resetMassActionState(e){this.markedRecordsForMassAction=[],e&&(this.elements.$workspaceActions.removeClass("hidden"),this.elements.$chooseMassAction.prop("disabled",!1)),document.dispatchEvent(new CustomEvent("multiRecordSelection:actions:hide"))}}export default new Backend;
\ No newline at end of file
diff --git a/typo3/sysext/workspaces/Resources/Public/JavaScript/renderable/comment-view.js b/typo3/sysext/workspaces/Resources/Public/JavaScript/renderable/comment-view.js
new file mode 100644
index 000000000000..8909c3c12e7f
--- /dev/null
+++ b/typo3/sysext/workspaces/Resources/Public/JavaScript/renderable/comment-view.js
@@ -0,0 +1,40 @@
+/*
+ * This file is part of the TYPO3 CMS project.
+ *
+ * It is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License, either version 2
+ * of the License, or any later version.
+ *
+ * For the full copyright and license information, please read the
+ * LICENSE.txt file that was distributed with this source code.
+ *
+ * The TYPO3 project - inspiring people to share!
+ */
+var __decorate=function(e,t,r,o){var n,m=arguments.length,s=m<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,r):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,o);else for(var i=e.length-1;i>=0;i--)(n=e[i])&&(s=(m<3?n(s):m>3?n(t,r,s):n(t,r))||s);return m>3&&s&&Object.defineProperty(t,r,s),s};import{customElement,property}from"lit/decorators.js";import{html,LitElement,nothing}from"lit";import{repeat}from"lit/directives/repeat.js";import{unsafeHTML}from"lit/directives/unsafe-html.js";let CommentViewElement=class extends LitElement{constructor(){super(...arguments),this.comments=[]}createRenderRoot(){return this}render(){return html`
+
+ ${repeat(this.comments,(e=>e.tstamp),(e=>this.renderComment(e)))}
+
+ `}renderComment(e){return html`
+
+ `}};__decorate([property({type:Array})],CommentViewElement.prototype,"comments",void 0),CommentViewElement=__decorate([customElement("typo3-workspaces-comment-view")],CommentViewElement);export{CommentViewElement};
\ No newline at end of file