Skip to content

Open Source Wealth Management Software. Angular + NestJS + Prisma + Nx + TypeScript 🤍

Task/move currency removal from cryptocurrency names to general availability (#7650)

Thomas Kaul0a07db82610d
diff --git a/CHANGELOG.md b/CHANGELOG.md
index b052e2d106..f16aa21470 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
+- Moved the improved symbol lookup results by removing the currency from the name of cryptocurrencies from experimental to general availability
- Upgraded `ng-extract-i18n-merge` from `3.3.0` to `3.4.0`
### Fixed
diff --git a/apps/api/src/services/data-provider/data-provider.service.ts b/apps/api/src/services/data-provider/data-provider.service.ts
index 8eca468cb3..5484688b40 100644
--- a/apps/api/src/services/data-provider/data-provider.service.ts
+++ b/apps/api/src/services/data-provider/data-provider.service.ts
@@ -17,6 +17,7 @@ import { CreateOrderDto } from '@ghostfolio/common/dtos';
import { SubscriptionType } from '@ghostfolio/common/enums';
import {
DATE_FORMAT,
+ formatAssetProfileName,
getAssetProfileIdentifier,
getCurrencyFromSymbol,
getStartOfUtcDate,
@@ -125,7 +126,11 @@ export class DataProviderService implements OnModuleInit {
symbol,
dataSource: DataSource[dataSource]
})
- ] = { ...assetProfile, symbol };
+ ] = {
+ ...assetProfile,
+ symbol,
+ name: formatAssetProfileName(assetProfile)
+ };
}
})
);
@@ -897,16 +902,7 @@ export class DataProviderService implements OnModuleInit {
lookupItem.dataProviderInfo.isPremium = false;
}
- if (
- lookupItem.assetSubClass === 'CRYPTOCURRENCY' &&
- user?.settings?.settings.isExperimentalFeatures
- ) {
- // Remove DEFAULT_CURRENCY at the end of cryptocurrency names
- lookupItem.name = lookupItem.name.replace(
- new RegExp(` ${DEFAULT_CURRENCY}$`),
- ''
- );
- }
+ lookupItem.name = formatAssetProfileName(lookupItem);
return lookupItem;
})
diff --git a/libs/common/src/lib/helper.ts b/libs/common/src/lib/helper.ts
index 9aab8d930e..f7b79b2471 100644
--- a/libs/common/src/lib/helper.ts
+++ b/libs/common/src/lib/helper.ts
@@ -261,6 +261,21 @@ export function extractNumberFromString({
}
}
+export function formatAssetProfileName({
+ assetSubClass,
+ name
+}: {
+ assetSubClass?: AssetSubClass;
+ name?: string;
+}) {
+ if (assetSubClass === 'CRYPTOCURRENCY') {
+ // Remove DEFAULT_CURRENCY at the end of cryptocurrency names
+ return name?.replace(new RegExp(` ${DEFAULT_CURRENCY}$`), '');
+ }
+
+ return name;
+}
+
export function formatMonthAndYear({
date,
locale