From d68542cb0ccd8a6f4e682ea1fd85318feaed8e1b Mon Sep 17 00:00:00 2001 From: Alex Freska Date: Fri, 20 Sep 2024 14:41:01 -0400 Subject: [PATCH] refactor(renterd): typescript strict mode --- .../components/Alerts/AlertsFilterMenu.tsx | 7 +- apps/renterd/components/Alerts/index.tsx | 2 - apps/renterd/components/CmdRoot/Item.tsx | 8 +- .../Contracts/ContractContextMenu.tsx | 48 +++- .../ContractFilterCmdGroups/Address.tsx | 2 +- .../ContractFilterCmdGroups/ContractSet.tsx | 2 +- .../ContractFilterCmdGroups/PublicKey.tsx | 2 +- .../ContractFilterCmdGroups/index.tsx | 4 +- .../ContractsFilterContractSetDialog.tsx | 5 +- .../Contracts/ContractsFilterMenu/index.tsx | 6 +- .../FilesHealthColumnContents.tsx | 4 +- .../Files/FilesCmd/FilesSearchCmd/index.tsx | 12 +- .../components/Files/FilesCmd/index.tsx | 6 +- .../Files/FilesSearchBucketMenu/index.tsx | 8 +- .../components/Hosts/HostContextMenu.tsx | 19 +- .../components/Hosts/HostMap/Globe.tsx | 13 +- .../components/Hosts/HostMap/GlobeDyn.tsx | 1 + .../components/Hosts/HostMap/HostItem.tsx | 20 +- .../renterd/components/Hosts/HostMap/utils.ts | 14 +- .../HostsFilterCmdGroups/Address.tsx | 2 +- .../HostsFilterCmdGroups/PublicKey.tsx | 2 +- .../Hosts/HostsFilterMenu/index.tsx | 6 +- .../components/Keys/KeysCreateDialog.tsx | 10 +- apps/renterd/components/Keys/index.tsx | 2 - apps/renterd/components/Profile/index.tsx | 4 +- apps/renterd/components/TransferProgress.tsx | 4 +- apps/renterd/components/TransfersBar.tsx | 2 +- .../Uploads/UploadsBreadcrumbMenu.tsx | 7 +- apps/renterd/contexts/alerts/columns.tsx | 18 +- apps/renterd/contexts/alerts/data.tsx | 212 ++++++++++-------- apps/renterd/contexts/alerts/index.tsx | 7 +- apps/renterd/contexts/app/useBusSdk.tsx | 2 +- apps/renterd/contexts/contracts/columns.tsx | 107 +++++---- apps/renterd/contexts/contracts/dataset.tsx | 12 +- apps/renterd/contexts/contracts/index.tsx | 4 +- .../contracts/useContractSetMetrics.tsx | 3 +- .../contexts/contracts/useFilteredStats.tsx | 6 +- .../contracts/usePrunableContractSizes.tsx | 13 +- apps/renterd/contexts/dialog.tsx | 2 +- .../contexts/filesDirectory/columns.tsx | 6 +- .../contexts/filesDirectory/dataset.tsx | 2 +- .../renterd/contexts/filesDirectory/index.tsx | 2 +- apps/renterd/contexts/filesDirectory/move.tsx | 12 +- apps/renterd/contexts/filesFlat/columns.tsx | 6 +- apps/renterd/contexts/filesFlat/dataset.tsx | 1 + apps/renterd/contexts/filesFlat/index.tsx | 3 +- .../renterd/contexts/filesManager/dataset.tsx | 6 +- .../contexts/filesManager/downloads.tsx | 4 + .../contexts/filesManager/index.spec.tsx | 40 ++-- apps/renterd/contexts/filesManager/index.tsx | 8 +- apps/renterd/contexts/filesManager/types.ts | 14 +- .../renterd/contexts/filesManager/uploads.tsx | 29 ++- apps/renterd/contexts/hosts/columns.tsx | 35 +-- apps/renterd/contexts/hosts/dataset.ts | 53 +++-- apps/renterd/contexts/hosts/index.tsx | 19 +- apps/renterd/contexts/hosts/types.tsx | 8 +- apps/renterd/contexts/keys/columns.tsx | 12 +- apps/renterd/contexts/keys/index.tsx | 11 +- apps/renterd/contexts/transactions/index.tsx | 6 +- apps/renterd/contexts/uploads/columns.tsx | 6 +- apps/renterd/contexts/uploads/index.tsx | 94 ++++---- apps/renterd/dialogs/FileRenameDialog.tsx | 3 + .../dialogs/FilesBucketDeleteDialog.tsx | 2 +- .../dialogs/FilesBucketPolicyDialog.tsx | 10 +- .../dialogs/FilesCreateDirectoryDialog.tsx | 1 + .../dialogs/RenterdSendSiacoinDialog.tsx | 2 +- .../RenterdTransactionDetailsDialog.tsx | 2 +- apps/renterd/hooks/useHealthLabel.tsx | 4 +- apps/renterd/hooks/useSyncStatus.ts | 11 +- apps/renterd/lib/health.ts | 4 +- apps/renterd/lib/multipartUpload.spec.ts | 60 +++-- apps/renterd/lib/multipartUpload.ts | 47 ++-- apps/renterd/lib/rename.ts | 4 +- apps/renterd/tsconfig.json | 2 +- .../src/app/TransactionDetailsDialog.tsx | 4 +- .../app/WalletSingleAddressDetailsDialog.tsx | 4 +- .../src/components/Table/TableRow.tsx | 4 +- .../src/components/Table/index.tsx | 6 +- libs/design-system/src/form/FieldFiat.tsx | 8 +- libs/design-system/src/form/FieldNumber.tsx | 8 +- libs/design-system/src/form/FieldSelect.tsx | 8 +- libs/design-system/src/form/FieldSiacoin.tsx | 8 +- libs/design-system/src/form/FieldSwitch.tsx | 8 +- libs/design-system/src/form/FieldText.tsx | 8 +- libs/design-system/src/form/FieldTextArea.tsx | 8 +- .../src/form/configurationFields.ts | 36 ++- .../src/hooks/useClientFilteredDataset.ts | 6 +- .../src/hooks/useSiacoinFiat.tsx | 16 +- libs/design-system/src/index.ts | 1 + libs/design-system/src/lib/object.ts | 4 +- libs/design-system/src/lib/types.ts | 5 + libs/units/src/events.ts | 2 +- libs/units/src/storage.ts | 22 +- libs/units/src/transactionTypes.ts | 10 +- 94 files changed, 791 insertions(+), 522 deletions(-) create mode 100644 libs/design-system/src/lib/types.ts diff --git a/apps/renterd/components/Alerts/AlertsFilterMenu.tsx b/apps/renterd/components/Alerts/AlertsFilterMenu.tsx index 7ab34f9fd..48cde694b 100644 --- a/apps/renterd/components/Alerts/AlertsFilterMenu.tsx +++ b/apps/renterd/components/Alerts/AlertsFilterMenu.tsx @@ -56,7 +56,12 @@ export function AlertsFilterMenu() { {!dataState && !!pageCount && (