in app/addons/documents/mango/components/MangoIndexEditor.js [95:137]
editor() {
const encodedPartKey = this.props.partitionKey ? encodeURIComponent(this.props.partitionKey) : '';
const editQueryURL = '#' + FauxtonAPI.urls('mango', 'query-app', encodeURIComponent(this.props.databaseName), encodedPartKey);
return (
<div className="mango-editor-wrapper">
<form className="form-horizontal" onSubmit={this.saveIndex}>
<div className="padded-box">
<ReactSelect
className="mango-select"
options={this.props.templates}
ref={node => this.templates = node}
placeholder="Examples"
searchable={false}
clearable={false}
autosize={false}
onChange={this.onTemplateSelected}
/>
</div>
<PaddedBorderedBox>
<CodeEditorPanel
id="query-field"
ref={node => this.codeEditor = node}
title="Index"
docLink={getDocUrl('MANGO_INDEX')}
defaultCode={this.props.queryIndexCode}
setHeightToLineCount={false}
className="mango-code-editor"/>
{this.partitionedCheckobx()}
</PaddedBorderedBox>
<div className="padded-box">
<div className="actions-panel">
<Button variant="cf-primary" className="btn-space" id="create-index-btn" onClick={this.saveIndex}>
Create Index
</Button>
<div className="right-side-actions">
<Button variant="cf-secondary" className="edit-link" href={editQueryURL}>Edit Query</Button>
</div>
</div>
</div>
</form>
</div>
);
}