Skip to content

Commit 0349188

Browse files
feat: allow full width content in library authoring [FC-0062] (#1258)
* feat: allow full width content in library authoring * chore: update header and footer versions --------- Co-authored-by: Jillian <[email protected]>
1 parent b177238 commit 0349188

File tree

7 files changed

+36
-31
lines changed

7 files changed

+36
-31
lines changed

package-lock.json

Lines changed: 15 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@
4848
"@dnd-kit/utilities": "^3.2.2",
4949
"@edx/brand": "npm:@openedx/brand-openedx@^1.2.3",
5050
"@edx/browserslist-config": "1.2.0",
51-
"@edx/frontend-component-footer": "^14.0.3",
52-
"@edx/frontend-component-header": "^5.3.3",
51+
"@edx/frontend-component-footer": "^14.1.0",
52+
"@edx/frontend-component-header": "^5.5.0",
5353
"@edx/frontend-enterprise-hotjar": "^2.0.0",
5454
"@edx/frontend-platform": "^8.0.3",
5555
"@edx/openedx-atlas": "^0.6.0",
@@ -65,7 +65,7 @@
6565
"@openedx-plugins/course-app-xpert_unit_summary": "file:plugins/course-apps/xpert_unit_summary",
6666
"@openedx/frontend-build": "^14.0.14",
6767
"@openedx/frontend-plugin-framework": "^1.2.1",
68-
"@openedx/paragon": "^22.5.1",
68+
"@openedx/paragon": "^22.8.1",
6969
"@redux-devtools/extension": "^3.3.0",
7070
"@reduxjs/toolkit": "1.9.7",
7171
"@tanstack/react-query": "4.36.1",

src/header/Header.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,23 @@ import React from 'react';
22
import { getConfig } from '@edx/frontend-platform';
33
import { useIntl } from '@edx/frontend-platform/i18n';
44
import { StudioHeader } from '@edx/frontend-component-header';
5-
import { useToggle } from '@openedx/paragon';
5+
import { type Container, useToggle } from '@openedx/paragon';
66
import { generatePath, useHref } from 'react-router-dom';
77

88
import { SearchModal } from '../search-modal';
99
import { useContentMenuItems, useSettingMenuItems, useToolsMenuItems } from './hooks';
1010
import messages from './messages';
1111

12+
type ContainerPropsType = React.ComponentProps<typeof Container>;
13+
1214
interface HeaderProps {
1315
contextId?: string,
1416
number?: string,
1517
org?: string,
1618
title?: string,
1719
isHiddenMainMenu?: boolean,
1820
isLibrary?: boolean,
21+
containerProps?: ContainerPropsType,
1922
}
2023

2124
const Header = ({
@@ -25,6 +28,7 @@ const Header = ({
2528
title = '',
2629
isHiddenMainMenu = false,
2730
isLibrary = false,
31+
containerProps = {},
2832
}: HeaderProps) => {
2933
const intl = useIntl();
3034
const libraryHref = useHref('/library/:libraryId');
@@ -69,8 +73,9 @@ const Header = ({
6973
mainMenuDropdowns={mainMenuDropdowns}
7074
outlineLink={outlineLink}
7175
searchButtonAction={meiliSearchEnabled ? openSearchModal : undefined}
76+
containerProps={containerProps}
7277
/>
73-
{ meiliSearchEnabled && (
78+
{meiliSearchEnabled && (
7479
<SearchModal
7580
isOpen={isShowSearchModalOpen}
7681
courseId={isLibrary ? undefined : contextId}

src/library-authoring/LibraryAuthoringPage.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,11 @@ const LibraryAuthoringPage = () => {
164164
org={libraryData.org}
165165
contextId={libraryId}
166166
isLibrary
167+
containerProps={{
168+
size: undefined,
169+
}}
167170
/>
168-
<Container size="xl" className="px-4 mt-4 mb-5 library-authoring-page">
171+
<Container className="px-4 mt-4 mb-5 library-authoring-page">
169172
<SearchContextProvider
170173
extraFilter={`context_key = "${libraryId}"`}
171174
>
@@ -218,7 +221,7 @@ const LibraryAuthoringPage = () => {
218221
</Routes>
219222
</SearchContextProvider>
220223
</Container>
221-
<StudioFooter />
224+
<StudioFooter containerProps={{ size: undefined }} />
222225
</div>
223226
{ !!sidebarBodyComponent && (
224227
<div className="library-authoring-sidebar box-shadow-left-1 bg-white" data-testid="library-sidebar">

src/library-authoring/LibraryRecentlyModified.tsx

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import React, { useMemo } from 'react';
22
import { useIntl } from '@edx/frontend-platform/i18n';
33
import { orderBy } from 'lodash';
4-
import { CardGrid } from '@openedx/paragon';
54

65
import { SearchContextProvider, useSearchContext } from '../search-manager';
76
import { type CollectionHit, type ContentHit, SearchSortOption } from '../search-manager/data/api';
@@ -48,15 +47,7 @@ const RecentlyModified: React.FC<{ libraryId: string }> = ({ libraryId }) => {
4847
title={intl.formatMessage(messages.recentlyModifiedTitle)}
4948
contentCount={componentCount}
5049
>
51-
<CardGrid
52-
columnSizes={{
53-
sm: 12,
54-
md: 6,
55-
lg: 4,
56-
xl: 3,
57-
}}
58-
hasEqualColumnHeights
59-
>
50+
<div className="library-cards-grid">
6051
{recentItems.map((contentHit) => (
6152
contentHit.type === 'collection' ? (
6253
<CollectionCard
@@ -71,7 +62,7 @@ const RecentlyModified: React.FC<{ libraryId: string }> = ({ libraryId }) => {
7162
/>
7263
)
7364
))}
74-
</CardGrid>
65+
</div>
7566
</LibrarySection>
7667
)
7768
: null;

src/library-authoring/components/ComponentCard.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
.library-component-card {
2+
.pgn__card {
3+
height: 100%
4+
}
5+
26
.library-component-header {
37
border-top-left-radius: .375rem;
48
border-top-right-radius: .375rem;

src/search-manager/data/api.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,6 @@ export async function fetchSearchResults({
246246
highlightPreTag: HIGHLIGHT_PRE_TAG,
247247
highlightPostTag: HIGHLIGHT_POST_TAG,
248248
attributesToCrop: ['content'],
249-
cropLength: 20,
250249
sort,
251250
offset,
252251
limit,
@@ -281,7 +280,6 @@ export async function fetchSearchResults({
281280
highlightPreTag: HIGHLIGHT_PRE_TAG,
282281
highlightPostTag: HIGHLIGHT_POST_TAG,
283282
attributesToCrop: ['description'],
284-
cropLength: 15,
285283
sort,
286284
offset,
287285
limit,

0 commit comments

Comments
 (0)