Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Aug 29, 2025. It is now read-only.

Conversation

@n-riesco
Copy link
Contributor

@n-riesco n-riesco commented Apr 6, 2018

  • replaced react-codemirror with react-codemirror2
  • used react-resizable to implement a resize handle
  • improved CSS styles (CodeEditor, SQLTable and tab list)
  • TODO: add jest test?

Closes #401
Closes #360
Closes #311
Closes #412

peek 2018-04-06 23-32

* Implemented CodeEditor using `react-codemirror2`.

Closes plotly#401
Closes plotly#360
* Uses react-resizable

Closes plotly#311
* Removed component CodeEditorField.

* Removed dependency react-codemirror.
@n-riesco n-riesco force-pushed the editor/use-react-codemirror2 branch from 586f28e to dc37d26 Compare April 10, 2018 16:51
* Added a margin between the COdeEditor and SQLTable.

* Removed margin between the tab headers (Table, Chart, Export) and the
  corresponding tab panels.

* Reduce initial size of CodeEditor from 250px to 140px.

* Increase initial size of SQLTable from 200px to 300px.

* Updated the styles for SQLTable so that it uses the same color scheme
  as CodeEditor.

* Added a link to toggle the row filters in SQLTable.
@n-riesco n-riesco force-pushed the editor/use-react-codemirror2 branch from dc37d26 to c4f215d Compare April 10, 2018 16:58
@n-riesco
Copy link
Contributor Author

n-riesco commented Apr 10, 2018

@jackparmer @shannonlal I've updated the PR with a few, small fixes I want to merge before we release Falcon v2.6:

  • I've made the initial size of the code editor smaller and the table view accordingly larger.
  • the table view now uses the same color theme as the code editor.
  • I've changed the way to toggle the row filter (I've a added a link similar to the one used to toggle the code editor).
  • I've updated ibm_dbto v2.3 (no need for my fork any longer!!!)

Please, let me knwo what you think of the UI changes.

peek 2018-04-10 18-29

Copy link
Contributor

@shannonlal shannonlal left a comment

Choose a reason for hiding this comment

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

Overall looks really good. My comments are all minor and don't want to block the release. Good job💃

const height = wrapperElement.clientHeight;
const width = wrapperElement.clientWidth;

const minConstraints = [width, 74];
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe put 74 as a constant at top with what it represents. const MIN_WIDTH_CONSTRAINTS = 74

static computeAutocompleteTables(props) {
const schemaRequest = props.schemaRequest || {};

if (schemaRequest.status !== 200 || !schemaRequest.content || !schemaRequest.content.rows) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we be moving connection status to a centralized location or atleast have this as a const? Minor thing

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, let's not do that. There is no gain in having STATUS_OK_200 vs 200.

maxConstraints
} = this.state;

const mode = {
Copy link
Contributor

Choose a reason for hiding this comment

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

If we add other dialects should the be added here? Should we update the NEW_CONNECTION doc?


minWidth={740}
minHeight={200}
minHeight={300}
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor thing. Do these variables belong in const?

Copy link
Contributor Author

@n-riesco n-riesco Apr 11, 2018

Choose a reason for hiding this comment

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

No, I wouldn't. My personal criteria for defining a const is:

  • if the constant is used only once or twice, I only define a const if it documents its meaning; e.g. in minHeight={300}, I don't define a constant, because it's clear that 300 is the minimum height passed to ReactDataGrid.
  • if the constant is used twice or more times, then I define a constant, because it's easier to update const MY_CONST = 300; in one place than 300 in multiple places.

@shannonlal
Copy link
Contributor

Added minor comments that you can review if you have time 💃

@n-riesco n-riesco merged commit 96dfe32 into plotly:master Apr 11, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants