Skip to content

Commit

Permalink
Work around elastic#11959 for now (elastic#12051)
Browse files Browse the repository at this point in the history
* Fix use of KuiButtons in Clone Modal.

* [scripts] stub scripts/languages api until elastic#11959 is fixed
  • Loading branch information
spalger authored and snide committed May 30, 2017
1 parent 9eea91e commit a0cf6ad
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,14 @@ export class DashboardCloneModal extends React.Component {

<KuiModalFooter>
<KuiButton
type="hollow"
buttonType="hollow"
data-test-subj="cloneCancelButton"
onClick={ this.props.onClose }
>
Cancel
</KuiButton>
<KuiButton
type="primary"
buttonType="primary"
data-test-subj="cloneConfirmButton"
onClick={ this.cloneDashboard }
>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,27 +1,9 @@
import _ from 'lodash';
import handleESError from '../../../lib/handle_es_error';

export function registerLanguages(server) {
server.route({
path: '/api/kibana/scripts/languages',
method: 'GET',
handler: function (request, reply) {
const { callWithRequest } = server.plugins.elasticsearch.getCluster('data');

return callWithRequest(request, 'cluster.getSettings', {
include_defaults: true,
filter_path: '**.script.engine.*.inline'
})
.then((esResponse) => {
const langs = _.get(esResponse, 'defaults.script.engine', {});
const inlineLangs = _.pick(langs, (lang) => lang.inline === 'true');
const supportedLangs = _.omit(inlineLangs, 'mustache');
return _.keys(supportedLangs);
})
.then(reply)
.catch((error) => {
reply(handleESError(error));
});
reply(['painless', 'expression']);
}
});
}

0 comments on commit a0cf6ad

Please sign in to comment.