From 59d6192229b85e3ba386d8288649353f831f653f Mon Sep 17 00:00:00 2001 From: jasquat Date: Tue, 5 Jul 2022 11:50:55 -0400 Subject: [PATCH] ran typescript migrate and fixed some issues w/ burnettk --- .eslintrc.js | 31 +- craco.config.js | 4 +- package-lock.json | 575 +++++++++++++++++- package.json | 2 + src/{App.js => App.tsx} | 3 + .../{ErrorBoundary.js => ErrorBoundary.tsx} | 19 +- .../{FileInput.js => FileInput.tsx} | 23 +- src/components/NavigationBar.js | 35 -- src/components/NavigationBar.tsx | 44 ++ ...tionForTable.js => PaginationForTable.tsx} | 33 +- src/components/ProcessBreadcrumb.js | 69 --- ...umb.test.js => ProcessBreadcrumb.test.tsx} | 6 + src/components/ProcessBreadcrumb.tsx | 73 +++ ...iagramEditor.js => ReactDiagramEditor.tsx} | 68 ++- src/{config.js => config.tsx} | 0 .../{ErrorContext.js => ErrorContext.tsx} | 1 + src/{helpers.test.js => helpers.test.tsx} | 0 src/{helpers.js => helpers.tsx} | 6 +- src/{index.js => index.tsx} | 2 + ...reportWebVitals.js => reportWebVitals.tsx} | 2 +- src/routes/AdminRoutes.js | 65 -- src/routes/AdminRoutes.tsx | 89 +++ ...ocessGroupEdit.js => ProcessGroupEdit.tsx} | 14 +- ...ProcessGroupNew.js => ProcessGroupNew.tsx} | 4 +- ...ocessGroupShow.js => ProcessGroupShow.tsx} | 29 +- .../{ProcessGroups.js => ProcessGroups.tsx} | 17 +- ...nstanceList.js => ProcessInstanceList.tsx} | 50 +- ...nceReport.js => ProcessInstanceReport.tsx} | 21 +- ...nstanceShow.js => ProcessInstanceShow.tsx} | 7 +- ...ocessModelEdit.js => ProcessModelEdit.tsx} | 20 +- ...Diagram.js => ProcessModelEditDiagram.tsx} | 33 +- ...ProcessModelNew.js => ProcessModelNew.tsx} | 5 +- ...ocessModelShow.js => ProcessModelShow.tsx} | 73 ++- src/routes/{TaskList.js => TaskList.tsx} | 15 +- src/routes/{TaskShow.js => TaskShow.tsx} | 14 +- src/routes/expenses.jsx | 7 - src/routes/expenses.tsx | 9 + src/{setupTests.js => setupTests.tsx} | 0 tsfixme.d.ts | 4 + 39 files changed, 1091 insertions(+), 381 deletions(-) rename src/{App.js => App.tsx} (83%) rename src/components/{ErrorBoundary.js => ErrorBoundary.tsx} (69%) rename src/components/{FileInput.js => FileInput.tsx} (85%) delete mode 100644 src/components/NavigationBar.js create mode 100644 src/components/NavigationBar.tsx rename src/components/{PaginationForTable.js => PaginationForTable.tsx} (87%) delete mode 100644 src/components/ProcessBreadcrumb.js rename src/components/{ProcessBreadcrumb.test.js => ProcessBreadcrumb.test.tsx} (65%) create mode 100644 src/components/ProcessBreadcrumb.tsx rename src/components/{ReactDiagramEditor.js => ReactDiagramEditor.tsx} (77%) rename src/{config.js => config.tsx} (100%) rename src/contexts/{ErrorContext.js => ErrorContext.tsx} (62%) rename src/{helpers.test.js => helpers.test.tsx} (100%) rename src/{helpers.js => helpers.tsx} (78%) rename src/{index.js => index.tsx} (75%) rename src/{reportWebVitals.js => reportWebVitals.tsx} (86%) delete mode 100644 src/routes/AdminRoutes.js create mode 100644 src/routes/AdminRoutes.tsx rename src/routes/{ProcessGroupEdit.js => ProcessGroupEdit.tsx} (83%) rename src/routes/{ProcessGroupNew.js => ProcessGroupNew.tsx} (95%) rename src/routes/{ProcessGroupShow.js => ProcessGroupShow.tsx} (69%) rename src/routes/{ProcessGroups.js => ProcessGroups.tsx} (68%) rename src/routes/{ProcessInstanceList.js => ProcessInstanceList.tsx} (79%) rename src/routes/{ProcessInstanceReport.js => ProcessInstanceReport.tsx} (72%) rename src/routes/{ProcessInstanceShow.js => ProcessInstanceShow.tsx} (79%) rename src/routes/{ProcessModelEdit.js => ProcessModelEdit.tsx} (77%) rename src/routes/{ProcessModelEditDiagram.js => ProcessModelEditDiagram.tsx} (72%) rename src/routes/{ProcessModelNew.js => ProcessModelNew.tsx} (92%) rename src/routes/{ProcessModelShow.js => ProcessModelShow.tsx} (58%) rename src/routes/{TaskList.js => TaskList.tsx} (69%) rename src/routes/{TaskShow.js => TaskShow.tsx} (73%) delete mode 100644 src/routes/expenses.jsx create mode 100644 src/routes/expenses.tsx rename src/{setupTests.js => setupTests.tsx} (100%) create mode 100644 tsfixme.d.ts diff --git a/.eslintrc.js b/.eslintrc.js index d7f0d64..ebec84e 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -11,7 +11,11 @@ module.exports = { 'plugin:jest/recommended', 'plugin:prettier/recommended', 'plugin:sonarjs/recommended', + 'plugin:import/errors', + 'plugin:import/warnings', + 'plugin:import/typescript', ], + parser: '@typescript-eslint/parser', parserOptions: { ecmaFeatures: { jsx: true, @@ -19,15 +23,36 @@ module.exports = { ecmaVersion: 'latest', sourceType: 'module', }, - plugins: ['react', 'sonarjs'], + plugins: ['react', 'sonarjs', '@typescript-eslint'], rules: { 'jest/expect-expect': 'off', 'react/jsx-no-bind': 'off', 'jsx-a11y/no-autofocus': 'off', 'jsx-a11y/label-has-associated-control': 'off', 'no-console': 'off', - 'react/jsx-filename-extension': [1, { extensions: ['.js', '.jsx'] }], + 'react/jsx-filename-extension': [ + 1, + { extensions: ['.js', '.jsx', '.tsx', '.ts'] }, + ], 'react/react-in-jsx-scope': 'off', - 'no-unused-vars': ['error', { destructuredArrayIgnorePattern: '^_' }], + 'react/require-default-props': 'off', + 'no-unused-vars': [ + 'error', + { + destructuredArrayIgnorePattern: '^_', + varsIgnorePattern: '_', + argsIgnorePattern: '^_', + }, + ], + 'import/extensions': [ + 'error', + 'ignorePackages', + { + js: 'never', + jsx: 'never', + ts: 'never', + tsx: 'never', + }, + ], }, }; diff --git a/craco.config.js b/craco.config.js index 9b57cd7..d0a928e 100644 --- a/craco.config.js +++ b/craco.config.js @@ -2,7 +2,7 @@ module.exports = { module: { rules: [ { - test: /\.m?js$/, + test: /\.m?[jt]sx?$/, exclude: /node_modules/, use: { loader: 'babel-loader', @@ -16,6 +16,7 @@ module.exports = { }, ], '@babel/preset-react', + '@babel/plugin-transform-typescript', ], }, }, @@ -42,6 +43,7 @@ module.exports = { presets: [ '@babel/preset-env', ['@babel/preset-react', { runtime: 'automatic' }], + '@babel/preset-typescript', ], // plugins: [], loaderOptions: (babelLoaderOptions) => { diff --git a/package-lock.json b/package-lock.json index 57b7ae2..3010163 100644 --- a/package-lock.json +++ b/package-lock.json @@ -45,6 +45,8 @@ "web-vitals": "^2.1.4" }, "devDependencies": { + "@typescript-eslint/eslint-plugin": "^5.30.5", + "@typescript-eslint/parser": "^5.30.5", "cypress": "^10.3.0", "eslint": "^8.19.0", "eslint_d": "^12.2.0", @@ -4643,13 +4645,13 @@ } }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "5.27.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.27.1.tgz", - "integrity": "sha512-6dM5NKT57ZduNnJfpY81Phe9nc9wolnMCnknb1im6brWi1RYv84nbMS3olJa27B6+irUVV1X/Wb+Am0FjJdGFw==", + "version": "5.30.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.30.5.tgz", + "integrity": "sha512-lftkqRoBvc28VFXEoRgyZuztyVUQ04JvUnATSPtIRFAccbXTWL6DEtXGYMcbg998kXw1NLUJm7rTQ9eUt+q6Ig==", "dependencies": { - "@typescript-eslint/scope-manager": "5.27.1", - "@typescript-eslint/type-utils": "5.27.1", - "@typescript-eslint/utils": "5.27.1", + "@typescript-eslint/scope-manager": "5.30.5", + "@typescript-eslint/type-utils": "5.30.5", + "@typescript-eslint/utils": "5.30.5", "debug": "^4.3.4", "functional-red-black-tree": "^1.0.1", "ignore": "^5.2.0", @@ -4674,6 +4676,119 @@ } } }, + "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/scope-manager": { + "version": "5.30.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.30.5.tgz", + "integrity": "sha512-NJ6F+YHHFT/30isRe2UTmIGGAiXKckCyMnIV58cE3JkHmaD6e5zyEYm5hBDv0Wbin+IC0T1FWJpD3YqHUG/Ydg==", + "dependencies": { + "@typescript-eslint/types": "5.30.5", + "@typescript-eslint/visitor-keys": "5.30.5" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/types": { + "version": "5.30.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.30.5.tgz", + "integrity": "sha512-kZ80w/M2AvsbRvOr3PjaNh6qEW1LFqs2pLdo2s5R38B2HYXG8Z0PP48/4+j1QHJFL3ssHIbJ4odPRS8PlHrFfw==", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/typescript-estree": { + "version": "5.30.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.30.5.tgz", + "integrity": "sha512-qGTc7QZC801kbYjAr4AgdOfnokpwStqyhSbiQvqGBLixniAKyH+ib2qXIVo4P9NgGzwyfD9I0nlJN7D91E1VpQ==", + "dependencies": { + "@typescript-eslint/types": "5.30.5", + "@typescript-eslint/visitor-keys": "5.30.5", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "semver": "^7.3.7", + "tsutils": "^3.21.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/utils": { + "version": "5.30.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.30.5.tgz", + "integrity": "sha512-o4SSUH9IkuA7AYIfAvatldovurqTAHrfzPApOZvdUq01hHojZojCFXx06D/aFpKCgWbMPRdJBWAC3sWp3itwTA==", + "dependencies": { + "@types/json-schema": "^7.0.9", + "@typescript-eslint/scope-manager": "5.30.5", + "@typescript-eslint/types": "5.30.5", + "@typescript-eslint/typescript-estree": "5.30.5", + "eslint-scope": "^5.1.1", + "eslint-utils": "^3.0.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/@typescript-eslint/eslint-plugin/node_modules/@typescript-eslint/visitor-keys": { + "version": "5.30.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.30.5.tgz", + "integrity": "sha512-D+xtGo9HUMELzWIUqcQc0p2PO4NyvTrgIOK/VnSH083+8sq0tiLozNRKuLarwHYGRuA6TVBQSuuLwJUDWd3aaA==", + "dependencies": { + "@typescript-eslint/types": "5.30.5", + "eslint-visitor-keys": "^3.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/eslint-plugin/node_modules/eslint-scope": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/@typescript-eslint/eslint-plugin/node_modules/estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "engines": { + "node": ">=4.0" + } + }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/semver": { "version": "7.3.7", "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", @@ -4707,13 +4822,13 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "5.27.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.27.1.tgz", - "integrity": "sha512-7Va2ZOkHi5NP+AZwb5ReLgNF6nWLGTeUJfxdkVUAPPSaAdbWNnFZzLZ4EGGmmiCTg+AwlbE1KyUYTBglosSLHQ==", + "version": "5.30.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.30.5.tgz", + "integrity": "sha512-zj251pcPXI8GO9NDKWWmygP6+UjwWmrdf9qMW/L/uQJBM/0XbU2inxe5io/234y/RCvwpKEYjZ6c1YrXERkK4Q==", "dependencies": { - "@typescript-eslint/scope-manager": "5.27.1", - "@typescript-eslint/types": "5.27.1", - "@typescript-eslint/typescript-estree": "5.27.1", + "@typescript-eslint/scope-manager": "5.30.5", + "@typescript-eslint/types": "5.30.5", + "@typescript-eslint/typescript-estree": "5.30.5", "debug": "^4.3.4" }, "engines": { @@ -4732,6 +4847,90 @@ } } }, + "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/scope-manager": { + "version": "5.30.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.30.5.tgz", + "integrity": "sha512-NJ6F+YHHFT/30isRe2UTmIGGAiXKckCyMnIV58cE3JkHmaD6e5zyEYm5hBDv0Wbin+IC0T1FWJpD3YqHUG/Ydg==", + "dependencies": { + "@typescript-eslint/types": "5.30.5", + "@typescript-eslint/visitor-keys": "5.30.5" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/types": { + "version": "5.30.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.30.5.tgz", + "integrity": "sha512-kZ80w/M2AvsbRvOr3PjaNh6qEW1LFqs2pLdo2s5R38B2HYXG8Z0PP48/4+j1QHJFL3ssHIbJ4odPRS8PlHrFfw==", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/typescript-estree": { + "version": "5.30.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.30.5.tgz", + "integrity": "sha512-qGTc7QZC801kbYjAr4AgdOfnokpwStqyhSbiQvqGBLixniAKyH+ib2qXIVo4P9NgGzwyfD9I0nlJN7D91E1VpQ==", + "dependencies": { + "@typescript-eslint/types": "5.30.5", + "@typescript-eslint/visitor-keys": "5.30.5", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "semver": "^7.3.7", + "tsutils": "^3.21.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/visitor-keys": { + "version": "5.30.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.30.5.tgz", + "integrity": "sha512-D+xtGo9HUMELzWIUqcQc0p2PO4NyvTrgIOK/VnSH083+8sq0tiLozNRKuLarwHYGRuA6TVBQSuuLwJUDWd3aaA==", + "dependencies": { + "@typescript-eslint/types": "5.30.5", + "eslint-visitor-keys": "^3.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/parser/node_modules/semver": { + "version": "7.3.7", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", + "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/@typescript-eslint/scope-manager": { "version": "5.27.1", "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.27.1.tgz", @@ -4749,11 +4948,11 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "5.27.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.27.1.tgz", - "integrity": "sha512-+UC1vVUWaDHRnC2cQrCJ4QtVjpjjCgjNFpg8b03nERmkHv9JV9X5M19D7UFMd+/G7T/sgFwX2pGmWK38rqyvXw==", + "version": "5.30.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.30.5.tgz", + "integrity": "sha512-k9+ejlv1GgwN1nN7XjVtyCgE0BTzhzT1YsQF0rv4Vfj2U9xnslBgMYYvcEYAFVdvhuEscELJsB7lDkN7WusErw==", "dependencies": { - "@typescript-eslint/utils": "5.27.1", + "@typescript-eslint/utils": "5.30.5", "debug": "^4.3.4", "tsutils": "^3.21.0" }, @@ -4773,6 +4972,133 @@ } } }, + "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/scope-manager": { + "version": "5.30.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.30.5.tgz", + "integrity": "sha512-NJ6F+YHHFT/30isRe2UTmIGGAiXKckCyMnIV58cE3JkHmaD6e5zyEYm5hBDv0Wbin+IC0T1FWJpD3YqHUG/Ydg==", + "dependencies": { + "@typescript-eslint/types": "5.30.5", + "@typescript-eslint/visitor-keys": "5.30.5" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/types": { + "version": "5.30.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.30.5.tgz", + "integrity": "sha512-kZ80w/M2AvsbRvOr3PjaNh6qEW1LFqs2pLdo2s5R38B2HYXG8Z0PP48/4+j1QHJFL3ssHIbJ4odPRS8PlHrFfw==", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/typescript-estree": { + "version": "5.30.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.30.5.tgz", + "integrity": "sha512-qGTc7QZC801kbYjAr4AgdOfnokpwStqyhSbiQvqGBLixniAKyH+ib2qXIVo4P9NgGzwyfD9I0nlJN7D91E1VpQ==", + "dependencies": { + "@typescript-eslint/types": "5.30.5", + "@typescript-eslint/visitor-keys": "5.30.5", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "semver": "^7.3.7", + "tsutils": "^3.21.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/utils": { + "version": "5.30.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.30.5.tgz", + "integrity": "sha512-o4SSUH9IkuA7AYIfAvatldovurqTAHrfzPApOZvdUq01hHojZojCFXx06D/aFpKCgWbMPRdJBWAC3sWp3itwTA==", + "dependencies": { + "@types/json-schema": "^7.0.9", + "@typescript-eslint/scope-manager": "5.30.5", + "@typescript-eslint/types": "5.30.5", + "@typescript-eslint/typescript-estree": "5.30.5", + "eslint-scope": "^5.1.1", + "eslint-utils": "^3.0.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/@typescript-eslint/type-utils/node_modules/@typescript-eslint/visitor-keys": { + "version": "5.30.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.30.5.tgz", + "integrity": "sha512-D+xtGo9HUMELzWIUqcQc0p2PO4NyvTrgIOK/VnSH083+8sq0tiLozNRKuLarwHYGRuA6TVBQSuuLwJUDWd3aaA==", + "dependencies": { + "@typescript-eslint/types": "5.30.5", + "eslint-visitor-keys": "^3.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/type-utils/node_modules/eslint-scope": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/@typescript-eslint/type-utils/node_modules/estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/@typescript-eslint/type-utils/node_modules/semver": { + "version": "7.3.7", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", + "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/@typescript-eslint/types": { "version": "5.27.1", "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.27.1.tgz", @@ -29112,13 +29438,13 @@ } }, "@typescript-eslint/eslint-plugin": { - "version": "5.27.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.27.1.tgz", - "integrity": "sha512-6dM5NKT57ZduNnJfpY81Phe9nc9wolnMCnknb1im6brWi1RYv84nbMS3olJa27B6+irUVV1X/Wb+Am0FjJdGFw==", + "version": "5.30.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.30.5.tgz", + "integrity": "sha512-lftkqRoBvc28VFXEoRgyZuztyVUQ04JvUnATSPtIRFAccbXTWL6DEtXGYMcbg998kXw1NLUJm7rTQ9eUt+q6Ig==", "requires": { - "@typescript-eslint/scope-manager": "5.27.1", - "@typescript-eslint/type-utils": "5.27.1", - "@typescript-eslint/utils": "5.27.1", + "@typescript-eslint/scope-manager": "5.30.5", + "@typescript-eslint/type-utils": "5.30.5", + "@typescript-eslint/utils": "5.30.5", "debug": "^4.3.4", "functional-red-black-tree": "^1.0.1", "ignore": "^5.2.0", @@ -29127,6 +29453,70 @@ "tsutils": "^3.21.0" }, "dependencies": { + "@typescript-eslint/scope-manager": { + "version": "5.30.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.30.5.tgz", + "integrity": "sha512-NJ6F+YHHFT/30isRe2UTmIGGAiXKckCyMnIV58cE3JkHmaD6e5zyEYm5hBDv0Wbin+IC0T1FWJpD3YqHUG/Ydg==", + "requires": { + "@typescript-eslint/types": "5.30.5", + "@typescript-eslint/visitor-keys": "5.30.5" + } + }, + "@typescript-eslint/types": { + "version": "5.30.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.30.5.tgz", + "integrity": "sha512-kZ80w/M2AvsbRvOr3PjaNh6qEW1LFqs2pLdo2s5R38B2HYXG8Z0PP48/4+j1QHJFL3ssHIbJ4odPRS8PlHrFfw==" + }, + "@typescript-eslint/typescript-estree": { + "version": "5.30.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.30.5.tgz", + "integrity": "sha512-qGTc7QZC801kbYjAr4AgdOfnokpwStqyhSbiQvqGBLixniAKyH+ib2qXIVo4P9NgGzwyfD9I0nlJN7D91E1VpQ==", + "requires": { + "@typescript-eslint/types": "5.30.5", + "@typescript-eslint/visitor-keys": "5.30.5", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "semver": "^7.3.7", + "tsutils": "^3.21.0" + } + }, + "@typescript-eslint/utils": { + "version": "5.30.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.30.5.tgz", + "integrity": "sha512-o4SSUH9IkuA7AYIfAvatldovurqTAHrfzPApOZvdUq01hHojZojCFXx06D/aFpKCgWbMPRdJBWAC3sWp3itwTA==", + "requires": { + "@types/json-schema": "^7.0.9", + "@typescript-eslint/scope-manager": "5.30.5", + "@typescript-eslint/types": "5.30.5", + "@typescript-eslint/typescript-estree": "5.30.5", + "eslint-scope": "^5.1.1", + "eslint-utils": "^3.0.0" + } + }, + "@typescript-eslint/visitor-keys": { + "version": "5.30.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.30.5.tgz", + "integrity": "sha512-D+xtGo9HUMELzWIUqcQc0p2PO4NyvTrgIOK/VnSH083+8sq0tiLozNRKuLarwHYGRuA6TVBQSuuLwJUDWd3aaA==", + "requires": { + "@typescript-eslint/types": "5.30.5", + "eslint-visitor-keys": "^3.3.0" + } + }, + "eslint-scope": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "requires": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + } + }, + "estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==" + }, "semver": { "version": "7.3.7", "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", @@ -29146,14 +29536,61 @@ } }, "@typescript-eslint/parser": { - "version": "5.27.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.27.1.tgz", - "integrity": "sha512-7Va2ZOkHi5NP+AZwb5ReLgNF6nWLGTeUJfxdkVUAPPSaAdbWNnFZzLZ4EGGmmiCTg+AwlbE1KyUYTBglosSLHQ==", + "version": "5.30.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.30.5.tgz", + "integrity": "sha512-zj251pcPXI8GO9NDKWWmygP6+UjwWmrdf9qMW/L/uQJBM/0XbU2inxe5io/234y/RCvwpKEYjZ6c1YrXERkK4Q==", "requires": { - "@typescript-eslint/scope-manager": "5.27.1", - "@typescript-eslint/types": "5.27.1", - "@typescript-eslint/typescript-estree": "5.27.1", + "@typescript-eslint/scope-manager": "5.30.5", + "@typescript-eslint/types": "5.30.5", + "@typescript-eslint/typescript-estree": "5.30.5", "debug": "^4.3.4" + }, + "dependencies": { + "@typescript-eslint/scope-manager": { + "version": "5.30.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.30.5.tgz", + "integrity": "sha512-NJ6F+YHHFT/30isRe2UTmIGGAiXKckCyMnIV58cE3JkHmaD6e5zyEYm5hBDv0Wbin+IC0T1FWJpD3YqHUG/Ydg==", + "requires": { + "@typescript-eslint/types": "5.30.5", + "@typescript-eslint/visitor-keys": "5.30.5" + } + }, + "@typescript-eslint/types": { + "version": "5.30.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.30.5.tgz", + "integrity": "sha512-kZ80w/M2AvsbRvOr3PjaNh6qEW1LFqs2pLdo2s5R38B2HYXG8Z0PP48/4+j1QHJFL3ssHIbJ4odPRS8PlHrFfw==" + }, + "@typescript-eslint/typescript-estree": { + "version": "5.30.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.30.5.tgz", + "integrity": "sha512-qGTc7QZC801kbYjAr4AgdOfnokpwStqyhSbiQvqGBLixniAKyH+ib2qXIVo4P9NgGzwyfD9I0nlJN7D91E1VpQ==", + "requires": { + "@typescript-eslint/types": "5.30.5", + "@typescript-eslint/visitor-keys": "5.30.5", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "semver": "^7.3.7", + "tsutils": "^3.21.0" + } + }, + "@typescript-eslint/visitor-keys": { + "version": "5.30.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.30.5.tgz", + "integrity": "sha512-D+xtGo9HUMELzWIUqcQc0p2PO4NyvTrgIOK/VnSH083+8sq0tiLozNRKuLarwHYGRuA6TVBQSuuLwJUDWd3aaA==", + "requires": { + "@typescript-eslint/types": "5.30.5", + "eslint-visitor-keys": "^3.3.0" + } + }, + "semver": { + "version": "7.3.7", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", + "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", + "requires": { + "lru-cache": "^6.0.0" + } + } } }, "@typescript-eslint/scope-manager": { @@ -29166,13 +29603,87 @@ } }, "@typescript-eslint/type-utils": { - "version": "5.27.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.27.1.tgz", - "integrity": "sha512-+UC1vVUWaDHRnC2cQrCJ4QtVjpjjCgjNFpg8b03nERmkHv9JV9X5M19D7UFMd+/G7T/sgFwX2pGmWK38rqyvXw==", + "version": "5.30.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.30.5.tgz", + "integrity": "sha512-k9+ejlv1GgwN1nN7XjVtyCgE0BTzhzT1YsQF0rv4Vfj2U9xnslBgMYYvcEYAFVdvhuEscELJsB7lDkN7WusErw==", "requires": { - "@typescript-eslint/utils": "5.27.1", + "@typescript-eslint/utils": "5.30.5", "debug": "^4.3.4", "tsutils": "^3.21.0" + }, + "dependencies": { + "@typescript-eslint/scope-manager": { + "version": "5.30.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.30.5.tgz", + "integrity": "sha512-NJ6F+YHHFT/30isRe2UTmIGGAiXKckCyMnIV58cE3JkHmaD6e5zyEYm5hBDv0Wbin+IC0T1FWJpD3YqHUG/Ydg==", + "requires": { + "@typescript-eslint/types": "5.30.5", + "@typescript-eslint/visitor-keys": "5.30.5" + } + }, + "@typescript-eslint/types": { + "version": "5.30.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.30.5.tgz", + "integrity": "sha512-kZ80w/M2AvsbRvOr3PjaNh6qEW1LFqs2pLdo2s5R38B2HYXG8Z0PP48/4+j1QHJFL3ssHIbJ4odPRS8PlHrFfw==" + }, + "@typescript-eslint/typescript-estree": { + "version": "5.30.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.30.5.tgz", + "integrity": "sha512-qGTc7QZC801kbYjAr4AgdOfnokpwStqyhSbiQvqGBLixniAKyH+ib2qXIVo4P9NgGzwyfD9I0nlJN7D91E1VpQ==", + "requires": { + "@typescript-eslint/types": "5.30.5", + "@typescript-eslint/visitor-keys": "5.30.5", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "semver": "^7.3.7", + "tsutils": "^3.21.0" + } + }, + "@typescript-eslint/utils": { + "version": "5.30.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.30.5.tgz", + "integrity": "sha512-o4SSUH9IkuA7AYIfAvatldovurqTAHrfzPApOZvdUq01hHojZojCFXx06D/aFpKCgWbMPRdJBWAC3sWp3itwTA==", + "requires": { + "@types/json-schema": "^7.0.9", + "@typescript-eslint/scope-manager": "5.30.5", + "@typescript-eslint/types": "5.30.5", + "@typescript-eslint/typescript-estree": "5.30.5", + "eslint-scope": "^5.1.1", + "eslint-utils": "^3.0.0" + } + }, + "@typescript-eslint/visitor-keys": { + "version": "5.30.5", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.30.5.tgz", + "integrity": "sha512-D+xtGo9HUMELzWIUqcQc0p2PO4NyvTrgIOK/VnSH083+8sq0tiLozNRKuLarwHYGRuA6TVBQSuuLwJUDWd3aaA==", + "requires": { + "@typescript-eslint/types": "5.30.5", + "eslint-visitor-keys": "^3.3.0" + } + }, + "eslint-scope": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "requires": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + } + }, + "estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==" + }, + "semver": { + "version": "7.3.7", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", + "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", + "requires": { + "lru-cache": "^6.0.0" + } + } } }, "@typescript-eslint/types": { diff --git a/package.json b/package.json index cf42c27..c3455af 100644 --- a/package.json +++ b/package.json @@ -67,6 +67,8 @@ ] }, "devDependencies": { + "@typescript-eslint/eslint-plugin": "^5.30.5", + "@typescript-eslint/parser": "^5.30.5", "cypress": "^10.3.0", "eslint": "^8.19.0", "eslint_d": "^12.2.0", diff --git a/src/App.js b/src/App.tsx similarity index 83% rename from src/App.js rename to src/App.tsx index 3314a20..e446eb0 100644 --- a/src/App.js +++ b/src/App.tsx @@ -20,6 +20,7 @@ export default function App() { let errorTag = ''; if (errorMessage !== '') { + // @ts-expect-error TS(2322): Type 'Element' is not assignable to type 'string'. errorTag = ( ); } - -ReactDiagramEditor.propTypes = { - processModelId: PropTypes.string.isRequired, - processGroupId: PropTypes.string.isRequired, - saveDiagram: PropTypes.func.isRequired, - diagramType: PropTypes.string.isRequired, - - diagramXML: PropTypes.string, - fileName: PropTypes.string, - onLaunchScriptEditor: PropTypes.func, - url: PropTypes.string, -}; - -ReactDiagramEditor.defaultProps = { - diagramXML: null, - fileName: null, - onLaunchScriptEditor: null, - url: null, -}; diff --git a/src/config.js b/src/config.tsx similarity index 100% rename from src/config.js rename to src/config.tsx diff --git a/src/contexts/ErrorContext.js b/src/contexts/ErrorContext.tsx similarity index 62% rename from src/contexts/ErrorContext.js rename to src/contexts/ErrorContext.tsx index e70bc15..50b362b 100644 --- a/src/contexts/ErrorContext.js +++ b/src/contexts/ErrorContext.tsx @@ -1,4 +1,5 @@ import { createContext } from 'react'; +// @ts-expect-error TS(2554): Expected 1 arguments, but got 0. const ErrorContext = createContext(); export default ErrorContext; diff --git a/src/helpers.test.js b/src/helpers.test.tsx similarity index 100% rename from src/helpers.test.js rename to src/helpers.test.tsx diff --git a/src/helpers.js b/src/helpers.tsx similarity index 78% rename from src/helpers.js rename to src/helpers.tsx index 5eb9688..3d3bc5f 100644 --- a/src/helpers.js +++ b/src/helpers.tsx @@ -1,5 +1,5 @@ // https://www.30secondsofcode.org/js/s/slugify -export const slugifyString = (str) => { +export const slugifyString = (str: any) => { return str .toLowerCase() .trim() @@ -9,11 +9,11 @@ export const slugifyString = (str) => { .replace(/-+$/g, ''); }; -export const capitalizeFirstLetter = (string) => { +export const capitalizeFirstLetter = (string: any) => { return string.charAt(0).toUpperCase() + string.slice(1); }; -export const convertDateToSeconds = (date, onChangeFunction) => { +export const convertDateToSeconds = (date: any, onChangeFunction: any) => { let dateInSeconds = date; if (date !== null) { let dateInMilliseconds = date; diff --git a/src/index.js b/src/index.tsx similarity index 75% rename from src/index.js rename to src/index.tsx index 02f826b..61aa0cb 100644 --- a/src/index.js +++ b/src/index.tsx @@ -7,6 +7,7 @@ import './index.css'; import reportWebVitals from './reportWebVitals'; +// @ts-expect-error TS(2345): Argument of type 'HTMLElement | null' is not assig... Remove this comment to see the full error message const root = ReactDOMClient.createRoot(document.getElementById('root')); root.render( @@ -17,4 +18,5 @@ root.render( // If you want to start measuring performance in your app, pass a function // to log results (for example: reportWebVitals(console.log)) // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals +// @ts-expect-error TS(2554): Expected 1 arguments, but got 0. reportWebVitals(); diff --git a/src/reportWebVitals.js b/src/reportWebVitals.tsx similarity index 86% rename from src/reportWebVitals.js rename to src/reportWebVitals.tsx index 532f29b..f00fe6c 100644 --- a/src/reportWebVitals.js +++ b/src/reportWebVitals.tsx @@ -1,4 +1,4 @@ -const reportWebVitals = (onPerfEntry) => { +const reportWebVitals = (onPerfEntry: any) => { if (onPerfEntry && onPerfEntry instanceof Function) { import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { getCLS(onPerfEntry); diff --git a/src/routes/AdminRoutes.js b/src/routes/AdminRoutes.js deleted file mode 100644 index 443b217..0000000 --- a/src/routes/AdminRoutes.js +++ /dev/null @@ -1,65 +0,0 @@ -import { Routes, Route } from 'react-router-dom'; - -import ProcessGroups from './ProcessGroups'; -import ProcessGroupShow from './ProcessGroupShow'; -import ProcessGroupNew from './ProcessGroupNew'; -import ProcessGroupEdit from './ProcessGroupEdit'; -import ProcessModelShow from './ProcessModelShow'; -import ProcessModelEditDiagram from './ProcessModelEditDiagram'; -import ProcessInstanceList from './ProcessInstanceList'; -import ProcessInstanceReport from './ProcessInstanceReport'; -import ProcessModelNew from './ProcessModelNew'; -import ProcessModelEdit from './ProcessModelEdit'; -import ProcessInstanceShow from './ProcessInstanceShow'; - -export default function AdminRoutes() { - return ( - - } /> - - } /> - } - /> - } /> - } - /> - - } - /> - } - /> - } - /> - } - /> - } - /> - } - /> - } - /> - } - /> - - ); -} diff --git a/src/routes/AdminRoutes.tsx b/src/routes/AdminRoutes.tsx new file mode 100644 index 0000000..3290d6a --- /dev/null +++ b/src/routes/AdminRoutes.tsx @@ -0,0 +1,89 @@ +import { Routes, Route } from 'react-router-dom'; + +import ProcessGroups from './ProcessGroups'; +import ProcessGroupShow from './ProcessGroupShow'; +import ProcessGroupNew from './ProcessGroupNew'; +import ProcessGroupEdit from './ProcessGroupEdit'; +import ProcessModelShow from './ProcessModelShow'; +import ProcessModelEditDiagram from './ProcessModelEditDiagram'; +import ProcessInstanceList from './ProcessInstanceList'; +import ProcessInstanceReport from './ProcessInstanceReport'; +import ProcessModelNew from './ProcessModelNew'; +import ProcessModelEdit from './ProcessModelEdit'; +import ProcessInstanceShow from './ProcessInstanceShow'; + +export default function AdminRoutes() { + return ( + // @ts-expect-error TS(2686): 'React' refers to a UMD global, but the current fi... Remove this comment to see the full error message + + {/* @ts-expect-error TS(2686): 'React' refers to a UMD global, but the current fi... Remove this comment to see the full error message */} + } /> + + {/* @ts-expect-error TS(2686): 'React' refers to a UMD global, but the current fi... Remove this comment to see the full error message */} + } /> + {/* @ts-expect-error TS(2686): 'React' refers to a UMD global, but the current fi... Remove this comment to see the full error message */} + } + /> + {/* @ts-expect-error TS(2686): 'React' refers to a UMD global, but the current fi... Remove this comment to see the full error message */} + } /> + {/* @ts-expect-error TS(2686): 'React' refers to a UMD global, but the current fi... Remove this comment to see the full error message */} + } + /> + + {/* @ts-expect-error TS(2686): 'React' refers to a UMD global, but the current fi... Remove this comment to see the full error message */} + } + /> + {/* @ts-expect-error TS(2686): 'React' refers to a UMD global, but the current fi... Remove this comment to see the full error message */} + } + /> + {/* @ts-expect-error TS(2686): 'React' refers to a UMD global, but the current fi... Remove this comment to see the full error message */} + } + /> + {/* @ts-expect-error TS(2686): 'React' refers to a UMD global, but the current fi... Remove this comment to see the full error message */} + } + /> + {/* @ts-expect-error TS(2686): 'React' refers to a UMD global, but the current fi... Remove this comment to see the full error message */} + } + /> + {/* @ts-expect-error TS(2686): 'React' refers to a UMD global, but the current fi... Remove this comment to see the full error message */} + } + /> + {/* @ts-expect-error TS(2686): 'React' refers to a UMD global, but the current fi... Remove this comment to see the full error message */} + } + /> + {/* @ts-expect-error TS(2686): 'React' refers to a UMD global, but the current fi... Remove this comment to see the full error message */} + } + /> + + ); +} diff --git a/src/routes/ProcessGroupEdit.js b/src/routes/ProcessGroupEdit.tsx similarity index 83% rename from src/routes/ProcessGroupEdit.js rename to src/routes/ProcessGroupEdit.tsx index 8a01f5a..80cff9c 100644 --- a/src/routes/ProcessGroupEdit.js +++ b/src/routes/ProcessGroupEdit.tsx @@ -27,9 +27,10 @@ export default function ProcessGroupEdit() { ); }, [params]); - const updateProcessGroup = (event) => { + const updateProcessGroup = (event: any) => { event.preventDefault(); + // @ts-expect-error TS(2531): Object is possibly 'null'. fetch(`${BACKEND_BASE_URL}/process-groups/${processGroup.id}`, { headers: new Headers({ 'Content-Type': 'application/json', @@ -38,10 +39,12 @@ export default function ProcessGroupEdit() { method: 'PUT', body: JSON.stringify({ display_name: displayName, + // @ts-expect-error TS(2531): Object is possibly 'null'. id: processGroup.id, }), }).then( () => { + // @ts-expect-error TS(2531): Object is possibly 'null'. navigate(`/admin/process-groups/${processGroup.id}`); }, // Note: it's important to handle errors here @@ -54,6 +57,7 @@ export default function ProcessGroupEdit() { }; const deleteProcessGroup = () => { + // @ts-expect-error TS(2531): Object is possibly 'null'. fetch(`${BACKEND_BASE_URL}/process-groups/${processGroup.id}`, { headers: new Headers({ Authorization: `Bearer ${HOT_AUTH_TOKEN}`, @@ -69,15 +73,15 @@ export default function ProcessGroupEdit() { ); }; - const onDisplayNameChanged = (newDisplayName) => { + const onDisplayNameChanged = (newDisplayName: any) => { setDisplayName(newDisplayName); }; if (processGroup) { return (
- -

Edit Process Group: {processGroup.id}

+ +

Edit Process Group: {(processGroup as any).id}

Submit diff --git a/src/routes/ProcessGroupNew.js b/src/routes/ProcessGroupNew.tsx similarity index 95% rename from src/routes/ProcessGroupNew.js rename to src/routes/ProcessGroupNew.tsx index 7f129ca..b93495a 100644 --- a/src/routes/ProcessGroupNew.js +++ b/src/routes/ProcessGroupNew.tsx @@ -10,7 +10,7 @@ export default function ProcessGroupNew() { const [displayName, setDisplayName] = useState(''); const navigate = useNavigate(); - const addProcessGroup = (event) => { + const addProcessGroup = (event: any) => { event.preventDefault(); fetch(`${BACKEND_BASE_URL}/process-groups`, { @@ -36,7 +36,7 @@ export default function ProcessGroupNew() { ); }; - const onDisplayNameChanged = (newDisplayName) => { + const onDisplayNameChanged = (newDisplayName: any) => { setDisplayName(newDisplayName); if (!idHasBeenUpdatedByUser) { setIdentifier(slugifyString(newDisplayName)); diff --git a/src/routes/ProcessGroupShow.js b/src/routes/ProcessGroupShow.tsx similarity index 69% rename from src/routes/ProcessGroupShow.js rename to src/routes/ProcessGroupShow.tsx index ed28541..d85a588 100644 --- a/src/routes/ProcessGroupShow.js +++ b/src/routes/ProcessGroupShow.tsx @@ -17,8 +17,10 @@ export default function ProcessGroupShow() { const [pagination, setPagination] = useState(null); useEffect(() => { + // @ts-expect-error TS(2345): Argument of type 'string | 1' is not assignable to... Remove this comment to see the full error message const page = parseInt(searchParams.get('page') || DEFAULT_PAGE, 10); const perPage = parseInt( + // @ts-expect-error TS(2345): Argument of type 'string | 50' is not assignable t... Remove this comment to see the full error message searchParams.get('per_page') || DEFAULT_PER_PAGE, 10 ); @@ -59,13 +61,16 @@ export default function ProcessGroupShow() { const buildTable = () => { const rows = processModels.map((row) => { return ( - + - - {row.id} + + {(row as any).id} - {row.display_name} + {(row as any).display_name} ); }); @@ -87,21 +92,26 @@ export default function ProcessGroupShow() { if (processGroup && pagination) { const perPage = parseInt( + // @ts-expect-error TS(2345): Argument of type 'string | 50' is not assignable t... Remove this comment to see the full error message searchParams.get('per_page') || DEFAULT_PER_PAGE, 10 ); + // @ts-expect-error TS(2345): Argument of type 'string | 1' is not assignable to... Remove this comment to see the full error message const page = parseInt(searchParams.get('page') || DEFAULT_PAGE, 10); return (
- -

Process Group: {processGroup.id}

+ {/* @ts-expect-error TS(2322): Type 'any' is not assignable to type 'never'. */} + +

Process Group: {(processGroup as any).id}

    -
diff --git a/src/routes/ProcessGroups.js b/src/routes/ProcessGroups.tsx similarity index 68% rename from src/routes/ProcessGroups.js rename to src/routes/ProcessGroups.tsx index f73e8ae..0721477 100644 --- a/src/routes/ProcessGroups.js +++ b/src/routes/ProcessGroups.tsx @@ -17,8 +17,10 @@ export default function ProcessGroups() { const [pagination, setPagination] = useState(null); useEffect(() => { + // @ts-expect-error TS(2345): Argument of type 'string | 1' is not assignable to... Remove this comment to see the full error message const page = parseInt(searchParams.get('page') || DEFAULT_PAGE, 10); const perPage = parseInt( + // @ts-expect-error TS(2345): Argument of type 'string | 50' is not assignable t... Remove this comment to see the full error message searchParams.get('per_page') || DEFAULT_PER_PAGE, 10 ); @@ -45,11 +47,13 @@ export default function ProcessGroups() { const buildTable = () => { const rows = processGroups.map((row) => { return ( - + - {row.id} + + {(row as any).id} + - {row.display_name} + {(row as any).display_name} ); }); @@ -68,22 +72,28 @@ export default function ProcessGroups() { const processGroupsDisplayArea = () => { const perPage = parseInt( + // @ts-expect-error TS(2345): Argument of type 'string | 50' is not assignable t... Remove this comment to see the full error message searchParams.get('per_page') || DEFAULT_PER_PAGE, 10 ); + // @ts-expect-error TS(2345): Argument of type 'string | 1' is not assignable to... Remove this comment to see the full error message const page = parseInt(searchParams.get('page') || DEFAULT_PAGE, 10); let displayText = ''; if (processGroups?.length > 0) { + // @ts-expect-error TS(2322): Type 'Element' is not assignable to type 'string'. displayText = ( ); } else { + // @ts-expect-error TS(2322): Type 'Element' is not assignable to type 'string'. displayText =

No Groups To Display

; } return displayText; @@ -92,6 +102,7 @@ export default function ProcessGroups() { if (pagination) { return (
+ {/* @ts-expect-error TS(2322): Type '{}' is not assignable to type 'never'. */}

Process Groups

diff --git a/src/routes/ProcessInstanceList.js b/src/routes/ProcessInstanceList.tsx similarity index 79% rename from src/routes/ProcessInstanceList.js rename to src/routes/ProcessInstanceList.tsx index 94e6927..16b53fc 100644 --- a/src/routes/ProcessInstanceList.js +++ b/src/routes/ProcessInstanceList.tsx @@ -7,6 +7,7 @@ import { } from 'react-router-dom'; import { Button, Table, Stack, Dropdown } from 'react-bootstrap'; +// @ts-expect-error TS(7016): Could not find a declaration file for module 'reac... Remove this comment to see the full error message import DatePicker from 'react-datepicker'; import { format } from 'date-fns'; import { @@ -41,7 +42,7 @@ export default function ProcessInstanceList() { const [endFrom, setEndFrom] = useState(null); const [endTill, setEndTill] = useState(null); - const setErrorMessage = useContext(ErrorContext)[1]; + const setErrorMessage = (useContext as any)(ErrorContext)[1]; const [processStatus, setProcessStatus] = useState(PROCESS_STATUSES[0]); const parametersToAlwaysFilterBy = useMemo(() => { @@ -57,12 +58,14 @@ export default function ProcessInstanceList() { function getProcessInstances() { const page = searchParams.get('page') || DEFAULT_PAGE; const perPage = parseInt( + // @ts-expect-error TS(2345): Argument of type 'string | 50' is not assignable t... Remove this comment to see the full error message searchParams.get('per_page') || DEFAULT_PER_PAGE, 10 ); let queryParamString = `per_page=${perPage}&page=${page}`; Object.keys(parametersToAlwaysFilterBy).forEach((paramName) => { + // @ts-expect-error TS(7053): Element implicitly has an 'any' type because expre... Remove this comment to see the full error message const functionToCall = parametersToAlwaysFilterBy[paramName]; const searchParamValue = searchParams.get(paramName); if (searchParamValue) { @@ -75,6 +78,7 @@ export default function ProcessInstanceList() { queryParamString += `&process_status=${searchParams.get( 'process_status' )}`; + // @ts-expect-error TS(2345): Argument of type 'string | null' is not assignable... Remove this comment to see the full error message setProcessStatus(searchParams.get('process_status')); } @@ -110,7 +114,7 @@ export default function ProcessInstanceList() { // does the comparison, but also returns false if either argument // is not truthy and therefore not comparable. - const isTrueComparison = (param1, operation, param2) => { + const isTrueComparison = (param1: any, operation: any, param2: any) => { if (param1 && param2) { switch (operation) { case '<': @@ -125,10 +129,11 @@ export default function ProcessInstanceList() { } }; - const handleFilter = (event) => { + const handleFilter = (event: any) => { event.preventDefault(); const page = searchParams.get('page') || DEFAULT_PAGE; const perPage = parseInt( + // @ts-expect-error TS(2345): Argument of type 'string | 50' is not assignable t... Remove this comment to see the full error message searchParams.get('per_page') || DEFAULT_PER_PAGE, 10 ); @@ -173,7 +178,12 @@ export default function ProcessInstanceList() { ); }; - const dateComponent = (labelString, name, initialDate, onChangeFunction) => { + const dateComponent = ( + labelString: any, + name: any, + initialDate: any, + onChangeFunction: any + ) => { let selectedDate = null; if (initialDate) { selectedDate = new Date(initialDate * 1000); @@ -184,7 +194,7 @@ export default function ProcessInstanceList() { convertDateToSeconds(date, onChangeFunction)} + onChange={(date: any) => convertDateToSeconds(date, onChangeFunction)} showTimeSelect dateFormat={DATE_FORMAT} /> @@ -270,32 +280,34 @@ export default function ProcessInstanceList() { const buildTable = () => { const rows = processInstances.map((row) => { let formattedStartDate = '-'; - if (row.start_in_seconds) { - const startDate = new Date(row.start_in_seconds * 1000); + if ((row as any).start_in_seconds) { + const startDate = new Date((row as any).start_in_seconds * 1000); formattedStartDate = format(startDate, DATE_FORMAT); } let formattedEndDate = '-'; - if (row.end_in_seconds) { - const endDate = new Date(row.end_in_seconds * 1000); + if ((row as any).end_in_seconds) { + const endDate = new Date((row as any).end_in_seconds * 1000); formattedEndDate = format(endDate, DATE_FORMAT); } return ( - + - {row.id} + {(row as any).id} - {row.process_model_identifier} - {row.process_group_identifier} + {(row as any).process_model_identifier} + {(row as any).process_group_identifier} {formattedStartDate} {formattedEndDate} - - {row.status} + + {(row as any).status} ); @@ -319,15 +331,20 @@ export default function ProcessInstanceList() { if (pagination) { const perPage = parseInt( + // @ts-expect-error TS(2345): Argument of type 'string | 50' is not assignable t... Remove this comment to see the full error message searchParams.get('per_page') || DEFAULT_PER_PAGE, 10 ); + // @ts-expect-error TS(2345): Argument of type 'string | 1' is not assignable to... Remove this comment to see the full error message const page = parseInt(searchParams.get('page') || DEFAULT_PAGE, 10); return (

Process Instances for {params.process_model_id}

@@ -336,6 +353,7 @@ export default function ProcessInstanceList() { page={page} perPage={perPage} pagination={pagination} + // @ts-expect-error TS(2322): Type 'Element' is not assignable to type 'string'. tableToDisplay={buildTable()} queryParamString={getSearchParamsAsQueryString()} path={`/admin/process-models/${params.process_group_id}/${params.process_model_id}/process-instances`} diff --git a/src/routes/ProcessInstanceReport.js b/src/routes/ProcessInstanceReport.tsx similarity index 72% rename from src/routes/ProcessInstanceReport.js rename to src/routes/ProcessInstanceReport.tsx index e25a560..c243ab5 100644 --- a/src/routes/ProcessInstanceReport.js +++ b/src/routes/ProcessInstanceReport.tsx @@ -22,6 +22,7 @@ export default function ProcessInstanceReport() { function getProcessInstances() { const page = searchParams.get('page') || DEFAULT_PAGE; const perPage = parseInt( + // @ts-expect-error TS(2345): Argument of type 'string | 50' is not assignable t... Remove this comment to see the full error message searchParams.get('per_page') || DEFAULT_PER_PAGE, 10 ); @@ -55,13 +56,13 @@ export default function ProcessInstanceReport() { const buildTable = () => { const rows = processInstances.map((row) => { return ( - - {row.id} - {row.data.month} - {row.data.milestone} - {row.data.req_id} - {row.data.feature} - {row.data.priority} + + {(row as any).id} + {(row as any).data.month} + {(row as any).data.milestone} + {(row as any).data.req_id} + {(row as any).data.feature} + {(row as any).data.priority} ); }); @@ -84,15 +85,20 @@ export default function ProcessInstanceReport() { if (pagination) { const perPage = parseInt( + // @ts-expect-error TS(2345): Argument of type 'string | 50' is not assignable t... Remove this comment to see the full error message searchParams.get('per_page') || DEFAULT_PER_PAGE, 10 ); + // @ts-expect-error TS(2345): Argument of type 'string | 1' is not assignable to... Remove this comment to see the full error message const page = parseInt(searchParams.get('page') || DEFAULT_PAGE, 10); return (

Process Instances for {params.process_model_id}

@@ -100,6 +106,7 @@ export default function ProcessInstanceReport() { page={page} perPage={perPage} pagination={pagination} + // @ts-expect-error TS(2322): Type 'Element' is not assignable to type 'string'. tableToDisplay={buildTable()} path={`/admin/process-models/${params.process_group_id}/${params.process_model_id}/process-instances/report`} /> diff --git a/src/routes/ProcessInstanceShow.js b/src/routes/ProcessInstanceShow.tsx similarity index 79% rename from src/routes/ProcessInstanceShow.js rename to src/routes/ProcessInstanceShow.tsx index 9981135..adb8087 100644 --- a/src/routes/ProcessInstanceShow.js +++ b/src/routes/ProcessInstanceShow.tsx @@ -55,14 +55,17 @@ export default function ProcessInstanceShow() { return (
-

Process Instance Id: {processInstance.id}

+

Process Instance Id: {(processInstance as any).id}

Data

-
{JSON.stringify(processInstance.data, null, 2)}
+
{JSON.stringify((processInstance as any).data, null, 2)}
@@ -72,9 +74,11 @@ export default function TaskList() { if (pagination) { const perPage = parseInt( + // @ts-expect-error TS(2345): Argument of type 'string | 50' is not assignable t... Remove this comment to see the full error message searchParams.get('per_page') || DEFAULT_PER_PAGE, 10 ); + // @ts-expect-error TS(2345): Argument of type 'string | 1' is not assignable to... Remove this comment to see the full error message const page = parseInt(searchParams.get('page') || DEFAULT_PAGE, 10); return (
@@ -83,6 +87,7 @@ export default function TaskList() { page={page} perPage={perPage} pagination={pagination} + // @ts-expect-error TS(2322): Type 'Element' is not assignable to type 'string'. tableToDisplay={buildTable()} path="/tasks" /> diff --git a/src/routes/TaskShow.js b/src/routes/TaskShow.tsx similarity index 73% rename from src/routes/TaskShow.js rename to src/routes/TaskShow.tsx index 0725d45..b1dc6db 100644 --- a/src/routes/TaskShow.js +++ b/src/routes/TaskShow.tsx @@ -11,6 +11,7 @@ export default function TaskShow() { const navigate = useNavigate(); useEffect(() => { + // @ts-expect-error TS(2345): Argument of type 'string | undefined' is not assig... Remove this comment to see the full error message const taskId = parseInt(params.task_id, 10); fetch(`${BACKEND_BASE_URL}/tasks/${taskId}`, { headers: new Headers({ @@ -28,7 +29,8 @@ export default function TaskShow() { ); }, [params.task_id]); - const handleFormSubmit = (event) => { + const handleFormSubmit = (event: any) => { + // @ts-expect-error TS(2531): Object is possibly 'null'. fetch(`${BACKEND_BASE_URL}/tasks/${task.id}/submit`, { headers: new Headers({ Authorization: `Bearer ${HOT_AUTH_TOKEN}`, @@ -51,13 +53,13 @@ export default function TaskShow() { return (
-

Task ID: {task.id}

-

process_instance_id: {task.process_instance_id}

-

status: {task.status}

+

Task ID: {(task as any).id}

+

process_instance_id: {(task as any).process_instance_id}

+

status: {(task as any).status}

); diff --git a/src/routes/expenses.jsx b/src/routes/expenses.jsx deleted file mode 100644 index d30204e..0000000 --- a/src/routes/expenses.jsx +++ /dev/null @@ -1,7 +0,0 @@ -export default function Expenses() { - return ( -
-

Expenses

-
- ); -} diff --git a/src/routes/expenses.tsx b/src/routes/expenses.tsx new file mode 100644 index 0000000..ca576bc --- /dev/null +++ b/src/routes/expenses.tsx @@ -0,0 +1,9 @@ +export default function Expenses() { + return ( + // @ts-expect-error TS(2686): 'React' refers to a UMD global, but the current fi... Remove this comment to see the full error message +
+ {/* @ts-expect-error TS(2686): 'React' refers to a UMD global, but the current fi... Remove this comment to see the full error message */} +

Expenses

+
+ ); +} diff --git a/src/setupTests.js b/src/setupTests.tsx similarity index 100% rename from src/setupTests.js rename to src/setupTests.tsx diff --git a/tsfixme.d.ts b/tsfixme.d.ts new file mode 100644 index 0000000..33cb660 --- /dev/null +++ b/tsfixme.d.ts @@ -0,0 +1,4 @@ +// declare global { + type $TSFixMe = any; + type $TSFixMeFunction = (...args: any[]) => any; +// }