From 1425919426cbad4e2cf43afe544e8e871ee37ab6 Mon Sep 17 00:00:00 2001 From: Benjamin Franzke <ben@bnf.dev> Date: Sun, 27 Aug 2023 18:45:11 +0200 Subject: [PATCH] [BUGFIX] Fix installer password toggle icon rendering The ajax Icon API is currently not available during first install, therefore neither getIcon nor the icon web component may be used to render an icon. The icon markup is therefore now pre-rendered via fluid for both states and toggled via CSS. Resolves: #101765 Related: #98089 Releases: main, 12.4 Change-Id: Ib72c06e41f083e4dc7392845058fc86aae95af9c Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/80712 Reviewed-by: Benjamin Franzke <ben@bnf.dev> Tested-by: Benjamin Franzke <ben@bnf.dev> Tested-by: core-ci <typo3@b13.com> --- Build/Sources/Sass/typo3/_install.scss | 14 ++++++++++++++ Build/Sources/TypeScript/install/installer.ts | 8 +++----- .../backend/Resources/Public/Css/backend.css | 2 ++ .../Templates/Installer/ShowDatabaseData.html | 7 +++++-- .../Resources/Public/JavaScript/installer.js | 2 +- 5 files changed, 25 insertions(+), 8 deletions(-) diff --git a/Build/Sources/Sass/typo3/_install.scss b/Build/Sources/Sass/typo3/_install.scss index 6e8b322bef8a..38f720f4249a 100644 --- a/Build/Sources/Sass/typo3/_install.scss +++ b/Build/Sources/Sass/typo3/_install.scss @@ -104,3 +104,17 @@ margin-bottom: 15px; } } + +.t3-install-form-password-toggle { + &[data-toggle-state="invisible"] { + .icon-actions-eye { + display: none; + } + } + + &[data-toggle-state="visible"] { + .icon-actions-lock { + display: none; + } + } +} diff --git a/Build/Sources/TypeScript/install/installer.ts b/Build/Sources/TypeScript/install/installer.ts index 3bcc817e4574..851bcb45b04c 100644 --- a/Build/Sources/TypeScript/install/installer.ts +++ b/Build/Sources/TypeScript/install/installer.ts @@ -71,14 +71,12 @@ class Installer { evt.preventDefault(); const $element = $(evt.currentTarget); const $toggleTarget = $($element.data('toggleTarget')); - const $toggleIcon = $element.find($element.data('toggleIcon')); - const isPassword = $toggleTarget.attr('type') === 'password'; - if (isPassword) { - $toggleIcon.replaceWith('<typo3-backend-icon identifier="actions-eye" size="small"></typo3-backend-icon>'); + if ($element.attr('data-toggle-state') === 'invisible') { + $element.attr('data-toggle-state', 'visible'); $toggleTarget.attr('type', 'text'); } else { + $element.attr('data-toggle-state', 'invisible'); $toggleTarget.attr('type', 'password'); - $toggleIcon.replaceWith('<typo3-backend-icon identifier="actions-lock" size="small"></typo3-backend-icon>'); } }); $(document).on('keyup', '.t3-install-form-password-strength', (): void => { diff --git a/typo3/sysext/backend/Resources/Public/Css/backend.css b/typo3/sysext/backend/Resources/Public/Css/backend.css index 760a34e996c9..32b4278658e9 100644 --- a/typo3/sysext/backend/Resources/Public/Css/backend.css +++ b/typo3/sysext/backend/Resources/Public/Css/backend.css @@ -4081,6 +4081,8 @@ span.dragIcon{display:inline-block;height:16px} .typo3-install-content-spacer{margin-top:2em} .typo3-install-content-spacer-small{margin-top:1em} .extensionConfiguration-form .tab-content{margin-bottom:15px} +.t3-install-form-password-toggle[data-toggle-state=invisible] .icon-actions-eye{display:none} +.t3-install-form-password-toggle[data-toggle-state=visible] .icon-actions-lock{display:none} .media-new-content-element-wizard .media-left input{margin-left:2px} .history-block{border-left:5px solid #a9a9a9;border-bottom:1px dotted #a9a9a9} .belog-filter-form .input-group{max-width:190px} diff --git a/typo3/sysext/install/Resources/Private/Templates/Installer/ShowDatabaseData.html b/typo3/sysext/install/Resources/Private/Templates/Installer/ShowDatabaseData.html index e79b515cfd1c..b492fdf985cc 100644 --- a/typo3/sysext/install/Resources/Private/Templates/Installer/ShowDatabaseData.html +++ b/typo3/sysext/install/Resources/Private/Templates/Installer/ShowDatabaseData.html @@ -41,9 +41,12 @@ <f:comment><!-- @todo: Add API for input group addons in floating forms--></f:comment> <button type="button" class="t3-install-form-password-toggle btn btn-link" - data-toggle-target="#password" data-toggle-icon=".icon" + data-toggle-target="#password" data-toggle-state="invisible" style="position: absolute; bottom: .35em; right: 0; outline: none; box-shadow: none" - aria-label="Toggle password visibility"><core:icon identifier="actions-lock" size="small" /></button> + aria-label="Toggle password visibility"> + <core:icon identifier="actions-lock" size="small" /> + <core:icon identifier="actions-eye" size="small" /> + </button> <label for="password" class="form-label">Password</label> </div> </div> diff --git a/typo3/sysext/install/Resources/Public/JavaScript/installer.js b/typo3/sysext/install/Resources/Public/JavaScript/installer.js index 3bdc536c5225..01a29a04265d 100644 --- a/typo3/sysext/install/Resources/Public/JavaScript/installer.js +++ b/typo3/sysext/install/Resources/Public/JavaScript/installer.js @@ -10,4 +10,4 @@ * * The TYPO3 project - inspiring people to share! */ -import DocumentService from"@typo3/core/document-service.js";import $ from"jquery";import AjaxRequest from"@typo3/core/ajax/ajax-request.js";import PasswordStrength from"@typo3/install/module/password-strength.js";import InfoBox from"@typo3/install/renderable/info-box.js";import ProgressBar from"@typo3/install/renderable/progress-bar.js";import Severity from"@typo3/install/renderable/severity.js";import"@typo3/backend/element/icon-element.js";class Installer{constructor(){this.selectorBody=".t3js-body",this.selectorModuleContent=".t3js-module-content",this.selectorMainContent=".t3js-installer-content",this.selectorProgressBar=".t3js-installer-progress",this.selectorProgressBarSteps=".t3js-installer-progress-steps",this.selectorDatabaseConnectOutput=".t3js-installer-databaseConnect-output",this.selectorDatabaseSelectOutput=".t3js-installer-databaseSelect-output",this.selectorDatabaseDataOutput=".t3js-installer-databaseData-output",this.initializeEvents(),DocumentService.ready().then((()=>{this.initialize()}))}initializeEvents(){$(document).on("click",".t3js-installer-environmentFolders-retry",(e=>{e.preventDefault(),this.showEnvironmentAndFolders()})),$(document).on("click",".t3js-installer-environmentFolders-execute",(e=>{e.preventDefault(),this.executeEnvironmentAndFolders()})),$(document).on("click",".t3js-installer-databaseConnect-execute",(e=>{e.preventDefault(),this.executeDatabaseConnect()})),$(document).on("click",".t3js-installer-databaseSelect-execute",(e=>{e.preventDefault(),this.executeDatabaseSelect()})),$(document).on("click",".t3js-installer-databaseData-execute",(e=>{e.preventDefault(),this.executeDatabaseData()})),$(document).on("click",".t3js-installer-defaultConfiguration-execute",(e=>{e.preventDefault(),this.executeDefaultConfiguration()})),$(document).on("click",".t3-install-form-password-toggle",(e=>{e.preventDefault();const t=$(e.currentTarget),s=$(t.data("toggleTarget")),a=t.find(t.data("toggleIcon"));"password"===s.attr("type")?(a.replaceWith('<typo3-backend-icon identifier="actions-eye" size="small"></typo3-backend-icon>'),s.attr("type","text")):(s.attr("type","password"),a.replaceWith('<typo3-backend-icon identifier="actions-lock" size="small"></typo3-backend-icon>'))})),$(document).on("keyup",".t3-install-form-password-strength",(()=>{PasswordStrength.initialize(".t3-install-form-password-strength")})),$(document).on("change","#t3js-connect-database-driver",(e=>{const t=$(e.currentTarget).val();$(".t3-install-driver-data").hide(),$(".t3-install-driver-data input").attr("disabled","disabled"),$("#"+t+" input").attr("disabled",null),$("#"+t).show()}))}initialize(){this.setProgress(0),this.getMainLayout()}getUrl(e){let t=location.href;return t=t.replace(location.search,""),void 0!==e&&(t=t+"?install[action]="+e),t}setProgress(e){const t=$(this.selectorProgressBar),s=$(this.selectorProgressBarSteps);let a=0;0!==e&&(a=e/5*100,t.find(".progress-bar").empty().text(a+"%"),s.find(".progress-steps").text(e+" of 5")),t.find(".progress-bar").css("width",a+"%").attr("aria-valuenow",a)}getMainLayout(){new AjaxRequest(this.getUrl("mainLayout")).get({cache:"no-cache"}).then((async e=>{const t=await e.resolve();$(this.selectorBody).empty().append(t.html),this.checkInstallerAvailable()}))}checkInstallerAvailable(){new AjaxRequest(this.getUrl("checkInstallerAvailable")).get({cache:"no-cache"}).then((async e=>{(await e.resolve()).success?this.checkEnvironmentAndFolders():this.showInstallerNotAvailable()}))}showInstallerNotAvailable(){const e=$(this.selectorMainContent);new AjaxRequest(this.getUrl("showInstallerNotAvailable")).get({cache:"no-cache"}).then((async t=>{const s=await t.resolve();!0===s.success&&e.empty().append(s.html)}))}checkEnvironmentAndFolders(){this.setProgress(1),new AjaxRequest(this.getUrl("checkEnvironmentAndFolders")).get({cache:"no-cache"}).then((async e=>{!0===(await e.resolve()).success?this.checkTrustedHostsPattern():this.showEnvironmentAndFolders()}))}showEnvironmentAndFolders(){const e=$(this.selectorMainContent);new AjaxRequest(this.getUrl("showEnvironmentAndFolders")).get({cache:"no-cache"}).then((async t=>{const s=await t.resolve();if(!0===s.success){e.empty().html(s.html);const t=$(".t3js-installer-environment-details");let a=!1;Array.isArray(s.environmentStatusErrors)&&s.environmentStatusErrors.forEach((e=>{a=!0;const s=InfoBox.render(e.severity,e.title,e.message);t.append(s)})),Array.isArray(s.environmentStatusWarnings)&&s.environmentStatusWarnings.forEach((e=>{a=!0;const s=InfoBox.render(e.severity,e.title,e.message);t.append(s)})),Array.isArray(s.structureErrors)&&s.structureErrors.forEach((e=>{a=!0;const s=InfoBox.render(e.severity,e.title,e.message);t.append(s)})),a?(t.show(),$(".t3js-installer-environmentFolders-bad").show()):$(".t3js-installer-environmentFolders-good").show()}}))}executeEnvironmentAndFolders(){new AjaxRequest(this.getUrl("executeEnvironmentAndFolders")).get({cache:"no-cache"}).then((async e=>{!0===(await e.resolve()).success&&this.checkTrustedHostsPattern()}))}checkTrustedHostsPattern(){new AjaxRequest(this.getUrl("checkTrustedHostsPattern")).get({cache:"no-cache"}).then((async e=>{!0===(await e.resolve()).success?this.executeSilentConfigurationUpdate():this.executeAdjustTrustedHostsPattern()}))}executeAdjustTrustedHostsPattern(){new AjaxRequest(this.getUrl("executeAdjustTrustedHostsPattern")).get({cache:"no-cache"}).then((()=>{this.executeSilentConfigurationUpdate()}))}executeSilentConfigurationUpdate(){new AjaxRequest(this.getUrl("executeSilentConfigurationUpdate")).get({cache:"no-cache"}).then((async e=>{!0===(await e.resolve()).success?this.executeSilentTemplateFileUpdate():this.executeSilentConfigurationUpdate()}))}executeSilentTemplateFileUpdate(){new AjaxRequest(this.getUrl("executeSilentTemplateFileUpdate")).get({cache:"no-cache"}).then((async e=>{!0===(await e.resolve()).success?this.checkDatabaseConnect():this.executeSilentTemplateFileUpdate()}))}checkDatabaseConnect(){this.setProgress(2),new AjaxRequest(this.getUrl("checkDatabaseConnect")).get({cache:"no-cache"}).then((async e=>{!0===(await e.resolve()).success?this.checkDatabaseSelect():this.showDatabaseConnect()}))}showDatabaseConnect(){const e=$(this.selectorMainContent);new AjaxRequest(this.getUrl("showDatabaseConnect")).get({cache:"no-cache"}).then((async t=>{const s=await t.resolve();!0===s.success&&(e.empty().html(s.html),$("#t3js-connect-database-driver").trigger("change"))}))}executeDatabaseConnect(){const e=$(this.selectorDatabaseConnectOutput),t={"install[action]":"executeDatabaseConnect","install[token]":$(this.selectorModuleContent).data("installer-database-connect-execute-token")};for(const e of $(this.selectorBody+" form").serializeArray())t[e.name]=e.value;new AjaxRequest(this.getUrl()).post(t).then((async t=>{const s=await t.resolve();!0===s.success?this.checkDatabaseSelect():Array.isArray(s.status)&&(e.empty(),s.status.forEach((t=>{const s=InfoBox.render(t.severity,t.title,t.message);e.append(s)})))}))}checkDatabaseSelect(){this.setProgress(3),new AjaxRequest(this.getUrl("checkDatabaseSelect")).get({cache:"no-cache"}).then((async e=>{!0===(await e.resolve()).success?this.checkDatabaseData():this.showDatabaseSelect()}))}showDatabaseSelect(){const e=$(this.selectorMainContent);new AjaxRequest(this.getUrl("showDatabaseSelect")).get({cache:"no-cache"}).then((async t=>{const s=await t.resolve();!0===s.success&&e.empty().html(s.html)}))}executeDatabaseSelect(){const e=$(this.selectorDatabaseSelectOutput),t={"install[action]":"executeDatabaseSelect","install[token]":$(this.selectorModuleContent).data("installer-database-select-execute-token")};for(const e of $(this.selectorBody+" form").serializeArray())t[e.name]=e.value;new AjaxRequest(this.getUrl()).post(t).then((async t=>{const s=await t.resolve();!0===s.success?this.checkDatabaseRequirements():Array.isArray(s.status)&&s.status.forEach((t=>{const s=InfoBox.render(t.severity,t.title,t.message);e.empty().append(s)}))}))}checkDatabaseRequirements(){const e=$(this.selectorDatabaseSelectOutput),t={"install[action]":"checkDatabaseRequirements","install[token]":$(this.selectorModuleContent).data("installer-database-check-requirements-execute-token")};for(const e of $(this.selectorBody+" form").serializeArray())t[e.name]=e.value;new AjaxRequest(this.getUrl()).post(t).then((async t=>{const s=await t.resolve();!0===s.success?this.checkDatabaseData():Array.isArray(s.status)&&(e.empty(),s.status.forEach((t=>{const s=InfoBox.render(t.severity,t.title,t.message);e.append(s)})))}))}checkDatabaseData(){this.setProgress(4),new AjaxRequest(this.getUrl("checkDatabaseData")).get({cache:"no-cache"}).then((async e=>{!0===(await e.resolve()).success?this.showDefaultConfiguration():this.showDatabaseData()}))}showDatabaseData(){const e=$(this.selectorMainContent);new AjaxRequest(this.getUrl("showDatabaseData")).get({cache:"no-cache"}).then((async t=>{const s=await t.resolve();!0===s.success&&e.empty().html(s.html)}))}executeDatabaseData(){const e=$(this.selectorDatabaseDataOutput),t={"install[action]":"executeDatabaseData","install[token]":$(this.selectorModuleContent).data("installer-database-data-execute-token")};for(const e of $(this.selectorBody+" form").serializeArray())t[e.name]=e.value;const s=ProgressBar.render(Severity.loading,"Loading...","");e.empty().append(s),new AjaxRequest(this.getUrl()).post(t).then((async t=>{const s=await t.resolve();!0===s.success?this.showDefaultConfiguration():Array.isArray(s.status)&&(e.empty(),s.status.forEach((t=>{const s=InfoBox.render(t.severity,t.title,t.message);e.append(s)})))}))}showDefaultConfiguration(){const e=$(this.selectorMainContent);this.setProgress(5),new AjaxRequest(this.getUrl("showDefaultConfiguration")).get({cache:"no-cache"}).then((async t=>{const s=await t.resolve();!0===s.success&&e.empty().html(s.html)}))}executeDefaultConfiguration(){const e={"install[action]":"executeDefaultConfiguration","install[token]":$(this.selectorModuleContent).data("installer-default-configuration-execute-token")};for(const t of $(this.selectorBody+" form").serializeArray())e[t.name]=t.value;new AjaxRequest(this.getUrl()).post(e).then((async e=>{const t=await e.resolve();top.location.href=t.redirect}))}}export default new Installer; \ No newline at end of file +import DocumentService from"@typo3/core/document-service.js";import $ from"jquery";import AjaxRequest from"@typo3/core/ajax/ajax-request.js";import PasswordStrength from"@typo3/install/module/password-strength.js";import InfoBox from"@typo3/install/renderable/info-box.js";import ProgressBar from"@typo3/install/renderable/progress-bar.js";import Severity from"@typo3/install/renderable/severity.js";import"@typo3/backend/element/icon-element.js";class Installer{constructor(){this.selectorBody=".t3js-body",this.selectorModuleContent=".t3js-module-content",this.selectorMainContent=".t3js-installer-content",this.selectorProgressBar=".t3js-installer-progress",this.selectorProgressBarSteps=".t3js-installer-progress-steps",this.selectorDatabaseConnectOutput=".t3js-installer-databaseConnect-output",this.selectorDatabaseSelectOutput=".t3js-installer-databaseSelect-output",this.selectorDatabaseDataOutput=".t3js-installer-databaseData-output",this.initializeEvents(),DocumentService.ready().then((()=>{this.initialize()}))}initializeEvents(){$(document).on("click",".t3js-installer-environmentFolders-retry",(e=>{e.preventDefault(),this.showEnvironmentAndFolders()})),$(document).on("click",".t3js-installer-environmentFolders-execute",(e=>{e.preventDefault(),this.executeEnvironmentAndFolders()})),$(document).on("click",".t3js-installer-databaseConnect-execute",(e=>{e.preventDefault(),this.executeDatabaseConnect()})),$(document).on("click",".t3js-installer-databaseSelect-execute",(e=>{e.preventDefault(),this.executeDatabaseSelect()})),$(document).on("click",".t3js-installer-databaseData-execute",(e=>{e.preventDefault(),this.executeDatabaseData()})),$(document).on("click",".t3js-installer-defaultConfiguration-execute",(e=>{e.preventDefault(),this.executeDefaultConfiguration()})),$(document).on("click",".t3-install-form-password-toggle",(e=>{e.preventDefault();const t=$(e.currentTarget),s=$(t.data("toggleTarget"));"invisible"===t.attr("data-toggle-state")?(t.attr("data-toggle-state","visible"),s.attr("type","text")):(t.attr("data-toggle-state","invisible"),s.attr("type","password"))})),$(document).on("keyup",".t3-install-form-password-strength",(()=>{PasswordStrength.initialize(".t3-install-form-password-strength")})),$(document).on("change","#t3js-connect-database-driver",(e=>{const t=$(e.currentTarget).val();$(".t3-install-driver-data").hide(),$(".t3-install-driver-data input").attr("disabled","disabled"),$("#"+t+" input").attr("disabled",null),$("#"+t).show()}))}initialize(){this.setProgress(0),this.getMainLayout()}getUrl(e){let t=location.href;return t=t.replace(location.search,""),void 0!==e&&(t=t+"?install[action]="+e),t}setProgress(e){const t=$(this.selectorProgressBar),s=$(this.selectorProgressBarSteps);let a=0;0!==e&&(a=e/5*100,t.find(".progress-bar").empty().text(a+"%"),s.find(".progress-steps").text(e+" of 5")),t.find(".progress-bar").css("width",a+"%").attr("aria-valuenow",a)}getMainLayout(){new AjaxRequest(this.getUrl("mainLayout")).get({cache:"no-cache"}).then((async e=>{const t=await e.resolve();$(this.selectorBody).empty().append(t.html),this.checkInstallerAvailable()}))}checkInstallerAvailable(){new AjaxRequest(this.getUrl("checkInstallerAvailable")).get({cache:"no-cache"}).then((async e=>{(await e.resolve()).success?this.checkEnvironmentAndFolders():this.showInstallerNotAvailable()}))}showInstallerNotAvailable(){const e=$(this.selectorMainContent);new AjaxRequest(this.getUrl("showInstallerNotAvailable")).get({cache:"no-cache"}).then((async t=>{const s=await t.resolve();!0===s.success&&e.empty().append(s.html)}))}checkEnvironmentAndFolders(){this.setProgress(1),new AjaxRequest(this.getUrl("checkEnvironmentAndFolders")).get({cache:"no-cache"}).then((async e=>{!0===(await e.resolve()).success?this.checkTrustedHostsPattern():this.showEnvironmentAndFolders()}))}showEnvironmentAndFolders(){const e=$(this.selectorMainContent);new AjaxRequest(this.getUrl("showEnvironmentAndFolders")).get({cache:"no-cache"}).then((async t=>{const s=await t.resolve();if(!0===s.success){e.empty().html(s.html);const t=$(".t3js-installer-environment-details");let a=!1;Array.isArray(s.environmentStatusErrors)&&s.environmentStatusErrors.forEach((e=>{a=!0;const s=InfoBox.render(e.severity,e.title,e.message);t.append(s)})),Array.isArray(s.environmentStatusWarnings)&&s.environmentStatusWarnings.forEach((e=>{a=!0;const s=InfoBox.render(e.severity,e.title,e.message);t.append(s)})),Array.isArray(s.structureErrors)&&s.structureErrors.forEach((e=>{a=!0;const s=InfoBox.render(e.severity,e.title,e.message);t.append(s)})),a?(t.show(),$(".t3js-installer-environmentFolders-bad").show()):$(".t3js-installer-environmentFolders-good").show()}}))}executeEnvironmentAndFolders(){new AjaxRequest(this.getUrl("executeEnvironmentAndFolders")).get({cache:"no-cache"}).then((async e=>{!0===(await e.resolve()).success&&this.checkTrustedHostsPattern()}))}checkTrustedHostsPattern(){new AjaxRequest(this.getUrl("checkTrustedHostsPattern")).get({cache:"no-cache"}).then((async e=>{!0===(await e.resolve()).success?this.executeSilentConfigurationUpdate():this.executeAdjustTrustedHostsPattern()}))}executeAdjustTrustedHostsPattern(){new AjaxRequest(this.getUrl("executeAdjustTrustedHostsPattern")).get({cache:"no-cache"}).then((()=>{this.executeSilentConfigurationUpdate()}))}executeSilentConfigurationUpdate(){new AjaxRequest(this.getUrl("executeSilentConfigurationUpdate")).get({cache:"no-cache"}).then((async e=>{!0===(await e.resolve()).success?this.executeSilentTemplateFileUpdate():this.executeSilentConfigurationUpdate()}))}executeSilentTemplateFileUpdate(){new AjaxRequest(this.getUrl("executeSilentTemplateFileUpdate")).get({cache:"no-cache"}).then((async e=>{!0===(await e.resolve()).success?this.checkDatabaseConnect():this.executeSilentTemplateFileUpdate()}))}checkDatabaseConnect(){this.setProgress(2),new AjaxRequest(this.getUrl("checkDatabaseConnect")).get({cache:"no-cache"}).then((async e=>{!0===(await e.resolve()).success?this.checkDatabaseSelect():this.showDatabaseConnect()}))}showDatabaseConnect(){const e=$(this.selectorMainContent);new AjaxRequest(this.getUrl("showDatabaseConnect")).get({cache:"no-cache"}).then((async t=>{const s=await t.resolve();!0===s.success&&(e.empty().html(s.html),$("#t3js-connect-database-driver").trigger("change"))}))}executeDatabaseConnect(){const e=$(this.selectorDatabaseConnectOutput),t={"install[action]":"executeDatabaseConnect","install[token]":$(this.selectorModuleContent).data("installer-database-connect-execute-token")};for(const e of $(this.selectorBody+" form").serializeArray())t[e.name]=e.value;new AjaxRequest(this.getUrl()).post(t).then((async t=>{const s=await t.resolve();!0===s.success?this.checkDatabaseSelect():Array.isArray(s.status)&&(e.empty(),s.status.forEach((t=>{const s=InfoBox.render(t.severity,t.title,t.message);e.append(s)})))}))}checkDatabaseSelect(){this.setProgress(3),new AjaxRequest(this.getUrl("checkDatabaseSelect")).get({cache:"no-cache"}).then((async e=>{!0===(await e.resolve()).success?this.checkDatabaseData():this.showDatabaseSelect()}))}showDatabaseSelect(){const e=$(this.selectorMainContent);new AjaxRequest(this.getUrl("showDatabaseSelect")).get({cache:"no-cache"}).then((async t=>{const s=await t.resolve();!0===s.success&&e.empty().html(s.html)}))}executeDatabaseSelect(){const e=$(this.selectorDatabaseSelectOutput),t={"install[action]":"executeDatabaseSelect","install[token]":$(this.selectorModuleContent).data("installer-database-select-execute-token")};for(const e of $(this.selectorBody+" form").serializeArray())t[e.name]=e.value;new AjaxRequest(this.getUrl()).post(t).then((async t=>{const s=await t.resolve();!0===s.success?this.checkDatabaseRequirements():Array.isArray(s.status)&&s.status.forEach((t=>{const s=InfoBox.render(t.severity,t.title,t.message);e.empty().append(s)}))}))}checkDatabaseRequirements(){const e=$(this.selectorDatabaseSelectOutput),t={"install[action]":"checkDatabaseRequirements","install[token]":$(this.selectorModuleContent).data("installer-database-check-requirements-execute-token")};for(const e of $(this.selectorBody+" form").serializeArray())t[e.name]=e.value;new AjaxRequest(this.getUrl()).post(t).then((async t=>{const s=await t.resolve();!0===s.success?this.checkDatabaseData():Array.isArray(s.status)&&(e.empty(),s.status.forEach((t=>{const s=InfoBox.render(t.severity,t.title,t.message);e.append(s)})))}))}checkDatabaseData(){this.setProgress(4),new AjaxRequest(this.getUrl("checkDatabaseData")).get({cache:"no-cache"}).then((async e=>{!0===(await e.resolve()).success?this.showDefaultConfiguration():this.showDatabaseData()}))}showDatabaseData(){const e=$(this.selectorMainContent);new AjaxRequest(this.getUrl("showDatabaseData")).get({cache:"no-cache"}).then((async t=>{const s=await t.resolve();!0===s.success&&e.empty().html(s.html)}))}executeDatabaseData(){const e=$(this.selectorDatabaseDataOutput),t={"install[action]":"executeDatabaseData","install[token]":$(this.selectorModuleContent).data("installer-database-data-execute-token")};for(const e of $(this.selectorBody+" form").serializeArray())t[e.name]=e.value;const s=ProgressBar.render(Severity.loading,"Loading...","");e.empty().append(s),new AjaxRequest(this.getUrl()).post(t).then((async t=>{const s=await t.resolve();!0===s.success?this.showDefaultConfiguration():Array.isArray(s.status)&&(e.empty(),s.status.forEach((t=>{const s=InfoBox.render(t.severity,t.title,t.message);e.append(s)})))}))}showDefaultConfiguration(){const e=$(this.selectorMainContent);this.setProgress(5),new AjaxRequest(this.getUrl("showDefaultConfiguration")).get({cache:"no-cache"}).then((async t=>{const s=await t.resolve();!0===s.success&&e.empty().html(s.html)}))}executeDefaultConfiguration(){const e={"install[action]":"executeDefaultConfiguration","install[token]":$(this.selectorModuleContent).data("installer-default-configuration-execute-token")};for(const t of $(this.selectorBody+" form").serializeArray())e[t.name]=t.value;new AjaxRequest(this.getUrl()).post(e).then((async e=>{const t=await e.resolve();top.location.href=t.redirect}))}}export default new Installer; \ No newline at end of file -- GitLab