Skip to content

Commit

Permalink
fix: add word break style for long words (openedx#574)
Browse files Browse the repository at this point in the history
  • Loading branch information
KristinAoki authored and snglth committed Jan 9, 2024
1 parent 766a736 commit d4cd53c
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 14 deletions.
22 changes: 15 additions & 7 deletions src/files-and-uploads/FileInfo.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,11 @@ const FileInfo = ({
>
<ModalDialog.Header>
<ModalDialog.Title>
{asset.displayName}
<div style={{ wordBreak: 'break-word' }}>
<Truncate lines={2} className="font-weight-bold small mt-3">
{asset.displayName}
</Truncate>
</div>
</ModalDialog.Title>
</ModalDialog.Header>
<ModalDialog.Body className="pt-0 x-small">
Expand Down Expand Up @@ -83,9 +87,11 @@ const FileInfo = ({
<FormattedMessage {...messages.studioUrlTitle} />
</div>
<ActionRow>
<Truncate lines={1}>
{asset.portableUrl}
</Truncate>
<div style={{ wordBreak: 'break-word' }}>
<Truncate lines={1}>
{asset.portableUrl}
</Truncate>
</div>
<ActionRow.Spacer />
<IconButton
src={ContentCopy}
Expand All @@ -98,9 +104,11 @@ const FileInfo = ({
<FormattedMessage {...messages.webUrlTitle} />
</div>
<ActionRow>
<Truncate lines={1}>
{asset.externalUrl}
</Truncate>
<div style={{ wordBreak: 'break-word' }}>
<Truncate lines={1}>
{asset.externalUrl}
</Truncate>
</div>
<ActionRow.Spacer />
<IconButton
src={ContentCopy}
Expand Down
2 changes: 1 addition & 1 deletion src/files-and-uploads/FilesAndUploads.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ const FilesAndUploads = ({
}}
/>
) : (
<div data-testid="files-data-table">
<div data-testid="files-data-table" className="mr-4 ml-3">
<DataTable.TableControlBar />
{ currentView === 'card' && <CardView CardComponent={fileCard} columnSizes={columnSizes} selectionPlacement="left" skeletonCardCount={6} /> }
{ currentView === 'list' && <CardView CardComponent={fileCard} columnSizes={{ xs: 12 }} selectionPlacement="left" skeletonCardCount={4} /> }
Expand Down
8 changes: 5 additions & 3 deletions src/files-and-uploads/table-components/GalleryCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,11 @@ const GalleryCard = ({
</div>
)}
</div>
<Truncate lines={1} className="font-weight-bold small mt-3">
{original.displayName}
</Truncate>
<div style={{ wordBreak: 'break-word' }}>
<Truncate lines={1} className="font-weight-bold small mt-3">
{original.displayName}
</Truncate>
</div>
</Card.Section>
<Card.Footer>
<Chip>
Expand Down
8 changes: 5 additions & 3 deletions src/files-and-uploads/table-components/ListCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,11 @@ const ListCard = ({
</div>
<Card.Body>
<Card.Section>
<Truncate lines={1} className="font-weight-bold small mt-3">
{original.displayName}
</Truncate>
<div style={{ wordBreak: 'break-word' }}>
<Truncate lines={1} className="font-weight-bold small mt-3">
{original.displayName}
</Truncate>
</div>
<Chip className="mt-3">
{original.wrapperType}
</Chip>
Expand Down

0 comments on commit d4cd53c

Please sign in to comment.