fix: additional linting + clarity changes
This commit is contained in:
@@ -24,7 +24,7 @@ export const Dashboard = () => {
|
||||
const showSelectSessionModal = reduxHooks.useShowSelectSessionModal();
|
||||
|
||||
// Hard coded to not show until experiment set-up logic is implemented
|
||||
const showProductRecommendations = !initIsPending && !hasAvailableDashboards && hasCourses && true;
|
||||
const showProductRecommendations = !initIsPending && !hasAvailableDashboards && hasCourses && false;
|
||||
|
||||
return (
|
||||
<div id="dashboard-container" className="d-flex flex-column p-2 pt-0">
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { get, stringifyUrl } from 'data/services/lms/utils';
|
||||
import urls from 'data/services/lms/urls';
|
||||
|
||||
export const crossProductRecommendationsUrl = (courseId) => `${urls.api}/learner_recommendations/product_recommendations/${courseId}/`;
|
||||
export const productRecommendationsUrl = (courseId) => `${urls.api}/learner_recommendations/product_recommendations/${courseId}/`;
|
||||
|
||||
const fetchProductRecommendations = (courseId) => get(stringifyUrl(crossProductRecommendationsUrl(courseId)));
|
||||
const fetchProductRecommendations = (courseId) => get(stringifyUrl(productRecommendationsUrl(courseId)));
|
||||
|
||||
export default {
|
||||
fetchProductRecommendations,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { get, stringifyUrl } from 'data/services/lms/utils';
|
||||
import api, { crossProductRecommendationsUrl } from './api';
|
||||
import api, { productRecommendationsUrl } from './api';
|
||||
|
||||
jest.mock('data/services/lms/utils', () => ({
|
||||
stringifyUrl: (...args) => ({ stringifyUrl: args }),
|
||||
@@ -10,7 +10,7 @@ describe('productRecommendationCourses api', () => {
|
||||
describe('fetchProductRecommendations', () => {
|
||||
it('calls get with the correct recommendation courses URL', () => {
|
||||
expect(api.fetchProductRecommendations('CourseRunKey')).toEqual(
|
||||
get(stringifyUrl(crossProductRecommendationsUrl('CourseRunKey'))),
|
||||
get(stringifyUrl(productRecommendationsUrl('CourseRunKey'))),
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -7,7 +7,7 @@ import { Icon, Hyperlink } from '@edx/paragon';
|
||||
import { ChevronRight } from '@edx/paragon/icons';
|
||||
import messages from '../messages';
|
||||
|
||||
function ProductCardHeader({ courseType }) {
|
||||
const ProductCardHeader = ({ courseType }) => {
|
||||
const { formatMessage } = useIntl();
|
||||
|
||||
const getProductTypeDetail = (type) => {
|
||||
@@ -54,7 +54,7 @@ function ProductCardHeader({ courseType }) {
|
||||
</p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
ProductCardHeader.propTypes = {
|
||||
courseType: PropTypes.string.isRequired,
|
||||
|
||||
Reference in New Issue
Block a user