Skip to content

Commit 3d3497a

Browse files
author
Korshenko, Olexii(okorshenko)
committed
Merge pull request #135 from magento-ogre/MAGETWO-44975-incorrect-messgae-on-success-page
Magetwo 44975 incorrect messgae on success page
2 parents 2d02dc7 + c9c7567 commit 3d3497a

File tree

5 files changed

+31
-14
lines changed

5 files changed

+31
-14
lines changed

setup/pub/magento/setup/app.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,15 @@ var app = angular.module(
3131
'system-config'
3232
]);
3333

34-
app.config(function ($stateProvider) {
34+
app.config(['$httpProvider', '$stateProvider', function ($httpProvider, $stateProvider) {
35+
if (!$httpProvider.defaults.headers.get) {
36+
$httpProvider.defaults.headers.get = {};
37+
}
38+
$httpProvider.defaults.headers.get['Cache-Control'] = 'no-cache, no-store, must-revalidate';
39+
$httpProvider.defaults.headers.get['Pragma'] = 'no-cache';
40+
$httpProvider.defaults.headers.get['Expires'] = 0;
3541
app.stateProvider = $stateProvider;
36-
})
42+
}])
3743
.config(function($provide) {
3844
$provide.decorator('$state', function($delegate, $stateParams) {
3945
$delegate.forceReload = function() {

setup/pub/magento/setup/component-grid.js

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -117,15 +117,15 @@ angular.module('component-grid', ['ngStorage'])
117117
version: $scope.availableUpdatePackages[component.name]['latestVersion']
118118
}
119119
];
120-
if ($localStorage.titles['update'].indexOf(component.moduleName) < 0 ) {
121-
$localStorage.titles['update'] = 'Update ' + component.moduleName;
122-
}
123120
if (component.moduleName) {
124121
$localStorage.moduleName = component.moduleName;
125122
} else {
126123
$localStorage.moduleName = component.name;
127124
}
128-
125+
if ($localStorage.titles['update'].indexOf($localStorage.moduleName) < 0 ) {
126+
$localStorage.titles['update'] = 'Update ' + $localStorage.moduleName;
127+
}
128+
$rootScope.titles = $localStorage.titles;
129129
$scope.nextState();
130130
};
131131

@@ -135,15 +135,16 @@ angular.module('component-grid', ['ngStorage'])
135135
name: component.name
136136
}
137137
];
138-
if ($localStorage.titles['uninstall'].indexOf(component.moduleName) < 0 ) {
139-
$localStorage.titles['uninstall'] = 'Uninstall ' + component.moduleName;
140-
}
141-
$localStorage.componentType = component.type;
142138
if (component.moduleName) {
143139
$localStorage.moduleName = component.moduleName;
144140
} else {
145141
$localStorage.moduleName = component.name;
146142
}
143+
if ($localStorage.titles['uninstall'].indexOf($localStorage.moduleName) < 0 ) {
144+
$localStorage.titles['uninstall'] = 'Uninstall ' + $localStorage.moduleName;
145+
}
146+
$rootScope.titles = $localStorage.titles;
147+
$localStorage.componentType = component.type;
147148
$state.go('root.readiness-check-uninstall');
148149
};
149150

@@ -154,12 +155,17 @@ angular.module('component-grid', ['ngStorage'])
154155
name: component.moduleName
155156
}
156157
];
157-
if ($localStorage.titles[type].indexOf(component.moduleName) < 0 ) {
158+
if (component.moduleName) {
159+
$localStorage.moduleName = component.moduleName;
160+
} else {
161+
$localStorage.moduleName = component.name;
162+
}
163+
if ($localStorage.titles[type].indexOf($localStorage.moduleName) < 0 ) {
158164
$localStorage.titles[type] = type.charAt(0).toUpperCase() + type.slice(1) + ' '
159-
+ component.moduleName;
165+
+ $localStorage.moduleName;
160166
}
167+
$rootScope.titles = $localStorage.titles;
161168
$localStorage.componentType = component.type;
162-
$localStorage.moduleName = component.moduleName;
163169
$state.go('root.readiness-check-'+type);
164170
}
165171
};

setup/pub/magento/setup/main.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,14 +113,17 @@ main.controller('navigationController',
113113
return {
114114
mainState: {},
115115
states: [],
116+
titlesWithModuleName: ['enable', 'disable', 'update', 'uninstall'],
116117
load: function () {
117-
$localStorage.$reset();
118118
var self = this;
119119
return $http.get('index.php/navigation').success(function (data) {
120120
var currentState = $location.path().replace('/', '');
121121
var isCurrentStateFound = false;
122122
self.states = data.nav;
123123
$localStorage.menu = data.menu;
124+
self.titlesWithModuleName.forEach(function (value) {
125+
data.titles[value] = data.titles[value] + $localStorage.moduleName;
126+
});
124127
$localStorage.titles = data.titles;
125128
data.nav.forEach(function (item) {
126129
app.stateProvider.state(item.id, item);

setup/pub/magento/setup/success.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,5 @@ angular.module('success', ['ngStorage'])
2727
$localStorage.$reset();
2828
$scope.admin.password = '';
2929
$scope.db.password = '';
30+
$localStorage.$reset();
3031
}]);

setup/pub/magento/setup/updater-success.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,5 @@ angular.module('updater-success', ['ngStorage'])
1818
$scope.back = function () {
1919
$window.location.href = '';
2020
}
21+
$localStorage.$reset();
2122
}]);

0 commit comments

Comments
 (0)