Browse Source

Merge branch 'main' into feature/improve-validation-for-manual-currency

pull/1769/head
Thomas Kaul 3 years ago
committed by GitHub
parent
commit
0de88477ba
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      CHANGELOG.md
  2. 12
      apps/api/src/app/frontend.middleware.ts
  3. 7
      apps/api/src/main.ts
  4. 3
      apps/client/src/app/components/admin-market-data-detail/admin-market-data-detail.component.html
  5. 17
      apps/client/src/app/components/benchmark-comparator/benchmark-comparator.component.ts
  6. 1
      apps/client/src/app/components/home-market/home-market.html
  7. 15
      apps/client/src/app/components/investment-chart/investment-chart.component.ts
  8. 18
      libs/ui/src/lib/line-chart/line-chart.component.ts

2
CHANGELOG.md

@ -10,6 +10,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed ### Changed
- Improved the validation of the manual currency for the activity fee and unit price - Improved the validation of the manual currency for the activity fee and unit price
- Harmonized the axis style of charts
- Made setting `NODE_ENV: production` optional (to avoid `ENOENT: no such file or directory` errors on startup)
- Removed the environment variable `ENABLE_FEATURE_CUSTOM_SYMBOLS` - Removed the environment variable `ENABLE_FEATURE_CUSTOM_SYMBOLS`
## 1.242.0 - 2023-03-04 ## 1.242.0 - 2023-03-04

12
apps/api/src/app/frontend.middleware.ts

