@epec-fcfm-uchile/frontend-component-header 1.0.37 → 1.0.39

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.
@@ -8,6 +8,9 @@ import LogoSlot from '../plugin-slots/LogoSlot';
8
8
  import CourseInfoSlot from '../plugin-slots/CourseInfoSlot';
9
9
  import { courseInfoDataShape } from './LearningHeaderCourseInfo';
10
10
  import messages from './messages';
11
+ import Cookies from 'js-cookie';
12
+ var login_subdomain = Cookies.get('_epec_session_subdomain');
13
+ var login_domain = typeof login_subdomain === 'string' && login_subdomain ? "".concat(login_subdomain.trim().toLowerCase().replace(/[^a-z]/g, ''), ".fcfmonline.cl") : 'app.fcfmonline.cl';
11
14
  var LearningHeader = function LearningHeader(_ref) {
12
15
  var courseOrg = _ref.courseOrg,
13
16
  courseNumber = _ref.courseNumber,
@@ -17,7 +20,7 @@ var LearningHeader = function LearningHeader(_ref) {
17
20
  var _useContext = useContext(AppContext),
18
21
  authenticatedUser = _useContext.authenticatedUser;
19
22
  var headerLogo = /*#__PURE__*/React.createElement(LogoSlot, {
20
- href: "".concat(getConfig().LMS_BASE_URL, "/dashboard"),
23
+ href: "https://".concat(login_domain, "/"),
21
24
  src: getConfig().LOGO_URL,
22
25
  alt: getConfig().SITE_NAME
23
26
  });
@@ -1 +1 @@
1
- {"version":3,"file":"LearningHeader.js","names":["React","useContext","PropTypes","getConfig","useIntl","AppContext","AuthenticatedUserDropdown","LogoSlot","CourseInfoSlot","courseInfoDataShape","messages","LearningHeader","_ref","courseOrg","courseNumber","courseTitle","showUserDropdown","intl","_useContext","authenticatedUser","headerLogo","createElement","href","concat","LMS_BASE_URL","src","LOGO_URL","alt","SITE_NAME","className","formatMessage","skipNavLink","style","lineHeight","Fragment","username","email","propTypes","bool","defaultProps"],"sources":["../../src/learning-header/LearningHeader.jsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport PropTypes from 'prop-types';\nimport { getConfig } from '@edx/frontend-platform';\nimport { useIntl } from '@edx/frontend-platform/i18n';\nimport { AppContext } from '@edx/frontend-platform/react';\n\nimport AuthenticatedUserDropdown from './AuthenticatedUserDropdown';\nimport LogoSlot from '../plugin-slots/LogoSlot';\nimport CourseInfoSlot from '../plugin-slots/CourseInfoSlot';\nimport { courseInfoDataShape } from './LearningHeaderCourseInfo';\nimport messages from './messages';\n\nconst LearningHeader = ({\n courseOrg,\n courseNumber,\n courseTitle,\n showUserDropdown,\n}) => {\n const intl = useIntl();\n const { authenticatedUser } = useContext(AppContext);\n\n const headerLogo = (\n <LogoSlot\n href={`${getConfig().LMS_BASE_URL}/dashboard`}\n src={getConfig().LOGO_URL}\n alt={getConfig().SITE_NAME}\n />\n );\n\n return (\n <header className=\"learning-header align-items-center\">\n <a className=\"sr-only sr-only-focusable\" href=\"#main-content\">{intl.formatMessage(messages.skipNavLink)}</a>\n <div className=\"d-flex align-items-center px-1 px-sm-3 sub-learning-header justify-content-between\">\n {headerLogo}\n <div className=\"flex-grow-1 course-title-lockup d-none d-sm-flex\" style={{ lineHeight: 1 }}>\n <CourseInfoSlot courseOrg={courseOrg} courseNumber={courseNumber} courseTitle={courseTitle} />\n </div>\n {showUserDropdown && authenticatedUser && (\n <>\n <AuthenticatedUserDropdown\n username={authenticatedUser.username} email={authenticatedUser.email}\n />\n </>\n )}\n {showUserDropdown && !authenticatedUser && (\n <div></div>\n )}\n </div>\n </header>\n );\n};\n\nLearningHeader.propTypes = {\n courseOrg: courseInfoDataShape.courseOrg,\n courseNumber: courseInfoDataShape.courseNumber,\n courseTitle: courseInfoDataShape.courseTitle,\n showUserDropdown: PropTypes.bool,\n};\n\nLearningHeader.defaultProps = {\n courseOrg: null,\n courseNumber: null,\n courseTitle: null,\n showUserDropdown: true,\n};\n\nexport default LearningHeader;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,UAAU,QAAQ,OAAO;AACzC,OAAOC,SAAS,MAAM,YAAY;AAClC,SAASC,SAAS,QAAQ,wBAAwB;AAClD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AU,EAAE;IAAE;EAAE,gBACzFjC,KAAA,CAAAqB,aAAA,CAACb,cAAc;IAACK,SAAS,EAAEA,SAAU;IAACC,YAAY,EAAEA,YAAa;IAACC,WAAW,EAAEA;EAAY,CAAE,CAC1F,CAAC,EACLC,gBAAgB,IAAIG,iBAAiB,iBACtCnB,KAAA,CAAAqB,aAAA,CAAArB,KAAA,CAAAkC,QAAA,qBACElC,KAAA,CAAAqB,aAAA,CAACf,yBAAyB;IACxB6B,QAAQ,EAAEhB,iBAAiB,CAACgB,QAAS;IAACC,KAAK,EAAEjB,iBAAiB,CAACiB;EAAM,CACtE,CACD,CACD,EACApB,gBAAgB,IAAI,CAACG,iBAAiB,iBACvCnB,KAAA,CAAAqB,aAAA,YAAU,CAEP,CACC,CAAC;AAEb,CAAC;AAEDV,cAAc,CAAC0B,SAAS,GAAG;EACzBxB,SAAS,EAAEJ,mBAAmB,CAACI,SAAS;EACxCC,YAAY,EAAEL,mBAAmB,CAACK,YAAY;EAC9CC,WAAW,EAAEN,mBAAmB,CAACM,WAAW;EAC5CC,gBAAgB,EAAEd,SAAS,CAACoC;AAC9B,CAAC;AAED3B,cAAc,CAAC4B,YAAY,GAAG;EAC5B1B,SAAS,EAAE,IAAI;EACfC,YAAY,EAAE,IAAI;EAClBC,WAAW,EAAE,IAAI;EACjBC,gBAAgB,EAAE;AACpB,CAAC;AAED,eAAeL,cAAc","ignoreList":[]}
1
+ {"version":3,"file":"LearningHeader.js","names":["React","useContext","PropTypes","getConfig","useIntl","AppContext","AuthenticatedUserDropdown","LogoSlot","CourseInfoSlot","courseInfoDataShape","messages","Cookies","login_subdomain","get","login_domain","concat","trim","toLowerCase","replace","LearningHeader","_ref","courseOrg","courseNumber","courseTitle","showUserDropdown","intl","_useContext","authenticatedUser","headerLogo","createElement","href","src","LOGO_URL","alt","SITE_NAME","className","formatMessage","skipNavLink","style","lineHeight","Fragment","username","email","propTypes","bool","defaultProps"],"sources":["../../src/learning-header/LearningHeader.jsx"],"sourcesContent":["import React, { useContext } from 'react';\nimport PropTypes from 'prop-types';\nimport { getConfig } from '@edx/frontend-platform';\nimport { useIntl } from '@edx/frontend-platform/i18n';\nimport { AppContext } from '@edx/frontend-platform/react';\n\nimport AuthenticatedUserDropdown from './AuthenticatedUserDropdown';\nimport LogoSlot from '../plugin-slots/LogoSlot';\nimport CourseInfoSlot from '../plugin-slots/CourseInfoSlot';\nimport { courseInfoDataShape } from './LearningHeaderCourseInfo';\nimport messages from './messages';\nimport Cookies from 'js-cookie';\nconst login_subdomain = Cookies.get('_epec_session_subdomain');\nconst login_domain = (typeof login_subdomain ==='string' && login_subdomain)?`${login_subdomain.trim().toLowerCase().replace(/[^a-z]/g, '')}.fcfmonline.cl`:'app.fcfmonline.cl';\n\nconst LearningHeader = ({\n courseOrg,\n courseNumber,\n courseTitle,\n showUserDropdown,\n}) => {\n const intl = useIntl();\n const { authenticatedUser } = useContext(AppContext);\n\n const headerLogo = (\n <LogoSlot\n href={`https://${login_domain}/`}\n src={getConfig().LOGO_URL}\n alt={getConfig().SITE_NAME}\n />\n );\n\n return (\n <header className=\"learning-header align-items-center\">\n <a className=\"sr-only sr-only-focusable\" href=\"#main-content\">{intl.formatMessage(messages.skipNavLink)}</a>\n <div className=\"d-flex align-items-center px-1 px-sm-3 sub-learning-header justify-content-between\">\n {headerLogo}\n <div className=\"flex-grow-1 course-title-lockup d-none d-sm-flex\" style={{ lineHeight: 1 }}>\n <CourseInfoSlot courseOrg={courseOrg} courseNumber={courseNumber} courseTitle={courseTitle} />\n </div>\n {showUserDropdown && authenticatedUser && (\n <>\n <AuthenticatedUserDropdown\n username={authenticatedUser.username} email={authenticatedUser.email}\n />\n </>\n )}\n {showUserDropdown && !authenticatedUser && (\n <div></div>\n )}\n </div>\n </header>\n );\n};\n\nLearningHeader.propTypes = {\n courseOrg: courseInfoDataShape.courseOrg,\n courseNumber: courseInfoDataShape.courseNumber,\n courseTitle: courseInfoDataShape.courseTitle,\n showUserDropdown: PropTypes.bool,\n};\n\nLearningHeader.defaultProps = {\n courseOrg: null,\n courseNumber: null,\n courseTitle: null,\n showUserDropdown: true,\n};\n\nexport default LearningHeader;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,UAAU,QAAQ,OAAO;AACzC,OAAOC,SAAS,MAAM,YAAY;AAClC,SAASC,SAAS,QAAQ,wBAAwB;AAClD,SAASC,OAAO,QAAQ,6BAA6B;AACrD,SAASC,UAAU,QAAQ,8BAA8B;AAEzD,OAAOC,yBAAyB,MAAM,6BAA6B;AACnE,OAAOC,QAAQ,MAAM,0BAA0B;AAC/C,OAAOC,cAAc,MAAM,gCAAgC;AAC3D,SAASC,mBAAmB,QAAQ,4BAA4B;AAChE,OAAOC,QAAQ,MAAM,YAAY;AACjC,OAAOC,OAAO,MAAM,WAAW;AAC/B,IAAMC,eAAe,GAAGD,OAAO,CAACE,GAAG,CAAC,yBAAyB,CAAC;AAC9D,IAAMC,YAAY,GAAI,OAAOF,eAAe,KAAI,QAAQ,IAAIA,eAAe,MAAAG,MAAA,CAAKH,eAAe,CAACI,IAAI,CAAC,CAAC,CAACC,WAAW,CAAC,CAAC,CAACC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,sBAAiB,mBAAmB;AAE/K,IAAMC,cAAc,GAAG,SAAjBA,cAAcA,CAAAC,IAAA,EAKd;EAAA,IAJJC,SAAS,GAAAD,IAAA,CAATC,SAAS;IACTC,YAAY,GAAAF,IAAA,CAAZE,YAAY;IACZC,WAAW,GAAAH,IAAA,CAAXG,WAAW;IACXC,gBAAgB,GAAAJ,IAAA,CAAhBI,gBAAgB;EAEhB,IAAMC,IAAI,GAAGrB,OAAO,CAAC,CAAC;EACtB,IAAAsB,WAAA,GAA8BzB,UAAU,CAACI,UAAU,CAAC;IAA5CsB,iBAAiB,GAAAD,WAAA,CAAjBC,iBAAiB;EAEzB,IAAMC,UAAU,gBACd5B,KAAA,CAAA6B,aAAA,CAACtB,QAAQ;IACPuB,IAAI,aAAAf,MAAA,CAAa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AAG;EAC5BxB,SAAS,EAAE,IAAI;EACfC,YAAY,EAAE,IAAI;EAClBC,WAAW,EAAE,IAAI;EACjBC,gBAAgB,EAAE;AACpB,CAAC;AAED,eAAeL,cAAc","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epec-fcfm-uchile/frontend-component-header",
3
- "version": "1.0.37",
3
+ "version": "1.0.39",
4
4
  "description": "The standard header for Open edX",
5
5
  "main": "dist/index.js",
6
6
  "publishConfig": {