Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add scheduled query browser #472

Merged
merged 34 commits into from Jul 3, 2018
Merged

Add scheduled query browser #472

merged 34 commits into from Jul 3, 2018

Conversation

briandennis
Copy link
Contributor

Adds a tab to display the existing scheduled queries in a table. The queries can be searched and when clicked, display the full query string as well as a link to the grid.

Note, this first step only allows query viewing. Creation, deletion, and updating will come in later PRs.

@n-riesco
Copy link
Contributor

Thanks for the PR. I'll review it on Monday.

@shannonlal I guess you may want to have a look at this PR, as this touches the UI.

@@ -0,0 +1,31 @@
import React from 'react';
import PropTypes from 'prop-types';

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add comment with a description. Something like "this module contains a collection of helper components for layout purposes" would be enough, unless there is something about the usage of <Row> and <Column> that developers should know.

const Modal = props => {
const EnhancedClass = enhanceWithClickOutside(class extends Component {
handleClickOutside() {
// eslint-disable-next-line
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove // eslint-disable-next-line

});

return props.open
? (
Copy link
Contributor

@n-riesco n-riesco Jul 2, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

format ternary expressions as:

return props.open ? (
    expressionIfTrue
) : (
    expressionIfFalse
);          

@@ -15,3 +15,8 @@
.react-resizable-handle {
z-index: 9;
}

/* TODO move this override */
.scheduler .CodeMirror {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this change (not needed for this PR)

import PropTypes from 'prop-types';

import ReactDataGrid from 'react-data-grid';
import ms from 'ms';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add ms to devDependencies

Falcon uses webpack to bundle most of if its dependencies and for this reason most of them are listed as devDependencies.

Only dependencies that webpack is unable to bundle (e.g. node native modules) should be added as dependencies.

import matchSorter from 'match-sorter';
import Highlight from 'react-highlight';

import { Link } from '../Link.react';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use extensions, i.e. import { Link } from '../Link.react.js';

import Highlight from 'react-highlight';

import { Link } from '../Link.react';
import { Row, Column } from '../Layout.react';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.js


import { Link } from '../Link.react';
import { Row, Column } from '../Layout.react';
import Modal from '../Modal.react';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.js

import { Link } from '../Link.react';
import { Row, Column } from '../Layout.react';
import Modal from '../Modal.react';
import { plotlyUrl } from '../../utils/utils';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.js

- Add comment
- Remove old code
- Add ms dev

class IntervalFormatter extends React.Component {
static propTypes = {
value: PropTypes.object
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

similarly here: either rename value or add description.

};
const boxStyle = { boxSizing: 'border-box', width: '50%' };

const MetaPreview = props => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a styling issue with this component. See:

screenshot from 2018-07-02 17-11-19

@n-riesco
Copy link
Contributor

n-riesco commented Jul 2, 2018

I'm not done writing the review but I've run out of time today. I'll continue tomorrow.

Here are some general code style changes (for new code):

  • new code should use lowercase filenames
  • if the file contains JSX use the extension .jsx (don't use the extension .react.js)
  • use CSS imports; see here for an example.
  • use 4-space indentation

To discuss:

  • backend should provide the UI with the grid's name. At the moment, it's hard for a user to know which grid is updated by a query. The user would have to open a link in the modal preview to know what grid is updated.

@@ -327,6 +335,7 @@ class Settings extends Component {
<TabList>
<Tab>Connection</Tab>
<Tab disabled={queryPanelDisabled}>Query</Tab>
<Tab disabled={false}>Schedule</Tab>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

disabled={false}

package.json Outdated
@@ -237,16 +238,20 @@
"dtrace-provider": "^0.8.6",
"font-awesome": "^4.6.1",
"ibm_db": "^2.3.0",
"match-sorter": "^2.2.3",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move to devDependencies

package.json Outdated
"mysql": "^2.15.0",
"oracledb": "https://github.com/oracle/node-oracledb/releases/download/v2.2.0/oracledb-src-2.2.0.tgz",
"papaparse": "^4.3.7",
"pg": "^4.5.5",
"pg-hstore": "^2.3.2",
"react-click-outside": "^3.0.1",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move to devDependencies

package.json Outdated
"mysql": "^2.15.0",
"oracledb": "https://github.com/oracle/node-oracledb/releases/download/v2.2.0/oracledb-src-2.2.0.tgz",
"papaparse": "^4.3.7",
"pg": "^4.5.5",
"pg-hstore": "^2.3.2",
"react-click-outside": "^3.0.1",
"react-highlight": "^0.12.0",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move to devDependencies

package.json Outdated
"restify": "^4.3.2",
"sequelize": "^3.30.4",
"source-map-support": "^0.5.0",
"sqlite3": "^3.1.13",
"tedious": "^2.1.4"
"tedious": "^2.1.4",
"tohash": "^1.0.2"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move to devDependencies

query: PropTypes.object
};

export const MetaPreviewModal = props => (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any need for having two components: MetaPreview and MetaPreviewModal?

If possible, I'd like to have a single component with a name that doesn't require to document the purpose of these components (how about SchedulePreview?).

@n-riesco
Copy link
Contributor

n-riesco commented Jul 3, 2018

TODO

@n-riesco
Copy link
Contributor

n-riesco commented Jul 3, 2018

A few more styling issues (see screen capture below):

  • only first row gets highlighted on hover
  • the bottom borders of of the Schedule panel and the Schedules table overlap (add margin?)

peek 2018-07-03 12-43

@nicolaskruchten nicolaskruchten changed the title Add scheduled query visualization Add scheduled query browser Jul 3, 2018
@briandennis
Copy link
Contributor Author

@n-riesco we've made all the fixes as per your latest feedback

@n-riesco
Copy link
Contributor

n-riesco commented Jul 3, 2018

I've tested it locally and it looks good. I'll merge it as soon as the tests in CircleCI succeed.

@briandennis Thanks! It's been a pleasure to read such a clean PR.

@n-riesco n-riesco merged commit 6233733 into plotly:master Jul 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants