chore(deps): bump react-use from 14.2.0 to 15.3.3

This is a copy of #1731 with fixes
This commit is contained in:
dependabot-preview[bot]
2020-08-03 08:25:35 +00:00
committed by Fredrik Adelöw
parent d15cc81c75
commit 14cfeb390e
29 changed files with 77 additions and 59 deletions
+1 -1
View File
@@ -29,7 +29,7 @@
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-router-dom": "6.0.0-beta.0",
"react-use": "^14.2.0"
"react-use": "^15.3.3"
},
"devDependencies": {
"@backstage/cli": "^0.1.1-alpha.16",
@@ -31,7 +31,7 @@ import {
import ClusterTable from '../ClusterTable/ClusterTable';
import { Button } from '@material-ui/core';
import { useAsync } from 'react-use';
import { gitOpsApiRef, ListClusterStatusesResponse } from '../../api';
import { gitOpsApiRef } from '../../api';
import { Alert } from '@material-ui/lab';
const ClusterList: FC<{}> = () => {
@@ -39,19 +39,17 @@ const ClusterList: FC<{}> = () => {
const githubAuth = useApi(githubAuthApiRef);
const [githubUsername, setGithubUsername] = useState(String);
const { loading, error, value } = useAsync<ListClusterStatusesResponse>(
async () => {
const accessToken = await githubAuth.getAccessToken(['repo', 'user']);
if (!githubUsername) {
const userInfo = await api.fetchUserInfo({ accessToken });
setGithubUsername(userInfo.login);
}
return api.listClusters({
gitHubToken: accessToken,
gitHubUser: githubUsername,
});
},
);
const { loading, error, value } = useAsync(async () => {
const accessToken = await githubAuth.getAccessToken(['repo', 'user']);
if (!githubUsername) {
const userInfo = await api.fetchUserInfo({ accessToken });
setGithubUsername(userInfo.login);
}
return api.listClusters({
gitHubToken: accessToken,
gitHubUser: githubUsername,
});
});
let content: JSX.Element;
if (loading) {
content = (
@@ -201,7 +201,7 @@ const ProfileCatalog: FC<{}> = () => {
setRunStatus([]);
const cloneResponse = await api.cloneClusterFromTemplate({
templateRepository: templateRepo,
templateRepository: templateRepo!,
gitHubToken: githubAccessToken,
gitHubUser: githubUsername,
targetOrg: gitHubOrg,
@@ -224,7 +224,7 @@ const ProfileCatalog: FC<{}> = () => {
gitHubUser: githubUsername,
targetOrg: gitHubOrg,
targetRepo: gitHubRepo,
profiles: gitopsProfiles,
profiles: gitopsProfiles!,
});
if (applyProfileResp.error === undefined) {