-
Notifications
You must be signed in to change notification settings - Fork 799
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Boost: cut off image filenames in the IG analysis report at 20 charac…
…ters to avoid overflow (#31670) * Cut off the image titles at 20 characters in the IG analysis report * changelog * Add "truncateString" function * Define the length in the truncateString parameter
- Loading branch information
Showing
3 changed files
with
18 additions
and
1 deletion.
There are no files selected for viewing
5 changes: 4 additions & 1 deletion
5
.../app/assets/src/js/modules/image-size-analysis/recommendations/components/RowTitle.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
projects/plugins/boost/app/assets/src/js/utils/truncate-string.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/** | ||
* Returns a string truncated to a given length. | ||
* If truncated, the string will end with an ellipsis. | ||
* | ||
* @param {string} str string to truncate | ||
* @param {number} maxLength maximum length of the string | ||
*/ | ||
export function truncateString( str: string, maxLength = 20 ): string { | ||
return str.length > maxLength ? str.slice( 0, maxLength ) + '…' : str; | ||
} |
4 changes: 4 additions & 0 deletions
4
projects/plugins/boost/changelog/fix-overflowing_filenames_image_guide_analysis
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: minor | ||
Type: added | ||
|
||
Boost: Cut off image titles at 20 characters in the Image Guide Analysis report |