From 500e4abcb98b05b63027a19a4eb2882196869786 Mon Sep 17 00:00:00 2001 From: Kristin Aoki <42981026+KristinAoki@users.noreply.github.com> Date: Fri, 13 Sep 2024 13:39:10 -0400 Subject: [PATCH] Revert "fix: show studio button if user has access (#1452)" (#1486) This reverts commit 82b27e59ccfcb201c6f25bf6f4f0d61e05d02275. --- src/instructor-toolbar/InstructorToolbar.jsx | 9 +++------ src/instructor-toolbar/InstructorToolbar.test.jsx | 13 ------------- src/tab-page/LoadedTabPage.jsx | 2 -- 3 files changed, 3 insertions(+), 21 deletions(-) diff --git a/src/instructor-toolbar/InstructorToolbar.jsx b/src/instructor-toolbar/InstructorToolbar.jsx index 83a0538f57..71d968c869 100644 --- a/src/instructor-toolbar/InstructorToolbar.jsx +++ b/src/instructor-toolbar/InstructorToolbar.jsx @@ -23,10 +23,10 @@ function getInsightsUrl(courseId) { return urlFull; } -function getStudioUrl(courseId, unitId, hasStudioAccess) { +function getStudioUrl(courseId, unitId) { const urlBase = getConfig().STUDIO_BASE_URL; let urlFull; - if (urlBase && hasStudioAccess) { + if (urlBase) { if (unitId) { urlFull = `${urlBase}/container/${unitId}`; } else if (courseId) { @@ -56,11 +56,10 @@ const InstructorToolbar = (props) => { courseId, unitId, tab, - hasStudioAccess, } = props; const urlInsights = getInsightsUrl(courseId); - const urlStudio = getStudioUrl(courseId, unitId, hasStudioAccess); + const urlStudio = getStudioUrl(courseId, unitId); const [masqueradeErrorMessage, showMasqueradeError] = useState(null); const accessExpirationMasqueradeBanner = useAccessExpirationMasqueradeBanner(courseId, tab); @@ -116,14 +115,12 @@ InstructorToolbar.propTypes = { courseId: PropTypes.string, unitId: PropTypes.string, tab: PropTypes.string, - hasStudioAccess: PropTypes.bool, }; InstructorToolbar.defaultProps = { courseId: undefined, unitId: undefined, tab: '', - hasStudioAccess: false, }; export default InstructorToolbar; diff --git a/src/instructor-toolbar/InstructorToolbar.test.jsx b/src/instructor-toolbar/InstructorToolbar.test.jsx index d586671cd1..f74c751b0f 100644 --- a/src/instructor-toolbar/InstructorToolbar.test.jsx +++ b/src/instructor-toolbar/InstructorToolbar.test.jsx @@ -34,7 +34,6 @@ describe('Instructor Toolbar', () => { mockData = { courseId: courseware.courseId, unitId: Object.values(models.units)[0].id, - hasStudioAccess: true, }; axiosMock.reset(); axiosMock.onGet(masqueradeUrl).reply(200, { success: true }); @@ -77,16 +76,4 @@ describe('Instructor Toolbar', () => { expect(screen.queryByText('View course in:')).not.toBeInTheDocument(); }); - - it('does not display Studio link if user does not have studio access', () => { - const config = { ...originalConfig }; - const data = { ...mockData, hasStudioAccess: false }; - config.INSIGHTS_BASE_URL = 'http://localhost:18100'; - getConfig.mockImplementation(() => config); - render(); - - const linksContainer = screen.getByText('View course in:').parentElement; - expect(screen.queryByText(linksContainer, 'Studio')).toBeNull(); - expect(getByText(linksContainer, 'Insights').getAttribute('href')).toMatch(/http.*/); - }); }); diff --git a/src/tab-page/LoadedTabPage.jsx b/src/tab-page/LoadedTabPage.jsx index 5684844c8a..0259aa1bfd 100644 --- a/src/tab-page/LoadedTabPage.jsx +++ b/src/tab-page/LoadedTabPage.jsx @@ -26,7 +26,6 @@ const LoadedTabPage = ({ celebrations, org, originalUserIsStaff, - studioAccess, tabs, title, verifiedMode, @@ -59,7 +58,6 @@ const LoadedTabPage = ({ courseId={courseId} unitId={unitId} tab={activeTabSlug} - hasStudioAccess={studioAccess} /> )}