refs #14280 Merge branch 'origin/14280-query-language'
authorDaniel Kos <daniel.kos@contractors.roche.com>
Thu, 6 Dec 2018 07:47:00 +0000 (08:47 +0100)
committerDaniel Kos <daniel.kos@contractors.roche.com>
Thu, 6 Dec 2018 07:47:21 +0000 (08:47 +0100)
Arvados-DCO-1.1-Signed-off-by: Daniel Kos <daniel.kos@contractors.roche.com>

1  2 
package.json
src/store/auth/auth-action.ts
src/store/repositories/repositories-actions.ts
yarn.lock

diff --combined package.json
index 623b86d3a58d659bae2105ae06aa0629db71b22f,1c066db8c1776fcf3238bf0a8e06190851b9e224..1332630471dccf4c6baf093905c74cd525880bfc
      "@types/react-dnd": "3.0.2",
      "@types/react-dropzone": "4.2.2",
      "@types/react-highlight-words": "0.12.0",
-     "@types/redux-form": "7.4.5",
+     "@types/redux-form": "7.4.12",
      "@types/reselect": "2.2.0",
      "@types/shell-quote": "1.6.0",
      "axios": "0.18.0",
      "classnames": "2.2.6",
      "cwlts": "1.15.29",
      "debounce": "1.2.0",
 +    "is-image": "2.0.0",
      "js-yaml": "3.12.0",
      "lodash": "4.17.11",
      "react": "16.5.2",
index e1b36f823e3f1082952a00abad459567c56e948b,9aadd5b949b2fe325d38d75bf2a03f4bb60e524b..4ed348751faa6a516eb07bcf3cb2c18688534e01
@@@ -4,7 -4,7 +4,7 @@@
  
  import { ofType, unionize, UnionOf } from '~/common/unionize';
  import { Dispatch } from "redux";
- import { reset, stopSubmit, startSubmit } from 'redux-form';
+ import { reset, stopSubmit, startSubmit, FormErrors } from 'redux-form';
  import { AxiosInstance } from "axios";
  import { RootState } from "../store";
  import { snackbarActions } from '~/store/snackbar/snackbar-actions';
@@@ -94,9 -94,9 +94,9 @@@ export const openSshKeyCreateDialog = (
  export const openPublicKeyDialog = (name: string, publicKey: string) =>
      dialogActions.OPEN_DIALOG({ id: SSH_KEY_PUBLIC_KEY_DIALOG, data: { name, publicKey } });
  
 -export const openSshKeyAttributesDialog = (index: number) =>
 +export const openSshKeyAttributesDialog = (uuid: string) =>
      (dispatch: Dispatch, getState: () => RootState) => {
 -        const sshKey = getState().auth.sshKeys[index];
 +        const sshKey = getState().auth.sshKeys.find(it => it.uuid === uuid);
          dispatch(dialogActions.OPEN_DIALOG({ id: SSH_KEY_ATTRIBUTES_DIALOG, data: { sshKey } }));
      };
  
@@@ -143,9 -143,9 +143,9 @@@ export const createSshKey = (data: SshK
          } catch (e) {
              const error = getAuthorizedKeysServiceError(e);
              if (error === AuthorizedKeysServiceError.UNIQUE_PUBLIC_KEY) {
-                 dispatch(stopSubmit(SSH_KEY_CREATE_FORM_NAME, { publicKey: 'Public key already exists.' }));
+                 dispatch(stopSubmit(SSH_KEY_CREATE_FORM_NAME, { publicKey: 'Public key already exists.' } as FormErrors));
              } else if (error === AuthorizedKeysServiceError.INVALID_PUBLIC_KEY) {
-                 dispatch(stopSubmit(SSH_KEY_CREATE_FORM_NAME, { publicKey: 'Public key is invalid' }));
+                 dispatch(stopSubmit(SSH_KEY_CREATE_FORM_NAME, { publicKey: 'Public key is invalid' } as FormErrors));
              }
          }
      };
index 61caa769f1ea32746608f3a4f570a86ddbb4db38,dd80f8d79fd117851fa4f86eec41319ff43d9187..ea64bfc90ee2bb3cd109c1944f8992fdbeb3f087
@@@ -10,7 -10,7 +10,7 @@@ import { navigateToRepositories } from 
  import { unionize, ofType, UnionOf } from "~/common/unionize";
  import { dialogActions } from '~/store/dialog/dialog-actions';
  import { RepositoryResource } from "~/models/repositories";
- import { startSubmit, reset, stopSubmit } from "redux-form";
+ import { startSubmit, reset, stopSubmit, FormErrors } from "redux-form";
  import { getCommonResourceServiceError, CommonResourceServiceError } from "~/services/common-service/common-resource-service";
  import { snackbarActions, SnackbarKind } from '~/store/snackbar/snackbar-actions';
  
@@@ -32,9 -32,9 +32,9 @@@ export const openRepositoriesSampleGitD
          dispatch(dialogActions.OPEN_DIALOG({ id: REPOSITORIES_SAMPLE_GIT_DIALOG, data: { uuidPrefix } }));
      };
  
 -export const openRepositoryAttributes = (index: number) =>
 +export const openRepositoryAttributes = (uuid: string) =>
      (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
 -        const repositoryData = getState().repositories.items[index];
 +        const repositoryData = getState().repositories.items.find(it => it.uuid === uuid);
          dispatch(dialogActions.OPEN_DIALOG({ id: REPOSITORY_ATTRIBUTES_DIALOG, data: { repositoryData } }));
      };
  
