Browse Source

refactor(client): address review comments for strict templates

pull/8108/head
KenTandrian 5 days ago
parent
commit
567b504064
  1. 1
      apps/client/src/app/components/account-detail-dialog/account-detail-dialog.html
  2. 1
      apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.html
  3. 27
      apps/client/src/app/components/markets/markets.component.ts
  4. 8
      apps/client/tsconfig.json

1
apps/client/src/app/components/account-detail-dialog/account-detail-dialog.html

@ -153,7 +153,6 @@
[hasPermissionToCreateActivity]="data.hasPermissionToCreateActivity"
[hasPermissionToDeleteActivity]="false"
[hasPermissionToExportActivities]="!showValuesInPercentage()"
[hasPermissionToFilter]="false"
[hasPermissionToOpenDetails]="false"
[hasPermissionToUpdateActivity]="data.hasPermissionToUpdateActivity"
[locale]="user?.settings?.locale"

1
apps/client/src/app/components/holding-detail-dialog/holding-detail-dialog.html

@ -383,7 +383,6 @@
[hasPermissionToExportActivities]="
!data.impersonationId && !user?.settings?.isRestrictedView
"
[hasPermissionToFilter]="false"
[hasPermissionToOpenDetails]="false"
[hasPermissionToUpdateActivity]="data.hasPermissionToUpdateActivity"
[locale]="data.locale"

27
apps/client/src/app/components/markets/markets.component.ts

@ -28,6 +28,7 @@ import {
signal
} from '@angular/core';
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
import { isNumber } from 'lodash-es';
import { DeviceDetectorService } from 'ngx-device-detector';
@Component({
@ -158,18 +159,20 @@ export class GfMarketsComponent implements OnInit {
this.fearAndGreedIndex =
this.fearAndGreedIndexData[this.fearAndGreedIndexMode]?.marketPrice;
this.historicalDataItems = [
...(
this.fearAndGreedIndexData[this.fearAndGreedIndexMode]
?.historicalData ?? []
).map(({ date, value }) => ({
date,
value: value ?? 0
})),
{
const historicalDataItems = (
this.fearAndGreedIndexData[this.fearAndGreedIndexMode]?.historicalData ??
[]
).filter((item): item is LineChartItem => {
return isNumber(item.value);
});
if (isNumber(this.fearAndGreedIndex)) {
historicalDataItems.push({
date: resetHours(new Date()).toISOString(),
value: this.fearAndGreedIndex ?? 0
}
];
value: this.fearAndGreedIndex
});
}
this.historicalDataItems = historicalDataItems;
}
}

8
apps/client/tsconfig.json

@ -14,7 +14,15 @@
}
],
"angularCompilerOptions": {
"extendedDiagnostics": {
"checks": {
// TODO: Remove once the fields are typed as optional
"nullishCoalescingNotNullable": "suppress",
"optionalChainNotNullable": "suppress"
}
},
"strictInjectionParameters": true,
"strictInputAccessModifiers": true,
"strictTemplates": true
},
"compilerOptions": {

Loading…
Cancel
Save