Skip to content

Commit b68d9a5

Browse files
committed
chore: fix lint issues
1 parent 869f7af commit b68d9a5

File tree

6 files changed

+11
-18
lines changed

6 files changed

+11
-18
lines changed

src/library-authoring/LibraryAuthoringPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ const LibraryAuthoringPage = () => {
203203
/>
204204
<Route
205205
path={TabList.collections}
206-
element={<LibraryCollections libraryId={libraryId} variant="full" />}
206+
element={<LibraryCollections variant="full" />}
207207
/>
208208
<Route
209209
path="*"

src/library-authoring/LibraryCollections.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
1-
import React, { useEffect, useMemo } from 'react';
2-
import { FormattedMessage } from '@edx/frontend-platform/i18n';
1+
import React, { useEffect } from 'react';
32
import { CardGrid } from '@openedx/paragon';
43

5-
import messages from './messages';
64
import { useSearchContext } from '../search-manager';
75
import { NoComponents, NoSearchResults } from './EmptyStates';
86
import CollectionCard from './components/CollectionCard';
97
import { LIBRARY_SECTION_PREVIEW_LIMIT } from './components/LibrarySection';
108

119
type LibraryCollectionsProps = {
12-
libraryId: string,
1310
variant: 'full' | 'preview',
1411
};
1512

@@ -20,15 +17,14 @@ type LibraryCollectionsProps = {
2017
* - 'full': Show all collections with Infinite scroll pagination.
2118
* - 'preview': Show first 4 collections without pagination.
2219
*/
23-
const LibraryCollections = ({ libraryId, variant }: LibraryCollectionsProps) => {
20+
const LibraryCollections = ({ variant }: LibraryCollectionsProps) => {
2421
const {
2522
collectionHits,
2623
totalCollectionHits,
2724
isFetchingNextPage,
2825
hasNextPage,
2926
fetchNextPage,
3027
isFiltered,
31-
setExtraFilter,
3228
} = useSearchContext();
3329

3430
const collectionList = variant === 'preview' ? collectionHits.slice(0, LIBRARY_SECTION_PREVIEW_LIMIT) : collectionHits;

src/library-authoring/LibraryHome.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ const LibraryHome = ({ libraryId, tabList, handleTabChange } : LibraryHomeProps)
4343
contentCount={collectionCount}
4444
viewAllAction={() => handleTabChange(tabList.collections)}
4545
>
46-
<LibraryCollections libraryId={libraryId} variant="preview" />
46+
<LibraryCollections variant="preview" />
4747
</LibrarySection>
4848
<LibrarySection
4949
title={intl.formatMessage(messages.componentsTitle, { componentCount })}

src/library-authoring/components/CollectionCard.tsx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,19 @@
1-
import React, { useContext, useMemo, useState } from 'react';
1+
import React, { useMemo } from 'react';
22
import { useIntl } from '@edx/frontend-platform/i18n';
33
import {
44
ActionRow,
55
Card,
66
Container,
77
Icon,
88
IconButton,
9-
Dropdown,
109
Stack,
1110
} from '@openedx/paragon';
1211
import { MoreVert } from '@openedx/paragon/icons';
1312

1413
import { getItemIcon, getComponentStyleColor } from '../../generic/block-type-utils';
15-
import { updateClipboard } from '../../generic/data/api';
1614
import TagCount from '../../generic/tag-count';
17-
import { ToastContext } from '../../generic/toast-context';
1815
import { type CollectionHit, Highlight } from '../../search-manager';
19-
import { LibraryContext } from '../common/context';
2016
import messages from './messages';
21-
import { STUDIO_CLIPBOARD_CHANNEL } from '../../constants';
2217

2318
type CollectionCardProps = {
2419
collectionHit: CollectionHit,

src/search-manager/SearchManager.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ import React from 'react';
99
import { useSearchParams } from 'react-router-dom';
1010
import { MeiliSearch, type Filter } from 'meilisearch';
1111

12-
import { CollectionHit, ContentHit, SearchSortOption, forceArray } from './data/api';
12+
import {
13+
CollectionHit, ContentHit, SearchSortOption, forceArray,
14+
} from './data/api';
1315
import { useContentSearchConnection, useContentSearchResults } from './data/apiHooks';
1416

1517
export interface SearchContextData {

src/search-manager/data/api.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ export async function fetchSearchResults({
213213
...problemTypesFilterFormatted,
214214
].flat()];
215215

216-
const collectionsFilter = 'type = "collection"'
216+
const collectionsFilter = 'type = "collection"';
217217

218218
// First query is always to get the hits, with all the filters applied.
219219
queries.push({
@@ -222,7 +222,7 @@ export async function fetchSearchResults({
222222
filter: [
223223
// top-level entries in the array are AND conditions and must all match
224224
// Inner arrays are OR conditions, where only one needs to match.
225-
`NOT ${collectionsFilter}`, // exclude collections
225+
`NOT ${collectionsFilter}`, // exclude collections
226226
...typeFilters,
227227
...extraFilterFormatted,
228228
...tagsFilterFormatted,
@@ -257,7 +257,7 @@ export async function fetchSearchResults({
257257
filter: [
258258
// top-level entries in the array are AND conditions and must all match
259259
// Inner arrays are OR conditions, where only one needs to match.
260-
collectionsFilter, // include only collections
260+
collectionsFilter, // include only collections
261261
...extraFilterFormatted,
262262
// We exclude the block type filter as collections are only of 1 type i.e. collection.
263263
...tagsFilterFormatted,

0 commit comments

Comments
 (0)