Browse Source

Task/migrate various components from NgStyle to style bindings (#7008)

* Migrate various components from NgStyle to style bindings

* Update changelog
pull/6853/merge
Ankit Singh 2 days ago
committed by GitHub
parent
commit
124940bf53
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 1
      CHANGELOG.md
  2. 2
      apps/client/src/app/components/benchmark-comparator/benchmark-comparator.component.html
  3. 2
      apps/client/src/app/components/benchmark-comparator/benchmark-comparator.component.ts
  4. 2
      apps/client/src/app/components/investment-chart/investment-chart.component.html
  5. 3
      apps/client/src/app/components/investment-chart/investment-chart.component.ts
  6. 3
      apps/client/src/app/pages/portfolio/fire/fire-page.component.ts
  7. 11
      apps/client/src/app/pages/portfolio/fire/fire-page.html
  8. 2
      libs/ui/src/lib/fire-calculator/fire-calculator.component.html
  9. 5
      libs/ui/src/lib/line-chart/line-chart.component.html
  10. 3
      libs/ui/src/lib/line-chart/line-chart.component.ts
  11. 5
      libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.html
  12. 3
      libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.ts
  13. 2
      libs/ui/src/lib/premium-indicator/premium-indicator.component.html
  14. 3
      libs/ui/src/lib/premium-indicator/premium-indicator.component.ts
  15. 5
      libs/ui/src/lib/treemap-chart/treemap-chart.component.html
  16. 3
      libs/ui/src/lib/treemap-chart/treemap-chart.component.ts

1
CHANGELOG.md

@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Prefilled the form in the account balance management with the current cash balance - Prefilled the form in the account balance management with the current cash balance
- Disabled the selection of future dates in the account balance management - Disabled the selection of future dates in the account balance management
- Migrated various components from `NgStyle` to style bindings
- Improved the language localization for Korean (`ko`) - Improved the language localization for Korean (`ko`)
## 3.8.0 - 2026-06-07 ## 3.8.0 - 2026-06-07

2
apps/client/src/app/components/benchmark-comparator/benchmark-comparator.component.html

@ -53,6 +53,6 @@
<canvas <canvas
#chartCanvas #chartCanvas
class="h-100" class="h-100"
[ngStyle]="{ display: isLoading() ? 'none' : 'block' }" [style.display]="isLoading() ? 'none' : 'block'"
></canvas> ></canvas>
</div> </div>

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

@ -17,7 +17,6 @@ import { ColorScheme } from '@ghostfolio/common/types';
import { registerChartConfiguration } from '@ghostfolio/ui/chart'; import { registerChartConfiguration } from '@ghostfolio/ui/chart';
import { GfPremiumIndicatorComponent } from '@ghostfolio/ui/premium-indicator'; import { GfPremiumIndicatorComponent } from '@ghostfolio/ui/premium-indicator';
import { CommonModule } from '@angular/common';
import { import {
ChangeDetectionStrategy, ChangeDetectionStrategy,
Component, Component,
@ -53,7 +52,6 @@ import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader';
@Component({ @Component({
changeDetection: ChangeDetectionStrategy.OnPush, changeDetection: ChangeDetectionStrategy.OnPush,
imports: [ imports: [
CommonModule,
FormsModule, FormsModule,
GfPremiumIndicatorComponent, GfPremiumIndicatorComponent,
IonIcon, IonIcon,

2
apps/client/src/app/components/investment-chart/investment-chart.component.html

@ -10,5 +10,5 @@
<canvas <canvas
#chartCanvas #chartCanvas
class="h-100" class="h-100"
[ngStyle]="{ display: isLoading ? 'none' : 'block' }" [style.display]="isLoading ? 'none' : 'block'"
></canvas> ></canvas>

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

@ -16,7 +16,6 @@ import { InvestmentItem } from '@ghostfolio/common/interfaces/investment-item.in
import { ColorScheme, GroupBy } from '@ghostfolio/common/types'; import { ColorScheme, GroupBy } from '@ghostfolio/common/types';
import { registerChartConfiguration } from '@ghostfolio/ui/chart'; import { registerChartConfiguration } from '@ghostfolio/ui/chart';
import { CommonModule } from '@angular/common';
import { import {
ChangeDetectionStrategy, ChangeDetectionStrategy,
Component, Component,
@ -49,7 +48,7 @@ import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader';
@Component({ @Component({
changeDetection: ChangeDetectionStrategy.OnPush, changeDetection: ChangeDetectionStrategy.OnPush,
imports: [CommonModule, NgxSkeletonLoaderModule], imports: [NgxSkeletonLoaderModule],
selector: 'gf-investment-chart', selector: 'gf-investment-chart',
styleUrls: ['./investment-chart.component.scss'], styleUrls: ['./investment-chart.component.scss'],
templateUrl: './investment-chart.component.html' templateUrl: './investment-chart.component.html'

3
apps/client/src/app/pages/portfolio/fire/fire-page.component.ts

@ -12,7 +12,7 @@ import { GfPremiumIndicatorComponent } from '@ghostfolio/ui/premium-indicator';
import { DataService } from '@ghostfolio/ui/services'; import { DataService } from '@ghostfolio/ui/services';
import { GfValueComponent } from '@ghostfolio/ui/value'; import { GfValueComponent } from '@ghostfolio/ui/value';
import { CommonModule, NgStyle } from '@angular/common'; import { CommonModule } from '@angular/common';
import { import {
ChangeDetectorRef, ChangeDetectorRef,
Component, Component,
@ -35,7 +35,6 @@ import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader';
GfFireCalculatorComponent, GfFireCalculatorComponent,
GfPremiumIndicatorComponent, GfPremiumIndicatorComponent,
GfValueComponent, GfValueComponent,
NgStyle,
NgxSkeletonLoaderModule, NgxSkeletonLoaderModule,
ReactiveFormsModule ReactiveFormsModule
], ],

11
apps/client/src/app/pages/portfolio/fire/fire-page.html

@ -19,14 +19,15 @@
!hasImpersonationId && hasPermissionToUpdateUserSettings !hasImpersonationId && hasPermissionToUpdateUserSettings
" "
[locale]="user?.settings?.locale" [locale]="user?.settings?.locale"
[ngStyle]="{
opacity: user?.subscription?.type === 'Basic' ? '0.67' : 'initial',
'pointer-events':
user?.subscription?.type === 'Basic' ? 'none' : 'initial'
}"
[projectedTotalAmount]="user?.settings?.projectedTotalAmount" [projectedTotalAmount]="user?.settings?.projectedTotalAmount"
[retirementDate]="user?.settings?.retirementDate" [retirementDate]="user?.settings?.retirementDate"
[savingsRate]="user?.settings?.savingsRate" [savingsRate]="user?.settings?.savingsRate"
[style.opacity]="
user?.subscription?.type === 'Basic' ? '0.67' : 'initial'
"
[style.pointer-events]="
user?.subscription?.type === 'Basic' ? 'none' : 'initial'
"
(annualInterestRateChanged)="onAnnualInterestRateChange($event)" (annualInterestRateChanged)="onAnnualInterestRateChange($event)"
(calculationCompleted)="onCalculationComplete($event)" (calculationCompleted)="onCalculationComplete($event)"
(projectedTotalAmountChanged)="onProjectedTotalAmountChange($event)" (projectedTotalAmountChanged)="onProjectedTotalAmountChange($event)"

2
libs/ui/src/lib/fire-calculator/fire-calculator.component.html

@ -81,7 +81,7 @@
<canvas <canvas
#chartCanvas #chartCanvas
class="h-100" class="h-100"
[ngStyle]="{ display: isLoading ? 'none' : 'block' }" [style.display]="isLoading ? 'none' : 'block'"
></canvas> ></canvas>
</div> </div>
</div> </div>

5
libs/ui/src/lib/line-chart/line-chart.component.html

@ -7,7 +7,4 @@
}" }"
/> />
} }
<canvas <canvas #chartCanvas [style.display]="isLoading ? 'none' : 'block'"></canvas>
#chartCanvas
[ngStyle]="{ display: isLoading ? 'none' : 'block' }"
></canvas>

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

@ -12,7 +12,6 @@ import {
import { LineChartItem } from '@ghostfolio/common/interfaces'; import { LineChartItem } from '@ghostfolio/common/interfaces';
import { ColorScheme } from '@ghostfolio/common/types'; import { ColorScheme } from '@ghostfolio/common/types';
import { CommonModule } from '@angular/common';
import { import {
AfterViewInit, AfterViewInit,
ChangeDetectionStrategy, ChangeDetectionStrategy,
@ -43,7 +42,7 @@ import { registerChartConfiguration } from '../chart';
@Component({ @Component({
changeDetection: ChangeDetectionStrategy.OnPush, changeDetection: ChangeDetectionStrategy.OnPush,
imports: [CommonModule, NgxSkeletonLoaderModule], imports: [NgxSkeletonLoaderModule],
selector: 'gf-line-chart', selector: 'gf-line-chart',
styleUrls: ['./line-chart.component.scss'], styleUrls: ['./line-chart.component.scss'],
templateUrl: './line-chart.component.html' templateUrl: './line-chart.component.html'

5
libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.html

@ -7,7 +7,4 @@
}" }"
/> />
} }
<canvas <canvas #chartCanvas [style.display]="isLoading ? 'none' : 'block'"></canvas>
#chartCanvas
[ngStyle]="{ display: isLoading ? 'none' : 'block' }"
></canvas>

3
libs/ui/src/lib/portfolio-proportion-chart/portfolio-proportion-chart.component.ts

@ -7,7 +7,6 @@ import {
} from '@ghostfolio/common/interfaces'; } from '@ghostfolio/common/interfaces';
import { ColorScheme } from '@ghostfolio/common/types'; import { ColorScheme } from '@ghostfolio/common/types';
import { CommonModule } from '@angular/common';
import { import {
AfterViewInit, AfterViewInit,
ChangeDetectionStrategy, ChangeDetectionStrategy,
@ -54,7 +53,7 @@ const {
@Component({ @Component({
changeDetection: ChangeDetectionStrategy.OnPush, changeDetection: ChangeDetectionStrategy.OnPush,
imports: [CommonModule, NgxSkeletonLoaderModule], imports: [NgxSkeletonLoaderModule],
selector: 'gf-portfolio-proportion-chart', selector: 'gf-portfolio-proportion-chart',
styleUrls: ['./portfolio-proportion-chart.component.scss'], styleUrls: ['./portfolio-proportion-chart.component.scss'],
templateUrl: './portfolio-proportion-chart.component.html' templateUrl: './portfolio-proportion-chart.component.html'

2
libs/ui/src/lib/premium-indicator/premium-indicator.component.html

@ -1,7 +1,7 @@
<a <a
class="align-items-center d-flex" class="align-items-center d-flex"
title="Upgrade to Ghostfolio Premium" title="Upgrade to Ghostfolio Premium"
[ngStyle]="{ 'pointer-events': enableLink ? 'initial' : 'none' }"
[routerLink]="routerLinkPricing" [routerLink]="routerLinkPricing"
[style.pointer-events]="enableLink ? 'initial' : 'none'"
><ion-icon class="text-muted" name="diamond-outline" ><ion-icon class="text-muted" name="diamond-outline"
/></a> /></a>

3
libs/ui/src/lib/premium-indicator/premium-indicator.component.ts

@ -1,6 +1,5 @@
import { publicRoutes } from '@ghostfolio/common/routes/routes'; import { publicRoutes } from '@ghostfolio/common/routes/routes';
import { CommonModule } from '@angular/common';
import { import {
CUSTOM_ELEMENTS_SCHEMA, CUSTOM_ELEMENTS_SCHEMA,
ChangeDetectionStrategy, ChangeDetectionStrategy,
@ -14,7 +13,7 @@ import { diamondOutline } from 'ionicons/icons';
@Component({ @Component({
changeDetection: ChangeDetectionStrategy.OnPush, changeDetection: ChangeDetectionStrategy.OnPush,
imports: [CommonModule, IonIcon, RouterModule], imports: [IonIcon, RouterModule],
schemas: [CUSTOM_ELEMENTS_SCHEMA], schemas: [CUSTOM_ELEMENTS_SCHEMA],
selector: 'gf-premium-indicator', selector: 'gf-premium-indicator',
styleUrls: ['./premium-indicator.component.scss'], styleUrls: ['./premium-indicator.component.scss'],

5
libs/ui/src/lib/treemap-chart/treemap-chart.component.html

@ -7,7 +7,4 @@
}" }"
/> />
} }
<canvas <canvas #chartCanvas [style.display]="isLoading ? 'none' : 'block'"></canvas>
#chartCanvas
[ngStyle]="{ display: isLoading ? 'none' : 'block' }"
></canvas>

3
libs/ui/src/lib/treemap-chart/treemap-chart.component.ts

@ -10,7 +10,6 @@ import {
} from '@ghostfolio/common/interfaces'; } from '@ghostfolio/common/interfaces';
import { ColorScheme, DateRange } from '@ghostfolio/common/types'; import { ColorScheme, DateRange } from '@ghostfolio/common/types';
import { CommonModule } from '@angular/common';
import { import {
AfterViewInit, AfterViewInit,
ChangeDetectionStrategy, ChangeDetectionStrategy,
@ -45,7 +44,7 @@ const { gray, green, red } = OpenColor;
@Component({ @Component({
changeDetection: ChangeDetectionStrategy.OnPush, changeDetection: ChangeDetectionStrategy.OnPush,
imports: [CommonModule, NgxSkeletonLoaderModule], imports: [NgxSkeletonLoaderModule],
selector: 'gf-treemap-chart', selector: 'gf-treemap-chart',
styleUrls: ['./treemap-chart.component.scss'], styleUrls: ['./treemap-chart.component.scss'],
templateUrl: './treemap-chart.component.html' templateUrl: './treemap-chart.component.html'

Loading…
Cancel
Save