[TASK] Remove Ter.json template in extension manager 78/44778/4
authorNicole Cordes <typo3@cordes.co>
Thu, 19 Nov 2015 01:06:59 +0000 (02:06 +0100)
committerWouter Wolters <typo3@wouterwolters.nl>
Fri, 20 Nov 2015 10:14:45 +0000 (11:14 +0100)
The Ter.json template is needed to reload the extension table list
after the extension information was reloaded. As this request is not
useful (e.g. any search parameter stays in the input field, but the
request doesn't filter anything), the template should be removed and
the whole page should be reloaded afterwards.

Resolves: #71669
Releases: master, 6.2
Change-Id: I64158edff282540e7cc9f2597c9579607834aa55
Reviewed-on: https://review.typo3.org/44778
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/extensionmanager/Resources/Private/Templates/List/Ter.json [deleted file]
typo3/sysext/extensionmanager/Resources/Public/JavaScript/Main.js

diff --git a/typo3/sysext/extensionmanager/Resources/Private/Templates/List/Ter.json b/typo3/sysext/extensionmanager/Resources/Private/Templates/List/Ter.json
deleted file mode 100644 (file)
index 3b8bf26..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-{namespace em=TYPO3\CMS\Extensionmanager\ViewHelpers}
-<em:format.jsonEncode>
-{f:render(partial:'List/TerPaginator.html', arguments:{extensions:extensions, availableAndInstalled:availableAndInstalled})}
-</em:format.jsonEncode>
\ No newline at end of file
index 4895990..a450e1a 100644 (file)
@@ -571,7 +571,7 @@ define([
                        $me.attr('action', '#');
                        $me.submit(function() {
                                // Force update on click.
-                               ExtensionManager.Update.updateFromTer(updateURL, 1);
+                               ExtensionManager.Update.updateFromTer(updateURL, true);
 
                                // Prevent normal submit action.
                                return false;
@@ -579,17 +579,17 @@ define([
 
                        // This might give problems when there are more "update"-buttons,
                        // each one would trigger a TER-ExtensionManager.Update.
-                       ExtensionManager.Update.updateFromTer(updateURL, 0);
+                       ExtensionManager.Update.updateFromTer(updateURL, false);
                });
        };
 
        /**
         *
         * @param {String} url
-        * @param {Number} forceUpdate
+        * @param {Boolean} forceUpdate
         */
        ExtensionManager.Update.updateFromTer = function(url, forceUpdate) {
-               if (forceUpdate == 1) {
+               if (forceUpdate) {
                        url = url + '&tx_extensionmanager_tools_extensionmanagerextensionmanager%5BforceUpdateCheck%5D=1';
                }
 
@@ -604,6 +604,8 @@ define([
                $(ExtensionManager.Update.identifier.terTableDataTableWrapper).addClass('is-loading');
                $(ExtensionManager.Update.identifier.pagination).addClass('is-loading');
 
+               var reload = false;
+
                $.ajax({
                        url: url,
                        dataType: 'json',
@@ -626,14 +628,9 @@ define([
                                );
 
                                if (data.updated) {
-                                       $.ajax({
-                                               url: window.location.href + '&tx_extensionmanager_tools_extensionmanagerextensionmanager%5Bformat%5D=json',
-                                               dataType: 'json',
-                                               success: function(data) {
-                                                       $(ExtensionManager.Update.identifier.terTableWrapper).html(data);
-                                                       ExtensionManager.Update.transformPaginatorToAjax();
-                                               }
-                                       });
+                                       // Reload page
+                                       reload = true;
+                                       window.location.replace(window.location.href);
                                }
                        },
                        error: function(jqXHR, textStatus, errorThrown) {
@@ -649,16 +646,18 @@ define([
                        complete: function() {
                                NProgress.done();
 
-                               // Hide loaders
-                               $(ExtensionManager.Update.identifier.splashscreen).removeClass('is-shown');
-                               $(ExtensionManager.Update.identifier.terTableDataTableWrapper).removeClass('is-loading');
-                               $(ExtensionManager.Update.identifier.pagination).removeClass('is-loading');
+                               if (!reload) {
+                                       // Hide loaders
+                                       $(ExtensionManager.Update.identifier.splashscreen).removeClass('is-shown');
+                                       $(ExtensionManager.Update.identifier.terTableDataTableWrapper).removeClass('is-loading');
+                                       $(ExtensionManager.Update.identifier.pagination).removeClass('is-loading');
 
-                               // Show triggers for TER-update
-                               $(ExtensionManager.Update.identifier.terUpdateAction).removeClass('is-hidden');
+                                       // Show triggers for TER-update
+                                       $(ExtensionManager.Update.identifier.terUpdateAction).removeClass('is-hidden');
 
-                               // Show extension table
-                               $(ExtensionManager.Update.identifier.extensionTable).show();
+                                       // Show extension table
+                                       $(ExtensionManager.Update.identifier.extensionTable).show();
+                               }
                        }
                });
        };