Skip to content

Commit bdc898d

Browse files
committed
chore: fix lint issues
1 parent e80de42 commit bdc898d

6 files changed

Lines changed: 31 additions & 19 deletions

File tree

src/generic/block-type-utils/index.scss

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -200,24 +200,24 @@
200200
}
201201

202202
.component-style-import-placeholder {
203-
background-color: #ab0e01;
203+
background-color: #AB0E01;
204204

205205
.pgn__icon:not(.btn-icon-before) {
206206
color: white;
207207
}
208208

209209
.btn-icon {
210210
&:hover, &:active, &:focus {
211-
background-color: darken(#ab0e01, 15%);
211+
background-color: darken(#AB0E01, 15%);
212212
}
213213
}
214214

215215
.btn {
216-
background-color: lighten(#ab0e01, 10%);
216+
background-color: lighten(#AB0E01, 10%);
217217
border: 0;
218218

219219
&:hover, &:active, &:focus {
220-
background-color: lighten(#ab0e01, 20%);
220+
background-color: lighten(#AB0E01, 20%);
221221
border: 1px solid var(--pgn-color-primary-base);
222222
margin: -1px;
223223
}

src/library-authoring/LibraryContent.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,12 @@ const LibraryContent = ({ contentType = ContentType.home }: LibraryContentProps)
101101

102102
return <CardComponent key={contentHit.id} hit={contentHit} />;
103103
})}
104-
{showPlaceholderBlocks && placeholderData?.hits?.map((item) => (<PlaceholderCard
105-
displayName={item.display_name}
106-
blockType={item.block_type}
107-
/>))}
104+
{showPlaceholderBlocks && placeholderData?.hits?.map((item) => (
105+
<PlaceholderCard
106+
displayName={item.display_name}
107+
blockType={item.block_type}
108+
/>
109+
))}
108110
</div>
109111
);
110112
};

src/library-authoring/components/BaseCard.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ import ComponentCount from '@src/generic/component-count';
1212
import TagCount from '@src/generic/tag-count';
1313
import { BlockTypeLabel, type ContentHitTags, Highlight } from '@src/search-manager';
1414
import { skipIfUnwantedTarget } from '@src/utils';
15-
import messages from './messages';
1615
import { Report } from '@openedx/paragon/icons';
16+
import messages from './messages';
1717

1818
type BaseCardProps = {
1919
itemType: string;
@@ -50,7 +50,7 @@ const BaseCard = ({
5050

5151
const itemIcon = getItemIcon(itemType);
5252
const intl = useIntl();
53-
const itemComponentStyle = !props.isPlaceholder ? getComponentStyleColor(itemType): "component-style-import-placeholder";
53+
const itemComponentStyle = !props.isPlaceholder ? getComponentStyleColor(itemType) : 'component-style-import-placeholder';
5454

5555
return (
5656
<Container className="library-item-card selected">
@@ -67,7 +67,7 @@ const BaseCard = ({
6767
<Card.Header
6868
className={`library-item-header ${itemComponentStyle}`}
6969
title={
70-
<Icon src={props.isPlaceholder ? Report: itemIcon} className="library-item-header-icon my-2" />
70+
<Icon src={props.isPlaceholder ? Report : itemIcon} className="library-item-header-icon my-2" />
7171
}
7272
actions={(
7373
<div
@@ -94,10 +94,12 @@ const BaseCard = ({
9494
<BlockTypeLabel blockType={itemType} />
9595
</small>
9696
</Stack>
97-
{!props.isPlaceholder && <>
97+
{!props.isPlaceholder && (
98+
<>
9899
<ComponentCount count={numChildren} />
99100
<TagCount size="sm" count={tagCount} />
100-
</>}
101+
</>
102+
)}
101103
</Stack>
102104
<div className="badge-container d-flex align-items-center justify-content-center">
103105
{props.hasUnpublishedChanges && (

src/library-authoring/data/api.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { camelCaseObject, getConfig, snakeCaseObject } from '@edx/frontend-platf
22
import { getAuthenticatedHttpClient } from '@edx/frontend-platform/auth';
33
import { VersionSpec } from '../LibraryBlock';
44
import { type ContainerType } from '../../generic/key-utils';
5-
import src from 'react-select/dist/declarations/src';
65

76
const getApiBaseUrl = () => getConfig().STUDIO_BASE_URL;
87

@@ -849,7 +848,11 @@ export interface BlockMigrationInfo {
849848
/**
850849
* Get the migration blocks info data for a library
851850
*/
852-
export async function getModulestoreMigrationBlocksInfo(libraryId: string, collectionId?: string, isFailed?: boolean): Promise<BlockMigrationInfo[]> {
851+
export async function getModulestoreMigrationBlocksInfo(
852+
libraryId: string,
853+
collectionId?: string,
854+
isFailed?: boolean,
855+
): Promise<BlockMigrationInfo[]> {
853856
const client = getAuthenticatedHttpClient();
854857

855858
const params = new URLSearchParams();

src/library-authoring/data/apiHooks.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -991,7 +991,12 @@ export const useMigrationInfo = (sourcesKeys: string[], enabled: boolean = true)
991991
/**
992992
* Returns the migration blocks info of a given library
993993
*/
994-
export const useMigrationBlocksInfo = (libraryId: string, collectionId?: string, isFailed?: boolean, enabled = true) => (
994+
export const useMigrationBlocksInfo = (
995+
libraryId: string,
996+
collectionId?: string,
997+
isFailed?: boolean,
998+
enabled = true,
999+
) => (
9951000
useQuery({
9961001
queryKey: libraryAuthoringQueryKeys.migrationBlocksInfo(libraryId, collectionId, isFailed),
9971002
queryFn: enabled ? () => api.getModulestoreMigrationBlocksInfo(libraryId, collectionId, isFailed) : skipToken,

src/library-authoring/import-course/PlaceholderCard.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import BaseCard from "../components/BaseCard";
1+
import BaseCard from '../components/BaseCard';
22

33
interface PlaceHolderCardProps {
44
blockType: string;
@@ -7,7 +7,7 @@ interface PlaceHolderCardProps {
77
}
88

99
const PlaceholderCard = ({ blockType, displayName, description }: PlaceHolderCardProps) => {
10-
const truncatedDescription = description ? description.substring(0, 40) + "...": undefined;
10+
const truncatedDescription = description ? `${description.substring(0, 40) }...` : undefined;
1111
return (
1212
<BaseCard
1313
itemType={blockType}
@@ -21,7 +21,7 @@ const PlaceholderCard = ({ blockType, displayName, description }: PlaceHolderCar
2121
selected={false}
2222
isPlaceholder
2323
/>
24-
)
24+
);
2525
};
2626

2727
export default PlaceholderCard;

0 commit comments

Comments
 (0)