Feature/change twitter to x (#2654)

* Change Twitter to X

* Update changelog
pull/2655/head
Thomas Kaul 7 months ago committed by GitHub
parent ae763cbb87
commit 1586cd3a59
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -15,6 +15,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
- Improved the data source validation in the activities import
- Changed _Twitter_ to _𝕏_
- Improved selection in the twitter bot service
- Improved the language localization for German (`de`)
- Upgraded `ng-extract-i18n-merge` from version `2.7.0` to `2.8.3`
- Upgraded `prettier` from version `3.0.3` to `3.1.0`

@ -73,9 +73,10 @@ export class BenchmarkService {
return { trend50d: fiftyDayAverage, trend200d: twoHundredDayAverage };
}
public async getBenchmarks({ useCache = true } = {}): Promise<
BenchmarkResponse['benchmarks']
> {
public async getBenchmarks({
enableSharing = false,
useCache = true
} = {}): Promise<BenchmarkResponse['benchmarks']> {
let benchmarks: BenchmarkResponse['benchmarks'];
if (useCache) {
@ -90,7 +91,9 @@ export class BenchmarkService {
} catch {}
}
const benchmarkAssetProfiles = await this.getBenchmarkAssetProfiles();
const benchmarkAssetProfiles = await this.getBenchmarkAssetProfiles({
enableSharing
});
const promisesAllTimeHighs: Promise<{ date: Date; marketPrice: number }>[] =
[];
@ -162,14 +165,24 @@ export class BenchmarkService {
return benchmarks;
}
public async getBenchmarkAssetProfiles(): Promise<Partial<SymbolProfile>[]> {
public async getBenchmarkAssetProfiles({
enableSharing = false
} = {}): Promise<Partial<SymbolProfile>[]> {
const symbolProfileIds: string[] = (
((await this.propertyService.getByKey(
PROPERTY_BENCHMARKS
)) as BenchmarkProperty[]) ?? []
).map(({ symbolProfileId }) => {
return symbolProfileId;
});
)
.filter((benchmark) => {
if (enableSharing) {
return benchmark.enableSharing;
}
return true;
})
.map(({ symbolProfileId }) => {
return symbolProfileId;
});
const assetProfiles =
await this.symbolProfileService.getSymbolProfilesByIds(symbolProfileIds);

@ -57,7 +57,7 @@ export class TwitterBotService {
symbolItem.marketPrice
}/100)`;
const benchmarkListing = await this.getBenchmarkListing(3);
const benchmarkListing = await this.getBenchmarkListing();
if (benchmarkListing?.length > 1) {
status += '\n\n';
@ -78,29 +78,22 @@ export class TwitterBotService {
}
}
private async getBenchmarkListing(aMax: number) {
private async getBenchmarkListing() {
const benchmarks = await this.benchmarkService.getBenchmarks({
enableSharing: true,
useCache: false
});
const benchmarkListing: string[] = [];
for (const [index, benchmark] of benchmarks.entries()) {
if (index > aMax - 1) {
break;
}
benchmarkListing.push(
`${benchmark.name} ${(
benchmark.performances.allTimeHigh.performancePercent * 100
return benchmarks
.map(({ marketCondition, name, performances }) => {
return `${name} ${(
performances.allTimeHigh.performancePercent * 100
).toFixed(1)}%${
benchmark.marketCondition !== 'NEUTRAL_MARKET'
? ' ' + resolveMarketCondition(benchmark.marketCondition).emoji
marketCondition !== 'NEUTRAL_MARKET'
? ' ' + resolveMarketCondition(marketCondition).emoji
: ''
}`
);
}
return benchmarkListing.join('\n');
}`;
})
.join('\n');
}
}

@ -127,8 +127,11 @@
class="align-items-baseline d-flex"
href="https://twitter.com/ghostfolio_"
target="_blank"
title="Follow Ghostfolio on Twitter"
>Twitter<ion-icon class="ml-1" name="open-outline"></ion-icon
title="Follow Ghostfolio on X (formerly Twitter)"
>X (formerly Twitter)<ion-icon
class="ml-1"
name="open-outline"
></ion-icon
></a>
</li>
<li>&nbsp;</li>

@ -55,7 +55,7 @@
community, tweet to
<a
href="https://twitter.com/ghostfolio_"
title="Tweet to Ghostfolio on Twitter"
title="Post to Ghostfolio on X (formerly Twitter)"
>@ghostfolio_</a
><ng-container *ngIf="user?.subscription?.type === 'Premium'"
>, send an e-mail to
@ -70,14 +70,14 @@
>GitHub</a
>.
</p>
<p class="text-center">
<p class="align-items-center d-flex justify-content-center">
<a
class="mx-2"
href="https://twitter.com/ghostfolio_"
mat-icon-button
title="Follow Ghostfolio on Twitter"
title="Follow Ghostfolio on X (formerly Twitter)"
>
<ion-icon name="logo-twitter"></ion-icon>
<span class="line-height-1 text-center w-100">𝕏</span>
</a>
<a
*ngIf="user?.subscription?.type === 'Premium'"

@ -233,7 +233,7 @@
community,
<a
href="https://twitter.com/ghostfolio_"
title="Tweet to Ghostfolio on Twitter"
title="Post to Ghostfolio on X (formerly Twitter)"
>@ghostfolio_</a
><ng-container *ngIf="user?.subscription?.type === 'Premium'"
>,
@ -262,7 +262,7 @@
>community, tweet to
<a
href="https://twitter.com/ghostfolio_"
title="Tweet to Ghostfolio on Twitter"
title="Post to Ghostfolio on X (formerly Twitter)"
>@ghostfolio_</a
><ng-container *ngIf="user?.subscription?.type === 'Premium'"
>, send an e-mail to

@ -1,3 +1,4 @@
export interface BenchmarkProperty {
enableSharing?: boolean;
symbolProfileId: string;
}

Loading…
Cancel
Save