From 7d564f10eb4041500f4f1bdcf38b34651f43370f Mon Sep 17 00:00:00 2001 From: Robert Rytovuori Date: Fri, 17 May 2024 09:35:06 +0300 Subject: [PATCH 01/38] initial to typescript conversion --- config/paths.js | 4 +- config/webpack.config.dev.js | 7 +- jsconfig.json | 5 +- package.json | 10 +- scripts/start.js | 2 +- src/api/ApiErrorModal.js | 67 - src/api/ApiErrorModal.tsx | 69 + src/api/actions.js | 11 - src/api/actions.ts | 4 + src/api/{callApi.js => callApi.ts} | 35 +- src/api/{callApiAsync.js => callApiAsync.ts} | 21 +- ...lUploadRequest.js => callUploadRequest.ts} | 25 +- src/api/constants.js | 3 - src/api/constants.ts | 1 + src/api/createUrl.js | 20 - src/api/createUrl.ts | 4 + src/api/createUrlWithoutVersionSuffix.js | 9 - src/api/createUrlWithoutVersionSuffix.ts | 6 + src/api/reducer.js | 16 - src/api/reducer.ts | 13 + src/api/selectors.js | 7 - src/api/selectors.ts | 3 + src/api/{spec.js => spec.ts} | 44 +- src/api/types.js | 12 - src/api/types.ts | 7 + src/app/App.js | 337 --- src/app/App.tsx | 271 +++ src/app/{AppContext.js => AppContext.tsx} | 68 +- src/application/actions.js | 82 - src/application/actions.ts | 28 + .../components/ApplicationAnswersField.js | 125 - .../components/ApplicationAnswersField.tsx | 107 + .../components/ApplicationAnswersSection.js | 78 - .../components/ApplicationAnswersSection.tsx | 51 + .../components/ApplicationSubsection.js | 539 ----- .../components/ApplicationSubsection.tsx | 425 ++++ .../components/{enums.js => enums.ts} | 5 +- .../infoCheck/ApplicantInfoCheck.js | 42 - .../infoCheck/ApplicantInfoCheck.tsx | 36 + .../infoCheck/ApplicantInfoCheckEdit.js | 167 -- .../infoCheck/ApplicantInfoCheckEdit.tsx | 142 ++ .../infoCheck/ApplicantInfoCheckEditItem.js | 68 - .../infoCheck/ApplicantInfoCheckEditItem.tsx | 60 + .../infoCheck/ApplicantInfoCheckForm.js | 164 -- .../infoCheck/ApplicantInfoCheckForm.tsx | 116 + .../infoCheck/ApplicantInfoCheckModal.js | 106 - .../infoCheck/ApplicantInfoCheckModal.tsx | 86 + .../{constants.js => constants.ts} | 36 +- src/application/{enums.js => enums.ts} | 19 +- .../{formValidation.js => formValidation.ts} | 56 +- src/application/{helpers.js => helpers.ts} | 308 +-- src/application/{reducer.js => reducer.ts} | 126 +- src/application/requests.js | 68 - src/application/requests.ts | 69 + src/application/saga.js | 241 -- src/application/saga.ts | 258 +++ src/application/selectors.js | 54 - src/application/selectors.ts | 21 + src/application/{spec.js => spec.ts} | 292 +-- src/application/types.js | 159 -- src/application/types.ts | 139 ++ src/areaNote/actions.js | 69 - src/areaNote/actions.ts | 18 + src/areaNote/components/AreaNoteListPage.js | 278 --- src/areaNote/components/AreaNoteListPage.tsx | 266 +++ src/areaNote/components/AreaNotesEditMap.js | 282 --- src/areaNote/components/AreaNotesEditMap.tsx | 236 ++ src/areaNote/components/AreaNotesLayer.js | 162 -- src/areaNote/components/AreaNotesLayer.tsx | 144 ++ src/areaNote/components/MapContainer.js | 165 -- src/areaNote/components/MapContainer.tsx | 110 + src/areaNote/components/SaveConditionPanel.js | 173 -- .../components/SaveConditionPanel.tsx | 145 ++ src/areaNote/components/ZoomLevelWarning.js | 18 - src/areaNote/components/ZoomLevelWarning.tsx | 17 + src/areaNote/components/search/Search.js | 101 - src/areaNote/components/search/Search.tsx | 89 + src/areaNote/{enums.js => enums.ts} | 6 +- src/areaNote/helpers.js | 87 - src/areaNote/helpers.ts | 75 + src/areaNote/reducer.js | 93 - src/areaNote/reducer.ts | 86 + src/areaNote/{requests.js => requests.ts} | 31 +- src/areaNote/saga.js | 162 -- src/areaNote/saga.ts | 210 ++ src/areaNote/selectors.js | 25 - src/areaNote/selectors.ts | 10 + src/areaNote/{spec.js => spec.ts} | 149 +- src/areaNote/types.js | 35 - src/areaNote/types.ts | 28 + src/areaSearch/actions.js | 167 -- src/areaSearch/actions.ts | 43 + .../AreaSearchApplicantInfoCheck.js | 39 - .../AreaSearchApplicantInfoCheck.tsx | 30 + .../AreaSearchApplicantInfoCheckEdit.js | 59 - .../AreaSearchApplicantInfoCheckEdit.tsx | 45 + ...plication.js => AreaSearchApplication.tsx} | 194 +- .../AreaSearchApplicationAuditLog.js | 130 -- .../AreaSearchApplicationAuditLog.tsx | 123 + .../AreaSearchApplicationCreateForm.js | 102 - .../AreaSearchApplicationCreateForm.tsx | 81 + .../AreaSearchApplicationCreatePage.js | 368 --- .../AreaSearchApplicationCreatePage.tsx | 303 +++ .../AreaSearchApplicationCreateSpecs.js | 266 --- .../AreaSearchApplicationCreateSpecs.tsx | 215 ++ .../components/AreaSearchApplicationEdit.js | 410 ---- .../components/AreaSearchApplicationEdit.tsx | 313 +++ .../AreaSearchApplicationListPage.js | 856 ------- .../AreaSearchApplicationListPage.tsx | 787 +++++++ .../components/AreaSearchApplicationPage.js | 561 ----- .../components/AreaSearchApplicationPage.tsx | 468 ++++ ...reaSearchApplicationPropertyIdentifiers.js | 49 - ...eaSearchApplicationPropertyIdentifiers.tsx | 45 + .../components/AreaSearchExportModal.js | 194 -- .../components/AreaSearchExportModal.tsx | 148 ++ .../components/AreaSearchStatusNoteHistory.js | 35 - .../AreaSearchStatusNoteHistory.tsx | 32 + .../components/EditAreaSearchPreparerForm.js | 136 -- .../components/EditAreaSearchPreparerForm.tsx | 108 + .../components/EditAreaSearchPreparerModal.js | 68 - .../EditAreaSearchPreparerModal.tsx | 51 + ...AreaSearchLayer.js => AreaSearchLayer.tsx} | 82 +- .../components/map/AreaSearchListMap.js | 166 -- .../components/map/AreaSearchListMap.tsx | 151 ++ .../components/map/AreaSearchMap.js | 131 -- .../components/map/AreaSearchMap.tsx | 109 + .../components/map/SingleAreaSearchMap.js | 95 - .../components/map/SingleAreaSearchMap.tsx | 79 + src/areaSearch/components/search/Search.js | 527 ----- src/areaSearch/components/search/Search.tsx | 434 ++++ src/areaSearch/{constants.js => constants.ts} | 6 +- src/areaSearch/{enums.js => enums.ts} | 9 +- src/areaSearch/{helpers.js => helpers.ts} | 115 +- src/areaSearch/{reducer.js => reducer.ts} | 175 +- src/areaSearch/{requests.js => requests.ts} | 73 +- src/areaSearch/saga.js | 356 --- src/areaSearch/saga.ts | 432 ++++ src/areaSearch/selectors.js | 93 - src/areaSearch/selectors.ts | 43 + src/areaSearch/{spec.js => spec.ts} | 237 +- src/areaSearch/types.js | 130 -- src/areaSearch/types.ts | 117 + .../{validators.js => validators.ts} | 6 +- src/auditLog/actions.js | 45 - src/auditLog/actions.ts | 14 + src/auditLog/{helpers.js => helpers.ts} | 107 +- src/auditLog/reducer.js | 93 - src/auditLog/reducer.ts | 90 + src/auditLog/requests.js | 7 - src/auditLog/requests.ts | 5 + src/auditLog/saga.js | 92 - src/auditLog/saga.ts | 108 + src/auditLog/selectors.js | 21 - src/auditLog/selectors.ts | 8 + src/auditLog/{spec.js => spec.ts} | 109 +- src/auditLog/types.js | 34 - src/auditLog/types.ts | 24 + src/auth/actions.js | 17 - src/auth/actions.ts | 6 + src/auth/components/CallbackPage.js | 33 - src/auth/components/CallbackPage.tsx | 27 + .../{LoginPage.js => LoginPage.tsx} | 23 +- src/auth/reducer.js | 24 - src/auth/reducer.ts | 19 + src/auth/saga.js | 44 - src/auth/saga.ts | 48 + src/auth/selectors.js | 17 - src/auth/selectors.ts | 7 + src/auth/{spec.js => spec.ts} | 40 +- src/auth/types.js | 14 - src/auth/types.ts | 7 + .../util/{user-manager.js => user-manager.ts} | 18 +- .../components/BasisOfRentCalculatorForm.js | 64 - .../components/BasisOfRentCalculatorForm.tsx | 40 + .../components/BasisOfRentCalculatorPage.js | 79 - .../components/BasisOfRentCalculatorPage.tsx | 64 + src/batchrun/actions.js | 89 - src/batchrun/actions.ts | 24 + src/batchrun/components/BatchRunPage.js | 175 -- src/batchrun/components/BatchRunPage.tsx | 150 ++ .../components/JobRunLogEntryPanel.js | 190 -- .../components/JobRunLogEntryPanel.tsx | 163 ++ src/batchrun/components/JobRuns.js | 243 -- src/batchrun/components/JobRuns.tsx | 198 ++ src/batchrun/components/ScheduledJobs.js | 194 -- src/batchrun/components/ScheduledJobs.tsx | 179 ++ src/batchrun/{enums.js => enums.ts} | 24 +- src/batchrun/{reducer.js => reducer.ts} | 149 +- src/batchrun/requests.js | 28 - src/batchrun/requests.ts | 26 + src/batchrun/{saga.js => saga.ts} | 126 +- src/batchrun/selectors.js | 52 - src/batchrun/selectors.ts | 19 + src/batchrun/{spec.js => spec.ts} | 219 +- src/batchrun/types.js | 50 - src/batchrun/types.ts | 41 + src/billingPeriods/actions.js | 18 - src/billingPeriods/actions.ts | 5 + src/billingPeriods/reducer.js | 26 - src/billingPeriods/reducer.ts | 22 + .../{requests.js => requests.ts} | 11 +- src/billingPeriods/saga.js | 36 - src/billingPeriods/saga.ts | 44 + src/billingPeriods/selectors.js | 11 - src/billingPeriods/selectors.ts | 7 + src/billingPeriods/{spec.js => spec.ts} | 65 +- src/billingPeriods/types.js | 17 - src/billingPeriods/types.ts | 14 + src/collectionCourtDecision/actions.js | 53 - src/collectionCourtDecision/actions.ts | 15 + .../{enums.js => enums.ts} | 8 +- src/collectionCourtDecision/reducer.js | 75 - src/collectionCourtDecision/reducer.ts | 70 + .../{requests.js => requests.ts} | 27 +- src/collectionCourtDecision/saga.js | 117 - src/collectionCourtDecision/saga.ts | 140 ++ src/collectionCourtDecision/selectors.js | 22 - src/collectionCourtDecision/selectors.ts | 9 + .../{spec.js => spec.ts} | 130 +- src/collectionCourtDecision/types.js | 38 - src/collectionCourtDecision/types.ts | 34 + src/collectionLetter/actions.js | 46 - src/collectionLetter/actions.ts | 13 + src/collectionLetter/{enums.js => enums.ts} | 8 +- src/collectionLetter/reducer.js | 69 - src/collectionLetter/reducer.ts | 65 + .../{requests.js => requests.ts} | 27 +- src/collectionLetter/saga.js | 115 - src/collectionLetter/saga.ts | 139 ++ src/collectionLetter/selectors.js | 19 - src/collectionLetter/selectors.ts | 8 + src/collectionLetter/{spec.js => spec.ts} | 115 +- src/collectionLetter/types.js | 32 - src/collectionLetter/types.ts | 29 + src/collectionNote/actions.js | 46 - src/collectionNote/actions.ts | 13 + src/collectionNote/{enums.js => enums.ts} | 8 +- src/collectionNote/reducer.js | 69 - src/collectionNote/reducer.ts | 65 + .../{requests.js => requests.ts} | 25 +- src/collectionNote/saga.js | 116 - src/collectionNote/saga.ts | 140 ++ src/collectionNote/selectors.js | 19 - src/collectionNote/selectors.ts | 8 + src/collectionNote/{spec.js => spec.ts} | 120 +- src/collectionNote/types.js | 31 - src/collectionNote/types.ts | 27 + src/comments/actions.js | 61 - src/comments/actions.ts | 17 + src/comments/{enums.js => enums.ts} | 8 +- src/comments/{helpers.js => helpers.ts} | 22 +- src/comments/reducer.js | 82 - src/comments/reducer.ts | 72 + src/comments/{requests.js => requests.ts} | 29 +- src/comments/saga.js | 137 -- src/comments/saga.ts | 170 ++ src/comments/selectors.js | 29 - src/comments/selectors.ts | 12 + src/comments/{spec.js => spec.ts} | 136 +- src/comments/types.js | 37 - src/comments/types.ts | 28 + .../address-search/AddressSearchInput.js | 406 ---- .../address-search/AddressSearchInput.tsx | 406 ++++ .../attributes/AreaNoteAttributes.js | 60 - .../attributes/AreaNoteAttributes.tsx | 46 + .../attributes/AreaSearchAttributes.js | 71 - .../attributes/AreaSearchAttributes.tsx | 59 + .../BatchrunJobRunsTabAttributes.js | 108 - .../BatchrunJobRunsTabAttributes.tsx | 86 + .../BatchrunScheduledJobsTabAttributes.js | 60 - .../BatchrunScheduledJobsTabAttributes.tsx | 46 + .../attributes/ContactAttributes.js | 60 - .../attributes/ContactAttributes.tsx | 46 + .../InfillDevelopmentListPageAttributes.js | 60 - .../InfillDevelopmentListPageAttributes.tsx | 46 + .../InfillDevelopmentPageAttributes.js | 133 -- .../InfillDevelopmentPageAttributes.tsx | 107 + .../attributes/InvoiceNoteAttributes.js | 60 - .../attributes/InvoiceNoteAttributes.tsx | 46 + .../attributes/LandUseContractAttributes.js | 80 - .../attributes/LandUseContractAttributes.tsx | 61 + ...=> LandUseContractInvoiceTabAttributes.ts} | 0 src/components/attributes/LeaseAttributes.js | 59 - src/components/attributes/LeaseAttributes.tsx | 45 + .../attributes/LeaseInvoiceTabAttributes.js | 220 -- .../attributes/LeaseInvoiceTabAttributes.tsx | 173 ++ ...seInvoicingConfirmationReportAttributes.js | 46 - ...eInvoicingConfirmationReportAttributes.tsx | 29 + .../attributes/LeasePageAttributes.js | 144 -- .../attributes/LeasePageAttributes.tsx | 113 + .../LeaseStatisticReportAttributes.js | 78 - .../LeaseStatisticReportAttributes.tsx | 62 + .../attributes/LeaseholdTransferAttributes.js | 60 - .../LeaseholdTransferAttributes.tsx | 46 + .../attributes/PlotApplicationsAttributes.js | 57 - .../attributes/PlotApplicationsAttributes.tsx | 44 + .../attributes/PlotSearchAttributes.js | 86 - .../attributes/PlotSearchAttributes.tsx | 65 + .../attributes/RentBasisAttributes.js | 59 - .../attributes/RentBasisAttributes.tsx | 46 + .../attributes/SapInvoicesAttributes.js | 60 - .../attributes/SapInvoicesAttributes.tsx | 46 + src/components/attributes/UsersPermissions.js | 58 - .../attributes/UsersPermissions.tsx | 44 + src/components/auditLog/AuditLogTable.js | 37 - src/components/auditLog/AuditLogTable.tsx | 44 + src/components/auditLog/AuditLogTableItem.js | 83 - src/components/auditLog/AuditLogTableItem.tsx | 70 + .../auditLog/AuditLogTableItemChange.js | 68 - .../auditLog/AuditLogTableItemChange.tsx | 53 + src/components/authorization/Authorization.js | 13 - src/components/authorization/Authorization.ts | 13 + .../authorization/AuthorizationError.js | 12 - .../authorization/AuthorizationError.tsx | 12 + src/components/button/BackButton.js | 25 - src/components/button/BackButton.tsx | 21 + src/components/button/Button.js | 33 - src/components/button/Button.tsx | 29 + src/components/button/CloseButton.js | 44 - src/components/button/CloseButton.tsx | 37 + src/components/button/EditButton.js | 26 - src/components/button/EditButton.tsx | 22 + src/components/button/IconButton.js | 43 - src/components/button/IconButton.tsx | 27 + src/components/button/IconRadioButtons.js | 49 - src/components/button/IconRadioButtons.tsx | 49 + src/components/button/SendupButton.js | 37 - src/components/button/SendupButton.tsx | 32 + src/components/collapse/Collapse.js | 244 -- src/components/collapse/Collapse.tsx | 218 ++ .../collapse/CollapseHeaderSubtitle.js | 11 - .../collapse/CollapseHeaderSubtitle.tsx | 10 + .../collapse/CollapseHeaderTitle.js | 108 - .../collapse/CollapseHeaderTitle.tsx | 89 + src/components/constants.js | 13 - src/components/constants.ts | 17 + src/components/content/BoxContentWrapper.js | 11 - src/components/content/BoxContentWrapper.tsx | 10 + src/components/content/BoxItem.js | 13 - src/components/content/BoxItem.tsx | 13 + src/components/content/BoxItemContainer.js | 13 - src/components/content/BoxItemContainer.tsx | 13 + src/components/content/ButtonWrapper.js | 11 - src/components/content/ButtonWrapper.tsx | 10 + src/components/content/ContentContainer.js | 11 - src/components/content/ContentContainer.tsx | 10 + src/components/content/ContentItem.js | 11 - src/components/content/ContentItem.tsx | 10 + src/components/content/Divider.js | 12 - src/components/content/Divider.tsx | 11 + src/components/content/FullWidthContainer.js | 13 - src/components/content/FullWidthContainer.tsx | 13 + src/components/content/GrayBox.js | 13 - src/components/content/GrayBox.tsx | 13 + src/components/content/GreenBox.js | 13 - src/components/content/GreenBox.tsx | 13 + src/components/content/ListItem.js | 13 - src/components/content/ListItem.tsx | 13 + src/components/content/ListItems.js | 13 - src/components/content/ListItems.tsx | 13 + .../content/{MapLink.js => MapLink.tsx} | 23 +- src/components/content/MapLinkButton.js | 20 - src/components/content/MapLinkButton.tsx | 15 + src/components/content/PageContainer.js | 54 - src/components/content/PageContainer.tsx | 51 + .../content/PageNavigationWrapper.js | 15 - .../content/PageNavigationWrapper.tsx | 12 + src/components/content/SubTitle.js | 105 - src/components/content/SubTitle.tsx | 87 + src/components/content/SubsectionContent.js | 11 - src/components/content/SubsectionContent.tsx | 10 + src/components/content/Title.js | 105 - src/components/content/Title.tsx | 87 + src/components/content/TitleH3.js | 105 - src/components/content/TitleH3.tsx | 87 + src/components/content/TruncatedText.js | 11 - src/components/content/TruncatedText.tsx | 10 + src/components/content/WarningContainer.js | 32 - src/components/content/WarningContainer.tsx | 29 + src/components/content/WhiteBox.js | 13 - src/components/content/WhiteBox.tsx | 13 + .../controlButtons/CommentButton.js | 32 - .../controlButtons/CommentButton.tsx | 29 + .../controlButtons/ControlButtonBar.js | 58 - .../controlButtons/ControlButtonBar.tsx | 53 + .../controlButtons/ControlButtons.js | 185 -- .../controlButtons/ControlButtons.tsx | 143 ++ src/components/{enums.js => enums.ts} | 22 +- src/components/excel/ExcelLink.js | 109 - src/components/excel/ExcelLink.tsx | 119 + src/components/file/FileDownloadButton.js | 99 - src/components/file/FileDownloadButton.tsx | 103 + src/components/file/FileDownloadLink.js | 106 - src/components/file/FileDownloadLink.tsx | 116 + src/components/file/FileInput.js | 23 - src/components/file/FileInput.tsx | 19 + src/components/form/ActionButtonWrapper.js | 11 - src/components/form/ActionButtonWrapper.tsx | 10 + src/components/form/AddButton.js | 30 - src/components/form/AddButton.tsx | 25 + src/components/form/AddButtonSecondary.js | 30 - src/components/form/AddButtonSecondary.tsx | 25 + src/components/form/AddButtonThird.js | 29 - src/components/form/AddButtonThird.tsx | 25 + src/components/form/AddFileButton.js | 44 - src/components/form/AddFileButton.tsx | 36 + src/components/form/ArchiveButton.js | 25 - src/components/form/ArchiveButton.tsx | 22 + src/components/form/AsyncSelect.js | 161 -- src/components/form/AsyncSelect.tsx | 160 ++ src/components/form/AttachButton.js | 25 - src/components/form/AttachButton.tsx | 22 + src/components/form/CopyToClipboardButton.js | 35 - src/components/form/CopyToClipboardButton.tsx | 25 + src/components/form/DecisionSelectInput.js | 77 - src/components/form/DecisionSelectInput.tsx | 60 + src/components/form/DocumentsButton.js | 30 - src/components/form/DocumentsButton.tsx | 25 + src/components/form/EditButton.js | 26 - src/components/form/EditButton.tsx | 22 + src/components/form/ErrorBlock.js | 11 - src/components/form/ErrorBlock.tsx | 10 + src/components/form/ErrorField.js | 13 - src/components/form/ErrorField.tsx | 16 + .../form/FieldAndRemoveButtonWrapper.js | 23 - .../form/FieldAndRemoveButtonWrapper.tsx | 20 + src/components/form/FieldTypeAddress.js | 42 - src/components/form/FieldTypeAddress.tsx | 36 + src/components/form/FieldTypeBasic.js | 58 - src/components/form/FieldTypeBasic.tsx | 52 + src/components/form/FieldTypeBoolean.js | 67 - src/components/form/FieldTypeBoolean.tsx | 61 + src/components/form/FieldTypeCheckbox.js | 87 - src/components/form/FieldTypeCheckbox.tsx | 66 + .../form/FieldTypeCheckboxDateTime.js | 63 - .../form/FieldTypeCheckboxDateTime.tsx | 54 + src/components/form/FieldTypeContactSelect.js | 54 - .../form/FieldTypeContactSelect.tsx | 38 + src/components/form/FieldTypeDatePicker.js | 91 - src/components/form/FieldTypeDatePicker.tsx | 76 + src/components/form/FieldTypeDecimal.js | 90 - src/components/form/FieldTypeDecimal.tsx | 101 + ...eFractional.js => FieldTypeFractional.tsx} | 83 +- src/components/form/FieldTypeHidden.js | 40 - src/components/form/FieldTypeHidden.tsx | 32 + src/components/form/FieldTypeLeaseSelect.js | 55 - src/components/form/FieldTypeLeaseSelect.tsx | 39 + src/components/form/FieldTypeLessorSelect.js | 54 - src/components/form/FieldTypeLessorSelect.tsx | 38 + src/components/form/FieldTypeMultiSelect.js | 43 - src/components/form/FieldTypeMultiSelect.tsx | 38 + .../form/FieldTypeRadioWithField.js | 76 - .../form/FieldTypeRadioWithField.tsx | 65 + src/components/form/FieldTypeSearch.js | 52 - src/components/form/FieldTypeSearch.tsx | 46 + src/components/form/FieldTypeSelect.js | 126 - src/components/form/FieldTypeSelect.tsx | 122 + src/components/form/FieldTypeTextArea.js | 61 - src/components/form/FieldTypeTextArea.tsx | 54 + src/components/form/FieldTypeTime.js | 60 - src/components/form/FieldTypeTime.tsx | 50 + src/components/form/FieldTypeUserSelect.js | 95 - src/components/form/FieldTypeUserSelect.tsx | 75 + src/components/form/FormField.js | 495 ---- src/components/form/FormField.tsx | 429 ++++ src/components/form/FormFieldLabel.js | 116 - src/components/form/FormFieldLabel.tsx | 95 + src/components/form/FormHintText.js | 20 - src/components/form/FormHintText.tsx | 18 + src/components/form/FormText.js | 20 - src/components/form/FormText.tsx | 18 + src/components/form/FormTextTitle.js | 114 - src/components/form/FormTextTitle.tsx | 95 + src/components/form/FormTitleAndText.js | 26 - src/components/form/FormTitleAndText.tsx | 21 + src/components/form/FormWrapper.js | 11 - src/components/form/FormWrapper.tsx | 10 + src/components/form/FormWrapperLeft.js | 11 - src/components/form/FormWrapperLeft.tsx | 10 + src/components/form/FormWrapperRight.js | 11 - src/components/form/FormWrapperRight.tsx | 10 + src/components/form/RemoveButton.js | 41 - src/components/form/RemoveButton.tsx | 28 + src/components/form/SuccessField.js | 16 - src/components/form/SuccessField.tsx | 18 + src/components/form/UnarchiveButton.js | 25 - src/components/form/UnarchiveButton.tsx | 22 + src/components/form/WarningField.js | 16 - src/components/form/WarningField.tsx | 18 + src/components/form/{filter.js => filter.ts} | 9 +- src/components/form/normalizers.js | 25 - src/components/form/normalizers.ts | 19 + src/components/form/validations.js | 171 -- src/components/form/validations.ts | 152 ++ src/components/formValidations.js | 28 - src/components/formValidations.ts | 29 + src/components/{helpers.js => helpers.ts} | 85 +- .../{AccordionIcon.js => AccordionIcon.tsx} | 17 +- .../icons/{AddIcon.js => AddIcon.tsx} | 19 +- src/components/icons/ArchiveIcon.js | 15 - src/components/icons/ArchiveIcon.tsx | 14 + .../icons/{AttachIcon.js => AttachIcon.tsx} | 19 +- src/components/icons/BackIcon.js | 15 - src/components/icons/BackIcon.tsx | 14 + .../icons/{CancelIcon.js => CancelIcon.tsx} | 21 +- src/components/icons/CommentIcon.js | 15 - src/components/icons/CommentIcon.tsx | 14 + ...ipboardIcon.js => CopyToClipboardIcon.tsx} | 17 +- src/components/icons/DocIcon.js | 9 - src/components/icons/DocIcon.tsx | 7 + .../icons/{EditIcon.js => EditIcon.tsx} | 19 +- .../icons/{ErrorIcon.js => ErrorIcon.tsx} | 17 +- .../icons/{ExcelIcon.js => ExcelIcon.tsx} | 17 +- ...ternalLinkIcon.js => ExternalLinkIcon.tsx} | 17 +- .../icons/{InfoIcon.js => InfoIcon.tsx} | 17 +- .../{MainMenuIcon.js => MainMenuIcon.tsx} | 17 +- src/components/icons/MapIcon.js | 14 - src/components/icons/MapIcon.tsx | 13 + .../{MoveDownIcon.js => MoveDownIcon.tsx} | 18 +- src/components/icons/MoveUpIcon.js | 17 - src/components/icons/MoveUpIcon.tsx | 16 + .../{QuestionIcon.js => QuestionIcon.tsx} | 23 +- src/components/icons/SendupIcon.js | 15 - src/components/icons/SendupIcon.tsx | 14 + .../icons/{SuccessIcon.js => SuccessIcon.tsx} | 17 +- src/components/icons/TableIcon.js | 14 - src/components/icons/TableIcon.tsx | 13 + .../icons/{TrashIcon.js => TrashIcon.tsx} | 17 +- src/components/icons/UnarchiveIcon.js | 15 - src/components/icons/UnarchiveIcon.tsx | 14 + src/components/inputs/CheckboxInput.js | 64 - src/components/inputs/CheckboxInput.tsx | 46 + src/components/inputs/DropdownIndicator.js | 21 - src/components/inputs/DropdownIndicator.tsx | 20 + src/components/inputs/EstateIdSelectInput.js | 67 - src/components/inputs/EstateIdSelectInput.tsx | 50 + src/components/inputs/LeaseSelectInput.js | 142 -- src/components/inputs/LeaseSelectInput.tsx | 101 + src/components/inputs/PlanUnitSelectInput.js | 71 - src/components/inputs/PlanUnitSelectInput.tsx | 53 + src/components/inputs/SearchInput.js | 34 - src/components/inputs/SearchInput.tsx | 28 + .../inputs/SelectLoadingIndicator.js | 12 - .../inputs/SelectLoadingIndicator.tsx | 10 + src/components/inputs/SingleRadioInput.js | 60 - src/components/inputs/SingleRadioInput.tsx | 49 + src/components/inputs/TextAreaInput.js | 31 - src/components/inputs/TextAreaInput.tsx | 27 + src/components/inputs/TextInput.js | 25 - src/components/inputs/TextInput.tsx | 20 + .../inputs/UserServiceUnitSelectInput.js | 101 - .../inputs/UserServiceUnitSelectInput.tsx | 73 + .../invoice-simulator/InvoiceSimulator.js | 157 -- .../invoice-simulator/InvoiceSimulator.tsx | 139 ++ .../InvoiceSimulatorBillingPeriods.js | 113 - .../InvoiceSimulatorBillingPeriods.tsx | 73 + .../invoice-simulator/InvoiceSimulatorForm.js | 71 - .../InvoiceSimulatorForm.tsx | 58 + .../InvoiceSimulatorInvoice.js | 92 - .../InvoiceSimulatorInvoice.tsx | 64 + ...ows.js => InvoiceSimulatorInvoiceRows.tsx} | 48 +- .../ktj/{KtjLink.js => KtjLink.tsx} | 113 +- src/components/links/DecisionLink.js | 21 - src/components/links/DecisionLink.tsx | 16 + src/components/links/ExternalLink.js | 35 - src/components/links/ExternalLink.tsx | 26 + src/components/loader/Loader.js | 17 - src/components/loader/Loader.tsx | 19 + src/components/loader/LoaderWrapper.js | 12 - src/components/loader/LoaderWrapper.tsx | 13 + .../map/{GeoSearch.js => GeoSearch.ts} | 14 +- src/components/map/HelsinkiProvider.js | 47 - src/components/map/HelsinkiProvider.ts | 53 + src/components/map/ZoomBox.js | 24 - src/components/map/ZoomBox.ts | 22 + src/components/map/types.js | 7 - src/components/map/types.ts | 1 + src/components/modal/ConfirmationModal.js | 74 - src/components/modal/ConfirmationModal.tsx | 54 + src/components/modal/{Modal.js => Modal.tsx} | 79 +- src/components/modal/ModalButtonWrapper.js | 11 - src/components/modal/ModalButtonWrapper.tsx | 10 + src/components/multi-select/Dropdown.js | 185 -- src/components/multi-select/Dropdown.tsx | 195 ++ .../multi-select/LoadingIndicator.js | 7 - .../multi-select/LoadingIndicator.tsx | 5 + .../{MultiSelect.js => MultiSelect.tsx} | 97 +- src/components/multi-select/SelectItem.js | 136 -- src/components/multi-select/SelectItem.tsx | 138 ++ src/components/multi-select/SelectList.js | 69 - src/components/multi-select/SelectList.tsx | 48 + src/components/multi-select/SelectPanel.js | 160 -- src/components/multi-select/SelectPanel.tsx | 152 ++ .../multi-select/{helpers.js => helpers.ts} | 64 +- .../rent-calculator/RentCalculator.js | 263 --- .../rent-calculator/RentCalculator.tsx | 251 ++ .../RentCalculatorExplanation.js | 80 - .../RentCalculatorExplanation.tsx | 67 + .../rent-calculator/RentCalculatorForm.js | 260 --- .../rent-calculator/RentCalculatorForm.tsx | 224 ++ .../rent-calculator/RentCalculatorRent.js | 49 - .../rent-calculator/RentCalculatorRent.tsx | 37 + .../rent-calculator/RentCalculatorSubItem.js | 79 - .../rent-calculator/RentCalculatorSubItem.tsx | 62 + .../rent-calculator/RentCalculatorTotalRow.js | 63 - .../RentCalculatorTotalRow.tsx | 56 + .../rent-calculator/RentForPeriod.js | 69 - .../rent-calculator/RentForPeriod.tsx | 54 + ...sizeHandler.js => WindowResizeHandler.tsx} | 31 +- src/components/search/SearchChangeTypeLink.js | 27 - .../search/SearchChangeTypeLink.tsx | 21 + src/components/search/SearchClearLink.js | 27 - src/components/search/SearchClearLink.tsx | 21 + src/components/search/SearchContainer.js | 15 - src/components/search/SearchContainer.tsx | 15 + src/components/search/SearchInputColumn.js | 10 - src/components/search/SearchInputColumn.tsx | 10 + src/components/search/SearchLabel.js | 10 - src/components/search/SearchLabel.tsx | 10 + src/components/search/SearchLabelColumn.js | 11 - src/components/search/SearchLabelColumn.tsx | 12 + src/components/search/SearchRow.js | 11 - src/components/search/SearchRow.tsx | 12 + src/components/search/SearchSubtitleLabel.js | 12 - src/components/search/SearchSubtitleLabel.tsx | 12 + src/components/showMore/ShowMore.js | 112 - src/components/showMore/ShowMore.tsx | 102 + src/components/sideMenu/SideMenu.js | 310 --- src/components/sideMenu/SideMenu.tsx | 263 +++ src/components/sideMenu/SubMenu.js | 93 - src/components/sideMenu/SubMenu.tsx | 89 + src/components/{spec.js => spec.ts} | 44 +- src/components/table/Icons.js | 20 - src/components/table/Icons.tsx | 11 + ...iItemCollapse.js => MultiItemCollapse.tsx} | 45 +- src/components/table/Pagination.js | 215 -- src/components/table/Pagination.tsx | 151 ++ src/components/table/SortableTable.js | 539 ----- src/components/table/SortableTable.tsx | 483 ++++ src/components/table/SortableTableGroup.js | 137 -- src/components/table/SortableTableGroup.tsx | 103 + src/components/table/SortableTableHeader.js | 103 - src/components/table/SortableTableHeader.tsx | 91 + src/components/table/SortableTableRow.js | 215 -- src/components/table/SortableTableRow.tsx | 180 ++ src/components/table/TableAndPanelWrapper.js | 195 -- src/components/table/TableAndPanelWrapper.tsx | 170 ++ src/components/table/TableFilterWrapper.js | 26 - src/components/table/TableFilterWrapper.tsx | 21 + src/components/table/TableFilters.js | 56 - src/components/table/TableFilters.tsx | 43 + src/components/table/TablePanel.js | 25 - src/components/table/TablePanel.tsx | 18 + src/components/table/TablePanelContainer.js | 49 - src/components/table/TablePanelContainer.tsx | 37 + src/components/table/TableWrapper.js | 13 - src/components/table/TableWrapper.tsx | 10 + .../table/VisualisationTypeWrapper.js | 13 - .../table/VisualisationTypeWrapper.tsx | 10 + .../tabs/{TabContent.js => TabContent.ts} | 5 +- src/components/tabs/TabPane.js | 8 - src/components/tabs/TabPane.ts | 8 + src/components/tabs/Tabs.js | 66 - src/components/tabs/Tabs.tsx | 55 + src/components/toastr/ToastrIcons.js | 21 - src/components/toastr/ToastrIcons.tsx | 23 + .../tooltip/{Tooltip.js => Tooltip.tsx} | 90 +- src/components/tooltip/TooltipToggleButton.js | 34 - .../tooltip/TooltipToggleButton.tsx | 35 + src/components/tooltip/TooltipWrapper.js | 25 - src/components/tooltip/TooltipWrapper.tsx | 24 + src/components/tooltip/UIDataTooltip.js | 306 --- src/components/tooltip/UIDataTooltip.tsx | 269 +++ src/components/tooltip/types.js | 3 - src/components/tooltip/types.ts | 1 + src/components/topNavigation/TopNavigation.js | 223 -- .../topNavigation/TopNavigation.tsx | 218 ++ src/components/topNavigation/actions.js | 11 - src/components/topNavigation/actions.ts | 3 + src/components/topNavigation/reducer.js | 20 - src/components/topNavigation/reducer.ts | 18 + src/components/topNavigation/selectors.js | 12 - src/components/topNavigation/selectors.ts | 4 + src/components/topNavigation/types.js | 14 - src/components/topNavigation/types.ts | 8 + src/components/uiData/UiDataListHOC.js | 77 - src/components/uiData/UiDataListHOC.tsx | 63 + src/components/vat/AmountWithVat.js | 64 - src/components/vat/AmountWithVat.tsx | 52 + src/{constants.js => constants.ts} | 23 +- src/contacts/actions.js | 94 - src/contacts/actions.ts | 24 + src/contacts/components/ContactAuditLog.js | 119 - src/contacts/components/ContactAuditLog.tsx | 110 + src/contacts/components/ContactEdit.js | 15 - src/contacts/components/ContactEdit.tsx | 11 + src/contacts/components/ContactModal.js | 100 - src/contacts/components/ContactModal.tsx | 65 + src/contacts/components/ContactPage.js | 573 ----- src/contacts/components/ContactPage.tsx | 521 +++++ src/contacts/components/ContactReadonly.js | 23 - src/contacts/components/ContactReadonly.tsx | 17 + src/contacts/components/ContactsListPage.js | 445 ---- src/contacts/components/ContactsListPage.tsx | 425 ++++ src/contacts/components/NewContactPage.js | 229 -- src/contacts/components/NewContactPage.tsx | 200 ++ src/contacts/components/forms/ContactForm.js | 469 ---- src/contacts/components/forms/ContactForm.tsx | 332 +++ src/contacts/components/search/Search.js | 180 -- src/contacts/components/search/Search.tsx | 163 ++ ...ContactTemplate.js => ContactTemplate.tsx} | 110 +- src/contacts/{constants.js => constants.ts} | 5 +- src/contacts/{enums.js => enums.ts} | 10 +- src/contacts/{helpers.js => helpers.ts} | 65 +- src/contacts/{reducer.js => reducer.ts} | 102 +- src/contacts/{requests.js => requests.ts} | 32 +- src/contacts/requestsAsync.js | 27 - src/contacts/requestsAsync.ts | 36 + src/contacts/{saga.js => saga.ts} | 183 +- src/contacts/selectors.js | 43 - src/contacts/selectors.ts | 16 + src/contacts/{spec.js => spec.ts} | 206 +- src/contacts/types.js | 53 - src/contacts/types.ts | 41 + src/contractFile/actions.js | 19 - src/contractFile/actions.ts | 5 + src/contractFile/reducer.js | 45 - src/contractFile/reducer.ts | 40 + src/contractFile/requests.js | 10 - src/contractFile/requests.ts | 6 + src/contractFile/saga.js | 43 - src/contractFile/saga.ts | 50 + src/contractFile/selectors.js | 11 - src/contractFile/selectors.ts | 5 + src/contractFile/{spec.js => spec.ts} | 56 +- src/contractFile/types.js | 17 - src/contractFile/types.ts | 13 + src/createCollectionLetter/actions.js | 18 - src/createCollectionLetter/actions.ts | 6 + .../{enums.js => enums.ts} | 8 +- .../{reducer.js => reducer.ts} | 29 +- .../{requests.js => requests.ts} | 12 +- src/createCollectionLetter/saga.js | 38 - src/createCollectionLetter/saga.ts | 36 + src/createCollectionLetter/selectors.js | 9 - src/createCollectionLetter/selectors.ts | 4 + .../{spec.js => spec.ts} | 50 +- src/createCollectionLetter/types.js | 11 - src/createCollectionLetter/types.ts | 8 + src/creditDecision/actions.js | 70 - src/creditDecision/actions.ts | 17 + .../components/CreditDecisionHistory.js | 153 -- .../components/CreditDecisionHistory.tsx | 122 + .../components/CreditDecisionRequest.js | 238 -- .../components/CreditDecisionRequest.tsx | 195 ++ .../components/CreditDecisionSearchPage.js | 159 -- .../components/CreditDecisionSearchPage.tsx | 159 ++ .../components/CreditDecisionTemplate.js | 25 - .../components/CreditDecisionTemplate.tsx | 23 + src/creditDecision/components/SearchForm.js | 113 - src/creditDecision/components/SearchForm.tsx | 98 + .../{StatusText.js => StatusText.tsx} | 48 +- src/creditDecision/{enums.js => enums.ts} | 12 +- src/creditDecision/reducer.js | 154 -- src/creditDecision/reducer.ts | 146 ++ .../{requests.js => requests.ts} | 33 +- src/creditDecision/saga.js | 157 -- src/creditDecision/saga.ts | 190 ++ src/creditDecision/selectors.js | 34 - src/creditDecision/selectors.ts | 12 + src/creditDecision/{spec.js => spec.ts} | 11 +- src/creditDecision/types.js | 48 - src/creditDecision/types.ts | 32 + src/district/actions.js | 18 - src/district/actions.ts | 5 + src/district/helpers.js | 18 - src/district/helpers.ts | 16 + src/district/reducer.js | 30 - src/district/reducer.ts | 22 + src/district/{requests.js => requests.ts} | 9 +- src/district/saga.js | 44 - src/district/saga.ts | 54 + src/district/selectors.js | 11 - src/district/selectors.ts | 7 + src/district/{spec.js => spec.ts} | 63 +- src/district/types.js | 14 - src/district/types.ts | 10 + src/{enums.js => enums.tsx} | 169 +- src/errorPage/ErrorPage.js | 14 - src/errorPage/ErrorPage.tsx | 13 + src/foundation/{enums.js => enums.ts} | 54 +- src/foundation/{reveal.js => reveal.tsx} | 150 +- src/foundation/{shapes.js => shapes.ts} | 7 +- src/foundation/{utils.js => utils.ts} | 12 +- src/index.js | 6 - src/index.ts | 3 + src/index/actions.js | 18 - src/index/actions.ts | 5 + src/index/components/IndexListPage.js | 116 - src/index/components/IndexListPage.tsx | 97 + .../{IndexTable.js => IndexTable.tsx} | 24 +- src/index/helpers.js | 31 - src/index/helpers.ts | 27 + src/index/reducer.js | 26 - src/index/reducer.ts | 20 + src/index/requests.js | 7 - src/index/requests.ts | 5 + src/index/saga.js | 36 - src/index/saga.ts | 35 + src/index/selectors.js | 10 - src/index/selectors.ts | 5 + src/index/{spec.js => spec.ts} | 45 +- src/index/types.js | 13 - src/index/types.ts | 9 + src/infillDevelopment/actions.js | 81 - src/infillDevelopment/actions.ts | 21 + .../components/InfillDevelopmentListPage.js | 417 ---- .../components/InfillDevelopmentListPage.tsx | 403 ++++ .../components/InfillDevelopmentPage.js | 579 ----- .../components/InfillDevelopmentPage.tsx | 507 +++++ .../components/NewInfillDevelopmentPage.js | 201 -- .../components/NewInfillDevelopmentPage.tsx | 168 ++ .../components/forms/InfillDevelopmentForm.js | 211 -- .../forms/InfillDevelopmentForm.tsx | 150 ++ .../components/forms/LeaseItemEdit.js | 959 -------- .../components/forms/LeaseItemEdit.tsx | 721 ++++++ .../components/forms/LeaseItemsEdit.js | 95 - .../components/forms/LeaseItemsEdit.tsx | 73 + .../components/search/Search.js | 263 --- .../components/search/Search.tsx | 234 ++ ...plate.js => InfillDevelopmentTemplate.tsx} | 107 +- .../sections/basicInfo/LeaseInfo.js | 155 -- .../sections/basicInfo/LeaseInfo.tsx | 119 + .../basicInfo/{LeaseItem.js => LeaseItem.tsx} | 333 +-- ...yer.js => InfillDevelopmentLeaseLayer.tsx} | 175 +- .../map/SingleInfillDevelopmentMap.js | 277 --- .../map/SingleInfillDevelopmentMap.tsx | 240 ++ .../{constants.js => constants.ts} | 5 +- src/infillDevelopment/{enums.js => enums.ts} | 20 +- .../{helpers.js => helpers.ts} | 128 +- .../{reducer.js => reducer.ts} | 114 +- .../{requests.js => requests.ts} | 32 +- src/infillDevelopment/saga.js | 155 -- src/infillDevelopment/saga.ts | 188 ++ src/infillDevelopment/selectors.js | 43 - src/infillDevelopment/selectors.ts | 18 + src/infillDevelopment/{spec.js => spec.ts} | 180 +- src/infillDevelopment/types.js | 45 - src/infillDevelopment/types.ts | 36 + src/infillDevelopmentAttachment/actions.js | 32 - src/infillDevelopmentAttachment/actions.ts | 9 + .../{enums.js => enums.ts} | 7 +- .../{reducer.js => reducer.ts} | 37 +- .../{requests.js => requests.ts} | 25 +- src/infillDevelopmentAttachment/saga.js | 87 - src/infillDevelopmentAttachment/saga.ts | 105 + src/infillDevelopmentAttachment/selectors.js | 12 - src/infillDevelopmentAttachment/selectors.ts | 5 + .../{spec.js => spec.ts} | 66 +- src/infillDevelopmentAttachment/types.js | 28 - src/infillDevelopmentAttachment/types.ts | 22 + src/invoiceNote/actions.js | 49 - src/invoiceNote/actions.ts | 13 + .../components/CreateInvoiceNoteModal.js | 150 -- .../components/CreateInvoiceNoteModal.tsx | 107 + .../components/InvoiceNoteListPage.js | 418 ---- .../components/InvoiceNoteListPage.tsx | 381 ++++ src/invoiceNote/components/Search.js | 140 -- src/invoiceNote/components/Search.tsx | 122 + src/invoiceNote/{enums.js => enums.ts} | 8 +- src/invoiceNote/{reducer.js => reducer.ts} | 52 +- src/invoiceNote/requests.js | 20 - src/invoiceNote/requests.ts | 17 + src/invoiceNote/saga.js | 99 - src/invoiceNote/saga.ts | 111 + src/invoiceNote/selectors.js | 22 - src/invoiceNote/selectors.ts | 9 + src/invoiceNote/{spec.js => spec.ts} | 106 +- src/invoiceNote/types.js | 30 - src/invoiceNote/types.ts | 24 + src/invoiceSets/actions.js | 22 - src/invoiceSets/actions.ts | 7 + src/invoiceSets/helpers.js | 25 - src/invoiceSets/helpers.ts | 23 + src/invoiceSets/reducer.js | 29 - src/invoiceSets/reducer.ts | 22 + src/invoiceSets/{requests.js => requests.ts} | 22 +- src/invoiceSets/saga.js | 66 - src/invoiceSets/saga.ts | 89 + src/invoiceSets/selectors.js | 12 - src/invoiceSets/selectors.ts | 8 + src/invoiceSets/{spec.js => spec.ts} | 63 +- src/invoiceSets/types.js | 16 - src/invoiceSets/types.ts | 12 + src/invoices/actions.js | 91 - src/invoices/actions.ts | 24 + src/invoices/{enums.js => enums.ts} | 29 +- src/invoices/{helpers.js => helpers.ts} | 145 +- src/invoices/reducer.js | 121 - src/invoices/reducer.ts | 111 + src/invoices/{requests.js => requests.ts} | 50 +- src/invoices/saga.js | 200 -- src/invoices/saga.ts | 273 +++ src/invoices/selectors.js | 44 - src/invoices/selectors.ts | 17 + src/invoices/{spec.js => spec.ts} | 196 +- src/invoices/types.js | 52 - src/invoices/types.ts | 45 + src/landUseAgreementAttachment/actions.js | 32 - src/landUseAgreementAttachment/actions.ts | 9 + .../{enums.js => enums.ts} | 7 +- .../{reducer.js => reducer.ts} | 37 +- .../{requests.js => requests.ts} | 25 +- src/landUseAgreementAttachment/saga.js | 87 - src/landUseAgreementAttachment/saga.ts | 105 + src/landUseAgreementAttachment/selectors.js | 12 - src/landUseAgreementAttachment/selectors.ts | 5 + .../{spec.js => spec.ts} | 66 +- src/landUseAgreementAttachment/types.js | 28 - src/landUseAgreementAttachment/types.ts | 22 + src/landUseContract/actions.js | 86 - src/landUseContract/actions.ts | 22 + .../components/LandUseContractListPage.js | 364 --- .../components/LandUseContractListPage.tsx | 350 +++ .../components/LandUseContractPage.js | 909 -------- .../components/LandUseContractPage.tsx | 875 +++++++ .../CreateLandUseContractForm.js | 176 -- .../CreateLandUseContractForm.tsx | 136 ++ .../CreateLandUseContractModal.js | 50 - .../CreateLandUseContractModal.tsx | 36 + .../components/search/Search.js | 101 - .../components/search/Search.tsx | 93 + .../components/sections/AddressItemEdit.js | 134 -- .../components/sections/AddressItemEdit.tsx | 96 + ...sicInformation.js => BasicInformation.tsx} | 183 +- .../sections/BasicInformationEdit.js | 669 ------ .../sections/BasicInformationEdit.tsx | 473 ++++ .../components/sections/Changes.js | 118 - .../components/sections/Changes.tsx | 94 + .../{Compensations.js => Compensations.tsx} | 121 +- .../components/sections/CompensationsEdit.js | 534 ----- .../components/sections/CompensationsEdit.tsx | 421 ++++ .../components/sections/ConditionItemEdit.js | 114 - .../components/sections/ConditionItemEdit.tsx | 65 + .../{Conditions.js => Conditions.tsx} | 93 +- .../components/sections/ConditionsEdit.js | 205 -- .../components/sections/ConditionsEdit.tsx | 169 ++ .../components/sections/ContractItem.js | 118 - .../components/sections/ContractItem.tsx | 77 + .../components/sections/ContractItemEdit.js | 564 ----- .../components/sections/ContractItemEdit.tsx | 396 ++++ .../components/sections/Contracts.js | 51 - .../components/sections/Contracts.tsx | 36 + .../components/sections/ContractsEdit.js | 183 -- .../components/sections/ContractsEdit.tsx | 149 ++ .../sections/CreateAndCreditInvoiceR.js | 295 --- .../sections/CreateAndCreditInvoiceR.tsx | 256 +++ .../components/sections/DecisionConditions.js | 168 -- .../sections/DecisionConditions.tsx | 116 + .../components/sections/DecisionItem.js | 116 - .../components/sections/DecisionItem.tsx | 73 + .../components/sections/DecisionItemEdit.js | 424 ---- .../components/sections/DecisionItemEdit.tsx | 278 +++ .../components/sections/Decisions.js | 42 - .../components/sections/Decisions.tsx | 30 + .../components/sections/DecisionsEdit.js | 165 -- .../components/sections/DecisionsEdit.tsx | 143 ++ .../components/sections/InvoiceNotesR.js | 342 --- .../components/sections/InvoiceNotesR.tsx | 276 +++ .../components/sections/InvoicePanelR.js | 164 -- .../components/sections/InvoicePanelR.tsx | 113 + .../sections/InvoiceTableAndPanelR.js | 530 ----- .../sections/InvoiceTableAndPanelR.tsx | 455 ++++ ...voiceTemplateR.js => InvoiceTemplateR.tsx} | 304 +-- .../sections/{Invoices.js => Invoices.tsx} | 66 +- .../components/sections/InvoicesEdit.js | 186 -- .../components/sections/InvoicesEdit.tsx | 135 ++ .../components/sections/InvoicesR.js | 159 -- .../components/sections/InvoicesR.tsx | 129 ++ .../components/sections/LandUseContractMap.js | 83 - .../sections/LandUseContractMap.tsx | 65 + .../components/sections/Litigant.js | 88 - .../components/sections/Litigant.tsx | 62 + .../sections/LitigantBillingPerson.js | 122 - .../sections/LitigantBillingPerson.tsx | 88 + .../sections/LitigantBillingPersonEdit.js | 219 -- .../sections/LitigantBillingPersonEdit.tsx | 170 ++ .../components/sections/LitigantItem.js | 89 - .../components/sections/LitigantItem.tsx | 65 + .../components/sections/LitigantItemEdit.js | 295 --- .../components/sections/LitigantItemEdit.tsx | 227 ++ .../components/sections/Litigants.js | 88 - .../components/sections/Litigants.tsx | 76 + .../components/sections/LitigantsEdit.js | 327 --- .../components/sections/LitigantsEdit.tsx | 276 +++ .../sections/UnitPricesUsedInCalculations.js | 149 -- .../sections/UnitPricesUsedInCalculations.tsx | 110 + .../sections/{Warrants.js => Warrants.tsx} | 100 +- .../sections/forms/CreditInvoiceForm.js | 230 -- .../sections/forms/CreditInvoiceForm.tsx | 164 ++ .../sections/forms/EditInvoiceForm.js | 750 ------ .../sections/forms/EditInvoiceForm.tsx | 566 +++++ .../forms/{InvoiceRows.js => InvoiceRows.tsx} | 81 +- .../sections/forms/InvoiceRowsEdit.js | 198 -- .../sections/forms/InvoiceRowsEdit.tsx | 160 ++ .../sections/forms/NewInvoiceForm.js | 301 --- .../sections/forms/NewInvoiceForm.tsx | 202 ++ src/landUseContract/constants.js | 23 - src/landUseContract/constants.ts | 31 + src/landUseContract/{enums.js => enums.ts} | 8 +- .../{formValidators.js => formValidators.ts} | 52 +- .../{helpers.js => helpers.ts} | 323 ++- .../{reducer.js => reducer.ts} | 99 +- .../{requests.js => requests.ts} | 38 +- src/landUseContract/requestsAsync.js | 15 - src/landUseContract/requestsAsync.ts | 19 + src/landUseContract/saga.js | 234 -- src/landUseContract/saga.ts | 284 +++ src/landUseContract/selectors.js | 52 - src/landUseContract/selectors.ts | 27 + src/landUseContract/{spec.js => spec.ts} | 180 +- src/landUseContract/types.js | 51 - src/landUseContract/types.ts | 39 + src/landUseInvoices/actions.js | 109 - src/landUseInvoices/actions.ts | 28 + src/landUseInvoices/{enums.js => enums.ts} | 29 +- .../{helpers.js => helpers.ts} | 145 +- .../{reducer.js => reducer.ts} | 130 +- .../{requests.js => requests.ts} | 50 +- src/landUseInvoices/saga.js | 222 -- src/landUseInvoices/saga.ts | 304 +++ src/landUseInvoices/selectors.js | 51 - src/landUseInvoices/selectors.ts | 21 + src/landUseInvoices/{spec.js => spec.ts} | 230 +- src/landUseInvoices/types.js | 67 - src/landUseInvoices/types.ts | 55 + src/leaseAreaAttachment/actions.js | 15 - src/leaseAreaAttachment/actions.ts | 4 + .../{enums.js => enums.ts} | 6 +- .../{requests.js => requests.ts} | 20 +- src/leaseAreaAttachment/saga.js | 66 - src/leaseAreaAttachment/saga.ts | 79 + src/leaseAreaAttachment/types.js | 20 - src/leaseAreaAttachment/types.ts | 16 + src/leaseCreateCharge/actions.js | 30 - src/leaseCreateCharge/actions.ts | 9 + src/leaseCreateCharge/{enums.js => enums.ts} | 8 +- .../{helpers.js => helpers.ts} | 26 +- .../{reducer.js => reducer.ts} | 43 +- src/leaseCreateCharge/requests.js | 15 - src/leaseCreateCharge/requests.ts | 18 + src/leaseCreateCharge/{saga.js => saga.ts} | 50 +- src/leaseCreateCharge/selectors.js | 15 - src/leaseCreateCharge/selectors.ts | 6 + src/leaseCreateCharge/spec.js | 200 -- src/leaseCreateCharge/spec.ts | 160 ++ src/leaseCreateCharge/types.js | 17 - src/leaseCreateCharge/types.ts | 13 + src/leaseInspectionAttachment/actions.js | 15 - src/leaseInspectionAttachment/actions.ts | 4 + .../{requests.js => requests.ts} | 20 +- src/leaseInspectionAttachment/saga.js | 66 - src/leaseInspectionAttachment/saga.ts | 79 + src/leaseInspectionAttachment/types.js | 19 - src/leaseInspectionAttachment/types.ts | 15 + src/leaseStatisticReport/actions.js | 98 - src/leaseStatisticReport/actions.ts | 26 + .../LeaseInvoicingConfirmationReport.js | 173 -- .../LeaseInvoicingConfirmationReport.tsx | 133 ++ .../components/LeaseStatisticReportForm.js | 221 -- .../components/LeaseStatisticReportForm.tsx | 166 ++ .../components/LeaseStatisticReportPage.js | 126 - .../components/LeaseStatisticReportPage.tsx | 99 + .../{enums.js => enums.ts} | 16 +- .../{helpers.js => helpers.ts} | 128 +- .../{reducer.js => reducer.ts} | 110 +- .../{requests.js => requests.ts} | 39 +- src/leaseStatisticReport/saga.js | 196 -- src/leaseStatisticReport/saga.ts | 244 ++ src/leaseStatisticReport/selectors.js | 48 - src/leaseStatisticReport/selectors.ts | 17 + src/leaseStatisticReport/{spec.js => spec.ts} | 236 +- src/leaseStatisticReport/types.js | 54 - src/leaseStatisticReport/types.ts | 42 + src/leaseType/actions.js | 18 - src/leaseType/actions.ts | 5 + src/leaseType/reducer.js | 24 - src/leaseType/reducer.ts | 20 + src/leaseType/{requests.js => requests.ts} | 8 +- src/leaseType/saga.js | 35 - src/leaseType/saga.ts | 39 + src/leaseType/selectors.js | 10 - src/leaseType/selectors.ts | 5 + src/leaseType/{spec.js => spec.ts} | 46 +- src/leaseType/types.js | 12 - src/leaseType/types.ts | 9 + src/leaseholdTransfer/actions.js | 40 - src/leaseholdTransfer/actions.ts | 11 + .../components/LeaseholdTransferListPage.js | 427 ---- .../components/LeaseholdTransferListPage.tsx | 393 ++++ .../components/search/Search.js | 135 -- .../components/search/Search.tsx | 125 + .../{constants.js => constants.ts} | 5 +- src/leaseholdTransfer/{enums.js => enums.ts} | 10 +- src/leaseholdTransfer/helpers.js | 52 - src/leaseholdTransfer/helpers.ts | 49 + .../{reducer.js => reducer.ts} | 49 +- .../{requests.js => requests.ts} | 20 +- src/leaseholdTransfer/saga.js | 92 - src/leaseholdTransfer/saga.ts | 105 + src/leaseholdTransfer/selectors.js | 19 - src/leaseholdTransfer/selectors.ts | 8 + src/leaseholdTransfer/{spec.js => spec.ts} | 91 +- src/leaseholdTransfer/types.js | 26 - src/leaseholdTransfer/types.ts | 21 + src/leases/actions.js | 177 -- src/leases/actions.ts | 44 + src/leases/components/LeaseListPage.js | 771 ------- src/leases/components/LeaseListPage.tsx | 744 ++++++ src/leases/components/LeasePage.js | 1186 ---------- src/leases/components/LeasePage.tsx | 1031 +++++++++ .../components/createLease/CreateLeaseForm.js | 287 --- .../createLease/CreateLeaseForm.tsx | 224 ++ .../createLease/CreateLeaseModal.js | 58 - .../createLease/CreateLeaseModal.tsx | 42 + .../leaseSections/auditLog/LeaseAuditLog.js | 130 -- .../leaseSections/auditLog/LeaseAuditLog.tsx | 123 + .../leaseSections/comments/Comment.js | 138 -- .../leaseSections/comments/Comment.tsx | 126 + .../leaseSections/comments/CommentPanel.js | 347 --- .../leaseSections/comments/CommentPanel.tsx | 299 +++ .../leaseSections/comments/NewCommentForm.js | 111 - .../leaseSections/comments/NewCommentForm.tsx | 76 + .../leaseSections/constructability/Comment.js | 65 - .../constructability/Comment.tsx | 48 + .../constructability/Comments.js | 40 - .../constructability/Comments.tsx | 29 + .../constructability/Constructability.js | 111 - .../constructability/Constructability.tsx | 90 + .../constructability/ConstructabilityEdit.js | 181 -- .../constructability/ConstructabilityEdit.tsx | 145 ++ ...bilityItem.js => ConstructabilityItem.tsx} | 301 +-- .../ConstructabilityItemEdit.js | 975 -------- .../ConstructabilityItemEdit.tsx | 681 ++++++ .../constructability/SendEmail.js | 164 -- .../constructability/SendEmail.tsx | 146 ++ .../constructability/SendEmailModal.js | 173 -- .../constructability/SendEmailModal.tsx | 144 ++ .../constructability/StatusIndicator.js | 30 - .../constructability/StatusIndicator.tsx | 30 + .../contract/AttachDecisionModal.js | 183 -- .../contract/AttachDecisionModal.tsx | 156 ++ .../{Collateral.js => Collateral.tsx} | 175 +- .../leaseSections/contract/CollateralEdit.js | 453 ---- .../leaseSections/contract/CollateralEdit.tsx | 290 +++ .../contract/ContractFileModal.js | 130 -- .../contract/ContractFileModal.tsx | 112 + .../{ContractItem.js => ContractItem.tsx} | 240 +- .../contract/ContractItemEdit.js | 754 ------ .../contract/ContractItemEdit.tsx | 524 +++++ .../leaseSections/contract/Contracts.js | 102 - .../leaseSections/contract/Contracts.tsx | 86 + .../leaseSections/contract/ContractsEdit.js | 209 -- .../leaseSections/contract/ContractsEdit.tsx | 174 ++ .../contract/DecisionConditionsEdit.js | 323 --- .../contract/DecisionConditionsEdit.tsx | 215 ++ .../{DecisionItem.js => DecisionItem.tsx} | 197 +- .../contract/DecisionItemEdit.js | 261 --- .../contract/DecisionItemEdit.tsx | 182 ++ .../leaseSections/contract/Decisions.js | 90 - .../leaseSections/contract/Decisions.tsx | 72 + .../leaseSections/contract/DecisionsEdit.js | 205 -- .../leaseSections/contract/DecisionsEdit.tsx | 168 ++ .../leaseSections/contract/DecisionsMain.js | 63 - .../leaseSections/contract/DecisionsMain.tsx | 52 + .../contract/DecisionsMainEdit.js | 64 - .../contract/DecisionsMainEdit.tsx | 52 + .../{InspectionItem.js => InspectionItem.tsx} | 84 +- .../contract/InspectionItemEdit.js | 275 --- .../contract/InspectionItemEdit.tsx | 207 ++ .../leaseSections/contract/Inspections.js | 81 - .../leaseSections/contract/Inspections.tsx | 69 + .../leaseSections/contract/InspectionsEdit.js | 186 -- .../contract/InspectionsEdit.tsx | 151 ++ .../invoice/CollectionCourtDecisionPanel.js | 180 -- .../invoice/CollectionCourtDecisionPanel.tsx | 138 ++ .../invoice/CreateAndCreditInvoice.js | 309 --- .../invoice/CreateAndCreditInvoice.tsx | 269 +++ .../invoice/CreateCollectionLetter.js | 24 - .../invoice/CreateCollectionLetter.tsx | 19 + .../leaseSections/invoice/DebtCollection.js | 13 - .../leaseSections/invoice/DebtCollection.tsx | 9 + .../leaseSections/invoice/InvoiceNotes.js | 342 --- .../leaseSections/invoice/InvoiceNotes.tsx | 276 +++ .../leaseSections/invoice/InvoicePanel.js | 165 -- .../leaseSections/invoice/InvoicePanel.tsx | 113 + .../invoice/InvoiceTableAndPanel.js | 593 ----- .../invoice/InvoiceTableAndPanel.tsx | 499 ++++ ...InvoiceTemplate.js => InvoiceTemplate.tsx} | 304 +-- .../leaseSections/invoice/Invoices.js | 380 ---- .../leaseSections/invoice/Invoices.tsx | 313 +++ .../forms/CollectionLetterInvoiceRow.js | 165 -- .../forms/CollectionLetterInvoiceRow.tsx | 140 ++ .../invoice/forms/CollectionLetterTotalRow.js | 99 - .../forms/CollectionLetterTotalRow.tsx | 90 + .../forms/CreateCollectionLetterForm.js | 308 --- .../forms/CreateCollectionLetterForm.tsx | 225 ++ .../invoice/forms/CreditInvoiceForm.js | 230 -- .../invoice/forms/CreditInvoiceForm.tsx | 164 ++ .../invoice/forms/DebtCollectionForm.js | 801 ------- .../invoice/forms/DebtCollectionForm.tsx | 647 ++++++ .../invoice/forms/EditInvoiceForm.js | 749 ------ .../invoice/forms/EditInvoiceForm.tsx | 565 +++++ .../forms/{InvoiceRows.js => InvoiceRows.tsx} | 81 +- .../invoice/forms/InvoiceRowsEdit.js | 186 -- .../invoice/forms/InvoiceRowsEdit.tsx | 148 ++ .../invoice/forms/NewCollectionNote.js | 82 - .../invoice/forms/NewCollectionNote.tsx | 59 + .../invoice/forms/NewInvoiceForm.js | 445 ---- .../invoice/forms/NewInvoiceForm.tsx | 273 +++ .../leaseArea/ArchiveAreaModal.js | 144 -- .../leaseArea/ArchiveAreaModal.tsx | 109 + ...DetailedPlan.js => CustomDetailedPlan.tsx} | 119 +- .../leaseArea/CustomDetailedPlanEdit.js | 592 ----- .../leaseArea/CustomDetailedPlanEdit.tsx | 421 ++++ .../leaseArea/{LeaseArea.js => LeaseArea.tsx} | 309 +-- .../leaseSections/leaseArea/LeaseAreaEdit.js | 801 ------- .../leaseSections/leaseArea/LeaseAreaEdit.tsx | 553 +++++ ...ceInfo.js => LeaseAreaWithArchiceInfo.tsx} | 135 +- .../leaseArea/LeaseAreaWithArchiveInfoEdit.js | 240 -- .../LeaseAreaWithArchiveInfoEdit.tsx | 170 ++ .../leaseSections/leaseArea/LeaseAreas.js | 72 - .../leaseSections/leaseArea/LeaseAreas.tsx | 55 + .../leaseSections/leaseArea/LeaseAreasEdit.js | 405 ---- .../leaseArea/LeaseAreasEdit.tsx | 345 +++ .../{PlanUnitItem.js => PlanUnitItem.tsx} | 146 +- .../leaseArea/PlanUnitItemEdit.js | 394 ---- .../leaseArea/PlanUnitItemEdit.tsx | 280 +++ .../leaseArea/{PlotItem.js => PlotItem.tsx} | 161 +- .../leaseSections/leaseArea/PlotItemEdit.js | 257 --- .../leaseSections/leaseArea/PlotItemEdit.tsx | 166 ++ .../leaseInfo/{LeaseInfo.js => LeaseInfo.tsx} | 63 +- .../leaseSections/map/AreasLayer.js | 81 - .../leaseSections/map/AreasLayer.tsx | 70 + .../leaseSections/map/LeaseListLayer.js | 86 - .../leaseSections/map/LeaseListLayer.tsx | 80 + .../leaseSections/map/LeaseListMap.js | 190 -- .../leaseSections/map/LeaseListMap.tsx | 167 ++ .../leaseSections/map/PlanUnitsLayer.js | 102 - .../leaseSections/map/PlanUnitsLayer.tsx | 91 + .../leaseSections/map/PlotsLayer.js | 73 - .../leaseSections/map/PlotsLayer.tsx | 71 + .../leaseSections/map/SingleLeaseMap.js | 297 --- .../leaseSections/map/SingleLeaseMap.tsx | 232 ++ .../rent/{BasicInfo.js => BasicInfo.tsx} | 300 +-- .../leaseSections/rent/BasicInfoEdit.js | 905 -------- .../leaseSections/rent/BasicInfoEdit.tsx | 576 +++++ .../rent/{BasisOfRent.js => BasisOfRent.tsx} | 447 ++-- .../leaseSections/rent/BasisOfRentEdit.js | 1999 ---------------- .../leaseSections/rent/BasisOfRentEdit.tsx | 1417 ++++++++++++ .../BasisOfRentManagementSubventionEdit.js | 176 -- .../BasisOfRentManagementSubventionEdit.tsx | 152 ++ .../BasisOfRentTemporarySubventionEdit.js | 118 - .../BasisOfRentTemporarySubventionEdit.tsx | 86 + .../leaseSections/rent/BasisOfRents.js | 149 -- .../leaseSections/rent/BasisOfRents.tsx | 111 + .../leaseSections/rent/BasisOfRentsEdit.js | 312 --- .../leaseSections/rent/BasisOfRentsEdit.tsx | 237 ++ ...ateRentTotal.js => CalculateRentTotal.tsx} | 41 +- .../leaseSections/rent/ContractRentEdit.js | 413 ---- .../leaseSections/rent/ContractRentEdit.tsx | 274 +++ .../{ContractRents.js => ContractRents.tsx} | 168 +- .../leaseSections/rent/ContractRentsEdit.js | 118 - .../leaseSections/rent/ContractRentsEdit.tsx | 88 + .../leaseSections/rent/EqualizedRents.js | 108 - .../leaseSections/rent/EqualizedRents.tsx | 85 + ...YearRents.js => FixedInitialYearRents.tsx} | 129 +- .../rent/FixedInitialYearRentsEdit.js | 292 --- .../rent/FixedInitialYearRentsEdit.tsx | 198 ++ .../leaseSections/rent/IndexAdjustedRents.js | 108 - .../leaseSections/rent/IndexAdjustedRents.tsx | 83 + .../leaseSections/rent/MastChildrenEdit.js | 102 - .../leaseSections/rent/MastChildrenEdit.tsx | 80 + .../leaseSections/rent/PayableRents.js | 104 - .../leaseSections/rent/PayableRents.tsx | 81 + .../leaseSections/rent/RentAdjustmentEdit.js | 683 ------ .../leaseSections/rent/RentAdjustmentEdit.tsx | 489 ++++ .../RentAdjustmentManagementSubventionEdit.js | 84 - ...RentAdjustmentManagementSubventionEdit.tsx | 59 + .../RentAdjustmentTemporarySubventionEdit.js | 84 - .../RentAdjustmentTemporarySubventionEdit.tsx | 59 + ...RentAdjustments.js => RentAdjustments.tsx} | 219 +- .../leaseSections/rent/RentAdjustmentsEdit.js | 257 --- .../rent/RentAdjustmentsEdit.tsx | 210 ++ .../components/leaseSections/rent/RentItem.js | 265 --- .../leaseSections/rent/RentItem.tsx | 165 ++ .../leaseSections/rent/RentItemEdit.js | 474 ---- .../leaseSections/rent/RentItemEdit.tsx | 343 +++ .../components/leaseSections/rent/Rents.js | 142 -- .../components/leaseSections/rent/Rents.tsx | 107 + .../leaseSections/rent/RentsEdit.js | 432 ---- .../leaseSections/rent/RentsEdit.tsx | 342 +++ .../leaseSections/rent/SteppedDiscountForm.js | 149 -- .../rent/SteppedDiscountForm.tsx | 106 + .../rent/SteppedDiscountModal.js | 73 - .../rent/SteppedDiscountModal.tsx | 48 + .../{LeaseHistory.js => LeaseHistory.tsx} | 174 +- .../leaseSections/summary/LeaseHistoryEdit.js | 405 ---- .../summary/LeaseHistoryEdit.tsx | 385 ++++ .../leaseSections/summary/LeaseHistoryItem.js | 143 -- .../summary/LeaseHistoryItem.tsx | 118 + .../summary/{Summary.js => Summary.tsx} | 298 +-- .../leaseSections/summary/SummaryEdit.js | 684 ------ .../leaseSections/summary/SummaryEdit.tsx | 462 ++++ ...mmaryLeaseInfo.js => SummaryLeaseInfo.tsx} | 430 ++-- ...OtherTenantItem.js => OtherTenantItem.tsx} | 133 +- .../tenant/OtherTenantItemEdit.js | 277 --- .../tenant/OtherTenantItemEdit.tsx | 210 ++ .../components/leaseSections/tenant/Tenant.js | 114 - .../leaseSections/tenant/Tenant.tsx | 85 + .../tenant/{TenantItem.js => TenantItem.tsx} | 137 +- .../leaseSections/tenant/TenantItemEdit.js | 601 ----- .../leaseSections/tenant/TenantItemEdit.tsx | 424 ++++ .../leaseSections/tenant/Tenants.js | 82 - .../leaseSections/tenant/Tenants.tsx | 58 + .../leaseSections/tenant/TenantsEdit.js | 414 ---- .../leaseSections/tenant/TenantsEdit.tsx | 339 +++ src/leases/components/search/Search.js | 784 ------- src/leases/components/search/Search.tsx | 626 +++++ src/leases/constants.js | 108 - src/leases/constants.ts | 143 ++ src/leases/{enums.js => enums.ts} | 254 +-- .../{formValidators.js => formValidators.ts} | 249 +- src/leases/{helpers.js => helpers.ts} | 2025 +++++++---------- src/leases/{reducer.js => reducer.ts} | 181 +- src/leases/{requests.js => requests.ts} | 93 +- src/leases/requestsAsync.js | 63 - src/leases/requestsAsync.ts | 87 + src/leases/saga.js | 571 ----- src/leases/saga.ts | 755 ++++++ src/leases/selectors.js | 86 - src/leases/selectors.ts | 38 + src/leases/{spec.js => spec.ts} | 364 ++- src/leases/types.js | 97 - src/leases/types.ts | 80 + src/lessor/actions.js | 14 - src/lessor/actions.ts | 4 + src/lessor/{helpers.js => helpers.ts} | 12 +- src/lessor/reducer.js | 16 - src/lessor/reducer.ts | 14 + src/lessor/saga.js | 29 - src/lessor/saga.ts | 35 + src/lessor/selectors.js | 7 - src/lessor/selectors.ts | 4 + src/lessor/{spec.js => spec.ts} | 34 +- src/lessor/types.js | 11 - src/lessor/types.ts | 7 + src/penaltyInterest/actions.js | 18 - src/penaltyInterest/actions.ts | 6 + src/penaltyInterest/{enums.js => enums.ts} | 8 +- src/penaltyInterest/reducer.js | 45 - src/penaltyInterest/reducer.ts | 40 + .../{requests.js => requests.ts} | 11 +- src/penaltyInterest/saga.js | 36 - src/penaltyInterest/saga.ts | 40 + src/penaltyInterest/selectors.js | 10 - src/penaltyInterest/selectors.ts | 5 + src/penaltyInterest/{spec.js => spec.ts} | 61 +- src/penaltyInterest/types.js | 12 - src/penaltyInterest/types.ts | 9 + src/plotApplications/actions.js | 185 -- src/plotApplications/actions.ts | 46 + ...PlotApplication.js => PlotApplication.tsx} | 227 +- .../components/PlotApplicationCreate.js | 387 ---- .../components/PlotApplicationCreate.tsx | 279 +++ .../components/PlotApplicationCreatePage.js | 456 ---- .../components/PlotApplicationCreatePage.tsx | 388 ++++ .../components/PlotApplicationEdit.js | 142 -- .../components/PlotApplicationEdit.tsx | 97 + .../components/PlotApplicationInfo.js | 24 - .../components/PlotApplicationInfo.tsx | 19 + .../PlotApplicationOpeningRecordForm.js | 141 -- .../PlotApplicationOpeningRecordForm.tsx | 117 + .../components/PlotApplicationPage.js | 686 ------ .../components/PlotApplicationPage.tsx | 577 +++++ .../PlotApplicationsListOpeningModal.js | 95 - .../PlotApplicationsListOpeningModal.tsx | 87 + .../components/PlotApplicationsListPage.js | 566 ----- .../components/PlotApplicationsListPage.tsx | 518 +++++ .../exportModal/PlotSearchExportModal.js | 261 --- .../exportModal/PlotSearchExportModal.tsx | 219 ++ .../PlotSearchExportModalTargetTable.js | 66 - .../PlotSearchExportModalTargetTable.tsx | 55 + .../PlotApplicationApplicantInfoCheck.js | 56 - .../PlotApplicationApplicantInfoCheck.tsx | 40 + .../PlotApplicationApplicantInfoCheckEdit.js | 66 - .../PlotApplicationApplicantInfoCheckEdit.tsx | 52 + .../PlotApplicationInfoCheckCollapse.js | 24 - .../PlotApplicationInfoCheckCollapse.tsx | 20 + ....js => PlotApplicationTargetInfoCheck.tsx} | 176 +- .../PlotApplicationTargetInfoCheckEdit.js | 625 ----- .../PlotApplicationTargetInfoCheckEdit.tsx | 472 ++++ .../components/map/ApplicationListMap.js | 169 -- .../components/map/ApplicationListMap.tsx | 154 ++ .../components/map/TargetListLayer.js | 72 - .../components/map/TargetListLayer.tsx | 58 + .../components/search/Search.js | 467 ---- .../components/search/Search.tsx | 399 ++++ .../{constants.js => constants.ts} | 6 +- src/plotApplications/{enums.js => enums.ts} | 21 +- .../{formValidators.js => formValidators.ts} | 0 .../{helpers.js => helpers.ts} | 155 +- .../{reducer.js => reducer.ts} | 190 +- .../{requests.js => requests.ts} | 65 +- src/plotApplications/saga.js | 467 ---- src/plotApplications/saga.ts | 634 ++++++ src/plotApplications/selectors.js | 109 - src/plotApplications/selectors.ts | 61 + src/plotApplications/{spec.js => spec.ts} | 121 +- src/plotApplications/types.js | 132 -- src/plotApplications/types.ts | 108 + src/plotSearch/actions.js | 264 --- src/plotSearch/actions.ts | 72 + .../components/CreatePlotSearchForm.js | 115 - .../components/CreatePlotSearchForm.tsx | 82 + .../components/CreatePlotSearchModal.js | 50 - .../components/CreatePlotSearchModal.tsx | 36 + .../components/PlotSearchListPage.js | 512 ----- .../components/PlotSearchListPage.tsx | 436 ++++ src/plotSearch/components/PlotSearchPage.js | 804 ------- src/plotSearch/components/PlotSearchPage.tsx | 694 ++++++ .../DirectReservationLinkModal.js | 281 --- .../DirectReservationLinkModal.tsx | 223 ++ .../application/Application.js | 104 - .../application/Application.tsx | 78 + .../application/ApplicationEdit.js | 328 --- .../application/ApplicationEdit.tsx | 253 ++ .../application/ApplicationPreviewSection.js | 248 -- .../application/ApplicationPreviewSection.tsx | 223 ++ .../EditPlotApplicationSectionFieldForm.js | 786 ------- .../EditPlotApplicationSectionFieldForm.tsx | 530 +++++ .../EditPlotApplicationSectionForm.js | 746 ------ .../EditPlotApplicationSectionForm.tsx | 537 +++++ .../EditPlotApplicationSectionModal.js | 57 - .../EditPlotApplicationSectionModal.tsx | 43 + .../basicInfo/{BasicInfo.js => BasicInfo.tsx} | 281 +-- .../basicInfo/BasicInfoDecisionEdit.js | 105 - .../basicInfo/BasicInfoDecisionEdit.tsx | 82 + .../basicInfo/BasicInfoEdit.js | 641 ------ .../basicInfo/BasicInfoEdit.tsx | 502 ++++ .../PlotSearchApplicationsOpeningSection.js | 116 - .../PlotSearchApplicationsOpeningSection.tsx | 97 + ...js => PlotSearchReservationRecipients.tsx} | 28 +- ...s => PlotSearchSiteCustomDetailedPlan.tsx} | 208 +- ...archSiteEdit.js => PlotSearchSiteEdit.tsx} | 724 +++--- ... PlotSearchSiteEditCustomDetailedPlan.tsx} | 154 +- ...PlanUnit.js => PlotSearchSitePlanUnit.tsx} | 270 +-- .../basicInfo/PlotSearchTargetListing.js | 120 - .../basicInfo/PlotSearchTargetListing.tsx | 64 + .../basicInfo/SuggestedEdit.js | 108 - .../basicInfo/SuggestedEdit.tsx | 71 + .../plotSearchSections/map/ApplicationMap.js | 85 - .../plotSearchSections/map/ApplicationMap.tsx | 63 + .../plotSearchInfo/PlotSearchInfo.js | 24 - .../plotSearchInfo/PlotSearchInfo.tsx | 19 + .../ReservationIdentifiersModal.js | 381 ---- .../ReservationIdentifiersModal.tsx | 306 +++ src/plotSearch/components/search/Search.js | 335 --- src/plotSearch/components/search/Search.tsx | 286 +++ src/plotSearch/constants.js | 139 -- src/plotSearch/constants.ts | 84 + src/plotSearch/{enums.js => enums.ts} | 17 +- .../{formValidators.js => formValidators.ts} | 0 src/plotSearch/{helpers.js => helpers.ts} | 271 +-- src/plotSearch/{reducer.js => reducer.ts} | 300 ++- src/plotSearch/{requests.js => requests.ts} | 85 +- src/plotSearch/requestsAsync.js | 27 - src/plotSearch/requestsAsync.ts | 36 + src/plotSearch/saga.js | 654 ------ src/plotSearch/saga.ts | 835 +++++++ src/plotSearch/selectors.js | 151 -- src/plotSearch/selectors.ts | 72 + src/plotSearch/{spec.js => spec.ts} | 413 ++-- src/plotSearch/types.js | 142 -- src/plotSearch/types.ts | 122 + src/{polyfills.js => polyfills.ts} | 6 +- src/previewInvoices/actions.js | 23 - src/previewInvoices/actions.ts | 6 + src/previewInvoices/reducer.js | 27 - src/previewInvoices/reducer.ts | 21 + src/previewInvoices/requests.js | 10 - src/previewInvoices/requests.ts | 13 + src/previewInvoices/saga.js | 37 - src/previewInvoices/saga.ts | 39 + src/previewInvoices/selectors.js | 10 - src/previewInvoices/selectors.ts | 5 + src/previewInvoices/{spec.js => spec.ts} | 77 +- src/previewInvoices/types.js | 22 - src/previewInvoices/types.ts | 17 + src/relatedLease/actions.js | 25 - src/relatedLease/actions.ts | 6 + src/relatedLease/{enums.js => enums.ts} | 6 +- src/relatedLease/{requests.js => requests.ts} | 24 +- src/relatedLease/saga.js | 116 - src/relatedLease/saga.ts | 147 ++ src/relatedLease/types.js | 29 - src/relatedLease/types.ts | 23 + src/rentForPeriod/actions.js | 28 - src/rentForPeriod/actions.ts | 7 + src/rentForPeriod/reducer.js | 51 - src/rentForPeriod/reducer.ts | 40 + .../{requests.js => requests.ts} | 11 +- src/rentForPeriod/saga.js | 51 - src/rentForPeriod/saga.ts | 49 + .../{selectors.js => selectors.ts} | 19 +- src/rentForPeriod/spec.js | 95 - src/rentForPeriod/spec.ts | 121 + src/rentForPeriod/types.js | 33 - src/rentForPeriod/types.ts | 26 + src/rentbasis/actions.js | 74 - src/rentbasis/actions.ts | 19 + src/rentbasis/components/NewRentBasisPage.js | 198 -- src/rentbasis/components/NewRentBasisPage.tsx | 166 ++ src/rentbasis/components/RentBasisInfo.js | 37 - src/rentbasis/components/RentBasisInfo.tsx | 31 + src/rentbasis/components/RentBasisListPage.js | 387 ---- .../components/RentBasisListPage.tsx | 366 +++ src/rentbasis/components/RentBasisPage.js | 499 ---- src/rentbasis/components/RentBasisPage.tsx | 454 ++++ .../components/forms/RentBasisForm.js | 741 ------ .../components/forms/RentBasisForm.tsx | 528 +++++ src/rentbasis/components/search/Search.js | 259 --- src/rentbasis/components/search/Search.tsx | 230 ++ .../sections/basicInfo/RentBasisEdit.js | 12 - .../sections/basicInfo/RentBasisEdit.tsx | 9 + ...BasisReadonly.js => RentBasisReadonly.tsx} | 148 +- .../components/sections/map/RentBasisLayer.js | 100 - .../sections/map/RentBasisLayer.tsx | 91 + .../sections/map/SingleRentBasisMap.js | 164 -- .../sections/map/SingleRentBasisMap.tsx | 144 ++ src/rentbasis/{constants.js => constants.ts} | 5 +- src/rentbasis/{enums.js => enums.ts} | 20 +- src/rentbasis/formValidators.js | 18 - src/rentbasis/formValidators.ts | 17 + src/rentbasis/{helpers.js => helpers.ts} | 128 +- src/rentbasis/{reducer.js => reducer.ts} | 90 +- src/rentbasis/{requests.js => requests.ts} | 32 +- src/rentbasis/saga.js | 151 -- src/rentbasis/saga.ts | 185 ++ src/rentbasis/selectors.js | 37 - src/rentbasis/selectors.ts | 14 + src/rentbasis/{spec.js => spec.ts} | 172 +- src/rentbasis/types.js | 40 - src/rentbasis/types.ts | 33 + src/root/Root.js | 24 - src/root/Root.tsx | 23 + src/root/configureStore.js | 38 - src/root/configureStore.ts | 31 + src/root/createRootReducer.js | 109 - src/root/createRootReducer.ts | 105 + src/root/createRootSaga.js | 106 - src/root/createRootSaga.ts | 53 + ...bleOfflineMode.js => enableOfflineMode.ts} | 9 +- src/root/renderApp.js | 17 - src/root/renderApp.tsx | 8 + src/root/{routes.js => routes.tsx} | 86 +- src/root/{startApp.js => startApp.ts} | 23 +- src/root/types.js | 95 - src/root/types.ts | 93 + src/sapInvoice/actions.js | 18 - src/sapInvoice/actions.ts | 5 + .../components/SapInvoicesListPage.js | 416 ---- .../components/SapInvoicesListPage.tsx | 395 ++++ src/sapInvoice/components/Search.js | 147 -- src/sapInvoice/components/Search.tsx | 132 ++ src/sapInvoice/{constants.js => constants.ts} | 5 +- src/sapInvoice/helpers.js | 54 - src/sapInvoice/helpers.ts | 50 + src/sapInvoice/reducer.js | 26 - src/sapInvoice/reducer.ts | 20 + src/sapInvoice/saga.js | 33 - src/sapInvoice/saga.ts | 39 + src/sapInvoice/selectors.js | 10 - src/sapInvoice/selectors.ts | 5 + src/sapInvoice/{spec.js => spec.ts} | 47 +- src/sapInvoice/types.js | 13 - src/sapInvoice/types.ts | 9 + src/serviceUnits/actions.js | 19 - src/serviceUnits/actions.ts | 5 + src/serviceUnits/reducer.js | 23 - src/serviceUnits/reducer.ts | 20 + src/serviceUnits/{requests.js => requests.ts} | 9 +- src/serviceUnits/{saga.js => saga.ts} | 29 +- src/serviceUnits/selectors.js | 10 - src/serviceUnits/selectors.ts | 5 + src/serviceUnits/types.js | 17 - src/serviceUnits/types.ts | 10 + src/silent_renew.js | 3 - src/silent_renew.ts | 2 + src/test.js | 6 - src/test.ts | 5 + src/tradeRegister/actions.js | 46 - src/tradeRegister/actions.ts | 12 + ...CompanyExtended.js => CompanyExtended.tsx} | 213 +- .../{CompanyNotice.js => CompanyNotice.tsx} | 165 +- ...mpanyRepresent.js => CompanyRepresent.tsx} | 321 +-- .../components/DownloadableFiles.js | 100 - .../components/DownloadableFiles.tsx | 65 + src/tradeRegister/components/Search.js | 82 - src/tradeRegister/components/Search.tsx | 65 + .../components/TradeRegisterSearchPage.js | 140 -- .../components/TradeRegisterSearchPage.tsx | 139 ++ .../components/TradeRegisterTemplate.js | 126 - .../components/TradeRegisterTemplate.tsx | 105 + src/tradeRegister/{enums.js => enums.ts} | 20 +- src/tradeRegister/reducer.js | 102 - src/tradeRegister/reducer.ts | 98 + .../{requests.js => requests.ts} | 10 +- src/tradeRegister/saga.js | 87 - src/tradeRegister/saga.ts | 102 + src/tradeRegister/selectors.js | 24 - src/tradeRegister/selectors.ts | 9 + src/tradeRegister/{spec.js => spec.ts} | 151 +- src/tradeRegister/types.js | 34 - src/tradeRegister/types.ts | 22 + src/types.js | 51 - src/types.ts | 37 + src/uiData/actions.js | 49 - src/uiData/actions.ts | 13 + src/uiData/{enums.js => enums.ts} | 7 +- src/uiData/{helpers.js => helpers.ts} | 13 +- src/uiData/{reducer.js => reducer.ts} | 49 +- src/uiData/{requests.js => requests.ts} | 30 +- src/uiData/saga.js | 138 -- src/uiData/saga.ts | 173 ++ src/uiData/{selectors.js => selectors.ts} | 26 +- src/uiData/{spec.js => spec.ts} | 113 +- src/uiData/types.js | 34 - src/uiData/types.ts | 28 + src/users/actions.js | 19 - src/users/actions.ts | 5 + src/users/helpers.js | 48 - src/users/helpers.ts | 42 + src/users/reducer.js | 26 - src/users/reducer.ts | 20 + src/users/{requests.js => requests.ts} | 9 +- src/users/requestsAsync.js | 27 - src/users/requestsAsync.ts | 36 + src/users/saga.js | 52 - src/users/saga.ts | 54 + src/users/selectors.js | 10 - src/users/selectors.ts | 5 + src/users/{spec.js => spec.ts} | 62 +- src/users/types.js | 14 - src/users/types.ts | 9 + src/usersPermissions/actions.js | 33 - src/usersPermissions/actions.ts | 8 + src/usersPermissions/{enums.js => enums.ts} | 6 +- .../{reducer.js => reducer.ts} | 56 +- .../{requests.js => requests.ts} | 8 +- src/usersPermissions/{saga.js => saga.ts} | 42 +- src/usersPermissions/selectors.js | 19 - src/usersPermissions/selectors.ts | 8 + src/usersPermissions/{spec.js => spec.ts} | 63 +- src/usersPermissions/types.js | 23 - src/usersPermissions/types.ts | 18 + src/util/date.js | 303 --- src/util/date.ts | 280 +++ src/util/forms.js | 26 - src/util/forms.ts | 20 + src/util/{helpers.js => helpers.tsx} | 344 ++- src/util/{map.js => map.ts} | 121 +- src/util/{spec.js => spec.ts} | 1408 +++++------- src/util/{storage.js => storage.ts} | 28 +- src/util/testUtil.js | 16 - src/util/testUtil.ts | 12 + src/vat/actions.js | 18 - src/vat/actions.ts | 5 + src/vat/reducer.js | 23 - src/vat/reducer.ts | 20 + src/vat/{requests.js => requests.ts} | 8 +- src/vat/saga.js | 33 - src/vat/saga.ts | 35 + src/vat/selectors.js | 11 - src/vat/selectors.ts | 7 + src/vat/{spec.js => spec.ts} | 51 +- src/vat/types.js | 13 - src/vat/types.ts | 9 + tsconfig.json | 109 + yarn.lock | 77 +- 1690 files changed, 89312 insertions(+), 111766 deletions(-) delete mode 100644 src/api/ApiErrorModal.js create mode 100644 src/api/ApiErrorModal.tsx delete mode 100644 src/api/actions.js create mode 100644 src/api/actions.ts rename src/api/{callApi.js => callApi.ts} (51%) rename src/api/{callApiAsync.js => callApiAsync.ts} (51%) rename src/api/{callUploadRequest.js => callUploadRequest.ts} (53%) delete mode 100644 src/api/constants.js create mode 100644 src/api/constants.ts delete mode 100644 src/api/createUrl.js create mode 100644 src/api/createUrl.ts delete mode 100644 src/api/createUrlWithoutVersionSuffix.js create mode 100644 src/api/createUrlWithoutVersionSuffix.ts delete mode 100644 src/api/reducer.js create mode 100644 src/api/reducer.ts delete mode 100644 src/api/selectors.js create mode 100644 src/api/selectors.ts rename src/api/{spec.js => spec.ts} (53%) delete mode 100644 src/api/types.js create mode 100644 src/api/types.ts delete mode 100644 src/app/App.js create mode 100644 src/app/App.tsx rename src/app/{AppContext.js => AppContext.tsx} (53%) delete mode 100644 src/application/actions.js create mode 100644 src/application/actions.ts delete mode 100644 src/application/components/ApplicationAnswersField.js create mode 100644 src/application/components/ApplicationAnswersField.tsx delete mode 100644 src/application/components/ApplicationAnswersSection.js create mode 100644 src/application/components/ApplicationAnswersSection.tsx delete mode 100644 src/application/components/ApplicationSubsection.js create mode 100644 src/application/components/ApplicationSubsection.tsx rename src/application/components/{enums.js => enums.ts} (67%) delete mode 100644 src/application/components/infoCheck/ApplicantInfoCheck.js create mode 100644 src/application/components/infoCheck/ApplicantInfoCheck.tsx delete mode 100644 src/application/components/infoCheck/ApplicantInfoCheckEdit.js create mode 100644 src/application/components/infoCheck/ApplicantInfoCheckEdit.tsx delete mode 100644 src/application/components/infoCheck/ApplicantInfoCheckEditItem.js create mode 100644 src/application/components/infoCheck/ApplicantInfoCheckEditItem.tsx delete mode 100644 src/application/components/infoCheck/ApplicantInfoCheckForm.js create mode 100644 src/application/components/infoCheck/ApplicantInfoCheckForm.tsx delete mode 100644 src/application/components/infoCheck/ApplicantInfoCheckModal.js create mode 100644 src/application/components/infoCheck/ApplicantInfoCheckModal.tsx rename src/application/{constants.js => constants.ts} (55%) rename src/application/{enums.js => enums.ts} (77%) rename src/application/{formValidation.js => formValidation.ts} (78%) rename src/application/{helpers.js => helpers.ts} (57%) rename src/application/{reducer.js => reducer.ts} (61%) delete mode 100644 src/application/requests.js create mode 100644 src/application/requests.ts delete mode 100644 src/application/saga.js create mode 100644 src/application/saga.ts delete mode 100644 src/application/selectors.js create mode 100644 src/application/selectors.ts rename src/application/{spec.js => spec.ts} (71%) delete mode 100644 src/application/types.js create mode 100644 src/application/types.ts delete mode 100644 src/areaNote/actions.js create mode 100644 src/areaNote/actions.ts delete mode 100644 src/areaNote/components/AreaNoteListPage.js create mode 100644 src/areaNote/components/AreaNoteListPage.tsx delete mode 100644 src/areaNote/components/AreaNotesEditMap.js create mode 100644 src/areaNote/components/AreaNotesEditMap.tsx delete mode 100644 src/areaNote/components/AreaNotesLayer.js create mode 100644 src/areaNote/components/AreaNotesLayer.tsx delete mode 100644 src/areaNote/components/MapContainer.js create mode 100644 src/areaNote/components/MapContainer.tsx delete mode 100644 src/areaNote/components/SaveConditionPanel.js create mode 100644 src/areaNote/components/SaveConditionPanel.tsx delete mode 100644 src/areaNote/components/ZoomLevelWarning.js create mode 100644 src/areaNote/components/ZoomLevelWarning.tsx delete mode 100644 src/areaNote/components/search/Search.js create mode 100644 src/areaNote/components/search/Search.tsx rename src/areaNote/{enums.js => enums.ts} (84%) delete mode 100644 src/areaNote/helpers.js create mode 100644 src/areaNote/helpers.ts delete mode 100644 src/areaNote/reducer.js create mode 100644 src/areaNote/reducer.ts rename src/areaNote/{requests.js => requests.ts} (68%) delete mode 100644 src/areaNote/saga.js create mode 100644 src/areaNote/saga.ts delete mode 100644 src/areaNote/selectors.js create mode 100644 src/areaNote/selectors.ts rename src/areaNote/{spec.js => spec.ts} (70%) delete mode 100644 src/areaNote/types.js create mode 100644 src/areaNote/types.ts delete mode 100644 src/areaSearch/actions.js create mode 100644 src/areaSearch/actions.ts delete mode 100644 src/areaSearch/components/AreaSearchApplicantInfoCheck.js create mode 100644 src/areaSearch/components/AreaSearchApplicantInfoCheck.tsx delete mode 100644 src/areaSearch/components/AreaSearchApplicantInfoCheckEdit.js create mode 100644 src/areaSearch/components/AreaSearchApplicantInfoCheckEdit.tsx rename src/areaSearch/components/{AreaSearchApplication.js => AreaSearchApplication.tsx} (62%) delete mode 100644 src/areaSearch/components/AreaSearchApplicationAuditLog.js create mode 100644 src/areaSearch/components/AreaSearchApplicationAuditLog.tsx delete mode 100644 src/areaSearch/components/AreaSearchApplicationCreateForm.js create mode 100644 src/areaSearch/components/AreaSearchApplicationCreateForm.tsx delete mode 100644 src/areaSearch/components/AreaSearchApplicationCreatePage.js create mode 100644 src/areaSearch/components/AreaSearchApplicationCreatePage.tsx delete mode 100644 src/areaSearch/components/AreaSearchApplicationCreateSpecs.js create mode 100644 src/areaSearch/components/AreaSearchApplicationCreateSpecs.tsx delete mode 100644 src/areaSearch/components/AreaSearchApplicationEdit.js create mode 100644 src/areaSearch/components/AreaSearchApplicationEdit.tsx delete mode 100644 src/areaSearch/components/AreaSearchApplicationListPage.js create mode 100644 src/areaSearch/components/AreaSearchApplicationListPage.tsx delete mode 100644 src/areaSearch/components/AreaSearchApplicationPage.js create mode 100644 src/areaSearch/components/AreaSearchApplicationPage.tsx delete mode 100644 src/areaSearch/components/AreaSearchApplicationPropertyIdentifiers.js create mode 100644 src/areaSearch/components/AreaSearchApplicationPropertyIdentifiers.tsx delete mode 100644 src/areaSearch/components/AreaSearchExportModal.js create mode 100644 src/areaSearch/components/AreaSearchExportModal.tsx delete mode 100644 src/areaSearch/components/AreaSearchStatusNoteHistory.js create mode 100644 src/areaSearch/components/AreaSearchStatusNoteHistory.tsx delete mode 100644 src/areaSearch/components/EditAreaSearchPreparerForm.js create mode 100644 src/areaSearch/components/EditAreaSearchPreparerForm.tsx delete mode 100644 src/areaSearch/components/EditAreaSearchPreparerModal.js create mode 100644 src/areaSearch/components/EditAreaSearchPreparerModal.tsx rename src/areaSearch/components/map/{AreaSearchLayer.js => AreaSearchLayer.tsx} (50%) delete mode 100644 src/areaSearch/components/map/AreaSearchListMap.js create mode 100644 src/areaSearch/components/map/AreaSearchListMap.tsx delete mode 100644 src/areaSearch/components/map/AreaSearchMap.js create mode 100644 src/areaSearch/components/map/AreaSearchMap.tsx delete mode 100644 src/areaSearch/components/map/SingleAreaSearchMap.js create mode 100644 src/areaSearch/components/map/SingleAreaSearchMap.tsx delete mode 100644 src/areaSearch/components/search/Search.js create mode 100644 src/areaSearch/components/search/Search.tsx rename src/areaSearch/{constants.js => constants.ts} (89%) rename src/areaSearch/{enums.js => enums.ts} (89%) rename src/areaSearch/{helpers.js => helpers.ts} (59%) rename src/areaSearch/{reducer.js => reducer.ts} (59%) rename src/areaSearch/{requests.js => requests.ts} (53%) delete mode 100644 src/areaSearch/saga.js create mode 100644 src/areaSearch/saga.ts delete mode 100644 src/areaSearch/selectors.js create mode 100644 src/areaSearch/selectors.ts rename src/areaSearch/{spec.js => spec.ts} (63%) delete mode 100644 src/areaSearch/types.js create mode 100644 src/areaSearch/types.ts rename src/areaSearch/{validators.js => validators.ts} (53%) delete mode 100644 src/auditLog/actions.js create mode 100644 src/auditLog/actions.ts rename src/auditLog/{helpers.js => helpers.ts} (83%) delete mode 100644 src/auditLog/reducer.js create mode 100644 src/auditLog/reducer.ts delete mode 100644 src/auditLog/requests.js create mode 100644 src/auditLog/requests.ts delete mode 100644 src/auditLog/saga.js create mode 100644 src/auditLog/saga.ts delete mode 100644 src/auditLog/selectors.js create mode 100644 src/auditLog/selectors.ts rename src/auditLog/{spec.js => spec.ts} (61%) delete mode 100644 src/auditLog/types.js create mode 100644 src/auditLog/types.ts delete mode 100644 src/auth/actions.js create mode 100644 src/auth/actions.ts delete mode 100644 src/auth/components/CallbackPage.js create mode 100644 src/auth/components/CallbackPage.tsx rename src/auth/components/{LoginPage.js => LoginPage.tsx} (65%) delete mode 100644 src/auth/reducer.js create mode 100644 src/auth/reducer.ts delete mode 100644 src/auth/saga.js create mode 100644 src/auth/saga.ts delete mode 100644 src/auth/selectors.js create mode 100644 src/auth/selectors.ts rename src/auth/{spec.js => spec.ts} (74%) delete mode 100644 src/auth/types.js create mode 100644 src/auth/types.ts rename src/auth/util/{user-manager.js => user-manager.ts} (86%) delete mode 100644 src/basisOfRentCalculator/components/BasisOfRentCalculatorForm.js create mode 100644 src/basisOfRentCalculator/components/BasisOfRentCalculatorForm.tsx delete mode 100644 src/basisOfRentCalculator/components/BasisOfRentCalculatorPage.js create mode 100644 src/basisOfRentCalculator/components/BasisOfRentCalculatorPage.tsx delete mode 100644 src/batchrun/actions.js create mode 100644 src/batchrun/actions.ts delete mode 100644 src/batchrun/components/BatchRunPage.js create mode 100644 src/batchrun/components/BatchRunPage.tsx delete mode 100644 src/batchrun/components/JobRunLogEntryPanel.js create mode 100644 src/batchrun/components/JobRunLogEntryPanel.tsx delete mode 100644 src/batchrun/components/JobRuns.js create mode 100644 src/batchrun/components/JobRuns.tsx delete mode 100644 src/batchrun/components/ScheduledJobs.js create mode 100644 src/batchrun/components/ScheduledJobs.tsx rename src/batchrun/{enums.js => enums.ts} (88%) rename src/batchrun/{reducer.js => reducer.ts} (56%) delete mode 100644 src/batchrun/requests.js create mode 100644 src/batchrun/requests.ts rename src/batchrun/{saga.js => saga.ts} (54%) delete mode 100644 src/batchrun/selectors.js create mode 100644 src/batchrun/selectors.ts rename src/batchrun/{spec.js => spec.ts} (62%) delete mode 100644 src/batchrun/types.js create mode 100644 src/batchrun/types.ts delete mode 100644 src/billingPeriods/actions.js create mode 100644 src/billingPeriods/actions.ts delete mode 100644 src/billingPeriods/reducer.js create mode 100644 src/billingPeriods/reducer.ts rename src/billingPeriods/{requests.js => requests.ts} (59%) delete mode 100644 src/billingPeriods/saga.js create mode 100644 src/billingPeriods/saga.ts delete mode 100644 src/billingPeriods/selectors.js create mode 100644 src/billingPeriods/selectors.ts rename src/billingPeriods/{spec.js => spec.ts} (50%) delete mode 100644 src/billingPeriods/types.js create mode 100644 src/billingPeriods/types.ts delete mode 100644 src/collectionCourtDecision/actions.js create mode 100644 src/collectionCourtDecision/actions.ts rename src/collectionCourtDecision/{enums.js => enums.ts} (91%) delete mode 100644 src/collectionCourtDecision/reducer.js create mode 100644 src/collectionCourtDecision/reducer.ts rename src/collectionCourtDecision/{requests.js => requests.ts} (71%) delete mode 100644 src/collectionCourtDecision/saga.js create mode 100644 src/collectionCourtDecision/saga.ts delete mode 100644 src/collectionCourtDecision/selectors.js create mode 100644 src/collectionCourtDecision/selectors.ts rename src/collectionCourtDecision/{spec.js => spec.ts} (61%) delete mode 100644 src/collectionCourtDecision/types.js create mode 100644 src/collectionCourtDecision/types.ts delete mode 100644 src/collectionLetter/actions.js create mode 100644 src/collectionLetter/actions.ts rename src/collectionLetter/{enums.js => enums.ts} (87%) delete mode 100644 src/collectionLetter/reducer.js create mode 100644 src/collectionLetter/reducer.ts rename src/collectionLetter/{requests.js => requests.ts} (65%) delete mode 100644 src/collectionLetter/saga.js create mode 100644 src/collectionLetter/saga.ts delete mode 100644 src/collectionLetter/selectors.js create mode 100644 src/collectionLetter/selectors.ts rename src/collectionLetter/{spec.js => spec.ts} (59%) delete mode 100644 src/collectionLetter/types.js create mode 100644 src/collectionLetter/types.ts delete mode 100644 src/collectionNote/actions.js create mode 100644 src/collectionNote/actions.ts rename src/collectionNote/{enums.js => enums.ts} (89%) delete mode 100644 src/collectionNote/reducer.js create mode 100644 src/collectionNote/reducer.ts rename src/collectionNote/{requests.js => requests.ts} (66%) delete mode 100644 src/collectionNote/saga.js create mode 100644 src/collectionNote/saga.ts delete mode 100644 src/collectionNote/selectors.js create mode 100644 src/collectionNote/selectors.ts rename src/collectionNote/{spec.js => spec.ts} (59%) delete mode 100644 src/collectionNote/types.js create mode 100644 src/collectionNote/types.ts delete mode 100644 src/comments/actions.js create mode 100644 src/comments/actions.ts rename src/comments/{enums.js => enums.ts} (83%) rename src/comments/{helpers.js => helpers.ts} (55%) delete mode 100644 src/comments/reducer.js create mode 100644 src/comments/reducer.ts rename src/comments/{requests.js => requests.ts} (70%) delete mode 100644 src/comments/saga.js create mode 100644 src/comments/saga.ts delete mode 100644 src/comments/selectors.js create mode 100644 src/comments/selectors.ts rename src/comments/{spec.js => spec.ts} (63%) delete mode 100644 src/comments/types.js create mode 100644 src/comments/types.ts delete mode 100644 src/components/address-search/AddressSearchInput.js create mode 100644 src/components/address-search/AddressSearchInput.tsx delete mode 100644 src/components/attributes/AreaNoteAttributes.js create mode 100644 src/components/attributes/AreaNoteAttributes.tsx delete mode 100644 src/components/attributes/AreaSearchAttributes.js create mode 100644 src/components/attributes/AreaSearchAttributes.tsx delete mode 100644 src/components/attributes/BatchrunJobRunsTabAttributes.js create mode 100644 src/components/attributes/BatchrunJobRunsTabAttributes.tsx delete mode 100644 src/components/attributes/BatchrunScheduledJobsTabAttributes.js create mode 100644 src/components/attributes/BatchrunScheduledJobsTabAttributes.tsx delete mode 100644 src/components/attributes/ContactAttributes.js create mode 100644 src/components/attributes/ContactAttributes.tsx delete mode 100644 src/components/attributes/InfillDevelopmentListPageAttributes.js create mode 100644 src/components/attributes/InfillDevelopmentListPageAttributes.tsx delete mode 100644 src/components/attributes/InfillDevelopmentPageAttributes.js create mode 100644 src/components/attributes/InfillDevelopmentPageAttributes.tsx delete mode 100644 src/components/attributes/InvoiceNoteAttributes.js create mode 100644 src/components/attributes/InvoiceNoteAttributes.tsx delete mode 100644 src/components/attributes/LandUseContractAttributes.js create mode 100644 src/components/attributes/LandUseContractAttributes.tsx rename src/components/attributes/{LandUseContractInvoiceTabAttributes.js => LandUseContractInvoiceTabAttributes.ts} (100%) delete mode 100644 src/components/attributes/LeaseAttributes.js create mode 100644 src/components/attributes/LeaseAttributes.tsx delete mode 100644 src/components/attributes/LeaseInvoiceTabAttributes.js create mode 100644 src/components/attributes/LeaseInvoiceTabAttributes.tsx delete mode 100644 src/components/attributes/LeaseInvoicingConfirmationReportAttributes.js create mode 100644 src/components/attributes/LeaseInvoicingConfirmationReportAttributes.tsx delete mode 100644 src/components/attributes/LeasePageAttributes.js create mode 100644 src/components/attributes/LeasePageAttributes.tsx delete mode 100644 src/components/attributes/LeaseStatisticReportAttributes.js create mode 100644 src/components/attributes/LeaseStatisticReportAttributes.tsx delete mode 100644 src/components/attributes/LeaseholdTransferAttributes.js create mode 100644 src/components/attributes/LeaseholdTransferAttributes.tsx delete mode 100644 src/components/attributes/PlotApplicationsAttributes.js create mode 100644 src/components/attributes/PlotApplicationsAttributes.tsx delete mode 100644 src/components/attributes/PlotSearchAttributes.js create mode 100644 src/components/attributes/PlotSearchAttributes.tsx delete mode 100644 src/components/attributes/RentBasisAttributes.js create mode 100644 src/components/attributes/RentBasisAttributes.tsx delete mode 100644 src/components/attributes/SapInvoicesAttributes.js create mode 100644 src/components/attributes/SapInvoicesAttributes.tsx delete mode 100644 src/components/attributes/UsersPermissions.js create mode 100644 src/components/attributes/UsersPermissions.tsx delete mode 100644 src/components/auditLog/AuditLogTable.js create mode 100644 src/components/auditLog/AuditLogTable.tsx delete mode 100644 src/components/auditLog/AuditLogTableItem.js create mode 100644 src/components/auditLog/AuditLogTableItem.tsx delete mode 100644 src/components/auditLog/AuditLogTableItemChange.js create mode 100644 src/components/auditLog/AuditLogTableItemChange.tsx delete mode 100644 src/components/authorization/Authorization.js create mode 100644 src/components/authorization/Authorization.ts delete mode 100644 src/components/authorization/AuthorizationError.js create mode 100644 src/components/authorization/AuthorizationError.tsx delete mode 100644 src/components/button/BackButton.js create mode 100644 src/components/button/BackButton.tsx delete mode 100644 src/components/button/Button.js create mode 100644 src/components/button/Button.tsx delete mode 100644 src/components/button/CloseButton.js create mode 100644 src/components/button/CloseButton.tsx delete mode 100644 src/components/button/EditButton.js create mode 100644 src/components/button/EditButton.tsx delete mode 100644 src/components/button/IconButton.js create mode 100644 src/components/button/IconButton.tsx delete mode 100644 src/components/button/IconRadioButtons.js create mode 100644 src/components/button/IconRadioButtons.tsx delete mode 100644 src/components/button/SendupButton.js create mode 100644 src/components/button/SendupButton.tsx delete mode 100644 src/components/collapse/Collapse.js create mode 100644 src/components/collapse/Collapse.tsx delete mode 100644 src/components/collapse/CollapseHeaderSubtitle.js create mode 100644 src/components/collapse/CollapseHeaderSubtitle.tsx delete mode 100644 src/components/collapse/CollapseHeaderTitle.js create mode 100644 src/components/collapse/CollapseHeaderTitle.tsx delete mode 100644 src/components/constants.js create mode 100644 src/components/constants.ts delete mode 100644 src/components/content/BoxContentWrapper.js create mode 100644 src/components/content/BoxContentWrapper.tsx delete mode 100644 src/components/content/BoxItem.js create mode 100644 src/components/content/BoxItem.tsx delete mode 100644 src/components/content/BoxItemContainer.js create mode 100644 src/components/content/BoxItemContainer.tsx delete mode 100644 src/components/content/ButtonWrapper.js create mode 100644 src/components/content/ButtonWrapper.tsx delete mode 100644 src/components/content/ContentContainer.js create mode 100644 src/components/content/ContentContainer.tsx delete mode 100644 src/components/content/ContentItem.js create mode 100644 src/components/content/ContentItem.tsx delete mode 100644 src/components/content/Divider.js create mode 100644 src/components/content/Divider.tsx delete mode 100644 src/components/content/FullWidthContainer.js create mode 100644 src/components/content/FullWidthContainer.tsx delete mode 100644 src/components/content/GrayBox.js create mode 100644 src/components/content/GrayBox.tsx delete mode 100644 src/components/content/GreenBox.js create mode 100644 src/components/content/GreenBox.tsx delete mode 100644 src/components/content/ListItem.js create mode 100644 src/components/content/ListItem.tsx delete mode 100644 src/components/content/ListItems.js create mode 100644 src/components/content/ListItems.tsx rename src/components/content/{MapLink.js => MapLink.tsx} (56%) delete mode 100644 src/components/content/MapLinkButton.js create mode 100644 src/components/content/MapLinkButton.tsx delete mode 100644 src/components/content/PageContainer.js create mode 100644 src/components/content/PageContainer.tsx delete mode 100644 src/components/content/PageNavigationWrapper.js create mode 100644 src/components/content/PageNavigationWrapper.tsx delete mode 100644 src/components/content/SubTitle.js create mode 100644 src/components/content/SubTitle.tsx delete mode 100644 src/components/content/SubsectionContent.js create mode 100644 src/components/content/SubsectionContent.tsx delete mode 100644 src/components/content/Title.js create mode 100644 src/components/content/Title.tsx delete mode 100644 src/components/content/TitleH3.js create mode 100644 src/components/content/TitleH3.tsx delete mode 100644 src/components/content/TruncatedText.js create mode 100644 src/components/content/TruncatedText.tsx delete mode 100644 src/components/content/WarningContainer.js create mode 100644 src/components/content/WarningContainer.tsx delete mode 100644 src/components/content/WhiteBox.js create mode 100644 src/components/content/WhiteBox.tsx delete mode 100644 src/components/controlButtons/CommentButton.js create mode 100644 src/components/controlButtons/CommentButton.tsx delete mode 100644 src/components/controlButtons/ControlButtonBar.js create mode 100644 src/components/controlButtons/ControlButtonBar.tsx delete mode 100644 src/components/controlButtons/ControlButtons.js create mode 100644 src/components/controlButtons/ControlButtons.tsx rename src/components/{enums.js => enums.ts} (86%) delete mode 100644 src/components/excel/ExcelLink.js create mode 100644 src/components/excel/ExcelLink.tsx delete mode 100644 src/components/file/FileDownloadButton.js create mode 100644 src/components/file/FileDownloadButton.tsx delete mode 100644 src/components/file/FileDownloadLink.js create mode 100644 src/components/file/FileDownloadLink.tsx delete mode 100644 src/components/file/FileInput.js create mode 100644 src/components/file/FileInput.tsx delete mode 100644 src/components/form/ActionButtonWrapper.js create mode 100644 src/components/form/ActionButtonWrapper.tsx delete mode 100644 src/components/form/AddButton.js create mode 100644 src/components/form/AddButton.tsx delete mode 100644 src/components/form/AddButtonSecondary.js create mode 100644 src/components/form/AddButtonSecondary.tsx delete mode 100644 src/components/form/AddButtonThird.js create mode 100644 src/components/form/AddButtonThird.tsx delete mode 100644 src/components/form/AddFileButton.js create mode 100644 src/components/form/AddFileButton.tsx delete mode 100644 src/components/form/ArchiveButton.js create mode 100644 src/components/form/ArchiveButton.tsx delete mode 100644 src/components/form/AsyncSelect.js create mode 100644 src/components/form/AsyncSelect.tsx delete mode 100644 src/components/form/AttachButton.js create mode 100644 src/components/form/AttachButton.tsx delete mode 100644 src/components/form/CopyToClipboardButton.js create mode 100644 src/components/form/CopyToClipboardButton.tsx delete mode 100644 src/components/form/DecisionSelectInput.js create mode 100644 src/components/form/DecisionSelectInput.tsx delete mode 100644 src/components/form/DocumentsButton.js create mode 100644 src/components/form/DocumentsButton.tsx delete mode 100644 src/components/form/EditButton.js create mode 100644 src/components/form/EditButton.tsx delete mode 100644 src/components/form/ErrorBlock.js create mode 100644 src/components/form/ErrorBlock.tsx delete mode 100644 src/components/form/ErrorField.js create mode 100644 src/components/form/ErrorField.tsx delete mode 100644 src/components/form/FieldAndRemoveButtonWrapper.js create mode 100644 src/components/form/FieldAndRemoveButtonWrapper.tsx delete mode 100644 src/components/form/FieldTypeAddress.js create mode 100644 src/components/form/FieldTypeAddress.tsx delete mode 100644 src/components/form/FieldTypeBasic.js create mode 100644 src/components/form/FieldTypeBasic.tsx delete mode 100644 src/components/form/FieldTypeBoolean.js create mode 100644 src/components/form/FieldTypeBoolean.tsx delete mode 100644 src/components/form/FieldTypeCheckbox.js create mode 100644 src/components/form/FieldTypeCheckbox.tsx delete mode 100644 src/components/form/FieldTypeCheckboxDateTime.js create mode 100644 src/components/form/FieldTypeCheckboxDateTime.tsx delete mode 100644 src/components/form/FieldTypeContactSelect.js create mode 100644 src/components/form/FieldTypeContactSelect.tsx delete mode 100644 src/components/form/FieldTypeDatePicker.js create mode 100644 src/components/form/FieldTypeDatePicker.tsx delete mode 100644 src/components/form/FieldTypeDecimal.js create mode 100644 src/components/form/FieldTypeDecimal.tsx rename src/components/form/{FieldTypeFractional.js => FieldTypeFractional.tsx} (52%) delete mode 100644 src/components/form/FieldTypeHidden.js create mode 100644 src/components/form/FieldTypeHidden.tsx delete mode 100644 src/components/form/FieldTypeLeaseSelect.js create mode 100644 src/components/form/FieldTypeLeaseSelect.tsx delete mode 100644 src/components/form/FieldTypeLessorSelect.js create mode 100644 src/components/form/FieldTypeLessorSelect.tsx delete mode 100644 src/components/form/FieldTypeMultiSelect.js create mode 100644 src/components/form/FieldTypeMultiSelect.tsx delete mode 100644 src/components/form/FieldTypeRadioWithField.js create mode 100644 src/components/form/FieldTypeRadioWithField.tsx delete mode 100644 src/components/form/FieldTypeSearch.js create mode 100644 src/components/form/FieldTypeSearch.tsx delete mode 100644 src/components/form/FieldTypeSelect.js create mode 100644 src/components/form/FieldTypeSelect.tsx delete mode 100644 src/components/form/FieldTypeTextArea.js create mode 100644 src/components/form/FieldTypeTextArea.tsx delete mode 100644 src/components/form/FieldTypeTime.js create mode 100644 src/components/form/FieldTypeTime.tsx delete mode 100644 src/components/form/FieldTypeUserSelect.js create mode 100644 src/components/form/FieldTypeUserSelect.tsx delete mode 100644 src/components/form/FormField.js create mode 100644 src/components/form/FormField.tsx delete mode 100644 src/components/form/FormFieldLabel.js create mode 100644 src/components/form/FormFieldLabel.tsx delete mode 100644 src/components/form/FormHintText.js create mode 100644 src/components/form/FormHintText.tsx delete mode 100644 src/components/form/FormText.js create mode 100644 src/components/form/FormText.tsx delete mode 100644 src/components/form/FormTextTitle.js create mode 100644 src/components/form/FormTextTitle.tsx delete mode 100644 src/components/form/FormTitleAndText.js create mode 100644 src/components/form/FormTitleAndText.tsx delete mode 100644 src/components/form/FormWrapper.js create mode 100644 src/components/form/FormWrapper.tsx delete mode 100644 src/components/form/FormWrapperLeft.js create mode 100644 src/components/form/FormWrapperLeft.tsx delete mode 100644 src/components/form/FormWrapperRight.js create mode 100644 src/components/form/FormWrapperRight.tsx delete mode 100644 src/components/form/RemoveButton.js create mode 100644 src/components/form/RemoveButton.tsx delete mode 100644 src/components/form/SuccessField.js create mode 100644 src/components/form/SuccessField.tsx delete mode 100644 src/components/form/UnarchiveButton.js create mode 100644 src/components/form/UnarchiveButton.tsx delete mode 100644 src/components/form/WarningField.js create mode 100644 src/components/form/WarningField.tsx rename src/components/form/{filter.js => filter.ts} (57%) delete mode 100644 src/components/form/normalizers.js create mode 100644 src/components/form/normalizers.ts delete mode 100644 src/components/form/validations.js create mode 100644 src/components/form/validations.ts delete mode 100644 src/components/formValidations.js create mode 100644 src/components/formValidations.ts rename src/components/{helpers.js => helpers.ts} (70%) rename src/components/icons/{AccordionIcon.js => AccordionIcon.tsx} (52%) rename src/components/icons/{AddIcon.js => AddIcon.tsx} (57%) delete mode 100644 src/components/icons/ArchiveIcon.js create mode 100644 src/components/icons/ArchiveIcon.tsx rename src/components/icons/{AttachIcon.js => AttachIcon.tsx} (80%) delete mode 100644 src/components/icons/BackIcon.js create mode 100644 src/components/icons/BackIcon.tsx rename src/components/icons/{CancelIcon.js => CancelIcon.tsx} (58%) delete mode 100644 src/components/icons/CommentIcon.js create mode 100644 src/components/icons/CommentIcon.tsx rename src/components/icons/{CopyToClipboardIcon.js => CopyToClipboardIcon.tsx} (68%) delete mode 100644 src/components/icons/DocIcon.js create mode 100644 src/components/icons/DocIcon.tsx rename src/components/icons/{EditIcon.js => EditIcon.tsx} (62%) rename src/components/icons/{ErrorIcon.js => ErrorIcon.tsx} (77%) rename src/components/icons/{ExcelIcon.js => ExcelIcon.tsx} (73%) rename src/components/icons/{ExternalLinkIcon.js => ExternalLinkIcon.tsx} (69%) rename src/components/icons/{InfoIcon.js => InfoIcon.tsx} (78%) rename src/components/icons/{MainMenuIcon.js => MainMenuIcon.tsx} (59%) delete mode 100644 src/components/icons/MapIcon.js create mode 100644 src/components/icons/MapIcon.tsx rename src/components/icons/{MoveDownIcon.js => MoveDownIcon.tsx} (55%) delete mode 100644 src/components/icons/MoveUpIcon.js create mode 100644 src/components/icons/MoveUpIcon.tsx rename src/components/icons/{QuestionIcon.js => QuestionIcon.tsx} (60%) delete mode 100644 src/components/icons/SendupIcon.js create mode 100644 src/components/icons/SendupIcon.tsx rename src/components/icons/{SuccessIcon.js => SuccessIcon.tsx} (69%) delete mode 100644 src/components/icons/TableIcon.js create mode 100644 src/components/icons/TableIcon.tsx rename src/components/icons/{TrashIcon.js => TrashIcon.tsx} (83%) delete mode 100644 src/components/icons/UnarchiveIcon.js create mode 100644 src/components/icons/UnarchiveIcon.tsx delete mode 100644 src/components/inputs/CheckboxInput.js create mode 100644 src/components/inputs/CheckboxInput.tsx delete mode 100644 src/components/inputs/DropdownIndicator.js create mode 100644 src/components/inputs/DropdownIndicator.tsx delete mode 100644 src/components/inputs/EstateIdSelectInput.js create mode 100644 src/components/inputs/EstateIdSelectInput.tsx delete mode 100644 src/components/inputs/LeaseSelectInput.js create mode 100644 src/components/inputs/LeaseSelectInput.tsx delete mode 100644 src/components/inputs/PlanUnitSelectInput.js create mode 100644 src/components/inputs/PlanUnitSelectInput.tsx delete mode 100644 src/components/inputs/SearchInput.js create mode 100644 src/components/inputs/SearchInput.tsx delete mode 100644 src/components/inputs/SelectLoadingIndicator.js create mode 100644 src/components/inputs/SelectLoadingIndicator.tsx delete mode 100644 src/components/inputs/SingleRadioInput.js create mode 100644 src/components/inputs/SingleRadioInput.tsx delete mode 100644 src/components/inputs/TextAreaInput.js create mode 100644 src/components/inputs/TextAreaInput.tsx delete mode 100644 src/components/inputs/TextInput.js create mode 100644 src/components/inputs/TextInput.tsx delete mode 100644 src/components/inputs/UserServiceUnitSelectInput.js create mode 100644 src/components/inputs/UserServiceUnitSelectInput.tsx delete mode 100644 src/components/invoice-simulator/InvoiceSimulator.js create mode 100644 src/components/invoice-simulator/InvoiceSimulator.tsx delete mode 100644 src/components/invoice-simulator/InvoiceSimulatorBillingPeriods.js create mode 100644 src/components/invoice-simulator/InvoiceSimulatorBillingPeriods.tsx delete mode 100644 src/components/invoice-simulator/InvoiceSimulatorForm.js create mode 100644 src/components/invoice-simulator/InvoiceSimulatorForm.tsx delete mode 100644 src/components/invoice-simulator/InvoiceSimulatorInvoice.js create mode 100644 src/components/invoice-simulator/InvoiceSimulatorInvoice.tsx rename src/components/invoice-simulator/{InvoiceSimulatorInvoiceRows.js => InvoiceSimulatorInvoiceRows.tsx} (67%) rename src/components/ktj/{KtjLink.js => KtjLink.tsx} (50%) delete mode 100644 src/components/links/DecisionLink.js create mode 100644 src/components/links/DecisionLink.tsx delete mode 100644 src/components/links/ExternalLink.js create mode 100644 src/components/links/ExternalLink.tsx delete mode 100644 src/components/loader/Loader.js create mode 100644 src/components/loader/Loader.tsx delete mode 100644 src/components/loader/LoaderWrapper.js create mode 100644 src/components/loader/LoaderWrapper.tsx rename src/components/map/{GeoSearch.js => GeoSearch.ts} (66%) delete mode 100644 src/components/map/HelsinkiProvider.js create mode 100644 src/components/map/HelsinkiProvider.ts delete mode 100644 src/components/map/ZoomBox.js create mode 100644 src/components/map/ZoomBox.ts delete mode 100644 src/components/map/types.js create mode 100644 src/components/map/types.ts delete mode 100644 src/components/modal/ConfirmationModal.js create mode 100644 src/components/modal/ConfirmationModal.tsx rename src/components/modal/{Modal.js => Modal.tsx} (53%) delete mode 100644 src/components/modal/ModalButtonWrapper.js create mode 100644 src/components/modal/ModalButtonWrapper.tsx delete mode 100644 src/components/multi-select/Dropdown.js create mode 100644 src/components/multi-select/Dropdown.tsx delete mode 100644 src/components/multi-select/LoadingIndicator.js create mode 100644 src/components/multi-select/LoadingIndicator.tsx rename src/components/multi-select/{MultiSelect.js => MultiSelect.tsx} (51%) delete mode 100644 src/components/multi-select/SelectItem.js create mode 100644 src/components/multi-select/SelectItem.tsx delete mode 100644 src/components/multi-select/SelectList.js create mode 100644 src/components/multi-select/SelectList.tsx delete mode 100644 src/components/multi-select/SelectPanel.js create mode 100644 src/components/multi-select/SelectPanel.tsx rename src/components/multi-select/{helpers.js => helpers.ts} (67%) delete mode 100644 src/components/rent-calculator/RentCalculator.js create mode 100644 src/components/rent-calculator/RentCalculator.tsx delete mode 100644 src/components/rent-calculator/RentCalculatorExplanation.js create mode 100644 src/components/rent-calculator/RentCalculatorExplanation.tsx delete mode 100644 src/components/rent-calculator/RentCalculatorForm.js create mode 100644 src/components/rent-calculator/RentCalculatorForm.tsx delete mode 100644 src/components/rent-calculator/RentCalculatorRent.js create mode 100644 src/components/rent-calculator/RentCalculatorRent.tsx delete mode 100644 src/components/rent-calculator/RentCalculatorSubItem.js create mode 100644 src/components/rent-calculator/RentCalculatorSubItem.tsx delete mode 100644 src/components/rent-calculator/RentCalculatorTotalRow.js create mode 100644 src/components/rent-calculator/RentCalculatorTotalRow.tsx delete mode 100644 src/components/rent-calculator/RentForPeriod.js create mode 100644 src/components/rent-calculator/RentForPeriod.tsx rename src/components/resize/{WindowResizeHandler.js => WindowResizeHandler.tsx} (63%) delete mode 100644 src/components/search/SearchChangeTypeLink.js create mode 100644 src/components/search/SearchChangeTypeLink.tsx delete mode 100644 src/components/search/SearchClearLink.js create mode 100644 src/components/search/SearchClearLink.tsx delete mode 100644 src/components/search/SearchContainer.js create mode 100644 src/components/search/SearchContainer.tsx delete mode 100644 src/components/search/SearchInputColumn.js create mode 100644 src/components/search/SearchInputColumn.tsx delete mode 100644 src/components/search/SearchLabel.js create mode 100644 src/components/search/SearchLabel.tsx delete mode 100644 src/components/search/SearchLabelColumn.js create mode 100644 src/components/search/SearchLabelColumn.tsx delete mode 100644 src/components/search/SearchRow.js create mode 100644 src/components/search/SearchRow.tsx delete mode 100644 src/components/search/SearchSubtitleLabel.js create mode 100644 src/components/search/SearchSubtitleLabel.tsx delete mode 100644 src/components/showMore/ShowMore.js create mode 100644 src/components/showMore/ShowMore.tsx delete mode 100644 src/components/sideMenu/SideMenu.js create mode 100644 src/components/sideMenu/SideMenu.tsx delete mode 100644 src/components/sideMenu/SubMenu.js create mode 100644 src/components/sideMenu/SubMenu.tsx rename src/components/{spec.js => spec.ts} (52%) delete mode 100644 src/components/table/Icons.js create mode 100644 src/components/table/Icons.tsx rename src/components/table/{MultiItemCollapse.js => MultiItemCollapse.tsx} (52%) delete mode 100644 src/components/table/Pagination.js create mode 100644 src/components/table/Pagination.tsx delete mode 100644 src/components/table/SortableTable.js create mode 100644 src/components/table/SortableTable.tsx delete mode 100644 src/components/table/SortableTableGroup.js create mode 100644 src/components/table/SortableTableGroup.tsx delete mode 100644 src/components/table/SortableTableHeader.js create mode 100644 src/components/table/SortableTableHeader.tsx delete mode 100644 src/components/table/SortableTableRow.js create mode 100644 src/components/table/SortableTableRow.tsx delete mode 100644 src/components/table/TableAndPanelWrapper.js create mode 100644 src/components/table/TableAndPanelWrapper.tsx delete mode 100644 src/components/table/TableFilterWrapper.js create mode 100644 src/components/table/TableFilterWrapper.tsx delete mode 100644 src/components/table/TableFilters.js create mode 100644 src/components/table/TableFilters.tsx delete mode 100644 src/components/table/TablePanel.js create mode 100644 src/components/table/TablePanel.tsx delete mode 100644 src/components/table/TablePanelContainer.js create mode 100644 src/components/table/TablePanelContainer.tsx delete mode 100644 src/components/table/TableWrapper.js create mode 100644 src/components/table/TableWrapper.tsx delete mode 100644 src/components/table/VisualisationTypeWrapper.js create mode 100644 src/components/table/VisualisationTypeWrapper.tsx rename src/components/tabs/{TabContent.js => TabContent.ts} (67%) delete mode 100644 src/components/tabs/TabPane.js create mode 100644 src/components/tabs/TabPane.ts delete mode 100644 src/components/tabs/Tabs.js create mode 100644 src/components/tabs/Tabs.tsx delete mode 100644 src/components/toastr/ToastrIcons.js create mode 100644 src/components/toastr/ToastrIcons.tsx rename src/components/tooltip/{Tooltip.js => Tooltip.tsx} (60%) delete mode 100644 src/components/tooltip/TooltipToggleButton.js create mode 100644 src/components/tooltip/TooltipToggleButton.tsx delete mode 100644 src/components/tooltip/TooltipWrapper.js create mode 100644 src/components/tooltip/TooltipWrapper.tsx delete mode 100644 src/components/tooltip/UIDataTooltip.js create mode 100644 src/components/tooltip/UIDataTooltip.tsx delete mode 100644 src/components/tooltip/types.js create mode 100644 src/components/tooltip/types.ts delete mode 100644 src/components/topNavigation/TopNavigation.js create mode 100644 src/components/topNavigation/TopNavigation.tsx delete mode 100644 src/components/topNavigation/actions.js create mode 100644 src/components/topNavigation/actions.ts delete mode 100644 src/components/topNavigation/reducer.js create mode 100644 src/components/topNavigation/reducer.ts delete mode 100644 src/components/topNavigation/selectors.js create mode 100644 src/components/topNavigation/selectors.ts delete mode 100644 src/components/topNavigation/types.js create mode 100644 src/components/topNavigation/types.ts delete mode 100644 src/components/uiData/UiDataListHOC.js create mode 100644 src/components/uiData/UiDataListHOC.tsx delete mode 100644 src/components/vat/AmountWithVat.js create mode 100644 src/components/vat/AmountWithVat.tsx rename src/{constants.js => constants.ts} (75%) delete mode 100644 src/contacts/actions.js create mode 100644 src/contacts/actions.ts delete mode 100644 src/contacts/components/ContactAuditLog.js create mode 100644 src/contacts/components/ContactAuditLog.tsx delete mode 100644 src/contacts/components/ContactEdit.js create mode 100644 src/contacts/components/ContactEdit.tsx delete mode 100644 src/contacts/components/ContactModal.js create mode 100644 src/contacts/components/ContactModal.tsx delete mode 100644 src/contacts/components/ContactPage.js create mode 100644 src/contacts/components/ContactPage.tsx delete mode 100644 src/contacts/components/ContactReadonly.js create mode 100644 src/contacts/components/ContactReadonly.tsx delete mode 100644 src/contacts/components/ContactsListPage.js create mode 100644 src/contacts/components/ContactsListPage.tsx delete mode 100644 src/contacts/components/NewContactPage.js create mode 100644 src/contacts/components/NewContactPage.tsx delete mode 100644 src/contacts/components/forms/ContactForm.js create mode 100644 src/contacts/components/forms/ContactForm.tsx delete mode 100644 src/contacts/components/search/Search.js create mode 100644 src/contacts/components/search/Search.tsx rename src/contacts/components/templates/{ContactTemplate.js => ContactTemplate.tsx} (81%) rename src/contacts/{constants.js => constants.ts} (64%) rename src/contacts/{enums.js => enums.ts} (96%) rename src/contacts/{helpers.js => helpers.ts} (55%) rename src/contacts/{reducer.js => reducer.ts} (58%) rename src/contacts/{requests.js => requests.ts} (65%) delete mode 100644 src/contacts/requestsAsync.js create mode 100644 src/contacts/requestsAsync.ts rename src/contacts/{saga.js => saga.ts} (51%) delete mode 100644 src/contacts/selectors.js create mode 100644 src/contacts/selectors.ts rename src/contacts/{spec.js => spec.ts} (68%) delete mode 100644 src/contacts/types.js create mode 100644 src/contacts/types.ts delete mode 100644 src/contractFile/actions.js create mode 100644 src/contractFile/actions.ts delete mode 100644 src/contractFile/reducer.js create mode 100644 src/contractFile/reducer.ts delete mode 100644 src/contractFile/requests.js create mode 100644 src/contractFile/requests.ts delete mode 100644 src/contractFile/saga.js create mode 100644 src/contractFile/saga.ts delete mode 100644 src/contractFile/selectors.js create mode 100644 src/contractFile/selectors.ts rename src/contractFile/{spec.js => spec.ts} (56%) delete mode 100644 src/contractFile/types.js create mode 100644 src/contractFile/types.ts delete mode 100644 src/createCollectionLetter/actions.js create mode 100644 src/createCollectionLetter/actions.ts rename src/createCollectionLetter/{enums.js => enums.ts} (91%) rename src/createCollectionLetter/{reducer.js => reducer.ts} (54%) rename src/createCollectionLetter/{requests.js => requests.ts} (50%) delete mode 100644 src/createCollectionLetter/saga.js create mode 100644 src/createCollectionLetter/saga.ts delete mode 100644 src/createCollectionLetter/selectors.js create mode 100644 src/createCollectionLetter/selectors.ts rename src/createCollectionLetter/{spec.js => spec.ts} (55%) delete mode 100644 src/createCollectionLetter/types.js create mode 100644 src/createCollectionLetter/types.ts delete mode 100644 src/creditDecision/actions.js create mode 100644 src/creditDecision/actions.ts delete mode 100644 src/creditDecision/components/CreditDecisionHistory.js create mode 100644 src/creditDecision/components/CreditDecisionHistory.tsx delete mode 100644 src/creditDecision/components/CreditDecisionRequest.js create mode 100644 src/creditDecision/components/CreditDecisionRequest.tsx delete mode 100644 src/creditDecision/components/CreditDecisionSearchPage.js create mode 100644 src/creditDecision/components/CreditDecisionSearchPage.tsx delete mode 100644 src/creditDecision/components/CreditDecisionTemplate.js create mode 100644 src/creditDecision/components/CreditDecisionTemplate.tsx delete mode 100644 src/creditDecision/components/SearchForm.js create mode 100644 src/creditDecision/components/SearchForm.tsx rename src/creditDecision/components/{StatusText.js => StatusText.tsx} (63%) rename src/creditDecision/{enums.js => enums.ts} (90%) delete mode 100644 src/creditDecision/reducer.js create mode 100644 src/creditDecision/reducer.ts rename src/creditDecision/{requests.js => requests.ts} (75%) delete mode 100644 src/creditDecision/saga.js create mode 100644 src/creditDecision/saga.ts delete mode 100644 src/creditDecision/selectors.js create mode 100644 src/creditDecision/selectors.ts rename src/creditDecision/{spec.js => spec.ts} (55%) delete mode 100644 src/creditDecision/types.js create mode 100644 src/creditDecision/types.ts delete mode 100644 src/district/actions.js create mode 100644 src/district/actions.ts delete mode 100644 src/district/helpers.js create mode 100644 src/district/helpers.ts delete mode 100644 src/district/reducer.js create mode 100644 src/district/reducer.ts rename src/district/{requests.js => requests.ts} (56%) delete mode 100644 src/district/saga.js create mode 100644 src/district/saga.ts delete mode 100644 src/district/selectors.js create mode 100644 src/district/selectors.ts rename src/district/{spec.js => spec.ts} (50%) delete mode 100644 src/district/types.js create mode 100644 src/district/types.ts rename src/{enums.js => enums.tsx} (83%) delete mode 100644 src/errorPage/ErrorPage.js create mode 100644 src/errorPage/ErrorPage.tsx rename src/foundation/{enums.js => enums.ts} (88%) rename src/foundation/{reveal.js => reveal.tsx} (56%) rename src/foundation/{shapes.js => shapes.ts} (61%) rename src/foundation/{utils.js => utils.ts} (93%) delete mode 100644 src/index.js create mode 100644 src/index.ts delete mode 100644 src/index/actions.js create mode 100644 src/index/actions.ts delete mode 100644 src/index/components/IndexListPage.js create mode 100644 src/index/components/IndexListPage.tsx rename src/index/components/{IndexTable.js => IndexTable.tsx} (84%) delete mode 100644 src/index/helpers.js create mode 100644 src/index/helpers.ts delete mode 100644 src/index/reducer.js create mode 100644 src/index/reducer.ts delete mode 100644 src/index/requests.js create mode 100644 src/index/requests.ts delete mode 100644 src/index/saga.js create mode 100644 src/index/saga.ts delete mode 100644 src/index/selectors.js create mode 100644 src/index/selectors.ts rename src/index/{spec.js => spec.ts} (63%) delete mode 100644 src/index/types.js create mode 100644 src/index/types.ts delete mode 100644 src/infillDevelopment/actions.js create mode 100644 src/infillDevelopment/actions.ts delete mode 100644 src/infillDevelopment/components/InfillDevelopmentListPage.js create mode 100644 src/infillDevelopment/components/InfillDevelopmentListPage.tsx delete mode 100644 src/infillDevelopment/components/InfillDevelopmentPage.js create mode 100644 src/infillDevelopment/components/InfillDevelopmentPage.tsx delete mode 100644 src/infillDevelopment/components/NewInfillDevelopmentPage.js create mode 100644 src/infillDevelopment/components/NewInfillDevelopmentPage.tsx delete mode 100644 src/infillDevelopment/components/forms/InfillDevelopmentForm.js create mode 100644 src/infillDevelopment/components/forms/InfillDevelopmentForm.tsx delete mode 100644 src/infillDevelopment/components/forms/LeaseItemEdit.js create mode 100644 src/infillDevelopment/components/forms/LeaseItemEdit.tsx delete mode 100644 src/infillDevelopment/components/forms/LeaseItemsEdit.js create mode 100644 src/infillDevelopment/components/forms/LeaseItemsEdit.tsx delete mode 100644 src/infillDevelopment/components/search/Search.js create mode 100644 src/infillDevelopment/components/search/Search.tsx rename src/infillDevelopment/components/sections/basicInfo/{InfillDevelopmentTemplate.js => InfillDevelopmentTemplate.tsx} (67%) delete mode 100644 src/infillDevelopment/components/sections/basicInfo/LeaseInfo.js create mode 100644 src/infillDevelopment/components/sections/basicInfo/LeaseInfo.tsx rename src/infillDevelopment/components/sections/basicInfo/{LeaseItem.js => LeaseItem.tsx} (71%) rename src/infillDevelopment/components/sections/map/{InfillDevelopmentLeaseLayer.js => InfillDevelopmentLeaseLayer.tsx} (59%) delete mode 100644 src/infillDevelopment/components/sections/map/SingleInfillDevelopmentMap.js create mode 100644 src/infillDevelopment/components/sections/map/SingleInfillDevelopmentMap.tsx rename src/infillDevelopment/{constants.js => constants.ts} (69%) rename src/infillDevelopment/{enums.js => enums.ts} (95%) rename src/infillDevelopment/{helpers.js => helpers.ts} (71%) rename src/infillDevelopment/{reducer.js => reducer.ts} (56%) rename src/infillDevelopment/{requests.js => requests.ts} (72%) delete mode 100644 src/infillDevelopment/saga.js create mode 100644 src/infillDevelopment/saga.ts delete mode 100644 src/infillDevelopment/selectors.js create mode 100644 src/infillDevelopment/selectors.ts rename src/infillDevelopment/{spec.js => spec.ts} (63%) delete mode 100644 src/infillDevelopment/types.js create mode 100644 src/infillDevelopment/types.ts delete mode 100644 src/infillDevelopmentAttachment/actions.js create mode 100644 src/infillDevelopmentAttachment/actions.ts rename src/infillDevelopmentAttachment/{enums.js => enums.ts} (89%) rename src/infillDevelopmentAttachment/{reducer.js => reducer.ts} (61%) rename src/infillDevelopmentAttachment/{requests.js => requests.ts} (70%) delete mode 100644 src/infillDevelopmentAttachment/saga.js create mode 100644 src/infillDevelopmentAttachment/saga.ts delete mode 100644 src/infillDevelopmentAttachment/selectors.js create mode 100644 src/infillDevelopmentAttachment/selectors.ts rename src/infillDevelopmentAttachment/{spec.js => spec.ts} (70%) delete mode 100644 src/infillDevelopmentAttachment/types.js create mode 100644 src/infillDevelopmentAttachment/types.ts delete mode 100644 src/invoiceNote/actions.js create mode 100644 src/invoiceNote/actions.ts delete mode 100644 src/invoiceNote/components/CreateInvoiceNoteModal.js create mode 100644 src/invoiceNote/components/CreateInvoiceNoteModal.tsx delete mode 100644 src/invoiceNote/components/InvoiceNoteListPage.js create mode 100644 src/invoiceNote/components/InvoiceNoteListPage.tsx delete mode 100644 src/invoiceNote/components/Search.js create mode 100644 src/invoiceNote/components/Search.tsx rename src/invoiceNote/{enums.js => enums.ts} (91%) rename src/invoiceNote/{reducer.js => reducer.ts} (54%) delete mode 100644 src/invoiceNote/requests.js create mode 100644 src/invoiceNote/requests.ts delete mode 100644 src/invoiceNote/saga.js create mode 100644 src/invoiceNote/saga.ts delete mode 100644 src/invoiceNote/selectors.js create mode 100644 src/invoiceNote/selectors.ts rename src/invoiceNote/{spec.js => spec.ts} (63%) delete mode 100644 src/invoiceNote/types.js create mode 100644 src/invoiceNote/types.ts delete mode 100644 src/invoiceSets/actions.js create mode 100644 src/invoiceSets/actions.ts delete mode 100644 src/invoiceSets/helpers.js create mode 100644 src/invoiceSets/helpers.ts delete mode 100644 src/invoiceSets/reducer.js create mode 100644 src/invoiceSets/reducer.ts rename src/invoiceSets/{requests.js => requests.ts} (53%) delete mode 100644 src/invoiceSets/saga.js create mode 100644 src/invoiceSets/saga.ts delete mode 100644 src/invoiceSets/selectors.js create mode 100644 src/invoiceSets/selectors.ts rename src/invoiceSets/{spec.js => spec.ts} (59%) delete mode 100644 src/invoiceSets/types.js create mode 100644 src/invoiceSets/types.ts delete mode 100644 src/invoices/actions.js create mode 100644 src/invoices/actions.ts rename src/invoices/{enums.js => enums.ts} (90%) rename src/invoices/{helpers.js => helpers.ts} (57%) delete mode 100644 src/invoices/reducer.js create mode 100644 src/invoices/reducer.ts rename src/invoices/{requests.js => requests.ts} (63%) delete mode 100644 src/invoices/saga.js create mode 100644 src/invoices/saga.ts delete mode 100644 src/invoices/selectors.js create mode 100644 src/invoices/selectors.ts rename src/invoices/{spec.js => spec.ts} (63%) delete mode 100644 src/invoices/types.js create mode 100644 src/invoices/types.ts delete mode 100644 src/landUseAgreementAttachment/actions.js create mode 100644 src/landUseAgreementAttachment/actions.ts rename src/landUseAgreementAttachment/{enums.js => enums.ts} (88%) rename src/landUseAgreementAttachment/{reducer.js => reducer.ts} (56%) rename src/landUseAgreementAttachment/{requests.js => requests.ts} (70%) delete mode 100644 src/landUseAgreementAttachment/saga.js create mode 100644 src/landUseAgreementAttachment/saga.ts delete mode 100644 src/landUseAgreementAttachment/selectors.js create mode 100644 src/landUseAgreementAttachment/selectors.ts rename src/landUseAgreementAttachment/{spec.js => spec.ts} (70%) delete mode 100644 src/landUseAgreementAttachment/types.js create mode 100644 src/landUseAgreementAttachment/types.ts delete mode 100644 src/landUseContract/actions.js create mode 100644 src/landUseContract/actions.ts delete mode 100644 src/landUseContract/components/LandUseContractListPage.js create mode 100644 src/landUseContract/components/LandUseContractListPage.tsx delete mode 100644 src/landUseContract/components/LandUseContractPage.js create mode 100644 src/landUseContract/components/LandUseContractPage.tsx delete mode 100644 src/landUseContract/components/createLandUseContract/CreateLandUseContractForm.js create mode 100644 src/landUseContract/components/createLandUseContract/CreateLandUseContractForm.tsx delete mode 100644 src/landUseContract/components/createLandUseContract/CreateLandUseContractModal.js create mode 100644 src/landUseContract/components/createLandUseContract/CreateLandUseContractModal.tsx delete mode 100644 src/landUseContract/components/search/Search.js create mode 100644 src/landUseContract/components/search/Search.tsx delete mode 100644 src/landUseContract/components/sections/AddressItemEdit.js create mode 100644 src/landUseContract/components/sections/AddressItemEdit.tsx rename src/landUseContract/components/sections/{BasicInformation.js => BasicInformation.tsx} (69%) delete mode 100644 src/landUseContract/components/sections/BasicInformationEdit.js create mode 100644 src/landUseContract/components/sections/BasicInformationEdit.tsx delete mode 100644 src/landUseContract/components/sections/Changes.js create mode 100644 src/landUseContract/components/sections/Changes.tsx rename src/landUseContract/components/sections/{Compensations.js => Compensations.tsx} (79%) delete mode 100644 src/landUseContract/components/sections/CompensationsEdit.js create mode 100644 src/landUseContract/components/sections/CompensationsEdit.tsx delete mode 100644 src/landUseContract/components/sections/ConditionItemEdit.js create mode 100644 src/landUseContract/components/sections/ConditionItemEdit.tsx rename src/landUseContract/components/sections/{Conditions.js => Conditions.tsx} (56%) delete mode 100644 src/landUseContract/components/sections/ConditionsEdit.js create mode 100644 src/landUseContract/components/sections/ConditionsEdit.tsx delete mode 100644 src/landUseContract/components/sections/ContractItem.js create mode 100644 src/landUseContract/components/sections/ContractItem.tsx delete mode 100644 src/landUseContract/components/sections/ContractItemEdit.js create mode 100644 src/landUseContract/components/sections/ContractItemEdit.tsx delete mode 100644 src/landUseContract/components/sections/Contracts.js create mode 100644 src/landUseContract/components/sections/Contracts.tsx delete mode 100644 src/landUseContract/components/sections/ContractsEdit.js create mode 100644 src/landUseContract/components/sections/ContractsEdit.tsx delete mode 100644 src/landUseContract/components/sections/CreateAndCreditInvoiceR.js create mode 100644 src/landUseContract/components/sections/CreateAndCreditInvoiceR.tsx delete mode 100644 src/landUseContract/components/sections/DecisionConditions.js create mode 100644 src/landUseContract/components/sections/DecisionConditions.tsx delete mode 100644 src/landUseContract/components/sections/DecisionItem.js create mode 100644 src/landUseContract/components/sections/DecisionItem.tsx delete mode 100644 src/landUseContract/components/sections/DecisionItemEdit.js create mode 100644 src/landUseContract/components/sections/DecisionItemEdit.tsx delete mode 100644 src/landUseContract/components/sections/Decisions.js create mode 100644 src/landUseContract/components/sections/Decisions.tsx delete mode 100644 src/landUseContract/components/sections/DecisionsEdit.js create mode 100644 src/landUseContract/components/sections/DecisionsEdit.tsx delete mode 100644 src/landUseContract/components/sections/InvoiceNotesR.js create mode 100644 src/landUseContract/components/sections/InvoiceNotesR.tsx delete mode 100644 src/landUseContract/components/sections/InvoicePanelR.js create mode 100644 src/landUseContract/components/sections/InvoicePanelR.tsx delete mode 100644 src/landUseContract/components/sections/InvoiceTableAndPanelR.js create mode 100644 src/landUseContract/components/sections/InvoiceTableAndPanelR.tsx rename src/landUseContract/components/sections/{InvoiceTemplateR.js => InvoiceTemplateR.tsx} (67%) rename src/landUseContract/components/sections/{Invoices.js => Invoices.tsx} (53%) delete mode 100644 src/landUseContract/components/sections/InvoicesEdit.js create mode 100644 src/landUseContract/components/sections/InvoicesEdit.tsx delete mode 100644 src/landUseContract/components/sections/InvoicesR.js create mode 100644 src/landUseContract/components/sections/InvoicesR.tsx delete mode 100644 src/landUseContract/components/sections/LandUseContractMap.js create mode 100644 src/landUseContract/components/sections/LandUseContractMap.tsx delete mode 100644 src/landUseContract/components/sections/Litigant.js create mode 100644 src/landUseContract/components/sections/Litigant.tsx delete mode 100644 src/landUseContract/components/sections/LitigantBillingPerson.js create mode 100644 src/landUseContract/components/sections/LitigantBillingPerson.tsx delete mode 100644 src/landUseContract/components/sections/LitigantBillingPersonEdit.js create mode 100644 src/landUseContract/components/sections/LitigantBillingPersonEdit.tsx delete mode 100644 src/landUseContract/components/sections/LitigantItem.js create mode 100644 src/landUseContract/components/sections/LitigantItem.tsx delete mode 100644 src/landUseContract/components/sections/LitigantItemEdit.js create mode 100644 src/landUseContract/components/sections/LitigantItemEdit.tsx delete mode 100644 src/landUseContract/components/sections/Litigants.js create mode 100644 src/landUseContract/components/sections/Litigants.tsx delete mode 100644 src/landUseContract/components/sections/LitigantsEdit.js create mode 100644 src/landUseContract/components/sections/LitigantsEdit.tsx delete mode 100644 src/landUseContract/components/sections/UnitPricesUsedInCalculations.js create mode 100644 src/landUseContract/components/sections/UnitPricesUsedInCalculations.tsx rename src/landUseContract/components/sections/{Warrants.js => Warrants.tsx} (57%) delete mode 100644 src/landUseContract/components/sections/forms/CreditInvoiceForm.js create mode 100644 src/landUseContract/components/sections/forms/CreditInvoiceForm.tsx delete mode 100644 src/landUseContract/components/sections/forms/EditInvoiceForm.js create mode 100644 src/landUseContract/components/sections/forms/EditInvoiceForm.tsx rename src/landUseContract/components/sections/forms/{InvoiceRows.js => InvoiceRows.tsx} (69%) delete mode 100644 src/landUseContract/components/sections/forms/InvoiceRowsEdit.js create mode 100644 src/landUseContract/components/sections/forms/InvoiceRowsEdit.tsx delete mode 100644 src/landUseContract/components/sections/forms/NewInvoiceForm.js create mode 100644 src/landUseContract/components/sections/forms/NewInvoiceForm.tsx delete mode 100644 src/landUseContract/constants.js create mode 100644 src/landUseContract/constants.ts rename src/landUseContract/{enums.js => enums.ts} (81%) rename src/landUseContract/{formValidators.js => formValidators.ts} (59%) rename src/landUseContract/{helpers.js => helpers.ts} (63%) rename src/landUseContract/{reducer.js => reducer.ts} (60%) rename src/landUseContract/{requests.js => requests.ts} (73%) delete mode 100644 src/landUseContract/requestsAsync.js create mode 100644 src/landUseContract/requestsAsync.ts delete mode 100644 src/landUseContract/saga.js create mode 100644 src/landUseContract/saga.ts delete mode 100644 src/landUseContract/selectors.js create mode 100644 src/landUseContract/selectors.ts rename src/landUseContract/{spec.js => spec.ts} (70%) delete mode 100644 src/landUseContract/types.js create mode 100644 src/landUseContract/types.ts delete mode 100644 src/landUseInvoices/actions.js create mode 100644 src/landUseInvoices/actions.ts rename src/landUseInvoices/{enums.js => enums.ts} (91%) rename src/landUseInvoices/{helpers.js => helpers.ts} (59%) rename src/landUseInvoices/{reducer.js => reducer.ts} (55%) rename src/landUseInvoices/{requests.js => requests.ts} (69%) delete mode 100644 src/landUseInvoices/saga.js create mode 100644 src/landUseInvoices/saga.ts delete mode 100644 src/landUseInvoices/selectors.js create mode 100644 src/landUseInvoices/selectors.ts rename src/landUseInvoices/{spec.js => spec.ts} (61%) delete mode 100644 src/landUseInvoices/types.js create mode 100644 src/landUseInvoices/types.ts delete mode 100644 src/leaseAreaAttachment/actions.js create mode 100644 src/leaseAreaAttachment/actions.ts rename src/leaseAreaAttachment/{enums.js => enums.ts} (77%) rename src/leaseAreaAttachment/{requests.js => requests.ts} (68%) delete mode 100644 src/leaseAreaAttachment/saga.js create mode 100644 src/leaseAreaAttachment/saga.ts delete mode 100644 src/leaseAreaAttachment/types.js create mode 100644 src/leaseAreaAttachment/types.ts delete mode 100644 src/leaseCreateCharge/actions.js create mode 100644 src/leaseCreateCharge/actions.ts rename src/leaseCreateCharge/{enums.js => enums.ts} (84%) rename src/leaseCreateCharge/{helpers.js => helpers.ts} (56%) rename src/leaseCreateCharge/{reducer.js => reducer.ts} (52%) delete mode 100644 src/leaseCreateCharge/requests.js create mode 100644 src/leaseCreateCharge/requests.ts rename src/leaseCreateCharge/{saga.js => saga.ts} (54%) delete mode 100644 src/leaseCreateCharge/selectors.js create mode 100644 src/leaseCreateCharge/selectors.ts delete mode 100644 src/leaseCreateCharge/spec.js create mode 100644 src/leaseCreateCharge/spec.ts delete mode 100644 src/leaseCreateCharge/types.js create mode 100644 src/leaseCreateCharge/types.ts delete mode 100644 src/leaseInspectionAttachment/actions.js create mode 100644 src/leaseInspectionAttachment/actions.ts rename src/leaseInspectionAttachment/{requests.js => requests.ts} (68%) delete mode 100644 src/leaseInspectionAttachment/saga.js create mode 100644 src/leaseInspectionAttachment/saga.ts delete mode 100644 src/leaseInspectionAttachment/types.js create mode 100644 src/leaseInspectionAttachment/types.ts delete mode 100644 src/leaseStatisticReport/actions.js create mode 100644 src/leaseStatisticReport/actions.ts delete mode 100644 src/leaseStatisticReport/components/LeaseInvoicingConfirmationReport.js create mode 100644 src/leaseStatisticReport/components/LeaseInvoicingConfirmationReport.tsx delete mode 100644 src/leaseStatisticReport/components/LeaseStatisticReportForm.js create mode 100644 src/leaseStatisticReport/components/LeaseStatisticReportForm.tsx delete mode 100644 src/leaseStatisticReport/components/LeaseStatisticReportPage.js create mode 100644 src/leaseStatisticReport/components/LeaseStatisticReportPage.tsx rename src/leaseStatisticReport/{enums.js => enums.ts} (94%) rename src/leaseStatisticReport/{helpers.js => helpers.ts} (55%) rename src/leaseStatisticReport/{reducer.js => reducer.ts} (63%) rename src/leaseStatisticReport/{requests.js => requests.ts} (50%) delete mode 100644 src/leaseStatisticReport/saga.js create mode 100644 src/leaseStatisticReport/saga.ts delete mode 100644 src/leaseStatisticReport/selectors.js create mode 100644 src/leaseStatisticReport/selectors.ts rename src/leaseStatisticReport/{spec.js => spec.ts} (59%) delete mode 100644 src/leaseStatisticReport/types.js create mode 100644 src/leaseStatisticReport/types.ts delete mode 100644 src/leaseType/actions.js create mode 100644 src/leaseType/actions.ts delete mode 100644 src/leaseType/reducer.js create mode 100644 src/leaseType/reducer.ts rename src/leaseType/{requests.js => requests.ts} (59%) delete mode 100644 src/leaseType/saga.js create mode 100644 src/leaseType/saga.ts delete mode 100644 src/leaseType/selectors.js create mode 100644 src/leaseType/selectors.ts rename src/leaseType/{spec.js => spec.ts} (67%) delete mode 100644 src/leaseType/types.js create mode 100644 src/leaseType/types.ts delete mode 100644 src/leaseholdTransfer/actions.js create mode 100644 src/leaseholdTransfer/actions.ts delete mode 100644 src/leaseholdTransfer/components/LeaseholdTransferListPage.js create mode 100644 src/leaseholdTransfer/components/LeaseholdTransferListPage.tsx delete mode 100644 src/leaseholdTransfer/components/search/Search.js create mode 100644 src/leaseholdTransfer/components/search/Search.tsx rename src/leaseholdTransfer/{constants.js => constants.ts} (67%) rename src/leaseholdTransfer/{enums.js => enums.ts} (90%) delete mode 100644 src/leaseholdTransfer/helpers.js create mode 100644 src/leaseholdTransfer/helpers.ts rename src/leaseholdTransfer/{reducer.js => reducer.ts} (55%) rename src/leaseholdTransfer/{requests.js => requests.ts} (57%) delete mode 100644 src/leaseholdTransfer/saga.js create mode 100644 src/leaseholdTransfer/saga.ts delete mode 100644 src/leaseholdTransfer/selectors.js create mode 100644 src/leaseholdTransfer/selectors.ts rename src/leaseholdTransfer/{spec.js => spec.ts} (64%) delete mode 100644 src/leaseholdTransfer/types.js create mode 100644 src/leaseholdTransfer/types.ts delete mode 100644 src/leases/actions.js create mode 100644 src/leases/actions.ts delete mode 100644 src/leases/components/LeaseListPage.js create mode 100644 src/leases/components/LeaseListPage.tsx delete mode 100644 src/leases/components/LeasePage.js create mode 100644 src/leases/components/LeasePage.tsx delete mode 100644 src/leases/components/createLease/CreateLeaseForm.js create mode 100644 src/leases/components/createLease/CreateLeaseForm.tsx delete mode 100644 src/leases/components/createLease/CreateLeaseModal.js create mode 100644 src/leases/components/createLease/CreateLeaseModal.tsx delete mode 100644 src/leases/components/leaseSections/auditLog/LeaseAuditLog.js create mode 100644 src/leases/components/leaseSections/auditLog/LeaseAuditLog.tsx delete mode 100644 src/leases/components/leaseSections/comments/Comment.js create mode 100644 src/leases/components/leaseSections/comments/Comment.tsx delete mode 100644 src/leases/components/leaseSections/comments/CommentPanel.js create mode 100644 src/leases/components/leaseSections/comments/CommentPanel.tsx delete mode 100644 src/leases/components/leaseSections/comments/NewCommentForm.js create mode 100644 src/leases/components/leaseSections/comments/NewCommentForm.tsx delete mode 100644 src/leases/components/leaseSections/constructability/Comment.js create mode 100644 src/leases/components/leaseSections/constructability/Comment.tsx delete mode 100644 src/leases/components/leaseSections/constructability/Comments.js create mode 100644 src/leases/components/leaseSections/constructability/Comments.tsx delete mode 100644 src/leases/components/leaseSections/constructability/Constructability.js create mode 100644 src/leases/components/leaseSections/constructability/Constructability.tsx delete mode 100644 src/leases/components/leaseSections/constructability/ConstructabilityEdit.js create mode 100644 src/leases/components/leaseSections/constructability/ConstructabilityEdit.tsx rename src/leases/components/leaseSections/constructability/{ConstructabilityItem.js => ConstructabilityItem.tsx} (67%) delete mode 100644 src/leases/components/leaseSections/constructability/ConstructabilityItemEdit.js create mode 100644 src/leases/components/leaseSections/constructability/ConstructabilityItemEdit.tsx delete mode 100644 src/leases/components/leaseSections/constructability/SendEmail.js create mode 100644 src/leases/components/leaseSections/constructability/SendEmail.tsx delete mode 100644 src/leases/components/leaseSections/constructability/SendEmailModal.js create mode 100644 src/leases/components/leaseSections/constructability/SendEmailModal.tsx delete mode 100644 src/leases/components/leaseSections/constructability/StatusIndicator.js create mode 100644 src/leases/components/leaseSections/constructability/StatusIndicator.tsx delete mode 100644 src/leases/components/leaseSections/contract/AttachDecisionModal.js create mode 100644 src/leases/components/leaseSections/contract/AttachDecisionModal.tsx rename src/leases/components/leaseSections/contract/{Collateral.js => Collateral.tsx} (80%) delete mode 100644 src/leases/components/leaseSections/contract/CollateralEdit.js create mode 100644 src/leases/components/leaseSections/contract/CollateralEdit.tsx delete mode 100644 src/leases/components/leaseSections/contract/ContractFileModal.js create mode 100644 src/leases/components/leaseSections/contract/ContractFileModal.tsx rename src/leases/components/leaseSections/contract/{ContractItem.js => ContractItem.tsx} (66%) delete mode 100644 src/leases/components/leaseSections/contract/ContractItemEdit.js create mode 100644 src/leases/components/leaseSections/contract/ContractItemEdit.tsx delete mode 100644 src/leases/components/leaseSections/contract/Contracts.js create mode 100644 src/leases/components/leaseSections/contract/Contracts.tsx delete mode 100644 src/leases/components/leaseSections/contract/ContractsEdit.js create mode 100644 src/leases/components/leaseSections/contract/ContractsEdit.tsx delete mode 100644 src/leases/components/leaseSections/contract/DecisionConditionsEdit.js create mode 100644 src/leases/components/leaseSections/contract/DecisionConditionsEdit.tsx rename src/leases/components/leaseSections/contract/{DecisionItem.js => DecisionItem.tsx} (68%) delete mode 100644 src/leases/components/leaseSections/contract/DecisionItemEdit.js create mode 100644 src/leases/components/leaseSections/contract/DecisionItemEdit.tsx delete mode 100644 src/leases/components/leaseSections/contract/Decisions.js create mode 100644 src/leases/components/leaseSections/contract/Decisions.tsx delete mode 100644 src/leases/components/leaseSections/contract/DecisionsEdit.js create mode 100644 src/leases/components/leaseSections/contract/DecisionsEdit.tsx delete mode 100644 src/leases/components/leaseSections/contract/DecisionsMain.js create mode 100644 src/leases/components/leaseSections/contract/DecisionsMain.tsx delete mode 100644 src/leases/components/leaseSections/contract/DecisionsMainEdit.js create mode 100644 src/leases/components/leaseSections/contract/DecisionsMainEdit.tsx rename src/leases/components/leaseSections/contract/{InspectionItem.js => InspectionItem.tsx} (68%) delete mode 100644 src/leases/components/leaseSections/contract/InspectionItemEdit.js create mode 100644 src/leases/components/leaseSections/contract/InspectionItemEdit.tsx delete mode 100644 src/leases/components/leaseSections/contract/Inspections.js create mode 100644 src/leases/components/leaseSections/contract/Inspections.tsx delete mode 100644 src/leases/components/leaseSections/contract/InspectionsEdit.js create mode 100644 src/leases/components/leaseSections/contract/InspectionsEdit.tsx delete mode 100644 src/leases/components/leaseSections/invoice/CollectionCourtDecisionPanel.js create mode 100644 src/leases/components/leaseSections/invoice/CollectionCourtDecisionPanel.tsx delete mode 100644 src/leases/components/leaseSections/invoice/CreateAndCreditInvoice.js create mode 100644 src/leases/components/leaseSections/invoice/CreateAndCreditInvoice.tsx delete mode 100644 src/leases/components/leaseSections/invoice/CreateCollectionLetter.js create mode 100644 src/leases/components/leaseSections/invoice/CreateCollectionLetter.tsx delete mode 100644 src/leases/components/leaseSections/invoice/DebtCollection.js create mode 100644 src/leases/components/leaseSections/invoice/DebtCollection.tsx delete mode 100644 src/leases/components/leaseSections/invoice/InvoiceNotes.js create mode 100644 src/leases/components/leaseSections/invoice/InvoiceNotes.tsx delete mode 100644 src/leases/components/leaseSections/invoice/InvoicePanel.js create mode 100644 src/leases/components/leaseSections/invoice/InvoicePanel.tsx delete mode 100644 src/leases/components/leaseSections/invoice/InvoiceTableAndPanel.js create mode 100644 src/leases/components/leaseSections/invoice/InvoiceTableAndPanel.tsx rename src/leases/components/leaseSections/invoice/{InvoiceTemplate.js => InvoiceTemplate.tsx} (67%) delete mode 100644 src/leases/components/leaseSections/invoice/Invoices.js create mode 100644 src/leases/components/leaseSections/invoice/Invoices.tsx delete mode 100644 src/leases/components/leaseSections/invoice/forms/CollectionLetterInvoiceRow.js create mode 100644 src/leases/components/leaseSections/invoice/forms/CollectionLetterInvoiceRow.tsx delete mode 100644 src/leases/components/leaseSections/invoice/forms/CollectionLetterTotalRow.js create mode 100644 src/leases/components/leaseSections/invoice/forms/CollectionLetterTotalRow.tsx delete mode 100644 src/leases/components/leaseSections/invoice/forms/CreateCollectionLetterForm.js create mode 100644 src/leases/components/leaseSections/invoice/forms/CreateCollectionLetterForm.tsx delete mode 100644 src/leases/components/leaseSections/invoice/forms/CreditInvoiceForm.js create mode 100644 src/leases/components/leaseSections/invoice/forms/CreditInvoiceForm.tsx delete mode 100644 src/leases/components/leaseSections/invoice/forms/DebtCollectionForm.js create mode 100644 src/leases/components/leaseSections/invoice/forms/DebtCollectionForm.tsx delete mode 100644 src/leases/components/leaseSections/invoice/forms/EditInvoiceForm.js create mode 100644 src/leases/components/leaseSections/invoice/forms/EditInvoiceForm.tsx rename src/leases/components/leaseSections/invoice/forms/{InvoiceRows.js => InvoiceRows.tsx} (69%) delete mode 100644 src/leases/components/leaseSections/invoice/forms/InvoiceRowsEdit.js create mode 100644 src/leases/components/leaseSections/invoice/forms/InvoiceRowsEdit.tsx delete mode 100644 src/leases/components/leaseSections/invoice/forms/NewCollectionNote.js create mode 100644 src/leases/components/leaseSections/invoice/forms/NewCollectionNote.tsx delete mode 100644 src/leases/components/leaseSections/invoice/forms/NewInvoiceForm.js create mode 100644 src/leases/components/leaseSections/invoice/forms/NewInvoiceForm.tsx delete mode 100644 src/leases/components/leaseSections/leaseArea/ArchiveAreaModal.js create mode 100644 src/leases/components/leaseSections/leaseArea/ArchiveAreaModal.tsx rename src/leases/components/leaseSections/leaseArea/{CustomDetailedPlan.js => CustomDetailedPlan.tsx} (83%) delete mode 100644 src/leases/components/leaseSections/leaseArea/CustomDetailedPlanEdit.js create mode 100644 src/leases/components/leaseSections/leaseArea/CustomDetailedPlanEdit.tsx rename src/leases/components/leaseSections/leaseArea/{LeaseArea.js => LeaseArea.tsx} (52%) delete mode 100644 src/leases/components/leaseSections/leaseArea/LeaseAreaEdit.js create mode 100644 src/leases/components/leaseSections/leaseArea/LeaseAreaEdit.tsx rename src/leases/components/leaseSections/leaseArea/{LeaseAreaWithArchiceInfo.js => LeaseAreaWithArchiceInfo.tsx} (56%) delete mode 100644 src/leases/components/leaseSections/leaseArea/LeaseAreaWithArchiveInfoEdit.js create mode 100644 src/leases/components/leaseSections/leaseArea/LeaseAreaWithArchiveInfoEdit.tsx delete mode 100644 src/leases/components/leaseSections/leaseArea/LeaseAreas.js create mode 100644 src/leases/components/leaseSections/leaseArea/LeaseAreas.tsx delete mode 100644 src/leases/components/leaseSections/leaseArea/LeaseAreasEdit.js create mode 100644 src/leases/components/leaseSections/leaseArea/LeaseAreasEdit.tsx rename src/leases/components/leaseSections/leaseArea/{PlanUnitItem.js => PlanUnitItem.tsx} (76%) delete mode 100644 src/leases/components/leaseSections/leaseArea/PlanUnitItemEdit.js create mode 100644 src/leases/components/leaseSections/leaseArea/PlanUnitItemEdit.tsx rename src/leases/components/leaseSections/leaseArea/{PlotItem.js => PlotItem.tsx} (52%) delete mode 100644 src/leases/components/leaseSections/leaseArea/PlotItemEdit.js create mode 100644 src/leases/components/leaseSections/leaseArea/PlotItemEdit.tsx rename src/leases/components/leaseSections/leaseInfo/{LeaseInfo.js => LeaseInfo.tsx} (72%) delete mode 100644 src/leases/components/leaseSections/map/AreasLayer.js create mode 100644 src/leases/components/leaseSections/map/AreasLayer.tsx delete mode 100644 src/leases/components/leaseSections/map/LeaseListLayer.js create mode 100644 src/leases/components/leaseSections/map/LeaseListLayer.tsx delete mode 100644 src/leases/components/leaseSections/map/LeaseListMap.js create mode 100644 src/leases/components/leaseSections/map/LeaseListMap.tsx delete mode 100644 src/leases/components/leaseSections/map/PlanUnitsLayer.js create mode 100644 src/leases/components/leaseSections/map/PlanUnitsLayer.tsx delete mode 100644 src/leases/components/leaseSections/map/PlotsLayer.js create mode 100644 src/leases/components/leaseSections/map/PlotsLayer.tsx delete mode 100644 src/leases/components/leaseSections/map/SingleLeaseMap.js create mode 100644 src/leases/components/leaseSections/map/SingleLeaseMap.tsx rename src/leases/components/leaseSections/rent/{BasicInfo.js => BasicInfo.tsx} (74%) delete mode 100644 src/leases/components/leaseSections/rent/BasicInfoEdit.js create mode 100644 src/leases/components/leaseSections/rent/BasicInfoEdit.tsx rename src/leases/components/leaseSections/rent/{BasisOfRent.js => BasisOfRent.tsx} (71%) delete mode 100644 src/leases/components/leaseSections/rent/BasisOfRentEdit.js create mode 100644 src/leases/components/leaseSections/rent/BasisOfRentEdit.tsx delete mode 100644 src/leases/components/leaseSections/rent/BasisOfRentManagementSubventionEdit.js create mode 100644 src/leases/components/leaseSections/rent/BasisOfRentManagementSubventionEdit.tsx delete mode 100644 src/leases/components/leaseSections/rent/BasisOfRentTemporarySubventionEdit.js create mode 100644 src/leases/components/leaseSections/rent/BasisOfRentTemporarySubventionEdit.tsx delete mode 100644 src/leases/components/leaseSections/rent/BasisOfRents.js create mode 100644 src/leases/components/leaseSections/rent/BasisOfRents.tsx delete mode 100644 src/leases/components/leaseSections/rent/BasisOfRentsEdit.js create mode 100644 src/leases/components/leaseSections/rent/BasisOfRentsEdit.tsx rename src/leases/components/leaseSections/rent/{CalculateRentTotal.js => CalculateRentTotal.tsx} (62%) delete mode 100644 src/leases/components/leaseSections/rent/ContractRentEdit.js create mode 100644 src/leases/components/leaseSections/rent/ContractRentEdit.tsx rename src/leases/components/leaseSections/rent/{ContractRents.js => ContractRents.tsx} (66%) delete mode 100644 src/leases/components/leaseSections/rent/ContractRentsEdit.js create mode 100644 src/leases/components/leaseSections/rent/ContractRentsEdit.tsx delete mode 100644 src/leases/components/leaseSections/rent/EqualizedRents.js create mode 100644 src/leases/components/leaseSections/rent/EqualizedRents.tsx rename src/leases/components/leaseSections/rent/{FixedInitialYearRents.js => FixedInitialYearRents.tsx} (73%) delete mode 100644 src/leases/components/leaseSections/rent/FixedInitialYearRentsEdit.js create mode 100644 src/leases/components/leaseSections/rent/FixedInitialYearRentsEdit.tsx delete mode 100644 src/leases/components/leaseSections/rent/IndexAdjustedRents.js create mode 100644 src/leases/components/leaseSections/rent/IndexAdjustedRents.tsx delete mode 100644 src/leases/components/leaseSections/rent/MastChildrenEdit.js create mode 100644 src/leases/components/leaseSections/rent/MastChildrenEdit.tsx delete mode 100644 src/leases/components/leaseSections/rent/PayableRents.js create mode 100644 src/leases/components/leaseSections/rent/PayableRents.tsx delete mode 100644 src/leases/components/leaseSections/rent/RentAdjustmentEdit.js create mode 100644 src/leases/components/leaseSections/rent/RentAdjustmentEdit.tsx delete mode 100644 src/leases/components/leaseSections/rent/RentAdjustmentManagementSubventionEdit.js create mode 100644 src/leases/components/leaseSections/rent/RentAdjustmentManagementSubventionEdit.tsx delete mode 100644 src/leases/components/leaseSections/rent/RentAdjustmentTemporarySubventionEdit.js create mode 100644 src/leases/components/leaseSections/rent/RentAdjustmentTemporarySubventionEdit.tsx rename src/leases/components/leaseSections/rent/{RentAdjustments.js => RentAdjustments.tsx} (70%) delete mode 100644 src/leases/components/leaseSections/rent/RentAdjustmentsEdit.js create mode 100644 src/leases/components/leaseSections/rent/RentAdjustmentsEdit.tsx delete mode 100644 src/leases/components/leaseSections/rent/RentItem.js create mode 100644 src/leases/components/leaseSections/rent/RentItem.tsx delete mode 100644 src/leases/components/leaseSections/rent/RentItemEdit.js create mode 100644 src/leases/components/leaseSections/rent/RentItemEdit.tsx delete mode 100644 src/leases/components/leaseSections/rent/Rents.js create mode 100644 src/leases/components/leaseSections/rent/Rents.tsx delete mode 100644 src/leases/components/leaseSections/rent/RentsEdit.js create mode 100644 src/leases/components/leaseSections/rent/RentsEdit.tsx delete mode 100644 src/leases/components/leaseSections/rent/SteppedDiscountForm.js create mode 100644 src/leases/components/leaseSections/rent/SteppedDiscountForm.tsx delete mode 100644 src/leases/components/leaseSections/rent/SteppedDiscountModal.js create mode 100644 src/leases/components/leaseSections/rent/SteppedDiscountModal.tsx rename src/leases/components/leaseSections/summary/{LeaseHistory.js => LeaseHistory.tsx} (56%) delete mode 100644 src/leases/components/leaseSections/summary/LeaseHistoryEdit.js create mode 100644 src/leases/components/leaseSections/summary/LeaseHistoryEdit.tsx delete mode 100644 src/leases/components/leaseSections/summary/LeaseHistoryItem.js create mode 100644 src/leases/components/leaseSections/summary/LeaseHistoryItem.tsx rename src/leases/components/leaseSections/summary/{Summary.js => Summary.tsx} (73%) delete mode 100644 src/leases/components/leaseSections/summary/SummaryEdit.js create mode 100644 src/leases/components/leaseSections/summary/SummaryEdit.tsx rename src/leases/components/leaseSections/summary/{SummaryLeaseInfo.js => SummaryLeaseInfo.tsx} (57%) rename src/leases/components/leaseSections/tenant/{OtherTenantItem.js => OtherTenantItem.tsx} (52%) delete mode 100644 src/leases/components/leaseSections/tenant/OtherTenantItemEdit.js create mode 100644 src/leases/components/leaseSections/tenant/OtherTenantItemEdit.tsx delete mode 100644 src/leases/components/leaseSections/tenant/Tenant.js create mode 100644 src/leases/components/leaseSections/tenant/Tenant.tsx rename src/leases/components/leaseSections/tenant/{TenantItem.js => TenantItem.tsx} (64%) delete mode 100644 src/leases/components/leaseSections/tenant/TenantItemEdit.js create mode 100644 src/leases/components/leaseSections/tenant/TenantItemEdit.tsx delete mode 100644 src/leases/components/leaseSections/tenant/Tenants.js create mode 100644 src/leases/components/leaseSections/tenant/Tenants.tsx delete mode 100644 src/leases/components/leaseSections/tenant/TenantsEdit.js create mode 100644 src/leases/components/leaseSections/tenant/TenantsEdit.tsx delete mode 100644 src/leases/components/search/Search.js create mode 100644 src/leases/components/search/Search.tsx delete mode 100644 src/leases/constants.js create mode 100644 src/leases/constants.ts rename src/leases/{enums.js => enums.ts} (93%) rename src/leases/{formValidators.js => formValidators.ts} (53%) rename src/leases/{helpers.js => helpers.ts} (52%) rename src/leases/{reducer.js => reducer.ts} (57%) rename src/leases/{requests.js => requests.ts} (69%) delete mode 100644 src/leases/requestsAsync.js create mode 100644 src/leases/requestsAsync.ts delete mode 100644 src/leases/saga.js create mode 100644 src/leases/saga.ts delete mode 100644 src/leases/selectors.js create mode 100644 src/leases/selectors.ts rename src/leases/{spec.js => spec.ts} (67%) delete mode 100644 src/leases/types.js create mode 100644 src/leases/types.ts delete mode 100644 src/lessor/actions.js create mode 100644 src/lessor/actions.ts rename src/lessor/{helpers.js => helpers.ts} (54%) delete mode 100644 src/lessor/reducer.js create mode 100644 src/lessor/reducer.ts delete mode 100644 src/lessor/saga.js create mode 100644 src/lessor/saga.ts delete mode 100644 src/lessor/selectors.js create mode 100644 src/lessor/selectors.ts rename src/lessor/{spec.js => spec.ts} (65%) delete mode 100644 src/lessor/types.js create mode 100644 src/lessor/types.ts delete mode 100644 src/penaltyInterest/actions.js create mode 100644 src/penaltyInterest/actions.ts rename src/penaltyInterest/{enums.js => enums.ts} (84%) delete mode 100644 src/penaltyInterest/reducer.js create mode 100644 src/penaltyInterest/reducer.ts rename src/penaltyInterest/{requests.js => requests.ts} (57%) delete mode 100644 src/penaltyInterest/saga.js create mode 100644 src/penaltyInterest/saga.ts delete mode 100644 src/penaltyInterest/selectors.js create mode 100644 src/penaltyInterest/selectors.ts rename src/penaltyInterest/{spec.js => spec.ts} (54%) delete mode 100644 src/penaltyInterest/types.js create mode 100644 src/penaltyInterest/types.ts delete mode 100644 src/plotApplications/actions.js create mode 100644 src/plotApplications/actions.ts rename src/plotApplications/components/{PlotApplication.js => PlotApplication.tsx} (54%) delete mode 100644 src/plotApplications/components/PlotApplicationCreate.js create mode 100644 src/plotApplications/components/PlotApplicationCreate.tsx delete mode 100644 src/plotApplications/components/PlotApplicationCreatePage.js create mode 100644 src/plotApplications/components/PlotApplicationCreatePage.tsx delete mode 100644 src/plotApplications/components/PlotApplicationEdit.js create mode 100644 src/plotApplications/components/PlotApplicationEdit.tsx delete mode 100644 src/plotApplications/components/PlotApplicationInfo.js create mode 100644 src/plotApplications/components/PlotApplicationInfo.tsx delete mode 100644 src/plotApplications/components/PlotApplicationOpeningRecordForm.js create mode 100644 src/plotApplications/components/PlotApplicationOpeningRecordForm.tsx delete mode 100644 src/plotApplications/components/PlotApplicationPage.js create mode 100644 src/plotApplications/components/PlotApplicationPage.tsx delete mode 100644 src/plotApplications/components/PlotApplicationsListOpeningModal.js create mode 100644 src/plotApplications/components/PlotApplicationsListOpeningModal.tsx delete mode 100644 src/plotApplications/components/PlotApplicationsListPage.js create mode 100644 src/plotApplications/components/PlotApplicationsListPage.tsx delete mode 100644 src/plotApplications/components/exportModal/PlotSearchExportModal.js create mode 100644 src/plotApplications/components/exportModal/PlotSearchExportModal.tsx delete mode 100644 src/plotApplications/components/exportModal/PlotSearchExportModalTargetTable.js create mode 100644 src/plotApplications/components/exportModal/PlotSearchExportModalTargetTable.tsx delete mode 100644 src/plotApplications/components/infoCheck/PlotApplicationApplicantInfoCheck.js create mode 100644 src/plotApplications/components/infoCheck/PlotApplicationApplicantInfoCheck.tsx delete mode 100644 src/plotApplications/components/infoCheck/PlotApplicationApplicantInfoCheckEdit.js create mode 100644 src/plotApplications/components/infoCheck/PlotApplicationApplicantInfoCheckEdit.tsx delete mode 100644 src/plotApplications/components/infoCheck/PlotApplicationInfoCheckCollapse.js create mode 100644 src/plotApplications/components/infoCheck/PlotApplicationInfoCheckCollapse.tsx rename src/plotApplications/components/infoCheck/{PlotApplicationTargetInfoCheck.js => PlotApplicationTargetInfoCheck.tsx} (70%) delete mode 100644 src/plotApplications/components/infoCheck/PlotApplicationTargetInfoCheckEdit.js create mode 100644 src/plotApplications/components/infoCheck/PlotApplicationTargetInfoCheckEdit.tsx delete mode 100644 src/plotApplications/components/map/ApplicationListMap.js create mode 100644 src/plotApplications/components/map/ApplicationListMap.tsx delete mode 100644 src/plotApplications/components/map/TargetListLayer.js create mode 100644 src/plotApplications/components/map/TargetListLayer.tsx delete mode 100644 src/plotApplications/components/search/Search.js create mode 100644 src/plotApplications/components/search/Search.tsx rename src/plotApplications/{constants.js => constants.ts} (87%) rename src/plotApplications/{enums.js => enums.ts} (93%) rename src/plotApplications/{formValidators.js => formValidators.ts} (100%) rename src/plotApplications/{helpers.js => helpers.ts} (58%) rename src/plotApplications/{reducer.js => reducer.ts} (64%) rename src/plotApplications/{requests.js => requests.ts} (63%) delete mode 100644 src/plotApplications/saga.js create mode 100644 src/plotApplications/saga.ts delete mode 100644 src/plotApplications/selectors.js create mode 100644 src/plotApplications/selectors.ts rename src/plotApplications/{spec.js => spec.ts} (71%) delete mode 100644 src/plotApplications/types.js create mode 100644 src/plotApplications/types.ts delete mode 100644 src/plotSearch/actions.js create mode 100644 src/plotSearch/actions.ts delete mode 100644 src/plotSearch/components/CreatePlotSearchForm.js create mode 100644 src/plotSearch/components/CreatePlotSearchForm.tsx delete mode 100644 src/plotSearch/components/CreatePlotSearchModal.js create mode 100644 src/plotSearch/components/CreatePlotSearchModal.tsx delete mode 100644 src/plotSearch/components/PlotSearchListPage.js create mode 100644 src/plotSearch/components/PlotSearchListPage.tsx delete mode 100644 src/plotSearch/components/PlotSearchPage.js create mode 100644 src/plotSearch/components/PlotSearchPage.tsx delete mode 100644 src/plotSearch/components/directReservationLinkModal/DirectReservationLinkModal.js create mode 100644 src/plotSearch/components/directReservationLinkModal/DirectReservationLinkModal.tsx delete mode 100644 src/plotSearch/components/plotSearchSections/application/Application.js create mode 100644 src/plotSearch/components/plotSearchSections/application/Application.tsx delete mode 100644 src/plotSearch/components/plotSearchSections/application/ApplicationEdit.js create mode 100644 src/plotSearch/components/plotSearchSections/application/ApplicationEdit.tsx delete mode 100644 src/plotSearch/components/plotSearchSections/application/ApplicationPreviewSection.js create mode 100644 src/plotSearch/components/plotSearchSections/application/ApplicationPreviewSection.tsx delete mode 100644 src/plotSearch/components/plotSearchSections/application/EditPlotApplicationSectionFieldForm.js create mode 100644 src/plotSearch/components/plotSearchSections/application/EditPlotApplicationSectionFieldForm.tsx delete mode 100644 src/plotSearch/components/plotSearchSections/application/EditPlotApplicationSectionForm.js create mode 100644 src/plotSearch/components/plotSearchSections/application/EditPlotApplicationSectionForm.tsx delete mode 100644 src/plotSearch/components/plotSearchSections/application/EditPlotApplicationSectionModal.js create mode 100644 src/plotSearch/components/plotSearchSections/application/EditPlotApplicationSectionModal.tsx rename src/plotSearch/components/plotSearchSections/basicInfo/{BasicInfo.js => BasicInfo.tsx} (56%) delete mode 100644 src/plotSearch/components/plotSearchSections/basicInfo/BasicInfoDecisionEdit.js create mode 100644 src/plotSearch/components/plotSearchSections/basicInfo/BasicInfoDecisionEdit.tsx delete mode 100644 src/plotSearch/components/plotSearchSections/basicInfo/BasicInfoEdit.js create mode 100644 src/plotSearch/components/plotSearchSections/basicInfo/BasicInfoEdit.tsx delete mode 100644 src/plotSearch/components/plotSearchSections/basicInfo/PlotSearchApplicationsOpeningSection.js create mode 100644 src/plotSearch/components/plotSearchSections/basicInfo/PlotSearchApplicationsOpeningSection.tsx rename src/plotSearch/components/plotSearchSections/basicInfo/{PlotSearchReservationRecipients.js => PlotSearchReservationRecipients.tsx} (60%) rename src/plotSearch/components/plotSearchSections/basicInfo/{PlotSearchSiteCustomDetailedPlan.js => PlotSearchSiteCustomDetailedPlan.tsx} (66%) rename src/plotSearch/components/plotSearchSections/basicInfo/{PlotSearchSiteEdit.js => PlotSearchSiteEdit.tsx} (50%) rename src/plotSearch/components/plotSearchSections/basicInfo/{PlotSearchSiteEditCustomDetailedPlan.js => PlotSearchSiteEditCustomDetailedPlan.tsx} (67%) rename src/plotSearch/components/plotSearchSections/basicInfo/{PlotSearchSitePlanUnit.js => PlotSearchSitePlanUnit.tsx} (69%) delete mode 100644 src/plotSearch/components/plotSearchSections/basicInfo/PlotSearchTargetListing.js create mode 100644 src/plotSearch/components/plotSearchSections/basicInfo/PlotSearchTargetListing.tsx delete mode 100644 src/plotSearch/components/plotSearchSections/basicInfo/SuggestedEdit.js create mode 100644 src/plotSearch/components/plotSearchSections/basicInfo/SuggestedEdit.tsx delete mode 100644 src/plotSearch/components/plotSearchSections/map/ApplicationMap.js create mode 100644 src/plotSearch/components/plotSearchSections/map/ApplicationMap.tsx delete mode 100644 src/plotSearch/components/plotSearchSections/plotSearchInfo/PlotSearchInfo.js create mode 100644 src/plotSearch/components/plotSearchSections/plotSearchInfo/PlotSearchInfo.tsx delete mode 100644 src/plotSearch/components/reservationIdentifiers/ReservationIdentifiersModal.js create mode 100644 src/plotSearch/components/reservationIdentifiers/ReservationIdentifiersModal.tsx delete mode 100644 src/plotSearch/components/search/Search.js create mode 100644 src/plotSearch/components/search/Search.tsx delete mode 100644 src/plotSearch/constants.js create mode 100644 src/plotSearch/constants.ts rename src/plotSearch/{enums.js => enums.ts} (94%) rename src/plotSearch/{formValidators.js => formValidators.ts} (100%) rename src/plotSearch/{helpers.js => helpers.ts} (54%) rename src/plotSearch/{reducer.js => reducer.ts} (60%) rename src/plotSearch/{requests.js => requests.ts} (68%) delete mode 100644 src/plotSearch/requestsAsync.js create mode 100644 src/plotSearch/requestsAsync.ts delete mode 100644 src/plotSearch/saga.js create mode 100644 src/plotSearch/saga.ts delete mode 100644 src/plotSearch/selectors.js create mode 100644 src/plotSearch/selectors.ts rename src/plotSearch/{spec.js => spec.ts} (66%) delete mode 100644 src/plotSearch/types.js create mode 100644 src/plotSearch/types.ts rename src/{polyfills.js => polyfills.ts} (96%) delete mode 100644 src/previewInvoices/actions.js create mode 100644 src/previewInvoices/actions.ts delete mode 100644 src/previewInvoices/reducer.js create mode 100644 src/previewInvoices/reducer.ts delete mode 100644 src/previewInvoices/requests.js create mode 100644 src/previewInvoices/requests.ts delete mode 100644 src/previewInvoices/saga.js create mode 100644 src/previewInvoices/saga.ts delete mode 100644 src/previewInvoices/selectors.js create mode 100644 src/previewInvoices/selectors.ts rename src/previewInvoices/{spec.js => spec.ts} (58%) delete mode 100644 src/previewInvoices/types.js create mode 100644 src/previewInvoices/types.ts delete mode 100644 src/relatedLease/actions.js create mode 100644 src/relatedLease/actions.ts rename src/relatedLease/{enums.js => enums.ts} (73%) rename src/relatedLease/{requests.js => requests.ts} (76%) delete mode 100644 src/relatedLease/saga.js create mode 100644 src/relatedLease/saga.ts delete mode 100644 src/relatedLease/types.js create mode 100644 src/relatedLease/types.ts delete mode 100644 src/rentForPeriod/actions.js create mode 100644 src/rentForPeriod/actions.ts delete mode 100644 src/rentForPeriod/reducer.js create mode 100644 src/rentForPeriod/reducer.ts rename src/rentForPeriod/{requests.js => requests.ts} (62%) delete mode 100644 src/rentForPeriod/saga.js create mode 100644 src/rentForPeriod/saga.ts rename src/rentForPeriod/{selectors.js => selectors.ts} (50%) delete mode 100644 src/rentForPeriod/spec.js create mode 100644 src/rentForPeriod/spec.ts delete mode 100644 src/rentForPeriod/types.js create mode 100644 src/rentForPeriod/types.ts delete mode 100644 src/rentbasis/actions.js create mode 100644 src/rentbasis/actions.ts delete mode 100644 src/rentbasis/components/NewRentBasisPage.js create mode 100644 src/rentbasis/components/NewRentBasisPage.tsx delete mode 100644 src/rentbasis/components/RentBasisInfo.js create mode 100644 src/rentbasis/components/RentBasisInfo.tsx delete mode 100644 src/rentbasis/components/RentBasisListPage.js create mode 100644 src/rentbasis/components/RentBasisListPage.tsx delete mode 100644 src/rentbasis/components/RentBasisPage.js create mode 100644 src/rentbasis/components/RentBasisPage.tsx delete mode 100644 src/rentbasis/components/forms/RentBasisForm.js create mode 100644 src/rentbasis/components/forms/RentBasisForm.tsx delete mode 100644 src/rentbasis/components/search/Search.js create mode 100644 src/rentbasis/components/search/Search.tsx delete mode 100644 src/rentbasis/components/sections/basicInfo/RentBasisEdit.js create mode 100644 src/rentbasis/components/sections/basicInfo/RentBasisEdit.tsx rename src/rentbasis/components/sections/basicInfo/{RentBasisReadonly.js => RentBasisReadonly.tsx} (79%) delete mode 100644 src/rentbasis/components/sections/map/RentBasisLayer.js create mode 100644 src/rentbasis/components/sections/map/RentBasisLayer.tsx delete mode 100644 src/rentbasis/components/sections/map/SingleRentBasisMap.js create mode 100644 src/rentbasis/components/sections/map/SingleRentBasisMap.tsx rename src/rentbasis/{constants.js => constants.ts} (66%) rename src/rentbasis/{enums.js => enums.ts} (89%) delete mode 100644 src/rentbasis/formValidators.js create mode 100644 src/rentbasis/formValidators.ts rename src/rentbasis/{helpers.js => helpers.ts} (62%) rename src/rentbasis/{reducer.js => reducer.ts} (53%) rename src/rentbasis/{requests.js => requests.ts} (64%) delete mode 100644 src/rentbasis/saga.js create mode 100644 src/rentbasis/saga.ts delete mode 100644 src/rentbasis/selectors.js create mode 100644 src/rentbasis/selectors.ts rename src/rentbasis/{spec.js => spec.ts} (64%) delete mode 100644 src/rentbasis/types.js create mode 100644 src/rentbasis/types.ts delete mode 100644 src/root/Root.js create mode 100644 src/root/Root.tsx delete mode 100644 src/root/configureStore.js create mode 100644 src/root/configureStore.ts delete mode 100644 src/root/createRootReducer.js create mode 100644 src/root/createRootReducer.ts delete mode 100644 src/root/createRootSaga.js create mode 100644 src/root/createRootSaga.ts rename src/root/{enableOfflineMode.js => enableOfflineMode.ts} (66%) delete mode 100644 src/root/renderApp.js create mode 100644 src/root/renderApp.tsx rename src/root/{routes.js => routes.tsx} (63%) rename src/root/{startApp.js => startApp.ts} (62%) delete mode 100644 src/root/types.js create mode 100644 src/root/types.ts delete mode 100644 src/sapInvoice/actions.js create mode 100644 src/sapInvoice/actions.ts delete mode 100644 src/sapInvoice/components/SapInvoicesListPage.js create mode 100644 src/sapInvoice/components/SapInvoicesListPage.tsx delete mode 100644 src/sapInvoice/components/Search.js create mode 100644 src/sapInvoice/components/Search.tsx rename src/sapInvoice/{constants.js => constants.ts} (66%) delete mode 100644 src/sapInvoice/helpers.js create mode 100644 src/sapInvoice/helpers.ts delete mode 100644 src/sapInvoice/reducer.js create mode 100644 src/sapInvoice/reducer.ts delete mode 100644 src/sapInvoice/saga.js create mode 100644 src/sapInvoice/saga.ts delete mode 100644 src/sapInvoice/selectors.js create mode 100644 src/sapInvoice/selectors.ts rename src/sapInvoice/{spec.js => spec.ts} (61%) delete mode 100644 src/sapInvoice/types.js create mode 100644 src/sapInvoice/types.ts delete mode 100644 src/serviceUnits/actions.js create mode 100644 src/serviceUnits/actions.ts delete mode 100644 src/serviceUnits/reducer.js create mode 100644 src/serviceUnits/reducer.ts rename src/serviceUnits/{requests.js => requests.ts} (57%) rename src/serviceUnits/{saga.js => saga.ts} (50%) delete mode 100644 src/serviceUnits/selectors.js create mode 100644 src/serviceUnits/selectors.ts delete mode 100644 src/serviceUnits/types.js create mode 100644 src/serviceUnits/types.ts delete mode 100644 src/silent_renew.js create mode 100644 src/silent_renew.ts delete mode 100644 src/test.js create mode 100644 src/test.ts delete mode 100644 src/tradeRegister/actions.js create mode 100644 src/tradeRegister/actions.ts rename src/tradeRegister/components/{CompanyExtended.js => CompanyExtended.tsx} (83%) rename src/tradeRegister/components/{CompanyNotice.js => CompanyNotice.tsx} (61%) rename src/tradeRegister/components/{CompanyRepresent.js => CompanyRepresent.tsx} (51%) delete mode 100644 src/tradeRegister/components/DownloadableFiles.js create mode 100644 src/tradeRegister/components/DownloadableFiles.tsx delete mode 100644 src/tradeRegister/components/Search.js create mode 100644 src/tradeRegister/components/Search.tsx delete mode 100644 src/tradeRegister/components/TradeRegisterSearchPage.js create mode 100644 src/tradeRegister/components/TradeRegisterSearchPage.tsx delete mode 100644 src/tradeRegister/components/TradeRegisterTemplate.js create mode 100644 src/tradeRegister/components/TradeRegisterTemplate.tsx rename src/tradeRegister/{enums.js => enums.ts} (96%) delete mode 100644 src/tradeRegister/reducer.js create mode 100644 src/tradeRegister/reducer.ts rename src/tradeRegister/{requests.js => requests.ts} (81%) delete mode 100644 src/tradeRegister/saga.js create mode 100644 src/tradeRegister/saga.ts delete mode 100644 src/tradeRegister/selectors.js create mode 100644 src/tradeRegister/selectors.ts rename src/tradeRegister/{spec.js => spec.ts} (65%) delete mode 100644 src/tradeRegister/types.js create mode 100644 src/tradeRegister/types.ts delete mode 100644 src/types.js create mode 100644 src/types.ts delete mode 100644 src/uiData/actions.js create mode 100644 src/uiData/actions.ts rename src/uiData/{enums.js => enums.ts} (97%) rename src/uiData/{helpers.js => helpers.ts} (97%) rename src/uiData/{reducer.js => reducer.ts} (52%) rename src/uiData/{requests.js => requests.ts} (54%) delete mode 100644 src/uiData/saga.js create mode 100644 src/uiData/saga.ts rename src/uiData/{selectors.js => selectors.ts} (50%) rename src/uiData/{spec.js => spec.ts} (65%) delete mode 100644 src/uiData/types.js create mode 100644 src/uiData/types.ts delete mode 100644 src/users/actions.js create mode 100644 src/users/actions.ts delete mode 100644 src/users/helpers.js create mode 100644 src/users/helpers.ts delete mode 100644 src/users/reducer.js create mode 100644 src/users/reducer.ts rename src/users/{requests.js => requests.ts} (59%) delete mode 100644 src/users/requestsAsync.js create mode 100644 src/users/requestsAsync.ts delete mode 100644 src/users/saga.js create mode 100644 src/users/saga.ts delete mode 100644 src/users/selectors.js create mode 100644 src/users/selectors.ts rename src/users/{spec.js => spec.ts} (52%) delete mode 100644 src/users/types.js create mode 100644 src/users/types.ts delete mode 100644 src/usersPermissions/actions.js create mode 100644 src/usersPermissions/actions.ts rename src/usersPermissions/{enums.js => enums.ts} (99%) rename src/usersPermissions/{reducer.js => reducer.ts} (55%) rename src/usersPermissions/{requests.js => requests.ts} (59%) rename src/usersPermissions/{saga.js => saga.ts} (51%) delete mode 100644 src/usersPermissions/selectors.js create mode 100644 src/usersPermissions/selectors.ts rename src/usersPermissions/{spec.js => spec.ts} (58%) delete mode 100644 src/usersPermissions/types.js create mode 100644 src/usersPermissions/types.ts delete mode 100644 src/util/date.js create mode 100644 src/util/date.ts delete mode 100644 src/util/forms.js create mode 100644 src/util/forms.ts rename src/util/{helpers.js => helpers.tsx} (63%) rename src/util/{map.js => map.ts} (73%) rename src/util/{spec.js => spec.ts} (63%) rename src/util/{storage.js => storage.ts} (85%) delete mode 100644 src/util/testUtil.js create mode 100644 src/util/testUtil.ts delete mode 100644 src/vat/actions.js create mode 100644 src/vat/actions.ts delete mode 100644 src/vat/reducer.js create mode 100644 src/vat/reducer.ts rename src/vat/{requests.js => requests.ts} (56%) delete mode 100644 src/vat/saga.js create mode 100644 src/vat/saga.ts delete mode 100644 src/vat/selectors.js create mode 100644 src/vat/selectors.ts rename src/vat/{spec.js => spec.ts} (61%) delete mode 100644 src/vat/types.js create mode 100644 src/vat/types.ts create mode 100644 tsconfig.json diff --git a/config/paths.js b/config/paths.js index 35248ad10..fc0fe22d6 100644 --- a/config/paths.js +++ b/config/paths.js @@ -45,9 +45,9 @@ module.exports = { dotenv: resolveApp('.env'), appBuild: resolveApp('dist'), appHtml: resolveApp('src/index.html'), - appIndexJs: resolveApp('src/index.js'), + appIndexJs: resolveApp('src/index.ts'), appScss: resolveApp('src/main.scss'), - silentRenewJs: resolveApp('src/silent_renew.js'), + silentRenewJs: resolveApp('src/silent_renew.ts'), silentRenewHtml: resolveApp('src/silent_renew.html'), appPackageJson: resolveApp('package.json'), appSrc: resolveApp('src'), diff --git a/config/webpack.config.dev.js b/config/webpack.config.dev.js index fa421b5e1..c15dbf291 100644 --- a/config/webpack.config.dev.js +++ b/config/webpack.config.dev.js @@ -54,11 +54,16 @@ module.exports = { path.join(__dirname, 'src'), 'node_modules', ], - extensions: ['.web.js', '.js', '.json', '.web.jsx', '.jsx'], + extensions: ['.web.js', '.js', '.json', '.web.jsx', '.jsx', '.ts', '.tsx'], }, module: { strictExportPresence: true, rules: [ + { + test: /\.tsx?$/, + use: 'ts-loader', + exclude: /node_modules/, + }, { test: /\.(js|jsx)$/, loader: 'babel-loader', diff --git a/jsconfig.json b/jsconfig.json index 639378075..a510ec626 100644 --- a/jsconfig.json +++ b/jsconfig.json @@ -2,10 +2,7 @@ "compilerOptions": { "baseUrl": ".", "paths": { - "$assets/*": ["./assets/*"], - "$components/*": ["./src/components/*"], - "$src/*": ["./src/*"], - "$util/*": ["./src/util/*"] + "src/*": ["./src/*"], } } } diff --git a/package.json b/package.json index c81932f68..5fd7cc472 100644 --- a/package.json +++ b/package.json @@ -32,6 +32,7 @@ "copy-to-clipboard": "^3.2.0", "date-fns": "^2.0.0-beta.4", "dotenv": "^8.0.0", + "file-loader": "^6.2.0", "file-saver": "^2.0.5", "font-awesome": "^4.7.0", "foundation-sites": "6.5.3", @@ -69,6 +70,7 @@ "redux-form": "^8.2.5", "redux-oidc": "^3.1.4", "redux-saga": "^1.0.5", + "ts-loader": "^9.5.1", "whatwg-fetch": "^3.0.0" }, "devDependencies": { @@ -81,6 +83,11 @@ "@babel/preset-react": "^7.23.3", "@babel/register": "^7.23.7", "@hot-loader/react-dom": "17.0.2", + "@types/chai": "^4.3.16", + "@types/history": "^5.0.0", + "@types/lodash": "^4.17.1", + "@types/mocha": "^10.0.6", + "@types/redux-actions": "^2.6.5", "babel-loader": "^9.1.3", "babel-plugin-istanbul": "^6.1.1", "babel-plugin-module-resolver": "^5.0.0", @@ -99,8 +106,6 @@ "eslint-plugin-flowtype": "^8.0.3", "eslint-plugin-react": "^7.14.3", "favicons-webpack-plugin": "^6.0.1", - "file-loader": "^6.2.0", - "flow-bin": "^0.227.0", "flow-typed": "^3.9.0", "fs-extra": "^11.2.0", "html-webpack-plugin": "^5.6.0", @@ -118,6 +123,7 @@ "sinon-chai": "^3.3.0", "style-loader": "^3.3.4", "terser-webpack-plugin": "^5.3.10", + "typescript": "^5.4.5", "url-loader": "^4.1.1", "webpack": "^5.9.0", "webpack-dev-server": "^4.15.1", diff --git a/scripts/start.js b/scripts/start.js index 7a6ecc36c..949e993f7 100644 --- a/scripts/start.js +++ b/scripts/start.js @@ -53,7 +53,7 @@ choosePort(HOST, DEFAULT_PORT) } const protocol = process.env.HTTPS === 'true' ? 'https' : 'http'; const appName = require(paths.appPackageJson).name; - const useTypeScript = false; + const useTypeScript = true; const urls = prepareUrls(protocol, HOST, port); const devSocket = { warnings: warnings => diff --git a/src/api/ApiErrorModal.js b/src/api/ApiErrorModal.js deleted file mode 100644 index cc4c03b10..000000000 --- a/src/api/ApiErrorModal.js +++ /dev/null @@ -1,67 +0,0 @@ -/* eslint-disable */ -import flowRight from 'lodash/flowRight'; -import React from 'react'; -import {Button} from 'react-foundation'; -import {reveal} from '../foundation/reveal'; -import {Sizes} from '../foundation/enums'; - -const ApiErrorModal = ({data, handleDismiss, isOpen}) => ( -
- {data ? : null} - -
-); - -const ApiErrorList = ({errors}) => { - const listObjectErrors = (obj: Object) => { - return ( - - ); - } - - return ( -
-
Error list
- {listObjectErrors(errors)} -
- ); -} - -const ApiErrorStackTrace = ({trace}) => -
-
Trace
-
    - {trace.filter((item) => item.file).map((item, index) => ( -
  1. - - {item.file}({item.line}) - -   - - {item.class ? `${item.class}::${item.function}` : item.function} - -
  2. - ))} -
-
; - -const ApiErrorContent = ({data}) => { - return
-

Server error {data.exception}

-
{data.message}
-
{data.source}
- {data.errors ? : null} - {data.trace ? : null} -
; -}; - -export default flowRight( - reveal({name: 'apiError'}), -)(ApiErrorModal); diff --git a/src/api/ApiErrorModal.tsx b/src/api/ApiErrorModal.tsx new file mode 100644 index 000000000..8cd98db7f --- /dev/null +++ b/src/api/ApiErrorModal.tsx @@ -0,0 +1,69 @@ +/* eslint-disable */ +import flowRight from "lodash/flowRight"; +import React from "react"; +import { Button } from "react-foundation"; +import { reveal } from "../foundation/reveal"; +import { Sizes } from "../foundation/enums"; + +const ApiErrorModal = ({ + data, + handleDismiss, + isOpen +}) =>
+ {data ? : null} + +
; + +const ApiErrorList = ({ + errors +}) => { + const listObjectErrors = (obj: Record) => { + return ; + }; + + return
+
Error list
+ {listObjectErrors(errors)} +
; +}; + +const ApiErrorStackTrace = ({ + trace +}) =>
+
Trace
+
    + {trace.filter(item => item.file).map((item, index) =>
  1. + + {item.file}({item.line}) + +   + + {item.class ? `${item.class}::${item.function}` : item.function} + +
  2. )} +
+
; + +const ApiErrorContent = ({ + data +}) => { + return
+

Server error {data.exception}

+
{data.message}
+
{data.source}
+ {data.errors ? : null} + {data.trace ? : null} +
; +}; + +export default flowRight(reveal({ + name: 'apiError' +}))(ApiErrorModal); \ No newline at end of file diff --git a/src/api/actions.js b/src/api/actions.js deleted file mode 100644 index ab9b58787..000000000 --- a/src/api/actions.js +++ /dev/null @@ -1,11 +0,0 @@ -// @flow - -import {createAction} from 'redux-actions'; - -import type {ApiError, ReceiveErrorAction, ClearErrorAction} from './types'; - -export const receiveError = (error: ApiError): ReceiveErrorAction => - createAction('mvj/api/RECEIVE_ERROR')(error); - -export const clearError = (): ClearErrorAction => - createAction('mvj/api/CLEAR_ERROR')(); diff --git a/src/api/actions.ts b/src/api/actions.ts new file mode 100644 index 000000000..3d07a9a9b --- /dev/null +++ b/src/api/actions.ts @@ -0,0 +1,4 @@ +import { createAction } from "redux-actions"; +import type { ApiError, ReceiveErrorAction, ClearErrorAction } from "./types"; +export const receiveError = (error: ApiError): ReceiveErrorAction => createAction('mvj/api/RECEIVE_ERROR')(error); +export const clearError = (): ClearErrorAction => createAction('mvj/api/CLEAR_ERROR')(); \ No newline at end of file diff --git a/src/api/callApi.js b/src/api/callApi.ts similarity index 51% rename from src/api/callApi.js rename to src/api/callApi.ts index 5b54466ef..c57b463a1 100644 --- a/src/api/callApi.js +++ b/src/api/callApi.ts @@ -1,8 +1,6 @@ -// @flow -import {call, select} from 'redux-saga/effects'; - -import {getApiToken} from '$src/auth/selectors'; -import {UI_ACCEPT_LANGUAGE_VALUE} from '$src/api/constants'; +import { call, select } from "redux-saga/effects"; +import { getApiToken } from "src/auth/selectors"; +import { UI_ACCEPT_LANGUAGE_VALUE } from "src/api/constants"; function* callApi(request: Request): Generator { const apiToken = yield select(getApiToken); @@ -11,10 +9,7 @@ function* callApi(request: Request): Generator { request.headers.set('Authorization', `Bearer ${apiToken}`); } - request.headers.set( - 'Accept-Language', - UI_ACCEPT_LANGUAGE_VALUE - ); + request.headers.set('Accept-Language', UI_ACCEPT_LANGUAGE_VALUE); if (request.method === 'PATCH' || request.method === 'POST' || request.method === 'PUT') { request.headers.set('Content-Type', 'application/json'); @@ -23,15 +18,27 @@ function* callApi(request: Request): Generator { const response = yield call(fetch, request); const status = response.status; - switch(status) { + switch (status) { case 204: - return {response}; + return { + response + }; + case 500: - return {response, bodyAsJson: {exception: response.status, message: response.statusText}}; + return { + response, + bodyAsJson: { + exception: response.status, + message: response.statusText + } + }; } const bodyAsJson = yield call([response, response.json]); - return {response, bodyAsJson}; + return { + response, + bodyAsJson + }; } -export default callApi; +export default callApi; \ No newline at end of file diff --git a/src/api/callApiAsync.js b/src/api/callApiAsync.ts similarity index 51% rename from src/api/callApiAsync.js rename to src/api/callApiAsync.ts index e74513277..46bef66ca 100644 --- a/src/api/callApiAsync.js +++ b/src/api/callApiAsync.ts @@ -1,19 +1,15 @@ -// @flow -import {store} from '$src/root/startApp'; -import {getApiToken} from '$src/auth/selectors'; -import {UI_ACCEPT_LANGUAGE_VALUE} from '$src/api/constants'; +import { store } from "src/root/startApp"; +import { getApiToken } from "src/auth/selectors"; +import { UI_ACCEPT_LANGUAGE_VALUE } from "src/api/constants"; -const callApiAsync = async (request: Request): Promise => { +const callApiAsync = async (request: Request): Promise> => { const apiToken = await getApiToken(store.getState()); if (apiToken) { request.headers.set('Authorization', `Bearer ${apiToken}`); } - request.headers.set( - 'Accept-Language', - UI_ACCEPT_LANGUAGE_VALUE - ); + request.headers.set('Accept-Language', UI_ACCEPT_LANGUAGE_VALUE); if (request.method === 'PATCH' || request.method === 'POST' || request.method === 'PUT') { request.headers.set('Content-Type', 'application/json'); @@ -21,7 +17,10 @@ const callApiAsync = async (request: Request): Promise => { const response = await fetch(request); const bodyAsJson = await response.json(); - return {response, bodyAsJson}; + return { + response, + bodyAsJson + }; }; -export default callApiAsync; +export default callApiAsync; \ No newline at end of file diff --git a/src/api/callUploadRequest.js b/src/api/callUploadRequest.ts similarity index 53% rename from src/api/callUploadRequest.js rename to src/api/callUploadRequest.ts index 7cd2eace1..612b06a3f 100644 --- a/src/api/callUploadRequest.js +++ b/src/api/callUploadRequest.ts @@ -1,22 +1,16 @@ -// @flow - -import {call, put, select} from 'redux-saga/effects'; - -import {receiveError} from '$src/api/actions'; -import {getApiToken} from '$src/auth/selectors'; -import {UI_ACCEPT_LANGUAGE_VALUE} from '$src/api/constants'; +import { call, put, select } from "redux-saga/effects"; +import { receiveError } from "src/api/actions"; +import { getApiToken } from "src/auth/selectors"; +import { UI_ACCEPT_LANGUAGE_VALUE } from "src/api/constants"; function* callUploadRequest(request: Request): Generator { const apiToken = yield select(getApiToken); + if (apiToken) { request.headers.set('Authorization', `Bearer ${apiToken}`); } - request.headers.set( - 'Accept-Language', - UI_ACCEPT_LANGUAGE_VALUE - ); - + request.headers.set('Accept-Language', UI_ACCEPT_LANGUAGE_VALUE); const response = yield call(fetch, request); const status = response.status; const bodyAsJson = yield call([response, response.json]); @@ -25,7 +19,10 @@ function* callUploadRequest(request: Request): Generator { yield put(receiveError(bodyAsJson)); } - return {response, bodyAsJson}; + return { + response, + bodyAsJson + }; } -export default callUploadRequest; +export default callUploadRequest; \ No newline at end of file diff --git a/src/api/constants.js b/src/api/constants.js deleted file mode 100644 index ca23e838a..000000000 --- a/src/api/constants.js +++ /dev/null @@ -1,3 +0,0 @@ -//@flow - -export const UI_ACCEPT_LANGUAGE_VALUE = 'fi,en;q=0.9'; diff --git a/src/api/constants.ts b/src/api/constants.ts new file mode 100644 index 000000000..56b5678bd --- /dev/null +++ b/src/api/constants.ts @@ -0,0 +1 @@ +export const UI_ACCEPT_LANGUAGE_VALUE = 'fi,en;q=0.9'; \ No newline at end of file diff --git a/src/api/createUrl.js b/src/api/createUrl.js deleted file mode 100644 index a742e1e29..000000000 --- a/src/api/createUrl.js +++ /dev/null @@ -1,20 +0,0 @@ -// @flow -import isArray from 'lodash/isArray'; - -export const stringifyQuery = (query: {[key: string]: any}): string => - Object - .keys(query) - .map((key) => [key, query[key]].map((v) => encodeURIComponent(v)).join('=')) - .join('&'); - -export const standardStringifyQuery = (query: {[key: string]: any}): string => - Object - .keys(query) - .map((key) => isArray(query[key]) - ? [key, query[key].map((v) => encodeURIComponent(v)).join(`&${key}=`)].join('=') - : [key, query[key]].map((v) => encodeURIComponent(v)).join('=') - ) - .join('&'); - -export default (url: string, params?: Object): string => - `${process.env.API_URL || ''}/${url}${params ? `?${stringifyQuery(params)}` : ''}`; diff --git a/src/api/createUrl.ts b/src/api/createUrl.ts new file mode 100644 index 000000000..2d57c79f1 --- /dev/null +++ b/src/api/createUrl.ts @@ -0,0 +1,4 @@ +import isArray from "lodash/isArray"; +export const stringifyQuery = (query: Record): string => Object.keys(query).map(key => [key, query[key]].map(v => encodeURIComponent(v)).join('=')).join('&'); +export const standardStringifyQuery = (query: Record): string => Object.keys(query).map(key => isArray(query[key]) ? [key, query[key].map(v => encodeURIComponent(v)).join(`&${key}=`)].join('=') : [key, query[key]].map(v => encodeURIComponent(v)).join('=')).join('&'); +export default ((url: string, params?: Record): string => `${process.env.API_URL || ''}/${url}${params ? `?${stringifyQuery(params)}` : ''}`); \ No newline at end of file diff --git a/src/api/createUrlWithoutVersionSuffix.js b/src/api/createUrlWithoutVersionSuffix.js deleted file mode 100644 index 881c15e70..000000000 --- a/src/api/createUrlWithoutVersionSuffix.js +++ /dev/null @@ -1,9 +0,0 @@ -// @flow -import {getApiUrlWithOutVersionSuffix} from '$src/util/helpers'; -import {stringifyQuery} from './createUrl'; - -export default (url: string, params?: Object) => { - const apiUrlWithOutVersionSuffix = getApiUrlWithOutVersionSuffix(); - - return `${apiUrlWithOutVersionSuffix}/${url}${params ? `?${stringifyQuery(params)}` : ''}`; -}; diff --git a/src/api/createUrlWithoutVersionSuffix.ts b/src/api/createUrlWithoutVersionSuffix.ts new file mode 100644 index 000000000..ee3f417fe --- /dev/null +++ b/src/api/createUrlWithoutVersionSuffix.ts @@ -0,0 +1,6 @@ +import { getApiUrlWithOutVersionSuffix } from "src/util/helpers"; +import { stringifyQuery } from "./createUrl"; +export default ((url: string, params?: Record) => { + const apiUrlWithOutVersionSuffix = getApiUrlWithOutVersionSuffix(); + return `${apiUrlWithOutVersionSuffix}/${url}${params ? `?${stringifyQuery(params)}` : ''}`; +}); \ No newline at end of file diff --git a/src/api/reducer.js b/src/api/reducer.js deleted file mode 100644 index 4545e9663..000000000 --- a/src/api/reducer.js +++ /dev/null @@ -1,16 +0,0 @@ -// @flow - -import {combineReducers} from 'redux'; -import {handleActions} from 'redux-actions'; - -import type {Reducer} from '../types'; -import type {ApiError, ReceiveErrorAction} from './types'; - -export const errorReducer: Reducer = handleActions({ - ['mvj/api/RECEIVE_ERROR']: (state, {payload: error}: ReceiveErrorAction) => error, - ['mvj/api/CLEAR_ERROR']: () => null, -}, null); - -export default combineReducers({ - error: errorReducer, -}); diff --git a/src/api/reducer.ts b/src/api/reducer.ts new file mode 100644 index 000000000..bedae0a29 --- /dev/null +++ b/src/api/reducer.ts @@ -0,0 +1,13 @@ +import { combineReducers } from "redux"; +import { handleActions } from "redux-actions"; +import type { Reducer } from "../types"; +import type { ApiError, ReceiveErrorAction } from "./types"; +export const errorReducer: Reducer = handleActions({ + ['mvj/api/RECEIVE_ERROR']: (state, { + payload: error + }: ReceiveErrorAction) => error, + ['mvj/api/CLEAR_ERROR']: () => null +}, null); +export default combineReducers, any>({ + error: errorReducer +}); \ No newline at end of file diff --git a/src/api/selectors.js b/src/api/selectors.js deleted file mode 100644 index f2961e50e..000000000 --- a/src/api/selectors.js +++ /dev/null @@ -1,7 +0,0 @@ -// @flow - -import type {Selector} from '../types'; -import type {ApiError} from './types'; - -export const getError: Selector = (state) => - state.api.error; diff --git a/src/api/selectors.ts b/src/api/selectors.ts new file mode 100644 index 000000000..e417b985c --- /dev/null +++ b/src/api/selectors.ts @@ -0,0 +1,3 @@ +import type { Selector } from "../types"; +import type { ApiError } from "./types"; +export const getError: Selector = state => state.api.error; \ No newline at end of file diff --git a/src/api/spec.js b/src/api/spec.ts similarity index 53% rename from src/api/spec.js rename to src/api/spec.ts index a82f1c665..50125fe1a 100644 --- a/src/api/spec.js +++ b/src/api/spec.ts @@ -1,44 +1,38 @@ -// @flow -import {expect} from 'chai'; - -import { - receiveError, - clearError, -} from './actions'; -import apiReducer from './reducer'; - -import type {ApiState} from './types'; - +import { expect } from "chai"; +import { receiveError, clearError } from "./actions"; +import apiReducer from "./reducer"; +import type { ApiState } from "./types"; const defaultState: ApiState = { - error: null, + error: null }; - -// $FlowFixMe +// @ts-expect-error describe('API', () => { - // $FlowFixMe describe('Reducer', () => { - // $FlowFixMe describe('apiReducer', () => { - // $FlowFixMe it('should update error', () => { - const dummyError = {'error': 'test'}; - const newState = {...defaultState, error: dummyError}; - + const dummyError = { + 'error': 'test' + }; + const newState = { ...defaultState, + error: dummyError + }; const state = apiReducer({}, receiveError(dummyError)); expect(state).to.deep.equal(newState); }); - it('should clear error', () => { - const dummyError = {'error': 'test'}; - const newState = {...defaultState, error: null}; - + const dummyError = { + 'error': 'test' + }; + const newState = { ...defaultState, + error: null + }; let state = apiReducer({}, receiveError(dummyError)); state = apiReducer(state, clearError()); expect(state).to.deep.equal(newState); }); }); }); -}); +}); \ No newline at end of file diff --git a/src/api/types.js b/src/api/types.js deleted file mode 100644 index 89620fbbb..000000000 --- a/src/api/types.js +++ /dev/null @@ -1,12 +0,0 @@ -// @flow - -import type {Action} from '../types'; - -export type ApiError = Object | null; - -export type ReceiveErrorAction = Action<'mvj/api/RECEIVE_ERROR', ApiError>; -export type ClearErrorAction = Action<'mvj/api/CLEAR_ERROR', void>; - -export type ApiState = { - error: ApiError, -}; diff --git a/src/api/types.ts b/src/api/types.ts new file mode 100644 index 000000000..dd5bca372 --- /dev/null +++ b/src/api/types.ts @@ -0,0 +1,7 @@ +import type { Action } from "../types"; +export type ApiError = Record | null; +export type ReceiveErrorAction = Action<"mvj/api/RECEIVE_ERROR", ApiError>; +export type ClearErrorAction = Action<"mvj/api/CLEAR_ERROR", void>; +export type ApiState = { + error: ApiError; +}; \ No newline at end of file diff --git a/src/app/App.js b/src/app/App.js deleted file mode 100644 index 53be89a14..000000000 --- a/src/app/App.js +++ /dev/null @@ -1,337 +0,0 @@ -// @flow -import React, {Component} from 'react'; -import {connect} from 'react-redux'; -import ReduxToastr from 'react-redux-toastr'; -import {withRouter} from 'react-router'; -import flowRight from 'lodash/flowRight'; -import isEmpty from 'lodash/isEmpty'; -import get from 'lodash/get'; -import {Sizes} from '$src/foundation/enums'; -import {revealContext} from '$src/foundation/reveal'; - -import {ActionTypes, AppConsumer, AppProvider} from '$src/app/AppContext'; -import ApiErrorModal from '$src/api/ApiErrorModal'; -import ConfirmationModal from '$src/components/modal/ConfirmationModal'; -import Loader from '$components/loader/Loader'; -import LoginPage from '$src/auth/components/LoginPage'; -import SideMenu from '$components/sideMenu/SideMenu'; -import TopNavigation from '$components/topNavigation/TopNavigation'; -import userManager from '$src/auth/util/user-manager'; -import {Routes, getRouteById} from '$src/root/routes'; -import {clearError} from '$src/api/actions'; -import {clearApiToken, fetchApiToken} from '$src/auth/actions'; -import {getEpochTime} from '$util/helpers'; -import {getError} from '$src/api/selectors'; -import {getApiToken, getApiTokenExpires, getIsFetching, getLoggedInUser} from '$src/auth/selectors'; -import {getLinkUrl, getPageTitle, getShowSearch} from '$components/topNavigation/selectors'; -import {getUserGroups, getUserActiveServiceUnit, getUserServiceUnits} from '$src/usersPermissions/selectors'; -import {setRedirectUrlToSessionStorage} from '$util/storage'; - -import type {ApiError} from '../api/types'; -import type {ApiToken} from '../auth/types'; -import type {UserGroups, UserServiceUnit, UserServiceUnits} from '$src/usersPermissions/types'; -import type {RootState} from '../root/types'; - -const url = window.location.toString(); -const IS_DEVELOPMENT_URL = url.includes('ninja') || url.includes('localhost'); - -type OwnProps = { - children: React$Node, -}; - -type Props = { - ...OwnProps, - apiError: ApiError, - apiToken: ApiToken, - apiTokenExpires: number, - clearApiToken: Function, - clearError: typeof clearError, - closeReveal: Function, - fetchApiToken: Function, - history: Object, - isApiTokenFetching: boolean, - linkUrl: string, - location: Object, - pageTitle: string, - userActiveServiceUnit: UserServiceUnit, - userServiceUnits: UserServiceUnits, - showSearch: boolean, - user: Object, - userGroups: UserGroups, -}; - -type State = { - displaySideMenu: boolean, - loggedIn: boolean, -}; - -class App extends Component { - state = { - displaySideMenu: false, - loggedIn: false, - } - - timerID: any - - componentWillUnmount() { - this.stopApiTokenTimer(); - } - - startApiTokenTimer = () => { - this.timerID = setInterval( - () => this.checkApiToken(), - 5000 - ); - } - - stopApiTokenTimer = () => { - clearInterval(this.timerID); - } - - componentDidUpdate(prevProps: Props) { - const { - apiError, - apiToken, - clearApiToken, - fetchApiToken, - history, - isApiTokenFetching, - user, - } = this.props; - const {loggedIn} = this.state; - - if(apiError) { - return; - } - - // Fetch api token if user info is received but Api token is empty - if(!isApiTokenFetching && - user && - user.access_token && - (isEmpty(apiToken) || user.access_token !== get(prevProps, 'user.access_token')) - ) { - fetchApiToken(user.access_token); - this.startApiTokenTimer(); - return; - } - - if(apiToken && !prevProps.apiToken) { - this.setState({loggedIn: true}); - } - - // Clear API token when user has logged out - if(!user && !isEmpty(apiToken)) { - clearApiToken(); - this.stopApiTokenTimer(); - - // If user has pressed logout button move to lease list page - if(!loggedIn) { - history.push(getRouteById(Routes.LEASES)); - } - } - } - - handleLogin = (event: any) => { - const {location: {pathname, search}} = this.props; - - event.preventDefault(); - userManager.signinRedirect(); - - setRedirectUrlToSessionStorage(`${pathname}${search}` || getRouteById(Routes.LEASES)); - } - - logOut = () => { - this.setState({ - loggedIn: false, - }, () => { - userManager.removeUser(); - sessionStorage.clear(); - }); - - } - - checkApiToken () { - const {apiTokenExpires, fetchApiToken} = this.props; - - if((apiTokenExpires <= getEpochTime()) && get(this.props, 'user.access_token')) { - fetchApiToken(this.props.user.access_token); - } - } - - toggleSideMenu = () => { - return this.setState({ - displaySideMenu: !this.state.displaySideMenu, - }); - }; - - handleDismissErrorModal = () => { - this.props.closeReveal('apiError'); - this.props.clearError(); - }; - - render() { - const {apiError, - apiToken, - children, - isApiTokenFetching, - linkUrl, - location, - pageTitle, - showSearch, - user, - userGroups, - userActiveServiceUnit, - userServiceUnits, - } = this.props; - const {displaySideMenu} = this.state; - const appStyle = (IS_DEVELOPMENT_URL) ? 'app-dev' : 'app'; - - if (isEmpty(user) || isEmpty(apiToken)) { - return ( -
- - - - - - - - {location.pathname === getRouteById(Routes.CALLBACK) && children} -
- ); - } - - return ( - - - {({ - isConfirmationModalOpen, - confirmationFunction, - confirmationModalButtonClassName, - confirmationModalButtonText, - confirmationModalLabel, - confirmationModalTitle, - dispatch, - }) => { - const handleConfirmation = () => { - confirmationFunction?.(); - handleHideConfirmationModal(); - }; - - const handleHideConfirmationModal = () => { - dispatch({type: ActionTypes.HIDE_CONFIRMATION_MODAL}); - }; - - return ( -
- - - - - - - - -
- -
- {children} -
-
-
- ); - }} -
-
- ); - } -} - -const mapStateToProps = (state: RootState) => { - const user = getLoggedInUser(state); - - if (!user || user.expired) { - return { - apiToken: getApiToken(state), - pageTitle: getPageTitle(state), - showSearch: getShowSearch(state), - user: null, - }; - } - - return { - apiError: getError(state), - apiToken: getApiToken(state), - apiTokenExpires: getApiTokenExpires(state), - isApiTokenFetching: getIsFetching(state), - linkUrl: getLinkUrl(state), - pageTitle: getPageTitle(state), - showSearch: getShowSearch(state), - user, - userGroups: getUserGroups(state), - userServiceUnits: getUserServiceUnits(state), - userActiveServiceUnit: getUserActiveServiceUnit(state), - }; -}; - -export default (flowRight( - withRouter, - connect( - mapStateToProps, - { - clearError, - clearApiToken, - fetchApiToken, - }, - ), - revealContext(), -)(App): React$ComponentType); diff --git a/src/app/App.tsx b/src/app/App.tsx new file mode 100644 index 000000000..7b3e06008 --- /dev/null +++ b/src/app/App.tsx @@ -0,0 +1,271 @@ +import React, { Component } from "react"; +import { connect } from "react-redux"; +import ReduxToastr from "react-redux-toastr"; +import { withRouter } from "react-router"; +import flowRight from "lodash/flowRight"; +import isEmpty from "lodash/isEmpty"; +import get from "lodash/get"; +import { Sizes } from "src/foundation/enums"; +import { revealContext } from "src/foundation/reveal"; +import { ActionTypes, AppConsumer, AppProvider } from "src/app/AppContext"; +import ApiErrorModal from "src/api/ApiErrorModal"; +import ConfirmationModal from "src/components/modal/ConfirmationModal"; +import Loader from "src/components/loader/Loader"; +import LoginPage from "src/auth/components/LoginPage"; +import SideMenu from "src/components/sideMenu/SideMenu"; +import TopNavigation from "src/components/topNavigation/TopNavigation"; +import userManager from "src/auth/util/user-manager"; +import { Routes, getRouteById } from "src/root/routes"; +import { clearError } from "src/api/actions"; +import { clearApiToken, fetchApiToken } from "src/auth/actions"; +import { getEpochTime } from "src/util/helpers"; +import { getError } from "src/api/selectors"; +import { getApiToken, getApiTokenExpires, getIsFetching, getLoggedInUser } from "src/auth/selectors"; +import { getLinkUrl, getPageTitle, getShowSearch } from "src/components/topNavigation/selectors"; +import { getUserGroups, getUserActiveServiceUnit, getUserServiceUnits } from "src/usersPermissions/selectors"; +import { setRedirectUrlToSessionStorage } from "src/util/storage"; +import type { ApiError } from "../api/types"; +import type { ApiToken } from "../auth/types"; +import type { UserGroups, UserServiceUnit, UserServiceUnits } from "src/usersPermissions/types"; +import type { RootState } from "../root/types"; +const url = window.location.toString(); +const IS_DEVELOPMENT_URL = url.includes('ninja') || url.includes('localhost'); +type OwnProps = { + children: React.ReactNode; +}; +type Props = OwnProps & { + apiError: ApiError; + apiToken: ApiToken; + apiTokenExpires: number; + clearApiToken: (...args: Array) => any; + clearError: typeof clearError; + closeReveal: (...args: Array) => any; + fetchApiToken: (...args: Array) => any; + history: Record; + isApiTokenFetching: boolean; + linkUrl: string; + location: Record; + pageTitle: string; + userActiveServiceUnit: UserServiceUnit; + userServiceUnits: UserServiceUnits; + showSearch: boolean; + user: Record; + userGroups: UserGroups; +}; +type State = { + displaySideMenu: boolean; + loggedIn: boolean; +}; + +class App extends Component { + state = { + displaySideMenu: false, + loggedIn: false + }; + timerID: any; + + componentWillUnmount() { + this.stopApiTokenTimer(); + } + + startApiTokenTimer = () => { + this.timerID = setInterval(() => this.checkApiToken(), 5000); + }; + stopApiTokenTimer = () => { + clearInterval(this.timerID); + }; + + componentDidUpdate(prevProps: Props) { + const { + apiError, + apiToken, + clearApiToken, + fetchApiToken, + history, + isApiTokenFetching, + user + } = this.props; + const { + loggedIn + } = this.state; + + if (apiError) { + return; + } + + // Fetch api token if user info is received but Api token is empty + if (!isApiTokenFetching && user && user.access_token && (isEmpty(apiToken) || user.access_token !== get(prevProps, 'user.access_token'))) { + fetchApiToken(user.access_token); + this.startApiTokenTimer(); + return; + } + + if (apiToken && !prevProps.apiToken) { + this.setState({ + loggedIn: true + }); + } + + // Clear API token when user has logged out + if (!user && !isEmpty(apiToken)) { + clearApiToken(); + this.stopApiTokenTimer(); + + // If user has pressed logout button move to lease list page + if (!loggedIn) { + history.push(getRouteById(Routes.LEASES)); + } + } + } + + handleLogin = (event: any) => { + const { + location: { + pathname, + search + } + } = this.props; + event.preventDefault(); + userManager.signinRedirect(); + setRedirectUrlToSessionStorage(`${pathname}${search}` || getRouteById(Routes.LEASES)); + }; + logOut = () => { + this.setState({ + loggedIn: false + }, () => { + userManager.removeUser(); + sessionStorage.clear(); + }); + }; + + checkApiToken() { + const { + apiTokenExpires, + fetchApiToken + } = this.props; + + if (apiTokenExpires <= getEpochTime() && get(this.props, 'user.access_token')) { + fetchApiToken(this.props.user.access_token); + } + } + + toggleSideMenu = () => { + return this.setState({ + displaySideMenu: !this.state.displaySideMenu + }); + }; + handleDismissErrorModal = () => { + this.props.closeReveal('apiError'); + this.props.clearError(); + }; + + render() { + const { + apiError, + apiToken, + children, + isApiTokenFetching, + linkUrl, + location, + pageTitle, + showSearch, + user, + userGroups, + userActiveServiceUnit, + userServiceUnits + } = this.props; + const { + displaySideMenu + } = this.state; + const appStyle = IS_DEVELOPMENT_URL ? 'app-dev' : 'app'; + + if (isEmpty(user) || isEmpty(apiToken)) { + return
+ + + + + + + + {location.pathname === getRouteById(Routes.CALLBACK) && children} +
; + } + + return + + {({ + isConfirmationModalOpen, + confirmationFunction, + confirmationModalButtonClassName, + confirmationModalButtonText, + confirmationModalLabel, + confirmationModalTitle, + dispatch + }) => { + const handleConfirmation = () => { + confirmationFunction?.(); + handleHideConfirmationModal(); + }; + + const handleHideConfirmationModal = () => { + dispatch({ + type: ActionTypes.HIDE_CONFIRMATION_MODAL + }); + }; + + return
+ + + + + + + + +
+ +
+ {children} +
+
+
; + }} +
+
; + } + +} + +const mapStateToProps = (state: RootState) => { + const user = getLoggedInUser(state); + + if (!user || user.expired) { + return { + apiToken: getApiToken(state), + pageTitle: getPageTitle(state), + showSearch: getShowSearch(state), + user: null + }; + } + + return { + apiError: getError(state), + apiToken: getApiToken(state), + apiTokenExpires: getApiTokenExpires(state), + isApiTokenFetching: getIsFetching(state), + linkUrl: getLinkUrl(state), + pageTitle: getPageTitle(state), + showSearch: getShowSearch(state), + user, + userGroups: getUserGroups(state), + userServiceUnits: getUserServiceUnits(state), + userActiveServiceUnit: getUserActiveServiceUnit(state) + }; +}; + +export default (flowRight(withRouter, connect(mapStateToProps, { + clearError, + clearApiToken, + fetchApiToken +}), revealContext())(App) as React.ComponentType); \ No newline at end of file diff --git a/src/app/AppContext.js b/src/app/AppContext.tsx similarity index 53% rename from src/app/AppContext.js rename to src/app/AppContext.tsx index 7c8d34d29..4b670db0d 100644 --- a/src/app/AppContext.js +++ b/src/app/AppContext.tsx @@ -1,53 +1,49 @@ -// @flow - -import React from 'react'; - -const Context: React$Context<$Shape> = React.createContext({}); - +import { $Shape } from "utility-types"; +import React from "react"; +const Context: React.Context<$Shape> = React.createContext({}); export const ActionTypes = { HIDE_CONFIRMATION_MODAL: 'HIDE_CONFIRMATION_MODAL', - SHOW_CONFIRMATION_MODAL: 'SHOW_CONFIRMATION_MODAL', + SHOW_CONFIRMATION_MODAL: 'SHOW_CONFIRMATION_MODAL' }; const reducer = (state, action) => { - switch(action.type) { + switch (action.type) { case ActionTypes.HIDE_CONFIRMATION_MODAL: - return {...state, isConfirmationModalOpen: false}; + return { ...state, + isConfirmationModalOpen: false + }; + case ActionTypes.SHOW_CONFIRMATION_MODAL: const { confirmationFunction, confirmationModalButtonClassName, confirmationModalButtonText, confirmationModalLabel, - confirmationModalTitle, + confirmationModalTitle } = action; - - return { - ...state, + return { ...state, confirmationFunction: confirmationFunction, confirmationModalButtonClassName: confirmationModalButtonClassName, confirmationModalButtonText: confirmationModalButtonText, confirmationModalLabel: confirmationModalLabel, confirmationModalTitle: confirmationModalTitle, - isConfirmationModalOpen: true, + isConfirmationModalOpen: true }; } }; type Props = { - children: any, -} - + children: any; +}; type AppContextState = { - confirmationFunction: ?Function, - confirmationModalButtonClassName: ?string, - confirmationModalButtonText: ?string, - confirmationModalLabel: ?string, - confirmationModalTitle: ?string, - isConfirmationModalOpen: boolean, - dispatch: Function, -} - + confirmationFunction: ((...args: Array) => any) | null | undefined; + confirmationModalButtonClassName: string | null | undefined; + confirmationModalButtonText: string | null | undefined; + confirmationModalLabel: string | null | undefined; + confirmationModalTitle: string | null | undefined; + isConfirmationModalOpen: boolean; + dispatch: (...args: Array) => any; +}; export class AppProvider extends React.Component { state: AppContextState = { confirmationFunction: null, @@ -56,16 +52,20 @@ export class AppProvider extends React.Component { confirmationModalLabel: null, confirmationModalTitle: null, isConfirmationModalOpen: false, - - dispatch: (action) => { - this.setState((state) => reducer(state, action)); - }, + dispatch: action => { + this.setState(state => reducer(state, action)); + } }; - render(): React$Node { - const {state, props: {children}} = this; + render(): React.ReactNode { + const { + state, + props: { + children + } + } = this; return {children}; } -} -export const AppConsumer = Context.Consumer; +} +export const AppConsumer = Context.Consumer; \ No newline at end of file diff --git a/src/application/actions.js b/src/application/actions.js deleted file mode 100644 index 2fbe73e87..000000000 --- a/src/application/actions.js +++ /dev/null @@ -1,82 +0,0 @@ -// @flow -import {createAction} from 'redux-actions'; - -import type { - ApplicantInfoCheckAttributesNotFoundAction, - ApplicationRelatedAttachmentsNotFoundAction, - AttachmentAttributesNotFoundAction, - AttributesNotFoundAction, - DeleteUploadAction, - FetchApplicantInfoCheckAttributesAction, - FetchApplicationRelatedAttachmentsAction, - FetchAttachmentAttributesAction, - FetchAttributesAction, - FetchFormAttributesAction, - FetchPendingUploadsAction, - FormAttributesNotFoundAction, - PendingUploadsNotFoundAction, - ReceiveApplicantInfoCheckAttributesAction, - ReceiveApplicationRelatedAttachmentsAction, - ReceiveAttachmentAttributesAction, - ReceiveAttachmentMethodsAction, - ReceiveAttributesAction, - ReceiveFileOperationFinishedAction, - ReceiveFormAttributesAction, - ReceiveMethodsAction, - ReceivePendingUploadsAction, - ReceiveUpdatedApplicantInfoCheckItemAction, - ReceiveUpdatedTargetInfoCheckItemAction, - UploadFileAction, -} from '$src/application/types'; -import type {Attributes, Methods} from '$src/types'; - -export const fetchAttributes = (): FetchAttributesAction => - createAction('mvj/application/FETCH_ATTRIBUTES')(); -export const receiveMethods = (methods: Methods): ReceiveMethodsAction => - createAction('mvj/application/RECEIVE_METHODS')(methods); -export const attributesNotFound = (): AttributesNotFoundAction => - createAction('mvj/application/ATTRIBUTES_NOT_FOUND')(); -export const receiveAttributes = (attributes: Attributes): ReceiveAttributesAction => - createAction('mvj/application/RECEIVE_ATTRIBUTES')(attributes); -export const fetchApplicantInfoCheckAttributes = (): FetchApplicantInfoCheckAttributesAction => - createAction('mvj/application/FETCH_APPLICANT_INFO_CHECK_ATTRIBUTES')(); -export const receiveApplicantInfoCheckAttributes = (payload: Object): ReceiveApplicantInfoCheckAttributesAction => - createAction('mvj/application/RECEIVE_APPLICANT_INFO_CHECK_ATTRIBUTES')(payload); -export const applicantInfoCheckAttributesNotFound = (): ApplicantInfoCheckAttributesNotFoundAction => - createAction('mvj/application/APPLICANT_INFO_CHECK_ATTRIBUTES_NOT_FOUND')(); -export const receiveUpdatedApplicantInfoCheckItem = (payload: Object): ReceiveUpdatedApplicantInfoCheckItemAction => - createAction('mvj/application/RECEIVE_UPDATED_APPLICANT_INFO_CHECK_ITEM')(payload); -export const receiveUpdatedTargetInfoCheckItem = (payload: Object): ReceiveUpdatedTargetInfoCheckItemAction => - createAction('mvj/application/RECEIVE_UPDATED_TARGET_INFO_CHECK_ITEM')(payload); -export const fetchFormAttributes = (payload: Object): FetchFormAttributesAction => - createAction('mvj/application/FETCH_FORM_ATTRIBUTES')(payload); -export const formAttributesNotFound = (): FormAttributesNotFoundAction => - createAction('mvj/application/FORM_ATTRIBUTES_NOT_FOUND')(); -export const receiveFormAttributes = (attributes: Attributes): ReceiveFormAttributesAction => - createAction('mvj/application/RECEIVE_FORM_ATTRIBUTES')(attributes); -export const fetchAttachmentAttributes = (): FetchAttachmentAttributesAction => - createAction('mvj/application/FETCH_ATTACHMENT_ATTRIBUTES')(); -export const receiveAttachmentAttributes = (payload: Object): ReceiveAttachmentAttributesAction => - createAction('mvj/application/RECEIVE_ATTACHMENT_ATTRIBUTES')(payload); -export const receiveAttachmentMethods = (payload: Object): ReceiveAttachmentMethodsAction => - createAction('mvj/application/RECEIVE_ATTACHMENT_METHODS')(payload); -export const attachmentAttributesNotFound = (): AttachmentAttributesNotFoundAction => - createAction('mvj/application/ATTACHMENT_ATTRIBUTES_NOT_FOUND')(); -export const fetchApplicationRelatedAttachments = (payload: Object): FetchApplicationRelatedAttachmentsAction => - createAction('mvj/application/FETCH_ATTACHMENTS')(payload); -export const receiveApplicationRelatedAttachments = (payload: Object): ReceiveApplicationRelatedAttachmentsAction => - createAction('mvj/application/RECEIVE_ATTACHMENTS')(payload); -export const applicationRelatedAttachmentsNotFound = (payload: Object): ApplicationRelatedAttachmentsNotFoundAction => - createAction('mvj/application/ATTACHMENTS_NOT_FOUND')(payload); -export const deleteUploadedAttachment = (payload: Object): DeleteUploadAction => - createAction('mvj/application/DELETE_UPLOAD')(payload); -export const uploadAttachment = (payload: Object): UploadFileAction => - createAction('mvj/application/UPLOAD_FILE')(payload); -export const fetchPendingUploads = (): FetchPendingUploadsAction => - createAction('mvj/application/FETCH_PENDING_UPLOADS')(); -export const receivePendingUploads = (payload: Object): ReceivePendingUploadsAction => - createAction('mvj/application/RECEIVE_PENDING_UPLOADS')(payload); -export const pendingUploadsNotFound = (): PendingUploadsNotFoundAction => - createAction('mvj/application/PENDING_UPLOADS_NOT_FOUND')(); -export const receiveFileOperationFinished = (): ReceiveFileOperationFinishedAction => - createAction('mvj/application/RECEIVE_FILE_OPERATION_FINISHED')(); diff --git a/src/application/actions.ts b/src/application/actions.ts new file mode 100644 index 000000000..1a3ec2596 --- /dev/null +++ b/src/application/actions.ts @@ -0,0 +1,28 @@ +import { createAction } from "redux-actions"; +import type { ApplicantInfoCheckAttributesNotFoundAction, ApplicationRelatedAttachmentsNotFoundAction, AttachmentAttributesNotFoundAction, AttributesNotFoundAction, DeleteUploadAction, FetchApplicantInfoCheckAttributesAction, FetchApplicationRelatedAttachmentsAction, FetchAttachmentAttributesAction, FetchAttributesAction, FetchFormAttributesAction, FetchPendingUploadsAction, FormAttributesNotFoundAction, PendingUploadsNotFoundAction, ReceiveApplicantInfoCheckAttributesAction, ReceiveApplicationRelatedAttachmentsAction, ReceiveAttachmentAttributesAction, ReceiveAttachmentMethodsAction, ReceiveAttributesAction, ReceiveFileOperationFinishedAction, ReceiveFormAttributesAction, ReceiveMethodsAction, ReceivePendingUploadsAction, ReceiveUpdatedApplicantInfoCheckItemAction, ReceiveUpdatedTargetInfoCheckItemAction, UploadFileAction } from "src/application/types"; +import type { Attributes, Methods } from "src/types"; +export const fetchAttributes = (): FetchAttributesAction => createAction('mvj/application/FETCH_ATTRIBUTES')(); +export const receiveMethods = (methods: Methods): ReceiveMethodsAction => createAction('mvj/application/RECEIVE_METHODS')(methods); +export const attributesNotFound = (): AttributesNotFoundAction => createAction('mvj/application/ATTRIBUTES_NOT_FOUND')(); +export const receiveAttributes = (attributes: Attributes): ReceiveAttributesAction => createAction('mvj/application/RECEIVE_ATTRIBUTES')(attributes); +export const fetchApplicantInfoCheckAttributes = (): FetchApplicantInfoCheckAttributesAction => createAction('mvj/application/FETCH_APPLICANT_INFO_CHECK_ATTRIBUTES')(); +export const receiveApplicantInfoCheckAttributes = (payload: Record): ReceiveApplicantInfoCheckAttributesAction => createAction('mvj/application/RECEIVE_APPLICANT_INFO_CHECK_ATTRIBUTES')(payload); +export const applicantInfoCheckAttributesNotFound = (): ApplicantInfoCheckAttributesNotFoundAction => createAction('mvj/application/APPLICANT_INFO_CHECK_ATTRIBUTES_NOT_FOUND')(); +export const receiveUpdatedApplicantInfoCheckItem = (payload: Record): ReceiveUpdatedApplicantInfoCheckItemAction => createAction('mvj/application/RECEIVE_UPDATED_APPLICANT_INFO_CHECK_ITEM')(payload); +export const receiveUpdatedTargetInfoCheckItem = (payload: Record): ReceiveUpdatedTargetInfoCheckItemAction => createAction('mvj/application/RECEIVE_UPDATED_TARGET_INFO_CHECK_ITEM')(payload); +export const fetchFormAttributes = (payload: Record): FetchFormAttributesAction => createAction('mvj/application/FETCH_FORM_ATTRIBUTES')(payload); +export const formAttributesNotFound = (): FormAttributesNotFoundAction => createAction('mvj/application/FORM_ATTRIBUTES_NOT_FOUND')(); +export const receiveFormAttributes = (attributes: Attributes): ReceiveFormAttributesAction => createAction('mvj/application/RECEIVE_FORM_ATTRIBUTES')(attributes); +export const fetchAttachmentAttributes = (): FetchAttachmentAttributesAction => createAction('mvj/application/FETCH_ATTACHMENT_ATTRIBUTES')(); +export const receiveAttachmentAttributes = (payload: Record): ReceiveAttachmentAttributesAction => createAction('mvj/application/RECEIVE_ATTACHMENT_ATTRIBUTES')(payload); +export const receiveAttachmentMethods = (payload: Record): ReceiveAttachmentMethodsAction => createAction('mvj/application/RECEIVE_ATTACHMENT_METHODS')(payload); +export const attachmentAttributesNotFound = (): AttachmentAttributesNotFoundAction => createAction('mvj/application/ATTACHMENT_ATTRIBUTES_NOT_FOUND')(); +export const fetchApplicationRelatedAttachments = (payload: Record): FetchApplicationRelatedAttachmentsAction => createAction('mvj/application/FETCH_ATTACHMENTS')(payload); +export const receiveApplicationRelatedAttachments = (payload: Record): ReceiveApplicationRelatedAttachmentsAction => createAction('mvj/application/RECEIVE_ATTACHMENTS')(payload); +export const applicationRelatedAttachmentsNotFound = (payload: Record): ApplicationRelatedAttachmentsNotFoundAction => createAction('mvj/application/ATTACHMENTS_NOT_FOUND')(payload); +export const deleteUploadedAttachment = (payload: Record): DeleteUploadAction => createAction('mvj/application/DELETE_UPLOAD')(payload); +export const uploadAttachment = (payload: Record): UploadFileAction => createAction('mvj/application/UPLOAD_FILE')(payload); +export const fetchPendingUploads = (): FetchPendingUploadsAction => createAction('mvj/application/FETCH_PENDING_UPLOADS')(); +export const receivePendingUploads = (payload: Record): ReceivePendingUploadsAction => createAction('mvj/application/RECEIVE_PENDING_UPLOADS')(payload); +export const pendingUploadsNotFound = (): PendingUploadsNotFoundAction => createAction('mvj/application/PENDING_UPLOADS_NOT_FOUND')(); +export const receiveFileOperationFinished = (): ReceiveFileOperationFinishedAction => createAction('mvj/application/RECEIVE_FILE_OPERATION_FINISHED')(); \ No newline at end of file diff --git a/src/application/components/ApplicationAnswersField.js b/src/application/components/ApplicationAnswersField.js deleted file mode 100644 index fdd587d0c..000000000 --- a/src/application/components/ApplicationAnswersField.js +++ /dev/null @@ -1,125 +0,0 @@ -// @flow - -import React from 'react'; -import {Column, Row} from 'react-foundation'; - -import FileDownloadLink from '$components/file/FileDownloadLink'; -import FormTextTitle from '$components/form/FormTextTitle'; -import FormText from '$components/form/FormText'; -import ApplicationAnswersSection from '$src/application/components/ApplicationAnswersSection'; -import {getApplicationAttachmentDownloadLink} from '$src/application/helpers'; - -import type { - FormSection, - SavedApplicationFormSection, - SectionExtraComponentProps, - UploadedFileMeta, -} from '$src/application/types'; - -type Props = { - section: FormSection, - answer: SavedApplicationFormSection, - topLevel: boolean, - fieldTypes: Array<{ value: string, display_name: string }>, - identifier: string, - sectionExtraComponent?: React$ComponentType, - sectionTitleTransformers?: Array<(string, FormSection, SavedApplicationFormSection) => string>, -}; - -const ApplicationAnswersField = ({ - section, - answer, - fieldTypes, - topLevel, - identifier, - sectionExtraComponent: SectionExtraComponent, - sectionTitleTransformers, -}: Props): React$Node => { - return <> - - {section.fields.filter((field) => field.enabled).map((field) => { - const fieldAnswer = answer.fields[field.identifier]; - const fieldType = fieldTypes?.find((fieldType) => fieldType.value === field.type)?.value; - - if (fieldType === 'hidden') { - return null; - } - - const getChoiceName = (id) => { - if (!id) { - return null; - } - - const choice = field.choices.find((choice) => choice.value === id || Number(choice.value) === id); - - let name = choice?.text || '(tuntematon vaihtoehto)'; - if (choice?.has_text_input) { - name += ` (${fieldAnswer.extra_value})`; - } - - return name; - }; - - let displayValue = fieldAnswer?.value; - if (displayValue !== undefined && displayValue !== null) { - switch (fieldType) { - case 'radiobutton': - case 'radiobuttoninline': - displayValue = getChoiceName(displayValue); - break; - case 'checkbox': - case 'dropdown': - if (Array.isArray(displayValue)) { - displayValue = displayValue.map(getChoiceName).join(', '); - } else { - if (field.choices.length > 0) { - displayValue = getChoiceName(displayValue); - } else { - displayValue = displayValue === true ? 'Kyllä' : 'Ei'; - } - } - break; - case 'uploadfiles': - // TODO: can this be cast in a cleaner way? - const files: Array = (displayValue: any); - displayValue = files.length > 0 ?
    {files.map((file) =>
  • - -
  • )}
