@edx/frontend-platform 4.2.0 → 4.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -9
- package/analytics/MockAnalyticsService.js.map +1 -1
- package/analytics/SegmentAnalyticsService.js.map +1 -1
- package/auth/AxiosCsrfTokenService.js.map +1 -1
- package/auth/AxiosJwtAuthService.js +5 -0
- package/auth/AxiosJwtAuthService.js.map +1 -1
- package/auth/AxiosJwtTokenService.js.map +1 -1
- package/auth/LocalForageCache.js.map +1 -1
- package/auth/MockAuthService.js.map +1 -1
- package/auth/interceptors/createCsrfTokenProviderInterceptor.js.map +1 -1
- package/auth/interceptors/createJwtTokenProviderInterceptor.js.map +1 -1
- package/auth/interceptors/createRetryInterceptor.js.map +1 -1
- package/auth/interface.js.map +1 -1
- package/auth/utils.js +3 -3
- package/auth/utils.js.map +1 -1
- package/config.js.map +1 -1
- package/i18n/countries.js.map +1 -1
- package/i18n/injectIntlWithShim.js.map +1 -1
- package/i18n/languages.js.map +1 -1
- package/i18n/lib.js.map +1 -1
- package/i18n/scripts/intl-imports.js.map +1 -1
- package/i18n/scripts/transifex-utils.js.map +1 -1
- package/initialize.js.map +1 -1
- package/logging/MockLoggingService.js +6 -0
- package/logging/MockLoggingService.js.map +1 -1
- package/logging/NewRelicLoggingService.js +27 -2
- package/logging/NewRelicLoggingService.js.map +1 -1
- package/logging/interface.js +10 -0
- package/logging/interface.js.map +1 -1
- package/package.json +5 -5
- package/react/AppProvider.js.map +1 -1
- package/react/AuthenticatedPageRoute.js.map +1 -1
- package/react/ErrorBoundary.js.map +1 -1
- package/react/ErrorPage.js.map +1 -1
- package/react/OptionalReduxProvider.js.map +1 -1
- package/react/PageRoute.js.map +1 -1
- package/testing/initializeMockApp.js.map +1 -1
- package/utils.js.map +1 -1
package/initialize.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initialize.js","names":["_regeneratorRuntime","exports","Op","Object","prototype","hasOwn","hasOwnProperty","defineProperty","obj","key","desc","value","$Symbol","Symbol","iteratorSymbol","iterator","asyncIteratorSymbol","asyncIterator","toStringTagSymbol","toStringTag","define","enumerable","configurable","writable","err","wrap","innerFn","outerFn","self","tryLocsList","protoGenerator","Generator","generator","create","context","Context","makeInvokeMethod","tryCatch","fn","arg","type","call","ContinueSentinel","GeneratorFunction","GeneratorFunctionPrototype","IteratorPrototype","getProto","getPrototypeOf","NativeIteratorPrototype","values","Gp","defineIteratorMethods","forEach","method","_invoke","AsyncIterator","PromiseImpl","invoke","resolve","reject","record","result","_typeof","__await","then","unwrapped","error","previousPromise","callInvokeWithMethodAndArg","state","Error","doneResult","delegate","delegateResult","maybeInvokeDelegate","sent","_sent","dispatchException","abrupt","done","methodName","undefined","TypeError","info","resultName","next","nextLoc","pushTryEntry","locs","entry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","push","resetTryEntry","completion","reset","iterable","iteratorMethod","isNaN","length","i","displayName","isGeneratorFunction","genFun","ctor","constructor","name","mark","setPrototypeOf","__proto__","awrap","async","Promise","iter","keys","val","object","reverse","pop","skipTempReset","prev","charAt","slice","stop","rootRecord","rval","exception","handle","loc","caught","hasCatch","hasFinally","finallyEntry","complete","finish","_catch","thrown","delegateYield","asyncGeneratorStep","gen","_next","_throw","_asyncToGenerator","args","arguments","apply","createBrowserHistory","createMemoryHistory","publish","getConfig","mergeConfig","configure","configureLogging","getLoggingService","NewRelicLoggingService","logError","configureAnalytics","SegmentAnalyticsService","identifyAnonymousUser","identifyAuthenticatedUser","GoogleAnalyticsLoader","getAuthenticatedHttpClient","configureAuth","ensureAuthenticatedUser","fetchAuthenticatedUser","hydrateAuthenticatedUser","getAuthenticatedUser","AxiosJwtAuthService","configureI18n","APP_PUBSUB_INITIALIZED","APP_CONFIG_INITIALIZED","APP_AUTH_INITIALIZED","APP_I18N_INITIALIZED","APP_LOGGING_INITIALIZED","APP_ANALYTICS_INITIALIZED","APP_READY","APP_INIT_ERROR","configureCache","history","window","basename","PUBLIC_PATH","initError","_x","_initError","_callee2","_callee2$","_context2","auth","_x2","_x3","_auth","_callee3","requireUser","hydrateUser","_callee3$","_context3","global","location","href","runtimeConfig","_runtimeConfig","_callee4","_getConfig","MFE_CONFIG_API_URL","APP_ID","apiConfig","apiService","params","url","_yield$apiService$get","data","_callee4$","_context4","headers","accept","URLSearchParams","append","concat","toString","get","t0","console","message","loadExternalScripts","externalScripts","ExternalScript","script","loadScript","analytics","_analytics","_callee5","authenticatedUser","_callee5$","_context5","userId","applyOverrideHandlers","overrides","noOp","_ref","_callee","_callee$","_context","_objectSpread","pubSub","config","logging","i18n","ready","initialize","_x4","_initialize","_callee6","_ref2","_ref2$loggingService","loggingService","_ref2$analyticsServic","analyticsService","_ref2$authService","authService","_ref2$authMiddleware","authMiddleware","_ref2$externalScripts","_ref2$requireAuthenti","_ref2$hydrateAuthenti","messages","_ref2$handlers","overrideHandlers","handlers","_callee6$","_context6","requireAuthenticatedUser","middleware","httpClient","isRedirecting"],"sources":["../src/initialize.js"],"sourcesContent":["/**\n * #### Import members from **@edx/frontend-platform**\n *\n * The initialization module provides a function for managing an application's initialization\n * lifecycle. It also provides constants and default handler implementations.\n *\n * ```\n * import {\n * initialize,\n * APP_INIT_ERROR,\n * APP_READY,\n * subscribe,\n * } from '@edx/frontend-platform';\n * import { AppProvider, ErrorPage, PageRoute } from '@edx/frontend-platform/react';\n * import React from 'react';\n * import ReactDOM from 'react-dom';\n * import { Switch } from 'react-router-dom';\n *\n * subscribe(APP_READY, () => {\n * ReactDOM.render(\n * <AppProvider store={configureStore()}>\n * <Header />\n * <main>\n * <Switch>\n * <PageRoute exact path=\"/\" component={PaymentPage} />\n * </Switch>\n * </main>\n * <Footer />\n * </AppProvider>,\n * document.getElementById('root'),\n * );\n * });\n *\n * subscribe(APP_INIT_ERROR, (error) => {\n * ReactDOM.render(<ErrorPage message={error.message} />, document.getElementById('root'));\n * });\n *\n * initialize({\n * messages: [appMessages],\n * requireAuthenticatedUser: true,\n * hydrateAuthenticatedUser: true,\n * });\n\n```\n * @module Initialization\n */\n\nimport { createBrowserHistory, createMemoryHistory } from 'history';\nimport {\n publish,\n} from './pubSub';\n// eslint-disable-next-line import/no-cycle\nimport {\n getConfig, mergeConfig,\n} from './config';\nimport {\n configure as configureLogging, getLoggingService, NewRelicLoggingService, logError,\n} from './logging';\nimport {\n configure as configureAnalytics, SegmentAnalyticsService, identifyAnonymousUser, identifyAuthenticatedUser,\n} from './analytics';\nimport { GoogleAnalyticsLoader } from './scripts';\nimport {\n getAuthenticatedHttpClient,\n configure as configureAuth,\n ensureAuthenticatedUser,\n fetchAuthenticatedUser,\n hydrateAuthenticatedUser,\n getAuthenticatedUser,\n AxiosJwtAuthService,\n} from './auth';\nimport { configure as configureI18n } from './i18n';\nimport {\n APP_PUBSUB_INITIALIZED,\n APP_CONFIG_INITIALIZED,\n APP_AUTH_INITIALIZED,\n APP_I18N_INITIALIZED,\n APP_LOGGING_INITIALIZED,\n APP_ANALYTICS_INITIALIZED,\n APP_READY, APP_INIT_ERROR,\n} from './constants';\nimport configureCache from './auth/LocalForageCache';\n\n/**\n * A browser history or memory history object created by the [history](https://github.com/ReactTraining/history)\n * package. Applications are encouraged to use this history object, rather than creating their own,\n * as behavior may be undefined when managing history via multiple mechanisms/instances. Note that\n * in environments where browser history may be inaccessible due to `window` being undefined, this\n * falls back to memory history.\n */\nexport const history = (typeof window !== 'undefined')\n ? createBrowserHistory({\n basename: getConfig().PUBLIC_PATH,\n }) : createMemoryHistory();\n\n/**\n * The default handler for the initialization lifecycle's `initError` phase. Logs the error to the\n * LoggingService using `logError`\n *\n * @see {@link module:frontend-platform/logging~logError}\n * @param {*} error\n */\nexport async function initError(error) {\n logError(error);\n}\n\n/**\n * The default handler for the initialization lifecycle's `auth` phase.\n *\n * The handler has several responsibilities:\n * - Determining the user's authentication state (authenticated or anonymous)\n * - Optionally redirecting to login if the application requires an authenticated user.\n * - Optionally loading additional user information via the application's user account data\n * endpoint.\n *\n * @param {boolean} requireUser Whether or not we should redirect to login if a user is not\n * authenticated.\n * @param {boolean} hydrateUser Whether or not we should fetch additional user account data.\n */\nexport async function auth(requireUser, hydrateUser) {\n if (requireUser) {\n await ensureAuthenticatedUser(global.location.href);\n } else {\n await fetchAuthenticatedUser();\n }\n\n if (hydrateUser && getAuthenticatedUser() !== null) {\n // We intentionally do not await the promise returned by hydrateAuthenticatedUser. All the\n // critical data is returned as part of fetch/ensureAuthenticatedUser above, and anything else\n // is a nice-to-have for application code.\n hydrateAuthenticatedUser();\n }\n}\n/*\n * Set or overrides configuration through an API.\n * This method allows runtime configuration.\n * Set a basic configuration when an error happen and allow initError and display the ErrorPage.\n */\n\nexport async function runtimeConfig() {\n try {\n const { MFE_CONFIG_API_URL, APP_ID } = getConfig();\n\n if (MFE_CONFIG_API_URL) {\n const apiConfig = { headers: { accept: 'application/json' } };\n const apiService = await configureCache();\n\n const params = new URLSearchParams();\n params.append('mfe', APP_ID);\n const url = `${MFE_CONFIG_API_URL}?${params.toString()}`;\n\n const { data } = await apiService.get(url, apiConfig);\n mergeConfig(data);\n }\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error('Error with config API', error.message);\n }\n}\n\nexport function loadExternalScripts(externalScripts, data) {\n externalScripts.forEach(ExternalScript => {\n const script = new ExternalScript(data);\n script.loadScript();\n });\n}\n\n/**\n * The default handler for the initialization lifecycle's `analytics` phase.\n *\n * The handler is responsible for identifying authenticated and anonymous users with the analytics\n * service. This is a pre-requisite for sending analytics events, thus, we do it during the\n * initialization sequence so that analytics is ready once the application's UI code starts to load.\n *\n */\nexport async function analytics() {\n const authenticatedUser = getAuthenticatedUser();\n if (authenticatedUser && authenticatedUser.userId) {\n identifyAuthenticatedUser(authenticatedUser.userId);\n } else {\n await identifyAnonymousUser();\n }\n}\n\nfunction applyOverrideHandlers(overrides) {\n const noOp = async () => { };\n return {\n pubSub: noOp,\n config: noOp,\n logging: noOp,\n auth,\n analytics,\n i18n: noOp,\n ready: noOp,\n initError,\n ...overrides, // This will override any same-keyed handlers from above.\n };\n}\n\n/**\n * Invokes the application initialization sequence.\n *\n * The sequence proceeds through a number of lifecycle phases, during which pertinent services are\n * configured.\n *\n * Using the `handlers` option, lifecycle phase handlers can be overridden to perform custom\n * functionality. Note that while these override handlers _do_ replace the default handler\n * functionality for analytics, auth, and initError (the other phases have no default\n * functionality), they do _not_ override the configuration of the actual services that those\n * handlers leverage.\n *\n * Some services can be overridden via the loggingService and analyticsService options. The other\n * services (auth and i18n) cannot currently be overridden.\n *\n * The following lifecycle phases exist:\n *\n * - pubSub: A no-op by default.\n * - config: A no-op by default.\n * - logging: A no-op by default.\n * - auth: Uses the 'auth' handler defined above.\n * - analytics: Uses the 'analytics' handler defined above.\n * - i18n: A no-op by default.\n * - ready: A no-op by default.\n * - initError: Uses the 'initError' handler defined above.\n *\n * @param {Object} [options]\n * @param {*} [options.loggingService=NewRelicLoggingService] The `LoggingService` implementation\n * to use.\n * @param {*} [options.analyticsService=SegmentAnalyticsService] The `AnalyticsService`\n * implementation to use.\n * @param {*} [options.authMiddleware=[]] An array of middleware to apply to http clients in the auth service.\n * @param {*} [options.externalScripts=[GoogleAnalyticsLoader]] An array of externalScripts.\n * By default added GoogleAnalyticsLoader.\n * @param {*} [options.requireAuthenticatedUser=false] If true, turns on automatic login\n * redirection for unauthenticated users. Defaults to false, meaning that by default the\n * application will allow anonymous/unauthenticated sessions.\n * @param {*} [options.hydrateAuthenticatedUser=false] If true, makes an API call to the user\n * account endpoint (`${App.config.LMS_BASE_URL}/api/user/v1/accounts/${username}`) to fetch\n * detailed account information for the authenticated user. This data is merged into the return\n * value of `getAuthenticatedUser`, overriding any duplicate keys that already exist. Defaults to\n * false, meaning that no additional account information will be loaded.\n * @param {*} [options.messages] A i18n-compatible messages object, or an array of such objects. If\n * an array is provided, duplicate keys are resolved with the last-one-in winning.\n * @param {*} [options.handlers={}] An optional object of handlers which can be used to replace the\n * default behavior of any part of the startup sequence. It can also be used to add additional\n * initialization behavior before or after the rest of the sequence.\n */\nexport async function initialize({\n loggingService = NewRelicLoggingService,\n analyticsService = SegmentAnalyticsService,\n authService = AxiosJwtAuthService,\n authMiddleware = [],\n externalScripts = [GoogleAnalyticsLoader],\n requireAuthenticatedUser: requireUser = false,\n hydrateAuthenticatedUser: hydrateUser = false,\n messages,\n handlers: overrideHandlers = {},\n}) {\n const handlers = applyOverrideHandlers(overrideHandlers);\n try {\n // Pub/Sub\n await handlers.pubSub();\n publish(APP_PUBSUB_INITIALIZED);\n\n // Configuration\n await handlers.config();\n await runtimeConfig();\n publish(APP_CONFIG_INITIALIZED);\n\n loadExternalScripts(externalScripts, {\n config: getConfig(),\n });\n\n // Logging\n configureLogging(loggingService, {\n config: getConfig(),\n });\n await handlers.logging();\n publish(APP_LOGGING_INITIALIZED);\n\n // Authentication\n configureAuth(authService, {\n loggingService: getLoggingService(),\n config: getConfig(),\n middleware: authMiddleware,\n });\n\n await handlers.auth(requireUser, hydrateUser);\n publish(APP_AUTH_INITIALIZED);\n\n // Analytics\n configureAnalytics(analyticsService, {\n config: getConfig(),\n loggingService: getLoggingService(),\n httpClient: getAuthenticatedHttpClient(),\n });\n await handlers.analytics();\n publish(APP_ANALYTICS_INITIALIZED);\n\n // Internationalization\n configureI18n({\n messages,\n config: getConfig(),\n loggingService: getLoggingService(),\n });\n await handlers.i18n();\n publish(APP_I18N_INITIALIZED);\n\n // Application Ready\n await handlers.ready();\n publish(APP_READY);\n } catch (error) {\n if (!error.isRedirecting) {\n // Initialization Error\n await handlers.initError(error);\n publish(APP_INIT_ERROR, error);\n }\n }\n}\n"],"mappings":";;;;;;+CACA,qJAAAA,mBAAA,YAAAA,oBAAA,WAAAC,OAAA,SAAAA,OAAA,OAAAC,EAAA,GAAAC,MAAA,CAAAC,SAAA,EAAAC,MAAA,GAAAH,EAAA,CAAAI,cAAA,EAAAC,cAAA,GAAAJ,MAAA,CAAAI,cAAA,cAAAC,GAAA,EAAAC,GAAA,EAAAC,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B,oBAAoB,CAAC;;UAE7B;UAAAkG,SAAA,CAAA5L,IAAA;UAAA,OACM0L,QAAQ,CAACpB,KAAK,EAAE;QAAA;UACtBpG,OAAO,CAAC2B,SAAS,CAAC;UAAC+F,SAAA,CAAA5L,IAAA;UAAA;QAAA;UAAA4L,SAAA,CAAAtJ,IAAA;UAAAsJ,SAAA,CAAAjD,EAAA,GAAAiD,SAAA;UAAA,IAEdA,SAAA,CAAAjD,EAAA,CAAMqD,aAAa;YAAAJ,SAAA,CAAA5L,IAAA;YAAA;UAAA;UAAA4L,SAAA,CAAA5L,IAAA;UAAA,OAEhB0L,QAAQ,CAACtF,SAAS,CAAAwF,SAAA,CAAAjD,EAAA,CAAO;QAAA;UAC/BzE,OAAO,CAAC4B,cAAc,EAAA8F,SAAA,CAAAjD,EAAA,CAAQ;QAAC;QAAA;UAAA,OAAAiD,SAAA,CAAAnJ,IAAA;MAAA;IAAA,GAAAiI,QAAA;EAAA,CAGpC;EAAA,OAAAD,WAAA,CAAA1G,KAAA,OAAAD,SAAA;AAAA"}
|
|
1
|
+
{"version":3,"file":"initialize.js","names":["_regeneratorRuntime","exports","Op","Object","prototype","hasOwn","hasOwnProperty","defineProperty","obj","key","desc","value","$Symbol","Symbol","iteratorSymbol","iterator","asyncIteratorSymbol","asyncIterator","toStringTagSymbol","toStringTag","define","enumerable","configurable","writable","err","wrap","innerFn","outerFn","self","tryLocsList","protoGenerator","Generator","generator","create","context","Context","makeInvokeMethod","tryCatch","fn","arg","type","call","ContinueSentinel","GeneratorFunction","GeneratorFunctionPrototype","IteratorPrototype","getProto","getPrototypeOf","NativeIteratorPrototype","values","Gp","defineIteratorMethods","forEach","method","_invoke","AsyncIterator","PromiseImpl","invoke","resolve","reject","record","result","_typeof","__await","then","unwrapped","error","previousPromise","callInvokeWithMethodAndArg","state","Error","doneResult","delegate","delegateResult","maybeInvokeDelegate","sent","_sent","dispatchException","abrupt","done","methodName","undefined","TypeError","info","resultName","next","nextLoc","pushTryEntry","locs","entry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","push","resetTryEntry","completion","reset","iterable","iteratorMethod","isNaN","length","i","displayName","isGeneratorFunction","genFun","ctor","constructor","name","mark","setPrototypeOf","__proto__","awrap","async","Promise","iter","keys","val","object","reverse","pop","skipTempReset","prev","charAt","slice","stop","rootRecord","rval","exception","handle","loc","caught","hasCatch","hasFinally","finallyEntry","complete","finish","_catch","thrown","delegateYield","asyncGeneratorStep","gen","_next","_throw","_asyncToGenerator","args","arguments","apply","createBrowserHistory","createMemoryHistory","publish","getConfig","mergeConfig","configure","configureLogging","getLoggingService","NewRelicLoggingService","logError","configureAnalytics","SegmentAnalyticsService","identifyAnonymousUser","identifyAuthenticatedUser","GoogleAnalyticsLoader","getAuthenticatedHttpClient","configureAuth","ensureAuthenticatedUser","fetchAuthenticatedUser","hydrateAuthenticatedUser","getAuthenticatedUser","AxiosJwtAuthService","configureI18n","APP_PUBSUB_INITIALIZED","APP_CONFIG_INITIALIZED","APP_AUTH_INITIALIZED","APP_I18N_INITIALIZED","APP_LOGGING_INITIALIZED","APP_ANALYTICS_INITIALIZED","APP_READY","APP_INIT_ERROR","configureCache","history","window","basename","PUBLIC_PATH","initError","_x","_initError","_callee2","_callee2$","_context2","auth","_x2","_x3","_auth","_callee3","requireUser","hydrateUser","_callee3$","_context3","global","location","href","runtimeConfig","_runtimeConfig","_callee4","_getConfig","MFE_CONFIG_API_URL","APP_ID","apiConfig","apiService","params","url","_yield$apiService$get","data","_callee4$","_context4","headers","accept","URLSearchParams","append","concat","toString","get","t0","console","message","loadExternalScripts","externalScripts","ExternalScript","script","loadScript","analytics","_analytics","_callee5","authenticatedUser","_callee5$","_context5","userId","applyOverrideHandlers","overrides","noOp","_ref","_callee","_callee$","_context","_objectSpread","pubSub","config","logging","i18n","ready","initialize","_x4","_initialize","_callee6","_ref2","_ref2$loggingService","loggingService","_ref2$analyticsServic","analyticsService","_ref2$authService","authService","_ref2$authMiddleware","authMiddleware","_ref2$externalScripts","_ref2$requireAuthenti","_ref2$hydrateAuthenti","messages","_ref2$handlers","overrideHandlers","handlers","_callee6$","_context6","requireAuthenticatedUser","middleware","httpClient","isRedirecting"],"sources":["../src/initialize.js"],"sourcesContent":["/**\n * #### Import members from **@edx/frontend-platform**\n *\n * The initialization module provides a function for managing an application's initialization\n * lifecycle. It also provides constants and default handler implementations.\n *\n * ```\n * import {\n * initialize,\n * APP_INIT_ERROR,\n * APP_READY,\n * subscribe,\n * } from '@edx/frontend-platform';\n * import { AppProvider, ErrorPage, PageRoute } from '@edx/frontend-platform/react';\n * import React from 'react';\n * import ReactDOM from 'react-dom';\n * import { Switch } from 'react-router-dom';\n *\n * subscribe(APP_READY, () => {\n * ReactDOM.render(\n * <AppProvider store={configureStore()}>\n * <Header />\n * <main>\n * <Switch>\n * <PageRoute exact path=\"/\" component={PaymentPage} />\n * </Switch>\n * </main>\n * <Footer />\n * </AppProvider>,\n * document.getElementById('root'),\n * );\n * });\n *\n * subscribe(APP_INIT_ERROR, (error) => {\n * ReactDOM.render(<ErrorPage message={error.message} />, document.getElementById('root'));\n * });\n *\n * initialize({\n * messages: [appMessages],\n * requireAuthenticatedUser: true,\n * hydrateAuthenticatedUser: true,\n * });\n\n```\n * @module Initialization\n */\n\nimport { createBrowserHistory, createMemoryHistory } from 'history';\nimport {\n publish,\n} from './pubSub';\n// eslint-disable-next-line import/no-cycle\nimport {\n getConfig, mergeConfig,\n} from './config';\nimport {\n configure as configureLogging, getLoggingService, NewRelicLoggingService, logError,\n} from './logging';\nimport {\n configure as configureAnalytics, SegmentAnalyticsService, identifyAnonymousUser, identifyAuthenticatedUser,\n} from './analytics';\nimport { GoogleAnalyticsLoader } from './scripts';\nimport {\n getAuthenticatedHttpClient,\n configure as configureAuth,\n ensureAuthenticatedUser,\n fetchAuthenticatedUser,\n hydrateAuthenticatedUser,\n getAuthenticatedUser,\n AxiosJwtAuthService,\n} from './auth';\nimport { configure as configureI18n } from './i18n';\nimport {\n APP_PUBSUB_INITIALIZED,\n APP_CONFIG_INITIALIZED,\n APP_AUTH_INITIALIZED,\n APP_I18N_INITIALIZED,\n APP_LOGGING_INITIALIZED,\n APP_ANALYTICS_INITIALIZED,\n APP_READY, APP_INIT_ERROR,\n} from './constants';\nimport configureCache from './auth/LocalForageCache';\n\n/**\n * A browser history or memory history object created by the [history](https://github.com/ReactTraining/history)\n * package. Applications are encouraged to use this history object, rather than creating their own,\n * as behavior may be undefined when managing history via multiple mechanisms/instances. Note that\n * in environments where browser history may be inaccessible due to `window` being undefined, this\n * falls back to memory history.\n */\nexport const history = (typeof window !== 'undefined')\n ? createBrowserHistory({\n basename: getConfig().PUBLIC_PATH,\n }) : createMemoryHistory();\n\n/**\n * The default handler for the initialization lifecycle's `initError` phase. Logs the error to the\n * LoggingService using `logError`\n *\n * @see {@link module:frontend-platform/logging~logError}\n * @param {*} error\n */\nexport async function initError(error) {\n logError(error);\n}\n\n/**\n * The default handler for the initialization lifecycle's `auth` phase.\n *\n * The handler has several responsibilities:\n * - Determining the user's authentication state (authenticated or anonymous)\n * - Optionally redirecting to login if the application requires an authenticated user.\n * - Optionally loading additional user information via the application's user account data\n * endpoint.\n *\n * @param {boolean} requireUser Whether or not we should redirect to login if a user is not\n * authenticated.\n * @param {boolean} hydrateUser Whether or not we should fetch additional user account data.\n */\nexport async function auth(requireUser, hydrateUser) {\n if (requireUser) {\n await ensureAuthenticatedUser(global.location.href);\n } else {\n await fetchAuthenticatedUser();\n }\n\n if (hydrateUser && getAuthenticatedUser() !== null) {\n // We intentionally do not await the promise returned by hydrateAuthenticatedUser. All the\n // critical data is returned as part of fetch/ensureAuthenticatedUser above, and anything else\n // is a nice-to-have for application code.\n hydrateAuthenticatedUser();\n }\n}\n/*\n * Set or overrides configuration through an API.\n * This method allows runtime configuration.\n * Set a basic configuration when an error happen and allow initError and display the ErrorPage.\n */\n\nexport async function runtimeConfig() {\n try {\n const { MFE_CONFIG_API_URL, APP_ID } = getConfig();\n\n if (MFE_CONFIG_API_URL) {\n const apiConfig = { headers: { accept: 'application/json' } };\n const apiService = await configureCache();\n\n const params = new URLSearchParams();\n params.append('mfe', APP_ID);\n const url = `${MFE_CONFIG_API_URL}?${params.toString()}`;\n\n const { data } = await apiService.get(url, apiConfig);\n mergeConfig(data);\n }\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error('Error with config API', error.message);\n }\n}\n\nexport function loadExternalScripts(externalScripts, data) {\n externalScripts.forEach(ExternalScript => {\n const script = new ExternalScript(data);\n script.loadScript();\n });\n}\n\n/**\n * The default handler for the initialization lifecycle's `analytics` phase.\n *\n * The handler is responsible for identifying authenticated and anonymous users with the analytics\n * service. This is a pre-requisite for sending analytics events, thus, we do it during the\n * initialization sequence so that analytics is ready once the application's UI code starts to load.\n *\n */\nexport async function analytics() {\n const authenticatedUser = getAuthenticatedUser();\n if (authenticatedUser && authenticatedUser.userId) {\n identifyAuthenticatedUser(authenticatedUser.userId);\n } else {\n await identifyAnonymousUser();\n }\n}\n\nfunction applyOverrideHandlers(overrides) {\n const noOp = async () => { };\n return {\n pubSub: noOp,\n config: noOp,\n logging: noOp,\n auth,\n analytics,\n i18n: noOp,\n ready: noOp,\n initError,\n ...overrides, // This will override any same-keyed handlers from above.\n };\n}\n\n/**\n * Invokes the application initialization sequence.\n *\n * The sequence proceeds through a number of lifecycle phases, during which pertinent services are\n * configured.\n *\n * Using the `handlers` option, lifecycle phase handlers can be overridden to perform custom\n * functionality. Note that while these override handlers _do_ replace the default handler\n * functionality for analytics, auth, and initError (the other phases have no default\n * functionality), they do _not_ override the configuration of the actual services that those\n * handlers leverage.\n *\n * Some services can be overridden via the loggingService and analyticsService options. The other\n * services (auth and i18n) cannot currently be overridden.\n *\n * The following lifecycle phases exist:\n *\n * - pubSub: A no-op by default.\n * - config: A no-op by default.\n * - logging: A no-op by default.\n * - auth: Uses the 'auth' handler defined above.\n * - analytics: Uses the 'analytics' handler defined above.\n * - i18n: A no-op by default.\n * - ready: A no-op by default.\n * - initError: Uses the 'initError' handler defined above.\n *\n * @param {Object} [options]\n * @param {*} [options.loggingService=NewRelicLoggingService] The `LoggingService` implementation\n * to use.\n * @param {*} [options.analyticsService=SegmentAnalyticsService] The `AnalyticsService`\n * implementation to use.\n * @param {*} [options.authMiddleware=[]] An array of middleware to apply to http clients in the auth service.\n * @param {*} [options.externalScripts=[GoogleAnalyticsLoader]] An array of externalScripts.\n * By default added GoogleAnalyticsLoader.\n * @param {*} [options.requireAuthenticatedUser=false] If true, turns on automatic login\n * redirection for unauthenticated users. Defaults to false, meaning that by default the\n * application will allow anonymous/unauthenticated sessions.\n * @param {*} [options.hydrateAuthenticatedUser=false] If true, makes an API call to the user\n * account endpoint (`${App.config.LMS_BASE_URL}/api/user/v1/accounts/${username}`) to fetch\n * detailed account information for the authenticated user. This data is merged into the return\n * value of `getAuthenticatedUser`, overriding any duplicate keys that already exist. Defaults to\n * false, meaning that no additional account information will be loaded.\n * @param {*} [options.messages] A i18n-compatible messages object, or an array of such objects. If\n * an array is provided, duplicate keys are resolved with the last-one-in winning.\n * @param {*} [options.handlers={}] An optional object of handlers which can be used to replace the\n * default behavior of any part of the startup sequence. It can also be used to add additional\n * initialization behavior before or after the rest of the sequence.\n */\nexport async function initialize({\n loggingService = NewRelicLoggingService,\n analyticsService = SegmentAnalyticsService,\n authService = AxiosJwtAuthService,\n authMiddleware = [],\n externalScripts = [GoogleAnalyticsLoader],\n requireAuthenticatedUser: requireUser = false,\n hydrateAuthenticatedUser: hydrateUser = false,\n messages,\n handlers: overrideHandlers = {},\n}) {\n const handlers = applyOverrideHandlers(overrideHandlers);\n try {\n // Pub/Sub\n await handlers.pubSub();\n publish(APP_PUBSUB_INITIALIZED);\n\n // Configuration\n await handlers.config();\n await runtimeConfig();\n publish(APP_CONFIG_INITIALIZED);\n\n loadExternalScripts(externalScripts, {\n config: getConfig(),\n });\n\n // Logging\n configureLogging(loggingService, {\n config: getConfig(),\n });\n await handlers.logging();\n publish(APP_LOGGING_INITIALIZED);\n\n // Authentication\n configureAuth(authService, {\n loggingService: getLoggingService(),\n config: getConfig(),\n middleware: authMiddleware,\n });\n\n await handlers.auth(requireUser, hydrateUser);\n publish(APP_AUTH_INITIALIZED);\n\n // Analytics\n configureAnalytics(analyticsService, {\n config: getConfig(),\n loggingService: getLoggingService(),\n httpClient: getAuthenticatedHttpClient(),\n });\n await handlers.analytics();\n publish(APP_ANALYTICS_INITIALIZED);\n\n // Internationalization\n configureI18n({\n messages,\n config: getConfig(),\n loggingService: getLoggingService(),\n });\n await handlers.i18n();\n publish(APP_I18N_INITIALIZED);\n\n // Application Ready\n await handlers.ready();\n publish(APP_READY);\n } catch (error) {\n if (!error.isRedirecting) {\n // Initialization Error\n await handlers.initError(error);\n publish(APP_INIT_ERROR, error);\n }\n }\n}\n"],"mappings":";;;;;;+CACA,qJAAAA,mBAAA,YAAAA,oBAAA,WAAAC,OAAA,SAAAA,OAAA,OAAAC,EAAA,GAAAC,MAAA,CAAAC,SAAA,EAAAC,MAAA,GAAAH,EAAA,CAAAI,cAAA,EAAAC,cAAA,GAAAJ,MAAA,CAAAI,cAAA,cAAAC,GAAA,EAAAC,GAAA,EAAAC,IAAA,IAAAF,GAAA,CAAAC,GAAA,IAAAC,IAAA,CAAAC,KAAA,KAAAC,OAAA,wBAAAC,MAAA,GAAAA,MAAA,OAAAC,cAAA,GAAAF,OAAA,CAAAG,QAAA,kBAAAC,mBAAA,GAAAJ,OAAA,CAAAK,aAAA,uBAAAC,iBAAA,GAAAN,OAAA,CAAAO,WAAA,8BAAAC,OAAAZ,GAAA,EAAAC,GAAA,EAAAE,KAAA,WAAAR,MAAA,CAAAI,cAAA,CAAAC,GAAA,EAAAC,GAAA,IAAAE,KAAA,EAAAA,KAAA,EAAAU,UAAA,MAAAC,YAAA,MAAAC,QAAA,SAAAf,GAAA,CAAAC,GAAA,WAAAW,MAAA,mBAAAI,GAAA,IAAAJ,MAAA,YAAAA,OAAAZ,GAAA,EAAAC,GAAA,EAAAE,KAAA,WAAAH,GAAA,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AAA5L,IAAA;UAAA,OAEhB0L,QAAQ,CAACtF,SAAS,CAAAwF,SAAA,CAAAjD,EAAM,CAAC;QAAA;UAC/BzE,OAAO,CAAC4B,cAAc,EAAA8F,SAAA,CAAAjD,EAAO,CAAC;QAAC;QAAA;UAAA,OAAAiD,SAAA,CAAAnJ,IAAA;MAAA;IAAA,GAAAiI,QAAA;EAAA,CAGpC;EAAA,OAAAD,WAAA,CAAA1G,KAAA,OAAAD,SAAA;AAAA"}
|
|
@@ -26,6 +26,12 @@ var MockLoggingService = /*#__PURE__*/_createClass(function MockLoggingService()
|
|
|
26
26
|
* @memberof MockLoggingService
|
|
27
27
|
*/
|
|
28
28
|
_defineProperty(this, "logError", jest.fn());
|
|
29
|
+
/**
|
|
30
|
+
* Implemented as a jest.fn()
|
|
31
|
+
*
|
|
32
|
+
* @memberof MockLoggingService
|
|
33
|
+
*/
|
|
34
|
+
_defineProperty(this, "setCustomAttribute", jest.fn());
|
|
29
35
|
});
|
|
30
36
|
export default MockLoggingService;
|
|
31
37
|
//# sourceMappingURL=MockLoggingService.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MockLoggingService.js","names":["MockLoggingService","_createClass","_classCallCheck","_defineProperty","jest","fn"],"sources":["../../src/logging/MockLoggingService.js"],"sourcesContent":["/**\n * The MockLoggingService implements both logInfo and logError as jest mock functions via\n * jest.fn(). It has no other functionality.\n *\n * @implements {LoggingService}\n * @memberof module:Logging\n */\nclass MockLoggingService {\n /**\n * Implemented as a jest.fn()\n *\n * @memberof MockLoggingService\n */\n logInfo = jest.fn();\n\n /**\n * Implemented as a jest.fn()\n *\n * @memberof MockLoggingService\n */\n logError = jest.fn();\n}\n\nexport default MockLoggingService;\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AANA,IAOMA,kBAAkB,gBAAAC,YAAA,UAAAD,mBAAA;EAAAE,eAAA,OAAAF,kBAAA;EACtB;AACF;AACA;AACA;AACA;EAJEG,eAAA,kBAKUC,IAAI,CAACC,EAAE,
|
|
1
|
+
{"version":3,"file":"MockLoggingService.js","names":["MockLoggingService","_createClass","_classCallCheck","_defineProperty","jest","fn"],"sources":["../../src/logging/MockLoggingService.js"],"sourcesContent":["/**\n * The MockLoggingService implements both logInfo and logError as jest mock functions via\n * jest.fn(). It has no other functionality.\n *\n * @implements {LoggingService}\n * @memberof module:Logging\n */\nclass MockLoggingService {\n /**\n * Implemented as a jest.fn()\n *\n * @memberof MockLoggingService\n */\n logInfo = jest.fn();\n\n /**\n * Implemented as a jest.fn()\n *\n * @memberof MockLoggingService\n */\n logError = jest.fn();\n\n /**\n * Implemented as a jest.fn()\n *\n * @memberof MockLoggingService\n */\n setCustomAttribute = jest.fn();\n}\n\nexport default MockLoggingService;\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AANA,IAOMA,kBAAkB,gBAAAC,YAAA,UAAAD,mBAAA;EAAAE,eAAA,OAAAF,kBAAA;EACtB;AACF;AACA;AACA;AACA;EAJEG,eAAA,kBAKUC,IAAI,CAACC,EAAE,CAAC,CAAC;EAEnB;AACF;AACA;AACA;AACA;EAJEF,eAAA,mBAKWC,IAAI,CAACC,EAAE,CAAC,CAAC;EAEpB;AACF;AACA;AACA;AACA;EAJEF,eAAA,6BAKqBC,IAAI,CAACC,EAAE,CAAC,CAAC;AAAA;AAGhC,eAAeL,kBAAkB"}
|
|
@@ -30,10 +30,11 @@ var pageActionNameInfo = 'INFO';
|
|
|
30
30
|
var pageActionNameIgnoredError = 'IGNORED_ERROR';
|
|
31
31
|
function sendPageAction(actionName, message, customAttributes) {
|
|
32
32
|
if (process.env.NODE_ENV === 'development') {
|
|
33
|
-
console.log(message, customAttributes); // eslint-disable-line
|
|
33
|
+
console.log(actionName, message, customAttributes); // eslint-disable-line
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
if (window && typeof window.newrelic !== 'undefined') {
|
|
37
|
+
// https://docs.newrelic.com/docs/browser/new-relic-browser/browser-apis/addpageaction/
|
|
37
38
|
window.newrelic.addPageAction(actionName, _objectSpread({
|
|
38
39
|
message: message
|
|
39
40
|
}, customAttributes));
|
|
@@ -45,9 +46,20 @@ function sendError(error, customAttributes) {
|
|
|
45
46
|
}
|
|
46
47
|
|
|
47
48
|
if (window && typeof window.newrelic !== 'undefined') {
|
|
49
|
+
// https://docs.newrelic.com/docs/browser/new-relic-browser/browser-apis/noticeerror/
|
|
48
50
|
window.newrelic.noticeError(fixErrorLength(error), customAttributes);
|
|
49
51
|
}
|
|
50
52
|
}
|
|
53
|
+
function _setCustomAttribute(name, value) {
|
|
54
|
+
if (process.env.NODE_ENV === 'development') {
|
|
55
|
+
console.log(name, value); // eslint-disable-line
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if (window && typeof window.newrelic !== 'undefined') {
|
|
59
|
+
// https://docs.newrelic.com/docs/browser/new-relic-browser/browser-apis/setcustomattribute/
|
|
60
|
+
window.newrelic.setCustomAttribute(name, value);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
51
63
|
|
|
52
64
|
/**
|
|
53
65
|
* The NewRelicLoggingService is a concrete implementation of the logging service interface that
|
|
@@ -75,7 +87,8 @@ function sendError(error, customAttributes) {
|
|
|
75
87
|
* ```
|
|
76
88
|
*
|
|
77
89
|
* You can also add your own custom metrics as an additional argument, or see the code to find
|
|
78
|
-
* other standard custom attributes.
|
|
90
|
+
* other standard custom attributes. By default, userId is added (via setCustomAttribute) for logged
|
|
91
|
+
* in users via the auth service (AuthAxiosJwtService).
|
|
79
92
|
*
|
|
80
93
|
* Requires the NewRelic Browser JavaScript snippet.
|
|
81
94
|
*
|
|
@@ -163,6 +176,18 @@ var NewRelicLoggingService = /*#__PURE__*/function () {
|
|
|
163
176
|
sendError(errorStringOrObject, allCustomAttributes);
|
|
164
177
|
}
|
|
165
178
|
}
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* Sets a custom attribute that will be included with all subsequent log messages.
|
|
182
|
+
*
|
|
183
|
+
* @param {string} name
|
|
184
|
+
* @param {string|number|null} value
|
|
185
|
+
*/
|
|
186
|
+
}, {
|
|
187
|
+
key: "setCustomAttribute",
|
|
188
|
+
value: function setCustomAttribute(name, value) {
|
|
189
|
+
_setCustomAttribute(name, value);
|
|
190
|
+
}
|
|
166
191
|
}]);
|
|
167
192
|
return NewRelicLoggingService;
|
|
168
193
|
}();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NewRelicLoggingService.js","names":["MAX_ERROR_LENGTH","fixErrorLength","error","message","length","processedError","Object","create","substring","pageActionNameInfo","pageActionNameIgnoredError","sendPageAction","actionName","customAttributes","process","env","NODE_ENV","console","log","window","newrelic","addPageAction","_objectSpread","sendError","noticeError","NewRelicLoggingService","options","_classCallCheck","config","undefined","ignoredErrorRegexes","IGNORED_ERROR_REGEX","_createClass","key","value","logInfo","infoStringOrErrorObject","arguments","customAttrs","_typeof","infoCustomAttributes","logError","errorStringOrObject","errorCustomAttributes","allCustomAttributes","keys","errorMessage","match","default"],"sources":["../../src/logging/NewRelicLoggingService.js"],"sourcesContent":["/**\n * NewRelic will not log an error if it is too long.\n *\n * @ignore\n */\nexport const MAX_ERROR_LENGTH = 4000;\n\nfunction fixErrorLength(error) {\n if (error.message && error.message.length > MAX_ERROR_LENGTH) {\n const processedError = Object.create(error);\n processedError.message = processedError.message.substring(0, MAX_ERROR_LENGTH);\n return processedError;\n }\n if (typeof error === 'string' && error.length > MAX_ERROR_LENGTH) {\n return error.substring(0, MAX_ERROR_LENGTH);\n }\n return error;\n}\n\n/* Constants used as New Relic page action names. */\nconst pageActionNameInfo = 'INFO';\nconst pageActionNameIgnoredError = 'IGNORED_ERROR';\n\nfunction sendPageAction(actionName, message, customAttributes) {\n if (process.env.NODE_ENV === 'development') {\n console.log(message, customAttributes); // eslint-disable-line\n }\n if (window && typeof window.newrelic !== 'undefined') {\n window.newrelic.addPageAction(actionName, { message, ...customAttributes });\n }\n}\n\nfunction sendError(error, customAttributes) {\n if (process.env.NODE_ENV === 'development') {\n console.error(error, customAttributes); // eslint-disable-line\n }\n if (window && typeof window.newrelic !== 'undefined') {\n window.newrelic.noticeError(fixErrorLength(error), customAttributes);\n }\n}\n\n/**\n * The NewRelicLoggingService is a concrete implementation of the logging service interface that\n * sends messages to NewRelic that can be seen in NewRelic Browser and NewRelic Insights. When in\n * development mode, all messages will instead be sent to the console.\n *\n * When you use `logError`, your errors will be checked to see if they're ignored *or* not.\n * Not-ignored errors will appear under \"JS errors\" for your Browser application.\n *\n * ```\n * SELECT * from JavaScriptError WHERE errorStatus is not null SINCE 10 days ago\n * ```\n *\n * Ignored errors will appear in New Relic Insights as page actions, which can be queried:\n *\n * ```\n * SELECT * from PageAction WHERE actionName = 'IGNORED_ERROR' SINCE 1 hour ago\n * ```\n *\n * When using `logInfo`, these only appear in New Relic Insights when querying for page actions as\n * follows:\n *\n * ```\n * SELECT * from PageAction WHERE actionName = 'INFO' SINCE 1 hour ago\n * ```\n *\n * You can also add your own custom metrics as an additional argument, or see the code to find\n * other standard custom attributes.\n *\n * Requires the NewRelic Browser JavaScript snippet.\n *\n * @implements {LoggingService}\n * @memberof module:Logging\n */\nexport default class NewRelicLoggingService {\n constructor(options) {\n const config = options ? options.config : undefined;\n /*\n String which is an explicit error message regex. If an error message matches the regex, the error\n is considered an *ignored* error and submitted to New Relic as a page action - not an error.\n\n Ignored error regexes are configured per frontend application (MFE).\n\n The regex for all ignored errors are represented in the .env files as a single string. If you need to\n ignore multiple errors, use the standard `|` regex syntax.\n\n For example, here's a .env line which ignores two specific errors:\n\n IGNORED_ERROR_REGEX='^\\\\[frontend-auth\\\\] Unimportant Error|Specific non-critical error #[\\\\d]+'\n\n This example would ignore errors with the following messages:\n\n [frontend-app-generic] - Specific non-critical error #45678 happened.\n [frontend-app-generic] - Specific non-critical error #93475 happened.\n [frontend-auth] Unimportant Error: Browser strangeness occurred.\n\n To test your regex additions, use a JS CLI environment (such as node) and run code like this:\n\n x = new RegExp('^\\\\[frontend-auth\\\\] Unimportant Error|Specific non-critical error #[\\\\d]+');\n '[frontend-app-generic] - Specific non-critical error #45678 happened.'.match(x);\n '[frontend-auth] Unimportant Error: Browser strangeness occurred.'.match(x);\n 'This error should not match anything!'.match(x);\n\n For edx.org, add new error message regexes in edx-internal YAML as needed.\n */\n this.ignoredErrorRegexes = config ? config.IGNORED_ERROR_REGEX : undefined;\n }\n\n /**\n *\n *\n * @param {*} infoStringOrErrorObject\n * @param {*} [customAttributes={}]\n * @memberof NewRelicLoggingService\n */\n logInfo(infoStringOrErrorObject, customAttributes = {}) {\n let message = infoStringOrErrorObject;\n let customAttrs = customAttributes;\n if (typeof infoStringOrErrorObject === 'object' && 'message' in infoStringOrErrorObject) {\n /* Caller has passed in an error object to be logged as a page action. */\n /* Extract the attributes and the message. */\n const infoCustomAttributes = infoStringOrErrorObject.customAttributes || {};\n customAttrs = { ...infoCustomAttributes, ...customAttributes };\n message = infoStringOrErrorObject.message;\n }\n sendPageAction(pageActionNameInfo, message, customAttrs);\n }\n\n /**\n *\n *\n * @param {*} errorStringOrObject\n * @param {*} [customAttributes={}]\n * @memberof NewRelicLoggingService\n */\n logError(errorStringOrObject, customAttributes = {}) {\n const errorCustomAttributes = errorStringOrObject.customAttributes || {};\n let allCustomAttributes = { ...errorCustomAttributes, ...customAttributes };\n if (Object.keys(allCustomAttributes).length === 0) {\n // noticeError expects undefined if there are no custom attributes.\n allCustomAttributes = undefined;\n }\n\n /*\n Separate the errors into ignored errors and other errors.\n Ignored errors are logged via adding a page action.\n Other errors are logged via noticeError and count as \"JS Errors\" for the application.\n */\n const errorMessage = errorStringOrObject.message || (typeof errorStringOrObject === 'string' ? errorStringOrObject : '');\n if (this.ignoredErrorRegexes && errorMessage.match(this.ignoredErrorRegexes)) {\n /* ignored error */\n sendPageAction(pageActionNameIgnoredError, errorMessage, allCustomAttributes);\n } else {\n /* error! */\n sendError(errorStringOrObject, allCustomAttributes);\n }\n }\n}\n"],"mappings":";;;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,CAAE;QAC9DV,OAAO,GAAGiC,uBAAuB,CAACjC,OAAO;MAC3C;MACAQ,cAAc,CAACF,kBAAkB,EAAEN,OAAO,EAAEmC,WAAW,CAAC;IAC1D;;IAEA;AACF;AACA;AACA;AACA;AACA;AACA;EANE;IAAAL,GAAA;IAAAC,KAAA,EAOA,SAAAO,SAASC,mBAAmB,EAAyB;MAAA,IAAvB7B,gBAAgB,GAAAwB,SAAA,CAAAjC,MAAA,QAAAiC,SAAA,QAAAR,SAAA,GAAAQ,SAAA,MAAG,CAAC,CAAC;MACjD,IAAMM,qBAAqB,GAAGD,mBAAmB,CAAC7B,gBAAgB,IAAI,CAAC,CAAC;MACxE,IAAI+B,mBAAmB,GAAAtB,aAAA,CAAAA,aAAA,KAAQqB,qBAAqB,GAAK9B,gBAAgB,CAAE;MAC3E,IAAIP,MAAM,CAACuC,IAAI,CAACD,mBAAmB,CAAC,CAACxC,MAAM,KAAK,CAAC,EAAE;QACjD;QACAwC,mBAAmB,GAAGf,SAAS;MACjC;;MAEA;AACJ;AACA;AACA;AACA;MACI,IAAMiB,YAAY,GAAGJ,mBAAmB,CAACvC,OAAO,KAAK,OAAOuC,mBAAmB,KAAK,QAAQ,GAAGA,mBAAmB,GAAG,EAAE,CAAC;MACxH,IAAI,IAAI,CAACZ,mBAAmB,IAAIgB,YAAY,CAACC,KAAK,CAAC,IAAI,CAACjB,mBAAmB,CAAC,EAAE;QAC5E;QACAnB,cAAc,CAACD,0BAA0B,EAAEoC,YAAY,EAAEF,mBAAmB,CAAC;MAC/E,CAAC,MAAM;QACL;QACArB,SAAS,CAACmB,mBAAmB,EAAEE,mBAAmB,CAAC;MACrD;IACF;EAAC;EAAA,OAAAnB,sBAAA;AAAA;AAAA,SAlFkBA,sBAAsB,IAAAuB,OAAA"}
|
|
1
|
+
{"version":3,"file":"NewRelicLoggingService.js","names":["MAX_ERROR_LENGTH","fixErrorLength","error","message","length","processedError","Object","create","substring","pageActionNameInfo","pageActionNameIgnoredError","sendPageAction","actionName","customAttributes","process","env","NODE_ENV","console","log","window","newrelic","addPageAction","_objectSpread","sendError","noticeError","setCustomAttribute","name","value","NewRelicLoggingService","options","_classCallCheck","config","undefined","ignoredErrorRegexes","IGNORED_ERROR_REGEX","_createClass","key","logInfo","infoStringOrErrorObject","arguments","customAttrs","_typeof","infoCustomAttributes","logError","errorStringOrObject","errorCustomAttributes","allCustomAttributes","keys","errorMessage","match","default"],"sources":["../../src/logging/NewRelicLoggingService.js"],"sourcesContent":["/**\n * NewRelic will not log an error if it is too long.\n *\n * @ignore\n */\nexport const MAX_ERROR_LENGTH = 4000;\n\nfunction fixErrorLength(error) {\n if (error.message && error.message.length > MAX_ERROR_LENGTH) {\n const processedError = Object.create(error);\n processedError.message = processedError.message.substring(0, MAX_ERROR_LENGTH);\n return processedError;\n }\n if (typeof error === 'string' && error.length > MAX_ERROR_LENGTH) {\n return error.substring(0, MAX_ERROR_LENGTH);\n }\n return error;\n}\n\n/* Constants used as New Relic page action names. */\nconst pageActionNameInfo = 'INFO';\nconst pageActionNameIgnoredError = 'IGNORED_ERROR';\n\nfunction sendPageAction(actionName, message, customAttributes) {\n if (process.env.NODE_ENV === 'development') {\n console.log(actionName, message, customAttributes); // eslint-disable-line\n }\n if (window && typeof window.newrelic !== 'undefined') {\n // https://docs.newrelic.com/docs/browser/new-relic-browser/browser-apis/addpageaction/\n window.newrelic.addPageAction(actionName, { message, ...customAttributes });\n }\n}\n\nfunction sendError(error, customAttributes) {\n if (process.env.NODE_ENV === 'development') {\n console.error(error, customAttributes); // eslint-disable-line\n }\n if (window && typeof window.newrelic !== 'undefined') {\n // https://docs.newrelic.com/docs/browser/new-relic-browser/browser-apis/noticeerror/\n window.newrelic.noticeError(fixErrorLength(error), customAttributes);\n }\n}\n\nfunction setCustomAttribute(name, value) {\n if (process.env.NODE_ENV === 'development') {\n console.log(name, value); // eslint-disable-line\n }\n if (window && typeof window.newrelic !== 'undefined') {\n // https://docs.newrelic.com/docs/browser/new-relic-browser/browser-apis/setcustomattribute/\n window.newrelic.setCustomAttribute(name, value);\n }\n}\n\n/**\n * The NewRelicLoggingService is a concrete implementation of the logging service interface that\n * sends messages to NewRelic that can be seen in NewRelic Browser and NewRelic Insights. When in\n * development mode, all messages will instead be sent to the console.\n *\n * When you use `logError`, your errors will be checked to see if they're ignored *or* not.\n * Not-ignored errors will appear under \"JS errors\" for your Browser application.\n *\n * ```\n * SELECT * from JavaScriptError WHERE errorStatus is not null SINCE 10 days ago\n * ```\n *\n * Ignored errors will appear in New Relic Insights as page actions, which can be queried:\n *\n * ```\n * SELECT * from PageAction WHERE actionName = 'IGNORED_ERROR' SINCE 1 hour ago\n * ```\n *\n * When using `logInfo`, these only appear in New Relic Insights when querying for page actions as\n * follows:\n *\n * ```\n * SELECT * from PageAction WHERE actionName = 'INFO' SINCE 1 hour ago\n * ```\n *\n * You can also add your own custom metrics as an additional argument, or see the code to find\n * other standard custom attributes. By default, userId is added (via setCustomAttribute) for logged\n * in users via the auth service (AuthAxiosJwtService).\n *\n * Requires the NewRelic Browser JavaScript snippet.\n *\n * @implements {LoggingService}\n * @memberof module:Logging\n */\nexport default class NewRelicLoggingService {\n constructor(options) {\n const config = options ? options.config : undefined;\n /*\n String which is an explicit error message regex. If an error message matches the regex, the error\n is considered an *ignored* error and submitted to New Relic as a page action - not an error.\n\n Ignored error regexes are configured per frontend application (MFE).\n\n The regex for all ignored errors are represented in the .env files as a single string. If you need to\n ignore multiple errors, use the standard `|` regex syntax.\n\n For example, here's a .env line which ignores two specific errors:\n\n IGNORED_ERROR_REGEX='^\\\\[frontend-auth\\\\] Unimportant Error|Specific non-critical error #[\\\\d]+'\n\n This example would ignore errors with the following messages:\n\n [frontend-app-generic] - Specific non-critical error #45678 happened.\n [frontend-app-generic] - Specific non-critical error #93475 happened.\n [frontend-auth] Unimportant Error: Browser strangeness occurred.\n\n To test your regex additions, use a JS CLI environment (such as node) and run code like this:\n\n x = new RegExp('^\\\\[frontend-auth\\\\] Unimportant Error|Specific non-critical error #[\\\\d]+');\n '[frontend-app-generic] - Specific non-critical error #45678 happened.'.match(x);\n '[frontend-auth] Unimportant Error: Browser strangeness occurred.'.match(x);\n 'This error should not match anything!'.match(x);\n\n For edx.org, add new error message regexes in edx-internal YAML as needed.\n */\n this.ignoredErrorRegexes = config ? config.IGNORED_ERROR_REGEX : undefined;\n }\n\n /**\n *\n *\n * @param {*} infoStringOrErrorObject\n * @param {*} [customAttributes={}]\n * @memberof NewRelicLoggingService\n */\n logInfo(infoStringOrErrorObject, customAttributes = {}) {\n let message = infoStringOrErrorObject;\n let customAttrs = customAttributes;\n if (typeof infoStringOrErrorObject === 'object' && 'message' in infoStringOrErrorObject) {\n /* Caller has passed in an error object to be logged as a page action. */\n /* Extract the attributes and the message. */\n const infoCustomAttributes = infoStringOrErrorObject.customAttributes || {};\n customAttrs = { ...infoCustomAttributes, ...customAttributes };\n message = infoStringOrErrorObject.message;\n }\n sendPageAction(pageActionNameInfo, message, customAttrs);\n }\n\n /**\n *\n *\n * @param {*} errorStringOrObject\n * @param {*} [customAttributes={}]\n * @memberof NewRelicLoggingService\n */\n logError(errorStringOrObject, customAttributes = {}) {\n const errorCustomAttributes = errorStringOrObject.customAttributes || {};\n let allCustomAttributes = { ...errorCustomAttributes, ...customAttributes };\n if (Object.keys(allCustomAttributes).length === 0) {\n // noticeError expects undefined if there are no custom attributes.\n allCustomAttributes = undefined;\n }\n\n /*\n Separate the errors into ignored errors and other errors.\n Ignored errors are logged via adding a page action.\n Other errors are logged via noticeError and count as \"JS Errors\" for the application.\n */\n const errorMessage = errorStringOrObject.message || (typeof errorStringOrObject === 'string' ? errorStringOrObject : '');\n if (this.ignoredErrorRegexes && errorMessage.match(this.ignoredErrorRegexes)) {\n /* ignored error */\n sendPageAction(pageActionNameIgnoredError, errorMessage, allCustomAttributes);\n } else {\n /* error! */\n sendError(errorStringOrObject, allCustomAttributes);\n }\n }\n\n /**\n * Sets a custom attribute that will be included with all subsequent log messages.\n *\n * @param {string} name\n * @param {string|number|null} value\n */\n setCustomAttribute(name, value) {\n setCustomAttribute(name, value);\n }\n}\n"],"mappings":";;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA,OAAO,IAAMA,gBAAgB,GAAG,IAAI;AAEpC,SAASC,cAAcA,CAACC,KAAK,EAAE;EAC7B,IAAIA,KAAK,CAACC,OAAO,IAAID,KAAK,CAACC,OAAO,CAACC,MAAM,GAAGJ,gBAAgB,EAAE;IAC5D,IAAMK,cAAc,GAAGC,MAAM,CAACC,MAAM,CAACL,KAAK,CAAC;IAC3CG,cAAc,CAACF,OAAO,GAAGE,cAAc,CAACF,OAAO,CAACK,SAAS,CAAC,CAAC,EAAER,gBAAgB,CAAC;IAC9E,OAAOK,cAAc;EACvB;EACA,IAAI,OAAOH,KAAK,KAAK,QAAQ,IAAIA,KAAK,CAACE,MAAM,GAAGJ,gBAAgB,EAAE;IAChE,OAAOE,KAAK,CAACM,SAAS,CAAC,CAAC,EAAER,gBAAgB,CAAC;EAC7C;EACA,OAAOE,KAAK;AACd;;AAEA;AACA,IAAMO,kBAAkB,GAAG,MAAM;AACjC,IAAMC,0BAA0B,GAAG,eAAe;AAElD,SAASC,cAAcA,CAACC,UAAU,EAAET,OAAO,EAAEU,gBAAgB,EAAE;EAC7D,IAAIC,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,aAAa,EAAE;IAC1CC,OAAO,CAACC,GAAG,CAACN,UAAU,EAAET,OAAO,EAAEU,gBAAgB,CAAC,CAAC,CAAC;EACtD;;EACA,IAAIM,MAAM,IAAI,OAAOA,MAAM,CAACC,QAAQ,KAAK,WAAW,EAAE;IACpD;IACAD,MAAM,CAACC,QAAQ,CAACC,aAAa,CAACT,UAAU,EAAAU,aAAA;MAAInB,OAAO,EAAPA;IAAO,GAAKU,gBAAgB,CAAE,CAAC;EAC7E;AACF;AAEA,SAASU,SAASA,CAACrB,KAAK,EAAEW,gBAAgB,EAAE;EAC1C,IAAIC,OAAO,CAACC,GAAG,CAACC,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,CAAC;MACxH,IAAI,IAAI,CAACX,mBAAmB,IAAIe,YAAY,CAACC,KAAK,CAAC,IAAI,CAAChB,mBAAmB,CAAC,EAAE;QAC5E;QACAtB,cAAc,CAACD,0BAA0B,EAAEsC,YAAY,EAAEF,mBAAmB,CAAC;MAC/E,CAAC,MAAM;QACL;QACAvB,SAAS,CAACqB,mBAAmB,EAAEE,mBAAmB,CAAC;MACrD;IACF;;IAEA;AACF;AACA;AACA;AACA;AACA;EALE;IAAAV,GAAA;IAAAT,KAAA,EAMA,SAAAF,mBAAmBC,IAAI,EAAEC,KAAK,EAAE;MAC9BF,mBAAkB,CAACC,IAAI,EAAEC,KAAK,CAAC;IACjC;EAAC;EAAA,OAAAC,sBAAA;AAAA;AAAA,SA5FkBA,sBAAsB,IAAAsB,OAAA"}
|
package/logging/interface.js
CHANGED
|
@@ -68,6 +68,16 @@ export function logError(errorStringOrObject, customAttributes) {
|
|
|
68
68
|
return service.logError(errorStringOrObject, customAttributes);
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
+
/**
|
|
72
|
+
* Sets a custom attribute that will be included with all subsequent log messages.
|
|
73
|
+
*
|
|
74
|
+
* @param {string} name
|
|
75
|
+
* @param {string|number|null} value
|
|
76
|
+
*/
|
|
77
|
+
export function setCustomAttribute(name, value) {
|
|
78
|
+
return service.setCustomAttribute(name, value);
|
|
79
|
+
}
|
|
80
|
+
|
|
71
81
|
/**
|
|
72
82
|
*
|
|
73
83
|
* @throws {Error} Thrown if the logging service has not yet been configured via {@link configure}.
|
package/logging/interface.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interface.js","names":["PropTypes","optionsShape","config","object","isRequired","serviceShape","logInfo","func","logError","service","configure","LoggingService","options","checkPropTypes","infoStringOrErrorObject","customAttributes","errorStringOrObject","getLoggingService","Error","resetLoggingService"],"sources":["../../src/logging/interface.js"],"sourcesContent":["/**\n * #### Import members from **@edx/frontend-platform/logging**\n *\n * Contains a shared interface for logging information. (The default implementation is in\n * NewRelicLoggingService.js.) When in development mode, all messages will instead be sent to the console.\n *\n * The `initialize` function performs much of the logging configuration for you. If, however,\n * you're not using the `initialize` function, logging (via New Relic) can be configured via:\n *\n * ```\n * import { configure, NewRelicLoggingService, logInfo, logError } from '@edx/frontend-platform/logging';\n * import { geConfig } from '@edx/frontend-platform';\n *\n * configureLogging(NewRelicLoggingService, {\n * config: getConfig(),\n * });\n *\n * logInfo('Just so you know...');\n * logInfo(new Error('Unimportant error'), { type: 'unimportant' });\n * logError('Uhoh!');\n * logError(new Error('Uhoh error!'));\n * ```\n *\n * As shown in this example, logging depends on the configuration document.\n *\n * @module Logging\n */\n\nimport PropTypes from 'prop-types';\n\nconst optionsShape = {\n config: PropTypes.object.isRequired,\n};\n\nconst serviceShape = {\n logInfo: PropTypes.func.isRequired,\n logError: PropTypes.func.isRequired,\n};\n\nlet service = null;\n\n/**\n *\n */\nexport function configure(LoggingService, options) {\n PropTypes.checkPropTypes(optionsShape, options, 'property', 'Logging');\n service = new LoggingService(options);\n PropTypes.checkPropTypes(serviceShape, service, 'property', 'LoggingService');\n return service;\n}\n\n/**\n * Logs a message to the 'info' log level. Can accept custom attributes as a property of the error\n * object, or as an optional second parameter.\n *\n * @param {string|Error} infoStringOrErrorObject\n * @param {Object} [customAttributes={}]\n */\nexport function logInfo(infoStringOrErrorObject, customAttributes) {\n return service.logInfo(infoStringOrErrorObject, customAttributes);\n}\n\n/**\n * Logs a message to the 'error' log level. Can accept custom attributes as a property of the error\n * object, or as an optional second parameter.\n *\n * @param {string|Error} errorStringOrObject\n * @param {Object} [customAttributes={}]\n */\nexport function logError(errorStringOrObject, customAttributes) {\n return service.logError(errorStringOrObject, customAttributes);\n}\n\n/**\n *\n * @throws {Error} Thrown if the logging service has not yet been configured via {@link configure}.\n * @returns {LoggingService}\n */\nexport function getLoggingService() {\n if (!service) {\n throw Error('You must first configure the logging service.');\n }\n return service;\n}\n\n/**\n * Sets the configured logging service back to null.\n *\n */\nexport function resetLoggingService() {\n service = null;\n}\n\n/**\n * @name LoggingService\n * @interface\n * @memberof module:Logging\n * @property {function} logError\n * @property {function} logInfo\n */\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,SAAS,MAAM,YAAY;AAElC,IAAMC,YAAY,GAAG;EACnBC,MAAM,EAAEF,SAAS,CAACG,MAAM,CAACC;AAC3B,CAAC;AAED,IAAMC,YAAY,GAAG;EACnBC,OAAO,EAAEN,SAAS,CAACO,IAAI,CAACH,UAAU;EAClCI,QAAQ,EAAER,SAAS,CAACO,IAAI,CAACH;AAC3B,CAAC;AAED,IAAIK,OAAO,GAAG,IAAI;;AAElB;AACA;AACA;AACA,OAAO,SAASC,SAASA,CAACC,cAAc,EAAEC,OAAO,EAAE;EACjDZ,SAAS,CAACa,cAAc,CAACZ,YAAY,EAAEW,OAAO,EAAE,UAAU,EAAE,SAAS,CAAC;EACtEH,OAAO,GAAG,IAAIE,cAAc,CAACC,OAAO,CAAC;EACrCZ,SAAS,CAACa,cAAc,CAACR,YAAY,EAAEI,OAAO,EAAE,UAAU,EAAE,gBAAgB,CAAC;EAC7E,OAAOA,OAAO;AAChB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASH,OAAOA,CAACQ,uBAAuB,EAAEC,gBAAgB,EAAE;EACjE,OAAON,OAAO,CAACH,OAAO,CAACQ,uBAAuB,EAAEC,gBAAgB,CAAC;AACnE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASP,QAAQA,CAACQ,mBAAmB,EAAED,gBAAgB,EAAE;EAC9D,OAAON,OAAO,CAACD,QAAQ,CAACQ,mBAAmB,EAAED,gBAAgB,CAAC;AAChE;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASE,iBAAiBA,CAAA,EAAG;EAClC,IAAI,
|
|
1
|
+
{"version":3,"file":"interface.js","names":["PropTypes","optionsShape","config","object","isRequired","serviceShape","logInfo","func","logError","service","configure","LoggingService","options","checkPropTypes","infoStringOrErrorObject","customAttributes","errorStringOrObject","setCustomAttribute","name","value","getLoggingService","Error","resetLoggingService"],"sources":["../../src/logging/interface.js"],"sourcesContent":["/**\n * #### Import members from **@edx/frontend-platform/logging**\n *\n * Contains a shared interface for logging information. (The default implementation is in\n * NewRelicLoggingService.js.) When in development mode, all messages will instead be sent to the console.\n *\n * The `initialize` function performs much of the logging configuration for you. If, however,\n * you're not using the `initialize` function, logging (via New Relic) can be configured via:\n *\n * ```\n * import { configure, NewRelicLoggingService, logInfo, logError } from '@edx/frontend-platform/logging';\n * import { geConfig } from '@edx/frontend-platform';\n *\n * configureLogging(NewRelicLoggingService, {\n * config: getConfig(),\n * });\n *\n * logInfo('Just so you know...');\n * logInfo(new Error('Unimportant error'), { type: 'unimportant' });\n * logError('Uhoh!');\n * logError(new Error('Uhoh error!'));\n * ```\n *\n * As shown in this example, logging depends on the configuration document.\n *\n * @module Logging\n */\n\nimport PropTypes from 'prop-types';\n\nconst optionsShape = {\n config: PropTypes.object.isRequired,\n};\n\nconst serviceShape = {\n logInfo: PropTypes.func.isRequired,\n logError: PropTypes.func.isRequired,\n};\n\nlet service = null;\n\n/**\n *\n */\nexport function configure(LoggingService, options) {\n PropTypes.checkPropTypes(optionsShape, options, 'property', 'Logging');\n service = new LoggingService(options);\n PropTypes.checkPropTypes(serviceShape, service, 'property', 'LoggingService');\n return service;\n}\n\n/**\n * Logs a message to the 'info' log level. Can accept custom attributes as a property of the error\n * object, or as an optional second parameter.\n *\n * @param {string|Error} infoStringOrErrorObject\n * @param {Object} [customAttributes={}]\n */\nexport function logInfo(infoStringOrErrorObject, customAttributes) {\n return service.logInfo(infoStringOrErrorObject, customAttributes);\n}\n\n/**\n * Logs a message to the 'error' log level. Can accept custom attributes as a property of the error\n * object, or as an optional second parameter.\n *\n * @param {string|Error} errorStringOrObject\n * @param {Object} [customAttributes={}]\n */\nexport function logError(errorStringOrObject, customAttributes) {\n return service.logError(errorStringOrObject, customAttributes);\n}\n\n/**\n * Sets a custom attribute that will be included with all subsequent log messages.\n *\n * @param {string} name\n * @param {string|number|null} value\n */\nexport function setCustomAttribute(name, value) {\n return service.setCustomAttribute(name, value);\n}\n\n/**\n *\n * @throws {Error} Thrown if the logging service has not yet been configured via {@link configure}.\n * @returns {LoggingService}\n */\nexport function getLoggingService() {\n if (!service) {\n throw Error('You must first configure the logging service.');\n }\n return service;\n}\n\n/**\n * Sets the configured logging service back to null.\n *\n */\nexport function resetLoggingService() {\n service = null;\n}\n\n/**\n * @name LoggingService\n * @interface\n * @memberof module:Logging\n * @property {function} logError\n * @property {function} logInfo\n */\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAOA,SAAS,MAAM,YAAY;AAElC,IAAMC,YAAY,GAAG;EACnBC,MAAM,EAAEF,SAAS,CAACG,MAAM,CAACC;AAC3B,CAAC;AAED,IAAMC,YAAY,GAAG;EACnBC,OAAO,EAAEN,SAAS,CAACO,IAAI,CAACH,UAAU;EAClCI,QAAQ,EAAER,SAAS,CAACO,IAAI,CAACH;AAC3B,CAAC;AAED,IAAIK,OAAO,GAAG,IAAI;;AAElB;AACA;AACA;AACA,OAAO,SAASC,SAASA,CAACC,cAAc,EAAEC,OAAO,EAAE;EACjDZ,SAAS,CAACa,cAAc,CAACZ,YAAY,EAAEW,OAAO,EAAE,UAAU,EAAE,SAAS,CAAC;EACtEH,OAAO,GAAG,IAAIE,cAAc,CAACC,OAAO,CAAC;EACrCZ,SAAS,CAACa,cAAc,CAACR,YAAY,EAAEI,OAAO,EAAE,UAAU,EAAE,gBAAgB,CAAC;EAC7E,OAAOA,OAAO;AAChB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASH,OAAOA,CAACQ,uBAAuB,EAAEC,gBAAgB,EAAE;EACjE,OAAON,OAAO,CAACH,OAAO,CAACQ,uBAAuB,EAAEC,gBAAgB,CAAC;AACnE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASP,QAAQA,CAACQ,mBAAmB,EAAED,gBAAgB,EAAE;EAC9D,OAAON,OAAO,CAACD,QAAQ,CAACQ,mBAAmB,EAAED,gBAAgB,CAAC;AAChE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASE,kBAAkBA,CAACC,IAAI,EAAEC,KAAK,EAAE;EAC9C,OAAOV,OAAO,CAACQ,kBAAkB,CAACC,IAAI,EAAEC,KAAK,CAAC;AAChD;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,iBAAiBA,CAAA,EAAG;EAClC,IAAI,CAACX,OAAO,EAAE;IACZ,MAAMY,KAAK,CAAC,+CAA+C,CAAC;EAC9D;EACA,OAAOZ,OAAO;AAChB;;AAEA;AACA;AACA;AACA;AACA,OAAO,SAASa,mBAAmBA,CAAA,EAAG;EACpCb,OAAO,GAAG,IAAI;AAChB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@edx/frontend-platform",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.4.0",
|
|
4
4
|
"description": "Foundational application framework for Open edX micro-frontend applications.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"publishConfig": {
|
|
@@ -33,17 +33,17 @@
|
|
|
33
33
|
"homepage": "https://github.com/openedx/frontend-platform#readme",
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@edx/brand": "npm:@edx/brand-openedx@1.2.0",
|
|
36
|
-
"@edx/browserslist-config": "1.
|
|
37
|
-
"@edx/frontend-build": "12.
|
|
36
|
+
"@edx/browserslist-config": "1.2.0",
|
|
37
|
+
"@edx/frontend-build": "12.8.27",
|
|
38
38
|
"@edx/paragon": "^20.30.1",
|
|
39
39
|
"@testing-library/react-hooks": "^8.0.1",
|
|
40
40
|
"axios-mock-adapter": "^1.21.3",
|
|
41
|
-
"core-js": "3.
|
|
41
|
+
"core-js": "3.30.2",
|
|
42
42
|
"enzyme": "3.11.0",
|
|
43
43
|
"enzyme-adapter-react-16": "1.15.7",
|
|
44
44
|
"husky": "8.0.3",
|
|
45
45
|
"jsdoc": "^4.0.0",
|
|
46
|
-
"nodemon": "2.0.
|
|
46
|
+
"nodemon": "2.0.22",
|
|
47
47
|
"prop-types": "15.8.1",
|
|
48
48
|
"react": "16.14.0",
|
|
49
49
|
"react-dom": "16.14.0",
|
package/react/AppProvider.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppProvider.js","names":["React","useState","useMemo","PropTypes","Router","OptionalReduxProvider","ErrorBoundary","AppContext","useAppEvent","useTrackColorSchemeChoice","getAuthenticatedUser","AUTHENTICATED_USER_CHANGED","getConfig","CONFIG_CHANGED","history","getLocale","getMessages","IntlProvider","LOCALE_CHANGED","AppProvider","_ref","store","children","_useState","_useState2","_slicedToArray","config","setConfig","_useState3","_useState4","authenticatedUser","setAuthenticatedUser","_useState5","_useState6","locale","setLocale","appContextValue","createElement","messages","Provider","value","propTypes","object","node","isRequired","defaultProps"],"sources":["../../src/react/AppProvider.jsx"],"sourcesContent":["import React, { useState, useMemo } from 'react';\nimport PropTypes from 'prop-types';\nimport { Router } from 'react-router-dom';\n\nimport OptionalReduxProvider from './OptionalReduxProvider';\n\nimport ErrorBoundary from './ErrorBoundary';\nimport AppContext from './AppContext';\nimport { useAppEvent, useTrackColorSchemeChoice } from './hooks';\nimport { getAuthenticatedUser, AUTHENTICATED_USER_CHANGED } from '../auth';\nimport { getConfig } from '../config';\nimport { CONFIG_CHANGED } from '../constants';\nimport { history } from '../initialize';\nimport {\n getLocale,\n getMessages,\n IntlProvider,\n LOCALE_CHANGED,\n} from '../i18n';\n\n/**\n * A wrapper component for React-based micro-frontends to initialize a number of common data/\n * context providers.\n *\n * ```\n * subscribe(APP_READY, () => {\n * ReactDOM.render(\n * <AppProvider>\n * <HelloWorld />\n * </AppProvider>\n * )\n * });\n * ```\n *\n * This will provide the following to HelloWorld:\n * - An error boundary as described above.\n * - An `AppContext` provider for React context data.\n * - IntlProvider for @edx/frontend-i18n internationalization\n * - Optionally a redux `Provider`. Will only be included if a `store` property is passed to\n * `AppProvider`.\n * - A `Router` for react-router.\n *\n * @param {Object} props\n * @param {Object} [props.store] A redux store.\n * @memberof module:React\n */\nexport default function AppProvider({ store, children }) {\n const [config, setConfig] = useState(getConfig());\n const [authenticatedUser, setAuthenticatedUser] = useState(getAuthenticatedUser());\n const [locale, setLocale] = useState(getLocale());\n\n useTrackColorSchemeChoice();\n\n useAppEvent(AUTHENTICATED_USER_CHANGED, () => {\n setAuthenticatedUser(getAuthenticatedUser());\n });\n\n useAppEvent(CONFIG_CHANGED, () => {\n setConfig(getConfig());\n });\n\n useAppEvent(LOCALE_CHANGED, () => {\n setLocale(getLocale());\n });\n\n const appContextValue = useMemo(() => ({ authenticatedUser, config, locale }), [authenticatedUser, config, locale]);\n\n return (\n <IntlProvider locale={locale} messages={getMessages()}>\n <ErrorBoundary>\n <AppContext.Provider\n value={appContextValue}\n >\n <OptionalReduxProvider store={store}>\n <Router history={history}>\n {children}\n </Router>\n </OptionalReduxProvider>\n </AppContext.Provider>\n </ErrorBoundary>\n </IntlProvider>\n );\n}\n\nAppProvider.propTypes = {\n // eslint-disable-next-line react/forbid-prop-types\n store: PropTypes.object,\n children: PropTypes.node.isRequired,\n};\n\nAppProvider.defaultProps = {\n store: null,\n};\n"],"mappings":";;;;;;AAAA,OAAOA,KAAK,IAAIC,QAAQ,EAAEC,OAAO,QAAQ,OAAO;AAChD,OAAOC,SAAS,MAAM,YAAY;AAClC,SAASC,MAAM,QAAQ,kBAAkB;AAEzC,OAAOC,qBAAqB,MAAM,yBAAyB;AAE3D,OAAOC,aAAa,MAAM,iBAAiB;AAC3C,OAAOC,UAAU,MAAM,cAAc;AACrC,SAASC,WAAW,EAAEC,yBAAyB,QAAQ,SAAS;AAChE,SAASC,oBAAoB,EAAEC,0BAA0B,QAAQ,SAAS;AAC1E,SAASC,SAAS,QAAQ,WAAW;AACrC,SAASC,cAAc,QAAQ,cAAc;AAC7C,SAASC,OAAO,QAAQ,eAAe;AACvC,SACEC,SAAS,EACTC,WAAW,EACXC,YAAY,EACZC,cAAc,QACT,SAAS;;AAEhB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,WAAWA,CAAAC,IAAA,EAAsB;EAAA,IAAnBC,KAAK,GAAAD,IAAA,CAALC,KAAK;IAAEC,QAAQ,GAAAF,IAAA,CAARE,QAAQ;EACnD,IAAAC,SAAA,GAA4BtB,QAAQ,CAACW,SAAS,
|
|
1
|
+
{"version":3,"file":"AppProvider.js","names":["React","useState","useMemo","PropTypes","Router","OptionalReduxProvider","ErrorBoundary","AppContext","useAppEvent","useTrackColorSchemeChoice","getAuthenticatedUser","AUTHENTICATED_USER_CHANGED","getConfig","CONFIG_CHANGED","history","getLocale","getMessages","IntlProvider","LOCALE_CHANGED","AppProvider","_ref","store","children","_useState","_useState2","_slicedToArray","config","setConfig","_useState3","_useState4","authenticatedUser","setAuthenticatedUser","_useState5","_useState6","locale","setLocale","appContextValue","createElement","messages","Provider","value","propTypes","object","node","isRequired","defaultProps"],"sources":["../../src/react/AppProvider.jsx"],"sourcesContent":["import React, { useState, useMemo } from 'react';\nimport PropTypes from 'prop-types';\nimport { Router } from 'react-router-dom';\n\nimport OptionalReduxProvider from './OptionalReduxProvider';\n\nimport ErrorBoundary from './ErrorBoundary';\nimport AppContext from './AppContext';\nimport { useAppEvent, useTrackColorSchemeChoice } from './hooks';\nimport { getAuthenticatedUser, AUTHENTICATED_USER_CHANGED } from '../auth';\nimport { getConfig } from '../config';\nimport { CONFIG_CHANGED } from '../constants';\nimport { history } from '../initialize';\nimport {\n getLocale,\n getMessages,\n IntlProvider,\n LOCALE_CHANGED,\n} from '../i18n';\n\n/**\n * A wrapper component for React-based micro-frontends to initialize a number of common data/\n * context providers.\n *\n * ```\n * subscribe(APP_READY, () => {\n * ReactDOM.render(\n * <AppProvider>\n * <HelloWorld />\n * </AppProvider>\n * )\n * });\n * ```\n *\n * This will provide the following to HelloWorld:\n * - An error boundary as described above.\n * - An `AppContext` provider for React context data.\n * - IntlProvider for @edx/frontend-i18n internationalization\n * - Optionally a redux `Provider`. Will only be included if a `store` property is passed to\n * `AppProvider`.\n * - A `Router` for react-router.\n *\n * @param {Object} props\n * @param {Object} [props.store] A redux store.\n * @memberof module:React\n */\nexport default function AppProvider({ store, children }) {\n const [config, setConfig] = useState(getConfig());\n const [authenticatedUser, setAuthenticatedUser] = useState(getAuthenticatedUser());\n const [locale, setLocale] = useState(getLocale());\n\n useTrackColorSchemeChoice();\n\n useAppEvent(AUTHENTICATED_USER_CHANGED, () => {\n setAuthenticatedUser(getAuthenticatedUser());\n });\n\n useAppEvent(CONFIG_CHANGED, () => {\n setConfig(getConfig());\n });\n\n useAppEvent(LOCALE_CHANGED, () => {\n setLocale(getLocale());\n });\n\n const appContextValue = useMemo(() => ({ authenticatedUser, config, locale }), [authenticatedUser, config, locale]);\n\n return (\n <IntlProvider locale={locale} messages={getMessages()}>\n <ErrorBoundary>\n <AppContext.Provider\n value={appContextValue}\n >\n <OptionalReduxProvider store={store}>\n <Router history={history}>\n {children}\n </Router>\n </OptionalReduxProvider>\n </AppContext.Provider>\n </ErrorBoundary>\n </IntlProvider>\n );\n}\n\nAppProvider.propTypes = {\n // eslint-disable-next-line react/forbid-prop-types\n store: PropTypes.object,\n children: PropTypes.node.isRequired,\n};\n\nAppProvider.default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AACT,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuthenticatedPageRoute.js","names":["React","useContext","PropTypes","useRouteMatch","AppContext","PageRoute","getLoginRedirectUrl","AuthenticatedPageRoute","_ref","redirectUrl","props","_objectWithoutProperties","_excluded","_useContext","authenticatedUser","match","path","exact","strict","sensitive","destination","global","location","href","assign","createElement","propTypes","string","defaultProps"],"sources":["../../src/react/AuthenticatedPageRoute.jsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport PropTypes from 'prop-types';\nimport { useRouteMatch } from 'react-router-dom';\n\nimport AppContext from './AppContext';\nimport PageRoute from './PageRoute';\nimport { getLoginRedirectUrl } from '../auth';\n\n/**\n * A react-router route that redirects to the login page when the route becomes active and the user\n * is not authenticated. If the application has been initialized with `requireAuthenticatedUser`\n * false, an authenticatedPageRoute can be used to protect a subset of the application's routes,\n * rather than the entire application.\n *\n * It can optionally accept an override URL to redirect to instead of the login page.\n *\n * Like a `PageRoute`, also calls `sendPageEvent` when the route becomes active.\n *\n * @see PageRoute\n * @see {@link module:frontend-platform/analytics~sendPageEvent}\n * @memberof module:React\n * @param {Object} props\n * @param {string} props.redirectUrl The URL anonymous users should be redirected to, rather than\n * viewing the route's contents.\n */\nexport default function AuthenticatedPageRoute({ redirectUrl, ...props }) {\n const { authenticatedUser } = useContext(AppContext);\n\n const match = useRouteMatch({\n // eslint-disable-next-line react/prop-types\n path: props.path,\n // eslint-disable-next-line react/prop-types\n exact: props.exact,\n // eslint-disable-next-line react/prop-types\n strict: props.strict,\n // eslint-disable-next-line react/prop-types\n sensitive: props.sensitive,\n });\n\n if (authenticatedUser === null) {\n if (match) {\n const destination = redirectUrl || getLoginRedirectUrl(global.location.href);\n global.location.assign(destination);\n }\n // This emulates a Route's way of displaying nothing if the route's path doesn't match the\n // current URL.\n return null;\n }\n return (\n <PageRoute {...props} />\n );\n}\n\nAuthenticatedPageRoute.propTypes = {\n redirectUrl: PropTypes.string,\n};\n\nAuthenticatedPageRoute.defaultProps = {\n redirectUrl: null,\n};\n"],"mappings":";;;AAAA,OAAOA,KAAK,IAAIC,UAAU,QAAQ,OAAO;AACzC,OAAOC,SAAS,MAAM,YAAY;AAClC,SAASC,aAAa,QAAQ,kBAAkB;AAEhD,OAAOC,UAAU,MAAM,cAAc;AACrC,OAAOC,SAAS,MAAM,aAAa;AACnC,SAASC,mBAAmB,QAAQ,SAAS;;AAE7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,sBAAsBA,CAAAC,IAAA,EAA4B;EAAA,IAAzBC,WAAW,GAAAD,IAAA,CAAXC,WAAW;IAAKC,KAAK,GAAAC,wBAAA,CAAAH,IAAA,EAAAI,SAAA;EACpE,IAAAC,WAAA,GAA8BZ,UAAU,CAACG,UAAU,CAAC;IAA5CU,iBAAiB,GAAAD,WAAA,CAAjBC,iBAAiB;EAEzB,IAAMC,KAAK,GAAGZ,aAAa,CAAC;IAC1B;IACAa,IAAI,EAAEN,KAAK,CAACM,IAAI;IAChB;IACAC,KAAK,EAAEP,KAAK,CAACO,KAAK;IAClB;IACAC,MAAM,EAAER,KAAK,CAACQ,MAAM;IACpB;IACAC,SAAS,EAAET,KAAK,CAACS;EACnB,CAAC,CAAC;EAEF,IAAIL,iBAAiB,KAAK,IAAI,EAAE;IAC9B,IAAIC,KAAK,EAAE;MACT,IAAMK,WAAW,GAAGX,WAAW,IAAIH,mBAAmB,CAACe,MAAM,CAACC,QAAQ,CAACC,IAAI,CAAC;MAC5EF,MAAM,CAACC,QAAQ,CAACE,MAAM,CAACJ,WAAW,CAAC;IACrC;IACA;IACA;IACA,OAAO,IAAI;EACb;EACA,oBACEpB,KAAA,CAAAyB,aAAA,CAACpB,SAAS,EAAKK,
|
|
1
|
+
{"version":3,"file":"AuthenticatedPageRoute.js","names":["React","useContext","PropTypes","useRouteMatch","AppContext","PageRoute","getLoginRedirectUrl","AuthenticatedPageRoute","_ref","redirectUrl","props","_objectWithoutProperties","_excluded","_useContext","authenticatedUser","match","path","exact","strict","sensitive","destination","global","location","href","assign","createElement","propTypes","string","defaultProps"],"sources":["../../src/react/AuthenticatedPageRoute.jsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport PropTypes from 'prop-types';\nimport { useRouteMatch } from 'react-router-dom';\n\nimport AppContext from './AppContext';\nimport PageRoute from './PageRoute';\nimport { getLoginRedirectUrl } from '../auth';\n\n/**\n * A react-router route that redirects to the login page when the route becomes active and the user\n * is not authenticated. If the application has been initialized with `requireAuthenticatedUser`\n * false, an authenticatedPageRoute can be used to protect a subset of the application's routes,\n * rather than the entire application.\n *\n * It can optionally accept an override URL to redirect to instead of the login page.\n *\n * Like a `PageRoute`, also calls `sendPageEvent` when the route becomes active.\n *\n * @see PageRoute\n * @see {@link module:frontend-platform/analytics~sendPageEvent}\n * @memberof module:React\n * @param {Object} props\n * @param {string} props.redirectUrl The URL anonymous users should be redirected to, rather than\n * viewing the route's contents.\n */\nexport default function AuthenticatedPageRoute({ redirectUrl, ...props }) {\n const { authenticatedUser } = useContext(AppContext);\n\n const match = useRouteMatch({\n // eslint-disable-next-line react/prop-types\n path: props.path,\n // eslint-disable-next-line react/prop-types\n exact: props.exact,\n // eslint-disable-next-line react/prop-types\n strict: props.strict,\n // eslint-disable-next-line react/prop-types\n sensitive: props.sensitive,\n });\n\n if (authenticatedUser === null) {\n if (match) {\n const destination = redirectUrl || getLoginRedirectUrl(global.location.href);\n global.location.assign(destination);\n }\n // This emulates a Route's way of displaying nothing if the route's path doesn't match the\n // current URL.\n return null;\n }\n return (\n <PageRoute {...props} />\n );\n}\n\nAuthenticatedPageRoute.propTypes = {\n redirectUrl: PropTypes.string,\n};\n\nAuthenticatedPageRoute.defaultProps = {\n redirectUrl: null,\n};\n"],"mappings":";;;AAAA,OAAOA,KAAK,IAAIC,UAAU,QAAQ,OAAO;AACzC,OAAOC,SAAS,MAAM,YAAY;AAClC,SAASC,aAAa,QAAQ,kBAAkB;AAEhD,OAAOC,UAAU,MAAM,cAAc;AACrC,OAAOC,SAAS,MAAM,aAAa;AACnC,SAASC,mBAAmB,QAAQ,SAAS;;AAE7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,sBAAsBA,CAAAC,IAAA,EAA4B;EAAA,IAAzBC,WAAW,GAAAD,IAAA,CAAXC,WAAW;IAAKC,KAAK,GAAAC,wBAAA,CAAAH,IAAA,EAAAI,SAAA;EACpE,IAAAC,WAAA,GAA8BZ,UAAU,CAACG,UAAU,CAAC;IAA5CU,iBAAiB,GAAAD,WAAA,CAAjBC,iBAAiB;EAEzB,IAAMC,KAAK,GAAGZ,aAAa,CAAC;IAC1B;IACAa,IAAI,EAAEN,KAAK,CAACM,IAAI;IAChB;IACAC,KAAK,EAAEP,KAAK,CAACO,KAAK;IAClB;IACAC,MAAM,EAAER,KAAK,CAACQ,MAAM;IACpB;IACAC,SAAS,EAAET,KAAK,CAACS;EACnB,CAAC,CAAC;EAEF,IAAIL,iBAAiB,KAAK,IAAI,EAAE;IAC9B,IAAIC,KAAK,EAAE;MACT,IAAMK,WAAW,GAAGX,WAAW,IAAIH,mBAAmB,CAACe,MAAM,CAACC,QAAQ,CAACC,IAAI,CAAC;MAC5EF,MAAM,CAACC,QAAQ,CAACE,MAAM,CAACJ,WAAW,CAAC;IACrC;IACA;IACA;IACA,OAAO,IAAI;EACb;EACA,oBACEpB,KAAA,CAAAyB,aAAA,CAACpB,SAAS,EAAKK,KAAQ,CAAC;AAE5B;AAEAH,sBAAsB,CAACmB,SAAS,GAAG;EACjCjB,WAAW,EAAEP,SAAS,CAACyB;AACzB,CAAC;AAEDpB,sBAAsB,CAACqB,YAAY,GAAG;EACpCnB,WAAW,EAAE;AACf,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorBoundary.js","names":["React","Component","PropTypes","logError","ErrorPage","ErrorBoundary","_Component","_inherits","_super","_createSuper","props","_this","_classCallCheck","call","state","hasError","_createClass","key","value","componentDidCatch","error","info","stack","componentStack","render","createElement","children","getDerivedStateFromError","default","propTypes","node","defaultProps"],"sources":["../../src/react/ErrorBoundary.jsx"],"sourcesContent":["import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\n\nimport { logError } from '../logging';\n\nimport ErrorPage from './ErrorPage';\n\n/**\n * Error boundary component used to log caught errors and display the error page.\n *\n * @memberof module:React\n * @extends {Component}\n */\nexport default class ErrorBoundary extends Component {\n constructor(props) {\n super(props);\n this.state = { hasError: false };\n }\n\n static getDerivedStateFromError() {\n // Update state so the next render will show the fallback UI.\n return { hasError: true };\n }\n\n componentDidCatch(error, info) {\n logError(error, { stack: info.componentStack });\n }\n\n render() {\n if (this.state.hasError) {\n return <ErrorPage />;\n }\n\n return this.props.children;\n }\n}\n\nErrorBoundary.propTypes = {\n children: PropTypes.node,\n};\n\nErrorBoundary.defaultProps = {\n children: null,\n};\n"],"mappings":";;;;;;;;;;;;;AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,OAAOC,SAAS,MAAM,YAAY;AAElC,SAASC,QAAQ,QAAQ,YAAY;AAErC,OAAOC,SAAS,MAAM,aAAa;;AAEnC;AACA;AACA;AACA;AACA;AACA;AALA,IAMqBC,aAAa,0BAAAC,UAAA;EAAAC,SAAA,CAAAF,aAAA,EAAAC,UAAA;EAAA,IAAAE,MAAA,GAAAC,YAAA,CAAAJ,aAAA;EAChC,SAAAA,cAAYK,KAAK,EAAE;IAAA,IAAAC,KAAA;IAAAC,eAAA,OAAAP,aAAA;IACjBM,KAAA,GAAAH,MAAA,CAAAK,IAAA,OAAMH,KAAK;IACXC,KAAA,CAAKG,KAAK,GAAG;MAAEC,QAAQ,EAAE;IAAM,CAAC;IAAC,OAAAJ,KAAA;EACnC;EAACK,YAAA,CAAAX,aAAA;IAAAY,GAAA;IAAAC,KAAA,EAOD,SAAAC,kBAAkBC,KAAK,EAAEC,IAAI,EAAE;MAC7BlB,QAAQ,CAACiB,KAAK,EAAE;QAAEE,KAAK,EAAED,IAAI,CAACE;MAAe,CAAC,CAAC;IACjD;EAAC;IAAAN,GAAA;IAAAC,KAAA,EAED,SAAAM,OAAA,EAAS;MACP,IAAI,IAAI,CAACV,KAAK,CAACC,QAAQ,EAAE;QACvB,oBAAOf,KAAA,CAAAyB,aAAA,CAACrB,SAAS,
|
|
1
|
+
{"version":3,"file":"ErrorBoundary.js","names":["React","Component","PropTypes","logError","ErrorPage","ErrorBoundary","_Component","_inherits","_super","_createSuper","props","_this","_classCallCheck","call","state","hasError","_createClass","key","value","componentDidCatch","error","info","stack","componentStack","render","createElement","children","getDerivedStateFromError","default","propTypes","node","defaultProps"],"sources":["../../src/react/ErrorBoundary.jsx"],"sourcesContent":["import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\n\nimport { logError } from '../logging';\n\nimport ErrorPage from './ErrorPage';\n\n/**\n * Error boundary component used to log caught errors and display the error page.\n *\n * @memberof module:React\n * @extends {Component}\n */\nexport default class ErrorBoundary extends Component {\n constructor(props) {\n super(props);\n this.state = { hasError: false };\n }\n\n static getDerivedStateFromError() {\n // Update state so the next render will show the fallback UI.\n return { hasError: true };\n }\n\n componentDidCatch(error, info) {\n logError(error, { stack: info.componentStack });\n }\n\n render() {\n if (this.state.hasError) {\n return <ErrorPage />;\n }\n\n return this.props.children;\n }\n}\n\nErrorBoundary.propTypes = {\n children: PropTypes.node,\n};\n\nErrorBoundary.defaultProps = {\n children: null,\n};\n"],"mappings":";;;;;;;;;;;;;AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,OAAOC,SAAS,MAAM,YAAY;AAElC,SAASC,QAAQ,QAAQ,YAAY;AAErC,OAAOC,SAAS,MAAM,aAAa;;AAEnC;AACA;AACA;AACA;AACA;AACA;AALA,IAMqBC,aAAa,0BAAAC,UAAA;EAAAC,SAAA,CAAAF,aAAA,EAAAC,UAAA;EAAA,IAAAE,MAAA,GAAAC,YAAA,CAAAJ,aAAA;EAChC,SAAAA,cAAYK,KAAK,EAAE;IAAA,IAAAC,KAAA;IAAAC,eAAA,OAAAP,aAAA;IACjBM,KAAA,GAAAH,MAAA,CAAAK,IAAA,OAAMH,KAAK;IACXC,KAAA,CAAKG,KAAK,GAAG;MAAEC,QAAQ,EAAE;IAAM,CAAC;IAAC,OAAAJ,KAAA;EACnC;EAACK,YAAA,CAAAX,aAAA;IAAAY,GAAA;IAAAC,KAAA,EAOD,SAAAC,kBAAkBC,KAAK,EAAEC,IAAI,EAAE;MAC7BlB,QAAQ,CAACiB,KAAK,EAAE;QAAEE,KAAK,EAAED,IAAI,CAACE;MAAe,CAAC,CAAC;IACjD;EAAC;IAAAN,GAAA;IAAAC,KAAA,EAED,SAAAM,OAAA,EAAS;MACP,IAAI,IAAI,CAACV,KAAK,CAACC,QAAQ,EAAE;QACvB,oBAAOf,KAAA,CAAAyB,aAAA,CAACrB,SAAS,MAAE,CAAC;MACtB;MAEA,OAAO,IAAI,CAACM,KAAK,CAACgB,QAAQ;IAC5B;EAAC;IAAAT,GAAA;IAAAC,KAAA,EAfD,SAAAS,yBAAA,EAAkC;MAChC;MACA,OAAO;QAAEZ,QAAQ,EAAE;MAAK,CAAC;IAC3B;EAAC;EAAA,OAAAV,aAAA;AAAA,EATwCJ,SAAS;AAAA,SAA/BI,aAAa,IAAAuB,OAAA;AAwBlCvB,aAAa,CAACwB,SAAS,GAAG;EACxBH,QAAQ,EAAExB,SAAS,CAAC4B;AACtB,CAAC;AAEDzB,aAAa,CAAC0B,YAAY,GAAG;EAC3BL,QAAQ,EAAE;AACZ,CAAC"}
|
package/react/ErrorPage.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorPage.js","names":["React","useState","PropTypes","Button","Container","Row","Col","useAppEvent","FormattedMessage","IntlProvider","getMessages","getLocale","LOCALE_CHANGED","ErrorPage","_ref","message","_useState","_useState2","_slicedToArray","locale","setLocale","reload","global","location","createElement","messages","fluid","className","id","defaultMessage","description","role","onClick","propTypes","string","defaultProps"],"sources":["../../src/react/ErrorPage.jsx"],"sourcesContent":["import React, { useState } from 'react';\nimport PropTypes from 'prop-types';\nimport {\n Button, Container, Row, Col,\n} from '@edx/paragon';\n\nimport { useAppEvent } from './hooks';\nimport {\n FormattedMessage,\n IntlProvider,\n getMessages,\n getLocale,\n LOCALE_CHANGED,\n} from '../i18n';\n\n/**\n * An error page that displays a generic message for unexpected errors. Also contains a \"Try\n * Again\" button to refresh the page.\n *\n * @memberof module:React\n * @extends {Component}\n */\nfunction ErrorPage({\n message,\n}) {\n const [locale, setLocale] = useState(getLocale());\n\n useAppEvent(LOCALE_CHANGED, () => {\n setLocale(getLocale());\n });\n\n /* istanbul ignore next */\n const reload = () => {\n global.location.reload();\n };\n\n return (\n <IntlProvider locale={locale} messages={getMessages()}>\n <Container fluid className=\"py-5 justify-content-center align-items-start text-center\">\n <Row>\n <Col>\n <p className=\"text-muted\">\n <FormattedMessage\n id=\"unexpected.error.message.text\"\n defaultMessage=\"An unexpected error occurred. Please click the button below to refresh the page.\"\n description=\"error message when an unexpected error occurs\"\n />\n </p>\n {message && (\n <div role=\"alert\" className=\"my-4\">\n <p>{message}</p>\n </div>\n )}\n <Button onClick={reload}>\n <FormattedMessage\n id=\"unexpected.error.button.text\"\n defaultMessage=\"Try again\"\n description=\"text for button that tries to reload the app by refreshing the page\"\n />\n </Button>\n </Col>\n </Row>\n </Container>\n </IntlProvider>\n );\n}\n\nErrorPage.propTypes = {\n message: PropTypes.string,\n};\n\nErrorPage.defaultProps = {\n message: null,\n};\n\nexport default ErrorPage;\n"],"mappings":";;;;;;AAAA,OAAOA,KAAK,IAAIC,QAAQ,QAAQ,OAAO;AACvC,OAAOC,SAAS,MAAM,YAAY;AAClC,SACEC,MAAM,EAAEC,SAAS,EAAEC,GAAG,EAAEC,GAAG,QACtB,cAAc;AAErB,SAASC,WAAW,QAAQ,SAAS;AACrC,SACEC,gBAAgB,EAChBC,YAAY,EACZC,WAAW,EACXC,SAAS,EACTC,cAAc,QACT,SAAS;;AAEhB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,SAASA,CAAAC,IAAA,EAEf;EAAA,IADDC,OAAO,GAAAD,IAAA,CAAPC,OAAO;EAEP,IAAAC,SAAA,GAA4Bf,QAAQ,CAACU,SAAS,
|
|
1
|
+
{"version":3,"file":"ErrorPage.js","names":["React","useState","PropTypes","Button","Container","Row","Col","useAppEvent","FormattedMessage","IntlProvider","getMessages","getLocale","LOCALE_CHANGED","ErrorPage","_ref","message","_useState","_useState2","_slicedToArray","locale","setLocale","reload","global","location","createElement","messages","fluid","className","id","defaultMessage","description","role","onClick","propTypes","string","defaultProps"],"sources":["../../src/react/ErrorPage.jsx"],"sourcesContent":["import React, { useState } from 'react';\nimport PropTypes from 'prop-types';\nimport {\n Button, Container, Row, Col,\n} from '@edx/paragon';\n\nimport { useAppEvent } from './hooks';\nimport {\n FormattedMessage,\n IntlProvider,\n getMessages,\n getLocale,\n LOCALE_CHANGED,\n} from '../i18n';\n\n/**\n * An error page that displays a generic message for unexpected errors. Also contains a \"Try\n * Again\" button to refresh the page.\n *\n * @memberof module:React\n * @extends {Component}\n */\nfunction ErrorPage({\n message,\n}) {\n const [locale, setLocale] = useState(getLocale());\n\n useAppEvent(LOCALE_CHANGED, () => {\n setLocale(getLocale());\n });\n\n /* istanbul ignore next */\n const reload = () => {\n global.location.reload();\n };\n\n return (\n <IntlProvider locale={locale} messages={getMessages()}>\n <Container fluid className=\"py-5 justify-content-center align-items-start text-center\">\n <Row>\n <Col>\n <p className=\"text-muted\">\n <FormattedMessage\n id=\"unexpected.error.message.text\"\n defaultMessage=\"An unexpected error occurred. Please click the button below to refresh the page.\"\n description=\"error message when an unexpected error occurs\"\n />\n </p>\n {message && (\n <div role=\"alert\" className=\"my-4\">\n <p>{message}</p>\n </div>\n )}\n <Button onClick={reload}>\n <FormattedMessage\n id=\"unexpected.error.button.text\"\n defaultMessage=\"Try again\"\n description=\"text for button that tries to reload the app by refreshing the page\"\n />\n </Button>\n </Col>\n </Row>\n </Container>\n </IntlProvider>\n );\n}\n\nErrorPage.propTypes = {\n message: PropTypes.string,\n};\n\nErrorPage.defaultProps = {\n message: null,\n};\n\nexport default ErrorPage;\n"],"mappings":";;;;;;AAAA,OAAOA,KAAK,IAAIC,QAAQ,QAAQ,OAAO;AACvC,OAAOC,SAAS,MAAM,YAAY;AAClC,SACEC,MAAM,EAAEC,SAAS,EAAEC,GAAG,EAAEC,GAAG,QACtB,cAAc;AAErB,SAASC,WAAW,QAAQ,SAAS;AACrC,SACEC,gBAAgB,EAChBC,YAAY,EACZC,WAAW,EACXC,SAAS,EACTC,cAAc,QACT,SAAS;;AAEhB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,SAASA,CAAAC,IAAA,EAEf;EAAA,IADDC,OAAO,GAAAD,IAAA,CAAPC,OAAO;EAEP,IAAAC,SAAA,GAA4Bf,QAAQ,CAACU,SAAS,CAAC,CAAC,CAAC;IAAAM,UAAA,GAAAC,cAAA,CAAAF,SAAA;IAA1CG,MAAM,GAAAF,UAAA;IAAEG,SAAS,GAAAH,UAAA;EAExBV,WAAW,CAACK,cAAc,EAAE,YAAM;IAChCQ,SAAS,CAACT,SAAS,CAAC,CAAC,CAAC;EACxB,CAAC,CAAC;;EAEF;EACA,IAAMU,MAAM,GAAG,SAATA,MAAMA,CAAA,EAAS;IACnBC,MAAM,CAACC,QAAQ,CAACF,MAAM,CAAC,CAAC;EAC1B,CAAC;EAED,oBACErB,KAAA,CAAAwB,aAAA,CAACf,YAAY;IAACU,MAAM,EAAEA,MAAO;IAACM,QAAQ,EAAEf,WAAW,CAAC;EAAE,gBACpDV,KAAA,CAAAwB,aAAA,CAACpB,SAAS;IAACsB,KAAK;IAACC,SAAS,EAAC;EAA2D,gBACpF3B,KAAA,CAAAwB,aAAA,CAACnB,GAAG,qBACFL,KAAA,CAAAwB,aAAA,CAAClB,GAAG,qBACFN,KAAA,CAAAwB,aAAA;IAAGG,SAAS,EAAC;EAAY,gBACvB3B,KAAA,CAAAwB,aAAA,CAAChB,gBAAgB;IACfoB,EAAE,EAAC,+BAA+B;IAClCC,cAAc,EAAC,kFAAkF;IACjGC,WAAW,EAAC;EAA+C,CAC5D,CACA,CAAC,EACHf,OAAO,iBACNf,KAAA,CAAAwB,aAAA;IAAKO,IAAI,EAAC,OAAO;IAACJ,SAAS,EAAC;EAAM,gBAChC3B,KAAA,CAAAwB,aAAA,YAAIT,OAAW,CACZ,CACN,eACDf,KAAA,CAAAwB,aAAA,CAACrB,MAAM;IAAC6B,OAAO,EAAEX;EAAO,gBACtBrB,KAAA,CAAAwB,aAAA,CAAChB,gBAAgB;IACfoB,EAAE,EAAC,8BAA8B;IACjCC,cAAc,EAAC,WAAW;IAC1BC,WAAW,EAAC;EAAqE,CAClF,CACK,CACL,CACF,CACI,CACC,CAAC;AAEnB;AAEAjB,SAAS,CAACoB,SAAS,GAAG;EACpBlB,OAAO,EAAEb,SAAS,CAACgC;AACrB,CAAC;AAEDrB,SAAS,CAACsB,YAAY,GAAG;EACvBpB,OAAO,EAAE;AACX,CAAC;AAED,eAAeF,SAAS"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OptionalReduxProvider.js","names":["React","PropTypes","Provider","OptionalReduxProvider","_ref","store","children","createElement","propTypes","object","node","isRequired","defaultProps"],"sources":["../../src/react/OptionalReduxProvider.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { Provider } from 'react-redux';\n\n/**\n * @memberof module:React\n * @param {Object} props\n */\nexport default function OptionalReduxProvider({ store, children }) {\n if (store === null) {\n return children;\n }\n\n return (\n <Provider store={store}>\n {children}\n </Provider>\n );\n}\n\nOptionalReduxProvider.propTypes = {\n store: PropTypes.object, // eslint-disable-line\n children: PropTypes.node.isRequired,\n};\n\nOptionalReduxProvider.defaultProps = {\n store: null,\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,SAASC,QAAQ,QAAQ,aAAa;;AAEtC;AACA;AACA;AACA;AACA,eAAe,SAASC,qBAAqBA,CAAAC,IAAA,EAAsB;EAAA,IAAnBC,KAAK,GAAAD,IAAA,CAALC,KAAK;IAAEC,QAAQ,GAAAF,IAAA,CAARE,QAAQ;EAC7D,IAAID,KAAK,KAAK,IAAI,EAAE;IAClB,OAAOC,QAAQ;EACjB;EAEA,oBACEN,KAAA,CAAAO,aAAA,CAACL,QAAQ;IAACG,KAAK,EAAEA;EAAM,GACpBC,
|
|
1
|
+
{"version":3,"file":"OptionalReduxProvider.js","names":["React","PropTypes","Provider","OptionalReduxProvider","_ref","store","children","createElement","propTypes","object","node","isRequired","defaultProps"],"sources":["../../src/react/OptionalReduxProvider.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { Provider } from 'react-redux';\n\n/**\n * @memberof module:React\n * @param {Object} props\n */\nexport default function OptionalReduxProvider({ store, children }) {\n if (store === null) {\n return children;\n }\n\n return (\n <Provider store={store}>\n {children}\n </Provider>\n );\n}\n\nOptionalReduxProvider.propTypes = {\n store: PropTypes.object, // eslint-disable-line\n children: PropTypes.node.isRequired,\n};\n\nOptionalReduxProvider.defaultProps = {\n store: null,\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,SAASC,QAAQ,QAAQ,aAAa;;AAEtC;AACA;AACA;AACA;AACA,eAAe,SAASC,qBAAqBA,CAAAC,IAAA,EAAsB;EAAA,IAAnBC,KAAK,GAAAD,IAAA,CAALC,KAAK;IAAEC,QAAQ,GAAAF,IAAA,CAARE,QAAQ;EAC7D,IAAID,KAAK,KAAK,IAAI,EAAE;IAClB,OAAOC,QAAQ;EACjB;EAEA,oBACEN,KAAA,CAAAO,aAAA,CAACL,QAAQ;IAACG,KAAK,EAAEA;EAAM,GACpBC,QACO,CAAC;AAEf;AAEAH,qBAAqB,CAACK,SAAS,GAAG;EAChCH,KAAK,EAAEJ,SAAS,CAACQ,MAAM;EAAE;EACzBH,QAAQ,EAAEL,SAAS,CAACS,IAAI,CAACC;AAC3B,CAAC;AAEDR,qBAAqB,CAACS,YAAY,GAAG;EACnCP,KAAK,EAAE;AACT,CAAC"}
|
package/react/PageRoute.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageRoute.js","names":["React","useEffect","Route","useRouteMatch","sendPageEvent","PageRoute","props","match","path","exact","strict","sensitive","JSON","stringify","createElement"],"sources":["../../src/react/PageRoute.jsx"],"sourcesContent":["/* eslint-disable react/prop-types */\nimport React, { useEffect } from 'react';\nimport { Route, useRouteMatch } from 'react-router-dom';\nimport { sendPageEvent } from '../analytics';\n\n/**\n * A react-router Route component that calls `sendPageEvent` when it becomes active.\n *\n * @see {@link module:frontend-platform/analytics~sendPageEvent}\n * @memberof module:React\n * @param {Object} props\n */\nexport default function PageRoute(props) {\n const match = useRouteMatch({\n path: props.path,\n exact: props.exact,\n strict: props.strict,\n sensitive: props.sensitive,\n });\n\n useEffect(() => {\n if (match) {\n sendPageEvent();\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [JSON.stringify(match)]);\n\n return (\n <Route {...props} />\n );\n}\n"],"mappings":"AAAA;AACA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,SAASC,KAAK,EAAEC,aAAa,QAAQ,kBAAkB;AACvD,SAASC,aAAa,QAAQ,cAAc;;AAE5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,SAASA,CAACC,KAAK,EAAE;EACvC,IAAMC,KAAK,GAAGJ,aAAa,CAAC;IAC1BK,IAAI,EAAEF,KAAK,CAACE,IAAI;IAChBC,KAAK,EAAEH,KAAK,CAACG,KAAK;IAClBC,MAAM,EAAEJ,KAAK,CAACI,MAAM;IACpBC,SAAS,EAAEL,KAAK,CAACK;EACnB,CAAC,CAAC;EAEFV,SAAS,CAAC,YAAM;IACd,IAAIM,KAAK,EAAE;MACTH,aAAa,
|
|
1
|
+
{"version":3,"file":"PageRoute.js","names":["React","useEffect","Route","useRouteMatch","sendPageEvent","PageRoute","props","match","path","exact","strict","sensitive","JSON","stringify","createElement"],"sources":["../../src/react/PageRoute.jsx"],"sourcesContent":["/* eslint-disable react/prop-types */\nimport React, { useEffect } from 'react';\nimport { Route, useRouteMatch } from 'react-router-dom';\nimport { sendPageEvent } from '../analytics';\n\n/**\n * A react-router Route component that calls `sendPageEvent` when it becomes active.\n *\n * @see {@link module:frontend-platform/analytics~sendPageEvent}\n * @memberof module:React\n * @param {Object} props\n */\nexport default function PageRoute(props) {\n const match = useRouteMatch({\n path: props.path,\n exact: props.exact,\n strict: props.strict,\n sensitive: props.sensitive,\n });\n\n useEffect(() => {\n if (match) {\n sendPageEvent();\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [JSON.stringify(match)]);\n\n return (\n <Route {...props} />\n );\n}\n"],"mappings":"AAAA;AACA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,SAASC,KAAK,EAAEC,aAAa,QAAQ,kBAAkB;AACvD,SAASC,aAAa,QAAQ,cAAc;;AAE5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,SAASA,CAACC,KAAK,EAAE;EACvC,IAAMC,KAAK,GAAGJ,aAAa,CAAC;IAC1BK,IAAI,EAAEF,KAAK,CAACE,IAAI;IAChBC,KAAK,EAAEH,KAAK,CAACG,KAAK;IAClBC,MAAM,EAAEJ,KAAK,CAACI,MAAM;IACpBC,SAAS,EAAEL,KAAK,CAACK;EACnB,CAAC,CAAC;EAEFV,SAAS,CAAC,YAAM;IACd,IAAIM,KAAK,EAAE;MACTH,aAAa,CAAC,CAAC;IACjB;IACF;EACA,CAAC,EAAE,CAACQ,IAAI,CAACC,SAAS,CAACN,KAAK,CAAC,CAAC,CAAC;EAE3B,oBACEP,KAAA,CAAAc,aAAA,CAACZ,KAAK,EAAKI,KAAQ,CAAC;AAExB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initializeMockApp.js","names":["configure","configureAnalytics","MockAnalyticsService","configureI18n","configureLogging","MockLoggingService","configureAuth","MockAuthService","getConfig","mockMessages","initializeMockApp","_ref","arguments","length","undefined","_ref$messages","messages","_ref$authenticatedUse","authenticatedUser","loggingService","config","authService","_objectSpread","analyticsService","httpClient","getAuthenticatedHttpClient"],"sources":["../../src/testing/initializeMockApp.js"],"sourcesContent":["import { configure as configureAnalytics, MockAnalyticsService } from '../analytics';\nimport { configure as configureI18n } from '../i18n';\nimport { configure as configureLogging, MockLoggingService } from '../logging';\nimport { configure as configureAuth, MockAuthService } from '../auth';\nimport { getConfig } from '../config';\nimport mockMessages from './mockMessages';\n\n/**\n * Initializes a mock application for component testing. The mock application includes\n * mock analytics, auth, and logging services, and the real i18n service.\n *\n * See MockAnalyticsService, MockAuthService, and MockLoggingService for mock implementation\n * details. For the most part, the analytics and logging services just implement their functions\n * with jest.fn() and do nothing else, whereas the MockAuthService actually has some behavior\n * implemented, it just doesn't make any HTTP calls.\n *\n * Note that this mock application is not sufficient for testing the full application lifecycle or\n * initialization callbacks/custom handlers as described in the 'initialize' function's\n * documentation. It exists merely to set up the mock services that components themselves tend to\n * interact with most often. It could be extended to allow for setting up custom handlers fairly\n * easily, as this functionality would be more-or-less identical to what the real initialize\n * function does.\n *\n * Example:\n *\n * ```\n * import { initializeMockApp } from '@edx/frontend-platform/testing';\n * import { logInfo } from '@edx/frontend-platform/logging';\n *\n * describe('initializeMockApp', () => {\n * it('mocks things correctly', () => {\n * const { loggingService } = initializeMockApp();\n * logInfo('test', {});\n * expect(loggingService.logInfo).toHaveBeenCalledWith('test', {});\n * });\n * });\n * ```\n *\n * @param {Object} [options]\n * @param {*} [options.messages] A i18n-compatible messages object, or an array of such objects. If\n * an array is provided, duplicate keys are resolved with the last-one-in winning.\n * @param {UserData|null} [options.authenticatedUser] A UserData object representing the\n * authenticated user. This is passed directly to MockAuthService.\n * @memberof module:Testing\n */\nexport default function initializeMockApp({\n messages = mockMessages,\n authenticatedUser = null,\n} = {}) {\n const loggingService = configureLogging(MockLoggingService, {\n config: getConfig(),\n });\n\n const authService = configureAuth(MockAuthService, {\n config: { ...getConfig(), authenticatedUser },\n loggingService,\n });\n\n const analyticsService = configureAnalytics(MockAnalyticsService, {\n config: getConfig(),\n httpClient: authService.getAuthenticatedHttpClient(),\n loggingService,\n });\n\n // The i18n service configure function has no return value, since there isn't a service class.\n configureI18n({\n config: getConfig(),\n loggingService,\n messages,\n });\n\n return {\n analyticsService,\n authService,\n loggingService,\n };\n}\n"],"mappings":";;;;;;AAAA,SAASA,SAAS,IAAIC,kBAAkB,EAAEC,oBAAoB,QAAQ,cAAc;AACpF,SAASF,SAAS,IAAIG,aAAa,QAAQ,SAAS;AACpD,SAASH,SAAS,IAAII,gBAAgB,EAAEC,kBAAkB,QAAQ,YAAY;AAC9E,SAASL,SAAS,IAAIM,aAAa,EAAEC,eAAe,QAAQ,SAAS;AACrE,SAASC,SAAS,QAAQ,WAAW;AACrC,OAAOC,YAAY,MAAM,gBAAgB;;AAEzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,iBAAiBA,CAAA,EAGjC;EAAA,IAAAC,IAAA,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAJ,CAAC,CAAC;IAAAG,aAAA,GAAAJ,IAAA,CAFJK,QAAQ;IAARA,QAAQ,GAAAD,aAAA,cAAGN,YAAY,GAAAM,aAAA;IAAAE,qBAAA,GAAAN,IAAA,CACvBO,iBAAiB;IAAjBA,iBAAiB,GAAAD,qBAAA,cAAG,IAAI,GAAAA,qBAAA;EAExB,IAAME,cAAc,GAAGf,gBAAgB,CAACC,kBAAkB,EAAE;IAC1De,MAAM,EAAEZ,SAAS;
|
|
1
|
+
{"version":3,"file":"initializeMockApp.js","names":["configure","configureAnalytics","MockAnalyticsService","configureI18n","configureLogging","MockLoggingService","configureAuth","MockAuthService","getConfig","mockMessages","initializeMockApp","_ref","arguments","length","undefined","_ref$messages","messages","_ref$authenticatedUse","authenticatedUser","loggingService","config","authService","_objectSpread","analyticsService","httpClient","getAuthenticatedHttpClient"],"sources":["../../src/testing/initializeMockApp.js"],"sourcesContent":["import { configure as configureAnalytics, MockAnalyticsService } from '../analytics';\nimport { configure as configureI18n } from '../i18n';\nimport { configure as configureLogging, MockLoggingService } from '../logging';\nimport { configure as configureAuth, MockAuthService } from '../auth';\nimport { getConfig } from '../config';\nimport mockMessages from './mockMessages';\n\n/**\n * Initializes a mock application for component testing. The mock application includes\n * mock analytics, auth, and logging services, and the real i18n service.\n *\n * See MockAnalyticsService, MockAuthService, and MockLoggingService for mock implementation\n * details. For the most part, the analytics and logging services just implement their functions\n * with jest.fn() and do nothing else, whereas the MockAuthService actually has some behavior\n * implemented, it just doesn't make any HTTP calls.\n *\n * Note that this mock application is not sufficient for testing the full application lifecycle or\n * initialization callbacks/custom handlers as described in the 'initialize' function's\n * documentation. It exists merely to set up the mock services that components themselves tend to\n * interact with most often. It could be extended to allow for setting up custom handlers fairly\n * easily, as this functionality would be more-or-less identical to what the real initialize\n * function does.\n *\n * Example:\n *\n * ```\n * import { initializeMockApp } from '@edx/frontend-platform/testing';\n * import { logInfo } from '@edx/frontend-platform/logging';\n *\n * describe('initializeMockApp', () => {\n * it('mocks things correctly', () => {\n * const { loggingService } = initializeMockApp();\n * logInfo('test', {});\n * expect(loggingService.logInfo).toHaveBeenCalledWith('test', {});\n * });\n * });\n * ```\n *\n * @param {Object} [options]\n * @param {*} [options.messages] A i18n-compatible messages object, or an array of such objects. If\n * an array is provided, duplicate keys are resolved with the last-one-in winning.\n * @param {UserData|null} [options.authenticatedUser] A UserData object representing the\n * authenticated user. This is passed directly to MockAuthService.\n * @memberof module:Testing\n */\nexport default function initializeMockApp({\n messages = mockMessages,\n authenticatedUser = null,\n} = {}) {\n const loggingService = configureLogging(MockLoggingService, {\n config: getConfig(),\n });\n\n const authService = configureAuth(MockAuthService, {\n config: { ...getConfig(), authenticatedUser },\n loggingService,\n });\n\n const analyticsService = configureAnalytics(MockAnalyticsService, {\n config: getConfig(),\n httpClient: authService.getAuthenticatedHttpClient(),\n loggingService,\n });\n\n // The i18n service configure function has no return value, since there isn't a service class.\n configureI18n({\n config: getConfig(),\n loggingService,\n messages,\n });\n\n return {\n analyticsService,\n authService,\n loggingService,\n };\n}\n"],"mappings":";;;;;;AAAA,SAASA,SAAS,IAAIC,kBAAkB,EAAEC,oBAAoB,QAAQ,cAAc;AACpF,SAASF,SAAS,IAAIG,aAAa,QAAQ,SAAS;AACpD,SAASH,SAAS,IAAII,gBAAgB,EAAEC,kBAAkB,QAAQ,YAAY;AAC9E,SAASL,SAAS,IAAIM,aAAa,EAAEC,eAAe,QAAQ,SAAS;AACrE,SAASC,SAAS,QAAQ,WAAW;AACrC,OAAOC,YAAY,MAAM,gBAAgB;;AAEzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,iBAAiBA,CAAA,EAGjC;EAAA,IAAAC,IAAA,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAJ,CAAC,CAAC;IAAAG,aAAA,GAAAJ,IAAA,CAFJK,QAAQ;IAARA,QAAQ,GAAAD,aAAA,cAAGN,YAAY,GA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