Skip to content

Commit

Permalink
fix: add Create Library placeholder
Browse files Browse the repository at this point in the history
  • Loading branch information
rpenido committed Jun 6, 2024
1 parent 5213eff commit 60b66e6
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 45 deletions.
3 changes: 2 additions & 1 deletion src/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { initializeHotjar } from '@edx/frontend-enterprise-hotjar';
import { logError } from '@edx/frontend-platform/logging';
import messages from './i18n';

import { LibraryAuthoringPage } from './library-authoring';
import { CreateLibrary, LibraryAuthoringPage } from './library-authoring';

Check failure on line 22 in src/index.jsx

View workflow job for this annotation

GitHub Actions / tests

Missing file extension "ts" for "./library-authoring"
import initializeStore from './store';
import CourseAuthoringRoutes from './CourseAuthoringRoutes';
import Head from './head/Head';
Expand Down Expand Up @@ -55,6 +55,7 @@ const App = () => {
<Route path="/home" element={<StudioHome />} />
<Route path="/libraries" element={<StudioHome />} />
<Route path="/legacy-libraries" element={<StudioHome />} />
<Route path="/library/create" element={<CreateLibrary />} />
<Route path="/library/:libraryId/*" element={<LibraryAuthoringPage />} />
<Route path="/course/:courseId/*" element={<CourseAuthoringRoutes />} />
<Route path="/course_rerun/:courseId" element={<CourseRerun />} />
Expand Down
31 changes: 31 additions & 0 deletions src/library-authoring/CreateLibrary.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// @ts-check
/* eslint-disable react/prop-types */
import React from 'react';
import { FormattedMessage } from '@edx/frontend-platform/i18n';
import { Container } from '@openedx/paragon';

import Header from '../header';
import SubHeader from '../generic/sub-header/SubHeader';

import messages from './messages';

Check failure on line 10 in src/library-authoring/CreateLibrary.jsx

View workflow job for this annotation

GitHub Actions / tests

Missing file extension "ts" for "./messages"

/**
* @type {React.FC}
*/
const LibraryCollections = () => (
<>
<Header isHiddenMainMenu />
<Container size="xl" className="p-4 mt-3">
<SubHeader
title={<FormattedMessage {...messages.createLibrary} />}
/>
<div className="d-flex my-6 justify-content-center">
<FormattedMessage
{...messages.createLibraryTempPlaceholder}
/>
</div>
</Container>
</>
);

export default LibraryCollections;
1 change: 1 addition & 0 deletions src/library-authoring/data/apiHook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export const useContentLibrary = (libraryId?: string) => {
return {
data: undefined,
error: 'No library ID provided',
isLoading: false,
}
}

Expand Down
1 change: 1 addition & 0 deletions src/library-authoring/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-check
// eslint-disable-next-line import/prefer-default-export
export { default as LibraryAuthoringPage } from './LibraryAuthoringPage';
export { default as CreateLibrary } from './CreateLibrary';
10 changes: 10 additions & 0 deletions src/library-authoring/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,16 @@ const messages = defineMessages({
defaultMessage: 'Recently modified components and collections will be displayed here.',
description: 'Temp placeholder for the recent components container. This will be replaced with the actual list.',
},
createLibrary: {
id: 'course-authoring.library-authoring.create-library',
defaultMessage: 'Create library',
description: 'Header for the create library form',
},
createLibraryTempPlaceholder: {
id: 'course-authoring.library-authoring.create-library-temp-placeholder',
defaultMessage: 'This is a placeholder for the create library form. This will be replaced with the actual form.',
description: 'Temp placeholder for the create library container. This will be replaced with the new library form.',
},
});

export default messages;
36 changes: 0 additions & 36 deletions src/studio-home/tabs-section/LibraryV2Placeholder.jsx

This file was deleted.

8 changes: 0 additions & 8 deletions src/studio-home/tabs-section/messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,6 @@ const messages = defineMessages({
defaultMessage: 'Taxonomies',
description: 'Title of Taxonomies tab on the home page',
},
libraryV2PlaceholderTitle: {
id: 'course-authoring.studio-home.libraries.placeholder.title',
defaultMessage: 'Library V2 Placeholder',
},
libraryV2PlaceholderBody: {
id: 'course-authoring.studio-home.libraries.placeholder.body',
defaultMessage: 'This is a placeholder page, as the Library Authoring MFE is not enabled.',
},
});

export default messages;

0 comments on commit 60b66e6

Please sign in to comment.