This is an automated email from the ASF dual-hosted git repository.
hshpak pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/incubator-datalab.git
The following commit(s) were added to refs/heads/develop by this push:
new 05a9d97 fixed truncate pipe
new 8c4d383 Merge pull request #1445 from
GennadiyShpak/truncate-pipe-hotfix
05a9d97 is described below
commit 05a9d97360dd16e292932d726513b26bce0ad296
Author: Hennadii_Shpak <[email protected]>
AuthorDate: Fri Mar 4 12:56:28 2022 +0200
fixed truncate pipe
---
.../app/core/pipes/truncate-text-pipe/truncate-text.pipe.ts | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
diff --git
a/services/self-service/src/main/resources/webapp/src/app/core/pipes/truncate-text-pipe/truncate-text.pipe.ts
b/services/self-service/src/main/resources/webapp/src/app/core/pipes/truncate-text-pipe/truncate-text.pipe.ts
index b18d1d3..f497dee 100644
---
a/services/self-service/src/main/resources/webapp/src/app/core/pipes/truncate-text-pipe/truncate-text.pipe.ts
+++
b/services/self-service/src/main/resources/webapp/src/app/core/pipes/truncate-text-pipe/truncate-text.pipe.ts
@@ -26,14 +26,11 @@ const MAX_SYMBOLS_COUNT = 255;
})
export class TruncateTextPipe implements PipeTransform {
transform(text: string, limit: number = MAX_SYMBOLS_COUNT): string {
- text = text.trim();
-
- if (text) {
- if (text.length > limit) {
- return `${text.substr(0, limit)}...`
- }
-
- return text
+ if (!text) {
+ return ''
}
+ return text.length > limit
+ ? `${text.substring(0, limit)}...`
+ : text
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]