From 2f2cfff8c6f67331b126e4cf6f5b9f5f01e9e6d4 Mon Sep 17 00:00:00 2001 From: Andreas Fernandez <a.fernandez@scripting-base.de> Date: Fri, 17 Apr 2020 08:55:54 +0200 Subject: [PATCH] [BUGFIX] Disable trigger buttons in Install Tool when actions are executed If an action in the Install Tool is executed that is related to an inline module or an interactable module (a.k.a "modal"), its trigger button(s) get now properly disabled and enabled to avoid executing the same actions consecutively while any request is still pending. Resolves: #91076 Releases: master Change-Id: I9a61063819f21a33ac8ede644fa8f998212b342b Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/64207 Tested-by: TYPO3com <noreply@typo3.com> Tested-by: Jonas Eberle <flightvision@googlemail.com> Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de> Tested-by: Susanne Moog <look@susi.dev> Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de> Reviewed-by: Susanne Moog <look@susi.dev> --- .../TypeScript/Module/AbstractInlineModule.ts | 9 ++- .../Module/AbstractInteractableModule.ts | 10 +++ .../Module/Environment/EnvironmentCheck.ts | 3 +- .../Module/Environment/FolderStructure.ts | 3 +- .../Module/Environment/ImageProcessing.ts | 2 +- .../TypeScript/Module/Environment/MailTest.ts | 52 ++++++------- .../TypeScript/Module/Maintenance/Cache.ts | 10 +-- .../Module/Maintenance/ClearTables.ts | 2 + .../Module/Maintenance/ClearTypo3tempFiles.ts | 2 + .../Module/Maintenance/CreateAdmin.ts | 74 ++++++++++--------- .../Module/Maintenance/DatabaseAnalyzer.ts | 20 ++--- .../Module/Maintenance/DumpAutoload.ts | 8 +- .../Module/Maintenance/ResetBackendUserUc.ts | 8 +- .../Settings/ChangeInstallToolPassword.ts | 51 ++++++------- .../TypeScript/Module/Settings/Features.ts | 2 + .../Module/Settings/LocalConfiguration.ts | 45 ++++++----- .../TypeScript/Module/Settings/Presets.ts | 38 +++++----- .../Module/Settings/SystemMaintainer.ts | 47 ++++++------ .../Module/Upgrade/ExtensionCompatTester.ts | 2 +- .../Module/Upgrade/ExtensionScanner.ts | 2 +- .../Module/Upgrade/TcaExtTablesCheck.ts | 2 + .../Module/Upgrade/TcaMigrationsCheck.ts | 2 + .../Resources/Public/TypeScript/Router.ts | 4 +- .../JavaScript/Module/AbstractInlineModule.js | 5 +- .../Module/AbstractInteractableModule.js | 2 +- .../Module/Environment/EnvironmentCheck.js | 2 +- .../Module/Environment/FolderStructure.js | 2 +- .../Module/Environment/ImageProcessing.js | 2 +- .../JavaScript/Module/Environment/MailTest.js | 2 +- .../JavaScript/Module/Maintenance/Cache.js | 2 +- .../Module/Maintenance/ClearTables.js | 2 +- .../Module/Maintenance/ClearTypo3tempFiles.js | 2 +- .../Module/Maintenance/CreateAdmin.js | 2 +- .../Module/Maintenance/DatabaseAnalyzer.js | 2 +- .../Module/Maintenance/DumpAutoload.js | 2 +- .../Module/Maintenance/ResetBackendUserUc.js | 2 +- .../Settings/ChangeInstallToolPassword.js | 2 +- .../JavaScript/Module/Settings/Features.js | 2 +- .../Module/Settings/LocalConfiguration.js | 2 +- .../JavaScript/Module/Settings/Presets.js | 2 +- .../Module/Settings/SystemMaintainer.js | 2 +- .../Module/Upgrade/ExtensionCompatTester.js | 2 +- .../Module/Upgrade/ExtensionScanner.js | 2 +- .../Module/Upgrade/TcaExtTablesCheck.js | 2 +- .../Module/Upgrade/TcaMigrationsCheck.js | 2 +- 45 files changed, 235 insertions(+), 210 deletions(-) rename typo3/sysext/install/Resources/Public/JavaScript/Module/InlineModuleInterface.js => Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/AbstractInlineModule.ts (62%) rename Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/InlineModuleInterface.ts => typo3/sysext/install/Resources/Public/JavaScript/Module/AbstractInlineModule.js (66%) diff --git a/typo3/sysext/install/Resources/Public/JavaScript/Module/InlineModuleInterface.js b/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/AbstractInlineModule.ts similarity index 62% rename from typo3/sysext/install/Resources/Public/JavaScript/Module/InlineModuleInterface.js rename to Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/AbstractInlineModule.ts index d3632d54e8aa..aae12319bcee 100644 --- a/typo3/sysext/install/Resources/Public/JavaScript/Module/InlineModuleInterface.js +++ b/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/AbstractInlineModule.ts @@ -10,4 +10,11 @@ * * The TYPO3 project - inspiring people to share! */ -define(["require","exports"],(function(e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0})})); \ No newline at end of file + +export abstract class AbstractInlineModule { + protected setButtonState(button: JQuery, interactable: boolean): void { + button.toggleClass('disabled', !interactable).prop('disabled', !interactable); + } + + abstract initialize($trigger: JQuery): void; +} diff --git a/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/AbstractInteractableModule.ts b/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/AbstractInteractableModule.ts index eabf2fb92e59..48a0527fb8ca 100644 --- a/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/AbstractInteractableModule.ts +++ b/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/AbstractInteractableModule.ts @@ -33,5 +33,15 @@ export abstract class AbstractInteractableModule { return this.currentModal.find(selector); } + protected setModalButtonsState(interactable: boolean): void { + this.getModalFooter().find('button').each((_: number, elem: Element): void => { + this.setModalButtonState($(elem), interactable) + }); + } + + protected setModalButtonState(button: JQuery, interactable: boolean): void { + button.toggleClass('disabled', !interactable).prop('disabled', !interactable); + } + public abstract initialize(currentModal: JQuery): void; } diff --git a/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/Environment/EnvironmentCheck.ts b/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/Environment/EnvironmentCheck.ts index 56e78d3652c5..04e8cbdcbfcf 100644 --- a/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/Environment/EnvironmentCheck.ts +++ b/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/Environment/EnvironmentCheck.ts @@ -45,12 +45,13 @@ class EnvironmentCheck extends AbstractInteractableModule { } private runTests(): void { + this.setModalButtonsState(false); + const modalContent = this.getModalBody(); const $errorBadge = $(this.selectorGridderBadge); $errorBadge.text('').hide(); const message = ProgressBar.render(Severity.loading, 'Loading...', ''); modalContent.find(this.selectorOutputContainer).empty().append(message); - this.findInModal(this.selectorExecuteTrigger).addClass('disabled').prop('disabled', true); (new AjaxRequest(Router.getUrl('environmentCheckGetStatus'))) .get({cache: 'no-cache'}) diff --git a/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/Environment/FolderStructure.ts b/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/Environment/FolderStructure.ts index e15dc78370e7..aab6b86f8e48 100644 --- a/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/Environment/FolderStructure.ts +++ b/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/Environment/FolderStructure.ts @@ -49,7 +49,6 @@ class FolderStructure extends AbstractInteractableModule { currentModal.on('click', this.selectorErrorFixTrigger, (e: JQueryEventObject): void => { e.preventDefault(); - $(e.currentTarget).addClass('disabled').prop('disabled', true); this.fix(); }); } @@ -111,6 +110,8 @@ class FolderStructure extends AbstractInteractableModule { } private fix(): void { + this.setModalButtonsState(false); + const modalContent: JQuery = this.getModalBody(); const $outputContainer: JQuery = this.findInModal(this.selectorOutputContainer); const message: any = ProgressBar.render(Severity.loading, 'Loading...', ''); diff --git a/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/Environment/ImageProcessing.ts b/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/Environment/ImageProcessing.ts index 10a2abea0c16..1adf41385159 100644 --- a/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/Environment/ImageProcessing.ts +++ b/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/Environment/ImageProcessing.ts @@ -68,7 +68,7 @@ class ImageProcessing extends AbstractInteractableModule { private runTests(): void { const modalContent = this.getModalBody(); const $triggerButton = this.findInModal(this.selectorExecuteTrigger); - $triggerButton.addClass('disabled').prop('disabled', true); + this.setModalButtonsState(false); const $twinImageTemplate = this.findInModal(this.selectorTwinImageTemplate); const promises: Array<Promise<any>> = []; diff --git a/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/Environment/MailTest.ts b/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/Environment/MailTest.ts index 7de52187f165..ef94b0e6a136 100644 --- a/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/Environment/MailTest.ts +++ b/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/Environment/MailTest.ts @@ -59,41 +59,43 @@ class MailTest extends AbstractInteractableModule { }, (error: ResponseError): void => { Router.handleAjaxError(error, modalContent); - } + }, ); } private send(): void { + this.setModalButtonsState(false); + const executeToken: string = this.getModuleContent().data('mail-test-token'); const $outputContainer: JQuery = this.findInModal(this.selectorOutputContainer); const message: any = ProgressBar.render(Severity.loading, 'Loading...', ''); $outputContainer.empty().html(message); - (new AjaxRequest(Router.getUrl())) - .post({ - install: { - action: 'mailTest', - token: executeToken, - email: this.findInModal('.t3js-mailTest-email').val(), - }, - }) - .then( - async (response: AjaxResponse): Promise<any> => { - const data = await response.resolve(); - $outputContainer.empty(); - if (Array.isArray(data.status)) { - data.status.forEach((element: any): void => { - const aMessage: any = InfoBox.render(element.severity, element.title, element.message); - $outputContainer.html(aMessage); - }); - } else { - Notification.error('Something went wrong'); - } - }, - (): void => { - // 500 can happen here if the mail configuration is broken + (new AjaxRequest(Router.getUrl())).post({ + install: { + action: 'mailTest', + token: executeToken, + email: this.findInModal('.t3js-mailTest-email').val(), + }, + }).then( + async (response: AjaxResponse): Promise<any> => { + const data = await response.resolve(); + $outputContainer.empty(); + if (Array.isArray(data.status)) { + data.status.forEach((element: any): void => { + const aMessage: any = InfoBox.render(element.severity, element.title, element.message); + $outputContainer.html(aMessage); + }); + } else { Notification.error('Something went wrong'); } - ); + }, + (): void => { + // 500 can happen here if the mail configuration is broken + Notification.error('Something went wrong'); + }, + ).finally((): void => { + this.setModalButtonsState(true); + }); } } diff --git a/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/Maintenance/Cache.ts b/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/Maintenance/Cache.ts index 62586344f88f..3be365de85cd 100644 --- a/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/Maintenance/Cache.ts +++ b/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/Maintenance/Cache.ts @@ -15,14 +15,14 @@ import Notification = require('TYPO3/CMS/Backend/Notification'); import AjaxRequest = require('TYPO3/CMS/Core/Ajax/AjaxRequest'); import Router = require('../../Router'); import {AjaxResponse} from 'TYPO3/CMS/Core/Ajax/AjaxResponse'; -import {InlineModuleInterface} from './../InlineModuleInterface'; +import {AbstractInlineModule} from '../AbstractInlineModule'; /** * Module: TYPO3/CMS/Install/Module/Cache */ -class Cache implements InlineModuleInterface { +class Cache extends AbstractInlineModule { public initialize($trigger: JQuery): void { - $trigger.addClass('disabled').prop('disabled', true); + this.setButtonState($trigger, false); (new AjaxRequest(Router.getUrl('cacheClearAll', 'maintenance'))) .get({cache: 'no-cache'}) @@ -45,10 +45,10 @@ class Cache implements InlineModuleInterface { Notification.error( 'Clearing caches went wrong on the server side. Check the system for broken extensions or missing database tables and try again', ); - } + }, ) .finally((): void => { - $trigger.removeClass('disabled').prop('disabled', false); + this.setButtonState($trigger, true); }); } } diff --git a/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/Maintenance/ClearTables.ts b/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/Maintenance/ClearTables.ts index e52d51c4fa2a..e0c12d2553a9 100644 --- a/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/Maintenance/ClearTables.ts +++ b/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/Maintenance/ClearTables.ts @@ -51,6 +51,8 @@ class ClearTables extends AbstractInteractableModule { } private getStats(): void { + this.setModalButtonsState(false); + const modalContent: JQuery = this.getModalBody(); (new AjaxRequest(Router.getUrl('clearTablesStats'))) .get({cache: 'no-cache'}) diff --git a/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/Maintenance/ClearTypo3tempFiles.ts b/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/Maintenance/ClearTypo3tempFiles.ts index 1603c29fcd71..5059d3321147 100644 --- a/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/Maintenance/ClearTypo3tempFiles.ts +++ b/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/Maintenance/ClearTypo3tempFiles.ts @@ -50,6 +50,8 @@ class ClearTypo3tempFiles extends AbstractInteractableModule { } private getStats(): void { + this.setModalButtonsState(false); + const modalContent = this.getModalBody(); (new AjaxRequest(Router.getUrl('clearTypo3tempFilesStats'))) .get({cache: 'no-cache'}) diff --git a/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/Maintenance/CreateAdmin.ts b/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/Maintenance/CreateAdmin.ts index c06852d3799f..08f2255aa4ca 100644 --- a/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/Maintenance/CreateAdmin.ts +++ b/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/Maintenance/CreateAdmin.ts @@ -56,49 +56,53 @@ class CreateAdmin extends AbstractInteractableModule { }, (error: ResponseError): void => { Router.handleAjaxError(error, modalContent); - } + }, ); } private create(): void { + this.setModalButtonsState(false); + const modalContent = this.getModalBody(); const executeToken = this.getModuleContent().data('create-admin-token'); - (new AjaxRequest(Router.getUrl())) - .post({ - install: { - action: 'createAdmin', - token: executeToken, - userName: this.findInModal('.t3js-createAdmin-user').val(), - userPassword: this.findInModal('.t3js-createAdmin-password').val(), - userPasswordCheck: this.findInModal('.t3js-createAdmin-password-check').val(), - userEmail: this.findInModal('.t3js-createAdmin-email').val(), - userSystemMaintainer: (this.findInModal('.t3js-createAdmin-system-maintainer').is(':checked')) ? 1 : 0, - }, - }) - .then( - async (response: AjaxResponse): Promise<any> => { - const data = await response.resolve(); - if (data.success === true && Array.isArray(data.status)) { - data.status.forEach((element: any): void => { - if (element.severity === 2) { - Notification.error(element.message); - } else { - Notification.success(element.title); - } - }); + const payload = { + install: { + action: 'createAdmin', + token: executeToken, + userName: this.findInModal('.t3js-createAdmin-user').val(), + userPassword: this.findInModal('.t3js-createAdmin-password').val(), + userPasswordCheck: this.findInModal('.t3js-createAdmin-password-check').val(), + userEmail: this.findInModal('.t3js-createAdmin-email').val(), + userSystemMaintainer: (this.findInModal('.t3js-createAdmin-system-maintainer').is(':checked')) ? 1 : 0, + }, + }; + this.getModuleContent().find(':input').prop('disabled', true); + + (new AjaxRequest(Router.getUrl())).post(payload).then(async (response: AjaxResponse): Promise<any> => { + const data = await response.resolve(); + if (data.success === true && Array.isArray(data.status)) { + data.status.forEach((element: any): void => { + if (element.severity === 2) { + Notification.error(element.message); } else { - Notification.error('Something went wrong'); + Notification.success(element.title); } - }, - (error: ResponseError): void => { - Router.handleAjaxError(error, modalContent); - } - ); - this.findInModal('.t3js-createAdmin-user').val(''); - this.findInModal('.t3js-createAdmin-password').val(''); - this.findInModal('.t3js-createAdmin-password-check').val(''); - this.findInModal('.t3js-createAdmin-email').val(''); - this.findInModal('.t3js-createAdmin-system-maintainer').prop('checked', false); + }); + } else { + Notification.error('Something went wrong'); + } + }, (error: ResponseError): void => { + Router.handleAjaxError(error, modalContent); + }).finally((): void => { + this.setModalButtonsState(true); + + this.getModuleContent().find(':input').prop('disabled', false); + this.findInModal('.t3js-createAdmin-user').val(''); + this.findInModal('.t3js-createAdmin-password').val(''); + this.findInModal('.t3js-createAdmin-password-check').val(''); + this.findInModal('.t3js-createAdmin-email').val(''); + this.findInModal('.t3js-createAdmin-system-maintainer').prop('checked', false); + }); } } diff --git a/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/Maintenance/DatabaseAnalyzer.ts b/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/Maintenance/DatabaseAnalyzer.ts index d017306cd22d..c1051d916227 100644 --- a/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/Maintenance/DatabaseAnalyzer.ts +++ b/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/Maintenance/DatabaseAnalyzer.ts @@ -75,6 +75,8 @@ class DatabaseAnalyzer extends AbstractInteractableModule { } private analyze(): void { + this.setModalButtonsState(false); + const modalContent = this.getModalBody(); const modalFooter = this.getModalFooter(); const outputContainer = modalContent.find(this.selectorOutputContainer); @@ -82,13 +84,9 @@ class DatabaseAnalyzer extends AbstractInteractableModule { const analyzeTrigger = modalFooter.find(this.selectorAnalyzeTrigger); outputContainer.empty().append(ProgressBar.render(Severity.loading, 'Analyzing current database schema...', '')); - - analyzeTrigger.prop('disabled', true); - executeTrigger.prop('disabled', true); - outputContainer.on('change', 'input[type="checkbox"]', (): void => { const hasCheckedCheckboxes = outputContainer.find(':checked').length > 0; - executeTrigger.prop('disabled', !hasCheckedCheckboxes); + this.setModalButtonState(executeTrigger, hasCheckedCheckboxes); }); (new AjaxRequest(Router.getUrl('databaseAnalyzerAnalyze'))) @@ -138,9 +136,8 @@ class DatabaseAnalyzer extends AbstractInteractableModule { outputContainer.append(aBlock.html()); }); - const isInitiallyDisabled = outputContainer.find(':checked').length === 0; - analyzeTrigger.prop('disabled', false); - executeTrigger.prop('disabled', isInitiallyDisabled); + this.setModalButtonState(analyzeTrigger, true); + this.setModalButtonState(executeTrigger, outputContainer.find(':checked').length > 0); } if (data.suggestions.length === 0 && data.status.length === 0) { outputContainer.append(InfoBox.render(Severity.ok, 'Database schema is up to date. Good job!', '')); @@ -156,18 +153,17 @@ class DatabaseAnalyzer extends AbstractInteractableModule { } private execute(): void { + this.setModalButtonsState(false); + const modalContent = this.getModalBody(); - const modalFooter = this.getModalFooter(); const executeToken = this.getModuleContent().data('database-analyzer-execute-token'); const outputContainer = modalContent.find(this.selectorOutputContainer); - const selectedHashes: Array<any> = []; + const selectedHashes: Array<any> = []; outputContainer.find('.t3js-databaseAnalyzer-suggestion-line input:checked').each((index: number, element: any): void => { selectedHashes.push($(element).data('hash')); }); outputContainer.empty().append(ProgressBar.render(Severity.loading, 'Executing database updates...', '')); - modalFooter.find(this.selectorExecuteTrigger).prop('disabled', true); - modalFooter.find(this.selectorAnalyzeTrigger).prop('disabled', true); (new AjaxRequest(Router.getUrl())) .post({ diff --git a/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/Maintenance/DumpAutoload.ts b/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/Maintenance/DumpAutoload.ts index bd6821a1b2fc..c88168a4754f 100644 --- a/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/Maintenance/DumpAutoload.ts +++ b/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/Maintenance/DumpAutoload.ts @@ -15,14 +15,14 @@ import Notification = require('TYPO3/CMS/Backend/Notification'); import AjaxRequest = require('TYPO3/CMS/Core/Ajax/AjaxRequest'); import Router = require('../../Router'); import {AjaxResponse} from 'TYPO3/CMS/Core/Ajax/AjaxResponse'; -import {InlineModuleInterface} from './../InlineModuleInterface'; +import {AbstractInlineModule} from '../AbstractInlineModule'; /** * Module: TYPO3/CMS/Install/Module/DumpAutoload */ -class DumpAutoload implements InlineModuleInterface { +class DumpAutoload extends AbstractInlineModule { public initialize($trigger: JQuery): void { - $trigger.addClass('disabled').prop('disabled', true); + this.setButtonState($trigger, false); (new AjaxRequest(Router.getUrl('dumpAutoload'))) .get({cache: 'no-cache'}) @@ -46,7 +46,7 @@ class DumpAutoload implements InlineModuleInterface { } ) .finally((): void => { - $trigger.removeClass('disabled').prop('disabled', false); + this.setButtonState($trigger, true); }); } } diff --git a/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/Maintenance/ResetBackendUserUc.ts b/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/Maintenance/ResetBackendUserUc.ts index bea2b6ac7c49..a42b38fa19c7 100644 --- a/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/Maintenance/ResetBackendUserUc.ts +++ b/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/Maintenance/ResetBackendUserUc.ts @@ -13,16 +13,16 @@ import AjaxRequest = require('TYPO3/CMS/Core/Ajax/AjaxRequest'); import {AjaxResponse} from 'TYPO3/CMS/Core/Ajax/AjaxResponse'; -import {InlineModuleInterface} from './../InlineModuleInterface'; +import {AbstractInlineModule} from '../AbstractInlineModule'; import Notification = require('TYPO3/CMS/Backend/Notification'); import Router = require('../../Router'); /** * Module: TYPO3/CMS/Install/Module/ResetBackendUserUc */ -class ResetBackendUserUc implements InlineModuleInterface { +class ResetBackendUserUc extends AbstractInlineModule { public initialize($trigger: JQuery): void { - $trigger.addClass('disabled').prop('disabled', true); + this.setButtonState($trigger, false); (new AjaxRequest(Router.getUrl('resetBackendUserUc'))) .get({cache: 'no-cache'}) @@ -46,7 +46,7 @@ class ResetBackendUserUc implements InlineModuleInterface { } ) .finally((): void => { - $trigger.removeClass('disabled').prop('disabled', false); + this.setButtonState($trigger, true); }); } } diff --git a/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/Settings/ChangeInstallToolPassword.ts b/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/Settings/ChangeInstallToolPassword.ts index df15657a3030..5615251a50a1 100644 --- a/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/Settings/ChangeInstallToolPassword.ts +++ b/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/Settings/ChangeInstallToolPassword.ts @@ -60,35 +60,32 @@ class ChangeInstallToolPassword extends AbstractInteractableModule { } private change(): void { + this.setModalButtonsState(false); + const modalContent = this.getModalBody(); const executeToken = this.getModuleContent().data('install-tool-token'); - (new AjaxRequest(Router.getUrl())) - .post({ - install: { - action: 'changeInstallToolPassword', - token: executeToken, - password: this.findInModal('.t3js-changeInstallToolPassword-password').val(), - passwordCheck: this.findInModal('.t3js-changeInstallToolPassword-password-check').val(), - }, - }) - .then( - async (response: AjaxResponse): Promise<any> => { - const data = await response.resolve(); - if (data.success === true && Array.isArray(data.status)) { - data.status.forEach((element: any): void => { - Notification.showMessage('', element.message, element.severity); - }); - } else { - Notification.error('Something went wrong'); - } - }, - (error: ResponseError): void => { - Router.handleAjaxError(error, modalContent); - } - ) - .finally((): void => { - this.findInModal('.t3js-changeInstallToolPassword-password,.t3js-changeInstallToolPassword-password-check').val(''); - }); + (new AjaxRequest(Router.getUrl())).post({ + install: { + action: 'changeInstallToolPassword', + token: executeToken, + password: this.findInModal('.t3js-changeInstallToolPassword-password').val(), + passwordCheck: this.findInModal('.t3js-changeInstallToolPassword-password-check').val(), + }, + }).then(async (response: AjaxResponse): Promise<any> => { + const data = await response.resolve(); + if (data.success === true && Array.isArray(data.status)) { + data.status.forEach((element: any): void => { + Notification.showMessage('', element.message, element.severity); + }); + } else { + Notification.error('Something went wrong'); + } + }, (error: ResponseError): void => { + Router.handleAjaxError(error, modalContent); + }).finally((): void => { + this.findInModal('.t3js-changeInstallToolPassword-password,.t3js-changeInstallToolPassword-password-check').val(''); + this.setModalButtonsState(true); + }); } } diff --git a/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/Settings/Features.ts b/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/Settings/Features.ts index ac4e7b52de40..289767da7de9 100644 --- a/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/Settings/Features.ts +++ b/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/Settings/Features.ts @@ -57,6 +57,8 @@ class Features extends AbstractInteractableModule { } private save(): void { + this.setModalButtonsState(false); + const modalContent = this.getModalBody(); const executeToken = this.getModuleContent().data('features-save-token'); const postData: any = {}; diff --git a/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/Settings/LocalConfiguration.ts b/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/Settings/LocalConfiguration.ts index fa1d7785b1cc..6d3d879147ae 100644 --- a/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/Settings/LocalConfiguration.ts +++ b/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/Settings/LocalConfiguration.ts @@ -114,6 +114,8 @@ class LocalConfiguration extends AbstractInteractableModule { } private write(): void { + this.setModalButtonsState(false); + const modalContent: JQuery = this.getModalBody(); const executeToken: JQuery = this.getModuleContent().data('local-configuration-write-token'); const configurationValues: any = {}; @@ -129,29 +131,26 @@ class LocalConfiguration extends AbstractInteractableModule { configurationValues[$element.data('path')] = $element.val(); } }); - (new AjaxRequest(Router.getUrl())) - .post({ - install: { - action: 'localConfigurationWrite', - token: executeToken, - configurationValues: configurationValues, - }, - }) - .then( - async (response: AjaxResponse): Promise<any> => { - const data = await response.resolve(); - if (data.success === true && Array.isArray(data.status)) { - data.status.forEach((element: any): void => { - Notification.showMessage(element.title, element.message, element.severity); - }); - } else { - Notification.error('Something went wrong'); - } - }, - (error: ResponseError): void => { - Router.handleAjaxError(error, modalContent); - } - ); + (new AjaxRequest(Router.getUrl())).post({ + install: { + action: 'localConfigurationWrite', + token: executeToken, + configurationValues: configurationValues, + }, + }).then(async (response: AjaxResponse): Promise<any> => { + const data = await response.resolve(); + if (data.success === true && Array.isArray(data.status)) { + data.status.forEach((element: any): void => { + Notification.showMessage(element.title, element.message, element.severity); + }); + } else { + Notification.error('Something went wrong'); + } + }, (error: ResponseError): void => { + Router.handleAjaxError(error, modalContent); + }).finally((): void => { + this.setModalButtonsState(true); + }); } } diff --git a/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/Settings/Presets.ts b/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/Settings/Presets.ts index 70d40fdefddd..d8170ca9430e 100644 --- a/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/Settings/Presets.ts +++ b/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/Settings/Presets.ts @@ -67,7 +67,7 @@ class Presets extends AbstractInteractableModule { }, (error: ResponseError): void => { Router.handleAjaxError(error, modalContent); - } + }, ); } @@ -97,11 +97,13 @@ class Presets extends AbstractInteractableModule { }, (error: ResponseError): void => { Router.handleAjaxError(error, modalContent); - } + }, ); } private activate(): void { + this.setModalButtonsState(false); + const modalContent: JQuery = this.getModalBody(); const executeToken: string = this.getModuleContent().data('presets-activate-token'); const postData: any = {}; @@ -110,23 +112,23 @@ class Presets extends AbstractInteractableModule { }); postData['install[action]'] = 'presetsActivate'; postData['install[token]'] = executeToken; - (new AjaxRequest(Router.getUrl())) - .post(postData) - .then( - async (response: AjaxResponse): Promise<any> => { - const data = await response.resolve(); - if (data.success === true && Array.isArray(data.status)) { - data.status.forEach((element: any): void => { - Notification.showMessage(element.title, element.message, element.severity); - }); - } else { - Notification.error('Something went wrong'); - } - }, - (error: ResponseError): void => { - Router.handleAjaxError(error, modalContent); + (new AjaxRequest(Router.getUrl())).post(postData).then( + async (response: AjaxResponse): Promise<any> => { + const data = await response.resolve(); + if (data.success === true && Array.isArray(data.status)) { + data.status.forEach((element: any): void => { + Notification.showMessage(element.title, element.message, element.severity); + }); + } else { + Notification.error('Something went wrong'); } - ); + }, + (error: ResponseError): void => { + Router.handleAjaxError(error, modalContent); + }, + ).finally((): void => { + this.setModalButtonsState(true); + }); } } diff --git a/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/Settings/SystemMaintainer.ts b/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/Settings/SystemMaintainer.ts index 461cacba72cc..6ab391da71a9 100644 --- a/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/Settings/SystemMaintainer.ts +++ b/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/Settings/SystemMaintainer.ts @@ -99,34 +99,33 @@ class SystemMaintainer extends AbstractInteractableModule { } private write(): void { + this.setModalButtonsState(false); + const modalContent = this.getModalBody(); const executeToken = this.getModuleContent().data('system-maintainer-write-token'); const selectedUsers = this.findInModal(this.selectorChosenField).val(); - (new AjaxRequest(Router.getUrl())) - .post({ - install: { - users: selectedUsers, - token: executeToken, - action: 'systemMaintainerWrite', - }, - }) - .then( - async (response: AjaxResponse): Promise<any> => { - const data = await response.resolve(); - if (data.success === true) { - if (Array.isArray(data.status)) { - data.status.forEach((element: any): void => { - Notification.success(element.title, element.message); - }); - } - } else { - Notification.error('Something went wrong'); - } - }, - (error: ResponseError): void => { - Router.handleAjaxError(error, modalContent); + (new AjaxRequest(Router.getUrl())).post({ + install: { + users: selectedUsers, + token: executeToken, + action: 'systemMaintainerWrite', + }, + }).then(async (response: AjaxResponse): Promise<any> => { + const data = await response.resolve(); + if (data.success === true) { + if (Array.isArray(data.status)) { + data.status.forEach((element: any): void => { + Notification.success(element.title, element.message); + }); } - ); + } else { + Notification.error('Something went wrong'); + } + }, (error: ResponseError): void => { + Router.handleAjaxError(error, modalContent); + }).finally((): void => { + this.setModalButtonsState(true); + }); } } diff --git a/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/Upgrade/ExtensionCompatTester.ts b/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/Upgrade/ExtensionCompatTester.ts index b3f191c99236..c5cd7491f246 100644 --- a/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/Upgrade/ExtensionCompatTester.ts +++ b/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/Upgrade/ExtensionCompatTester.ts @@ -52,7 +52,7 @@ class ExtensionCompatTester extends AbstractInteractableModule { } private getLoadedExtensionList(): void { - this.findInModal(this.selectorCheckTrigger).addClass('disabled').prop('disabled', true); + this.setModalButtonsState(false); this.findInModal('.modal-loading').hide(); const modalContent = this.getModalBody(); const $outputContainer = this.findInModal(this.selectorOutputContainer); diff --git a/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/Upgrade/ExtensionScanner.ts b/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/Upgrade/ExtensionScanner.ts index b7a17b1996b1..930f9611acc3 100644 --- a/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/Upgrade/ExtensionScanner.ts +++ b/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/Upgrade/ExtensionScanner.ts @@ -78,7 +78,7 @@ class ExtensionScanner extends AbstractInteractableModule { }).on('click', this.selectorExtensionScanButton, (e: JQueryEventObject): void => { // Scan all button e.preventDefault(); - $(e.currentTarget).addClass('disabled').prop('disabled', true); + this.setModalButtonsState(false); const $extensions = currentModal.find(this.selectorExtensionContainer); this.scanAll($extensions); }); diff --git a/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/Upgrade/TcaExtTablesCheck.ts b/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/Upgrade/TcaExtTablesCheck.ts index a7bacf92ec04..9127deb9d8b7 100644 --- a/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/Upgrade/TcaExtTablesCheck.ts +++ b/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/Upgrade/TcaExtTablesCheck.ts @@ -40,6 +40,8 @@ class TcaExtTablesCheck extends AbstractInteractableModule { } private check(): void { + this.setModalButtonsState(false); + const modalContent = this.getModalBody(); const $outputContainer = $(this.selectorOutputContainer); const m: any = ProgressBar.render(Severity.loading, 'Loading...', ''); diff --git a/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/Upgrade/TcaMigrationsCheck.ts b/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/Upgrade/TcaMigrationsCheck.ts index 04f36268e50c..e967c8c3cd68 100644 --- a/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/Upgrade/TcaMigrationsCheck.ts +++ b/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/Upgrade/TcaMigrationsCheck.ts @@ -40,6 +40,8 @@ class TcaMigrationsCheck extends AbstractInteractableModule { } private check(): void { + this.setModalButtonsState(false); + const $outputContainer: JQuery = $(this.selectorOutputContainer); const modalContent: JQuery = this.getModalBody(); const message: any = ProgressBar.render(Severity.loading, 'Loading...', ''); diff --git a/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Router.ts b/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Router.ts index bc7c26c1b5aa..d57715157075 100644 --- a/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Router.ts +++ b/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Router.ts @@ -16,7 +16,7 @@ import AjaxRequest = require('TYPO3/CMS/Core/Ajax/AjaxRequest'); import {AjaxResponse} from 'TYPO3/CMS/Core/Ajax/AjaxResponse'; import {ResponseError} from 'TYPO3/CMS/Core/Ajax/ResponseError'; import {AbstractInteractableModule} from './Module/AbstractInteractableModule'; -import {InlineModuleInterface} from './Module/InlineModuleInterface'; +import {AbstractInlineModule} from './Module/AbstractInlineModule'; import Icons = require('TYPO3/CMS/Backend/Icons'); import Modal = require('TYPO3/CMS/Backend/Modal'); import InfoBox = require('./Renderable/InfoBox'); @@ -59,7 +59,7 @@ class Router { const inlineState = $me.data('inline'); const isInline = typeof inlineState !== 'undefined' && parseInt(inlineState, 10) === 1; if (isInline) { - require([requireModule], (aModule: InlineModuleInterface): void => { + require([requireModule], (aModule: AbstractInlineModule): void => { aModule.initialize($me); }); } else { diff --git a/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/InlineModuleInterface.ts b/typo3/sysext/install/Resources/Public/JavaScript/Module/AbstractInlineModule.js similarity index 66% rename from Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/InlineModuleInterface.ts rename to typo3/sysext/install/Resources/Public/JavaScript/Module/AbstractInlineModule.js index fd207fd88ba5..2ba3f91c8c20 100644 --- a/Build/Sources/TypeScript/install/Resources/Public/TypeScript/Module/InlineModuleInterface.ts +++ b/typo3/sysext/install/Resources/Public/JavaScript/Module/AbstractInlineModule.js @@ -10,7 +10,4 @@ * * The TYPO3 project - inspiring people to share! */ - -export interface InlineModuleInterface { - initialize($trigger: JQuery): void; -} +define(["require","exports"],(function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.AbstractInlineModule=class{setButtonState(e,t){e.toggleClass("disabled",!t).prop("disabled",!t)}}})); \ No newline at end of file diff --git a/typo3/sysext/install/Resources/Public/JavaScript/Module/AbstractInteractableModule.js b/typo3/sysext/install/Resources/Public/JavaScript/Module/AbstractInteractableModule.js index fe647dfe22da..97ab9ba103a6 100644 --- a/typo3/sysext/install/Resources/Public/JavaScript/Module/AbstractInteractableModule.js +++ b/typo3/sysext/install/Resources/Public/JavaScript/Module/AbstractInteractableModule.js @@ -10,4 +10,4 @@ * * The TYPO3 project - inspiring people to share! */ -define(["require","exports"],(function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.AbstractInteractableModule=class{constructor(){this.selectorModalBody=".t3js-modal-body",this.selectorModalContent=".t3js-module-content",this.selectorModalFooter=".t3js-modal-footer"}getModalBody(){return this.findInModal(this.selectorModalBody)}getModuleContent(){return this.findInModal(this.selectorModalContent)}getModalFooter(){return this.findInModal(this.selectorModalFooter)}findInModal(t){return this.currentModal.find(t)}}})); \ No newline at end of file +define(["require","exports"],(function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.AbstractInteractableModule=class{constructor(){this.selectorModalBody=".t3js-modal-body",this.selectorModalContent=".t3js-module-content",this.selectorModalFooter=".t3js-modal-footer"}getModalBody(){return this.findInModal(this.selectorModalBody)}getModuleContent(){return this.findInModal(this.selectorModalContent)}getModalFooter(){return this.findInModal(this.selectorModalFooter)}findInModal(t){return this.currentModal.find(t)}setModalButtonsState(t){this.getModalFooter().find("button").each((e,o)=>{this.setModalButtonState($(o),t)})}setModalButtonState(t,e){t.toggleClass("disabled",!e).prop("disabled",!e)}}})); \ No newline at end of file diff --git a/typo3/sysext/install/Resources/Public/JavaScript/Module/Environment/EnvironmentCheck.js b/typo3/sysext/install/Resources/Public/JavaScript/Module/Environment/EnvironmentCheck.js index 67f5199fd260..6a1f1631ff2b 100644 --- a/typo3/sysext/install/Resources/Public/JavaScript/Module/Environment/EnvironmentCheck.js +++ b/typo3/sysext/install/Resources/Public/JavaScript/Module/Environment/EnvironmentCheck.js @@ -10,4 +10,4 @@ * * The TYPO3 project - inspiring people to share! */ -define(["require","exports","jquery","../AbstractInteractableModule","TYPO3/CMS/Backend/Modal","TYPO3/CMS/Backend/Notification","TYPO3/CMS/Core/Ajax/AjaxRequest","../../Renderable/InfoBox","../../Renderable/ProgressBar","../../Renderable/Severity","../../Router","bootstrap"],(function(e,t,r,s,n,a,o,i,l,c,d){"use strict";class u extends s.AbstractInteractableModule{constructor(){super(...arguments),this.selectorGridderBadge=".t3js-environmentCheck-badge",this.selectorExecuteTrigger=".t3js-environmentCheck-execute",this.selectorOutputContainer=".t3js-environmentCheck-output"}initialize(e){this.currentModal=e,this.runTests(),e.on("click",this.selectorExecuteTrigger,e=>{e.preventDefault(),this.runTests()})}runTests(){const e=this.getModalBody(),t=r(this.selectorGridderBadge);t.text("").hide();const s=l.render(c.loading,"Loading...","");e.find(this.selectorOutputContainer).empty().append(s),this.findInModal(this.selectorExecuteTrigger).addClass("disabled").prop("disabled",!0),new o(d.getUrl("environmentCheckGetStatus")).get({cache:"no-cache"}).then(async s=>{const o=await s.resolve();e.empty().append(o.html),n.setButtons(o.buttons);let l=0,c=0;!0===o.success&&"object"==typeof o.status?(r.each(o.status,(t,r)=>{Array.isArray(r)&&r.length>0&&r.forEach(t=>{1===t.severity&&l++,2===t.severity&&c++;const r=i.render(t.severity,t.title,t.message);e.find(this.selectorOutputContainer).append(r)})}),c>0?t.removeClass("label-warning").addClass("label-danger").text(c).show():l>0&&t.removeClass("label-error").addClass("label-warning").text(l).show()):a.error("Something went wrong")},t=>{d.handleAjaxError(t,e)})}}return new u})); \ No newline at end of file +define(["require","exports","jquery","../AbstractInteractableModule","TYPO3/CMS/Backend/Modal","TYPO3/CMS/Backend/Notification","TYPO3/CMS/Core/Ajax/AjaxRequest","../../Renderable/InfoBox","../../Renderable/ProgressBar","../../Renderable/Severity","../../Router","bootstrap"],(function(e,t,r,s,n,a,o,i,c,l,d){"use strict";class u extends s.AbstractInteractableModule{constructor(){super(...arguments),this.selectorGridderBadge=".t3js-environmentCheck-badge",this.selectorExecuteTrigger=".t3js-environmentCheck-execute",this.selectorOutputContainer=".t3js-environmentCheck-output"}initialize(e){this.currentModal=e,this.runTests(),e.on("click",this.selectorExecuteTrigger,e=>{e.preventDefault(),this.runTests()})}runTests(){this.setModalButtonsState(!1);const e=this.getModalBody(),t=r(this.selectorGridderBadge);t.text("").hide();const s=c.render(l.loading,"Loading...","");e.find(this.selectorOutputContainer).empty().append(s),new o(d.getUrl("environmentCheckGetStatus")).get({cache:"no-cache"}).then(async s=>{const o=await s.resolve();e.empty().append(o.html),n.setButtons(o.buttons);let c=0,l=0;!0===o.success&&"object"==typeof o.status?(r.each(o.status,(t,r)=>{Array.isArray(r)&&r.length>0&&r.forEach(t=>{1===t.severity&&c++,2===t.severity&&l++;const r=i.render(t.severity,t.title,t.message);e.find(this.selectorOutputContainer).append(r)})}),l>0?t.removeClass("label-warning").addClass("label-danger").text(l).show():c>0&&t.removeClass("label-error").addClass("label-warning").text(c).show()):a.error("Something went wrong")},t=>{d.handleAjaxError(t,e)})}}return new u})); \ No newline at end of file diff --git a/typo3/sysext/install/Resources/Public/JavaScript/Module/Environment/FolderStructure.js b/typo3/sysext/install/Resources/Public/JavaScript/Module/Environment/FolderStructure.js index 7c298c08cad6..813071f58418 100644 --- a/typo3/sysext/install/Resources/Public/JavaScript/Module/Environment/FolderStructure.js +++ b/typo3/sysext/install/Resources/Public/JavaScript/Module/Environment/FolderStructure.js @@ -10,4 +10,4 @@ * * The TYPO3 project - inspiring people to share! */ -define(["require","exports","jquery","../AbstractInteractableModule","TYPO3/CMS/Backend/Modal","TYPO3/CMS/Backend/Notification","TYPO3/CMS/Core/Ajax/AjaxRequest","../../Renderable/InfoBox","../../Renderable/ProgressBar","../../Renderable/Severity","../../Router","bootstrap"],(function(e,t,r,s,i,o,n,a,d,l,c){"use strict";class u extends s.AbstractInteractableModule{constructor(){super(...arguments),this.selectorGridderBadge=".t3js-folderStructure-badge",this.selectorOutputContainer=".t3js-folderStructure-output",this.selectorErrorContainer=".t3js-folderStructure-errors",this.selectorErrorList=".t3js-folderStructure-errors-list",this.selectorErrorFixTrigger=".t3js-folderStructure-errors-fix",this.selectorOkContainer=".t3js-folderStructure-ok",this.selectorOkList=".t3js-folderStructure-ok-list",this.selectorPermissionContainer=".t3js-folderStructure-permissions"}static removeLoadingMessage(e){e.find(".alert-loading").remove()}initialize(e){this.currentModal=e,this.getStatus(),e.on("click",this.selectorErrorFixTrigger,e=>{e.preventDefault(),r(e.currentTarget).addClass("disabled").prop("disabled",!0),this.fix()})}getStatus(){const e=this.getModalBody(),t=r(this.selectorGridderBadge);t.text("").hide(),e.find(this.selectorOutputContainer).empty().append(d.render(l.loading,"Loading...","")),new n(c.getUrl("folderStructureGetStatus")).get({cache:"no-cache"}).then(async r=>{const s=await r.resolve();if(e.empty().append(s.html),i.setButtons(s.buttons),!0===s.success&&Array.isArray(s.errorStatus)){let r=0;s.errorStatus.length>0?(e.find(this.selectorErrorContainer).show(),e.find(this.selectorErrorList).empty(),s.errorStatus.forEach(s=>{r++,t.text(r).show();const i=a.render(s.severity,s.title,s.message);e.find(this.selectorErrorList).append(i)})):e.find(this.selectorErrorContainer).hide()}!0===s.success&&Array.isArray(s.okStatus)&&(s.okStatus.length>0?(e.find(this.selectorOkContainer).show(),e.find(this.selectorOkList).empty(),s.okStatus.forEach(t=>{const r=a.render(t.severity,t.title,t.message);e.find(this.selectorOkList).append(r)})):e.find(this.selectorOkContainer).hide());let o=s.folderStructureFilePermissionStatus;e.find(this.selectorPermissionContainer).empty().append(a.render(o.severity,o.title,o.message)),o=s.folderStructureDirectoryPermissionStatus,e.find(this.selectorPermissionContainer).append(a.render(o.severity,o.title,o.message))},t=>{c.handleAjaxError(t,e)})}fix(){const e=this.getModalBody(),t=this.findInModal(this.selectorOutputContainer),r=d.render(l.loading,"Loading...","");t.empty().html(r),new n(c.getUrl("folderStructureFix")).get({cache:"no-cache"}).then(async e=>{const r=await e.resolve();u.removeLoadingMessage(t),!0===r.success&&Array.isArray(r.fixedStatus)?(r.fixedStatus.length>0?r.fixedStatus.forEach(e=>{t.append(a.render(e.severity,e.title,e.message))}):t.append(a.render(l.warning,"Nothing fixed","")),this.getStatus()):o.error("Something went wrong")},t=>{c.handleAjaxError(t,e)})}}return new u})); \ No newline at end of file +define(["require","exports","jquery","../AbstractInteractableModule","TYPO3/CMS/Backend/Modal","TYPO3/CMS/Backend/Notification","TYPO3/CMS/Core/Ajax/AjaxRequest","../../Renderable/InfoBox","../../Renderable/ProgressBar","../../Renderable/Severity","../../Router","bootstrap"],(function(e,t,r,s,i,o,n,a,d,c,l){"use strict";class u extends s.AbstractInteractableModule{constructor(){super(...arguments),this.selectorGridderBadge=".t3js-folderStructure-badge",this.selectorOutputContainer=".t3js-folderStructure-output",this.selectorErrorContainer=".t3js-folderStructure-errors",this.selectorErrorList=".t3js-folderStructure-errors-list",this.selectorErrorFixTrigger=".t3js-folderStructure-errors-fix",this.selectorOkContainer=".t3js-folderStructure-ok",this.selectorOkList=".t3js-folderStructure-ok-list",this.selectorPermissionContainer=".t3js-folderStructure-permissions"}static removeLoadingMessage(e){e.find(".alert-loading").remove()}initialize(e){this.currentModal=e,this.getStatus(),e.on("click",this.selectorErrorFixTrigger,e=>{e.preventDefault(),this.fix()})}getStatus(){const e=this.getModalBody(),t=r(this.selectorGridderBadge);t.text("").hide(),e.find(this.selectorOutputContainer).empty().append(d.render(c.loading,"Loading...","")),new n(l.getUrl("folderStructureGetStatus")).get({cache:"no-cache"}).then(async r=>{const s=await r.resolve();if(e.empty().append(s.html),i.setButtons(s.buttons),!0===s.success&&Array.isArray(s.errorStatus)){let r=0;s.errorStatus.length>0?(e.find(this.selectorErrorContainer).show(),e.find(this.selectorErrorList).empty(),s.errorStatus.forEach(s=>{r++,t.text(r).show();const i=a.render(s.severity,s.title,s.message);e.find(this.selectorErrorList).append(i)})):e.find(this.selectorErrorContainer).hide()}!0===s.success&&Array.isArray(s.okStatus)&&(s.okStatus.length>0?(e.find(this.selectorOkContainer).show(),e.find(this.selectorOkList).empty(),s.okStatus.forEach(t=>{const r=a.render(t.severity,t.title,t.message);e.find(this.selectorOkList).append(r)})):e.find(this.selectorOkContainer).hide());let o=s.folderStructureFilePermissionStatus;e.find(this.selectorPermissionContainer).empty().append(a.render(o.severity,o.title,o.message)),o=s.folderStructureDirectoryPermissionStatus,e.find(this.selectorPermissionContainer).append(a.render(o.severity,o.title,o.message))},t=>{l.handleAjaxError(t,e)})}fix(){this.setModalButtonsState(!1);const e=this.getModalBody(),t=this.findInModal(this.selectorOutputContainer),r=d.render(c.loading,"Loading...","");t.empty().html(r),new n(l.getUrl("folderStructureFix")).get({cache:"no-cache"}).then(async e=>{const r=await e.resolve();u.removeLoadingMessage(t),!0===r.success&&Array.isArray(r.fixedStatus)?(r.fixedStatus.length>0?r.fixedStatus.forEach(e=>{t.append(a.render(e.severity,e.title,e.message))}):t.append(a.render(c.warning,"Nothing fixed","")),this.getStatus()):o.error("Something went wrong")},t=>{l.handleAjaxError(t,e)})}}return new u})); \ No newline at end of file diff --git a/typo3/sysext/install/Resources/Public/JavaScript/Module/Environment/ImageProcessing.js b/typo3/sysext/install/Resources/Public/JavaScript/Module/Environment/ImageProcessing.js index a767a19d6895..11fd3c4fbb1c 100644 --- a/typo3/sysext/install/Resources/Public/JavaScript/Module/Environment/ImageProcessing.js +++ b/typo3/sysext/install/Resources/Public/JavaScript/Module/Environment/ImageProcessing.js @@ -10,4 +10,4 @@ * * The TYPO3 project - inspiring people to share! */ -define(["require","exports","jquery","../AbstractInteractableModule","TYPO3/CMS/Backend/Modal","TYPO3/CMS/Backend/Notification","TYPO3/CMS/Core/Ajax/AjaxRequest","../../Renderable/InfoBox","../../Renderable/Severity","../../Router","bootstrap"],(function(e,t,s,n,a,r,o,i,c,l){"use strict";class d extends n.AbstractInteractableModule{constructor(){super(...arguments),this.selectorExecuteTrigger=".t3js-imageProcessing-execute",this.selectorTestContainer=".t3js-imageProcessing-twinContainer",this.selectorTwinImageTemplate=".t3js-imageProcessing-twinImage-template",this.selectorCommandContainer=".t3js-imageProcessing-command",this.selectorCommandText=".t3js-imageProcessing-command-text",this.selectorTwinImages=".t3js-imageProcessing-images"}initialize(e){this.currentModal=e,this.getData(),e.on("click",this.selectorExecuteTrigger,e=>{e.preventDefault(),this.runTests()})}getData(){const e=this.getModalBody();new o(l.getUrl("imageProcessingGetData")).get({cache:"no-cache"}).then(async t=>{const s=await t.resolve();!0===s.success?(e.empty().append(s.html),a.setButtons(s.buttons),this.runTests()):r.error("Something went wrong")},t=>{l.handleAjaxError(t,e)})}runTests(){const e=this.getModalBody(),t=this.findInModal(this.selectorExecuteTrigger);t.addClass("disabled").prop("disabled",!0);const n=this.findInModal(this.selectorTwinImageTemplate),a=[];e.find(this.selectorTestContainer).each((t,r)=>{const d=s(r),m=d.data("test"),g=i.render(c.loading,"Loading...","");d.empty().html(g);const h=new o(l.getUrl(m)).get({cache:"no-cache"}).then(async e=>{const t=await e.resolve();if(!0===t.success){d.empty(),Array.isArray(t.status)&&t.status.forEach(()=>{const e=i.render(r.severity,r.title,r.message);d.append(e)});const e=n.clone();if(e.removeClass("t3js-imageProcessing-twinImage-template"),!0===t.fileExists&&(e.find("img.reference").attr("src",t.referenceFile),e.find("img.result").attr("src",t.outputFile),e.find(this.selectorTwinImages).show()),Array.isArray(t.command)&&t.command.length>0){e.find(this.selectorCommandContainer).show();const s=[];t.command.forEach(e=>{s.push("<strong>Command:</strong>\n"+e[1]),3===e.length&&s.push("<strong>Result:</strong>\n"+e[2])}),e.find(this.selectorCommandText).html(s.join("\n"))}d.append(e)}},t=>{l.handleAjaxError(t,e)});a.push(h)}),Promise.all(a).then(()=>{t.removeClass("disabled").prop("disabled",!1)})}}return new d})); \ No newline at end of file +define(["require","exports","jquery","../AbstractInteractableModule","TYPO3/CMS/Backend/Modal","TYPO3/CMS/Backend/Notification","TYPO3/CMS/Core/Ajax/AjaxRequest","../../Renderable/InfoBox","../../Renderable/Severity","../../Router","bootstrap"],(function(e,t,s,n,r,a,o,i,c,l){"use strict";class m extends n.AbstractInteractableModule{constructor(){super(...arguments),this.selectorExecuteTrigger=".t3js-imageProcessing-execute",this.selectorTestContainer=".t3js-imageProcessing-twinContainer",this.selectorTwinImageTemplate=".t3js-imageProcessing-twinImage-template",this.selectorCommandContainer=".t3js-imageProcessing-command",this.selectorCommandText=".t3js-imageProcessing-command-text",this.selectorTwinImages=".t3js-imageProcessing-images"}initialize(e){this.currentModal=e,this.getData(),e.on("click",this.selectorExecuteTrigger,e=>{e.preventDefault(),this.runTests()})}getData(){const e=this.getModalBody();new o(l.getUrl("imageProcessingGetData")).get({cache:"no-cache"}).then(async t=>{const s=await t.resolve();!0===s.success?(e.empty().append(s.html),r.setButtons(s.buttons),this.runTests()):a.error("Something went wrong")},t=>{l.handleAjaxError(t,e)})}runTests(){const e=this.getModalBody(),t=this.findInModal(this.selectorExecuteTrigger);this.setModalButtonsState(!1);const n=this.findInModal(this.selectorTwinImageTemplate),r=[];e.find(this.selectorTestContainer).each((t,a)=>{const m=s(a),g=m.data("test"),d=i.render(c.loading,"Loading...","");m.empty().html(d);const h=new o(l.getUrl(g)).get({cache:"no-cache"}).then(async e=>{const t=await e.resolve();if(!0===t.success){m.empty(),Array.isArray(t.status)&&t.status.forEach(()=>{const e=i.render(a.severity,a.title,a.message);m.append(e)});const e=n.clone();if(e.removeClass("t3js-imageProcessing-twinImage-template"),!0===t.fileExists&&(e.find("img.reference").attr("src",t.referenceFile),e.find("img.result").attr("src",t.outputFile),e.find(this.selectorTwinImages).show()),Array.isArray(t.command)&&t.command.length>0){e.find(this.selectorCommandContainer).show();const s=[];t.command.forEach(e=>{s.push("<strong>Command:</strong>\n"+e[1]),3===e.length&&s.push("<strong>Result:</strong>\n"+e[2])}),e.find(this.selectorCommandText).html(s.join("\n"))}m.append(e)}},t=>{l.handleAjaxError(t,e)});r.push(h)}),Promise.all(r).then(()=>{t.removeClass("disabled").prop("disabled",!1)})}}return new m})); \ No newline at end of file diff --git a/typo3/sysext/install/Resources/Public/JavaScript/Module/Environment/MailTest.js b/typo3/sysext/install/Resources/Public/JavaScript/Module/Environment/MailTest.js index 8d8988b27dcb..1b9645fb4a8f 100644 --- a/typo3/sysext/install/Resources/Public/JavaScript/Module/Environment/MailTest.js +++ b/typo3/sysext/install/Resources/Public/JavaScript/Module/Environment/MailTest.js @@ -10,4 +10,4 @@ * * The TYPO3 project - inspiring people to share! */ -define(["require","exports","../AbstractInteractableModule","TYPO3/CMS/Backend/Modal","TYPO3/CMS/Backend/Notification","TYPO3/CMS/Core/Ajax/AjaxRequest","../../Renderable/InfoBox","../../Renderable/ProgressBar","../../Renderable/Severity","../../Router","bootstrap"],(function(t,e,n,s,a,r,o,i,l,c){"use strict";class u extends n.AbstractInteractableModule{constructor(){super(...arguments),this.selectorOutputContainer=".t3js-mailTest-output",this.selectorMailTestButton=".t3js-mailTest-execute"}initialize(t){this.currentModal=t,this.getData(),t.on("click",this.selectorMailTestButton,t=>{t.preventDefault(),this.send()}),t.on("submit","form",t=>{t.preventDefault(),this.send()})}getData(){const t=this.getModalBody();new r(c.getUrl("mailTestGetData")).get({cache:"no-cache"}).then(async e=>{const n=await e.resolve();!0===n.success?(t.empty().append(n.html),s.setButtons(n.buttons)):a.error("Something went wrong")},e=>{c.handleAjaxError(e,t)})}send(){const t=this.getModuleContent().data("mail-test-token"),e=this.findInModal(this.selectorOutputContainer),n=i.render(l.loading,"Loading...","");e.empty().html(n),new r(c.getUrl()).post({install:{action:"mailTest",token:t,email:this.findInModal(".t3js-mailTest-email").val()}}).then(async t=>{const n=await t.resolve();e.empty(),Array.isArray(n.status)?n.status.forEach(t=>{const n=o.render(t.severity,t.title,t.message);e.html(n)}):a.error("Something went wrong")},()=>{a.error("Something went wrong")})}}return new u})); \ No newline at end of file +define(["require","exports","../AbstractInteractableModule","TYPO3/CMS/Backend/Modal","TYPO3/CMS/Backend/Notification","TYPO3/CMS/Core/Ajax/AjaxRequest","../../Renderable/InfoBox","../../Renderable/ProgressBar","../../Renderable/Severity","../../Router","bootstrap"],(function(t,e,s,n,a,o,r,i,l,c){"use strict";class u extends s.AbstractInteractableModule{constructor(){super(...arguments),this.selectorOutputContainer=".t3js-mailTest-output",this.selectorMailTestButton=".t3js-mailTest-execute"}initialize(t){this.currentModal=t,this.getData(),t.on("click",this.selectorMailTestButton,t=>{t.preventDefault(),this.send()}),t.on("submit","form",t=>{t.preventDefault(),this.send()})}getData(){const t=this.getModalBody();new o(c.getUrl("mailTestGetData")).get({cache:"no-cache"}).then(async e=>{const s=await e.resolve();!0===s.success?(t.empty().append(s.html),n.setButtons(s.buttons)):a.error("Something went wrong")},e=>{c.handleAjaxError(e,t)})}send(){this.setModalButtonsState(!1);const t=this.getModuleContent().data("mail-test-token"),e=this.findInModal(this.selectorOutputContainer),s=i.render(l.loading,"Loading...","");e.empty().html(s),new o(c.getUrl()).post({install:{action:"mailTest",token:t,email:this.findInModal(".t3js-mailTest-email").val()}}).then(async t=>{const s=await t.resolve();e.empty(),Array.isArray(s.status)?s.status.forEach(t=>{const s=r.render(t.severity,t.title,t.message);e.html(s)}):a.error("Something went wrong")},()=>{a.error("Something went wrong")}).finally(()=>{this.setModalButtonsState(!0)})}}return new u})); \ No newline at end of file diff --git a/typo3/sysext/install/Resources/Public/JavaScript/Module/Maintenance/Cache.js b/typo3/sysext/install/Resources/Public/JavaScript/Module/Maintenance/Cache.js index 05cfd1cd0377..4a1dde977b15 100644 --- a/typo3/sysext/install/Resources/Public/JavaScript/Module/Maintenance/Cache.js +++ b/typo3/sysext/install/Resources/Public/JavaScript/Module/Maintenance/Cache.js @@ -10,4 +10,4 @@ * * The TYPO3 project - inspiring people to share! */ -define(["require","exports","TYPO3/CMS/Backend/Notification","TYPO3/CMS/Core/Ajax/AjaxRequest","../../Router"],(function(e,s,a,r,t){"use strict";return new class{initialize(e){e.addClass("disabled").prop("disabled",!0),new r(t.getUrl("cacheClearAll","maintenance")).get({cache:"no-cache"}).then(async e=>{const s=await e.resolve();!0===s.success&&Array.isArray(s.status)?s.status.length>0&&s.status.forEach(e=>{a.success(e.title,e.message)}):a.error("Something went wrong clearing caches")},()=>{a.error("Clearing caches went wrong on the server side. Check the system for broken extensions or missing database tables and try again")}).finally(()=>{e.removeClass("disabled").prop("disabled",!1)})}}})); \ No newline at end of file +define(["require","exports","TYPO3/CMS/Backend/Notification","TYPO3/CMS/Core/Ajax/AjaxRequest","../../Router","../AbstractInlineModule"],(function(e,t,s,n,a,r){"use strict";class i extends r.AbstractInlineModule{initialize(e){this.setButtonState(e,!1),new n(a.getUrl("cacheClearAll","maintenance")).get({cache:"no-cache"}).then(async e=>{const t=await e.resolve();!0===t.success&&Array.isArray(t.status)?t.status.length>0&&t.status.forEach(e=>{s.success(e.title,e.message)}):s.error("Something went wrong clearing caches")},()=>{s.error("Clearing caches went wrong on the server side. Check the system for broken extensions or missing database tables and try again")}).finally(()=>{this.setButtonState(e,!0)})}}return new i})); \ No newline at end of file diff --git a/typo3/sysext/install/Resources/Public/JavaScript/Module/Maintenance/ClearTables.js b/typo3/sysext/install/Resources/Public/JavaScript/Module/Maintenance/ClearTables.js index 8dee6a189936..a69acc497045 100644 --- a/typo3/sysext/install/Resources/Public/JavaScript/Module/Maintenance/ClearTables.js +++ b/typo3/sysext/install/Resources/Public/JavaScript/Module/Maintenance/ClearTables.js @@ -10,4 +10,4 @@ * * The TYPO3 project - inspiring people to share! */ -define(["require","exports","jquery","../AbstractInteractableModule","TYPO3/CMS/Backend/Modal","TYPO3/CMS/Backend/Notification","TYPO3/CMS/Core/Ajax/AjaxRequest","../../Router"],(function(t,e,s,a,r,l,o,c){"use strict";class n extends a.AbstractInteractableModule{constructor(){super(...arguments),this.selectorClearTrigger=".t3js-clearTables-clear",this.selectorStatsTrigger=".t3js-clearTables-stats",this.selectorOutputContainer=".t3js-clearTables-output",this.selectorStatContainer=".t3js-clearTables-stat-container",this.selectorStatTemplate=".t3js-clearTables-stat-template",this.selectorStatDescription=".t3js-clearTables-stat-description",this.selectorStatRows=".t3js-clearTables-stat-rows",this.selectorStatName=".t3js-clearTables-stat-name"}initialize(t){this.currentModal=t,this.getStats(),t.on("click",this.selectorStatsTrigger,t=>{t.preventDefault(),s(this.selectorOutputContainer).empty(),this.getStats()}),t.on("click",this.selectorClearTrigger,t=>{const e=s(t.target).closest(this.selectorClearTrigger).data("table");t.preventDefault(),this.clear(e)})}getStats(){const t=this.getModalBody();new o(c.getUrl("clearTablesStats")).get({cache:"no-cache"}).then(async e=>{const s=await e.resolve();!0===s.success?(t.empty().append(s.html),r.setButtons(s.buttons),Array.isArray(s.stats)&&s.stats.length>0&&s.stats.forEach(e=>{if(e.rowCount>0){const s=t.find(this.selectorStatTemplate).clone();s.find(this.selectorStatDescription).text(e.description),s.find(this.selectorStatName).text(e.name),s.find(this.selectorStatRows).text(e.rowCount),s.find(this.selectorClearTrigger).attr("data-table",e.name),t.find(this.selectorStatContainer).append(s.html())}})):l.error("Something went wrong")},e=>{c.handleAjaxError(e,t)})}clear(t){const e=this.getModalBody(),s=this.getModuleContent().data("clear-tables-clear-token");new o(c.getUrl()).post({install:{action:"clearTablesClear",token:s,table:t}}).then(async t=>{const e=await t.resolve();!0===e.success&&Array.isArray(e.status)?e.status.forEach(t=>{l.success(t.message)}):l.error("Something went wrong"),this.getStats()},t=>{c.handleAjaxError(t,e)})}}return new n})); \ No newline at end of file +define(["require","exports","jquery","../AbstractInteractableModule","TYPO3/CMS/Backend/Modal","TYPO3/CMS/Backend/Notification","TYPO3/CMS/Core/Ajax/AjaxRequest","../../Router"],(function(t,e,s,a,r,l,o,c){"use strict";class n extends a.AbstractInteractableModule{constructor(){super(...arguments),this.selectorClearTrigger=".t3js-clearTables-clear",this.selectorStatsTrigger=".t3js-clearTables-stats",this.selectorOutputContainer=".t3js-clearTables-output",this.selectorStatContainer=".t3js-clearTables-stat-container",this.selectorStatTemplate=".t3js-clearTables-stat-template",this.selectorStatDescription=".t3js-clearTables-stat-description",this.selectorStatRows=".t3js-clearTables-stat-rows",this.selectorStatName=".t3js-clearTables-stat-name"}initialize(t){this.currentModal=t,this.getStats(),t.on("click",this.selectorStatsTrigger,t=>{t.preventDefault(),s(this.selectorOutputContainer).empty(),this.getStats()}),t.on("click",this.selectorClearTrigger,t=>{const e=s(t.target).closest(this.selectorClearTrigger).data("table");t.preventDefault(),this.clear(e)})}getStats(){this.setModalButtonsState(!1);const t=this.getModalBody();new o(c.getUrl("clearTablesStats")).get({cache:"no-cache"}).then(async e=>{const s=await e.resolve();!0===s.success?(t.empty().append(s.html),r.setButtons(s.buttons),Array.isArray(s.stats)&&s.stats.length>0&&s.stats.forEach(e=>{if(e.rowCount>0){const s=t.find(this.selectorStatTemplate).clone();s.find(this.selectorStatDescription).text(e.description),s.find(this.selectorStatName).text(e.name),s.find(this.selectorStatRows).text(e.rowCount),s.find(this.selectorClearTrigger).attr("data-table",e.name),t.find(this.selectorStatContainer).append(s.html())}})):l.error("Something went wrong")},e=>{c.handleAjaxError(e,t)})}clear(t){const e=this.getModalBody(),s=this.getModuleContent().data("clear-tables-clear-token");new o(c.getUrl()).post({install:{action:"clearTablesClear",token:s,table:t}}).then(async t=>{const e=await t.resolve();!0===e.success&&Array.isArray(e.status)?e.status.forEach(t=>{l.success(t.message)}):l.error("Something went wrong"),this.getStats()},t=>{c.handleAjaxError(t,e)})}}return new n})); \ No newline at end of file diff --git a/typo3/sysext/install/Resources/Public/JavaScript/Module/Maintenance/ClearTypo3tempFiles.js b/typo3/sysext/install/Resources/Public/JavaScript/Module/Maintenance/ClearTypo3tempFiles.js index 3266911ce876..dde1e7e98680 100644 --- a/typo3/sysext/install/Resources/Public/JavaScript/Module/Maintenance/ClearTypo3tempFiles.js +++ b/typo3/sysext/install/Resources/Public/JavaScript/Module/Maintenance/ClearTypo3tempFiles.js @@ -10,4 +10,4 @@ * * The TYPO3 project - inspiring people to share! */ -define(["require","exports","jquery","../AbstractInteractableModule","TYPO3/CMS/Backend/Modal","TYPO3/CMS/Backend/Notification","TYPO3/CMS/Core/Ajax/AjaxRequest","../../Router"],(function(t,e,r,s,a,o,i,l){"use strict";class c extends s.AbstractInteractableModule{constructor(){super(...arguments),this.selectorDeleteTrigger=".t3js-clearTypo3temp-delete",this.selectorOutputContainer=".t3js-clearTypo3temp-output",this.selectorStatContainer=".t3js-clearTypo3temp-stat-container",this.selectorStatsTrigger=".t3js-clearTypo3temp-stats",this.selectorStatTemplate=".t3js-clearTypo3temp-stat-template",this.selectorStatNumberOfFiles=".t3js-clearTypo3temp-stat-numberOfFiles",this.selectorStatDirectory=".t3js-clearTypo3temp-stat-directory"}initialize(t){this.currentModal=t,this.getStats(),t.on("click",this.selectorStatsTrigger,t=>{t.preventDefault(),r(this.selectorOutputContainer).empty(),this.getStats()}),t.on("click",this.selectorDeleteTrigger,t=>{const e=r(t.currentTarget).data("folder"),s=r(t.currentTarget).data("storage-uid");t.preventDefault(),this.delete(e,s)})}getStats(){const t=this.getModalBody();new i(l.getUrl("clearTypo3tempFilesStats")).get({cache:"no-cache"}).then(async e=>{const r=await e.resolve();!0===r.success?(t.empty().append(r.html),a.setButtons(r.buttons),Array.isArray(r.stats)&&r.stats.length>0&&r.stats.forEach(e=>{if(e.numberOfFiles>0){const r=t.find(this.selectorStatTemplate).clone();r.find(this.selectorStatNumberOfFiles).text(e.numberOfFiles),r.find(this.selectorStatDirectory).text(e.directory),r.find(this.selectorDeleteTrigger).attr("data-folder",e.directory),r.find(this.selectorDeleteTrigger).attr("data-storage-uid",e.storageUid),t.find(this.selectorStatContainer).append(r.html())}})):o.error("Something went wrong")},e=>{l.handleAjaxError(e,t)})}delete(t,e){const r=this.getModalBody(),s=this.getModuleContent().data("clear-typo3temp-delete-token");new i(l.getUrl()).post({install:{action:"clearTypo3tempFiles",token:s,folder:t,storageUid:e}}).then(async t=>{const e=await t.resolve();!0===e.success&&Array.isArray(e.status)?(e.status.forEach(t=>{o.success(t.message)}),this.getStats()):o.error("Something went wrong")},t=>{l.handleAjaxError(t,r)})}}return new c})); \ No newline at end of file +define(["require","exports","jquery","../AbstractInteractableModule","TYPO3/CMS/Backend/Modal","TYPO3/CMS/Backend/Notification","TYPO3/CMS/Core/Ajax/AjaxRequest","../../Router"],(function(t,e,s,r,a,o,i,l){"use strict";class c extends r.AbstractInteractableModule{constructor(){super(...arguments),this.selectorDeleteTrigger=".t3js-clearTypo3temp-delete",this.selectorOutputContainer=".t3js-clearTypo3temp-output",this.selectorStatContainer=".t3js-clearTypo3temp-stat-container",this.selectorStatsTrigger=".t3js-clearTypo3temp-stats",this.selectorStatTemplate=".t3js-clearTypo3temp-stat-template",this.selectorStatNumberOfFiles=".t3js-clearTypo3temp-stat-numberOfFiles",this.selectorStatDirectory=".t3js-clearTypo3temp-stat-directory"}initialize(t){this.currentModal=t,this.getStats(),t.on("click",this.selectorStatsTrigger,t=>{t.preventDefault(),s(this.selectorOutputContainer).empty(),this.getStats()}),t.on("click",this.selectorDeleteTrigger,t=>{const e=s(t.currentTarget).data("folder"),r=s(t.currentTarget).data("storage-uid");t.preventDefault(),this.delete(e,r)})}getStats(){this.setModalButtonsState(!1);const t=this.getModalBody();new i(l.getUrl("clearTypo3tempFilesStats")).get({cache:"no-cache"}).then(async e=>{const s=await e.resolve();!0===s.success?(t.empty().append(s.html),a.setButtons(s.buttons),Array.isArray(s.stats)&&s.stats.length>0&&s.stats.forEach(e=>{if(e.numberOfFiles>0){const s=t.find(this.selectorStatTemplate).clone();s.find(this.selectorStatNumberOfFiles).text(e.numberOfFiles),s.find(this.selectorStatDirectory).text(e.directory),s.find(this.selectorDeleteTrigger).attr("data-folder",e.directory),s.find(this.selectorDeleteTrigger).attr("data-storage-uid",e.storageUid),t.find(this.selectorStatContainer).append(s.html())}})):o.error("Something went wrong")},e=>{l.handleAjaxError(e,t)})}delete(t,e){const s=this.getModalBody(),r=this.getModuleContent().data("clear-typo3temp-delete-token");new i(l.getUrl()).post({install:{action:"clearTypo3tempFiles",token:r,folder:t,storageUid:e}}).then(async t=>{const e=await t.resolve();!0===e.success&&Array.isArray(e.status)?(e.status.forEach(t=>{o.success(t.message)}),this.getStats()):o.error("Something went wrong")},t=>{l.handleAjaxError(t,s)})}}return new c})); \ No newline at end of file diff --git a/typo3/sysext/install/Resources/Public/JavaScript/Module/Maintenance/CreateAdmin.js b/typo3/sysext/install/Resources/Public/JavaScript/Module/Maintenance/CreateAdmin.js index c76a8087a232..157ef363abce 100644 --- a/typo3/sysext/install/Resources/Public/JavaScript/Module/Maintenance/CreateAdmin.js +++ b/typo3/sysext/install/Resources/Public/JavaScript/Module/Maintenance/CreateAdmin.js @@ -10,4 +10,4 @@ * * The TYPO3 project - inspiring people to share! */ -define(["require","exports","TYPO3/CMS/Backend/Modal","TYPO3/CMS/Backend/Notification","TYPO3/CMS/Core/Ajax/AjaxRequest","../../Router","../PasswordStrength","../AbstractInteractableModule"],(function(t,e,a,s,n,r,i,o){"use strict";class d extends o.AbstractInteractableModule{constructor(){super(...arguments),this.selectorAdminCreateButton=".t3js-createAdmin-create"}initialize(t){this.currentModal=t,this.getData(),t.on("click",this.selectorAdminCreateButton,t=>{t.preventDefault(),this.create()}),t.on("click",".t3-install-form-password-strength",()=>{i.initialize(".t3-install-form-password-strength")})}getData(){const t=this.getModalBody();new n(r.getUrl("createAdminGetData")).get({cache:"no-cache"}).then(async e=>{const n=await e.resolve();!0===n.success?(t.empty().append(n.html),a.setButtons(n.buttons)):s.error("Something went wrong")},e=>{r.handleAjaxError(e,t)})}create(){const t=this.getModalBody(),e=this.getModuleContent().data("create-admin-token");new n(r.getUrl()).post({install:{action:"createAdmin",token:e,userName:this.findInModal(".t3js-createAdmin-user").val(),userPassword:this.findInModal(".t3js-createAdmin-password").val(),userPasswordCheck:this.findInModal(".t3js-createAdmin-password-check").val(),userEmail:this.findInModal(".t3js-createAdmin-email").val(),userSystemMaintainer:this.findInModal(".t3js-createAdmin-system-maintainer").is(":checked")?1:0}}).then(async t=>{const e=await t.resolve();!0===e.success&&Array.isArray(e.status)?e.status.forEach(t=>{2===t.severity?s.error(t.message):s.success(t.title)}):s.error("Something went wrong")},e=>{r.handleAjaxError(e,t)}),this.findInModal(".t3js-createAdmin-user").val(""),this.findInModal(".t3js-createAdmin-password").val(""),this.findInModal(".t3js-createAdmin-password-check").val(""),this.findInModal(".t3js-createAdmin-email").val(""),this.findInModal(".t3js-createAdmin-system-maintainer").prop("checked",!1)}}return new d})); \ No newline at end of file +define(["require","exports","TYPO3/CMS/Backend/Modal","TYPO3/CMS/Backend/Notification","TYPO3/CMS/Core/Ajax/AjaxRequest","../../Router","../PasswordStrength","../AbstractInteractableModule"],(function(t,e,s,a,n,i,r,o){"use strict";class d extends o.AbstractInteractableModule{constructor(){super(...arguments),this.selectorAdminCreateButton=".t3js-createAdmin-create"}initialize(t){this.currentModal=t,this.getData(),t.on("click",this.selectorAdminCreateButton,t=>{t.preventDefault(),this.create()}),t.on("click",".t3-install-form-password-strength",()=>{r.initialize(".t3-install-form-password-strength")})}getData(){const t=this.getModalBody();new n(i.getUrl("createAdminGetData")).get({cache:"no-cache"}).then(async e=>{const n=await e.resolve();!0===n.success?(t.empty().append(n.html),s.setButtons(n.buttons)):a.error("Something went wrong")},e=>{i.handleAjaxError(e,t)})}create(){this.setModalButtonsState(!1);const t=this.getModalBody(),e={install:{action:"createAdmin",token:this.getModuleContent().data("create-admin-token"),userName:this.findInModal(".t3js-createAdmin-user").val(),userPassword:this.findInModal(".t3js-createAdmin-password").val(),userPasswordCheck:this.findInModal(".t3js-createAdmin-password-check").val(),userEmail:this.findInModal(".t3js-createAdmin-email").val(),userSystemMaintainer:this.findInModal(".t3js-createAdmin-system-maintainer").is(":checked")?1:0}};this.getModuleContent().find(":input").prop("disabled",!0),new n(i.getUrl()).post(e).then(async t=>{const e=await t.resolve();!0===e.success&&Array.isArray(e.status)?e.status.forEach(t=>{2===t.severity?a.error(t.message):a.success(t.title)}):a.error("Something went wrong")},e=>{i.handleAjaxError(e,t)}).finally(()=>{this.setModalButtonsState(!0),this.getModuleContent().find(":input").prop("disabled",!1),this.findInModal(".t3js-createAdmin-user").val(""),this.findInModal(".t3js-createAdmin-password").val(""),this.findInModal(".t3js-createAdmin-password-check").val(""),this.findInModal(".t3js-createAdmin-email").val(""),this.findInModal(".t3js-createAdmin-system-maintainer").prop("checked",!1)})}}return new d})); \ No newline at end of file diff --git a/typo3/sysext/install/Resources/Public/JavaScript/Module/Maintenance/DatabaseAnalyzer.js b/typo3/sysext/install/Resources/Public/JavaScript/Module/Maintenance/DatabaseAnalyzer.js index efe6c1de3f39..af49c1dd8f09 100644 --- a/typo3/sysext/install/Resources/Public/JavaScript/Module/Maintenance/DatabaseAnalyzer.js +++ b/typo3/sysext/install/Resources/Public/JavaScript/Module/Maintenance/DatabaseAnalyzer.js @@ -10,4 +10,4 @@ * * The TYPO3 project - inspiring people to share! */ -define(["require","exports","jquery","../AbstractInteractableModule","TYPO3/CMS/Backend/Modal","TYPO3/CMS/Backend/Notification","TYPO3/CMS/Core/Ajax/AjaxRequest","../../Renderable/InfoBox","../../Renderable/ProgressBar","../../Renderable/Severity","../../Router"],(function(e,t,a,s,n,r,o,i,l,c,d){"use strict";class g extends s.AbstractInteractableModule{constructor(){super(...arguments),this.selectorAnalyzeTrigger=".t3js-databaseAnalyzer-analyze",this.selectorExecuteTrigger=".t3js-databaseAnalyzer-execute",this.selectorOutputContainer=".t3js-databaseAnalyzer-output",this.selectorSuggestionBlock=".t3js-databaseAnalyzer-suggestion-block",this.selectorSuggestionList=".t3js-databaseAnalyzer-suggestion-list",this.selectorSuggestionLineTemplate=".t3js-databaseAnalyzer-suggestion-line-template"}initialize(e){this.currentModal=e,this.getData(),e.on("click",".t3js-databaseAnalyzer-suggestion-block-checkbox",e=>{const t=a(e.currentTarget);t.closest("fieldset").find(":checkbox").prop("checked",t.get(0).checked)}),e.on("click",this.selectorAnalyzeTrigger,e=>{e.preventDefault(),this.analyze()}),e.on("click",this.selectorExecuteTrigger,e=>{e.preventDefault(),this.execute()})}getData(){const e=this.getModalBody();new o(d.getUrl("databaseAnalyzer")).get({cache:"no-cache"}).then(async t=>{const a=await t.resolve();!0===a.success?(e.empty().append(a.html),n.setButtons(a.buttons),this.analyze()):r.error("Something went wrong")},t=>{d.handleAjaxError(t,e)})}analyze(){const e=this.getModalBody(),t=this.getModalFooter(),a=e.find(this.selectorOutputContainer),s=t.find(this.selectorExecuteTrigger),n=t.find(this.selectorAnalyzeTrigger);a.empty().append(l.render(c.loading,"Analyzing current database schema...","")),n.prop("disabled",!0),s.prop("disabled",!0),a.on("change",'input[type="checkbox"]',()=>{const e=a.find(":checked").length>0;s.prop("disabled",!e)}),new o(d.getUrl("databaseAnalyzerAnalyze")).get({cache:"no-cache"}).then(async t=>{const o=await t.resolve();if(!0===o.success){if(Array.isArray(o.status)&&(a.find(".alert-loading").remove(),o.status.forEach(e=>{const t=i.render(e.severity,e.title,e.message);a.append(t)})),Array.isArray(o.suggestions)){o.suggestions.forEach(t=>{const s=e.find(this.selectorSuggestionBlock).clone();s.removeClass(this.selectorSuggestionBlock.substr(1));const n=t.key;s.find(".t3js-databaseAnalyzer-suggestion-block-legend").text(t.label),s.find(".t3js-databaseAnalyzer-suggestion-block-checkbox").attr("id","t3-install-"+n+"-checkbox"),t.enabled&&s.find(".t3js-databaseAnalyzer-suggestion-block-checkbox").attr("checked","checked"),s.find(".t3js-databaseAnalyzer-suggestion-block-label").attr("for","t3-install-"+n+"-checkbox"),t.children.forEach(a=>{const n=e.find(this.selectorSuggestionLineTemplate).children().clone(),r=a.hash,o=n.find(".t3js-databaseAnalyzer-suggestion-line-checkbox");o.attr("id","t3-install-db-"+r).attr("data-hash",r),t.enabled&&o.attr("checked","checked"),n.find(".t3js-databaseAnalyzer-suggestion-line-label").attr("for","t3-install-db-"+r),n.find(".t3js-databaseAnalyzer-suggestion-line-statement").text(a.statement),void 0!==a.current&&(n.find(".t3js-databaseAnalyzer-suggestion-line-current-value").text(a.current),n.find(".t3js-databaseAnalyzer-suggestion-line-current").show()),void 0!==a.rowCount&&(n.find(".t3js-databaseAnalyzer-suggestion-line-count-value").text(a.rowCount),n.find(".t3js-databaseAnalyzer-suggestion-line-count").show()),s.find(this.selectorSuggestionList).append(n)}),a.append(s.html())});const t=0===a.find(":checked").length;n.prop("disabled",!1),s.prop("disabled",t)}0===o.suggestions.length&&0===o.status.length&&a.append(i.render(c.ok,"Database schema is up to date. Good job!",""))}else r.error("Something went wrong")},t=>{d.handleAjaxError(t,e)})}execute(){const e=this.getModalBody(),t=this.getModalFooter(),s=this.getModuleContent().data("database-analyzer-execute-token"),n=e.find(this.selectorOutputContainer),i=[];n.find(".t3js-databaseAnalyzer-suggestion-line input:checked").each((e,t)=>{i.push(a(t).data("hash"))}),n.empty().append(l.render(c.loading,"Executing database updates...","")),t.find(this.selectorExecuteTrigger).prop("disabled",!0),t.find(this.selectorAnalyzeTrigger).prop("disabled",!0),new o(d.getUrl()).post({install:{action:"databaseAnalyzerExecute",token:s,hashes:i}}).then(async e=>{const t=await e.resolve();!0===t.success&&Array.isArray(t.status)&&t.status.forEach(e=>{r.showMessage(e.title,e.message,e.severity)}),this.analyze()},t=>{d.handleAjaxError(t,e)})}}return new g})); \ No newline at end of file +define(["require","exports","jquery","../AbstractInteractableModule","TYPO3/CMS/Backend/Modal","TYPO3/CMS/Backend/Notification","TYPO3/CMS/Core/Ajax/AjaxRequest","../../Renderable/InfoBox","../../Renderable/ProgressBar","../../Renderable/Severity","../../Router"],(function(e,t,a,s,n,o,r,i,l,c,d){"use strict";class g extends s.AbstractInteractableModule{constructor(){super(...arguments),this.selectorAnalyzeTrigger=".t3js-databaseAnalyzer-analyze",this.selectorExecuteTrigger=".t3js-databaseAnalyzer-execute",this.selectorOutputContainer=".t3js-databaseAnalyzer-output",this.selectorSuggestionBlock=".t3js-databaseAnalyzer-suggestion-block",this.selectorSuggestionList=".t3js-databaseAnalyzer-suggestion-list",this.selectorSuggestionLineTemplate=".t3js-databaseAnalyzer-suggestion-line-template"}initialize(e){this.currentModal=e,this.getData(),e.on("click",".t3js-databaseAnalyzer-suggestion-block-checkbox",e=>{const t=a(e.currentTarget);t.closest("fieldset").find(":checkbox").prop("checked",t.get(0).checked)}),e.on("click",this.selectorAnalyzeTrigger,e=>{e.preventDefault(),this.analyze()}),e.on("click",this.selectorExecuteTrigger,e=>{e.preventDefault(),this.execute()})}getData(){const e=this.getModalBody();new r(d.getUrl("databaseAnalyzer")).get({cache:"no-cache"}).then(async t=>{const a=await t.resolve();!0===a.success?(e.empty().append(a.html),n.setButtons(a.buttons),this.analyze()):o.error("Something went wrong")},t=>{d.handleAjaxError(t,e)})}analyze(){this.setModalButtonsState(!1);const e=this.getModalBody(),t=this.getModalFooter(),a=e.find(this.selectorOutputContainer),s=t.find(this.selectorExecuteTrigger),n=t.find(this.selectorAnalyzeTrigger);a.empty().append(l.render(c.loading,"Analyzing current database schema...","")),a.on("change",'input[type="checkbox"]',()=>{const e=a.find(":checked").length>0;this.setModalButtonState(s,e)}),new r(d.getUrl("databaseAnalyzerAnalyze")).get({cache:"no-cache"}).then(async t=>{const r=await t.resolve();!0===r.success?(Array.isArray(r.status)&&(a.find(".alert-loading").remove(),r.status.forEach(e=>{const t=i.render(e.severity,e.title,e.message);a.append(t)})),Array.isArray(r.suggestions)&&(r.suggestions.forEach(t=>{const s=e.find(this.selectorSuggestionBlock).clone();s.removeClass(this.selectorSuggestionBlock.substr(1));const n=t.key;s.find(".t3js-databaseAnalyzer-suggestion-block-legend").text(t.label),s.find(".t3js-databaseAnalyzer-suggestion-block-checkbox").attr("id","t3-install-"+n+"-checkbox"),t.enabled&&s.find(".t3js-databaseAnalyzer-suggestion-block-checkbox").attr("checked","checked"),s.find(".t3js-databaseAnalyzer-suggestion-block-label").attr("for","t3-install-"+n+"-checkbox"),t.children.forEach(a=>{const n=e.find(this.selectorSuggestionLineTemplate).children().clone(),o=a.hash,r=n.find(".t3js-databaseAnalyzer-suggestion-line-checkbox");r.attr("id","t3-install-db-"+o).attr("data-hash",o),t.enabled&&r.attr("checked","checked"),n.find(".t3js-databaseAnalyzer-suggestion-line-label").attr("for","t3-install-db-"+o),n.find(".t3js-databaseAnalyzer-suggestion-line-statement").text(a.statement),void 0!==a.current&&(n.find(".t3js-databaseAnalyzer-suggestion-line-current-value").text(a.current),n.find(".t3js-databaseAnalyzer-suggestion-line-current").show()),void 0!==a.rowCount&&(n.find(".t3js-databaseAnalyzer-suggestion-line-count-value").text(a.rowCount),n.find(".t3js-databaseAnalyzer-suggestion-line-count").show()),s.find(this.selectorSuggestionList).append(n)}),a.append(s.html())}),this.setModalButtonState(n,!0),this.setModalButtonState(s,a.find(":checked").length>0)),0===r.suggestions.length&&0===r.status.length&&a.append(i.render(c.ok,"Database schema is up to date. Good job!",""))):o.error("Something went wrong")},t=>{d.handleAjaxError(t,e)})}execute(){this.setModalButtonsState(!1);const e=this.getModalBody(),t=this.getModuleContent().data("database-analyzer-execute-token"),s=e.find(this.selectorOutputContainer),n=[];s.find(".t3js-databaseAnalyzer-suggestion-line input:checked").each((e,t)=>{n.push(a(t).data("hash"))}),s.empty().append(l.render(c.loading,"Executing database updates...","")),new r(d.getUrl()).post({install:{action:"databaseAnalyzerExecute",token:t,hashes:n}}).then(async e=>{const t=await e.resolve();!0===t.success&&Array.isArray(t.status)&&t.status.forEach(e=>{o.showMessage(e.title,e.message,e.severity)}),this.analyze()},t=>{d.handleAjaxError(t,e)})}}return new g})); \ No newline at end of file diff --git a/typo3/sysext/install/Resources/Public/JavaScript/Module/Maintenance/DumpAutoload.js b/typo3/sysext/install/Resources/Public/JavaScript/Module/Maintenance/DumpAutoload.js index faeb12e40cf5..b0e346bdde8b 100644 --- a/typo3/sysext/install/Resources/Public/JavaScript/Module/Maintenance/DumpAutoload.js +++ b/typo3/sysext/install/Resources/Public/JavaScript/Module/Maintenance/DumpAutoload.js @@ -10,4 +10,4 @@ * * The TYPO3 project - inspiring people to share! */ -define(["require","exports","TYPO3/CMS/Backend/Notification","TYPO3/CMS/Core/Ajax/AjaxRequest","../../Router"],(function(e,s,a,t,r){"use strict";return new class{initialize(e){e.addClass("disabled").prop("disabled",!0),new t(r.getUrl("dumpAutoload")).get({cache:"no-cache"}).then(async e=>{const s=await e.resolve();!0===s.success&&Array.isArray(s.status)?s.status.length>0&&s.status.forEach(e=>{a.success(e.message)}):a.error("Something went wrong")},()=>{a.error("Dumping autoload files went wrong on the server side. Check the system for broken extensions and try again")}).finally(()=>{e.removeClass("disabled").prop("disabled",!1)})}}})); \ No newline at end of file +define(["require","exports","TYPO3/CMS/Backend/Notification","TYPO3/CMS/Core/Ajax/AjaxRequest","../../Router","../AbstractInlineModule"],(function(e,t,s,n,r,a){"use strict";class o extends a.AbstractInlineModule{initialize(e){this.setButtonState(e,!1),new n(r.getUrl("dumpAutoload")).get({cache:"no-cache"}).then(async e=>{const t=await e.resolve();!0===t.success&&Array.isArray(t.status)?t.status.length>0&&t.status.forEach(e=>{s.success(e.message)}):s.error("Something went wrong")},()=>{s.error("Dumping autoload files went wrong on the server side. Check the system for broken extensions and try again")}).finally(()=>{this.setButtonState(e,!0)})}}return new o})); \ No newline at end of file diff --git a/typo3/sysext/install/Resources/Public/JavaScript/Module/Maintenance/ResetBackendUserUc.js b/typo3/sysext/install/Resources/Public/JavaScript/Module/Maintenance/ResetBackendUserUc.js index 922a48abc718..2dd14b3cc5b4 100644 --- a/typo3/sysext/install/Resources/Public/JavaScript/Module/Maintenance/ResetBackendUserUc.js +++ b/typo3/sysext/install/Resources/Public/JavaScript/Module/Maintenance/ResetBackendUserUc.js @@ -10,4 +10,4 @@ * * The TYPO3 project - inspiring people to share! */ -define(["require","exports","TYPO3/CMS/Core/Ajax/AjaxRequest","TYPO3/CMS/Backend/Notification","../../Router"],(function(e,s,r,a,t){"use strict";return new class{initialize(e){e.addClass("disabled").prop("disabled",!0),new r(t.getUrl("resetBackendUserUc")).get({cache:"no-cache"}).then(async e=>{const s=await e.resolve();!0===s.success&&Array.isArray(s.status)?s.status.length>0&&s.status.forEach(e=>{a.success(e.message)}):a.error("Something went wrong ...")},()=>{a.error("Dumping autoload files went wrong on the server side. Check the system for broken extensions and try again")}).finally(()=>{e.removeClass("disabled").prop("disabled",!1)})}}})); \ No newline at end of file +define(["require","exports","TYPO3/CMS/Core/Ajax/AjaxRequest","../AbstractInlineModule","TYPO3/CMS/Backend/Notification","../../Router"],(function(e,t,s,n,r,a){"use strict";class o extends n.AbstractInlineModule{initialize(e){this.setButtonState(e,!1),new s(a.getUrl("resetBackendUserUc")).get({cache:"no-cache"}).then(async e=>{const t=await e.resolve();!0===t.success&&Array.isArray(t.status)?t.status.length>0&&t.status.forEach(e=>{r.success(e.message)}):r.error("Something went wrong ...")},()=>{r.error("Dumping autoload files went wrong on the server side. Check the system for broken extensions and try again")}).finally(()=>{this.setButtonState(e,!0)})}}return new o})); \ No newline at end of file diff --git a/typo3/sysext/install/Resources/Public/JavaScript/Module/Settings/ChangeInstallToolPassword.js b/typo3/sysext/install/Resources/Public/JavaScript/Module/Settings/ChangeInstallToolPassword.js index 68f21fc1dade..fdf0f958843b 100644 --- a/typo3/sysext/install/Resources/Public/JavaScript/Module/Settings/ChangeInstallToolPassword.js +++ b/typo3/sysext/install/Resources/Public/JavaScript/Module/Settings/ChangeInstallToolPassword.js @@ -10,4 +10,4 @@ * * The TYPO3 project - inspiring people to share! */ -define(["require","exports","TYPO3/CMS/Backend/Modal","TYPO3/CMS/Backend/Notification","TYPO3/CMS/Core/Ajax/AjaxRequest","../../Router","../PasswordStrength","../AbstractInteractableModule"],(function(t,s,a,e,o,n,r,l){"use strict";class c extends l.AbstractInteractableModule{constructor(){super(...arguments),this.selectorChangeButton=".t3js-changeInstallToolPassword-change"}initialize(t){this.currentModal=t,this.getData(),t.on("click",this.selectorChangeButton,t=>{t.preventDefault(),this.change()}),t.on("click",".t3-install-form-password-strength",()=>{r.initialize(".t3-install-form-password-strength")})}getData(){const t=this.getModalBody();new o(n.getUrl("changeInstallToolPasswordGetData")).get({cache:"no-cache"}).then(async s=>{const o=await s.resolve();!0===o.success?(t.empty().append(o.html),a.setButtons(o.buttons)):e.error("Something went wrong")},s=>{n.handleAjaxError(s,t)})}change(){const t=this.getModalBody(),s=this.getModuleContent().data("install-tool-token");new o(n.getUrl()).post({install:{action:"changeInstallToolPassword",token:s,password:this.findInModal(".t3js-changeInstallToolPassword-password").val(),passwordCheck:this.findInModal(".t3js-changeInstallToolPassword-password-check").val()}}).then(async t=>{const s=await t.resolve();!0===s.success&&Array.isArray(s.status)?s.status.forEach(t=>{e.showMessage("",t.message,t.severity)}):e.error("Something went wrong")},s=>{n.handleAjaxError(s,t)}).finally(()=>{this.findInModal(".t3js-changeInstallToolPassword-password,.t3js-changeInstallToolPassword-password-check").val("")})}}return new c})); \ No newline at end of file +define(["require","exports","TYPO3/CMS/Backend/Modal","TYPO3/CMS/Backend/Notification","TYPO3/CMS/Core/Ajax/AjaxRequest","../../Router","../PasswordStrength","../AbstractInteractableModule"],(function(t,s,a,e,o,n,r,l){"use strict";class c extends l.AbstractInteractableModule{constructor(){super(...arguments),this.selectorChangeButton=".t3js-changeInstallToolPassword-change"}initialize(t){this.currentModal=t,this.getData(),t.on("click",this.selectorChangeButton,t=>{t.preventDefault(),this.change()}),t.on("click",".t3-install-form-password-strength",()=>{r.initialize(".t3-install-form-password-strength")})}getData(){const t=this.getModalBody();new o(n.getUrl("changeInstallToolPasswordGetData")).get({cache:"no-cache"}).then(async s=>{const o=await s.resolve();!0===o.success?(t.empty().append(o.html),a.setButtons(o.buttons)):e.error("Something went wrong")},s=>{n.handleAjaxError(s,t)})}change(){this.setModalButtonsState(!1);const t=this.getModalBody(),s=this.getModuleContent().data("install-tool-token");new o(n.getUrl()).post({install:{action:"changeInstallToolPassword",token:s,password:this.findInModal(".t3js-changeInstallToolPassword-password").val(),passwordCheck:this.findInModal(".t3js-changeInstallToolPassword-password-check").val()}}).then(async t=>{const s=await t.resolve();!0===s.success&&Array.isArray(s.status)?s.status.forEach(t=>{e.showMessage("",t.message,t.severity)}):e.error("Something went wrong")},s=>{n.handleAjaxError(s,t)}).finally(()=>{this.findInModal(".t3js-changeInstallToolPassword-password,.t3js-changeInstallToolPassword-password-check").val(""),this.setModalButtonsState(!0)})}}return new c})); \ No newline at end of file diff --git a/typo3/sysext/install/Resources/Public/JavaScript/Module/Settings/Features.js b/typo3/sysext/install/Resources/Public/JavaScript/Module/Settings/Features.js index d8cbd7a83bc0..e65f23715f9d 100644 --- a/typo3/sysext/install/Resources/Public/JavaScript/Module/Settings/Features.js +++ b/typo3/sysext/install/Resources/Public/JavaScript/Module/Settings/Features.js @@ -10,4 +10,4 @@ * * The TYPO3 project - inspiring people to share! */ -define(["require","exports","jquery","../AbstractInteractableModule","TYPO3/CMS/Backend/Modal","TYPO3/CMS/Backend/Notification","TYPO3/CMS/Core/Ajax/AjaxRequest","../../Router"],(function(e,t,s,a,n,r,o,i){"use strict";class c extends a.AbstractInteractableModule{constructor(){super(...arguments),this.selectorSaveTrigger=".t3js-features-save"}initialize(e){this.currentModal=e,this.getContent(),e.on("click",this.selectorSaveTrigger,e=>{e.preventDefault(),this.save()})}getContent(){const e=this.getModalBody();new o(i.getUrl("featuresGetContent")).get({cache:"no-cache"}).then(async t=>{const s=await t.resolve();!0===s.success&&"undefined"!==s.html&&s.html.length>0?(e.empty().append(s.html),n.setButtons(s.buttons)):r.error("Something went wrong")},t=>{i.handleAjaxError(t,e)})}save(){const e=this.getModalBody(),t=this.getModuleContent().data("features-save-token"),a={};s(this.findInModal("form").serializeArray()).each((e,t)=>{a[t.name]=t.value}),a["install[action]"]="featuresSave",a["install[token]"]=t,new o(i.getUrl()).post(a).then(async e=>{const t=await e.resolve();!0===t.success&&Array.isArray(t.status)?(t.status.forEach(e=>{r.showMessage(e.title,e.message,e.severity)}),this.getContent()):r.error("Something went wrong")},t=>{i.handleAjaxError(t,e)})}}return new c})); \ No newline at end of file +define(["require","exports","jquery","../AbstractInteractableModule","TYPO3/CMS/Backend/Modal","TYPO3/CMS/Backend/Notification","TYPO3/CMS/Core/Ajax/AjaxRequest","../../Router"],(function(e,t,s,a,n,r,o,i){"use strict";class c extends a.AbstractInteractableModule{constructor(){super(...arguments),this.selectorSaveTrigger=".t3js-features-save"}initialize(e){this.currentModal=e,this.getContent(),e.on("click",this.selectorSaveTrigger,e=>{e.preventDefault(),this.save()})}getContent(){const e=this.getModalBody();new o(i.getUrl("featuresGetContent")).get({cache:"no-cache"}).then(async t=>{const s=await t.resolve();!0===s.success&&"undefined"!==s.html&&s.html.length>0?(e.empty().append(s.html),n.setButtons(s.buttons)):r.error("Something went wrong")},t=>{i.handleAjaxError(t,e)})}save(){this.setModalButtonsState(!1);const e=this.getModalBody(),t=this.getModuleContent().data("features-save-token"),a={};s(this.findInModal("form").serializeArray()).each((e,t)=>{a[t.name]=t.value}),a["install[action]"]="featuresSave",a["install[token]"]=t,new o(i.getUrl()).post(a).then(async e=>{const t=await e.resolve();!0===t.success&&Array.isArray(t.status)?(t.status.forEach(e=>{r.showMessage(e.title,e.message,e.severity)}),this.getContent()):r.error("Something went wrong")},t=>{i.handleAjaxError(t,e)})}}return new c})); \ No newline at end of file diff --git a/typo3/sysext/install/Resources/Public/JavaScript/Module/Settings/LocalConfiguration.js b/typo3/sysext/install/Resources/Public/JavaScript/Module/Settings/LocalConfiguration.js index fcff92e3f92a..cd82c317b5c7 100644 --- a/typo3/sysext/install/Resources/Public/JavaScript/Module/Settings/LocalConfiguration.js +++ b/typo3/sysext/install/Resources/Public/JavaScript/Module/Settings/LocalConfiguration.js @@ -10,4 +10,4 @@ * * The TYPO3 project - inspiring people to share! */ -define(["require","exports","jquery","../AbstractInteractableModule","TYPO3/CMS/Backend/Modal","TYPO3/CMS/Backend/Notification","TYPO3/CMS/Core/Ajax/AjaxRequest","../../Router","bootstrap","../../Renderable/Clearable"],(function(e,t,a,s,r,o,n,i){"use strict";class l extends s.AbstractInteractableModule{constructor(){super(...arguments),this.selectorToggleAllTrigger=".t3js-localConfiguration-toggleAll",this.selectorWriteTrigger=".t3js-localConfiguration-write",this.selectorSearchTrigger=".t3js-localConfiguration-search"}initialize(e){this.currentModal=e,this.getContent(),e.on("click",this.selectorWriteTrigger,()=>{this.write()}),e.on("click",this.selectorToggleAllTrigger,()=>{const e=this.getModalBody().find(".panel-collapse"),t=e.eq(0).hasClass("in")?"hide":"show";e.collapse(t)}),jQuery.expr[":"].contains=jQuery.expr.createPseudo(e=>t=>jQuery(t).text().toUpperCase().includes(e.toUpperCase())),e.on("keydown",t=>{const a=e.find(this.selectorSearchTrigger);t.ctrlKey||t.metaKey?"f"===String.fromCharCode(t.which).toLowerCase()&&(t.preventDefault(),a.focus()):27===t.keyCode&&(t.preventDefault(),a.val("").focus())}),e.on("keyup",this.selectorSearchTrigger,t=>{const s=a(t.target).val(),r=e.find(this.selectorSearchTrigger);e.find("div.item").each((e,t)=>{const r=a(t);a(":contains("+s+")",r).length>0||a('input[value*="'+s+'"]',r).length>0?r.removeClass("hidden").addClass("searchhit"):r.removeClass("searchhit").addClass("hidden")}),e.find(".searchhit").parent().collapse("show");const o=r.get(0);o.clearable(),o.focus()})}getContent(){const e=this.getModalBody();new n(i.getUrl("localConfigurationGetContent")).get({cache:"no-cache"}).then(async t=>{const a=await t.resolve();!0===a.success&&(Array.isArray(a.status)&&a.status.forEach(e=>{o.success(e.title,e.message)}),e.html(a.html),r.setButtons(a.buttons))},t=>{i.handleAjaxError(t,e)})}write(){const e=this.getModalBody(),t=this.getModuleContent().data("local-configuration-write-token"),s={};this.findInModal(".t3js-localConfiguration-pathValue").each((e,t)=>{const r=a(t);"checkbox"===r.attr("type")?t.checked?s[r.data("path")]="1":s[r.data("path")]="0":s[r.data("path")]=r.val()}),new n(i.getUrl()).post({install:{action:"localConfigurationWrite",token:t,configurationValues:s}}).then(async e=>{const t=await e.resolve();!0===t.success&&Array.isArray(t.status)?t.status.forEach(e=>{o.showMessage(e.title,e.message,e.severity)}):o.error("Something went wrong")},t=>{i.handleAjaxError(t,e)})}}return new l})); \ No newline at end of file +define(["require","exports","jquery","../AbstractInteractableModule","TYPO3/CMS/Backend/Modal","TYPO3/CMS/Backend/Notification","TYPO3/CMS/Core/Ajax/AjaxRequest","../../Router","bootstrap","../../Renderable/Clearable"],(function(e,t,a,s,o,r,n,i){"use strict";class l extends s.AbstractInteractableModule{constructor(){super(...arguments),this.selectorToggleAllTrigger=".t3js-localConfiguration-toggleAll",this.selectorWriteTrigger=".t3js-localConfiguration-write",this.selectorSearchTrigger=".t3js-localConfiguration-search"}initialize(e){this.currentModal=e,this.getContent(),e.on("click",this.selectorWriteTrigger,()=>{this.write()}),e.on("click",this.selectorToggleAllTrigger,()=>{const e=this.getModalBody().find(".panel-collapse"),t=e.eq(0).hasClass("in")?"hide":"show";e.collapse(t)}),jQuery.expr[":"].contains=jQuery.expr.createPseudo(e=>t=>jQuery(t).text().toUpperCase().includes(e.toUpperCase())),e.on("keydown",t=>{const a=e.find(this.selectorSearchTrigger);t.ctrlKey||t.metaKey?"f"===String.fromCharCode(t.which).toLowerCase()&&(t.preventDefault(),a.focus()):27===t.keyCode&&(t.preventDefault(),a.val("").focus())}),e.on("keyup",this.selectorSearchTrigger,t=>{const s=a(t.target).val(),o=e.find(this.selectorSearchTrigger);e.find("div.item").each((e,t)=>{const o=a(t);a(":contains("+s+")",o).length>0||a('input[value*="'+s+'"]',o).length>0?o.removeClass("hidden").addClass("searchhit"):o.removeClass("searchhit").addClass("hidden")}),e.find(".searchhit").parent().collapse("show");const r=o.get(0);r.clearable(),r.focus()})}getContent(){const e=this.getModalBody();new n(i.getUrl("localConfigurationGetContent")).get({cache:"no-cache"}).then(async t=>{const a=await t.resolve();!0===a.success&&(Array.isArray(a.status)&&a.status.forEach(e=>{r.success(e.title,e.message)}),e.html(a.html),o.setButtons(a.buttons))},t=>{i.handleAjaxError(t,e)})}write(){this.setModalButtonsState(!1);const e=this.getModalBody(),t=this.getModuleContent().data("local-configuration-write-token"),s={};this.findInModal(".t3js-localConfiguration-pathValue").each((e,t)=>{const o=a(t);"checkbox"===o.attr("type")?t.checked?s[o.data("path")]="1":s[o.data("path")]="0":s[o.data("path")]=o.val()}),new n(i.getUrl()).post({install:{action:"localConfigurationWrite",token:t,configurationValues:s}}).then(async e=>{const t=await e.resolve();!0===t.success&&Array.isArray(t.status)?t.status.forEach(e=>{r.showMessage(e.title,e.message,e.severity)}):r.error("Something went wrong")},t=>{i.handleAjaxError(t,e)}).finally(()=>{this.setModalButtonsState(!0)})}}return new l})); \ No newline at end of file diff --git a/typo3/sysext/install/Resources/Public/JavaScript/Module/Settings/Presets.js b/typo3/sysext/install/Resources/Public/JavaScript/Module/Settings/Presets.js index 341f8f1c1285..ce5eb85de7b1 100644 --- a/typo3/sysext/install/Resources/Public/JavaScript/Module/Settings/Presets.js +++ b/typo3/sysext/install/Resources/Public/JavaScript/Module/Settings/Presets.js @@ -10,4 +10,4 @@ * * The TYPO3 project - inspiring people to share! */ -define(["require","exports","jquery","../AbstractInteractableModule","TYPO3/CMS/Backend/Modal","TYPO3/CMS/Backend/Notification","TYPO3/CMS/Core/Ajax/AjaxRequest","../../Router","bootstrap"],(function(e,t,s,a,n,r,o,i){"use strict";class c extends a.AbstractInteractableModule{constructor(){super(...arguments),this.selectorActivateTrigger=".t3js-presets-activate",this.selectorImageExecutable=".t3js-presets-image-executable",this.selectorImageExecutableTrigger=".t3js-presets-image-executable-trigger"}initialize(e){this.currentModal=e,this.getContent(),e.on("click",this.selectorImageExecutableTrigger,e=>{e.preventDefault(),this.getCustomImagePathContent()}),e.on("click",this.selectorActivateTrigger,e=>{e.preventDefault(),this.activate()}),e.find(".t3js-custom-preset").on("input",".t3js-custom-preset",e=>{s("#"+s(e.currentTarget).data("radio")).prop("checked",!0)})}getContent(){const e=this.getModalBody();new o(i.getUrl("presetsGetContent")).get({cache:"no-cache"}).then(async t=>{const s=await t.resolve();!0===s.success&&"undefined"!==s.html&&s.html.length>0?(e.empty().append(s.html),n.setButtons(s.buttons)):r.error("Something went wrong")},t=>{i.handleAjaxError(t,e)})}getCustomImagePathContent(){const e=this.getModalBody(),t=this.getModuleContent().data("presets-content-token");new o(i.getUrl()).post({install:{token:t,action:"presetsGetContent",values:{Image:{additionalSearchPath:this.findInModal(this.selectorImageExecutable).val()}}}}).then(async t=>{const s=await t.resolve();!0===s.success&&"undefined"!==s.html&&s.html.length>0?e.empty().append(s.html):r.error("Something went wrong")},t=>{i.handleAjaxError(t,e)})}activate(){const e=this.getModalBody(),t=this.getModuleContent().data("presets-activate-token"),a={};s(this.findInModal("form").serializeArray()).each((e,t)=>{a[t.name]=t.value}),a["install[action]"]="presetsActivate",a["install[token]"]=t,new o(i.getUrl()).post(a).then(async e=>{const t=await e.resolve();!0===t.success&&Array.isArray(t.status)?t.status.forEach(e=>{r.showMessage(e.title,e.message,e.severity)}):r.error("Something went wrong")},t=>{i.handleAjaxError(t,e)})}}return new c})); \ No newline at end of file +define(["require","exports","jquery","../AbstractInteractableModule","TYPO3/CMS/Backend/Modal","TYPO3/CMS/Backend/Notification","TYPO3/CMS/Core/Ajax/AjaxRequest","../../Router","bootstrap"],(function(t,e,s,a,n,r,o,i){"use strict";class c extends a.AbstractInteractableModule{constructor(){super(...arguments),this.selectorActivateTrigger=".t3js-presets-activate",this.selectorImageExecutable=".t3js-presets-image-executable",this.selectorImageExecutableTrigger=".t3js-presets-image-executable-trigger"}initialize(t){this.currentModal=t,this.getContent(),t.on("click",this.selectorImageExecutableTrigger,t=>{t.preventDefault(),this.getCustomImagePathContent()}),t.on("click",this.selectorActivateTrigger,t=>{t.preventDefault(),this.activate()}),t.find(".t3js-custom-preset").on("input",".t3js-custom-preset",t=>{s("#"+s(t.currentTarget).data("radio")).prop("checked",!0)})}getContent(){const t=this.getModalBody();new o(i.getUrl("presetsGetContent")).get({cache:"no-cache"}).then(async e=>{const s=await e.resolve();!0===s.success&&"undefined"!==s.html&&s.html.length>0?(t.empty().append(s.html),n.setButtons(s.buttons)):r.error("Something went wrong")},e=>{i.handleAjaxError(e,t)})}getCustomImagePathContent(){const t=this.getModalBody(),e=this.getModuleContent().data("presets-content-token");new o(i.getUrl()).post({install:{token:e,action:"presetsGetContent",values:{Image:{additionalSearchPath:this.findInModal(this.selectorImageExecutable).val()}}}}).then(async e=>{const s=await e.resolve();!0===s.success&&"undefined"!==s.html&&s.html.length>0?t.empty().append(s.html):r.error("Something went wrong")},e=>{i.handleAjaxError(e,t)})}activate(){this.setModalButtonsState(!1);const t=this.getModalBody(),e=this.getModuleContent().data("presets-activate-token"),a={};s(this.findInModal("form").serializeArray()).each((t,e)=>{a[e.name]=e.value}),a["install[action]"]="presetsActivate",a["install[token]"]=e,new o(i.getUrl()).post(a).then(async t=>{const e=await t.resolve();!0===e.success&&Array.isArray(e.status)?e.status.forEach(t=>{r.showMessage(t.title,t.message,t.severity)}):r.error("Something went wrong")},e=>{i.handleAjaxError(e,t)}).finally(()=>{this.setModalButtonsState(!0)})}}return new c})); \ No newline at end of file diff --git a/typo3/sysext/install/Resources/Public/JavaScript/Module/Settings/SystemMaintainer.js b/typo3/sysext/install/Resources/Public/JavaScript/Module/Settings/SystemMaintainer.js index be6a93296104..5e2845b66aa8 100644 --- a/typo3/sysext/install/Resources/Public/JavaScript/Module/Settings/SystemMaintainer.js +++ b/typo3/sysext/install/Resources/Public/JavaScript/Module/Settings/SystemMaintainer.js @@ -10,4 +10,4 @@ * * The TYPO3 project - inspiring people to share! */ -define(["require","exports","jquery","../AbstractInteractableModule","TYPO3/CMS/Backend/Modal","TYPO3/CMS/Backend/Notification","TYPO3/CMS/Core/Ajax/AjaxRequest","../../Router","bootstrap"],(function(e,t,s,n,r,i,a,o){"use strict";class c extends n.AbstractInteractableModule{constructor(){super(...arguments),this.selectorWriteTrigger=".t3js-systemMaintainer-write",this.selectorChosenContainer=".t3js-systemMaintainer-chosen",this.selectorChosenField=".t3js-systemMaintainer-chosen-select"}initialize(t){this.currentModal=t,window.location!==window.parent.location?top.require(["TYPO3/CMS/Install/chosen.jquery.min"],()=>{this.getList()}):e(["TYPO3/CMS/Install/chosen.jquery.min"],()=>{this.getList()}),t.on("click",this.selectorWriteTrigger,e=>{e.preventDefault(),this.write()})}getList(){const e=this.getModalBody();new a(o.getUrl("systemMaintainerGetList")).get({cache:"no-cache"}).then(async t=>{const n=await t.resolve();if(!0===n.success){Array.isArray(n.status)&&n.status.forEach(e=>{i.success(e.title,e.message)}),e.html(n.html),r.setButtons(n.buttons),Array.isArray(n.users)&&n.users.forEach(t=>{let n=t.username;t.disable&&(n="[DISABLED] "+n);const r=s("<option>",{value:t.uid}).text(n);t.isSystemMaintainer&&r.attr("selected","selected"),e.find(this.selectorChosenField).append(r)});const t={".t3js-systemMaintainer-chosen-select":{width:"100%",placeholder_text_multiple:"users"}};for(const s in t)t.hasOwnProperty(s)&&e.find(s).chosen(t[s]);e.find(this.selectorChosenContainer).show(),e.find(this.selectorChosenField).trigger("chosen:updated")}},t=>{o.handleAjaxError(t,e)})}write(){const e=this.getModalBody(),t=this.getModuleContent().data("system-maintainer-write-token"),s=this.findInModal(this.selectorChosenField).val();new a(o.getUrl()).post({install:{users:s,token:t,action:"systemMaintainerWrite"}}).then(async e=>{const t=await e.resolve();!0===t.success?Array.isArray(t.status)&&t.status.forEach(e=>{i.success(e.title,e.message)}):i.error("Something went wrong")},t=>{o.handleAjaxError(t,e)})}}return new c})); \ No newline at end of file +define(["require","exports","jquery","../AbstractInteractableModule","TYPO3/CMS/Backend/Modal","TYPO3/CMS/Backend/Notification","TYPO3/CMS/Core/Ajax/AjaxRequest","../../Router","bootstrap"],(function(t,e,s,n,i,r,a,o){"use strict";class c extends n.AbstractInteractableModule{constructor(){super(...arguments),this.selectorWriteTrigger=".t3js-systemMaintainer-write",this.selectorChosenContainer=".t3js-systemMaintainer-chosen",this.selectorChosenField=".t3js-systemMaintainer-chosen-select"}initialize(e){this.currentModal=e,window.location!==window.parent.location?top.require(["TYPO3/CMS/Install/chosen.jquery.min"],()=>{this.getList()}):t(["TYPO3/CMS/Install/chosen.jquery.min"],()=>{this.getList()}),e.on("click",this.selectorWriteTrigger,t=>{t.preventDefault(),this.write()})}getList(){const t=this.getModalBody();new a(o.getUrl("systemMaintainerGetList")).get({cache:"no-cache"}).then(async e=>{const n=await e.resolve();if(!0===n.success){Array.isArray(n.status)&&n.status.forEach(t=>{r.success(t.title,t.message)}),t.html(n.html),i.setButtons(n.buttons),Array.isArray(n.users)&&n.users.forEach(e=>{let n=e.username;e.disable&&(n="[DISABLED] "+n);const i=s("<option>",{value:e.uid}).text(n);e.isSystemMaintainer&&i.attr("selected","selected"),t.find(this.selectorChosenField).append(i)});const e={".t3js-systemMaintainer-chosen-select":{width:"100%",placeholder_text_multiple:"users"}};for(const s in e)e.hasOwnProperty(s)&&t.find(s).chosen(e[s]);t.find(this.selectorChosenContainer).show(),t.find(this.selectorChosenField).trigger("chosen:updated")}},e=>{o.handleAjaxError(e,t)})}write(){this.setModalButtonsState(!1);const t=this.getModalBody(),e=this.getModuleContent().data("system-maintainer-write-token"),s=this.findInModal(this.selectorChosenField).val();new a(o.getUrl()).post({install:{users:s,token:e,action:"systemMaintainerWrite"}}).then(async t=>{const e=await t.resolve();!0===e.success?Array.isArray(e.status)&&e.status.forEach(t=>{r.success(t.title,t.message)}):r.error("Something went wrong")},e=>{o.handleAjaxError(e,t)}).finally(()=>{this.setModalButtonsState(!0)})}}return new c})); \ No newline at end of file diff --git a/typo3/sysext/install/Resources/Public/JavaScript/Module/Upgrade/ExtensionCompatTester.js b/typo3/sysext/install/Resources/Public/JavaScript/Module/Upgrade/ExtensionCompatTester.js index 24494f000d4a..51ce96b3533a 100644 --- a/typo3/sysext/install/Resources/Public/JavaScript/Module/Upgrade/ExtensionCompatTester.js +++ b/typo3/sysext/install/Resources/Public/JavaScript/Module/Upgrade/ExtensionCompatTester.js @@ -10,4 +10,4 @@ * * The TYPO3 project - inspiring people to share! */ -define(["require","exports","jquery","../AbstractInteractableModule","TYPO3/CMS/Backend/Modal","TYPO3/CMS/Backend/Notification","TYPO3/CMS/Core/Ajax/AjaxRequest","../../Renderable/InfoBox","../../Renderable/ProgressBar","../../Renderable/Severity","../../Router","bootstrap"],(function(e,t,n,s,o,a,i,r,l,d,c){"use strict";class h extends s.AbstractInteractableModule{constructor(){super(...arguments),this.selectorCheckTrigger=".t3js-extensionCompatTester-check",this.selectorUninstallTrigger=".t3js-extensionCompatTester-uninstall",this.selectorOutputContainer=".t3js-extensionCompatTester-output"}initialize(e){this.currentModal=e,this.getLoadedExtensionList(),e.on("click",this.selectorCheckTrigger,()=>{this.findInModal(this.selectorUninstallTrigger).addClass("hidden"),this.findInModal(this.selectorOutputContainer).empty(),this.getLoadedExtensionList()}),e.on("click",this.selectorUninstallTrigger,e=>{this.uninstallExtension(n(e.target).data("extension"))})}getLoadedExtensionList(){this.findInModal(this.selectorCheckTrigger).addClass("disabled").prop("disabled",!0),this.findInModal(".modal-loading").hide();const e=this.getModalBody(),t=this.findInModal(this.selectorOutputContainer),n=l.render(d.loading,"Loading...","");t.append(n),new i(c.getUrl("extensionCompatTesterLoadedExtensionList")).get({cache:"no-cache"}).then(async t=>{const n=await t.resolve();e.empty().append(n.html),o.setButtons(n.buttons);const s=this.findInModal(this.selectorOutputContainer),i=l.render(d.loading,"Loading...","");s.append(i),!0===n.success?this.loadExtLocalconf().then(()=>{s.append(r.render(d.ok,"ext_localconf.php of all loaded extensions successfully loaded","")),this.loadExtTables().then(()=>{s.append(r.render(d.ok,"ext_tables.php of all loaded extensions successfully loaded",""))},async e=>{this.renderFailureMessages("ext_tables.php",(await e.response.json()).brokenExtensions,s)}).finally(()=>{this.unlockModal()})},async e=>{this.renderFailureMessages("ext_localconf.php",(await e.response.json()).brokenExtensions,s),s.append(r.render(d.notice,"Skipped scanning ext_tables.php files due to previous errors","")),this.unlockModal()}):a.error("Something went wrong")},t=>{c.handleAjaxError(t,e)})}unlockModal(){this.findInModal(this.selectorOutputContainer).find(".alert-loading").remove(),this.findInModal(this.selectorCheckTrigger).removeClass("disabled").prop("disabled",!1)}renderFailureMessages(e,t,s){for(let o of t){let t;o.isProtected||(t=n("<button />",{class:"btn btn-danger t3js-extensionCompatTester-uninstall"}).attr("data-extension",o.name).text('Uninstall extension "'+o.name+'"')),s.append(r.render(d.error,"Loading "+e+' of extension "'+o.name+'" failed',o.isProtected?"Extension is mandatory and cannot be uninstalled.":""),t)}this.unlockModal()}loadExtLocalconf(){const e=this.getModuleContent().data("extension-compat-tester-load-ext_localconf-token");return new i(c.getUrl()).post({install:{action:"extensionCompatTesterLoadExtLocalconf",token:e}})}loadExtTables(){const e=this.getModuleContent().data("extension-compat-tester-load-ext_tables-token");return new i(c.getUrl()).post({install:{action:"extensionCompatTesterLoadExtTables",token:e}})}uninstallExtension(e){const t=this.getModuleContent().data("extension-compat-tester-uninstall-extension-token"),s=this.getModalBody(),o=n(this.selectorOutputContainer),h=l.render(d.loading,"Loading...","");o.append(h),new i(c.getUrl()).post({install:{action:"extensionCompatTesterUninstallExtension",token:t,extension:e}}).then(async e=>{const t=await e.resolve();t.success?(Array.isArray(t.status)&&t.status.forEach(e=>{const t=r.render(e.severity,e.title,e.message);s.find(this.selectorOutputContainer).empty().append(t)}),this.findInModal(this.selectorUninstallTrigger).addClass("hidden"),this.getLoadedExtensionList()):a.error("Something went wrong")},e=>{c.handleAjaxError(e,s)})}}return new h})); \ No newline at end of file +define(["require","exports","jquery","../AbstractInteractableModule","TYPO3/CMS/Backend/Modal","TYPO3/CMS/Backend/Notification","TYPO3/CMS/Core/Ajax/AjaxRequest","../../Renderable/InfoBox","../../Renderable/ProgressBar","../../Renderable/Severity","../../Router","bootstrap"],(function(e,t,n,s,o,a,i,r,l,d,c){"use strict";class h extends s.AbstractInteractableModule{constructor(){super(...arguments),this.selectorCheckTrigger=".t3js-extensionCompatTester-check",this.selectorUninstallTrigger=".t3js-extensionCompatTester-uninstall",this.selectorOutputContainer=".t3js-extensionCompatTester-output"}initialize(e){this.currentModal=e,this.getLoadedExtensionList(),e.on("click",this.selectorCheckTrigger,()=>{this.findInModal(this.selectorUninstallTrigger).addClass("hidden"),this.findInModal(this.selectorOutputContainer).empty(),this.getLoadedExtensionList()}),e.on("click",this.selectorUninstallTrigger,e=>{this.uninstallExtension(n(e.target).data("extension"))})}getLoadedExtensionList(){this.setModalButtonsState(!1),this.findInModal(".modal-loading").hide();const e=this.getModalBody(),t=this.findInModal(this.selectorOutputContainer),n=l.render(d.loading,"Loading...","");t.append(n),new i(c.getUrl("extensionCompatTesterLoadedExtensionList")).get({cache:"no-cache"}).then(async t=>{const n=await t.resolve();e.empty().append(n.html),o.setButtons(n.buttons);const s=this.findInModal(this.selectorOutputContainer),i=l.render(d.loading,"Loading...","");s.append(i),!0===n.success?this.loadExtLocalconf().then(()=>{s.append(r.render(d.ok,"ext_localconf.php of all loaded extensions successfully loaded","")),this.loadExtTables().then(()=>{s.append(r.render(d.ok,"ext_tables.php of all loaded extensions successfully loaded",""))},async e=>{this.renderFailureMessages("ext_tables.php",(await e.response.json()).brokenExtensions,s)}).finally(()=>{this.unlockModal()})},async e=>{this.renderFailureMessages("ext_localconf.php",(await e.response.json()).brokenExtensions,s),s.append(r.render(d.notice,"Skipped scanning ext_tables.php files due to previous errors","")),this.unlockModal()}):a.error("Something went wrong")},t=>{c.handleAjaxError(t,e)})}unlockModal(){this.findInModal(this.selectorOutputContainer).find(".alert-loading").remove(),this.findInModal(this.selectorCheckTrigger).removeClass("disabled").prop("disabled",!1)}renderFailureMessages(e,t,s){for(let o of t){let t;o.isProtected||(t=n("<button />",{class:"btn btn-danger t3js-extensionCompatTester-uninstall"}).attr("data-extension",o.name).text('Uninstall extension "'+o.name+'"')),s.append(r.render(d.error,"Loading "+e+' of extension "'+o.name+'" failed',o.isProtected?"Extension is mandatory and cannot be uninstalled.":""),t)}this.unlockModal()}loadExtLocalconf(){const e=this.getModuleContent().data("extension-compat-tester-load-ext_localconf-token");return new i(c.getUrl()).post({install:{action:"extensionCompatTesterLoadExtLocalconf",token:e}})}loadExtTables(){const e=this.getModuleContent().data("extension-compat-tester-load-ext_tables-token");return new i(c.getUrl()).post({install:{action:"extensionCompatTesterLoadExtTables",token:e}})}uninstallExtension(e){const t=this.getModuleContent().data("extension-compat-tester-uninstall-extension-token"),s=this.getModalBody(),o=n(this.selectorOutputContainer),h=l.render(d.loading,"Loading...","");o.append(h),new i(c.getUrl()).post({install:{action:"extensionCompatTesterUninstallExtension",token:t,extension:e}}).then(async e=>{const t=await e.resolve();t.success?(Array.isArray(t.status)&&t.status.forEach(e=>{const t=r.render(e.severity,e.title,e.message);s.find(this.selectorOutputContainer).empty().append(t)}),this.findInModal(this.selectorUninstallTrigger).addClass("hidden"),this.getLoadedExtensionList()):a.error("Something went wrong")},e=>{c.handleAjaxError(e,s)})}}return new h})); \ No newline at end of file diff --git a/typo3/sysext/install/Resources/Public/JavaScript/Module/Upgrade/ExtensionScanner.js b/typo3/sysext/install/Resources/Public/JavaScript/Module/Upgrade/ExtensionScanner.js index bea0011fe3bb..f4e2b762f772 100644 --- a/typo3/sysext/install/Resources/Public/JavaScript/Module/Upgrade/ExtensionScanner.js +++ b/typo3/sysext/install/Resources/Public/JavaScript/Module/Upgrade/ExtensionScanner.js @@ -10,4 +10,4 @@ * * The TYPO3 project - inspiring people to share! */ -define(["require","exports","jquery","TYPO3/CMS/Core/Ajax/AjaxRequest","../AbstractInteractableModule","TYPO3/CMS/Backend/Modal","TYPO3/CMS/Backend/Notification","../../Ajax/AjaxQueue","../../Router","bootstrap"],(function(e,n,t,s,i,a,o,r,l){"use strict";class c extends i.AbstractInteractableModule{constructor(){super(...arguments),this.listOfAffectedRestFileHashes=[],this.selectorExtensionContainer=".t3js-extensionScanner-extension",this.selectorNumberOfFiles=".t3js-extensionScanner-number-of-files",this.selectorScanSingleTrigger=".t3js-extensionScanner-scan-single",this.selectorExtensionScanButton=".t3js-extensionScanner-scan-all"}initialize(e){this.currentModal=e,this.getData(),e.on("show.bs.collapse",this.selectorExtensionContainer,e=>{const n=t(e.currentTarget);if(void 0===n.data("scanned")){const e=n.data("extension");this.scanSingleExtension(e),n.data("scanned",!0)}}).on("hide.bs.modal",()=>{r.flush()}).on("click",this.selectorScanSingleTrigger,e=>{e.preventDefault();const n=t(e.currentTarget).closest(this.selectorExtensionContainer).data("extension");this.scanSingleExtension(n)}).on("click",this.selectorExtensionScanButton,n=>{n.preventDefault(),t(n.currentTarget).addClass("disabled").prop("disabled",!0);const s=e.find(this.selectorExtensionContainer);this.scanAll(s)})}getData(){const e=this.getModalBody();new s(l.getUrl("extensionScannerGetData")).get().then(async n=>{const t=await n.resolve();!0===t.success?(e.empty().append(t.html),a.setButtons(t.buttons)):o.error("Something went wrong")},n=>{l.handleAjaxError(n,e)})}getExtensionSelector(e){return this.selectorExtensionContainer+"-"+e}scanAll(e){this.findInModal(this.selectorExtensionContainer).removeClass("panel-danger panel-warning panel-success").find(".panel-progress-bar").css("width",0).attr("aria-valuenow",0).find("span").text("0%"),this.setProgressForAll(),e.each((e,n)=>{const s=t(n),i=s.data("extension");this.scanSingleExtension(i),s.data("scanned",!0)})}setStatusMessageForScan(e,n,t){this.findInModal(this.getExtensionSelector(e)).find(this.selectorNumberOfFiles).text("Checked "+n+" of "+t+" files")}setProgressForScan(e,n,t){const s=n/t*100;this.findInModal(this.getExtensionSelector(e)).find(".panel-progress-bar").css("width",s+"%").attr("aria-valuenow",s).find("span").text(s+"%")}setProgressForAll(){const e=this.findInModal(this.selectorExtensionContainer).length,n=this.findInModal(this.selectorExtensionContainer+".t3js-extensionscan-finished.panel-success").length+this.findInModal(this.selectorExtensionContainer+".t3js-extensionscan-finished.panel-warning").length+this.findInModal(this.selectorExtensionContainer+".t3js-extensionscan-finished.panel-danger").length,t=n/e*100,i=this.getModalBody();this.findInModal(".t3js-extensionScanner-progress-all-extension .progress-bar").css("width",t+"%").attr("aria-valuenow",t).find("span").text(n+" of "+e+" scanned"),n===e&&(this.findInModal(this.selectorExtensionScanButton).removeClass("disabled").prop("disabled",!1),o.success("Scan finished","All extensions have been scanned"),new s(l.getUrl()).post({install:{action:"extensionScannerMarkFullyScannedRestFiles",token:this.getModuleContent().data("extension-scanner-mark-fully-scanned-rest-files-token"),hashes:this.uniqueArray(this.listOfAffectedRestFileHashes)}}).then(async e=>{const n=await e.resolve();!0===n.success&&o.success("Marked not affected files","Marked "+n.markedAsNotAffected+" ReST files as not affected.")},e=>{l.handleAjaxError(e,i)}))}uniqueArray(e){return e.filter((e,n,t)=>t.indexOf(e)===n)}scanSingleExtension(e){const n=this.getModuleContent().data("extension-scanner-files-token"),i=this.getModalBody(),a=this.findInModal(this.getExtensionSelector(e));let c=!1;a.removeClass("panel-danger panel-warning panel-success t3js-extensionscan-finished"),a.data("hasRun","true"),a.find(".t3js-extensionScanner-scan-single").text("Scanning...").attr("disabled","disabled"),a.find(".t3js-extensionScanner-extension-body-loc").empty().text("0"),a.find(".t3js-extensionScanner-extension-body-ignored-files").empty().text("0"),a.find(".t3js-extensionScanner-extension-body-ignored-lines").empty().text("0"),this.setProgressForAll(),new s(l.getUrl()).post({install:{action:"extensionScannerFiles",token:n,extension:e}}).then(async n=>{const s=await n.resolve();if(!0===s.success&&Array.isArray(s.files)){const n=s.files.length;if(n<=0)return void o.warning("No files found","The extension EXT:"+e+" contains no files we can scan");this.setStatusMessageForScan(e,0,n),a.find(".t3js-extensionScanner-extension-body").text("");let d=0;s.files.forEach(s=>{r.add({method:"POST",data:{install:{action:"extensionScannerScanFile",token:this.getModuleContent().data("extension-scanner-scan-file-token"),extension:e,file:s}},url:l.getUrl(),onfulfilled:async o=>{const r=await o.resolve();if(d++,this.setStatusMessageForScan(e,d,n),this.setProgressForScan(e,d,n),r.success&&t.isArray(r.matches)&&r.matches.forEach(e=>{c=!0;const n=i.find("#t3js-extensionScanner-file-hit-template").clone();n.find(".t3js-extensionScanner-hit-file-panel-head").attr("href","#collapse"+e.uniqueId),n.find(".t3js-extensionScanner-hit-file-panel-body").attr("id","collapse"+e.uniqueId),n.find(".t3js-extensionScanner-hit-filename").text(s),n.find(".t3js-extensionScanner-hit-message").text(e.message),"strong"===e.indicator?n.find(".t3js-extensionScanner-hit-file-panel-head .badges").append('<span class="badge" title="Reliable match, false positive unlikely">strong</span>'):n.find(".t3js-extensionScanner-hit-file-panel-head .badges").append('<span class="badge" title="Probable match, but can be a false positive">weak</span>'),!0===e.silenced&&n.find(".t3js-extensionScanner-hit-file-panel-head .badges").append('<span class="badge" title="Match has been annotated by extension author as false positive match">silenced</span>'),n.find(".t3js-extensionScanner-hit-file-lineContent").empty().text(e.lineContent),n.find(".t3js-extensionScanner-hit-file-line").empty().text(e.line+": "),t.isArray(e.restFiles)&&e.restFiles.forEach(e=>{const t=i.find("#t3js-extensionScanner-file-hit-rest-template").clone();t.find(".t3js-extensionScanner-hit-rest-panel-head").attr("href","#collapse"+e.uniqueId),t.find(".t3js-extensionScanner-hit-rest-panel-head .badge").empty().text(e.version),t.find(".t3js-extensionScanner-hit-rest-panel-body").attr("id","collapse"+e.uniqueId),t.find(".t3js-extensionScanner-hit-rest-headline").text(e.headline),t.find(".t3js-extensionScanner-hit-rest-body").text(e.content),t.addClass("panel-"+e.class),n.find(".t3js-extensionScanner-hit-file-rest-container").append(t),this.listOfAffectedRestFileHashes.push(e.file_hash)});const o=n.find(".panel-breaking",".t3js-extensionScanner-hit-file-rest-container").length>0?"panel-danger":"panel-warning";n.addClass(o),a.find(".t3js-extensionScanner-extension-body").removeClass("hide").append(n),"panel-danger"===o&&a.removeClass("panel-warning").addClass(o),"panel-warning"!==o||a.hasClass("panel-danger")||a.addClass(o)}),r.success){const e=parseInt(a.find(".t3js-extensionScanner-extension-body-loc").text(),10);if(a.find(".t3js-extensionScanner-extension-body-loc").empty().text(e+r.effectiveCodeLines),r.isFileIgnored){const e=parseInt(a.find(".t3js-extensionScanner-extension-body-ignored-files").text(),10);a.find(".t3js-extensionScanner-extension-body-ignored-files").empty().text(e+1)}const n=parseInt(a.find(".t3js-extensionScanner-extension-body-ignored-lines").text(),10);a.find(".t3js-extensionScanner-extension-body-ignored-lines").empty().text(n+r.ignoredLines)}d===n&&(c||a.addClass("panel-success"),a.addClass("t3js-extensionscan-finished"),this.setProgressForAll(),a.find(".t3js-extensionScanner-scan-single").text("Rescan").attr("disabled",null))},onrejected:t=>{d+=1,this.setStatusMessageForScan(e,d,n),this.setProgressForScan(e,d,n),this.setProgressForAll(),console.error(t)}})})}else o.error("Oops, an error occurred","Please look at the browser console output for details"),console.error(s)},e=>{l.handleAjaxError(e,i)})}}return new c})); \ No newline at end of file +define(["require","exports","jquery","TYPO3/CMS/Core/Ajax/AjaxRequest","../AbstractInteractableModule","TYPO3/CMS/Backend/Modal","TYPO3/CMS/Backend/Notification","../../Ajax/AjaxQueue","../../Router","bootstrap"],(function(e,n,t,s,i,a,o,r,l){"use strict";class c extends i.AbstractInteractableModule{constructor(){super(...arguments),this.listOfAffectedRestFileHashes=[],this.selectorExtensionContainer=".t3js-extensionScanner-extension",this.selectorNumberOfFiles=".t3js-extensionScanner-number-of-files",this.selectorScanSingleTrigger=".t3js-extensionScanner-scan-single",this.selectorExtensionScanButton=".t3js-extensionScanner-scan-all"}initialize(e){this.currentModal=e,this.getData(),e.on("show.bs.collapse",this.selectorExtensionContainer,e=>{const n=t(e.currentTarget);if(void 0===n.data("scanned")){const e=n.data("extension");this.scanSingleExtension(e),n.data("scanned",!0)}}).on("hide.bs.modal",()=>{r.flush()}).on("click",this.selectorScanSingleTrigger,e=>{e.preventDefault();const n=t(e.currentTarget).closest(this.selectorExtensionContainer).data("extension");this.scanSingleExtension(n)}).on("click",this.selectorExtensionScanButton,n=>{n.preventDefault(),this.setModalButtonsState(!1);const t=e.find(this.selectorExtensionContainer);this.scanAll(t)})}getData(){const e=this.getModalBody();new s(l.getUrl("extensionScannerGetData")).get().then(async n=>{const t=await n.resolve();!0===t.success?(e.empty().append(t.html),a.setButtons(t.buttons)):o.error("Something went wrong")},n=>{l.handleAjaxError(n,e)})}getExtensionSelector(e){return this.selectorExtensionContainer+"-"+e}scanAll(e){this.findInModal(this.selectorExtensionContainer).removeClass("panel-danger panel-warning panel-success").find(".panel-progress-bar").css("width",0).attr("aria-valuenow",0).find("span").text("0%"),this.setProgressForAll(),e.each((e,n)=>{const s=t(n),i=s.data("extension");this.scanSingleExtension(i),s.data("scanned",!0)})}setStatusMessageForScan(e,n,t){this.findInModal(this.getExtensionSelector(e)).find(this.selectorNumberOfFiles).text("Checked "+n+" of "+t+" files")}setProgressForScan(e,n,t){const s=n/t*100;this.findInModal(this.getExtensionSelector(e)).find(".panel-progress-bar").css("width",s+"%").attr("aria-valuenow",s).find("span").text(s+"%")}setProgressForAll(){const e=this.findInModal(this.selectorExtensionContainer).length,n=this.findInModal(this.selectorExtensionContainer+".t3js-extensionscan-finished.panel-success").length+this.findInModal(this.selectorExtensionContainer+".t3js-extensionscan-finished.panel-warning").length+this.findInModal(this.selectorExtensionContainer+".t3js-extensionscan-finished.panel-danger").length,t=n/e*100,i=this.getModalBody();this.findInModal(".t3js-extensionScanner-progress-all-extension .progress-bar").css("width",t+"%").attr("aria-valuenow",t).find("span").text(n+" of "+e+" scanned"),n===e&&(this.findInModal(this.selectorExtensionScanButton).removeClass("disabled").prop("disabled",!1),o.success("Scan finished","All extensions have been scanned"),new s(l.getUrl()).post({install:{action:"extensionScannerMarkFullyScannedRestFiles",token:this.getModuleContent().data("extension-scanner-mark-fully-scanned-rest-files-token"),hashes:this.uniqueArray(this.listOfAffectedRestFileHashes)}}).then(async e=>{const n=await e.resolve();!0===n.success&&o.success("Marked not affected files","Marked "+n.markedAsNotAffected+" ReST files as not affected.")},e=>{l.handleAjaxError(e,i)}))}uniqueArray(e){return e.filter((e,n,t)=>t.indexOf(e)===n)}scanSingleExtension(e){const n=this.getModuleContent().data("extension-scanner-files-token"),i=this.getModalBody(),a=this.findInModal(this.getExtensionSelector(e));let c=!1;a.removeClass("panel-danger panel-warning panel-success t3js-extensionscan-finished"),a.data("hasRun","true"),a.find(".t3js-extensionScanner-scan-single").text("Scanning...").attr("disabled","disabled"),a.find(".t3js-extensionScanner-extension-body-loc").empty().text("0"),a.find(".t3js-extensionScanner-extension-body-ignored-files").empty().text("0"),a.find(".t3js-extensionScanner-extension-body-ignored-lines").empty().text("0"),this.setProgressForAll(),new s(l.getUrl()).post({install:{action:"extensionScannerFiles",token:n,extension:e}}).then(async n=>{const s=await n.resolve();if(!0===s.success&&Array.isArray(s.files)){const n=s.files.length;if(n<=0)return void o.warning("No files found","The extension EXT:"+e+" contains no files we can scan");this.setStatusMessageForScan(e,0,n),a.find(".t3js-extensionScanner-extension-body").text("");let d=0;s.files.forEach(s=>{r.add({method:"POST",data:{install:{action:"extensionScannerScanFile",token:this.getModuleContent().data("extension-scanner-scan-file-token"),extension:e,file:s}},url:l.getUrl(),onfulfilled:async o=>{const r=await o.resolve();if(d++,this.setStatusMessageForScan(e,d,n),this.setProgressForScan(e,d,n),r.success&&t.isArray(r.matches)&&r.matches.forEach(e=>{c=!0;const n=i.find("#t3js-extensionScanner-file-hit-template").clone();n.find(".t3js-extensionScanner-hit-file-panel-head").attr("href","#collapse"+e.uniqueId),n.find(".t3js-extensionScanner-hit-file-panel-body").attr("id","collapse"+e.uniqueId),n.find(".t3js-extensionScanner-hit-filename").text(s),n.find(".t3js-extensionScanner-hit-message").text(e.message),"strong"===e.indicator?n.find(".t3js-extensionScanner-hit-file-panel-head .badges").append('<span class="badge" title="Reliable match, false positive unlikely">strong</span>'):n.find(".t3js-extensionScanner-hit-file-panel-head .badges").append('<span class="badge" title="Probable match, but can be a false positive">weak</span>'),!0===e.silenced&&n.find(".t3js-extensionScanner-hit-file-panel-head .badges").append('<span class="badge" title="Match has been annotated by extension author as false positive match">silenced</span>'),n.find(".t3js-extensionScanner-hit-file-lineContent").empty().text(e.lineContent),n.find(".t3js-extensionScanner-hit-file-line").empty().text(e.line+": "),t.isArray(e.restFiles)&&e.restFiles.forEach(e=>{const t=i.find("#t3js-extensionScanner-file-hit-rest-template").clone();t.find(".t3js-extensionScanner-hit-rest-panel-head").attr("href","#collapse"+e.uniqueId),t.find(".t3js-extensionScanner-hit-rest-panel-head .badge").empty().text(e.version),t.find(".t3js-extensionScanner-hit-rest-panel-body").attr("id","collapse"+e.uniqueId),t.find(".t3js-extensionScanner-hit-rest-headline").text(e.headline),t.find(".t3js-extensionScanner-hit-rest-body").text(e.content),t.addClass("panel-"+e.class),n.find(".t3js-extensionScanner-hit-file-rest-container").append(t),this.listOfAffectedRestFileHashes.push(e.file_hash)});const o=n.find(".panel-breaking",".t3js-extensionScanner-hit-file-rest-container").length>0?"panel-danger":"panel-warning";n.addClass(o),a.find(".t3js-extensionScanner-extension-body").removeClass("hide").append(n),"panel-danger"===o&&a.removeClass("panel-warning").addClass(o),"panel-warning"!==o||a.hasClass("panel-danger")||a.addClass(o)}),r.success){const e=parseInt(a.find(".t3js-extensionScanner-extension-body-loc").text(),10);if(a.find(".t3js-extensionScanner-extension-body-loc").empty().text(e+r.effectiveCodeLines),r.isFileIgnored){const e=parseInt(a.find(".t3js-extensionScanner-extension-body-ignored-files").text(),10);a.find(".t3js-extensionScanner-extension-body-ignored-files").empty().text(e+1)}const n=parseInt(a.find(".t3js-extensionScanner-extension-body-ignored-lines").text(),10);a.find(".t3js-extensionScanner-extension-body-ignored-lines").empty().text(n+r.ignoredLines)}d===n&&(c||a.addClass("panel-success"),a.addClass("t3js-extensionscan-finished"),this.setProgressForAll(),a.find(".t3js-extensionScanner-scan-single").text("Rescan").attr("disabled",null))},onrejected:t=>{d+=1,this.setStatusMessageForScan(e,d,n),this.setProgressForScan(e,d,n),this.setProgressForAll(),console.error(t)}})})}else o.error("Oops, an error occurred","Please look at the browser console output for details"),console.error(s)},e=>{l.handleAjaxError(e,i)})}}return new c})); \ No newline at end of file diff --git a/typo3/sysext/install/Resources/Public/JavaScript/Module/Upgrade/TcaExtTablesCheck.js b/typo3/sysext/install/Resources/Public/JavaScript/Module/Upgrade/TcaExtTablesCheck.js index f2a8c0f7504e..c9052e0ef4e2 100644 --- a/typo3/sysext/install/Resources/Public/JavaScript/Module/Upgrade/TcaExtTablesCheck.js +++ b/typo3/sysext/install/Resources/Public/JavaScript/Module/Upgrade/TcaExtTablesCheck.js @@ -10,4 +10,4 @@ * * The TYPO3 project - inspiring people to share! */ -define(["require","exports","jquery","../AbstractInteractableModule","TYPO3/CMS/Backend/Modal","TYPO3/CMS/Backend/Notification","TYPO3/CMS/Core/Ajax/AjaxRequest","../../Renderable/InfoBox","../../Renderable/ProgressBar","../../Renderable/Severity","../../Router"],(function(e,t,n,s,r,a,o,c,i,l,h){"use strict";class d extends s.AbstractInteractableModule{constructor(){super(...arguments),this.selectorCheckTrigger=".t3js-tcaExtTablesCheck-check",this.selectorOutputContainer=".t3js-tcaExtTablesCheck-output"}initialize(e){this.currentModal=e,this.check(),e.on("click",this.selectorCheckTrigger,e=>{e.preventDefault(),this.check()})}check(){const e=this.getModalBody(),t=n(this.selectorOutputContainer),s=i.render(l.loading,"Loading...","");t.empty().html(s),new o(h.getUrl("tcaExtTablesCheck")).get({cache:"no-cache"}).then(async n=>{const s=await n.resolve();if(e.empty().append(s.html),r.setButtons(s.buttons),!0===s.success&&Array.isArray(s.status))if(s.status.length>0){const n=c.render(l.warning,"Following extensions change TCA in ext_tables.php","Check ext_tables.php files, look for ExtensionManagementUtility calls and $GLOBALS['TCA'] modifications");e.find(this.selectorOutputContainer).append(n),s.status.forEach(n=>{const s=c.render(n.severity,n.title,n.message);t.append(s),e.append(s)})}else{const t=c.render(l.ok,"No TCA changes in ext_tables.php files. Good job!","");e.find(this.selectorOutputContainer).append(t)}else a.error("Something went wrong",'Use "Check for broken extensions"')},t=>{h.handleAjaxError(t,e)})}}return new d})); \ No newline at end of file +define(["require","exports","jquery","../AbstractInteractableModule","TYPO3/CMS/Backend/Modal","TYPO3/CMS/Backend/Notification","TYPO3/CMS/Core/Ajax/AjaxRequest","../../Renderable/InfoBox","../../Renderable/ProgressBar","../../Renderable/Severity","../../Router"],(function(e,t,n,s,r,a,o,c,i,l,h){"use strict";class d extends s.AbstractInteractableModule{constructor(){super(...arguments),this.selectorCheckTrigger=".t3js-tcaExtTablesCheck-check",this.selectorOutputContainer=".t3js-tcaExtTablesCheck-output"}initialize(e){this.currentModal=e,this.check(),e.on("click",this.selectorCheckTrigger,e=>{e.preventDefault(),this.check()})}check(){this.setModalButtonsState(!1);const e=this.getModalBody(),t=n(this.selectorOutputContainer),s=i.render(l.loading,"Loading...","");t.empty().html(s),new o(h.getUrl("tcaExtTablesCheck")).get({cache:"no-cache"}).then(async n=>{const s=await n.resolve();if(e.empty().append(s.html),r.setButtons(s.buttons),!0===s.success&&Array.isArray(s.status))if(s.status.length>0){const n=c.render(l.warning,"Following extensions change TCA in ext_tables.php","Check ext_tables.php files, look for ExtensionManagementUtility calls and $GLOBALS['TCA'] modifications");e.find(this.selectorOutputContainer).append(n),s.status.forEach(n=>{const s=c.render(n.severity,n.title,n.message);t.append(s),e.append(s)})}else{const t=c.render(l.ok,"No TCA changes in ext_tables.php files. Good job!","");e.find(this.selectorOutputContainer).append(t)}else a.error("Something went wrong",'Use "Check for broken extensions"')},t=>{h.handleAjaxError(t,e)})}}return new d})); \ No newline at end of file diff --git a/typo3/sysext/install/Resources/Public/JavaScript/Module/Upgrade/TcaMigrationsCheck.js b/typo3/sysext/install/Resources/Public/JavaScript/Module/Upgrade/TcaMigrationsCheck.js index cc34442d14bd..7af897ea2593 100644 --- a/typo3/sysext/install/Resources/Public/JavaScript/Module/Upgrade/TcaMigrationsCheck.js +++ b/typo3/sysext/install/Resources/Public/JavaScript/Module/Upgrade/TcaMigrationsCheck.js @@ -10,4 +10,4 @@ * * The TYPO3 project - inspiring people to share! */ -define(["require","exports","jquery","../AbstractInteractableModule","TYPO3/CMS/Backend/Modal","TYPO3/CMS/Core/Ajax/AjaxRequest","../../Renderable/FlashMessage","../../Renderable/InfoBox","../../Renderable/ProgressBar","../../Renderable/Severity","../../Router"],(function(e,t,n,r,s,o,a,i,c,l,d){"use strict";class h extends r.AbstractInteractableModule{constructor(){super(...arguments),this.selectorCheckTrigger=".t3js-tcaMigrationsCheck-check",this.selectorOutputContainer=".t3js-tcaMigrationsCheck-output"}initialize(e){this.currentModal=e,this.check(),e.on("click",this.selectorCheckTrigger,e=>{e.preventDefault(),this.check()})}check(){const e=n(this.selectorOutputContainer),t=this.getModalBody(),r=c.render(l.loading,"Loading...","");e.empty().html(r),new o(d.getUrl("tcaMigrationsCheck")).get({cache:"no-cache"}).then(async e=>{const n=await e.resolve();if(t.empty().append(n.html),s.setButtons(n.buttons),!0===n.success&&Array.isArray(n.status))if(n.status.length>0){const e=i.render(l.warning,"TCA migrations need to be applied","Check the following list and apply needed changes.");t.find(this.selectorOutputContainer).empty(),t.find(this.selectorOutputContainer).append(e),n.status.forEach(e=>{const n=i.render(e.severity,e.title,e.message);t.find(this.selectorOutputContainer).append(n)})}else{const e=i.render(l.ok,"No TCA migrations need to be applied","Your TCA looks good.");t.find(this.selectorOutputContainer).append(e)}else{const e=a.render(l.error,"Something went wrong",'Use "Check for broken extensions"');t.find(this.selectorOutputContainer).append(e)}},e=>{d.handleAjaxError(e,t)})}}return new h})); \ No newline at end of file +define(["require","exports","jquery","../AbstractInteractableModule","TYPO3/CMS/Backend/Modal","TYPO3/CMS/Core/Ajax/AjaxRequest","../../Renderable/FlashMessage","../../Renderable/InfoBox","../../Renderable/ProgressBar","../../Renderable/Severity","../../Router"],(function(e,t,n,r,s,o,a,i,c,l,d){"use strict";class h extends r.AbstractInteractableModule{constructor(){super(...arguments),this.selectorCheckTrigger=".t3js-tcaMigrationsCheck-check",this.selectorOutputContainer=".t3js-tcaMigrationsCheck-output"}initialize(e){this.currentModal=e,this.check(),e.on("click",this.selectorCheckTrigger,e=>{e.preventDefault(),this.check()})}check(){this.setModalButtonsState(!1);const e=n(this.selectorOutputContainer),t=this.getModalBody(),r=c.render(l.loading,"Loading...","");e.empty().html(r),new o(d.getUrl("tcaMigrationsCheck")).get({cache:"no-cache"}).then(async e=>{const n=await e.resolve();if(t.empty().append(n.html),s.setButtons(n.buttons),!0===n.success&&Array.isArray(n.status))if(n.status.length>0){const e=i.render(l.warning,"TCA migrations need to be applied","Check the following list and apply needed changes.");t.find(this.selectorOutputContainer).empty(),t.find(this.selectorOutputContainer).append(e),n.status.forEach(e=>{const n=i.render(e.severity,e.title,e.message);t.find(this.selectorOutputContainer).append(n)})}else{const e=i.render(l.ok,"No TCA migrations need to be applied","Your TCA looks good.");t.find(this.selectorOutputContainer).append(e)}else{const e=a.render(l.error,"Something went wrong",'Use "Check for broken extensions"');t.find(this.selectorOutputContainer).append(e)}},e=>{d.handleAjaxError(e,t)})}}return new h})); \ No newline at end of file -- GitLab