Skip to content

Commit

Permalink
ENT-4276 lp codes bugfixes (#238)
Browse files Browse the repository at this point in the history
* ENT-4276 use new ecommerce param to allow pass through of params to grant_data_sharing_permissions url when we don't go directly there.

* Fixing message typo.

* ESLint error fix

* Fix to correct prop type to remove React console error. enrollLabel property now consistent across repo.
  • Loading branch information
edx-abolger committed Mar 12, 2021
1 parent 5f9e8cf commit 55a38c4
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 10 deletions.
7 changes: 4 additions & 3 deletions src/components/course/data/hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,9 @@ const useCourseEnrollmentUrl = ({
license_uuid: subscriptionLicense.uuid,
course_id: key,
enterprise_customer_uuid: enterpriseConfig.uuid,
// We don't want any sidebar text we show the data consent page from this workflow since
// the text on the sidebar is used when a learner is coming from their employer's system.
left_sidebar_text_override: '',
};
return `${config.LMS_BASE_URL}/enterprise/grant_data_sharing_permissions/?${qs.stringify(enrollOptions)}`;
}
Expand All @@ -288,9 +291,7 @@ const useCourseEnrollmentUrl = ({
const enrollOptions = {
...baseEnrollmentOptions,
sku,
// We don't want any sidebar text we show the data consent page from this workflow:
left_sidebar_text_override: '',

consent_url_param_string: encodeURI('left_sidebar_text_override='), // Deliberately doubly encoded since it will get parsed on the redirect.
};
// get the index of the first offer that applies to a catalog that the course is in
const offerForCourse = findOfferForCourse(offers, catalogList);
Expand Down
2 changes: 1 addition & 1 deletion src/components/course/enrollment/common.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ const EnrollButtonCta = ({ enrollLabel: EnrollLabel, ...props }) => (
</EnrollButtonWrapper>
);

EnrollButtonCta.propTypes = { enrollLabel: PropTypes.shape.isRequired };
EnrollButtonCta.propTypes = { enrollLabel: PropTypes.node.isRequired };

export { EnrollButtonCta };
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const EnrollBtnDisabled = ({ enrollLabel }) => (
);

EnrollBtnDisabled.propTypes = {
enrollLabel: PropTypes.shape.isRequired,
enrollLabel: PropTypes.node.isRequired,
};

export default EnrollBtnDisabled;
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const ToCoursewarePage = ({
};

ToCoursewarePage.propTypes = {
enrollLabel: PropTypes.shape.isRequired,
enrollLabel: PropTypes.node.isRequired,
enrollmentUrl: PropTypes.string.isRequired,
userEnrollment: PropTypes.shape.isRequired,
subscriptionLicense: PropTypes.shape.isRequired,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const ToDataSharingConsentPage = ({ enrollLabel, enrollmentUrl }) => (
);

ToDataSharingConsentPage.propTypes = {
enrollLabel: PropTypes.shape.isRequired,
enrollLabel: PropTypes.node.isRequired,
enrollmentUrl: PropTypes.string.isRequired,
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const ToVoucherRedeemPage = ({ enrollLabel, enrollmentUrl }) => {
);
};
ToVoucherRedeemPage.propTypes = {
enrollLabel: PropTypes.shape.isRequired,
enrollLabel: PropTypes.node.isRequired,
enrollmentUrl: PropTypes.string.isRequired,
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const ViewOnDashboard = ({ enrollLabel }) => {
};

ViewOnDashboard.propTypes = {
enrollLabel: PropTypes.shape.isRequired,
enrollLabel: PropTypes.node.isRequired,
};

export default ViewOnDashboard;
2 changes: 1 addition & 1 deletion src/components/enterprise-user-subsidy/OffersAlert.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faInfoCircle } from '@fortawesome/free-solid-svg-icons';
import { UserSubsidyContext } from '.';

export const getOffersText = (number) => `You have ${number} enrollment codes${number > 1 ? 's' : ''} left to use.`;
export const getOffersText = (number) => `You have ${number} enrollment code${number > 1 ? 's' : ''} left to use.`;

const OffersAlert = () => {
const { offers } = useContext(UserSubsidyContext);
Expand Down

0 comments on commit 55a38c4

Please sign in to comment.