-
-
Notifications
You must be signed in to change notification settings - Fork 171
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* fix issue #757 - Folder size indicator show "k" when over 1,000 * reduce complexity to respect codeclimate * issue 757: create a pipe Co-authored-by: Jean-Michel Dagenais <jm@obkio.com>
- Loading branch information
1 parent
728ccfd
commit b56b6c0
Showing
4 changed files
with
25 additions
and
8 deletions.
There are no files selected for viewing
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
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
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
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,15 @@ | ||
import { Pipe, PipeTransform } from '@angular/core'; | ||
|
||
@Pipe({ | ||
name: 'folderSize' | ||
}) | ||
export class FolderSizePipe implements PipeTransform { | ||
transform(value: any, ...args: any[]): any { | ||
const fileCount = parseInt(value, 10); | ||
if (fileCount >= 1000) { | ||
return Math.floor(fileCount / 1000) + 'k'; | ||
} else { | ||
return value; | ||
} | ||
} | ||
} |