"@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",
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';
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 } }));
};
} 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));
}
}
};
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';
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 } }));
};
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;
}
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());
};
export const loadRepositoriesPanel = () =>
(dispatch: Dispatch) => {
dispatch(repositoriesBindedActions.REQUEST_ITEMS());
- };
+ };
"@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"
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"
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"