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

console: clean up styles for entry and server code #9646

Merged
merged 1 commit into from
Dec 27, 2016

Conversation

epixa
Copy link
Contributor

@epixa epixa commented Dec 26, 2016

Much of the code in console is original from when the project was a
separate plugin and was not updated when it was ported over. Now, any
code in the root of the project or in the server directory will be
linted based on the global rules in Kibana and more closely follow our main
JS styleguide.

For #9603

@epixa epixa added Team:Operations Team label for Operations Team review v5.2.0 v6.0.0 Feature:Console Dev Tools Console Feature labels Dec 26, 2016
Copy link
Contributor

@cjcenizal cjcenizal left a comment

Choose a reason for hiding this comment

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

Looks awesome! Just had one question and one suggestion.

@@ -150,14 +150,14 @@ module.exports = function (kibana) {
path: '/api/console/api_server',
method: ['GET', 'POST'],
handler: function (req, reply) {
let server = require('./api_server/server');
let { sense_version, apis } = req.query;
const server = require('./api_server/server');
Copy link
Contributor

Choose a reason for hiding this comment

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

Any reason not to import this at the top of the file?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nope! Good catch

strict: off
wrap-iife: off
no-var: off
prefer-const: off
Copy link
Contributor

Choose a reason for hiding this comment

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

When will we remove these linting rules and defer to the ones in the root?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just like the console-root eslintrc that is deleted in this PR, we can delete the specific lint configs once we've updated the code in those directories (public and api_server).

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds good. Can we track these tasks in a linting meta-issue? Unless you're planning to move on them immediately, I'm afraid that we'll lose sight of them.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The linked issue is the issue for tracking this, but I've added the meta label to it and added four todo items, two of which are tackled here.

@epixa epixa force-pushed the 9603-console-linting branch from 59dfbed to 522acae Compare December 26, 2016 23:27
@epixa epixa mentioned this pull request Dec 26, 2016
5 tasks
@epixa
Copy link
Contributor Author

epixa commented Dec 26, 2016

I removed that require() call in favor of an import

@@ -150,14 +151,13 @@ module.exports = function (kibana) {
path: '/api/console/api_server',
method: ['GET', 'POST'],
handler: function (req, reply) {
let server = require('./api_server/server');
let { sense_version, apis } = req.query;
const { senseVersion, apis } = req.query;
Copy link
Contributor

Choose a reason for hiding this comment

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

Originally we expected sense_version in the response, but now we're expecting senseVersion. Do we need to update any server-side code to make a corresponding change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm going to change it back since it's pulled from the request.

To be honest, I'm surprised this change worked at all, so I suspect there's some unused code/behaviors here. In any case, that's beyond the scope of this change, so I'd prefer to keep this to purely internal changes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Reverted it back to sense_version

Much of the code in console is original from when the project was a
separate plugin and was not updated when it was ported over.  Now, any
code in the root of the project or in the server directory will be
linted based on the global rules in Kibana.
@epixa epixa force-pushed the 9603-console-linting branch from 522acae to aa82918 Compare December 26, 2016 23:45
Copy link
Contributor

@cjcenizal cjcenizal left a comment

Choose a reason for hiding this comment

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

LGTM!

@epixa
Copy link
Contributor Author

epixa commented Dec 27, 2016

Thanks!

@epixa epixa merged commit 886204b into elastic:master Dec 27, 2016
@epixa epixa deleted the 9603-console-linting branch December 27, 2016 01:07
epixa added a commit that referenced this pull request Dec 27, 2016
Backports PR #9646

**Commit 1:**
console: clean up styles for entry and server code

Much of the code in console is original from when the project was a
separate plugin and was not updated when it was ported over.  Now, any
code in the root of the project or in the server directory will be
linted based on the global rules in Kibana.

* Original sha: aa82918
* Authored by Court Ewing <[email protected]> on 2016-12-26T20:02:30Z
epixa pushed a commit that referenced this pull request Dec 27, 2016
Backports PR #9646

**Commit 1:**
console: clean up styles for entry and server code

Much of the code in console is original from when the project was a
separate plugin and was not updated when it was ported over.  Now, any
code in the root of the project or in the server directory will be
linted based on the global rules in Kibana.

* Original sha: aa82918
* Authored by Court Ewing <[email protected]> on 2016-12-26T20:02:30Z
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Console Dev Tools Console Feature Feature:Dev Tools review Team:Operations Team label for Operations Team v5.2.0 v6.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants