Skip to content

Commit

Permalink
Updates packages that have vulnerability
Browse files Browse the repository at this point in the history
This patch updates vulnerable packages and enforces following changes

- Modifies few tests and Resources component
- Adds prettier rule for endOfLine as auto to resolve prettier errors
- Moves global variable declaration into a `.d.ts` file
to resolve eslint errors
- Adds `.eslintcache` in the gitignore which is generated by
latest version of react-scripts

Signed-off-by:Shiv Verma <shverma@redhat.com>
  • Loading branch information
pratap0007 authored and tekton-robot committed Feb 12, 2021
1 parent 2fefe55 commit 9455647
Show file tree
Hide file tree
Showing 11 changed files with 12,682 additions and 8,897 deletions.
1 change: 1 addition & 0 deletions ui/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"jest": true
},
"rules": {
"prettier/prettier": ["error", { "endOfLine": "auto" }],
"no-console": "warn",
"@typescript-eslint/explicit-module-boundary-types": "off"
},
Expand Down
3 changes: 3 additions & 0 deletions ui/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,6 @@
npm-debug.log*
yarn-debug.log*
yarn-error.log*

#eslint
.eslintcache
20,709 changes: 12,315 additions & 8,394 deletions ui/package-lock.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@patternfly/patternfly": "^4.80.3",
"@patternfly/react-core": "^4.47.0",
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.5.0",
Expand All @@ -15,20 +16,19 @@
"@types/react-router-dom": "^5.1.6",
"@types/react-syntax-highlighter": "^13.5.0",
"@types/react-test-renderer": "^16.9.3",
"axios": "^0.19.2",
"axios": "^0.21.1",
"fuzzysort": "^1.1.4",
"mobx": "^5.15.6",
"mobx-react": "^6.3.0",
"mobx-state-tree": "^3.17.2",
"moment": "^2.29.1",
"mst-persist": "^0.1.3",
"patternfly": "^3.59.5",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-github-login": "^1.0.3",
"react-markdown": "^5.0.3",
"react-router-dom": "^5.2.0",
"react-scripts": "3.4.3",
"react-scripts": "^4.0.1",
"react-syntax-highlighter": "^15.3.1",
"remark-gfm": "^1.0.0",
"typescript": "^3.7.5"
Expand Down
10 changes: 10 additions & 0 deletions ui/src/config/constant.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
interface API_CONFIG {
API_URL: string;
GH_CLIENT_ID: string;
}

export declare global {
interface Window {
config: API_CONFIG;
}
}
11 changes: 0 additions & 11 deletions ui/src/config/constants.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@
interface API_CONFIG {
API_URL: string;
GH_CLIENT_ID: string;
}

declare global {
interface Window {
config: API_CONFIG;
}
}

window.config = window.config || {
API_URL: 'no API_URL set',
GH_CLIENT_ID: 'no GH_CLIENT_ID set'
Expand Down
6 changes: 2 additions & 4 deletions ui/src/containers/App/App.test.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React from 'react';
import { mount } from 'enzyme';
import renderer from 'react-test-renderer';
import { FakeHub } from '../../api/testutil';
import { createProviderAndStore, createProvider } from '../../store/root';
import LeftPane from '../../components/LeftPane';
Expand All @@ -12,13 +11,13 @@ const { Provider } = createProviderAndStore(api);

describe('App', () => {
it('should render the component correctly and match the snapshot', (done) => {
const app = renderer.create(
const app = mount(
<Provider>
<App />
</Provider>
);

expect(app.toJSON()).toMatchSnapshot();
expect(app.debug()).toMatchSnapshot();
done();
});

Expand All @@ -29,7 +28,6 @@ describe('App', () => {
<App />
</Provider>
);

expect(component.find(LeftPane).length).toEqual(1);
});
});
Loading

0 comments on commit 9455647

Please sign in to comment.