17782: Additional imports and typing fixes.
authorLucas Di Pentima <lucas.dipentima@curii.com>
Fri, 2 Jul 2021 14:48:12 +0000 (11:48 -0300)
committerLucas Di Pentima <lucas.dipentima@curii.com>
Fri, 2 Jul 2021 16:43:28 +0000 (13:43 -0300)
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas.dipentima@curii.com>

12 files changed:
package.json
src/store/store.ts
src/views-components/auto-logout/auto-logout.tsx
src/views-components/data-explorer/renderers.tsx
src/views-components/project-properties-dialog/project-properties-form.tsx
src/views-components/resource-properties-form/property-chip.tsx
src/views-components/sharing-dialog/participant-select.tsx
src/views/collection-panel/collection-tag-form.tsx
src/views/link-account-panel/link-account-panel-root.tsx
src/views/login-panel/login-panel.tsx
src/views/virtual-machine-panel/virtual-machine-admin-panel.tsx
yarn.lock

index 2d64e21ed947c5a6d9886c1405e9980f7ef79448..37392cf8c669bd77fcb2038420a551c66c6d1f5e 100644 (file)
@@ -31,7 +31,7 @@
     "elliptic": "6.5.4",
     "file-saver": "2.0.1",
     "fstream": "1.0.12",
-    "is-image": "2.0.0",
+    "is-image": "3.0.0",
     "js-yaml": "3.13.1",
     "jssha": "2.3.1",
     "jszip": "3.1.5",
@@ -89,6 +89,7 @@
     "@types/classnames": "2.2.6",
     "@types/enzyme": "3.1.14",
     "@types/enzyme-adapter-react-16": "1.0.3",
+    "@types/is-image": "3.0.0",
     "@types/jest": "26.0.23",
     "@types/node": "15.12.4",
     "@types/react-dom": "17.0.8",
     "**/meow/trim-newlines": "^3.0.1",
     "react-rte/**/ua-parser-js": "0.7.24",
     "**/@typescript-eslint/eslint-plugin": "^4.1.1",
