[TASK] EM: Require confirmation to continue on dependency failure 56/38356/5
authorAndreas Fernandez <a.fernandez@scripting-base.de>
Mon, 30 Mar 2015 14:37:38 +0000 (16:37 +0200)
committerXavier Perseguers <xavier@typo3.org>
Tue, 31 Mar 2015 09:32:17 +0000 (11:32 +0200)
Disable all "I know what I'm doing" buttons and add a confirmation
checkbox to unlock those buttons.

Resolves: #66150
Releases: master
Change-Id: I92a5ecd27818e160156dceb7b81be5c320f8424d
Reviewed-on: http://review.typo3.org/38356
Reviewed-by: Nicole Cordes <typo3@cordes.co>
Tested-by: Nicole Cordes <typo3@cordes.co>
Reviewed-by: Xavier Perseguers <xavier@typo3.org>
Tested-by: Xavier Perseguers <xavier@typo3.org>
typo3/sysext/extensionmanager/Resources/Private/Language/locallang.xlf
typo3/sysext/extensionmanager/Resources/Private/Partials/List/UnresolvedDependencies.json
typo3/sysext/extensionmanager/Resources/Private/Partials/List/UnresolvedDependenciesMessage.html
typo3/sysext/extensionmanager/Resources/Private/Templates/List/UnresolvedDependencies.html
typo3/sysext/extensionmanager/Resources/Public/JavaScript/Main.js

index 36f430f..e3acefa 100644 (file)
                        <trans-unit id="button.resolveDependencies">
                                <source>Resolve dependencies</source>
                        </trans-unit>
+                       <trans-unit id="label.resolveDependenciesEnableButton">
+                               <source>I understand what this means and I'm able to investigate on possibly occurring issues by myself.</source>
+                       </trans-unit>
                        <trans-unit id="button.resolveDependenciesIgnore">
-                               <source>Continue anyway</source>
+                               <source>I know what I'm doing, continue anyway</source>
                        </trans-unit>
                        <trans-unit id="extensionList.clickToConfigure">
                                <source>(Click to configure)</source>
index 0c56e7d..026df1d 100644 (file)
@@ -1,6 +1,6 @@
 <f:render partial="List/UnresolvedDependencies.html" arguments="{_all}" />
 
-<h3><span class="fa fa-exclamation-triangle"></span> <f:translate key="dependencyCheck.unresolvedDependencies.title" /></h3>
-<f:render partial="List/UnresolvedDependenciesMessage.html" />
-<br /><br />
-<strong><f:translate key="dependencyCheck.unresolvedDependencies.question" /></strong>
\ No newline at end of file
+<f:be.infobox title="{f:translate(key: 'dependencyCheck.unresolvedDependencies.title')}" state="1">
+       <f:render partial="List/UnresolvedDependenciesMessage.html" />
+       <p><strong><f:translate key="dependencyCheck.unresolvedDependencies.question" /></strong></p>
+</f:be.infobox>
\ No newline at end of file
index 7d6a5d4..ae36669 100644 (file)
@@ -1 +1,6 @@
-<p><f:translate key="dependencyCheck.unresolvedDependencies.message" /></p>
\ No newline at end of file
+<p><f:translate key="dependencyCheck.unresolvedDependencies.message" /></p>
+<div class="checkbox">
+       <label>
+               <input type="checkbox" name="unlockDependencyIgnoreButton"> <f:translate key="label.resolveDependenciesEnableButton" />
+       </label>
+</div>
\ No newline at end of file
index bd29ecf..90b187a 100644 (file)
@@ -18,7 +18,7 @@
        <f:link.action action="index" class="btn btn-default onClickMaskExtensionManager">
                Go back
        </f:link.action>
-       <f:link.action action="installExtensionWithoutSystemDependencyCheck" controller="Action" arguments="{extensionKey: extension.extensionKey}" class="btn btn-default onClickMaskExtensionManager">
+       <f:link.action action="installExtensionWithoutSystemDependencyCheck" controller="Action" arguments="{extensionKey: extension.extensionKey}" class="btn btn-default t3js-dependencies disabled onClickMaskExtensionManager">
                <span class="t3-icon t3-icon-actions t3-icon-dialog-error">&nbsp;</span> <f:translate key="dependencyCheck.unresolvedDependencies.proceed" />
        </f:link.action>
 </f:section>
\ No newline at end of file
index dc7fc09..c99a727 100644 (file)
@@ -407,7 +407,7 @@ define(['jquery', 'datatables', 'jquery/jquery.clearable'], function($) {
                        success: function (data) {
                                $extManager.unmask();
                                if (data.errorCount > 0) {
-                                       top.TYPO3.Modal.confirm(data.errorTitle, data.errorMessage, top.TYPO3.Severity.warning, [
+                                       top.TYPO3.Modal.confirm(data.errorTitle, data.errorMessage, top.TYPO3.Severity.error, [
                                                {
                                                        text: TYPO3.lang['button.cancel'],
                                                        active: true,
@@ -416,13 +416,19 @@ define(['jquery', 'datatables', 'jquery/jquery.clearable'], function($) {
                                                        }
                                                }, {
                                                        text: TYPO3.lang['button.resolveDependenciesIgnore'],
-                                                       btnClass: 'btn-warning',
+                                                       btnClass: 'btn-danger disabled t3js-dependencies',
                                                        trigger: function() {
                                                                Repository.getResolveDependenciesAndInstallResult(data.skipDependencyUri);
                                                                top.TYPO3.Modal.dismiss();
                                                        }
                                                }
                                        ]);
+                                       top.TYPO3.Modal.currentModal.on('shown.bs.modal', function() {
+                                               var $actionButton = top.TYPO3.Modal.currentModal.find('.t3js-dependencies');
+                                               top.TYPO3.jQuery('input[name=unlockDependencyIgnoreButton]').on('change', function() {
+                                                       $actionButton.toggleClass('disabled', !$(this).prop('checked'));
+                                               });
+                                       });
                                } else {
                                        var successMessage = TYPO3.lang['extensionList.dependenciesResolveDownloadSuccess.message' + data.installationTypeLanguageKey].replace(/\{0\}/g, data.extension) + ' <br />';
                                        successMessage += '<br /><h3>' + TYPO3.lang['extensionList.dependenciesResolveDownloadSuccess.header'] + ':</h3>';
@@ -622,6 +628,9 @@ define(['jquery', 'datatables', 'jquery/jquery.clearable'], function($) {
                                        },
                                        success: ExtensionManager.updateExtension
                                });
+                       }).on('change', 'input[name=unlockDependencyIgnoreButton]', function() {
+                               var $actionButton = TYPO3.jQuery('.t3js-dependencies');
+                               $actionButton.toggleClass('disabled', !$(this).prop('checked'));
                        });
 
                        $(ExtensionManager.identifier.searchField).clearable({