@edx/frontend-app-subscription-learner-dashboard 1.68.1 → 1.69.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/dist/Main.js +5 -2
- package/dist/Main.js.map +1 -1
- package/dist/containers/RecommendationsRailsPanel/Recommendations/index.js +3 -1
- package/dist/containers/RecommendationsRailsPanel/Recommendations/index.js.map +1 -1
- package/dist/data/services/segment/AnalyticsPageWrap.d.ts +9 -0
- package/dist/data/services/segment/AnalyticsPageWrap.js +14 -0
- package/dist/data/services/segment/AnalyticsPageWrap.js.map +1 -0
- package/dist/data/services/segment/utils.js +4 -1
- package/dist/data/services/segment/utils.js.map +1 -1
- package/package.json +1 -1
package/dist/Main.js
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { CurrentAppProvider
|
|
2
|
+
import { CurrentAppProvider } from '@openedx/frontend-base';
|
|
3
|
+
import AnalyticsPageWrap from './data/services/segment/AnalyticsPageWrap';
|
|
3
4
|
import { appId } from './constants';
|
|
4
5
|
import ContextProviders from './data/context';
|
|
5
6
|
import Dashboard from './containers/Dashboard';
|
|
6
7
|
import { SubscriptionInformation } from './containers/SubscriptionInformation';
|
|
7
8
|
import './style.scss';
|
|
8
|
-
const Main = () => (_jsx(CurrentAppProvider, { appId: appId, children: _jsx(ContextProviders, { children: _jsxs(
|
|
9
|
+
const Main = () => (_jsx(CurrentAppProvider, { appId: appId, children: _jsx(ContextProviders, { children: _jsxs(AnalyticsPageWrap, { pageName: `Subscription Dashboard`, properties: {
|
|
10
|
+
category: 'Subscription'
|
|
11
|
+
}, children: [_jsx(Dashboard, {}), _jsx(SubscriptionInformation, {})] }) }) }));
|
|
9
12
|
export default Main;
|
|
10
13
|
//# sourceMappingURL=Main.js.map
|
package/dist/Main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Main.js","sourceRoot":"","sources":["../src/Main.jsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,kBAAkB,EAAE,
|
|
1
|
+
{"version":3,"file":"Main.js","sourceRoot":"","sources":["../src/Main.jsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,iBAAiB,MAAM,2CAA2C,CAAC;AAE1E,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,gBAAgB,MAAM,gBAAgB,CAAC;AAC9C,OAAO,SAAS,MAAM,wBAAwB,CAAC;AAC/C,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAE/E,OAAO,cAAc,CAAC;AAEtB,MAAM,IAAI,GAAG,GAAG,EAAE,CAAC,CACjB,KAAC,kBAAkB,IAAC,KAAK,EAAE,KAAK,YAC9B,KAAC,gBAAgB,cACf,MAAC,iBAAiB,IAAC,QAAQ,EAAE,wBAAwB,EAAE,UAAU,EAAE;gBACjE,QAAQ,EAAE,cAAc;aACzB,aACC,KAAC,SAAS,KAAG,EACb,KAAC,uBAAuB,KAAG,IACT,GACH,GACA,CACtB,CAAC;AAEF,eAAe,IAAI,CAAC","sourcesContent":["import { CurrentAppProvider } from '@openedx/frontend-base';\nimport AnalyticsPageWrap from './data/services/segment/AnalyticsPageWrap';\n\nimport { appId } from './constants';\nimport ContextProviders from './data/context';\nimport Dashboard from './containers/Dashboard';\nimport { SubscriptionInformation } from './containers/SubscriptionInformation';\n\nimport './style.scss';\n\nconst Main = () => (\n <CurrentAppProvider appId={appId}>\n <ContextProviders>\n <AnalyticsPageWrap pageName={`Subscription Dashboard`} properties={{\n category: 'Subscription'\n }}>\n <Dashboard />\n <SubscriptionInformation />\n </AnalyticsPageWrap>\n </ContextProviders>\n </CurrentAppProvider>\n);\n\nexport default Main;\n"]}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { ProductCard } from '../../ProductCard';
|
|
3
|
+
import { useGridKeyboardNavigation } from '../../../hooks/useGridKeyboardNavigation';
|
|
3
4
|
export const Recommendations = ({ items }) => {
|
|
4
|
-
|
|
5
|
+
const { gridRef, registerCard, handleKeyDown, setFocusedIndex } = useGridKeyboardNavigation({ columns: 4 });
|
|
6
|
+
return (_jsx("div", { "data-testid": "popular-courses-items", ref: gridRef, tabIndex: 0, onKeyDown: handleKeyDown, children: _jsx("div", { className: "row g-3 flex-nowrap flex-md-wrap overflow-auto", children: items.map((item, index) => (_jsx("div", { ref: node => registerCard(index, node), tabIndex: 0, className: "col-12 col-md-6 col-xl-3 d-flex mb-2", onFocus: () => setFocusedIndex(index), children: _jsx(ProductCard, { item: item }) }, item.objectID))) }) }));
|
|
5
7
|
};
|
|
6
8
|
export default Recommendations;
|
|
7
9
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/containers/RecommendationsRailsPanel/Recommendations/index.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/containers/RecommendationsRailsPanel/Recommendations/index.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAC;AAGjF,MAAM,CAAC,MAAM,eAAe,GAA6B,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACrE,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,eAAe,EAAE,GAAG,yBAAyB,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC;IAE5G,OAAO,CACL,6BACc,uBAAuB,EACnC,GAAG,EAAE,OAAO,EACZ,QAAQ,EAAE,CAAC,EACX,SAAS,EAAE,aAAa,YAExB,cAAK,SAAS,EAAC,gDAAgD,YAC5D,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,CAC1B,cAEE,GAAG,EAAE,IAAI,CAAC,EAAE,CAAC,YAAY,CAAC,KAAK,EAAE,IAAI,CAAC,EACtC,QAAQ,EAAE,CAAC,EACX,SAAS,EAAC,sCAAsC,EAChD,OAAO,EAAE,GAAG,EAAE,CAAC,eAAe,CAAC,KAAK,CAAC,YAErC,KAAC,WAAW,IAAC,IAAI,EAAE,IAAI,GAAI,IANtB,IAAI,CAAC,QAAQ,CAOd,CACP,CAAC,GACE,GACF,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,eAAe,CAAC","sourcesContent":["import { FC } from 'react';\n\nimport { ProductCard } from '../../ProductCard';\nimport { useGridKeyboardNavigation } from '@src/hooks/useGridKeyboardNavigation';\nimport { RecommendationsProps } from './data/types';\n\nexport const Recommendations: FC<RecommendationsProps> = ({ items }) => {\n const { gridRef, registerCard, handleKeyDown, setFocusedIndex } = useGridKeyboardNavigation({ columns: 4 });\n\n return (\n <div\n data-testid=\"popular-courses-items\"\n ref={gridRef}\n tabIndex={0}\n onKeyDown={handleKeyDown}\n >\n <div className=\"row g-3 flex-nowrap flex-md-wrap overflow-auto\">\n {items.map((item, index) => (\n <div\n key={item.objectID}\n ref={node => registerCard(index, node)}\n tabIndex={0}\n className=\"col-12 col-md-6 col-xl-3 d-flex mb-2\"\n onFocus={() => setFocusedIndex(index)}\n >\n <ProductCard item={item} />\n </div>\n ))}\n </div>\n </div>\n );\n};\n\nexport default Recommendations;\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
interface Props {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
category?: string;
|
|
5
|
+
pageName?: string;
|
|
6
|
+
properties?: Record<string, unknown>;
|
|
7
|
+
}
|
|
8
|
+
declare const AnalyticsPageWrap: ({ children, category, pageName, properties }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export default AnalyticsPageWrap;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect } from 'react';
|
|
3
|
+
import { useLocation } from 'react-router-dom';
|
|
4
|
+
import { sendPageEvent } from '@openedx/frontend-base';
|
|
5
|
+
const AnalyticsPageWrap = ({ children, category, pageName, properties = {} }) => {
|
|
6
|
+
const location = useLocation();
|
|
7
|
+
useEffect(() => {
|
|
8
|
+
sendPageEvent(category, pageName, Object.assign({ app: 'learner-home', path: location.pathname }, properties));
|
|
9
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
10
|
+
}, [location.pathname]);
|
|
11
|
+
return _jsx(_Fragment, { children: children });
|
|
12
|
+
};
|
|
13
|
+
export default AnalyticsPageWrap;
|
|
14
|
+
//# sourceMappingURL=AnalyticsPageWrap.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AnalyticsPageWrap.js","sourceRoot":"","sources":["../../../../src/data/services/segment/AnalyticsPageWrap.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAa,SAAS,EAAE,MAAM,OAAO,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AASvD,MAAM,iBAAiB,GAAG,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,GAAG,EAAE,EAAS,EAAE,EAAE;IACrF,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;IAE/B,SAAS,CAAC,GAAG,EAAE;QACb,aAAa,CAAC,QAAQ,EAAE,QAAQ,kBAC9B,GAAG,EAAE,cAAc,EACnB,IAAI,EAAE,QAAQ,CAAC,QAAQ,IACpB,UAAU,EACb,CAAC;QACH,uDAAuD;IACzD,CAAC,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC;IAExB,OAAO,4BAAG,QAAQ,GAAI,CAAC;AACzB,CAAC,CAAC;AAEF,eAAe,iBAAiB,CAAC","sourcesContent":["import { ReactNode, useEffect } from 'react';\nimport { useLocation } from 'react-router-dom';\nimport { sendPageEvent } from '@openedx/frontend-base';\n\ninterface Props {\n children: ReactNode,\n category?: string,\n pageName?: string,\n properties?: Record<string, unknown>,\n}\n\nconst AnalyticsPageWrap = ({ children, category, pageName, properties = {} }: Props) => {\n const location = useLocation();\n\n useEffect(() => {\n sendPageEvent(category, pageName, {\n app: 'learner-home',\n path: location.pathname,\n ...properties,\n });\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [location.pathname]);\n\n return <>{children}</>;\n};\n\nexport default AnalyticsPageWrap;\n"]}
|
|
@@ -2,7 +2,10 @@ import { sendTrackEvent } from '@openedx/frontend-base';
|
|
|
2
2
|
import { appName } from '../../../tracking/constants';
|
|
3
3
|
import { getCommonTrackingProps } from '../../../tracking';
|
|
4
4
|
export const LINK_TIMEOUT = 300;
|
|
5
|
-
export const createEventTracker = (name, options = {}) => () =>
|
|
5
|
+
export const createEventTracker = (name, options = {}) => () => {
|
|
6
|
+
const { payment_method, opt_in } = getCommonTrackingProps();
|
|
7
|
+
return sendTrackEvent(name, Object.assign(Object.assign({}, options), { app_name: appName, payment_method, opt_in }));
|
|
8
|
+
};
|
|
6
9
|
export const createLinkTracker = (tracker, href) => (e) => {
|
|
7
10
|
e.preventDefault();
|
|
8
11
|
tracker();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/data/services/segment/utils.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAE3D,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,CAAC;AAEhC,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,IAAI,EAAE,OAAO,GAAG,EAAE,EAAE,EAAE,CAAC,GAAG,EAAE,CAAC,cAAc,
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/data/services/segment/utils.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAE3D,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,CAAC;AAEhC,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,IAAI,EAAE,OAAO,GAAG,EAAE,EAAE,EAAE,CAAC,GAAG,EAAE;IAC7D,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,GAAG,sBAAsB,EAAE,CAAC;IAC5D,OAAO,cAAc,CACnB,IAAI,kCACC,OAAO,KAAE,QAAQ,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,IACxD,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE;IACxD,CAAC,CAAC,cAAc,EAAE,CAAC;IACnB,OAAO,EAAE,CAAC;IACV,OAAO,UAAU,CAAC,GAAG,EAAE;QACrB,MAAM,CAAC,QAAQ,CAAC,IAAI,GAAG,IAAI,CAAC;IAC9B,CAAC,EAAE,YAAY,CAAC,CAAC;AACnB,CAAC,CAAC","sourcesContent":["import { sendTrackEvent } from '@openedx/frontend-base';\nimport { appName } from '../../../tracking/constants';\nimport { getCommonTrackingProps } from '../../../tracking';\n\nexport const LINK_TIMEOUT = 300;\n\nexport const createEventTracker = (name, options = {}) => () => {\n const { payment_method, opt_in } = getCommonTrackingProps();\n return sendTrackEvent(\n name,\n { ...options, app_name: appName, payment_method, opt_in },\n );\n};\n\nexport const createLinkTracker = (tracker, href) => (e) => {\n e.preventDefault();\n tracker();\n return setTimeout(() => {\n global.location.href = href;\n }, LINK_TIMEOUT);\n};\n"]}
|