-    "**/@typescript-eslint/parser": "^4.1.1",
-    "webpack-dev-server/http-proxy-middleware/http-proxy": "^1.18.1",
-    "webpack-dev-server/selfsigned/node-forge": "0.10.0",
-    "webpack/node-libs-browser/crypto-browserify/*/elliptic": "6.5.4",
-    "webpack/terser-webpack-plugin/serialize-javascript": "^3.1.0"
+    "**/@typescript-eslint/parser": "^4.1.1"
   },
   "browserslist": {
     "production": [
index 0cacc88f71c43296a1a41651f29c5107d8a01a3a..d0f1af871d7321bdcd24941fab7c88038845ff29 100644 (file)
@@ -73,10 +73,15 @@ import { Config } from 'common/config';
 import { pluginConfig } from 'plugins';
 import { MiddlewareListReducer } from 'common/plugintypes';
 
+declare global {
+    interface Window {
+      __REDUX_DEVTOOLS_EXTENSION_COMPOSE__?: typeof compose;
+    }
+}
+
 const composeEnhancers =
     (process.env.NODE_ENV === 'development' &&
-        window && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ &&
-        window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({ trace: true, traceLimit: 25 })) ||
+        window && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__) ||
     compose;
 
 export type RootState = ReturnType<ReturnType<typeof createRootReducer>>;
index c6c1feeef86671df718c7f4613e0bcaa37a94d1a..9a8299b25ca3b351f6c3f9ee161f9e6b67bb5d0c 100644 (file)
@@ -40,7 +40,7 @@ const mapDispatchToProps = (dispatch: Dispatch): AutoLogoutActionProps => ({
 export type AutoLogoutProps = AutoLogoutDataProps & AutoLogoutActionProps;
 
 const debounce = (delay: number | undefined, fn: Function) => {
-    let timerId: number | null;
+    let timerId: NodeJS.Timer | null;
     return (...args: any[]) => {
         if (timerId) { clearTimeout(timerId); }
         timerId = setTimeout(() => {
index a8f375aec458ff4c76965acea3161b9b734b6d90..dccd2786f1c80c76656e739817de3a2a265ff3fb 100644 (file)
@@ -477,9 +477,9 @@ export const ResponsiblePerson =
     compose(
         connect(
             (state: RootState, props: { uuid: string, parentRef: HTMLElement | null }) => {
-                let responsiblePersonName = null;
-                let responsiblePersonUUID = null;
-                let responsiblePersonProperty = null;
+                let responsiblePersonName: string = '';
+                let responsiblePersonUUID: string = '';
+                let responsiblePersonProperty: string = '';
 
                 if (state.auth.config.clusterConfig.Collections.ManagedProperties) {
                     let index = 0;
index 09c847c33329783a8760179a3a9c1e4c552686b9..f36bacf4aeb3007dfe706a7db5dced57961ef0b2 100644 (file)
@@ -6,12 +6,13 @@ import { reduxForm, reset } from 'redux-form';
 import { PROJECT_PROPERTIES_FORM_NAME, createProjectProperty } from 'store/details-panel/details-panel-action';
 import { ResourcePropertiesForm, ResourcePropertiesFormData } from 'views-components/resource-properties-form/resource-properties-form';
 import { withStyles } from '@material-ui/core';
+import { Dispatch } from 'redux';
 
 const Form = withStyles(({ spacing }) => ({ container: { marginBottom: spacing.unit * 2 } }))(ResourcePropertiesForm);
 
 export const ProjectPropertiesForm = reduxForm<ResourcePropertiesFormData>({
     form: PROJECT_PROPERTIES_FORM_NAME,
-    onSubmit: (data, dispatch) => {
+    onSubmit: (data, dispatch: Dispatch) => {
         dispatch<any>(createProjectProperty(data));
         dispatch(reset(PROJECT_PROPERTIES_FORM_NAME));
     }
index 0116488280dff28dbd402622077f07c0d1f3bdde..24b5c0a96dcd6eec494301ab2eb47381047104b9 100644 (file)
@@ -6,7 +6,7 @@ import React from 'react';
 import { Chip } from '@material-ui/core';
 import { connect } from 'react-redux';
 import { RootState } from 'store/store';
-import * as CopyToClipboard from 'react-copy-to-clipboard';
+import CopyToClipboard from 'react-copy-to-clipboard';
 import { getVocabulary } from 'store/vocabulary/vocabulary-selectors';
 import { Dispatch } from 'redux';
 import { snackbarActions, SnackbarKind } from 'store/snackbar/snackbar-actions';
index d34a81255808096d0c9b8c3f838565a7f863e2c1..402faa7f9414d935c64ccc3ec677c98f5db8a00f 100644 (file)
@@ -12,7 +12,7 @@ import { ListItemText, Typography } from '@material-ui/core';
 import { noop } from 'lodash/fp';
 import { GroupClass, GroupResource } from 'models/group';
 import { getUserDisplayName, UserResource } from 'models/user';
-import { ResourceKind } from 'models/resource';
+import { Resource, ResourceKind } from 'models/resource';
 import { ListResults } from 'services/common-service/common-service';
 
 export interface Participant {
@@ -20,7 +20,7 @@ export interface Participant {
     uuid: string;
 }
 
-type ParticipantResource = GroupResource & UserResource;
+type ParticipantResource = GroupResource | UserResource;
 
 interface ParticipantSelectProps {
     items: Participant[];
@@ -40,14 +40,14 @@ interface ParticipantSelectState {
     suggestions: ParticipantResource[];
 }
 
-const getDisplayName = (item: GroupResource & UserResource) => {
+const getDisplayName = (item: GroupResource | UserResource) => {
     switch (item.kind) {
         case ResourceKind.USER:
             return getUserDisplayName(item, true);
         case ResourceKind.GROUP:
             return item.name;
         default:
-            return item.uuid;
+            return (item as Resource).uuid;
     }
 };
 
index d1956d3373aa677f189d4ce685f4b9aaabfe5f5b..6d9cbd59424f4596c6406f9d7f5e724f13912d5c 100644 (file)
@@ -6,12 +6,13 @@ import { reduxForm, reset } from 'redux-form';
 import { createCollectionTag, COLLECTION_TAG_FORM_NAME } from 'store/collection-panel/collection-panel-action';
 import { ResourcePropertiesForm, ResourcePropertiesFormData } from 'views-components/resource-properties-form/resource-properties-form';
 import { withStyles } from '@material-ui/core';
+import { Dispatch } from 'redux';
 
 const Form = withStyles(({ spacing }) => ({ container: { marginBottom: spacing.unit * 2 } }))(ResourcePropertiesForm);
 
 export const CollectionTagForm = reduxForm<ResourcePropertiesFormData>({
     form: COLLECTION_TAG_FORM_NAME,
-    onSubmit: (data, dispatch) => {
+    onSubmit: (data, dispatch: Dispatch) => {
         dispatch<any>(createCollectionTag(data));
         dispatch(reset(COLLECTION_TAG_FORM_NAME));
     }
index 87809d36d3b72095cd6fd53d9a35c84ca0a6c9ab..eb52ba18e39a81418f95eac28d7cfab339cd9038 100644 (file)
@@ -52,7 +52,7 @@ export interface LinkAccountPanelRootActionProps {
 }
 
 function displayUser(user: UserResource, showCreatedAt: boolean = false, showCluster: boolean = false) {
-    const disp = [];
+    const disp: JSX.Element[] = [];
     disp.push(<span><b>{user.email}</b> ({user.username}, {user.uuid})</span>);
     if (showCluster) {
         const homeCluster = user.uuid.substr(0, 5);
index e09e486e14e6d0cfdb147cdbf4745319c297ffaf..110097bee59dc7d09a9afbcdcf53f50516114755 100644 (file)
@@ -51,7 +51,7 @@ const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
 });
 
 const doPasswordLogin = (url: string) => (username: string, password: string) => {
-    const formData = [];
+    const formData: string[] = [];
     formData.push('username='+encodeURIComponent(username));
     formData.push('password='+encodeURIComponent(password));
     return Axios.post(`${url}/arvados/v1/users/authenticate`, formData.join('&'), {
index 685265017fea45cc92f091a7605be1199ada4619..a6ad24a7dbbc6c7206dcbe48d390efac7a24d6b9 100644 (file)
@@ -31,7 +31,6 @@ const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
 
 const mapStateToProps = (state: RootState) => {
     return {
-        logins: state.virtualMachines.logins,
         userUuid: state.auth.user!.uuid,
         ...state.virtualMachines
     };
index 1740bbb8bfb0662e774d58bf25fbbed64a64b851..140e34abb570a46ae68f88217251e56cbc338776 100644 (file)
--- a/yarn.lock
+++ b/yarn.lock
   resolved "https://registry.yarnpkg.com/@types/history/-/history-4.7.8.tgz#49348387983075705fe8f4e02fb67f7daaec4934"
   integrity sha512-S78QIYirQcUoo6UJZx9CSP0O2ix9IaeAXwQi26Rhr/+mg7qqPy8TzaxHSUut7eGjL8WmLccT7/MXf304WjqHcA==
 
+"@types/is-image@3.0.0":
+  version "3.0.0"
+  resolved "https://registry.yarnpkg.com/@types/is-image/-/is-image-3.0.0.tgz#79baa13a9d3395b916a566df4ae7dd6115bfd779"
+  integrity sha512-+CD4viNsVIn9hPNGAZPEfV2DKoJd/by1OcbCFbsBirmDLNj3v8aZ+5QUPFZFeP4YXgQHVA4A37/ueb5qwnd1fg==
+  dependencies:
+    is-image "*"
+
 "@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0":
   version "2.0.3"
   resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.3.tgz#4ba8ddb720221f432e443bd5f9117fd22cfd4762"
@@ -6718,7 +6725,7 @@ http-proxy-middleware@0.19.1:
     lodash "^4.17.11"
     micromatch "^3.1.10"
 
-http-proxy@^1.17.0, http-proxy@^1.18.1:
+http-proxy@^1.17.0:
   version "1.18.1"
   resolved "https://registry.yarnpkg.com/http-proxy/-/http-proxy-1.18.1.tgz#401541f0534884bbf95260334e72f88ee3976549"
   integrity sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ==
@@ -6804,7 +6811,7 @@ ignore@^5.1.4:
   resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.1.8.tgz#f150a8b50a34289b33e22f5889abd4d8016f0e57"
   integrity sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==
 
-image-extensions@^1.0.1:
+image-extensions@^1.1.0:
   version "1.1.0"
   resolved "https://registry.yarnpkg.com/image-extensions/-/image-extensions-1.1.0.tgz#b8e6bf6039df0056e333502a00b6637a3105d894"
   integrity sha1-uOa/YDnfAFbjM1AqALZjejEF2JQ=
@@ -7234,12 +7241,12 @@ is-glob@^4.0.0, is-glob@^4.0.1, is-glob@~4.0.1:
   dependencies:
     is-extglob "^2.1.1"
 
-is-image@2.0.0:
-  version "2.0.0"
-  resolved "https://registry.yarnpkg.com/is-image/-/is-image-2.0.0.tgz#454c9569578de31869371fbfaea4958f461b3e0c"
-  integrity sha1-RUyVaVeN4xhpNx+/rqSVj0YbPgw=
+is-image@*, is-image@3.0.0:
+  version "3.0.0"
+  resolved "https://registry.yarnpkg.com/is-image/-/is-image-3.0.0.tgz#f183431372f6f8caf7cda316a0a6dea4d41926dd"
+  integrity sha512-NNPLvwKZ/hqx1Wv+ayKvVeDOylIapVKSxK/guzmB9doAk0FEdK0KqFKbnwNbuMLEPqEY4NaBhxzB4e98fVOq2Q==
   dependencies:
-    image-extensions "^1.0.1"
+    image-extensions "^1.1.0"
 
 is-in-browser@^1.0.2, is-in-browser@^1.1.3:
   version "1.1.3"
@@ -9080,7 +9087,7 @@ node-fetch@^1.0.1:
     encoding "^0.1.11"
     is-stream "^1.0.1"
 
-node-forge@0.10.0, node-forge@^0.10.0:
+node-forge@^0.10.0:
   version "0.10.0"
   resolved "https://registry.yarnpkg.com/node-forge/-/node-forge-0.10.0.tgz#32dea2afb3e9926f02ee5ce8794902691a676bf3"
   integrity sha512-PPmu8eEeG9saEUvI97fm4OYxXVB6bFvyNTyiUOBichBpFG8A1Ljw3bY62+5oOjDEMHRnd0Y7HQ+x7uzxOzC6JA==
@@ -12021,13 +12028,6 @@ send@0.17.1:
     range-parser "~1.2.1"
     statuses "~1.5.0"
 
-serialize-javascript@^3.1.0:
-  version "3.1.0"
-  resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-3.1.0.tgz#8bf3a9170712664ef2561b44b691eafe399214ea"
-  integrity sha512-JIJT1DGiWmIKhzRsG91aS6Ze4sFUrYbltlkg2onR5OrnNM02Kl/hnY/T4FN2omvyeBbQmMJv+K4cPOpGzOTFBg==
-  dependencies:
-    randombytes "^2.1.0"
-
 serialize-javascript@^4.0.0:
   version "4.0.0"
   resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-4.0.0.tgz#b525e1238489a5ecfc42afacc3fe99e666f4b1aa"