Skip to content

Wrap consts in kibana tutorials#22181

Merged
yankouskia merged 5 commits intoelastic:masterfrom
LeanidShutau:feature/refactor-kibana-tutorials
Aug 28, 2018
Merged

Wrap consts in kibana tutorials#22181
yankouskia merged 5 commits intoelastic:masterfrom
LeanidShutau:feature/refactor-kibana-tutorials

Conversation

@LeanidShutau
Copy link
Copy Markdown
Contributor

I18n engine must be initialized before i18n.translate(...) calls. So all objects with translatable labels should be wrapped into functions.

const OBJECT_NAME = {...}; becomes function createObjectName { return {...}; }.

@LeanidShutau LeanidShutau added Team:Core Platform Core services: plugins, logging, config, saved objects, http, ES client, i18n, etc t// Project:i18n labels Aug 20, 2018
@LeanidShutau LeanidShutau self-assigned this Aug 20, 2018
@LeanidShutau LeanidShutau requested review from azasypkin and yankouskia and removed request for azasypkin and yankouskia August 20, 2018 15:19
@elasticmachine
Copy link
Copy Markdown
Contributor

💔 Build Failed

@elasticmachine
Copy link
Copy Markdown
Contributor

💔 Build Failed

@azasypkin
Copy link
Copy Markdown
Contributor

FATAL TypeError: (0 , _apm_client_instructions.createRailsClientInstructions)(...) is not a function or its return value is not iterable --- looks like related to the PR itself?

@azasypkin azasypkin added :Sharing and removed Team:Core Platform Core services: plugins, logging, config, saved objects, http, ES client, i18n, etc t// labels Aug 21, 2018
@elasticmachine
Copy link
Copy Markdown
Contributor

💔 Build Failed

@LeanidShutau
Copy link
Copy Markdown
Contributor Author

retest

@elasticmachine
Copy link
Copy Markdown
Contributor

💔 Build Failed

@LeanidShutau
Copy link
Copy Markdown
Contributor Author

retest

@yankouskia
Copy link
Copy Markdown

@LeanidShutau maybe merge latest master?

@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

}
]
};
export function createOnPremElasticCloudInstructions() {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

There'll be much fewer diffs in PRs like this if the export was like:

const COMMON_NETFLOW_INSTRUCTIONS = createCommonNetflowInstructions();
const TRYCLOUD_OPTION1 = createTrycloudOption1();
const TRYCLOUD_OPTION2 = createTrycloudOption2();
const LOGSTASH_INSTRUCTIONS = createLogstashInstructions();

export const createOnPremElasticCloudInstructions = () => ({
    instructionSets: [
      //...
    ]
});

that is, using implicit return should keep the indentation the same

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@tsullivan
createCommonNetflowInstructions(), ..., createLogstashInstructions() can't be called outside the function, because i18n engine should be initialized before text translation.

Copy link
Copy Markdown
Member

@tsullivan tsullivan left a comment

Choose a reason for hiding this comment

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

requesting to use arrow functions and implicit return where possible to make the code more concise and the diffs show fewer lines of code change

@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

@LeanidShutau LeanidShutau requested a review from tsullivan August 27, 2018 11:05
Copy link
Copy Markdown
Member

@tsullivan tsullivan left a comment

Choose a reason for hiding this comment

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

LGTM

@yankouskia yankouskia merged commit 8cb473e into elastic:master Aug 28, 2018
@LeanidShutau LeanidShutau deleted the feature/refactor-kibana-tutorials branch August 28, 2018 10:11
LeanidShutau added a commit to LeanidShutau/kibana that referenced this pull request Aug 28, 2018
* Wrap consts in kibana tutorials

* Fix onPrem instructions

* Fix rails instructions

* Use arrow functions and implicit return

Co-authored-by: LeanidShutau <leanidshutau@gmail.com>
@LeanidShutau
Copy link
Copy Markdown
Contributor Author

6.x/6.5: 91989b5

LeanidShutau added a commit that referenced this pull request Aug 28, 2018
* Wrap consts in kibana tutorials

* Fix onPrem instructions

* Fix rails instructions

* Use arrow functions and implicit return

Co-authored-by: LeanidShutau <leanidshutau@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants