diff --git a/CHANGELOG.md b/CHANGELOG.md
index 7a9ac2e3..3698f063 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
- Improved the symbol validation in the _Yahoo Finance_ service (get asset profiles)
+- Refactored `lodash.uniq` with `Array.from(new Set(...))`
- Refreshed the cryptocurrencies list
### Fixed
diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md
index cea43095..1c45aeca 100644
--- a/DEVELOPMENT.md
+++ b/DEVELOPMENT.md
@@ -60,6 +60,10 @@ Remove permission in `UserService` using `without()`
Use `@if (user?.settings?.isExperimentalFeatures) {}` in HTML template
+## Component Library (_Storybook_)
+
+https://ghostfol.io/development/storybook
+
## Git
### Rebase
diff --git a/apps/api/src/app/portfolio/calculator/portfolio-calculator.ts b/apps/api/src/app/portfolio/calculator/portfolio-calculator.ts
index 54d80a95..52d57230 100644
--- a/apps/api/src/app/portfolio/calculator/portfolio-calculator.ts
+++ b/apps/api/src/app/portfolio/calculator/portfolio-calculator.ts
@@ -49,7 +49,7 @@ import {
min,
subDays
} from 'date-fns';
-import { isNumber, sortBy, sum, uniq, uniqBy } from 'lodash';
+import { isNumber, sortBy, sum, uniqBy } from 'lodash';
export abstract class PortfolioCalculator {
protected static readonly ENABLE_LOGGING = false;
@@ -222,7 +222,7 @@ export abstract class PortfolioCalculator {
const exchangeRatesByCurrency =
await this.exchangeRateDataService.getExchangeRatesByCurrency({
- currencies: uniq(Object.values(currencies)),
+ currencies: Array.from(new Set(Object.values(currencies))),
endDate: endOfDay(this.endDate),
startDate: this.startDate,
targetCurrency: this.currency
diff --git a/apps/api/src/app/portfolio/portfolio.service.ts b/apps/api/src/app/portfolio/portfolio.service.ts
index e90ebd4a..a3d9e3c4 100644
--- a/apps/api/src/app/portfolio/portfolio.service.ts
+++ b/apps/api/src/app/portfolio/portfolio.service.ts
@@ -82,7 +82,7 @@ import {
parseISO,
set
} from 'date-fns';
-import { isEmpty, uniq } from 'lodash';
+import { isEmpty } from 'lodash';
import { PortfolioCalculator } from './calculator/portfolio-calculator';
import {
@@ -2032,14 +2032,16 @@ export class PortfolioService {
where: { id: filters[0].id }
});
} else {
- const accountIds = uniq(
- activities
- .filter(({ accountId }) => {
- return accountId;
- })
- .map(({ accountId }) => {
- return accountId;
- })
+ const accountIds = Array.from(
+ new Set(
+ activities
+ .filter(({ accountId }) => {
+ return accountId;
+ })
+ .map(({ accountId }) => {
+ return accountId;
+ })
+ )
);
currentAccounts = await this.accountService.accounts({
diff --git a/apps/api/src/services/exchange-rate-data/exchange-rate-data.service.ts b/apps/api/src/services/exchange-rate-data/exchange-rate-data.service.ts
index db95a348..0a2d177c 100644
--- a/apps/api/src/services/exchange-rate-data/exchange-rate-data.service.ts
+++ b/apps/api/src/services/exchange-rate-data/exchange-rate-data.service.ts
@@ -23,7 +23,7 @@ import {
isToday,
subDays
} from 'date-fns';
-import { isNumber, uniq } from 'lodash';
+import { isNumber } from 'lodash';
import ms from 'ms';
@Injectable()
@@ -515,7 +515,7 @@ export class ExchangeRateDataService {
}
}
- return uniq(currencies).filter(Boolean).sort();
+ return Array.from(new Set(currencies)).filter(Boolean).sort();
}
private prepareCurrencyPairs(aCurrencies: string[]) {
diff --git a/apps/client/src/app/components/admin-market-data/create-asset-profile-dialog/create-asset-profile-dialog.component.ts b/apps/client/src/app/components/admin-market-data/create-asset-profile-dialog/create-asset-profile-dialog.component.ts
index b0f69fa5..e8455457 100644
--- a/apps/client/src/app/components/admin-market-data/create-asset-profile-dialog/create-asset-profile-dialog.component.ts
+++ b/apps/client/src/app/components/admin-market-data/create-asset-profile-dialog/create-asset-profile-dialog.component.ts
@@ -20,7 +20,6 @@ import {
} from '@angular/forms';
import { MatDialogRef } from '@angular/material/dialog';
import { isISO4217CurrencyCode } from 'class-validator';
-import { uniq } from 'lodash';
import { Subject, takeUntil } from 'rxjs';
import { CreateAssetProfileDialogMode } from './interfaces/interfaces';
@@ -87,7 +86,9 @@ export class CreateAssetProfileDialog implements OnInit, OnDestroy {
this.createAssetProfileForm.get('addCurrency').value as string
).toUpperCase();
- const currencies = uniq([...this.customCurrencies, currency]).sort();
+ const currencies = Array.from(
+ new Set([...this.customCurrencies, currency])
+ ).sort();
this.dataService
.putAdminSetting(PROPERTY_CURRENCIES, {
diff --git a/apps/client/src/app/components/user-account-settings/user-account-settings.component.ts b/apps/client/src/app/components/user-account-settings/user-account-settings.component.ts
index ced61711..1ee23ff8 100644
--- a/apps/client/src/app/components/user-account-settings/user-account-settings.component.ts
+++ b/apps/client/src/app/components/user-account-settings/user-account-settings.component.ts
@@ -24,7 +24,6 @@ import { FormBuilder, Validators } from '@angular/forms';
import { MatSlideToggleChange } from '@angular/material/slide-toggle';
import { MatSnackBar } from '@angular/material/snack-bar';
import { format, parseISO } from 'date-fns';
-import { uniq } from 'lodash';
import ms from 'ms';
import { EMPTY, Subject, throwError } from 'rxjs';
import { catchError, takeUntil } from 'rxjs/operators';
@@ -108,7 +107,7 @@ export class UserAccountSettingsComponent implements OnDestroy, OnInit {
);
this.locales.push(this.user.settings.locale);
- this.locales = uniq(this.locales.sort());
+ this.locales = Array.from(new Set(this.locales)).sort();
this.changeDetectorRef.markForCheck();
}
diff --git a/apps/client/src/locales/messages.ca.xlf b/apps/client/src/locales/messages.ca.xlf
index 0f9de490..f83df877 100644
--- a/apps/client/src/locales/messages.ca.xlf
+++ b/apps/client/src/locales/messages.ca.xlf
@@ -7589,7 +7589,7 @@
AI prompt has been copied to the clipboard
apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts
- 170
+ 173
@@ -7685,7 +7685,7 @@
Open Duck.ai
apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts
- 171
+ 174
diff --git a/apps/client/src/locales/messages.de.xlf b/apps/client/src/locales/messages.de.xlf
index 223253ba..d8ee071f 100644
--- a/apps/client/src/locales/messages.de.xlf
+++ b/apps/client/src/locales/messages.de.xlf
@@ -7589,7 +7589,7 @@
KI-Anweisung wurde in die Zwischenablage kopiert
apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts
- 170
+ 173
@@ -7685,7 +7685,7 @@
Öffne Duck.ai
apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts
- 171
+ 174
diff --git a/apps/client/src/locales/messages.es.xlf b/apps/client/src/locales/messages.es.xlf
index a763a390..5b9c5dbe 100644
--- a/apps/client/src/locales/messages.es.xlf
+++ b/apps/client/src/locales/messages.es.xlf
@@ -7590,7 +7590,7 @@
AI prompt has been copied to the clipboard
apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts
- 170
+ 173
@@ -7686,7 +7686,7 @@
Open Duck.ai
apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts
- 171
+ 174
diff --git a/apps/client/src/locales/messages.fr.xlf b/apps/client/src/locales/messages.fr.xlf
index 0e7b6b9a..2b61e3ed 100644
--- a/apps/client/src/locales/messages.fr.xlf
+++ b/apps/client/src/locales/messages.fr.xlf
@@ -7589,7 +7589,7 @@
AI prompt has been copied to the clipboard
apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts
- 170
+ 173
@@ -7685,7 +7685,7 @@
Open Duck.ai
apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts
- 171
+ 174
diff --git a/apps/client/src/locales/messages.it.xlf b/apps/client/src/locales/messages.it.xlf
index 4ab6c53a..3d12719e 100644
--- a/apps/client/src/locales/messages.it.xlf
+++ b/apps/client/src/locales/messages.it.xlf
@@ -7590,7 +7590,7 @@
AI prompt has been copied to the clipboard
apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts
- 170
+ 173
@@ -7686,7 +7686,7 @@
Open Duck.ai
apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts
- 171
+ 174
diff --git a/apps/client/src/locales/messages.nl.xlf b/apps/client/src/locales/messages.nl.xlf
index 13671956..fa29621a 100644
--- a/apps/client/src/locales/messages.nl.xlf
+++ b/apps/client/src/locales/messages.nl.xlf
@@ -7589,7 +7589,7 @@
AI prompt has been copied to the clipboard
apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts
- 170
+ 173
@@ -7685,7 +7685,7 @@
Open Duck.ai
apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts
- 171
+ 174
diff --git a/apps/client/src/locales/messages.pl.xlf b/apps/client/src/locales/messages.pl.xlf
index ac208d13..e6e89741 100644
--- a/apps/client/src/locales/messages.pl.xlf
+++ b/apps/client/src/locales/messages.pl.xlf
@@ -7589,7 +7589,7 @@
AI prompt has been copied to the clipboard
apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts
- 170
+ 173
@@ -7685,7 +7685,7 @@
Open Duck.ai
apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts
- 171
+ 174
diff --git a/apps/client/src/locales/messages.pt.xlf b/apps/client/src/locales/messages.pt.xlf
index 789ee636..5676461e 100644
--- a/apps/client/src/locales/messages.pt.xlf
+++ b/apps/client/src/locales/messages.pt.xlf
@@ -7589,7 +7589,7 @@
AI prompt has been copied to the clipboard
apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts
- 170
+ 173
@@ -7685,7 +7685,7 @@
Open Duck.ai
apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts
- 171
+ 174
diff --git a/apps/client/src/locales/messages.tr.xlf b/apps/client/src/locales/messages.tr.xlf
index 05e2566f..f9e2bfd9 100644
--- a/apps/client/src/locales/messages.tr.xlf
+++ b/apps/client/src/locales/messages.tr.xlf
@@ -7589,7 +7589,7 @@
AI prompt has been copied to the clipboard
apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts
- 170
+ 173
@@ -7685,7 +7685,7 @@
Open Duck.ai
apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts
- 171
+ 174
diff --git a/apps/client/src/locales/messages.uk.xlf b/apps/client/src/locales/messages.uk.xlf
index 94d3893b..2c13d1ef 100644
--- a/apps/client/src/locales/messages.uk.xlf
+++ b/apps/client/src/locales/messages.uk.xlf
@@ -7597,7 +7597,7 @@
Запит AI скопійовано в буфер обміну
apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts
- 170
+ 173
@@ -7685,7 +7685,7 @@
Open Duck.ai
apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts
- 171
+ 174
diff --git a/apps/client/src/locales/messages.xlf b/apps/client/src/locales/messages.xlf
index c1ec934b..778195c2 100644
--- a/apps/client/src/locales/messages.xlf
+++ b/apps/client/src/locales/messages.xlf
@@ -6867,7 +6867,7 @@
AI prompt has been copied to the clipboard
apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts
- 170
+ 173
@@ -6951,7 +6951,7 @@
Open Duck.ai
apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts
- 171
+ 174
diff --git a/apps/client/src/locales/messages.zh.xlf b/apps/client/src/locales/messages.zh.xlf
index 6d6054df..5c1b6bc5 100644
--- a/apps/client/src/locales/messages.zh.xlf
+++ b/apps/client/src/locales/messages.zh.xlf
@@ -7590,7 +7590,7 @@
AI prompt has been copied to the clipboard
apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts
- 170
+ 173
@@ -7686,7 +7686,7 @@
Open Duck.ai
apps/client/src/app/pages/portfolio/analysis/analysis-page.component.ts
- 171
+ 174