зеркало из https://github.com/mozilla/fleet.git
Get app to work in IE (#1344)
* Use lodash for endsWith support * Fix IE Promise and Object.assign
This commit is contained in:
Родитель
7a7fb9eac9
Коммит
a56dba63a2
|
@ -287,6 +287,7 @@ Third-Party Licenses
|
|||
| [es5-ext](https://www.npmjs.com/package/es5-ext) | [MIT](https://opensource.org/licenses/MIT) |
|
||||
| [es6-iterator](https://www.npmjs.com/package/es6-iterator) | [MIT](https://opensource.org/licenses/MIT) |
|
||||
| [es6-map](https://www.npmjs.com/package/es6-map) | [MIT](https://opensource.org/licenses/MIT) |
|
||||
| [es6-object-assign](https://www.npmjs.com/package/es6-object-assign) | [MIT](https://opensource.org/licenses/MIT) |
|
||||
| [es6-promise](https://www.npmjs.com/package/es6-promise) | [MIT](https://opensource.org/licenses/MIT) |
|
||||
| [es6-set](https://www.npmjs.com/package/es6-set) | [MIT](https://opensource.org/licenses/MIT) |
|
||||
| [es6-symbol](https://www.npmjs.com/package/es6-symbol) | [MIT](https://opensource.org/licenses/MIT) |
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* eslint-disable no-unused-vars */
|
||||
import { get } from 'lodash';
|
||||
import { endsWith, get } from 'lodash';
|
||||
import { push } from 'react-router-redux';
|
||||
|
||||
import APP_CONSTANTS from 'app_constants';
|
||||
|
@ -12,7 +12,7 @@ const { HTTP_STATUS, PATHS } = APP_CONSTANTS;
|
|||
const authMiddleware = store => next => (action) => {
|
||||
const { type, payload } = action;
|
||||
|
||||
if (type.endsWith('FAILURE')) {
|
||||
if (endsWith(type, 'FAILURE')) {
|
||||
if (get(payload, 'errors.http_status') === HTTP_STATUS.UNAUTHENTICATED) {
|
||||
store.dispatch(logoutSuccess);
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/* eslint-disable no-unused-vars */
|
||||
import { get } from 'lodash';
|
||||
import { endsWith, get } from 'lodash';
|
||||
import { push } from 'react-router-redux';
|
||||
|
||||
import APP_CONSTANTS from 'app_constants';
|
||||
|
@ -9,7 +9,7 @@ const { HTTP_STATUS, PATHS } = APP_CONSTANTS;
|
|||
const redirectMiddleware = store => next => (action) => {
|
||||
const { type, payload } = action;
|
||||
|
||||
if (type.endsWith('FAILURE')) {
|
||||
if (endsWith(type, 'FAILURE')) {
|
||||
const httpStatus = get(payload, 'errors.http_status');
|
||||
|
||||
if (HTTP_STATUS.INTERNAL_ERROR.test(httpStatus)) {
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
import Es6ObjectAssign from 'es6-object-assign';
|
||||
import Es6Promise from 'es6-promise';
|
||||
|
||||
import { applyMiddleware, compose, createStore } from 'redux';
|
||||
import { browserHistory } from 'react-router';
|
||||
import { loadingBarMiddleware } from 'react-redux-loading-bar';
|
||||
|
@ -9,6 +12,10 @@ import nagMessageMiddleware from './middlewares/nag_message';
|
|||
import redirectMiddleware from './middlewares/redirect';
|
||||
import reducers from './reducers';
|
||||
|
||||
// ie polyfills
|
||||
Es6ObjectAssign.polyfill();
|
||||
Es6Promise.polyfill();
|
||||
|
||||
const initialState = {};
|
||||
|
||||
const appliedMiddleware = applyMiddleware(
|
||||
|
|
|
@ -30,7 +30,8 @@
|
|||
"css-loader": "^0.23.1",
|
||||
"cssrecipes-defaults": "^0.5.0",
|
||||
"enzyme": "^2.4.1",
|
||||
"es6-promise": "^3.2.1",
|
||||
"es6-object-assign": "^1.0.3",
|
||||
"es6-promise": "^4.0.5",
|
||||
"expect": "^1.20.2",
|
||||
"expose-loader": "^0.7.1",
|
||||
"express": "^4.13.4",
|
||||
|
|
10
yarn.lock
10
yarn.lock
|
@ -2002,9 +2002,13 @@ es6-map@^0.1.3:
|
|||
es6-symbol "~3.1.0"
|
||||
event-emitter "~0.3.4"
|
||||
|
||||
es6-promise@^3.2.1:
|
||||
version "3.3.1"
|
||||
resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-3.3.1.tgz#a08cdde84ccdbf34d027a1451bc91d4bcd28a613"
|
||||
es6-object-assign@^1.0.3:
|
||||
version "1.0.3"
|
||||
resolved "https://registry.yarnpkg.com/es6-object-assign/-/es6-object-assign-1.0.3.tgz#40a192e0fda5ee44ee8cf6f5b5d9b47cd0f69b14"
|
||||
|
||||
es6-promise@^4.0.5:
|
||||
version "4.0.5"
|
||||
resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.0.5.tgz#7882f30adde5b240ccfa7f7d78c548330951ae42"
|
||||
|
||||
es6-set@^0.1.4, es6-set@~0.1.3:
|
||||
version "0.1.4"
|
||||
|
|
Загрузка…
Ссылка в новой задаче