Skip to content

Commit

Permalink
Removed the enterprise-specific code
Browse files Browse the repository at this point in the history
  • Loading branch information
asadiqbal08 committed Oct 27, 2021
1 parent 6876b42 commit e26aa41
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 46 deletions.
4 changes: 1 addition & 3 deletions src/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ $white: #fff;

.learning-header {
min-width: 0;
background-color: red;


.course-title-lockup {
min-width: 0;

Expand All @@ -43,7 +42,6 @@ $white: #fff;
.user-dropdown {
.btn {
height: 3rem;
background: red;
@media (max-width: -1 + map-get($grid-breakpoints, "sm")) {
padding: 0 0.5rem;
}
Expand Down
29 changes: 4 additions & 25 deletions src/learning-header/AuthenticatedUserDropdown.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,13 @@ import { Dropdown } from '@edx/paragon';

import messages from './messages';

function AuthenticatedUserDropdown({ enterpriseLearnerPortalLink, intl, username }) {
function AuthenticatedUserDropdown({ intl, username }) {
let dashboardMenuItem = (
<Dropdown.Item href={`${getConfig().LMS_BASE_URL}/dashboard`}>
{intl.formatMessage(messages.dashboard)}
</Dropdown.Item>
);
if (enterpriseLearnerPortalLink && Object.keys(enterpriseLearnerPortalLink).length > 0) {
dashboardMenuItem = (
<Dropdown.Item href={enterpriseLearnerPortalLink.href}>
{enterpriseLearnerPortalLink.content}
</Dropdown.Item>
);
}

return (
<>
<a className="text-gray-700 mr-3" href={`${getConfig().SUPPORT_URL}`}>{intl.formatMessage(messages.help)}</a>
Expand All @@ -41,15 +35,9 @@ function AuthenticatedUserDropdown({ enterpriseLearnerPortalLink, intl, username
<Dropdown.Item href={`${getConfig().LMS_BASE_URL}/account/settings`}>
{intl.formatMessage(messages.account)}
</Dropdown.Item>
{!enterpriseLearnerPortalLink && (
// Users should only see Order History if they do not have an available
// learner portal, because an available learner portal currently means
// that they access content via Subscriptions, in which context an "order"
// is not relevant.
<Dropdown.Item href={getConfig().ORDER_HISTORY_URL}>
<Dropdown.Item href={getConfig().ORDER_HISTORY_URL}>
{intl.formatMessage(messages.orderHistory)}
</Dropdown.Item>
)}
</Dropdown.Item>
<Dropdown.Item href={getConfig().LOGOUT_URL}>
{intl.formatMessage(messages.signOut)}
</Dropdown.Item>
Expand All @@ -62,15 +50,6 @@ function AuthenticatedUserDropdown({ enterpriseLearnerPortalLink, intl, username
AuthenticatedUserDropdown.propTypes = {
intl: intlShape.isRequired,
username: PropTypes.string.isRequired,
enterpriseLearnerPortalLink: PropTypes.shape({
type: PropTypes.string,
href: PropTypes.string,
content: PropTypes.string,
}),
};

AuthenticatedUserDropdown.defaultProps = {
enterpriseLearnerPortalLink: undefined,
};

export default injectIntl(AuthenticatedUserDropdown);
18 changes: 0 additions & 18 deletions src/learning-header/Header.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React, { useContext } from 'react';
import PropTypes from 'prop-types';
import { useEnterpriseConfig } from '@edx/frontend-enterprise-utils';
import { getConfig } from '@edx/frontend-platform';
import { injectIntl, intlShape } from '@edx/frontend-platform/i18n';
import { AppContext } from '@edx/frontend-platform/react';
Expand Down Expand Up @@ -33,12 +32,6 @@ function Header({
}) {
const { authenticatedUser } = useContext(AppContext);

const { enterpriseLearnerPortalLink, enterpriseCustomerBrandingConfig } = useEnterpriseConfig(
authenticatedUser,
getConfig().ENTERPRISE_LEARNER_PORTAL_HOSTNAME,
getConfig().LMS_BASE_URL,
);

let headerLogo = (
<LinkedLogo
className="logo"
Expand All @@ -47,16 +40,6 @@ function Header({
alt={getConfig().SITE_NAME}
/>
);
if (enterpriseCustomerBrandingConfig && Object.keys(enterpriseCustomerBrandingConfig).length > 0) {
headerLogo = (
<LinkedLogo
className="logo"
href={enterpriseCustomerBrandingConfig.logoDestination}
src={enterpriseCustomerBrandingConfig.logo}
alt={enterpriseCustomerBrandingConfig.logoAltText}
/>
);
}

return (
<header className="learning-header">
Expand All @@ -69,7 +52,6 @@ function Header({
</div>
{showUserDropdown && authenticatedUser && (
<AuthenticatedUserDropdown
enterpriseLearnerPortalLink={enterpriseLearnerPortalLink}
username={authenticatedUser.username}
/>
)}
Expand Down

0 comments on commit e26aa41

Please sign in to comment.