From 58e12792cc7fdea1957affa3f37f6c20b04e70db Mon Sep 17 00:00:00 2001 From: "Mohamed E." Date: Fri, 6 Sep 2024 11:38:33 +0400 Subject: [PATCH] Code Improvements (#3) * fix: refactor color utils Signed-off-by: Mohamed Elkholy * fix: fix node/npm version support Signed-off-by: Mohamed Elkholy * fix: refactor deprecated `String.substring` method Signed-off-by: Mohamed Elkholy * fix: remove repo count from sidebar Signed-off-by: Mohamed Elkholy --------- Signed-off-by: Mohamed Elkholy --- README.md | 4 +- package.json | 4 +- .../list-categories.component.ts | 2 +- .../list-repo-card.component.ts | 2 +- .../list-repos/list-repos.component.ts | 6 +- .../list-all/list-all.component.ts | 1 + .../list-categories.component.css | 5 -- .../list-categories.component.ts | 6 +- .../list-category/list-category.component.ts | 1 + .../list-search/list-search.component.ts | 3 +- .../list-repo-score.service.ts | 23 +++--- src/app/lists/util/color/gradient.d.ts | 35 --------- src/app/lists/util/color/gradient.js | 62 ---------------- src/app/lists/util/color/gradient.ts | 74 +++++++++++++++++++ src/app/lists/util/color/scale.d.ts | 33 --------- src/app/lists/util/color/scale.js | 61 --------------- src/app/lists/util/color/scale.ts | 67 +++++++++++++++++ src/constants.ts | 15 ++-- 18 files changed, 178 insertions(+), 226 deletions(-) delete mode 100755 src/app/lists/util/color/gradient.d.ts delete mode 100755 src/app/lists/util/color/gradient.js create mode 100755 src/app/lists/util/color/gradient.ts delete mode 100755 src/app/lists/util/color/scale.d.ts delete mode 100755 src/app/lists/util/color/scale.js create mode 100755 src/app/lists/util/color/scale.ts diff --git a/README.md b/README.md index e188b6f..37d29ad 100755 --- a/README.md +++ b/README.md @@ -17,8 +17,8 @@ but I originally used it because Angular Material was still in alpha at the time ### Prerequisites -- Node >= 18.0 -- NPM >= 10.0 +- Node >= 18.19 +- NPM >= 10.2.3 ```bash # Clone the repo diff --git a/package.json b/package.json index 042a67d..853ab1c 100755 --- a/package.json +++ b/package.json @@ -14,8 +14,8 @@ "url": "https://github.com/awesomehub/app.git" }, "engines": { - "node": ">=18.0.0", - "npm": ">=10.0.0" + "node": ">=18.19.0", + "npm": ">=10.2.3" }, "scripts": { "ng": "ng", diff --git a/src/app/lists/components/list-categories/list-categories.component.ts b/src/app/lists/components/list-categories/list-categories.component.ts index c4d4f62..a9b1a02 100755 --- a/src/app/lists/components/list-categories/list-categories.component.ts +++ b/src/app/lists/components/list-categories/list-categories.component.ts @@ -11,7 +11,7 @@ import { List, ListCategory } from '@app/lists' [routerLink]="['/list', list.id, category.path]" (click)="navigate.emit(category)" > - {{ category.title }} {{ category.count.all | number }} + {{ category.title }} diff --git a/src/app/lists/components/list-repo-card/list-repo-card.component.ts b/src/app/lists/components/list-repo-card/list-repo-card.component.ts index 8f6ba44..69bf77e 100755 --- a/src/app/lists/components/list-repo-card/list-repo-card.component.ts +++ b/src/app/lists/components/list-repo-card/list-repo-card.component.ts @@ -107,6 +107,6 @@ export class ListRepoCardComponent { public scoreColorLegend: string[] constructor(private repoScoreService: ListRepoScoreService) { - this.scoreColorLegend = repoScoreService.getScoreColors() + this.scoreColorLegend = repoScoreService.getScoreColorTheme() } } diff --git a/src/app/lists/components/list-repos/list-repos.component.ts b/src/app/lists/components/list-repos/list-repos.component.ts index 54e1148..6428d49 100755 --- a/src/app/lists/components/list-repos/list-repos.component.ts +++ b/src/app/lists/components/list-repos/list-repos.component.ts @@ -17,7 +17,10 @@ import { ListRepo } from '@app/lists' selector: 'ah-list-repos', styleUrls: ['list-repos.component.css'], template: ` -

{{ heading }}

+

+ {{ heading }} + ({{ count | number }}) +