Skip to content

Commit 0ed7fa9

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

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
@@ -160,8 +160,11 @@ const LibraryAuthoringPage = () => {
160160
org={libraryData.org}
161161
contextId={libraryId}
162162
isLibrary
163+
containerProps={{
164+
size: undefined,
165+
}}
163166
/>
164-
<Container size="xl" className="px-4 mt-4 mb-5 library-authoring-page">
167+
<Container className="px-4 mt-4 mb-5 library-authoring-page">
165168
<SearchContextProvider
166169
extraFilter={`context_key = "${libraryId}"`}
167170
>
@@ -210,7 +213,7 @@ const LibraryAuthoringPage = () => {
210213
</Routes>
211214
</SearchContextProvider>
212215
</Container>
213-
<StudioFooter />
216+
<StudioFooter containerProps={{ size: undefined }} />
214217
</div>
215218
{ !!sidebarBodyComponent && (
216219
<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';
@@ -50,15 +49,7 @@ const RecentlyModified: React.FC<Record<never, never>> = () => {
5049
title={intl.formatMessage(messages.recentlyModifiedTitle)}
5150
contentCount={componentCount}
5251
>
53-
<CardGrid
54-
columnSizes={{
55-
sm: 12,
56-
md: 6,
57-
lg: 4,
58-
xl: 3,
59-
}}
60-
hasEqualColumnHeights
61-
>
52+
<div className="library-cards-grid">
6253
{recentItems.map((contentHit) => (
6354
contentHit.type === 'collection' ? (
6455
<CollectionCard
@@ -73,7 +64,7 @@ const RecentlyModified: React.FC<Record<never, never>> = () => {
7364
/>
7465
)
7566
))}
76-
</CardGrid>
67+
</div>
7768
</LibrarySection>
7869
)
7970
: 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)