@@@ -55,13 -55,13 +55,13 @@@ export const createRepository = (reposi
              const newRepository = await services.repositoriesService.create({ name: `${user.username}/${repository.name}` });
              dispatch(dialogActions.CLOSE_DIALOG({ id: REPOSITORY_CREATE_FORM_NAME }));
              dispatch(reset(REPOSITORY_CREATE_FORM_NAME));
-             dispatch(snackbarActions.OPEN_SNACKBAR({ message: "Repository has been successfully created.", hideDuration: 2000, kind: SnackbarKind.SUCCESS })); 
-             dispatch<any>(loadRepositoriesData());     
+             dispatch(snackbarActions.OPEN_SNACKBAR({ message: "Repository has been successfully created.", hideDuration: 2000, kind: SnackbarKind.SUCCESS }));
+             dispatch<any>(loadRepositoriesData());
              return newRepository;
          } catch (e) {
              const error = getCommonResourceServiceError(e);
              if (error === CommonResourceServiceError.NAME_HAS_ALREADY_BEEN_TAKEN) {
-                 dispatch(stopSubmit(REPOSITORY_CREATE_FORM_NAME, { name: 'Repository with the same name already exists.' }));
+                 dispatch(stopSubmit(REPOSITORY_CREATE_FORM_NAME, { name: 'Repository with the same name already exists.' } as FormErrors));
              }
              return undefined;
          }
@@@ -84,7 -84,7 +84,7 @@@ export const removeRepository = (uuid: 
      async (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
          dispatch(snackbarActions.OPEN_SNACKBAR({ message: 'Removing ...' }));
          await services.repositoriesService.delete(uuid);
 -        dispatch(snackbarActions.OPEN_SNACKBAR({ message: 'Removed.', hideDuration: 2000 }));
 +        dispatch(snackbarActions.OPEN_SNACKBAR({ message: 'Removed.', hideDuration: 2000, kind: SnackbarKind.SUCCESS }));
          dispatch<any>(loadRepositoriesData());
      };
  
@@@ -104,4 -104,4 +104,4 @@@ export const loadRepositoriesData = () 
  export const loadRepositoriesPanel = () =>
      (dispatch: Dispatch) => {
          dispatch(repositoriesBindedActions.REQUEST_ITEMS());
-     };
+     };
diff --combined yarn.lock
index f08c370f5d3fb8121d01411f0519fda30590e7ba,e4d50aae5aa5cce20ac28cfddf3024c457f2f5ab..d3d6396d479953c17c56aa7ebbfca727d5cc2661
+++ b/yarn.lock
      "@types/react" "*"
      redux "^3.6.0"
  
- "@types/redux-form@7.4.5":
-   version "7.4.5"
-   resolved "https://registry.yarnpkg.com/@types/redux-form/-/redux-form-7.4.5.tgz#fae0fa6cfbc613867093d1e0f6a84db17177305e"
-   integrity sha512-PY74tuDamNhStB+87TQJXAKoa7uf5Ue/MJvnIrQowgjyRUo2Ky/THUfDec9U7IKRGzLnX7vWVTsoN1EvLnwAEQ==
+ "@types/redux-form@7.4.12":
+   version "7.4.12"
+   resolved "https://registry.yarnpkg.com/@types/redux-form/-/redux-form-7.4.12.tgz#2afb0615e3b7417d460ab14a4802ede4a98f9c79"
+   integrity sha512-qHRkJcgdc5MntQHrkYCg5o6oySh+OdVKA90yELTdi9XlNvSGRxd6K230aTckVrwdUjdxtwZ31UqFgLoU5SiWYQ==
    dependencies:
      "@types/react" "*"
      redux "^3.6.0 || ^4.0.0"
@@@ -4329,11 -4329,6 +4329,11 @@@ ignore-walk@^3.0.1
    dependencies:
      minimatch "^3.0.4"
  
 +image-extensions@^1.0.1:
 +  version "1.1.0"
 +  resolved "https://registry.yarnpkg.com/image-extensions/-/image-extensions-1.1.0.tgz#b8e6bf6039df0056e333502a00b6637a3105d894"
 +  integrity sha1-uOa/YDnfAFbjM1AqALZjejEF2JQ=
 +
  immutable@^3.8.1:
    version "3.8.2"
    resolved "https://registry.yarnpkg.com/immutable/-/immutable-3.8.2.tgz#c2439951455bb39913daf281376f1530e104adf3"
@@@ -4649,13 -4644,6 +4649,13 @@@ is-glob@^4.0.0
    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=
 +  dependencies:
 +    image-extensions "^1.0.1"
 +
  is-in-browser@^1.0.2, is-in-browser@^1.1.3:
    version "1.1.3"
    resolved "https://registry.yarnpkg.com/is-in-browser/-/is-in-browser-1.1.3.tgz#56ff4db683a078c6082eb95dad7dc62e1d04f835"