: null; - break; - case 'hidden': - break; - } - } - - return - - {field.label} - - - {displayValue || '-'} - - ; - })} -
- {section.subsections.filter((section) => section.visible).map((subsection) => - )} - {SectionExtraComponent ? : null} - ; -}; - -export default ApplicationAnswersField; diff --git a/src/application/components/ApplicationAnswersField.tsx b/src/application/components/ApplicationAnswersField.tsx new file mode 100644 index 000000000..3c9c92873 --- /dev/null +++ b/src/application/components/ApplicationAnswersField.tsx @@ -0,0 +1,107 @@ +import React from "react"; +import { Column, Row } from "react-foundation"; +import FileDownloadLink from "src/components/file/FileDownloadLink"; +import FormTextTitle from "src/components/form/FormTextTitle"; +import FormText from "src/components/form/FormText"; +import ApplicationAnswersSection from "src/application/components/ApplicationAnswersSection"; +import { getApplicationAttachmentDownloadLink } from "src/application/helpers"; +import type { FormSection, SavedApplicationFormSection, SectionExtraComponentProps, UploadedFileMeta } from "src/application/types"; +type Props = { + section: FormSection; + answer: SavedApplicationFormSection; + topLevel: boolean; + fieldTypes: Array<{ + value: string; + display_name: string; + }>; + identifier: string; + sectionExtraComponent?: React.ComponentType; + sectionTitleTransformers?: Array<(arg0: string, arg1: FormSection, arg2: SavedApplicationFormSection) => string>; +}; + +const ApplicationAnswersField = ({ + section, + answer, + fieldTypes, + topLevel, + identifier, + sectionExtraComponent: SectionExtraComponent, + sectionTitleTransformers +}: Props): React.ReactNode => { + return <> + + {section.fields.filter(field => field.enabled).map(field => { + const fieldAnswer = answer.fields[field.identifier]; + const fieldType = fieldTypes?.find(fieldType => fieldType.value === field.type)?.value; + + if (fieldType === 'hidden') { + return null; + } + + const getChoiceName = id => { + if (!id) { + return null; + } + + const choice = field.choices.find(choice => choice.value === id || Number(choice.value) === id); + let name = choice?.text || '(tuntematon vaihtoehto)'; + + if (choice?.has_text_input) { + name += ` (${fieldAnswer.extra_value})`; + } + + return name; + }; + + let displayValue = fieldAnswer?.value; + + if (displayValue !== undefined && displayValue !== null) { + switch (fieldType) { + case 'radiobutton': + case 'radiobuttoninline': + displayValue = getChoiceName(displayValue); + break; + + case 'checkbox': + case 'dropdown': + if (Array.isArray(displayValue)) { + displayValue = displayValue.map(getChoiceName).join(', '); + } else { + if (field.choices.length > 0) { + displayValue = getChoiceName(displayValue); + } else { + displayValue = displayValue === true ? 'Kyllä' : 'Ei'; + } + } + + break; + + case 'uploadfiles': + // TODO: can this be cast in a cleaner way? + const files: Array = (displayValue as any); + displayValue = files.length > 0 ?
    {files.map(file =>
  • + +
  • )}
: null; + break; + + case 'hidden': + break; + } + } + + return + + {field.label} + + + {displayValue || '-'} + + ; + })} +
+ {section.subsections.filter(section => section.visible).map(subsection => )} + {SectionExtraComponent ? : null} + ; +}; + +export default ApplicationAnswersField; \ No newline at end of file diff --git a/src/application/components/ApplicationAnswersSection.js b/src/application/components/ApplicationAnswersSection.js deleted file mode 100644 index 0974e69d3..000000000 --- a/src/application/components/ApplicationAnswersSection.js +++ /dev/null @@ -1,78 +0,0 @@ -// @flow - -import React from 'react'; - -import Collapse from '$components/collapse/Collapse'; -import SubTitle from '$components/content/SubTitle'; -import ApplicationAnswersField from '$src/application/components/ApplicationAnswersField'; - -import type { - FormSection, - SavedApplicationFormSection, - SectionExtraComponentProps, -} from '$src/application/types'; - -type Props = { - section: FormSection, - answer: SavedApplicationFormSection | Array, - topLevel?: boolean, - fieldTypes: Array<{ value: string, display_name: string }>, - sectionExtraComponent?: React$ComponentType, - sectionTitleTransformers?: Array<(string, FormSection, SavedApplicationFormSection) => string>, -}; - -const ApplicationAnswersSection = ({ - section, - answer, - topLevel = false, - fieldTypes, - sectionExtraComponent, - sectionTitleTransformers, -}: Props): React$Node => { - if (!answer) { - return null; - } - - const title = section.title || '(tuntematon osio)'; - - const Wrapper = topLevel ? - ({children}) => {children} : ({children}) =>
- - {title} - - {children} -
; - return - {section.add_new_allowed - ? (answer instanceof Array ? answer : []).map((singleAnswer, i) => { - const subtitle: string = (sectionTitleTransformers || []).reduce( - (title, transformer) => transformer(title, section, singleAnswer), `#${i + 1}`); - - return - - ; - }) - : } - ; -}; - -export default ApplicationAnswersSection; diff --git a/src/application/components/ApplicationAnswersSection.tsx b/src/application/components/ApplicationAnswersSection.tsx new file mode 100644 index 000000000..173163b27 --- /dev/null +++ b/src/application/components/ApplicationAnswersSection.tsx @@ -0,0 +1,51 @@ +import React from "react"; +import Collapse from "src/components/collapse/Collapse"; +import SubTitle from "src/components/content/SubTitle"; +import ApplicationAnswersField from "src/application/components/ApplicationAnswersField"; +import type { FormSection, SavedApplicationFormSection, SectionExtraComponentProps } from "src/application/types"; +type Props = { + section: FormSection; + answer: SavedApplicationFormSection | Array; + topLevel?: boolean; + fieldTypes: Array<{ + value: string; + display_name: string; + }>; + sectionExtraComponent?: React.ComponentType; + sectionTitleTransformers?: Array<(arg0: string, arg1: FormSection, arg2: SavedApplicationFormSection) => string>; +}; + +const ApplicationAnswersSection = ({ + section, + answer, + topLevel = false, + fieldTypes, + sectionExtraComponent, + sectionTitleTransformers +}: Props): React.ReactNode => { + if (!answer) { + return null; + } + + const title = section.title || '(tuntematon osio)'; + const Wrapper = topLevel ? ({ + children + }) => {children} : ({ + children + }) =>
+ + {title} + + {children} +
; + return + {section.add_new_allowed ? (answer instanceof Array ? answer : []).map((singleAnswer, i) => { + const subtitle: string = (sectionTitleTransformers || []).reduce((title, transformer) => transformer(title, section, singleAnswer), `#${i + 1}`); + return + + ; + }) : } + ; +}; + +export default ApplicationAnswersSection; \ No newline at end of file diff --git a/src/application/components/ApplicationSubsection.js b/src/application/components/ApplicationSubsection.js deleted file mode 100644 index 0172b0baf..000000000 --- a/src/application/components/ApplicationSubsection.js +++ /dev/null @@ -1,539 +0,0 @@ -// @flow -import React, {Fragment, useCallback} from 'react'; -import {change, FieldArray, formValueSelector} from 'redux-form'; -import {connect} from 'react-redux'; -import type {Fields} from 'redux-form/lib/FieldArrayProps.types'; -import {Column, Row} from 'react-foundation'; - -import AddButton from '$components/form/AddButton'; -import RemoveButton from '$components/form/RemoveButton'; -import FormField from '$components/form/FormField'; -import AddFileButton from '$components/form/AddFileButton'; -import FormTextTitle from '$components/form/FormTextTitle'; -import FormText from '$components/form/FormText'; -import Authorization from '$components/authorization/Authorization'; -import FileDownloadLink from '$components/file/FileDownloadLink'; -import LoadingIndicator from '$components/multi-select/LoadingIndicator'; -import {ButtonColors} from '$components/enums'; -import FormHintText from '$components/form/FormHintText'; -import {formatDate, isFieldAllowedToRead} from '$util/helpers'; -import {ConfirmationModalTexts} from '$src/enums'; -import {ActionTypes, AppConsumer} from '$src/app/AppContext'; -import {ApplicantTypes} from '$src/application/enums'; -import { - getApplicationAttachmentDownloadLink, - getFieldFileIds, - getSectionApplicantType, - getSectionTemplate, - valueToApplicantType, -} from '$src/application/helpers'; -import { - getAttachmentAttributes, - getAttachmentMethods, - getExistingUploads, - getFieldTypeMapping, - getIsFetchingApplicationRelatedAttachments, - getIsFetchingAttachmentAttributes, - getIsFetchingPendingUploads, - getIsPerformingFileOperation, - getPendingUploads, -} from '$src/application/selectors'; -import {ApplicationSectionKeys} from '$src/application/components/enums'; -import { - APPLICANT_MAIN_IDENTIFIERS, - APPLICANT_SECTION_IDENTIFIER, - APPLICANT_TYPE_FIELD_IDENTIFIER, - EMAIL_FIELD_IDENTIFIER, - TARGET_SECTION_IDENTIFIER, -} from '$src/application/constants'; -import { - deleteUploadedAttachment, - uploadAttachment, -} from '$src/application/actions'; - -import type { - FormSection, - PlotApplicationFormValue, - UploadedFileMeta, -} from '$src/application/types'; -import {companyIdentifierValidator, emailValidator, personalIdentifierValidator} from '$src/application/formValidation'; - -const ApplicationFormFileField = connect( - (state, props) => { - const {formName, formPath, field, fieldName} = props; - - return ({ - pendingUploads: getPendingUploads(state), - existingUploads: getExistingUploads(state, field.identifier), - attachmentMethods: getAttachmentMethods(state), - attachmentAttributes: getAttachmentAttributes(state), - isFetchingPendingUploads: getIsFetchingPendingUploads(state), - isFetchingAttachments: getIsFetchingApplicationRelatedAttachments(state), - isFetchingAttachmentAttributes: getIsFetchingAttachmentAttributes(state), - isPerformingFileOperation: getIsPerformingFileOperation(state), - fieldFileIds: getFieldFileIds(state, formName, fieldName), - attachmentIds: formValueSelector(formName)(state, (formPath ? `${formPath}.` : '') + 'attachments'), - }); - }, - { - uploadAttachment, - deleteUploadedAttachment, - change, - } -)(({ - uploadAttachment, - deleteUploadedAttachment, - pendingUploads, - existingUploads, - // TODO: Method authorization is disabled, since at this point in time, the backend returns false for all methods. - //attachmentMethods, - attachmentAttributes, - isFetchingPendingUploads, - isFetchingAttachments, - isFetchingAttachmentAttributes, - isPerformingFileOperation, - field, - fieldName, - change, - fieldFileIds, - attachmentIds, - formName, - formPath, - answerId, -}) => { - return ( - - {({dispatch}) => { - const isNew = !answerId; - const pathWithinForm = fieldName.split('.').slice(1).join('.'); - - const addId = (newId: number) => { - change(formName, `${fieldName}.value`, [...fieldFileIds, newId]); - change(formName, (formPath ? `${formPath}.` : '') + 'attachments', [...attachmentIds, newId]); - }; - - const removeId = (newId: number) => { - change(formName, `${fieldName}.value`, fieldFileIds.filter((id) => id !== newId)); - change(formName, (formPath ? `${formPath}.` : '') + 'attachments', attachmentIds.filter((id) => id !== newId)); - }; - - const submitFile = (fieldId, e) => { - uploadAttachment({ - fileData: { - field: fieldId, - file: e.target.files[0], - answer: answerId || undefined, - }, - callback: (path: string, uploadedFile: UploadedFileMeta) => { - addId(uploadedFile.id); - }, - path: pathWithinForm, - }); - }; - - const uploads = (isNew ? pendingUploads : existingUploads).filter((file) => fieldFileIds.includes(file.id)); - - const deleteFile = (file) => { - dispatch({ - type: ActionTypes.SHOW_CONFIRMATION_MODAL, - confirmationFunction: () => { - // Hard delete only if this is a new editor. Edit mode can be canceled, in which case changes to files - // are desirable to not also take place. Orphaned files not attached to an application anymore are - // planned to be removed by the backend periodically. - if (isNew) { - deleteUploadedAttachment(file); - } - - removeId(file.id); - }, - confirmationModalButtonClassName: ButtonColors.ALERT, - confirmationModalButtonText: ConfirmationModalTexts.DELETE_ATTACHMENT.BUTTON, - confirmationModalLabel: ConfirmationModalTexts.DELETE_ATTACHMENT.LABEL, - confirmationModalTitle: ConfirmationModalTexts.DELETE_ATTACHMENT.TITLE, - }); - }; - - const busy = isFetchingPendingUploads || isPerformingFileOperation || isFetchingAttachments || isFetchingAttachmentAttributes; - - return - {field.label} - {!isFetchingAttachmentAttributes && uploads.length > 0 && - - - - Tiedoston nimi - - - - - - - {'Ladattu'} - - - - } - {!isFetchingAttachmentAttributes && uploads.map((file, index) => { - return - - - - - - - - {formatDate(file.created_at) || '-'} - - - - - deleteFile(file)} - style={{right: 12}} - title="Poista liitetiedosto" - disabled={busy} - /> - - - ; - })} - {uploads.length === 0 && !busy && - - Ei lisättyjä liitteitä. - - } - - {busy - ? - : submitFile(field.id, e)} />} - - ;}} - - ); -}); - -const ApplicationFormSubsectionFields = connect( - (state, props) => ({ - sectionApplicantType: getSectionApplicantType(state, props.formName, props.section, props.identifier), - }), { - change, - } -)( - ({ - section, - identifier, - change, - sectionApplicantType, - formName, - formPath, - sectionTitleTransformers, - answerId, - }) => { - const renderField = useCallback((pathName, field) => { - if (!field.enabled) { - return null; - } - - const fieldName = [ - pathName, - ApplicationSectionKeys.Fields, - field.identifier, - ].join('.'); - const fieldType = field.type; - - // Special cases that use a different submission path and thus different props - if (fieldType === 'uploadfiles') { - return ; - } - - let extraAttributes = {}; - let fieldOverrides = {}; - let columnWidths = { - small: 12, - medium: 6, - large: 3, - }; - - switch (fieldType) { - case 'textbox': - case 'fractional': - break; - case 'textarea': - columnWidths = { - small: 12, - medium: 12, - large: 12, - }; - break; - case 'dropdown': - extraAttributes = { - choices: field.choices.map((option) => ({ - display_name: option.label, - value: option.value, - })), - }; - break; - case 'hidden': - if(field.identifier === APPLICANT_TYPE_FIELD_IDENTIFIER) { - change(formName, `${identifier}.metadata.applicantType`, valueToApplicantType(field.default_value)); - } - extraAttributes = { - type: 'hidden', - }; - break; - case 'checkbox': - fieldOverrides = { - options: field.choices.map((choice) => ({ - value: choice.value, - label: choice.has_text_input ? <> - {choice.text} - { ' ' } - - : choice.text, - })), - }; - columnWidths = { - small: 12, - medium: 12, - large: 12, - }; - break; - case 'radiobutton': - case 'radiobuttoninline': - extraAttributes = { - type: 'radio-with-field', - }; - fieldOverrides = { - options: field.choices.map((choice) => ({ - label: choice.text, - value: choice.value, - field: choice.has_text_input - ? - : null, - })), - }; - columnWidths = { - small: 12, - medium: 12, - large: 12, - }; - break; - default: - break; - } - - let validator; - switch (fieldName.substring(fieldName.lastIndexOf('.') + 1)) { - case APPLICANT_MAIN_IDENTIFIERS[ApplicantTypes.PERSON].IDENTIFIER_FIELD: - validator = personalIdentifierValidator; - break; - case APPLICANT_MAIN_IDENTIFIERS[ApplicantTypes.COMPANY].IDENTIFIER_FIELD: - validator = companyIdentifierValidator; - break; - case EMAIL_FIELD_IDENTIFIER: - validator = emailValidator; - break; - } - - return ( - - checkSpecialValues(field, newValue)} - validate={validator} - /> - - ); - }, []); - - const checkSpecialValues = useCallback((field: Object, newValue: PlotApplicationFormValue): void => { - if (field.identifier === APPLICANT_TYPE_FIELD_IDENTIFIER && section.identifier === APPLICANT_SECTION_IDENTIFIER) { - change(formName, `${identifier}.metadata.applicantType`, valueToApplicantType(newValue)); - } - }, []); - - return ( - <> - - {section.fields.map((field) => {renderField(identifier, field)})} - - {section.subsections.map((subsection) => ( - - ))} - - ); - } -); - -const ApplicationFormSubsectionFieldArray = ({ - fields, - section, - headerTag: HeaderTag, - formName, - formPath, - sectionTitleTransformers, - answerId, -}: { - fields: Fields, - section: Object, - headerTag: string | React$ComponentType<{ children?: React$Node }>, - formName: string, - formPath: string, - sectionTitleTransformers: Array<(string, FormSection, string) => string>, - answerId: number | null, -}): React$Node => { - return ( -
- {fields.map((identifier, i) => { - const subtitle: string = (sectionTitleTransformers || []).reduce( - (title, transformer) => transformer(title, section, identifier), `${section.title} (${i + 1})`); - - return ( -
-
- {fields.length > 1 && section.identifier !== TARGET_SECTION_IDENTIFIER && ( - fields.remove(i)} - style={{float: 'right'}} - /> - )} - - {subtitle} - - -
-
- ); - })} - {section.identifier !== TARGET_SECTION_IDENTIFIER && fields.push(getSectionTemplate(formName, formPath, section.identifier))} - label={section.add_new_text || 'Lisää uusi'} - />} -
- ); -}; - -const ApplicationSubsection = ({ - path, - section, - headerTag: HeaderTag = 'h3', - parentApplicantType, - formName, - formPath = '', - sectionTitleTransformers, - answerId, -}: { - path: Array, - section: Object, - headerTag?: string | React$ComponentType<{ children?: React$Node }>, - parentApplicantType?: string | null, - formName: string, - formPath: ?string, - sectionTitleTransformers: Array<(string, FormSection, string) => string>, - answerId: number | null, -}): React$Node => { - if (!section.visible) { - return null; - } - - if (parentApplicantType === ApplicantTypes.UNSELECTED) { - return null; - } - - if (parentApplicantType !== ApplicantTypes.NOT_APPLICABLE && ![ - ApplicantTypes.UNKNOWN, - ApplicantTypes.BOTH, - parentApplicantType, - ].includes(section.applicant_type)) { - return null; - } - - const isArray = section.add_new_allowed; - const pathName = [...path, section.identifier].join('.'); - - const title = section.title || '(tuntematon osio)'; - - return ( -
- {isArray ? ( - - ) : ( -
- {title} - -
- )} -
- ); -}; - -export default ApplicationSubsection; diff --git a/src/application/components/ApplicationSubsection.tsx b/src/application/components/ApplicationSubsection.tsx new file mode 100644 index 000000000..b798bcebe --- /dev/null +++ b/src/application/components/ApplicationSubsection.tsx @@ -0,0 +1,425 @@ +import React, { Fragment, useCallback } from "react"; +import { change, FieldArray, formValueSelector } from "redux-form"; +import { connect } from "react-redux"; +import type { Fields } from "redux-form/lib/FieldArrayProps.types"; +import { Column, Row } from "react-foundation"; +import AddButton from "src/components/form/AddButton"; +import RemoveButton from "src/components/form/RemoveButton"; +import FormField from "src/components/form/FormField"; +import AddFileButton from "src/components/form/AddFileButton"; +import FormTextTitle from "src/components/form/FormTextTitle"; +import FormText from "src/components/form/FormText"; +import Authorization from "src/components/authorization/Authorization"; +import FileDownloadLink from "src/components/file/FileDownloadLink"; +import LoadingIndicator from "src/components/multi-select/LoadingIndicator"; +import { ButtonColors } from "src/components/enums"; +import FormHintText from "src/components/form/FormHintText"; +import { formatDate, isFieldAllowedToRead } from "src/util/helpers"; +import { ConfirmationModalTexts } from "src/enums"; +import { ActionTypes, AppConsumer } from "src/app/AppContext"; +import { ApplicantTypes } from "src/application/enums"; +import { getApplicationAttachmentDownloadLink, getFieldFileIds, getSectionApplicantType, getSectionTemplate, valueToApplicantType } from "src/application/helpers"; +import { getAttachmentAttributes, getAttachmentMethods, getExistingUploads, getFieldTypeMapping, getIsFetchingApplicationRelatedAttachments, getIsFetchingAttachmentAttributes, getIsFetchingPendingUploads, getIsPerformingFileOperation, getPendingUploads } from "src/application/selectors"; +import { ApplicationSectionKeys } from "src/application/components/enums"; +import { APPLICANT_MAIN_IDENTIFIERS, APPLICANT_SECTION_IDENTIFIER, APPLICANT_TYPE_FIELD_IDENTIFIER, EMAIL_FIELD_IDENTIFIER, TARGET_SECTION_IDENTIFIER } from "src/application/constants"; +import { deleteUploadedAttachment, uploadAttachment } from "src/application/actions"; +import type { FormSection, PlotApplicationFormValue, UploadedFileMeta } from "src/application/types"; +import { companyIdentifierValidator, emailValidator, personalIdentifierValidator } from "src/application/formValidation"; +const ApplicationFormFileField = connect((state, props) => { + const { + formName, + formPath, + field, + fieldName + } = props; + return { + pendingUploads: getPendingUploads(state), + existingUploads: getExistingUploads(state, field.identifier), + attachmentMethods: getAttachmentMethods(state), + attachmentAttributes: getAttachmentAttributes(state), + isFetchingPendingUploads: getIsFetchingPendingUploads(state), + isFetchingAttachments: getIsFetchingApplicationRelatedAttachments(state), + isFetchingAttachmentAttributes: getIsFetchingAttachmentAttributes(state), + isPerformingFileOperation: getIsPerformingFileOperation(state), + fieldFileIds: getFieldFileIds(state, formName, fieldName), + attachmentIds: formValueSelector(formName)(state, (formPath ? `${formPath}.` : '') + 'attachments') + }; +}, { + uploadAttachment, + deleteUploadedAttachment, + change +})(({ + uploadAttachment, + deleteUploadedAttachment, + pendingUploads, + existingUploads, + // TODO: Method authorization is disabled, since at this point in time, the backend returns false for all methods. + //attachmentMethods, + attachmentAttributes, + isFetchingPendingUploads, + isFetchingAttachments, + isFetchingAttachmentAttributes, + isPerformingFileOperation, + field, + fieldName, + change, + fieldFileIds, + attachmentIds, + formName, + formPath, + answerId +}) => { + return + {({ + dispatch + }) => { + const isNew = !answerId; + const pathWithinForm = fieldName.split('.').slice(1).join('.'); + + const addId = (newId: number) => { + change(formName, `${fieldName}.value`, [...fieldFileIds, newId]); + change(formName, (formPath ? `${formPath}.` : '') + 'attachments', [...attachmentIds, newId]); + }; + + const removeId = (newId: number) => { + change(formName, `${fieldName}.value`, fieldFileIds.filter(id => id !== newId)); + change(formName, (formPath ? `${formPath}.` : '') + 'attachments', attachmentIds.filter(id => id !== newId)); + }; + + const submitFile = (fieldId, e) => { + uploadAttachment({ + fileData: { + field: fieldId, + file: e.target.files[0], + answer: answerId || undefined + }, + callback: (path: string, uploadedFile: UploadedFileMeta) => { + addId(uploadedFile.id); + }, + path: pathWithinForm + }); + }; + + const uploads = (isNew ? pendingUploads : existingUploads).filter(file => fieldFileIds.includes(file.id)); + + const deleteFile = file => { + dispatch({ + type: ActionTypes.SHOW_CONFIRMATION_MODAL, + confirmationFunction: () => { + // Hard delete only if this is a new editor. Edit mode can be canceled, in which case changes to files + // are desirable to not also take place. Orphaned files not attached to an application anymore are + // planned to be removed by the backend periodically. + if (isNew) { + deleteUploadedAttachment(file); + } + + removeId(file.id); + }, + confirmationModalButtonClassName: ButtonColors.ALERT, + confirmationModalButtonText: ConfirmationModalTexts.DELETE_ATTACHMENT.BUTTON, + confirmationModalLabel: ConfirmationModalTexts.DELETE_ATTACHMENT.LABEL, + confirmationModalTitle: ConfirmationModalTexts.DELETE_ATTACHMENT.TITLE + }); + }; + + const busy = isFetchingPendingUploads || isPerformingFileOperation || isFetchingAttachments || isFetchingAttachmentAttributes; + return + {field.label} + {!isFetchingAttachmentAttributes && uploads.length > 0 && + + + + Tiedoston nimi + + + + + + + {'Ladattu'} + + + + } + {!isFetchingAttachmentAttributes && uploads.map((file, index) => { + return + + + + + + + + {formatDate(file.created_at) || '-'} + + + + + deleteFile(file)} style={{ + right: 12 + }} title="Poista liitetiedosto" disabled={busy} /> + + + ; + })} + {uploads.length === 0 && !busy && + + Ei lisättyjä liitteitä. + + } + + {busy ? : submitFile(field.id, e)} />} + + ; + }} + ; +}); +const ApplicationFormSubsectionFields = connect((state, props) => ({ + sectionApplicantType: getSectionApplicantType(state, props.formName, props.section, props.identifier) +}), { + change +})(({ + section, + identifier, + change, + sectionApplicantType, + formName, + formPath, + sectionTitleTransformers, + answerId +}) => { + const renderField = useCallback((pathName, field) => { + if (!field.enabled) { + return null; + } + + const fieldName = [pathName, ApplicationSectionKeys.Fields, field.identifier].join('.'); + const fieldType = field.type; + + // Special cases that use a different submission path and thus different props + if (fieldType === 'uploadfiles') { + return ; + } + + let extraAttributes = {}; + let fieldOverrides = {}; + let columnWidths = { + small: 12, + medium: 6, + large: 3 + }; + + switch (fieldType) { + case 'textbox': + case 'fractional': + break; + + case 'textarea': + columnWidths = { + small: 12, + medium: 12, + large: 12 + }; + break; + + case 'dropdown': + extraAttributes = { + choices: field.choices.map(option => ({ + display_name: option.label, + value: option.value + })) + }; + break; + + case 'hidden': + if (field.identifier === APPLICANT_TYPE_FIELD_IDENTIFIER) { + change(formName, `${identifier}.metadata.applicantType`, valueToApplicantType(field.default_value)); + } + + extraAttributes = { + type: 'hidden' + }; + break; + + case 'checkbox': + fieldOverrides = { + options: field.choices.map(choice => ({ + value: choice.value, + label: choice.has_text_input ? <> + {choice.text} + {' '} + + : choice.text + })) + }; + columnWidths = { + small: 12, + medium: 12, + large: 12 + }; + break; + + case 'radiobutton': + case 'radiobuttoninline': + extraAttributes = { + type: 'radio-with-field' + }; + fieldOverrides = { + options: field.choices.map(choice => ({ + label: choice.text, + value: choice.value, + field: choice.has_text_input ? : null + })) + }; + columnWidths = { + small: 12, + medium: 12, + large: 12 + }; + break; + + default: + break; + } + + let validator; + + switch (fieldName.substring(fieldName.lastIndexOf('.') + 1)) { + case APPLICANT_MAIN_IDENTIFIERS[ApplicantTypes.PERSON].IDENTIFIER_FIELD: + validator = personalIdentifierValidator; + break; + + case APPLICANT_MAIN_IDENTIFIERS[ApplicantTypes.COMPANY].IDENTIFIER_FIELD: + validator = companyIdentifierValidator; + break; + + case EMAIL_FIELD_IDENTIFIER: + validator = emailValidator; + break; + } + + return + checkSpecialValues(field, newValue)} validate={validator} /> + ; + }, []); + const checkSpecialValues = useCallback((field: Record, newValue: PlotApplicationFormValue): void => { + if (field.identifier === APPLICANT_TYPE_FIELD_IDENTIFIER && section.identifier === APPLICANT_SECTION_IDENTIFIER) { + change(formName, `${identifier}.metadata.applicantType`, valueToApplicantType(newValue)); + } + }, []); + return <> + + {section.fields.map(field => {renderField(identifier, field)})} + + {section.subsections.map(subsection => )} + ; +}); + +const ApplicationFormSubsectionFieldArray = ({ + fields, + section, + headerTag: HeaderTag, + formName, + formPath, + sectionTitleTransformers, + answerId +}: { + fields: Fields; + section: Record; + headerTag: string | React.ComponentType<{ + children?: React.ReactNode; + }>; + formName: string; + formPath: string; + sectionTitleTransformers: Array<(arg0: string, arg1: FormSection, arg2: string) => string>; + answerId: number | null; +}): React.ReactNode => { + return
+ {fields.map((identifier, i) => { + const subtitle: string = (sectionTitleTransformers || []).reduce((title, transformer) => transformer(title, section, identifier), `${section.title} (${i + 1})`); + return
+
+ {fields.length > 1 && section.identifier !== TARGET_SECTION_IDENTIFIER && fields.remove(i)} style={{ + float: 'right' + }} />} + + {subtitle} + + +
+
; + })} + {section.identifier !== TARGET_SECTION_IDENTIFIER && fields.push(getSectionTemplate(formName, formPath, section.identifier))} label={section.add_new_text || 'Lisää uusi'} />} +
; +}; + +const ApplicationSubsection = ({ + path, + section, + headerTag: HeaderTag = 'h3', + parentApplicantType, + formName, + formPath = '', + sectionTitleTransformers, + answerId +}: { + path: Array; + section: Record; + headerTag?: string | React.ComponentType<{ + children?: React.ReactNode; + }>; + parentApplicantType?: string | null; + formName: string; + formPath: string | null | undefined; + sectionTitleTransformers: Array<(arg0: string, arg1: FormSection, arg2: string) => string>; + answerId: number | null; +}): React.ReactNode => { + if (!section.visible) { + return null; + } + + if (parentApplicantType === ApplicantTypes.UNSELECTED) { + return null; + } + + if (parentApplicantType !== ApplicantTypes.NOT_APPLICABLE && ![ApplicantTypes.UNKNOWN, ApplicantTypes.BOTH, parentApplicantType].includes(section.applicant_type)) { + return null; + } + + const isArray = section.add_new_allowed; + const pathName = [...path, section.identifier].join('.'); + const title = section.title || '(tuntematon osio)'; + return
+ {isArray ? :
+ {title} + +
} +
; +}; + +export default ApplicationSubsection; \ No newline at end of file diff --git a/src/application/components/enums.js b/src/application/components/enums.ts similarity index 67% rename from src/application/components/enums.js rename to src/application/components/enums.ts index 96ed48457..aae9c059b 100644 --- a/src/application/components/enums.js +++ b/src/application/components/enums.ts @@ -1,5 +1,4 @@ -// @flow export const ApplicationSectionKeys = { Subsections: 'sections', - Fields: 'fields', -}; + Fields: 'fields' +}; \ No newline at end of file diff --git a/src/application/components/infoCheck/ApplicantInfoCheck.js b/src/application/components/infoCheck/ApplicantInfoCheck.js deleted file mode 100644 index 2accaa299..000000000 --- a/src/application/components/infoCheck/ApplicantInfoCheck.js +++ /dev/null @@ -1,42 +0,0 @@ -// @flow -import React, {Component} from 'react'; -import {Column, Row} from 'react-foundation'; - -import {getLabelOfOption} from '$util/helpers'; -import {getUserFullName} from '$src/users/helpers'; - -type Props = { - infoChecks: Object, - infoCheckStateOptions: Object, -}; - -class ApplicantInfoCheck extends Component { - render(): React$Node { - const { - infoChecks, - infoCheckStateOptions, - } = this.props; - - return ( - - {infoChecks.map((item) => { - const statusText = getLabelOfOption(infoCheckStateOptions, item.data.state); - - return - - - {item.kind.label} - - - {statusText} - {item.data.preparer && <>, {getUserFullName(item.data.preparer)}} - - - ; - })} - - ); - } -} - -export default ApplicantInfoCheck; diff --git a/src/application/components/infoCheck/ApplicantInfoCheck.tsx b/src/application/components/infoCheck/ApplicantInfoCheck.tsx new file mode 100644 index 000000000..a55f069d6 --- /dev/null +++ b/src/application/components/infoCheck/ApplicantInfoCheck.tsx @@ -0,0 +1,36 @@ +import React, { Component } from "react"; +import { Column, Row } from "react-foundation"; +import { getLabelOfOption } from "src/util/helpers"; +import { getUserFullName } from "src/users/helpers"; +type Props = { + infoChecks: Record; + infoCheckStateOptions: Record; +}; + +class ApplicantInfoCheck extends Component { + render(): React.ReactNode { + const { + infoChecks, + infoCheckStateOptions + } = this.props; + return + {infoChecks.map(item => { + const statusText = getLabelOfOption(infoCheckStateOptions, item.data.state); + return + + + {item.kind.label} + + + {statusText} + {item.data.preparer && <>, {getUserFullName(item.data.preparer)}} + + + ; + })} + ; + } + +} + +export default ApplicantInfoCheck; \ No newline at end of file diff --git a/src/application/components/infoCheck/ApplicantInfoCheckEdit.js b/src/application/components/infoCheck/ApplicantInfoCheckEdit.js deleted file mode 100644 index bc2591f55..000000000 --- a/src/application/components/infoCheck/ApplicantInfoCheckEdit.js +++ /dev/null @@ -1,167 +0,0 @@ -// @flow -import React, {Component} from 'react'; -import {Row} from 'react-foundation'; -import {connect} from 'react-redux'; -import {change} from 'redux-form'; - -import ApplicantInfoCheckModal from '$src/application/components/infoCheck/ApplicantInfoCheckModal'; -import {ApplicantInfoCheckFieldPaths, ApplicantInfoCheckFieldTitles, ApplicantTypes} from '$src/application/enums'; -import ApplicantInfoCheckEditItem from '$src/application/components/infoCheck/ApplicantInfoCheckEditItem'; -import FormText from '$components/form/FormText'; -import {getApplicantInfoCheckFormName} from '$src/application/helpers'; - -type OwnProps = { - infoCheckIds: Array, - answer: Object, - showMarkAll: boolean, - submissionErrors: Array<{ - id: number, - kind: ?Object, - error: ?Object | ?Array, - }>, -}; - -type Props = { - ...OwnProps, - change: typeof change, -}; - -type State = { - isModalOpen: boolean, - modalCheckItem: ?Object, - checkItemForm: ?string, - modalPage: number, -}; - -class ApplicantInfoCheckEdit extends Component { - state: State = { - isModalOpen: false, - modalCheckItem: null, - checkItemForm: null, - modalPage: 0, - }; - - openModal = (checkItem: Object, form: string, skipToForm: boolean): void => { - this.setState(() => ({ - isModalOpen: true, - modalCheckItem: checkItem, - checkItemForm: form, - modalPage: (!skipToForm && checkItem.kind.external) ? 1 : 2, - })); - }; - - closeModal = (): void => { - this.setState(() => ({ - isModalOpen: false, - modalCheckItem: null, - checkItemForm: '', - modalPage: 0, - })); - }; - - setPage = (page: number): void => { - this.setState(() => ({ - modalPage: page, - })); - } - - saveInfoCheck = (data: Object): void => { - const {change} = this.props; - const {checkItemForm} = this.state; - - if (checkItemForm) { - Object.keys(data).forEach((field) => { - change(checkItemForm, `data.${field}`, data[field]); - }); - - this.closeModal(); - } - } - - renderErrors(): React$Node { - const {submissionErrors} = this.props; - - if (submissionErrors.length === 0) { - return null; - } - - let content = []; - submissionErrors.map((infoCheckItem) => { - try { - if (infoCheckItem.error instanceof Array) { - content.push(
    - {infoCheckItem.error.map((error, i) =>
  • {error}
  • )} -
); - } else if (infoCheckItem.error instanceof Error) { - content.push(infoCheckItem.error.message); - } else if (typeof infoCheckItem.error === 'object') { - const errorObject: Object = infoCheckItem.error; - content.push(
    - {Object.keys(errorObject).map((key) => { - const fieldLabelKey = Object.keys(ApplicantInfoCheckFieldPaths).find( - (path) => ApplicantInfoCheckFieldPaths[path] === key); - - return
  • - {infoCheckItem.kind?.label} - {fieldLabelKey ? ApplicantInfoCheckFieldTitles[fieldLabelKey] : key}:{' '} - {errorObject[key].length !== undefined - ? errorObject[key].join(', ') - : errorObject[key]} -
  • ; - })} -
); - } else { - content.push(infoCheckItem.error); - } - } catch { - content.push(JSON.stringify(infoCheckItem.error)); - } - }); - - return - Tallennus ei onnistunut:{' '} - {content} - ; - } - - render(): React$Node { - const { - isModalOpen, - modalCheckItem, - modalPage, - } = this.state; - - const { - infoCheckIds, - answer, - submissionErrors, - showMarkAll = true, - } = this.props; - - const applicantType = answer?.metadata?.applicantType; - - return ( -
- - {infoCheckIds.map((id, index) => )} - - this.saveInfoCheck(data)} - infoCheck={modalCheckItem} - businessId={applicantType === ApplicantTypes.COMPANY ? answer.metadata.identifier : undefined} - personId={applicantType === ApplicantTypes.PERSON ? answer.metadata.identifier : undefined} - showMarkAll={showMarkAll} - /> - {submissionErrors && this.renderErrors()} -
- ); - } -} - -export default (connect(null, { - change, -})(ApplicantInfoCheckEdit): React$ComponentType); diff --git a/src/application/components/infoCheck/ApplicantInfoCheckEdit.tsx b/src/application/components/infoCheck/ApplicantInfoCheckEdit.tsx new file mode 100644 index 000000000..301daf68f --- /dev/null +++ b/src/application/components/infoCheck/ApplicantInfoCheckEdit.tsx @@ -0,0 +1,142 @@ +import React, { Component } from "react"; +import { Row } from "react-foundation"; +import { connect } from "react-redux"; +import { change } from "redux-form"; +import ApplicantInfoCheckModal from "src/application/components/infoCheck/ApplicantInfoCheckModal"; +import { ApplicantInfoCheckFieldPaths, ApplicantInfoCheckFieldTitles, ApplicantTypes } from "src/application/enums"; +import ApplicantInfoCheckEditItem from "src/application/components/infoCheck/ApplicantInfoCheckEditItem"; +import FormText from "src/components/form/FormText"; +import { getApplicantInfoCheckFormName } from "src/application/helpers"; +type OwnProps = { + infoCheckIds: Array; + answer: Record; + showMarkAll: boolean; + submissionErrors: Array<{ + id: number; + kind: Record | null | undefined; + error: (Record | null | undefined) | (Array> | null | undefined); + }>; +}; +type Props = OwnProps & { + change: typeof change; +}; +type State = { + isModalOpen: boolean; + modalCheckItem: Record | null | undefined; + checkItemForm: string | null | undefined; + modalPage: number; +}; + +class ApplicantInfoCheckEdit extends Component { + state: State = { + isModalOpen: false, + modalCheckItem: null, + checkItemForm: null, + modalPage: 0 + }; + openModal = (checkItem: Record, form: string, skipToForm: boolean): void => { + this.setState(() => ({ + isModalOpen: true, + modalCheckItem: checkItem, + checkItemForm: form, + modalPage: !skipToForm && checkItem.kind.external ? 1 : 2 + })); + }; + closeModal = (): void => { + this.setState(() => ({ + isModalOpen: false, + modalCheckItem: null, + checkItemForm: '', + modalPage: 0 + })); + }; + setPage = (page: number): void => { + this.setState(() => ({ + modalPage: page + })); + }; + saveInfoCheck = (data: Record): void => { + const { + change + } = this.props; + const { + checkItemForm + } = this.state; + + if (checkItemForm) { + Object.keys(data).forEach(field => { + change(checkItemForm, `data.${field}`, data[field]); + }); + this.closeModal(); + } + }; + + renderErrors(): React.ReactNode { + const { + submissionErrors + } = this.props; + + if (submissionErrors.length === 0) { + return null; + } + + let content = []; + submissionErrors.map(infoCheckItem => { + try { + if (infoCheckItem.error instanceof Array) { + content.push(
    + {infoCheckItem.error.map((error, i) =>
  • {error}
  • )} +
); + } else if (infoCheckItem.error instanceof Error) { + content.push(infoCheckItem.error.message); + } else if (typeof infoCheckItem.error === 'object') { + const errorObject: Record = infoCheckItem.error; + content.push(
    + {Object.keys(errorObject).map(key => { + const fieldLabelKey = Object.keys(ApplicantInfoCheckFieldPaths).find(path => ApplicantInfoCheckFieldPaths[path] === key); + return
  • + {infoCheckItem.kind?.label} - {fieldLabelKey ? ApplicantInfoCheckFieldTitles[fieldLabelKey] : key}:{' '} + {errorObject[key].length !== undefined ? errorObject[key].join(', ') : errorObject[key]} +
  • ; + })} +
); + } else { + content.push(infoCheckItem.error); + } + } catch { + content.push(JSON.stringify(infoCheckItem.error)); + } + }); + return + Tallennus ei onnistunut:{' '} + {content} + ; + } + + render(): React.ReactNode { + const { + isModalOpen, + modalCheckItem, + modalPage + } = this.state; + const { + infoCheckIds, + answer, + submissionErrors, + showMarkAll = true + } = this.props; + const applicantType = answer?.metadata?.applicantType; + return
+ + {infoCheckIds.map((id, index) => )} + + this.saveInfoCheck(data)} infoCheck={modalCheckItem} businessId={applicantType === ApplicantTypes.COMPANY ? answer.metadata.identifier : undefined} personId={applicantType === ApplicantTypes.PERSON ? answer.metadata.identifier : undefined} showMarkAll={showMarkAll} /> + {submissionErrors && this.renderErrors()} +
; + } + +} + +export default (connect(null, { + change +})(ApplicantInfoCheckEdit) as React.ComponentType); \ No newline at end of file diff --git a/src/application/components/infoCheck/ApplicantInfoCheckEditItem.js b/src/application/components/infoCheck/ApplicantInfoCheckEditItem.js deleted file mode 100644 index 9c0780117..000000000 --- a/src/application/components/infoCheck/ApplicantInfoCheckEditItem.js +++ /dev/null @@ -1,68 +0,0 @@ -// @flow - -import React from 'react'; -import flowRight from 'lodash/flowRight'; -import {connect} from 'react-redux'; -import {getFormValues, reduxForm} from 'redux-form'; -import {Column, Row} from 'react-foundation'; -import classNames from 'classnames'; - -import {getApplicantInfoCheckAttributes} from '$src/application/selectors'; -import {getFieldOptions, getLabelOfOption} from '$util/helpers'; -import {getUserFullName} from '$src/users/helpers'; - -import type {Attributes} from '$src/types'; - -type OwnProps = { - openModal: Function, - formName: string, -}; - -type Props = { - ...OwnProps, - dirty: boolean, - infoCheckAttributes: Attributes, - formValues: Object, -}; - -const ApplicantInfoCheckEditItem = (({formValues, dirty, openModal, formName, infoCheckAttributes}: Props) => { - const infoCheckStatusOptions = getFieldOptions(infoCheckAttributes, 'state'); - const statusText = getLabelOfOption(infoCheckStatusOptions, formValues.data.state); - - return - - - {formValues.kind.external && - openModal(formValues, formName, false)}> - {formValues.kind.label} - } - {!formValues.kind.external && {formValues.kind.label}} - - - {formValues.kind.external && !formValues.data.preparer && {statusText}} - {(!formValues.kind.external || formValues.data.preparer) && - openModal(formValues, formName, true)}> - {statusText} - {formValues.data.preparer && <>, {getUserFullName(formValues.data.preparer)}} - } - - - ; -}); - -export default (flowRight(connect((state, props) => { - const formValues = getFormValues(props.formName)(state); - - return { - formValues, - form: props.formName, - infoCheckAttributes: getApplicantInfoCheckAttributes(state), - }; -}), reduxForm({ - destroyOnUnmount: false, -}))(ApplicantInfoCheckEditItem): React$ComponentType); diff --git a/src/application/components/infoCheck/ApplicantInfoCheckEditItem.tsx b/src/application/components/infoCheck/ApplicantInfoCheckEditItem.tsx new file mode 100644 index 000000000..ddcaa2787 --- /dev/null +++ b/src/application/components/infoCheck/ApplicantInfoCheckEditItem.tsx @@ -0,0 +1,60 @@ +import React from "react"; +import flowRight from "lodash/flowRight"; +import { connect } from "react-redux"; +import { getFormValues, reduxForm } from "redux-form"; +import { Column, Row } from "react-foundation"; +import classNames from "classnames"; +import { getApplicantInfoCheckAttributes } from "src/application/selectors"; +import { getFieldOptions, getLabelOfOption } from "src/util/helpers"; +import { getUserFullName } from "src/users/helpers"; +import type { Attributes } from "src/types"; +type OwnProps = { + openModal: (...args: Array) => any; + formName: string; +}; +type Props = OwnProps & { + dirty: boolean; + infoCheckAttributes: Attributes; + formValues: Record; +}; + +const ApplicantInfoCheckEditItem = ({ + formValues, + dirty, + openModal, + formName, + infoCheckAttributes +}: Props) => { + const infoCheckStatusOptions = getFieldOptions(infoCheckAttributes, 'state'); + const statusText = getLabelOfOption(infoCheckStatusOptions, formValues.data.state); + return + + + {formValues.kind.external && openModal(formValues, formName, false)}> + {formValues.kind.label} + } + {!formValues.kind.external && {formValues.kind.label}} + + + {formValues.kind.external && !formValues.data.preparer && {statusText}} + {(!formValues.kind.external || formValues.data.preparer) && openModal(formValues, formName, true)}> + {statusText} + {formValues.data.preparer && <>, {getUserFullName(formValues.data.preparer)}} + } + + + ; +}; + +export default (flowRight(connect((state, props) => { + const formValues = getFormValues(props.formName)(state); + return { + formValues, + form: props.formName, + infoCheckAttributes: getApplicantInfoCheckAttributes(state) + }; +}), reduxForm({ + destroyOnUnmount: false +}))(ApplicantInfoCheckEditItem) as React.ComponentType); \ No newline at end of file diff --git a/src/application/components/infoCheck/ApplicantInfoCheckForm.js b/src/application/components/infoCheck/ApplicantInfoCheckForm.js deleted file mode 100644 index 5c8ebd606..000000000 --- a/src/application/components/infoCheck/ApplicantInfoCheckForm.js +++ /dev/null @@ -1,164 +0,0 @@ -//@flow -import React, {Component} from 'react'; -import {getFormValues, reduxForm} from 'redux-form'; -import {Column, Row} from 'react-foundation'; -import get from 'lodash/get'; -import flowRight from 'lodash/flowRight'; -import {connect} from 'react-redux'; - -import {FieldTypes, FormNames} from '$src/enums'; -import {ButtonColors} from '$components/enums'; -import FormField from '$components/form/FormField'; -import ModalButtonWrapper from '$components/modal/ModalButtonWrapper'; -import Button from '$components/button/Button'; -import { - ApplicantInfoCheckFieldPaths, - ApplicantInfoCheckFieldTitles, -} from '$src/application/enums'; -import {getApplicantInfoCheckAttributes} from '$src/application/selectors'; - -import type {Attributes} from '$src/types'; - -type OwnProps = { - infoCheck: Object, - onClose: Function, - onSubmit: Function, -}; - -type Props = { - ...OwnProps, - initialize: Function, - attributes: Attributes, - valid: boolean, - formValues: Object, - isPreparerDirty: boolean, - showMarkAll: boolean, -}; - -class ApplicantInfoCheckForm extends Component { - firstField: ?HTMLInputElement - - componentDidMount(): void { - const infoCheck = this.props?.infoCheck; - - if (!infoCheck) { - return; - } - - const {preparer, ...rest} = infoCheck.data; - - this.props.initialize({ - ...rest, - preparer, - }); - } - - setRefForFirstField = (element: HTMLInputElement): void => { - this.firstField = element; - } - - setFocus = (): void => { - if (this.firstField) { - this.firstField.focus(); - } - } - - handleSave = (): void => { - const { - onSubmit, - formValues, - } = this.props; - - onSubmit(formValues); - }; - - render(): React$Node { - const { - attributes, - valid, - onClose, - showMarkAll, - } = this.props; - - return ( -
- - - - - - - - {showMarkAll === true && - - - - } - - - - - - - - -