Browse Source

Task/remove deprecated fear and greed index symbol (#7103)

Remove deprecated fear and greed index symbol
pull/7104/head
Thomas Kaul 7 days ago
committed by GitHub
parent
commit
6e97a3c978
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 19
      apps/api/src/services/data-provider/rapid-api/rapid-api.service.ts
  2. 4
      apps/api/src/services/twitter-bot/twitter-bot.service.ts
  3. 4
      apps/client/src/app/components/home-market/home-market.component.ts
  4. 4
      libs/common/src/lib/config.ts
  5. 2
      libs/common/src/lib/helper.ts

19
apps/api/src/services/data-provider/rapid-api/rapid-api.service.ts

@ -8,10 +8,7 @@ import {
GetSearchParams
} from '@ghostfolio/api/services/data-provider/interfaces/data-provider.interface';
import { FetchService } from '@ghostfolio/api/services/fetch/fetch.service';
import {
ghostfolioFearAndGreedIndexSymbol,
ghostfolioFearAndGreedIndexSymbolStocks
} from '@ghostfolio/common/config';
import { ghostfolioFearAndGreedIndexSymbolStocks } from '@ghostfolio/common/config';
import { DATE_FORMAT, getYesterday } from '@ghostfolio/common/helper';
import {
DataProviderHistoricalResponse,
@ -64,12 +61,7 @@ export class RapidApiService implements DataProviderInterface {
[symbol: string]: { [date: string]: DataProviderHistoricalResponse };
}> {
try {
if (
[
ghostfolioFearAndGreedIndexSymbol,
ghostfolioFearAndGreedIndexSymbolStocks
].includes(symbol)
) {
if (symbol === ghostfolioFearAndGreedIndexSymbolStocks) {
const fgi = await this.getFearAndGreedIndex();
return {
@ -106,12 +98,7 @@ export class RapidApiService implements DataProviderInterface {
try {
const symbol = symbols[0];
if (
[
ghostfolioFearAndGreedIndexSymbol,
ghostfolioFearAndGreedIndexSymbolStocks
].includes(symbol)
) {
if (symbol === ghostfolioFearAndGreedIndexSymbolStocks) {
const fgi = await this.getFearAndGreedIndex();
return {

4
apps/api/src/services/twitter-bot/twitter-bot.service.ts

@ -3,7 +3,7 @@ import { BenchmarkService } from '@ghostfolio/api/services/benchmark/benchmark.s
import { ConfigurationService } from '@ghostfolio/api/services/configuration/configuration.service';
import {
ghostfolioFearAndGreedIndexDataSourceStocks,
ghostfolioFearAndGreedIndexSymbol
ghostfolioFearAndGreedIndexSymbolStocks
} from '@ghostfolio/common/config';
import {
resolveFearAndGreedIndex,
@ -49,7 +49,7 @@ export class TwitterBotService implements OnModuleInit {
const symbolItem = await this.symbolService.get({
dataGatheringItem: {
dataSource: ghostfolioFearAndGreedIndexDataSourceStocks,
symbol: ghostfolioFearAndGreedIndexSymbol
symbol: ghostfolioFearAndGreedIndexSymbolStocks
}
});

4
apps/client/src/app/components/home-market/home-market.component.ts

@ -1,6 +1,6 @@
import { GfFearAndGreedIndexComponent } from '@ghostfolio/client/components/fear-and-greed-index/fear-and-greed-index.component';
import { UserService } from '@ghostfolio/client/services/user/user.service';
import { ghostfolioFearAndGreedIndexSymbol } from '@ghostfolio/common/config';
import { ghostfolioFearAndGreedIndexSymbolStocks } from '@ghostfolio/common/config';
import { resetHours } from '@ghostfolio/common/helper';
import {
Benchmark,
@ -86,7 +86,7 @@ export class GfHomeMarketComponent implements OnInit {
.fetchSymbolItem({
dataSource: this.info.fearAndGreedDataSource,
includeHistoricalData: this.numberOfDays,
symbol: ghostfolioFearAndGreedIndexSymbol
symbol: ghostfolioFearAndGreedIndexSymbolStocks
})
.pipe(takeUntilDestroyed(this.destroyRef))
.subscribe(({ historicalData, marketPrice }) => {

4
libs/common/src/lib/config.ts

@ -5,11 +5,13 @@ import ms from 'ms';
import { ColorScheme, DateRange } from './types';
export const ghostfolioPrefix = 'GF';
/* @deprecated */
export const ghostfolioScraperApiSymbolPrefix = `_${ghostfolioPrefix}_`;
export const ghostfolioFearAndGreedIndexDataSourceCryptocurrencies =
DataSource.MANUAL;
export const ghostfolioFearAndGreedIndexDataSourceStocks = DataSource.RAPID_API;
export const ghostfolioFearAndGreedIndexSymbol = `${ghostfolioScraperApiSymbolPrefix}FEAR_AND_GREED_INDEX`;
export const ghostfolioFearAndGreedIndexSymbolCryptocurrencies = `${ghostfolioPrefix}_FEAR_AND_GREED_INDEX_CRYPTOCURRENCIES`;
export const ghostfolioFearAndGreedIndexSymbolStocks = `${ghostfolioPrefix}_FEAR_AND_GREED_INDEX_STOCKS`;

2
libs/common/src/lib/helper.ts

@ -38,7 +38,6 @@ import {
DEFAULT_CURRENCY,
DEFAULT_LOCALE,
DERIVED_CURRENCIES,
ghostfolioFearAndGreedIndexSymbol,
ghostfolioFearAndGreedIndexSymbolCryptocurrencies,
ghostfolioFearAndGreedIndexSymbolStocks,
ghostfolioScraperApiSymbolPrefix
@ -157,7 +156,6 @@ export function canDeleteAssetProfile({
!isBenchmark &&
!isDerivedCurrency(getCurrencyFromSymbol(symbol)) &&
!isRootCurrency(getCurrencyFromSymbol(symbol)) &&
symbol !== ghostfolioFearAndGreedIndexSymbol &&
symbol !== ghostfolioFearAndGreedIndexSymbolCryptocurrencies &&
symbol !== ghostfolioFearAndGreedIndexSymbolStocks &&
watchedByCount === 0

Loading…
Cancel
Save