web/user: revert truncate behaviour for application description
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
@ -29,6 +29,20 @@ export function convertToTitle(text: string): string {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Truncate a string based on maximum word count
|
||||
*/
|
||||
export function truncateWords(string: string, length = 10): string {
|
||||
string = string || "";
|
||||
const array = string.trim().split(" ");
|
||||
const ellipsis = array.length > length ? "..." : "";
|
||||
|
||||
return array.slice(0, length).join(" ") + ellipsis;
|
||||
}
|
||||
|
||||
/**
|
||||
* Truncate a string based on character count
|
||||
*/
|
||||
export function truncate(string: string, length = 10): string {
|
||||
return string.length > length ? `${string.substring(0, length)}...` : string;
|
||||
}
|
||||
|
Reference in New Issue
Block a user