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 d3632d54e8aa27738e754e6b6d2715f190e027f6..aae12319bceeaf75d3262f1fd23689fce3126355 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 eabf2fb92e59d3b4fca07a4ce4477ff838e53404..48a0527fb8cad5d9717f3ffdc6c33f0bdd532189 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 56e78d3652c5ac1bdc15ae7495eae4edc46f1f67..04e8cbdcbfcfd527db38f37bf3512ada88a164b3 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 e15dc78370e7f15de9432454b366f02e664ac3f0..aab6b86f8e48ee97d83e1fc734c9998ec85e4608 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 10a2abea0c16b5a767a9aa4e76d8783dcba78c11..1adf41385159c78ba179bf03d994eb2e5a56161c 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 7de52187f1650d00c3448047468d36d2525cf67d..ef94b0e6a136aa5ad0aaf92d2b4281254d39f38c 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 62586344f88fce521c88c0e21a0a02f5fc79f895..3be365de85cd9d7714a2b322ce5779b0873e4ae5 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 e52d51c4fa2a1b76efc2cb97247cdd8d0fd7f868..e0c12d2553a93bdcdf2542c1dd58f6154c90db16 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 1603c29fcd715ef578b3241ca1d17b0c3f404510..5059d3321147857ae120984ee02b7539ca75e28e 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 c06852d3799f0e5889baf57dbb672acfa0fee888..08f2255aa4ca932056c5562429eebbb2bce65456 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 d017306cd22d03245ec10dd74d0535a8a9b37cb2..c1051d9162270e0269bb6fcbf727a60933075fda 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 bd6821a1b2fcfa8cb9d070e8c9a88bde5b581f57..c88168a4754fecc33d676df3f9187a9bb882d6c5 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 bea2b6ac7c4993ef1cb8e50fae0b7375eb60d779..a42b38fa19c774f32ca6ce9d4295634340943848 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 df15657a30304a37e9ce3067a13545b3f6a92dae..5615251a50a173d21027a63d7916b27419d56fb4 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 ac4e7b52de40bc72db7b3dc4b70390616a1967e1..289767da7de97f8eb2b38cb8f166b3b2e3905a5a 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 fa1d7785b1ccfcee5e505a8f9a2f2a75fda7ec22..6d3d879147ae8a513d68818b8bbe35137705e22a 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 70d40fdefddd91860fc293df6e897c2fae15dbcd..d8170ca9430e4909361e99286dc9c516b1a141d3 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 461cacba72cc86e8cab561f7430fb2f85a309b45..6ab391da71a9d951e48cddcf2bcc25d0c5f79712 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 b3f191c99236761299126eb1f40d5d389ae3a6e7..c5cd7491f2462bbca2a1836527cd2e989b9f414c 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 b7a17b1996b156136979890995f31d7007822992..930f9611acc38e22d1016f189481340e4c027788 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 a7bacf92ec0407fad1e0a9369dcd72e44f91fb72..9127deb9d8b75b25e6b5b0492765dd00bd4d669e 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 04f36268e50c3756058b3bde40ac1f1447c2503c..e967c8c3cd68ff9e6691f5907ed0c8df734e8ea1 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 bc7c26c1b5aa368715b4aa1dc8a9937db0830df2..d57715157075a2a6ddcc978be6be70bb91ad6f3c 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 fd207fd88ba55d586e440adb38fd032fd80fee16..2ba3f91c8c208438fdf114f55783f7fc07a8f4ed 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 fe647dfe22dad37bcae4dacf62edfd4076683db7..97ab9ba103a634875924a1c40d0517e9e92469cc 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 67f5199fd2604dca5cc12bade853b98cefe947fe..6a1f1631ff2bef26d796ff9d15f5479695fa4e23 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 7c298c08cad65c66ffb26a1c2618329003eac0a5..813071f58418f98810a8b60d450b6f5fa6056b0d 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 a767a19d6895777be9103d6adf48a784ff060387..11fd3c4fbb1cdc15d4d2cd51cc07d783239bd47b 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 8d8988b27dcb6113d030aad33bccf22f90bb02cf..1b9645fb4a8ffb1a15459193b1007d84547c6a78 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 05cfd1cd03777be82ccdb47b208e705a458ab077..4a1dde977b1574ac83426a0c699c2971c6e03f43 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 8dee6a189936fdde911159ed4131e9114157adbb..a69acc4970459e2a0cde7328244c7072001028d3 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 3266911ce8768e2c5528ab531a62bde0b2d5f820..dde1e7e98680a9b219da0b480485e252a473621b 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 c76a8087a2328c395645afc19016e376bc2bec29..157ef363abce71b200ef0288ff66fd16510702a6 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 efe6c1de3f39cf2290414138363573adba939ea6..af49c1dd8f09c256d2467f98028e3fd0c255827e 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 faeb12e40cf5a36fbc6026cdbe33c25debaca85e..b0e346bdde8b0d28ca7ae0ca90caea1e0add31ae 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 922a48abc718d737aaf62bc3571c35dbf981f054..2dd14b3cc5b44a3b28b00c11b2202a9bd33311e3 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 68f21fc1dade23de72a4b121634b3d8a37019160..fdf0f958843b659b9f2c59ffd875d91f167431ca 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 d8cbd7a83bc098ff71ae7bfbac454b353281ee37..e65f23715f9dd9ab5a5d8c615f3cd958ce108435 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 fcff92e3f92aed0039602b4ff6996ba603aec39a..cd82c317b5c72592d61f9cdf72d78c4813c03572 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 341f8f1c1285ec6bd0e0c8637b2b158d3b7a800d..ce5eb85de7b103ed53306503d876990e909d1a6c 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 be6a93296104ac096bc4d7128d8745757adbbc0b..5e2845b66aa8c6f519a30c1ee0550aa29963b7b1 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 24494f000d4a95545a3afcb4d20ecc898e944970..51ce96b3533a710397e7feed1f7e847dc12bb6c2 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 bea0011fe3bbcbbb3a3ae432af9f66c9eeb445d6..f4e2b762f7729cec0ae1bb7fab13a6aabf94bcf9 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 f2a8c0f7504e73ac80be55011be5af7ab7ed7177..c9052e0ef4e20ecaeb4ce49c85a4935504fde7b3 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 cc34442d14bd6b614913b8129613fd741ba776e4..7af897ea259370feef87fa19791e3ecb364861eb 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