@ -1,11 +1,11 @@
import * as fs from 'fs'; import * as fs from 'fs';
import * as path from 'path'; import * as path from 'path';
import { environment } from '@ghostfolio/api/environments/environment';
import { ConfigurationService } from '@ghostfolio/api/services/configuration.service'; import { ConfigurationService } from '@ghostfolio/api/services/configuration.service';
import { DEFAULT_LANGUAGE_CODE } from '@ghostfolio/common/config'; import { DEFAULT_LANGUAGE_CODE } from '@ghostfolio/common/config';
import { DATE_FORMAT } from '@ghostfolio/common/helper'; import { DATE_FORMAT } from '@ghostfolio/common/helper';
import { Injectable, NestMiddleware } from '@nestjs/common'; import { Injectable, NestMiddleware } from '@nestjs/common';
import { ConfigService } from '@nestjs/config';
import { format } from 'date-fns'; import { format } from 'date-fns';
import { NextFunction, Request, Response } from 'express'; import { NextFunction, Request, Response } from 'express';
@ -18,18 +18,10 @@ export class FrontendMiddleware implements NestMiddleware {
public indexHtmlIt = ''; public indexHtmlIt = '';
public indexHtmlNl = ''; public indexHtmlNl = '';
public indexHtmlPt = ''; public indexHtmlPt = '';
public isProduction: boolean;
public constructor( public constructor(
private readonly configService: ConfigService,
private readonly configurationService: ConfigurationService private readonly configurationService: ConfigurationService
) { ) {
const NODE_ENV =
this.configService.get<'development' | 'production'>('NODE_ENV') ??
'development';
this.isProduction = NODE_ENV === 'production';
try { try {
this.indexHtmlDe = fs.readFileSync( this.indexHtmlDe = fs.readFileSync(
this.getPathOfIndexHtmlFile('de'), this.getPathOfIndexHtmlFile('de'),
@ -100,7 +92,7 @@ export class FrontendMiddleware implements NestMiddleware {
if ( if (
request.path.startsWith('/api/') || request.path.startsWith('/api/') ||
this.isFileRequest(request.url) || this.isFileRequest(request.url) ||
!this.isProduction !environment.production
) { ) {
// Skip // Skip
next(); next();

7
apps/api/src/main.ts

@ -10,13 +10,8 @@ async function bootstrap() {
const configApp = await NestFactory.create(AppModule); const configApp = await NestFactory.create(AppModule);
const configService = configApp.get<ConfigService>(ConfigService); const configService = configApp.get<ConfigService>(ConfigService);
const NODE_ENV =
configService.get<'development' | 'production'>('NODE_ENV') ??
'development';
const app = await NestFactory.create(AppModule, { const app = await NestFactory.create(AppModule, {
logger: logger: environment.production
NODE_ENV === 'production'
? ['error', 'log', 'warn'] ? ['error', 'log', 'warn']
: ['debug', 'error', 'log', 'verbose', 'warn'] : ['debug', 'error', 'log', 'verbose', 'warn']
}); });

3
apps/client/src/app/components/admin-market-data-detail/admin-market-data-detail.component.html

@ -1,6 +1,7 @@
<div> <div>
<gf-line-chart <gf-line-chart
class="mb-4" class="mb-4"
[colorScheme]="user?.settings?.colorScheme"
[historicalDataItems]="historicalDataItems" [historicalDataItems]="historicalDataItems"
[isAnimated]="true" [isAnimated]="true"
[locale]="locale" [locale]="locale"
@ -28,7 +29,7 @@
}" }"
[title]=" [title]="
(itemByMonth.key + '-' + (i + 1 < 10 ? '0' + (i + 1) : i + 1) (itemByMonth.key + '-' + (i + 1 < 10 ? '0' + (i + 1) : i + 1)
| date: defaultDateFormat) ?? '' | date : defaultDateFormat) ?? ''
" "
(click)=" (click)="
onOpenMarketDataDetail({ onOpenMarketDataDetail({

17
apps/client/src/app/components/benchmark-comparator/benchmark-comparator.component.ts

@ -166,7 +166,6 @@ export class BenchmarkComparatorComponent implements OnChanges, OnDestroy {
}, },
display: true, display: true,
grid: { grid: {
color: `rgba(${getTextColor(this.colorScheme)}, 0.8)`,
display: false display: false
}, },
type: 'time', type: 'time',
@ -177,13 +176,21 @@ export class BenchmarkComparatorComponent implements OnChanges, OnDestroy {
}, },
y: { y: {
border: { border: {
color: `rgba(${getTextColor(this.colorScheme)}, 0.1)`, width: 0
display: false
}, },
display: true, display: true,
grid: { grid: {
color: `rgba(${getTextColor(this.colorScheme)}, 0.8)`, color: ({ scale, tick }) => {
display: false if (
tick.value === 0 ||
tick.value === scale.max ||
tick.value === scale.min
) {
return `rgba(${getTextColor(this.colorScheme)}, 0.1)`;
}
return 'transparent';
}
}, },
position: 'right', position: 'right',
ticks: { ticks: {

1
apps/client/src/app/components/home-market/home-market.html

@ -10,6 +10,7 @@
symbol="Fear & Greed Index" symbol="Fear & Greed Index"
yMax="100" yMax="100"
yMin="0" yMin="0"
[colorScheme]="user?.settings?.colorScheme"
[historicalDataItems]="historicalDataItems" [historicalDataItems]="historicalDataItems"
[isAnimated]="true" [isAnimated]="true"
[locale]="user?.settings?.locale" [locale]="user?.settings?.locale"

15
apps/client/src/app/components/investment-chart/investment-chart.component.ts

@ -283,7 +283,6 @@ export class InvestmentChartComponent implements OnChanges, OnDestroy {
}, },
display: true, display: true,
grid: { grid: {
color: `rgba(${getTextColor(this.colorScheme)}, 0.8)`,
display: false display: false
}, },
min: this.daysInMarket min: this.daysInMarket
@ -298,13 +297,21 @@ export class InvestmentChartComponent implements OnChanges, OnDestroy {
}, },
y: { y: {
border: { border: {
color: `rgba(${getTextColor(this.colorScheme)}, 0.1)`,
display: false display: false
}, },
display: !this.isInPercent, display: !this.isInPercent,
grid: { grid: {
color: `rgba(${getTextColor(this.colorScheme)}, 0.8)`, color: ({ scale, tick }) => {
display: false if (
tick.value === 0 ||
tick.value === scale.max ||
tick.value === scale.min
) {
return `rgba(${getTextColor(this.colorScheme)}, 0.1)`;
}
return 'transparent';
}
}, },
position: 'right', position: 'right',
ticks: { ticks: {

18
libs/ui/src/lib/line-chart/line-chart.component.ts

@ -217,7 +217,6 @@ export class LineChartComponent implements AfterViewInit, OnChanges, OnDestroy {
}, },
display: this.showXAxis, display: this.showXAxis,
grid: { grid: {
color: `rgba(${getTextColor(this.colorScheme)}, 0.8)`,
display: false display: false
}, },
time: { time: {
@ -228,12 +227,23 @@ export class LineChartComponent implements AfterViewInit, OnChanges, OnDestroy {
}, },
y: { y: {
border: { border: {
color: `rgba(${getTextColor(this.colorScheme)}, 0.1)` width: 0
}, },
display: this.showYAxis, display: this.showYAxis,
grid: { grid: {
color: `rgba(${getTextColor(this.colorScheme)}, 0.8)`, color: ({ scale, tick }) => {
display: false if (
tick.value === 0 ||
tick.value === scale.max ||
tick.value === scale.min ||
tick.value === this.yMax ||
tick.value === this.yMin
) {
return `rgba(${getTextColor(this.colorScheme)}, 0.1)`;
}
return 'transparent';
}
}, },
max: this.yMax, max: this.yMax,
min: this.yMin, min: this.yMin,

Loading…
Cancel
Save