Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add accounnt and profile urls in env files and replace legacy url #878

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
NODE_ENV='production'
USE_API_CACHE=true
ACCOUNT_SETTINGS_URL=''
ACCOUNT_PROFILE_URL=''
ENABLE_SKILLS_QUIZ=false
FEATURE_ENABLE_PROGRAMS=true
FEATURE_PROGRAM_TYPE_FACET=true
Expand Down
2 changes: 2 additions & 0 deletions .env.development
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ ECOMMERCE_BASE_URL='http://localhost:18130'
DISCOVERY_API_BASE_URL='http://localhost:18381'
ENTERPRISE_ACCESS_BASE_URL='http://localhost:18270'
ENTERPRISE_SUBSIDY_BASE_URL='http://localhost:18280'
ACCOUNT_PROFILE_URL=http://localhost:1995
ACCOUNT_SETTINGS_URL=http://localhost:1997
ENTERPRISE_CATALOG_API_BASE_URL='http://localhost:18160'
LICENSE_MANAGER_URL='http://localhost:18170'
MARKETING_SITE_BASE_URL='https://stage.edx.org'
Expand Down
2 changes: 1 addition & 1 deletion src/components/dashboard/SubscriptionExpirationModal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const SubscriptionExpirationModal = () => {
const renderCertificateText = () => {
const { username } = getAuthenticatedUser();
return (
<a href={`${config.LMS_BASE_URL}/u/${username}`} className="font-weight-bold">
<a href={`${config.ACCOUNT_PROFILE_URL}/u/${username}`} className="font-weight-bold">
download your completed certificates
</a>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@
<small className="mt-2 mb-0">
View your certificate on
{' '}
<a href={`${config.LMS_BASE_URL}/u/${username}`}>your profile →</a>
<a href={`${config.ACCOUNT_PROFILE_URL}/u/${username}`}>your profile →</a>
</small>
);
}
Expand All @@ -424,7 +424,7 @@
return miscText;
}

if (!courseMiscText) {

Check warning on line 427 in src/components/dashboard/main-content/course-enrollments/course-cards/BaseCourseCard.jsx

View check run for this annotation

Codecov / codecov/patch

src/components/dashboard/main-content/course-enrollments/course-cards/BaseCourseCard.jsx#L427

Added line #L427 was not covered by tests
return null;
}

Expand All @@ -442,7 +442,7 @@
? BADGE_PROPS_BY_COURSE_STATUS.assigned
: BADGE_PROPS_BY_COURSE_STATUS[type];

if (badgeProps) {

Check warning on line 445 in src/components/dashboard/main-content/course-enrollments/course-cards/BaseCourseCard.jsx

View check run for this annotation

Codecov / codecov/patch

src/components/dashboard/main-content/course-enrollments/course-cards/BaseCourseCard.jsx#L445

Added line #L445 was not covered by tests
return <Badge className="mt-1" {...badgeProps} />;
}

Expand All @@ -455,7 +455,7 @@
linkToCourse,
hasViewCertificateLink,
isLoading,
mode,

Check warning on line 458 in src/components/dashboard/main-content/course-enrollments/course-cards/BaseCourseCard.jsx

View check run for this annotation

Codecov / codecov/patch

src/components/dashboard/main-content/course-enrollments/course-cards/BaseCourseCard.jsx#L458

Added line #L458 was not covered by tests
} = this.props;
const dropdownMenuItems = this.getDropdownMenuItems();
const isExecutiveEducation2UCourse = EXECUTIVE_EDUCATION_COURSE_MODES.includes(mode);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const CompletedCourseCard = (props) => {
<div className="d-flex align-items-center">
<p className="mb-0 small">
View your certificate on{' '}
<a href={`${config.LMS_BASE_URL}/u/${username}`}>
<a href={`${config.ACCOUNT_PROFILE_URL}/u/${username}`}>
your profile →
</a>
</p>
Expand Down
6 changes: 4 additions & 2 deletions src/components/site-header/AvatarDropdown.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ const AvatarDropdown = ({ showLabel }) => {
LMS_BASE_URL,
LOGOUT_URL,
LEARNER_SUPPORT_URL,
ACCOUNT_PROFILE_URL,
ACCOUNT_SETTINGS_URL,
} = getConfig();
const { enterpriseConfig, authenticatedUser } = useContext(AppContext);
const { username, profileImage } = authenticatedUser;
Expand Down Expand Up @@ -52,8 +54,8 @@ const AvatarDropdown = ({ showLabel }) => {
{enterpriseConfig.name}
</Dropdown.Item>
<Dropdown.Divider className="border-light" />
<Dropdown.Item href={`${LMS_BASE_URL}/u/${authenticatedUser.username}`}>My profile</Dropdown.Item>
<Dropdown.Item href={`${LMS_BASE_URL}/account/settings`}>Account settings</Dropdown.Item>
<Dropdown.Item href={`${ACCOUNT_PROFILE_URL}/u/${authenticatedUser.username}`}>My profile</Dropdown.Item>
<Dropdown.Item href={ACCOUNT_SETTINGS_URL}>Account settings</Dropdown.Item>
<Dropdown.Item href={LEARNER_SUPPORT_URL}>Help</Dropdown.Item>
<Dropdown.Divider className="border-light" />
<Dropdown.Item href={logoutUrl}>Sign out</Dropdown.Item>
Expand Down
2 changes: 2 additions & 0 deletions src/setupTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import Adapter from '@wojtekmaj/enzyme-adapter-react-17';
configure({ adapter: new Adapter() });

process.env.LMS_BASE_URL = 'http://localhost:18000';
process.env.ACCOUNT_PROFILE_URL = 'http://localhost:1995';
process.env.ACCOUNT_SETTINGS_URL = 'http://localhost:1997';
process.env.ECOMMERCE_BASE_URL = 'http://ecommerce.url';
process.env.MARKETING_SITE_BASE_URL = 'http://marketing.url';
process.env.LEARNER_SUPPORT_SPEND_ENROLLMENT_LIMITS_URL = 'http://limits.url';
Expand Down
Loading