Fix linting
This commit is contained in:
@@ -32,11 +32,13 @@
|
||||
"@types/react-lazylog": "^4.5.0",
|
||||
"@types/react-redux": "^7.1.8",
|
||||
"circleci-api": "^4.0.0",
|
||||
"moment": "^2.25.3",
|
||||
"react": "16.13.1",
|
||||
"react-dom": "16.13.1",
|
||||
"react-lazylog": "^4.5.2",
|
||||
"react-redux": "^7.2.0",
|
||||
"react-router": "^5.1.2",
|
||||
"react-router-dom": "^5.1.2",
|
||||
"react-use": "^13.0.0"
|
||||
},
|
||||
"files": [
|
||||
|
||||
@@ -60,7 +60,6 @@ export class CircleCIApi {
|
||||
}
|
||||
|
||||
async getBuild(buildNumber: number, options: CircleCIOptions) {
|
||||
console.log({ buildNumber, options });
|
||||
return getFullBuild(options.token, buildNumber, {
|
||||
circleHost: this.apiUrl,
|
||||
...options.vcs,
|
||||
|
||||
@@ -25,7 +25,7 @@ export const Layout: React.FC = ({ children }) => (
|
||||
pageTitleOverride="Circle CI"
|
||||
title={
|
||||
<Box display="flex" alignItems="center">
|
||||
<img src={logo} style={{ height: '1em' }} />
|
||||
<img src={logo} style={{ height: '1em' }} alt="Backstage Logo" />
|
||||
<Box mr={1} /> Circle CI
|
||||
</Box>
|
||||
}
|
||||
|
||||
@@ -35,7 +35,6 @@ const useStyles = makeStyles({
|
||||
button: {
|
||||
order: -1,
|
||||
marginRight: 0,
|
||||
// FIXME: how not to hardcode this
|
||||
marginLeft: '-20px',
|
||||
},
|
||||
});
|
||||
@@ -51,12 +50,13 @@ export const ActionOutput: FC<{
|
||||
const [messages, setMessages] = useState([]);
|
||||
useEffect(() => {
|
||||
fetch(url)
|
||||
.then((res) => res.json())
|
||||
.then((actionOutput) => {
|
||||
actionOutput &&
|
||||
.then(res => res.json())
|
||||
.then(actionOutput => {
|
||||
if (typeof actionOutput !== 'undefined') {
|
||||
setMessages(
|
||||
actionOutput.map(({ message }: { message: string }) => message),
|
||||
);
|
||||
}
|
||||
});
|
||||
}, [url]);
|
||||
|
||||
|
||||
@@ -36,20 +36,14 @@ export const SettingsPage = () => {
|
||||
token: tokenFromStore,
|
||||
owner: ownerFromStore,
|
||||
repo: repoFromStore,
|
||||
} = useSelector(
|
||||
(state: iRootState): SettingsState =>
|
||||
(console.log({ state }) as any) || state.settings,
|
||||
);
|
||||
} = useSelector((state: iRootState): SettingsState => state.settings);
|
||||
|
||||
// const apiGitInfo = api.options.vcs;
|
||||
// const [authed] = React.useState(false);
|
||||
const [token, setToken] = React.useState(() => tokenFromStore);
|
||||
const [owner, setOwner] = React.useState(() => ownerFromStore);
|
||||
const [repo, setRepo] = React.useState(() => repoFromStore);
|
||||
|
||||
const dispatch: Dispatch = useDispatch();
|
||||
|
||||
React.useEffect(() => () => console.log('Settings unmounterd'), []);
|
||||
React.useEffect(() => {
|
||||
if (tokenFromStore !== token) {
|
||||
setToken(tokenFromStore);
|
||||
@@ -95,7 +89,7 @@ export const SettingsPage = () => {
|
||||
value={token}
|
||||
fullWidth
|
||||
variant="outlined"
|
||||
onChange={(e) => setToken(e.target.value)}
|
||||
onChange={e => setToken(e.target.value)}
|
||||
/>
|
||||
</ListItem>
|
||||
<ListItem>
|
||||
@@ -105,7 +99,7 @@ export const SettingsPage = () => {
|
||||
label="Owner"
|
||||
variant="outlined"
|
||||
value={owner}
|
||||
onChange={(e) => setOwner(e.target.value)}
|
||||
onChange={e => setOwner(e.target.value)}
|
||||
/>
|
||||
</ListItem>
|
||||
<ListItem>
|
||||
@@ -115,7 +109,7 @@ export const SettingsPage = () => {
|
||||
fullWidth
|
||||
variant="outlined"
|
||||
value={repo}
|
||||
onChange={(e) => setRepo(e.target.value)}
|
||||
onChange={e => setRepo(e.target.value)}
|
||||
/>
|
||||
</ListItem>
|
||||
<ListItem>
|
||||
|
||||
@@ -65,7 +65,7 @@ export const buildWithSteps = {
|
||||
state: iRootState,
|
||||
) {
|
||||
try {
|
||||
d; //ispatch.buildWithSteps.()
|
||||
dispatch.buildWithSteps.setBuildError(null);
|
||||
const options = {
|
||||
token: state.settings.token,
|
||||
vcs: {
|
||||
@@ -77,7 +77,7 @@ export const buildWithSteps = {
|
||||
const build = await api.getBuild(buildId, options);
|
||||
dispatch.buildWithSteps.setBuild(build);
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
dispatch.buildWithSteps.setBuildError(e);
|
||||
}
|
||||
},
|
||||
startPolling(
|
||||
|
||||
@@ -65,7 +65,7 @@ export const builds = {
|
||||
async getBuilds(api: CircleCIApi, state: iRootState) {
|
||||
try {
|
||||
dispatch.builds.setGetBuildsError(null);
|
||||
const builds = await api.getBuilds({
|
||||
const newBuilds = await api.getBuilds({
|
||||
token: state.settings.token,
|
||||
vcs: {
|
||||
owner: state.settings.owner,
|
||||
@@ -73,7 +73,7 @@ export const builds = {
|
||||
type: GitType.GITHUB,
|
||||
},
|
||||
});
|
||||
dispatch.builds.setBuilds(builds);
|
||||
dispatch.builds.setBuilds(newBuilds);
|
||||
} catch (e) {
|
||||
dispatch.builds.setGetBuildsError(null);
|
||||
}
|
||||
|
||||
@@ -14624,6 +14624,11 @@ moment@2.24.0:
|
||||
resolved "https://registry.npmjs.org/moment/-/moment-2.24.0.tgz#0d055d53f5052aa653c9f6eb68bb5d12bf5c2b5b"
|
||||
integrity sha512-bV7f+6l2QigeBBZSM/6yTNq4P2fNpSWj/0e7jQcy87A8e7o2nAfP/34/2ky5Vw4B9S446EtIhodAzkFCcR4dQg==
|
||||
|
||||
moment@^2.25.3:
|
||||
version "2.25.3"
|
||||
resolved "https://registry.npmjs.org/moment/-/moment-2.25.3.tgz#252ff41319cf41e47761a1a88cab30edfe9808c0"
|
||||
integrity sha512-PuYv0PHxZvzc15Sp8ybUCoQ+xpyPWvjOuK72a5ovzp2LI32rJXOiIfyoFoYvG3s6EwwrdkMyWuRiEHSZRLJNdg==
|
||||
|
||||
morgan@^1.10.0:
|
||||
version "1.10.0"
|
||||
resolved "https://registry.npmjs.org/morgan/-/morgan-1.10.0.tgz#091778abc1fc47cd3509824653dae1faab6b17d7"
|
||||
|
||||
Reference in New Issue
Block a user