Skip to content

Commit

Permalink
fix: content libraries permission
Browse files Browse the repository at this point in the history
  • Loading branch information
rpenido committed Dec 4, 2024
1 parent e75ce15 commit 0f53602
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/studio-home/StudioHome.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { Add as AddIcon, Error } from '@openedx/paragon/icons';
import { useIntl } from '@edx/frontend-platform/i18n';
import { StudioFooter } from '@edx/frontend-component-footer';
import { getConfig } from '@edx/frontend-platform';
import { useLocation, useNavigate } from 'react-router-dom';
import { Link, useLocation, useNavigate } from 'react-router-dom';

Check failure on line 14 in src/studio-home/StudioHome.tsx

View workflow job for this annotation

GitHub Actions / tests

'Link' is defined but never used

import Loading from '../generic/Loading';
import InternetConnectionAlert from '../generic/internet-connection-alert';
Expand Down Expand Up @@ -57,6 +57,7 @@ const StudioHome = () => {
studioShortName,
studioRequestEmail,
showNewLibraryButton,
showNewLibraryV2Button,
} = studioHomeData;

const getHeaderButtons = useCallback(() => {
Expand Down Expand Up @@ -86,7 +87,7 @@ const StudioHome = () => {
);
}

if (showNewLibraryButton || showV2LibraryURL) {
if ((showNewLibraryButton && !showV2LibraryURL) || (showV2LibraryURL && showNewLibraryV2Button)) {
const newLibraryClick = () => {
if (showV2LibraryURL) {
navigate('/library/create');
Expand All @@ -101,7 +102,6 @@ const StudioHome = () => {
variant="outline-primary"
iconBefore={AddIcon}
size="sm"
disabled={showNewCourseContainer}
onClick={newLibraryClick}
data-testid="new-library-button"
>
Expand Down
1 change: 1 addition & 0 deletions src/studio-home/__mocks__/studioHomeMock.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ module.exports = {
requestCourseCreatorUrl: '/request_course_creator',
rerunCreatorStatus: true,
showNewLibraryButton: true,
showNewLibraryV2Button: true,
splitStudioHome: false,
studioName: 'Studio',
studioShortName: 'Studio',
Expand Down
1 change: 1 addition & 0 deletions src/studio-home/factories/mockApiResponses.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export const generateGetStudioHomeDataApiResponse = () => ({
requestCourseCreatorUrl: '/request_course_creator',
rerunCreatorStatus: true,
showNewLibraryButton: true,
showNewLibraryV2Button: true,
splitStudioHome: false,
studioName: 'Studio',
studioShortName: 'Studio',
Expand Down

0 comments on commit 0f53602

Please sign in to comment.