Skip to content

Commit 9c23824

Browse files
author
Igor Melnikov
committed
MAGETWO-44975: Incorrect messgae on success page after extension installation
Fixing issue with clearing local storage and titles being overwritten
1 parent 16dc76d commit 9c23824

File tree

2 files changed

+9
-13
lines changed

2 files changed

+9
-13
lines changed

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

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -114,15 +114,11 @@ angular.module('component-grid', ['ngStorage'])
114114
version: $scope.availableUpdatePackages[component.name]['latestVersion']
115115
}
116116
];
117-
if ($localStorage.titles['update'].indexOf(component.moduleName) < 0 ) {
118-
$localStorage.titles['update'] = 'Update ' + component.moduleName;
119-
}
120117
if (component.moduleName) {
121118
$localStorage.moduleName = component.moduleName;
122119
} else {
123120
$localStorage.moduleName = component.name;
124121
}
125-
126122
$scope.nextState();
127123
};
128124

@@ -132,9 +128,6 @@ angular.module('component-grid', ['ngStorage'])
132128
name: component.name
133129
}
134130
];
135-
if ($localStorage.titles['uninstall'].indexOf(component.moduleName) < 0 ) {
136-
$localStorage.titles['uninstall'] = 'Uninstall ' + component.moduleName;
137-
}
138131
$localStorage.componentType = component.type;
139132
if (component.moduleName) {
140133
$localStorage.moduleName = component.moduleName;
@@ -151,12 +144,12 @@ angular.module('component-grid', ['ngStorage'])
151144
name: component.moduleName
152145
}
153146
];
154-
if ($localStorage.titles[type].indexOf(component.moduleName) < 0 ) {
155-
$localStorage.titles[type] = type.charAt(0).toUpperCase() + type.slice(1) + ' '
156-
+ component.moduleName;
157-
}
158147
$localStorage.componentType = component.type;
159-
$localStorage.moduleName = component.moduleName;
148+
if (component.moduleName) {
149+
$localStorage.moduleName = component.moduleName;
150+
} else {
151+
$localStorage.moduleName = component.name;
152+
}
160153
$state.go('root.readiness-check-'+type);
161154
}
162155
};

setup/pub/magento/setup/main.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,14 +102,17 @@ main.controller('navigationController',
102102
return {
103103
mainState: {},
104104
states: [],
105+
titlesWithModuleName: ['enable', 'disable', 'update', 'uninstall'],
105106
load: function () {
106-
$localStorage.$reset();
107107
var self = this;
108108
return $http.get('index.php/navigation').success(function (data) {
109109
var currentState = $location.path().replace('/', '');
110110
var isCurrentStateFound = false;
111111
self.states = data.nav;
112112
$localStorage.menu = data.menu;
113+
self.titlesWithModuleName.forEach(function (value) {
114+
data.titles[value] = data.titles[value] + $localStorage.moduleName;
115+
});
113116
$localStorage.titles = data.titles;
114117
data.nav.forEach(function (item) {
115118
app.stateProvider.state(item.id, item);

0 commit comments

Comments
 (0)