Skip to content

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

Bugfix/fix line chart labels (#491)

Thomas Kaul705441ecf80b
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 4ec49a8841..46a940772d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -16,6 +16,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Upgraded `rxjs` from version `6.6.7` to `7.4.0`
- Upgraded `storybook` from version `6.3.8` to `6.4.0-rc.3`
+### Fixed
+
+- Fixed the broken line charts showing value labels if openend from the allocations page
+- Fixed the click event for drafts in the transactions table
+
## 1.80.0 - 23.11.2021
### Added
diff --git a/apps/client/src/app/components/transactions-table/transactions-table.component.html b/apps/client/src/app/components/transactions-table/transactions-table.component.html
index ead16806c9..ba56f77a78 100644
--- a/apps/client/src/app/components/transactions-table/transactions-table.component.html
+++ b/apps/client/src/app/components/transactions-table/transactions-table.component.html
@@ -254,10 +254,12 @@
*matRowDef="let row; columns: displayedColumns"
mat-row
(click)="
- onOpenPositionDialog({
- symbol: row.symbol
- })
+ !row.isDraft &&
+ onOpenPositionDialog({
+ symbol: row.symbol
+ })
"
+ [ngClass]="{ 'is-draft': row.isDraft }"
></tr>
</table>
diff --git a/apps/client/src/app/components/transactions-table/transactions-table.component.scss b/apps/client/src/app/components/transactions-table/transactions-table.component.scss
index ebb6599bcf..965de25a84 100644
--- a/apps/client/src/app/components/transactions-table/transactions-table.component.scss
+++ b/apps/client/src/app/components/transactions-table/transactions-table.component.scss
@@ -24,7 +24,9 @@
}
.mat-row {
- cursor: pointer;
+ &:not(.is-draft) {
+ cursor: pointer;
+ }
.type-badge {
background-color: rgba(var(--palette-foreground-text), 0.05);
diff --git a/libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.ts b/libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.ts
index e5ac3e92a2..7ec180b05d 100644
--- a/libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.ts
+++ b/libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.ts
@@ -54,13 +54,7 @@ export class PortfolioProportionChartComponent
};
public constructor() {
- Chart.register(
- ArcElement,
- ChartDataLabels,
- DoughnutController,
- LinearScale,
- Tooltip
- );
+ Chart.register(ArcElement, DoughnutController, LinearScale, Tooltip);
}
public ngAfterViewInit() {
@@ -76,7 +70,6 @@ export class PortfolioProportionChartComponent
}
public ngOnDestroy() {
- Chart.unregister(ChartDataLabels);
this.chart?.destroy();
}
@@ -254,7 +247,7 @@ export class PortfolioProportionChartComponent
} else {
this.chart = new Chart(this.chartCanvas.nativeElement, {
data,
- options: {
+ options: <unknown>{
cutout: '70%',
layout: {
padding: this.showLabels === true ? 100 : 0
@@ -316,6 +309,7 @@ export class PortfolioProportionChartComponent
}
}
},
+ plugins: [ChartDataLabels],
type: 'doughnut'
});
}