Skip to content

Commit

Permalink
Develop (#150)
Browse files Browse the repository at this point in the history
* Update dependency @material-ui/core to v4.7.2 (#46)

* Update dependency react-use to v13.11.0 (#47)

* Update renovate.json (#52)

* Update dependency @types/papaparse to v5.0.3 (#55)

* Update dependency electron to v7.1.4 (#56)

* Update typescript-eslint monorepo to v2.11.0 (#53)

* Update renovate.json (#58)

* Update renovate.json

* Update renovate.json

* Update dependency @testing-library/react to v9.3.3 (#59)

* Update dependency react-popper to v1.3.7 (#51)

* Update dependency @types/node to v12.12.17 (#48)

* Update dependency @types/react to v16.9.16 (#49)

* Update dependency react-use to v13.12.2 (#50)

* Update dependency @testing-library/react to v9.4.0 (#64)

* Update dependency electron to v7.1.5 (#65)

* Update Apollo GraphQL packages (#66)

* Update dependency @material-ui/core to v4.8.0 (#67)

* Update dependency @types/node to v12.12.18 (#68)

* Update typescript-eslint monorepo to v2.12.0 (#69)

* Fix/bug query explorer ssl (#62)

* Use electron for explorer if checkbox is selected

* Rename query files

* Fix queryBase results bug

* Fix query explorer and add compact view option

* Use Typescript for Electron build

* Restructure code and handle history with Context

* Fix and adjust Explorer

* Fix tests

* Remove unused code

* Fix e2e tests

* Update lock file

* Clean and improve tests

* Add missing @types/qs

* Chore/improve code coverage (#71)

* Render Root component

* Fix TS bugs

* Clean unused code

* Add more tests

* Add some tests for Electron main file

* Update renovate.json

* Fix Renovate config

* Chore/rearrange files (#76)

* Change components structure

* Move helpers out of apollo dir

* Add Connection data saving test

* Add form tests

* Fix CI configuration bug

* Remove condition from apollo base file

* Add password visibility toggle tests

* Update dependency electron to v7.1.6 (#77)

* Update dependency papaparse to v5.1.1 (#78)

* Update dependency @types/jest to v24.0.24 (#79)

* Update Node.js to v10.18.0 (#81)

* Update dependency electron to v7.1.7 (#82)

* Update dependency @types/react to v16.9.17 (#83)

* Update dependency @types/mui-datatables to v2.13.2 (#84)

* Update dependency eslint to v6.8.0 (#85)

* Update dependency typescript to v3.7.4 (#86)

* Update typescript-eslint monorepo to v2.13.0 (#88)

* Update dependency @material-ui/core to v4.8.1 (#89)

* Update dependency @types/jest to v24.0.25 (#90)

* Update dependency react-use to v13.13.0 (#91)

* Update dependency @types/mui-datatables to v2.13.3 (#92)

* Update dependency @types/node to v12.12.22 (#80)

* Update dependency @material-ui/core to v4.8.2 (#93)

* Update typescript-eslint monorepo to v2.14.0 (#94)

* Update dependency @types/node to v12.12.23 (#95)

Co-authored-by: Renovate Bot <renovatebot@gmail.com>

* Update dependency react-use to v13.14.0 (#96)

Co-authored-by: Renovate Bot <renovatebot@gmail.com>

* Update dependency @types/node to v12.12.24 (#97)

Co-authored-by: Renovate Bot <renovatebot@gmail.com>

* Update dependency @types/webpack-env to v1.15.0 (#98)

Co-authored-by: Renovate Bot <renovatebot@gmail.com>

* Update dependency @material-ui/core to v4.8.3 (#99)

Co-authored-by: Renovate Bot <renovatebot@gmail.com>

* Update typescript-eslint monorepo to v2.15.0 (#100)

Co-authored-by: Renovate Bot <renovatebot@gmail.com>

* Update dependency axios to v0.19.1 (#101)

Co-authored-by: Renovate Bot <renovatebot@gmail.com>

* Update dependency react-use to v13.14.1 (#102)

Co-authored-by: Renovate Bot <renovatebot@gmail.com>

* Update dependency @types/mui-datatables to v2.13.4 (#103)

Co-authored-by: Renovate Bot <renovatebot@gmail.com>

* Update dependency react-use to v13.14.2 (#104)

Co-authored-by: Renovate Bot <renovatebot@gmail.com>

* Update dependency react-use to v13.14.3 (#105)

Co-authored-by: Renovate Bot <renovatebot@gmail.com>

* Update dependency date-fns to v2.9.0 (#106)

Co-authored-by: Renovate Bot <renovatebot@gmail.com>

* Update dependency electron to v7.1.8 (#107)

Co-authored-by: Renovate Bot <renovatebot@gmail.com>

* Update dependency react-use to v13.15.0 (#108)

Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>

* Update typescript-eslint monorepo to v2.16.0 (#109)

Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>

* Update dependency electron to v7.1.9 (#110)

Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>

* Update Node.js to v10.18.1 (#111)

Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>

* Update dependency react-use to v13.16.0 (#113)

Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>

* Update dependency react-use to v13.16.1 (#114)

Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>

* Update dependency @types/jest to v24.9.0 (#115)

Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>

* Update dependency react-use to v13.17.0 (#116)

Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>

* Update dependency eslint-plugin-react to v7.18.0 (#117)

Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>

* Update dependency react-use to v13.18.0 (#118)

Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>

* Update dependency react-use to v13.19.0 (#119)

Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>

* Update dependency typescript to v3.7.5 (#120)

Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>

* Update dependency mui-datatables to v2.14.0 (#121)

Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>

* Update dependency react-use to v13.20.0 (#122)

Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>

* Update dependency @types/node to v12.12.25 (#123)

Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>

* Update dependency react-use to v13.21.0 (#126)

Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>

* Update typescript-eslint monorepo to v2.17.0 (#127)

Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>

* Update dependency @types/react-dom to v16.9.5 (#128)

Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>

* Update dependency @types/react to v16.9.18 (#129)

Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>

* Update dependency axios to v0.19.2 (#130)

Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>

* Update dependency react-final-form to v6.3.4 (#131)

Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>

* Update dependency @types/react to v16.9.19 (#132)

Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>

* Update dependency @types/jest to v24.9.1 (#134)

Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>

* Update dependency codecov to v3.6.2 (#135)

Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>

* Update dependency electron to v7.1.10 (#136)

Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>

* Update dependency final-form to v4.18.7 (#137)

Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>

* Update dependency react-final-form to v6.3.5 (#138)

Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>

* Update dependency react-use to v13.22.0 (#139)

Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>

* Update dependency react-use to v13.22.1 (#141)

Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>

* Update dependency graphql to v14.6.0 (#140)

Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>

* Update dependency react-use to v13.22.2 (#142)

Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>

* Update typescript-eslint monorepo to v2.18.0 (#143)

Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>

* Update dependency rimraf to v3.0.1 (#145)

Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>

* Update dependency react-use to v13.22.3 (#146)

Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>

* Update dependency @testing-library/cypress to v5.1.0 (#147)

Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>

* Update dependency @types/node to v12.12.26 (#148)

Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>

* Update dependency @types/react-inspector to v4 (#87)

Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>

* Update dependency wait-on to v4 (#125)

Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>

* Fix missing unsafeSsl in ExplorerPanel (#149)

* Fix missing unsafeSsl in ExplorerPanel

* Fix tests

* Update CHANGELOG

* 0.1.8

* Update DEVELOPMENT.md

* Udpate version in .env

* Remove unsafeSsl from connection id and fix tests

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: WhiteSource Renovate <renovatebot@gmail.com>
  • Loading branch information
3 people committed Jan 29, 2020
1 parent 482e560 commit 8ace909
Show file tree
Hide file tree
Showing 16 changed files with 252 additions and 128 deletions.
2 changes: 1 addition & 1 deletion .env
@@ -1,7 +1,7 @@
REACT_EDITOR=vim
# all vars available in the App has to be prefixed with REACT_APP_
# see https://github.com/facebook/create-react-app/blob/next/packages/react-scripts/template/README.md#what-other-env-files-can-be-used
REACT_APP_VERSION=0.1.7
REACT_APP_VERSION=0.1.8

# use own babel-eslint and eslint versions
SKIP_PREFLIGHT_CHECK=true
6 changes: 6 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,11 @@
## master

## v0.1.8

### :bug: Bug Fix

- fix "Ignore SSL" in Explorer panel

## v0.1.7

#### :rocket: New Features
Expand Down
2 changes: 1 addition & 1 deletion DEVELOPMENT.md
Expand Up @@ -63,7 +63,7 @@ Use `npm run dist:[platform]` to create platform specific bundle (`platform` may
## Releases

0. Update CHANGELOG.md
1. Use `npm publish` to set new version number (you will be prompted for that)
1. Use `npm version patch` to set new version number and then `npm publish` to publish on NPM
1. Execute `./release.sh` script to create Electron packages for every supported system
1. Push Docker images with `npm run release:docker`
1. Manually create Github release, upload files from step 2. and changes from CHANGELOG.md
Expand Down
2 changes: 1 addition & 1 deletion dev-db/docker-compose.yml
Expand Up @@ -19,5 +19,5 @@ services:
- INFLUXDB_HTTP_HTTPS_CERTIFICATE=/cert/certificate.pem
- INFLUXDB_HTTP_HTTPS_PRIVATE_KEY=/cert/key.pem

# In order to simulate unsafe SSL add the following like to your /etc/hosts file and access database from test.dev URL
# In order to simulate unsafe SSL add the following entry to your /etc/hosts file and access database from test.dev URL
# 127.0.0.1 test.dev
240 changes: 149 additions & 91 deletions package-lock.json

Large diffs are not rendered by default.

36 changes: 18 additions & 18 deletions package.json
Expand Up @@ -2,30 +2,30 @@
"name": "timeseriesadmin",
"description": "Administration and querying interface for InfluxDB databases",
"author": "Jan Grzegorowski <grzegorowski@gmail.com> (https://grzegorowski.com)",
"version": "0.1.7",
"version": "0.1.8",
"private": false,
"license": "MIT",
"dependencies": {
"@material-ui/core": "4.8.3",
"@material-ui/icons": "4.5.1",
"@types/classnames": "2.2.9",
"@types/jest": "24.9.0",
"@types/jest": "24.9.1",
"@types/lodash": "4.14.149",
"@types/mui-datatables": "2.13.4",
"@types/node": "12.12.25",
"@types/node": "12.12.26",
"@types/papaparse": "5.0.3",
"@types/react": "16.9.17",
"@types/react-dom": "16.9.4",
"@types/react-inspector": "3.0.0",
"@types/react": "16.9.19",
"@types/react-dom": "16.9.5",
"@types/react-inspector": "4.0.0",
"@types/webpack-env": "1.15.0",
"apollo-cache-inmemory": "1.6.5",
"apollo-client": "2.6.8",
"apollo-link": "1.2.13",
"axios": "0.19.1",
"axios": "0.19.2",
"compare-versions": "3.5.1",
"date-fns": "2.9.0",
"final-form": "4.18.6",
"graphql": "14.5.8",
"final-form": "4.18.7",
"graphql": "14.6.0",
"graphql-tag": "2.10.1",
"history": "4.10.1",
"lodash": "4.17.15",
Expand All @@ -35,11 +35,11 @@
"react": "16.12.0",
"react-apollo": "3.1.3",
"react-dom": "16.12.0",
"react-final-form": "6.3.3",
"react-final-form": "6.3.5",
"react-inspector": "4.0.0",
"react-popper": "1.3.7",
"react-scripts": "3.3.0",
"react-use": "13.20.0",
"react-use": "13.22.3",
"typescript": "3.7.5"
},
"scripts": {
Expand Down Expand Up @@ -67,23 +67,23 @@
},
"devDependencies": {
"@apollo/react-testing": "3.1.3",
"@testing-library/cypress": "5.0.2",
"@testing-library/cypress": "5.1.0",
"@testing-library/react": "9.4.0",
"@types/qs": "6.9.0",
"@typescript-eslint/eslint-plugin": "2.16.0",
"@typescript-eslint/parser": "2.16.0",
"@typescript-eslint/eslint-plugin": "2.18.0",
"@typescript-eslint/parser": "2.18.0",
"babel-eslint": "10.0.3",
"babel-polyfill": "6.26.0",
"codecov": "3.6.1",
"codecov": "3.6.2",
"cypress": "3.7.0",
"electron": "7.1.9",
"electron": "7.1.10",
"electron-builder": "21.2.0",
"electron-debug": "3.0.1",
"eslint": "6.8.0",
"eslint-plugin-react": "7.18.0",
"prettier": "1.19.1",
"rimraf": "3.0.0",
"wait-on": "3.3.0"
"rimraf": "3.0.1",
"wait-on": "4.0.0"
},
"main": "public/electron.js",
"_homepage": "homepage value should not be changed or Electron will not be able to localize source files",
Expand Down
2 changes: 1 addition & 1 deletion src/app/apollo/defaults.ts
Expand Up @@ -2,7 +2,7 @@ import storage from 'app/helpers/storage';

// ensure connection fields existence
const connections = JSON.parse(storage.get('connections', '[]')).map(
(conn: any) => ({
(conn: {}) => ({
url: '',
u: '',
p: '',
Expand Down
62 changes: 54 additions & 8 deletions src/app/apollo/resolvers/connections.test.ts
Expand Up @@ -12,44 +12,90 @@ describe('connections resolvers', () => {
{ cache: null },
),
).toBe(null);
expect(updateConnections).toBeCalledWith(null, [
expect(updateConnections).toHaveBeenLastCalledWith(null, [
{
__typename: 'Connection',
db: undefined,
id: 'http://test.testuser_',
p: undefined,
u: 'user',
url: 'http://test.test',
unsafeSsl: undefined,
},
]);
});

test('saveConnection() update', () => {
test('saveConnection() update using defaults', () => {
(getConnections as any).mockImplementation(() => [
{
__typename: 'Connection',
db: undefined,
id: 'http://test.testuser_',
id: 'http://test.test__',
p: undefined,
u: 'user',
u: undefined,
url: 'http://test.test',
unsafeSsl: undefined,
},
]);
expect(
saveConnection(
undefined,
{ url: 'http://test.test', u: 'user', p: 'password' },
{
url: 'http://test.test',
u: undefined,
p: 'password',
unsafeSsl: undefined,
},
{ cache: null },
),
).toBe(null);
expect(updateConnections).toBeCalledWith(null, [
expect(updateConnections).toHaveBeenLastCalledWith(null, [
{
__typename: 'Connection',
db: undefined,
id: 'http://test.testuser_',
id: 'http://test.test__',
p: 'password',
u: undefined,
url: 'http://test.test',
unsafeSsl: undefined,
},
]);
});

test('saveConnection() update', () => {
(getConnections as any).mockImplementation(() => [
{
__typename: 'Connection',
db: 'db',
id: 'http://test.testuserdb',
p: undefined,
u: 'user',
url: 'http://test.test',
unsafeSsl: true,
},
]);
expect(
saveConnection(
undefined,
{
db: 'db',
url: 'http://test.test',
u: 'user',
p: 'password',
unsafeSsl: true,
},
{ cache: null },
),
).toBe(null);
expect(updateConnections).toHaveBeenLastCalledWith(null, [
{
__typename: 'Connection',
db: 'db',
id: 'http://test.testuserdb',
p: 'password',
u: 'user',
url: 'http://test.test',
unsafeSsl: true,
},
]);
});
Expand All @@ -72,6 +118,6 @@ describe('connections resolvers', () => {
{ cache: null },
),
).toBe(null);
expect(updateConnections).toBeCalledWith(null, []);
expect(updateConnections).toHaveBeenLastCalledWith(null, []);
});
});
3 changes: 2 additions & 1 deletion src/app/apollo/resolvers/connections.ts
Expand Up @@ -4,7 +4,7 @@ import { FormParams } from './form';

export const saveConnection = (
_obj: void,
{ url, u, p, db }: FormParams,
{ url, u, p, db, unsafeSsl }: FormParams,
{ cache }: any,
): null => {
const connections = getConnections(cache);
Expand All @@ -13,6 +13,7 @@ export const saveConnection = (
u,
p,
db,
unsafeSsl,
id: `${url}${u || '_'}${db || '_'}`,
__typename: 'Connection',
};
Expand Down
4 changes: 2 additions & 2 deletions src/app/apollo/schema.ts
Expand Up @@ -29,8 +29,8 @@ export default `
}
type Mutation {
executeQuery(url: String!, u: String, p: String, db: String, q: String!): Boolean
updateForm(url: String, u: String, p: String, db: String, q: String): Boolean
saveConnection(url: String, u: String, p: String, db: String): Boolean
updateForm(url: String, u: String, p: String, db: String, q: String, unsafeSsl: Boolean): Boolean
saveConnection(url: String, u: String, p: String, db: String, unsafeSsl: Boolean): Boolean
deleteConnection(id: String!): Boolean
}
type Query {
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/App/index.tsx
Expand Up @@ -45,7 +45,7 @@ export const App: React.FC = () => {
>
<DrawerRight
drawerWidth={drawerWidth}
updateWidth={(width: number) => setDrawerWidth(width)}
updateWidth={(width: number): void => setDrawerWidth(width)}
/>
</Drawer>
</div>
Expand Down
4 changes: 4 additions & 0 deletions src/app/components/root/Root.test.tsx
Expand Up @@ -3,6 +3,10 @@ import { render, waitForElement } from 'utils/test-utils';
import { Root } from './Root';
import { fireEvent, within } from '@testing-library/react';

jest.mock('app/helpers/queryBase', () => ({
queryBase: jest.fn().mockResolvedValue({ response: { status: 200 } }),
}));

describe('<App />', () => {
test('connection and query history saving', async () => {
const { getByText, getByLabelText, getByTestId } = render(<Root />);
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/root/Root.tsx
Expand Up @@ -6,7 +6,7 @@ import theme from '../theme';
import { App } from '../App';
import client from '../../apollo';

export const Root = () => (
export const Root: React.FC = () => (
<ApolloProvider client={client}>
<MuiThemeProvider theme={theme}>
<App />
Expand Down
1 change: 1 addition & 0 deletions src/app/components/sidebar/Connections/index.test.tsx
Expand Up @@ -47,6 +47,7 @@ describe('<Connections />', () => {
u: 'user',
p: 'pass',
db: 'db',
unsafeSsl: false,
},
];
const { getByText, getByLabelText } = render(<Connections />, {
Expand Down
11 changes: 9 additions & 2 deletions src/app/components/sidebar/Connections/index.tsx
Expand Up @@ -35,8 +35,14 @@ const styles = (): any => ({
});

export const SET_FORM_QUERY = gql`
mutation($url: String!, $u: String, $p: String, $db: String) {
updateForm(url: $url, u: $u, p: $p, db: $db) @client
mutation(
$url: String!
$u: String
$p: String
$db: String
$unsafeSsl: Boolean
) {
updateForm(url: $url, u: $u, p: $p, db: $db, unsafeSsl: $unsafeSsl) @client
}
`;

Expand All @@ -48,6 +54,7 @@ export const GET_CONNECTIONS = gql`
u
p
db
unsafeSsl
}
}
`;
Expand Down
1 change: 1 addition & 0 deletions src/app/helpers/connections.ts
Expand Up @@ -11,6 +11,7 @@ export const getConnections = (cache: any) => {
u
p
db
unsafeSsl
}
}
`,
Expand Down

0 comments on commit 8ace909

Please sign in to comment.