Upgrade frontend-app-account to latest frontend-auth and frontend-logging. (#16)

This commit is contained in:
David Joy
2019-05-02 16:05:31 -04:00
committed by GitHub
parent 02c55b6e59
commit 884906ac06
4 changed files with 61 additions and 32 deletions

73
package-lock.json generated
View File

@@ -1026,10 +1026,11 @@
}
},
"@edx/frontend-auth": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/@edx/frontend-auth/-/frontend-auth-4.0.0.tgz",
"integrity": "sha512-nWbdq9c3WDzNyIA16MI9jRMaSbUn4lMUA1gLi1xmxxviR9Kppm6Ne6vZpCpo0p18X2kcWsfEnEprTfRg1i+5Ew==",
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/@edx/frontend-auth/-/frontend-auth-5.1.1.tgz",
"integrity": "sha512-bkPTzSr4EO4VuceM+2Aks/fqoSfnUr/MWxkRS2WNNCrvLRhW26aG5eK3z6UtPCYS2CiUpflt6lJc5CQXBrAksA==",
"requires": {
"@edx/frontend-logging": "^2.0.0",
"axios": "^0.18.0",
"camelcase-keys": "^5.0.0",
"jwt-decode": "^2.2.0",
@@ -1054,9 +1055,9 @@
}
},
"@edx/frontend-logging": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/@edx/frontend-logging/-/frontend-logging-1.0.2.tgz",
"integrity": "sha512-1djcoIfT2rqqnGDTBPwuQOekgtKyk9lwriKAC2oFJeqvDhmMmqSnWUTEJde4/UiZbV7zhEMJ6GPnF9LH5bsadg=="
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/@edx/frontend-logging/-/frontend-logging-2.0.0.tgz",
"integrity": "sha512-/nzaWXSD93YNhpXCwn9pjjoAMX69Jch4yU2qEkSJYEoQAwvHMlkIDLHsazwi3l1TqFBbeGulGCV8fi/GF6Uvqw=="
},
"@edx/paragon": {
"version": "4.1.3",
@@ -4310,9 +4311,9 @@
"integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg=="
},
"camelcase-keys": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-5.1.0.tgz",
"integrity": "sha512-eZJ8mFhctds8vW/Lo/a2CXFrCEzJurUU05Tx2ReiXaW4aVBJBNxOvtGHf/GQdjHMQTZE11FCRhrdRlM4Se5umA==",
"version": "5.2.0",
"resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-5.2.0.tgz",
"integrity": "sha512-mSM/OQKD1HS5Ll2AXxeaHSdqCGC/QQ8IrgTbKYA/rxnC36thBKysfIr9+OVBWuW17jyZF4swHkjtglawgBmVFg==",
"requires": {
"camelcase": "^5.3.1",
"map-obj": "^3.0.0",
@@ -8574,7 +8575,8 @@
"ansi-regex": {
"version": "2.1.1",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"aproba": {
"version": "1.2.0",
@@ -8595,12 +8597,14 @@
"balanced-match": {
"version": "1.0.0",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"brace-expansion": {
"version": "1.1.11",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
@@ -8615,17 +8619,20 @@
"code-point-at": {
"version": "1.1.0",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"concat-map": {
"version": "0.0.1",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"console-control-strings": {
"version": "1.1.0",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"core-util-is": {
"version": "1.0.2",
@@ -8742,7 +8749,8 @@
"inherits": {
"version": "2.0.3",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"ini": {
"version": "1.3.5",
@@ -8754,6 +8762,7 @@
"version": "1.0.0",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"number-is-nan": "^1.0.0"
}
@@ -8768,6 +8777,7 @@
"version": "3.0.4",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"brace-expansion": "^1.1.7"
}
@@ -8775,12 +8785,14 @@
"minimist": {
"version": "0.0.8",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"minipass": {
"version": "2.3.5",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"safe-buffer": "^5.1.2",
"yallist": "^3.0.0"
@@ -8799,6 +8811,7 @@
"version": "0.5.1",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"minimist": "0.0.8"
}
@@ -8879,7 +8892,8 @@
"number-is-nan": {
"version": "1.0.1",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"object-assign": {
"version": "4.1.1",
@@ -8891,6 +8905,7 @@
"version": "1.4.0",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"wrappy": "1"
}
@@ -8976,7 +8991,8 @@
"safe-buffer": {
"version": "5.1.2",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"safer-buffer": {
"version": "2.1.2",
@@ -9012,6 +9028,7 @@
"version": "1.0.2",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0",
@@ -9031,6 +9048,7 @@
"version": "3.0.1",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"ansi-regex": "^2.0.0"
}
@@ -9074,12 +9092,14 @@
"wrappy": {
"version": "1.0.2",
"bundled": true,
"dev": true
"dev": true,
"optional": true
},
"yallist": {
"version": "3.0.3",
"bundled": true,
"dev": true
"dev": true,
"optional": true
}
}
},
@@ -12272,9 +12292,9 @@
"dev": true
},
"map-obj": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/map-obj/-/map-obj-3.0.0.tgz",
"integrity": "sha512-Ot+2wruG8WqTbJngDxz0Ifm03y2pO4iL+brq/l+yEkGjUza03BnMQqX2XT//Jls8MOOl2VTHviAoLX+/nq/HXw=="
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/map-obj/-/map-obj-3.1.0.tgz",
"integrity": "sha512-Xg1iyYz/+iIW6YoMldux47H/e5QZyDSB41Kb0ev+YYHh3FJnyyzY0vTk/WbVeWcCvdXd70cOriUBmhP8alUFBA=="
},
"map-visit": {
"version": "1.0.0",
@@ -17598,6 +17618,13 @@
"requires": {
"map-obj": "~3.0.0",
"to-snake-case": "~1.0.0"
},
"dependencies": {
"map-obj": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/map-obj/-/map-obj-3.0.0.tgz",
"integrity": "sha512-Ot+2wruG8WqTbJngDxz0Ifm03y2pO4iL+brq/l+yEkGjUza03BnMQqX2XT//Jls8MOOl2VTHviAoLX+/nq/HXw=="
}
}
},
"snapdragon": {

View File

@@ -27,10 +27,10 @@
"@cospired/i18n-iso-languages": "^2.0.2",
"@edx/edx-bootstrap": "^2.0.1",
"@edx/frontend-analytics": "^1.0.0",
"@edx/frontend-auth": "^4.0.0",
"@edx/frontend-auth": "^5.0.0",
"@edx/frontend-component-footer": "^2.0.3",
"@edx/frontend-component-site-header": "^2.1.4",
"@edx/frontend-logging": "^1.0.2",
"@edx/frontend-logging": "^2.0.0",
"@edx/paragon": "^4.1.3",
"@fortawesome/fontawesome-svg-core": "^1.2.17",
"@fortawesome/free-brands-svg-icons": "^5.7.2",

View File

@@ -1,7 +1,7 @@
import { call, put, delay, takeEvery, select } from 'redux-saga/effects';
import { push } from 'connected-react-router';
import LoggingService from '@edx/frontend-logging';
import { logAPIErrorResponse } from '@edx/frontend-logging';
// Actions
import {
@@ -35,7 +35,7 @@ export function* handleFetchAccount() {
const values = yield call(ApiService.getAccount, username);
yield put(fetchAccountSuccess(values));
} catch (e) {
LoggingService.logAPIErrorResponse(e);
logAPIErrorResponse(e);
yield put(fetchAccountFailure(e.message));
yield put(push('/error'));
}
@@ -56,7 +56,7 @@ export function* handleSaveAccount(action) {
if (e.fieldErrors) {
yield put(saveAccountFailure({ fieldErrors: e.fieldErrors }));
} else {
LoggingService.logAPIErrorResponse(e);
logAPIErrorResponse(e);
yield put(saveAccountFailure(e.message));
yield put(push('/error'));
}
@@ -69,7 +69,7 @@ export function* handleResetPassword() {
const response = yield call(ApiService.postResetPassword);
yield put(resetPasswordSuccess(response));
} catch (e) {
LoggingService.logAPIErrorResponse(e);
logAPIErrorResponse(e);
yield put(push('/error'));
}
}
@@ -80,7 +80,7 @@ export function* handleFetchThirdPartyAuthProviders() {
const authProviders = yield call(ApiService.getThirdPartyAuthProviders);
yield put(fetchThirdPartyAuthProvidersSuccess(authProviders));
} catch (e) {
LoggingService.logAPIErrorResponse(e);
logAPIErrorResponse(e);
yield put(fetchThirdPartyAuthProvidersFailure(e.message));
yield put(push('/error'));
}

View File

@@ -2,7 +2,7 @@ import 'babel-polyfill';
import React from 'react';
import ReactDOM from 'react-dom';
import { identifyAuthenticatedUser, sendPageEvent, configureAnalytics, initializeSegment } from '@edx/frontend-analytics';
import LoggingService from '@edx/frontend-logging';
import { configureLoggingService, NewRelicLoggingService } from '@edx/frontend-logging';
import { getAuthenticatedAPIClient } from '@edx/frontend-auth';
import { configuration } from './environment';
@@ -24,6 +24,7 @@ const apiClient = getAuthenticatedAPIClient({
accessTokenCookieName: configuration.ACCESS_TOKEN_COOKIE_NAME,
userInfoCookieName: configuration.USER_INFO_COOKIE_NAME,
csrfCookieName: configuration.CSRF_COOKIE_NAME,
loggingService: NewRelicLoggingService,
});
/**
@@ -37,11 +38,12 @@ function createInitialState() {
function configure() {
const { store, history } = configureStore(createInitialState(), configuration.ENVIRONMENT);
configureLoggingService(NewRelicLoggingService);
configureAccountSettingsApiService(configuration, apiClient);
configureUserAccountApiService(configuration, apiClient);
initializeSegment(configuration.SEGMENT_KEY);
configureAnalytics({
loggingService: LoggingService,
loggingService: NewRelicLoggingService,
authApiClient: apiClient,
analyticsApiBaseUrl: configuration.LMS_BASE_URL,
});