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

enable fullwidth for JSON editor #479

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,7 @@ const IndexDetail = (
panels={[
{
id: 0,
width: 400,
items: sourceIndices.map((sourceIndex) => ({
name: sourceIndex,
"data-test-subj": `import-settings-${sourceIndex}`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ const ReindexAdvancedOptions = (props: ReindexOptionsProps) => {
</CustomFormRow>

<EuiSpacer />
<CustomFormRow label="Pipeline" helpText="Pipeline pre-process documents before writing into destination">
<CustomFormRow label="Pipeline" helpText="Pipeline pre-process documents before writing into destination.">
<EuiComboBox
aria-label="Ingest Pipeline"
placeholder="Select a single pipeline"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ Object {
class="euiFormHelpText euiFormRow__text"
style="padding-top: 0px; padding-bottom: 4px;"
>
Pipeline pre-process documents before writing into destination
Pipeline pre-process documents before writing into destination.
</div>
<div
aria-expanded="false"
Expand Down Expand Up @@ -344,7 +344,7 @@ Object {
class="euiFormHelpText euiFormRow__text"
style="padding-top: 0px; padding-bottom: 4px;"
>
Pipeline pre-process documents before writing into destination
Pipeline pre-process documents before writing into destination.
</div>
<div
aria-expanded="false"
Expand Down
97 changes: 48 additions & 49 deletions public/pages/Reindex/container/Reindex/Reindex.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ export default class Reindex extends Component<ReindexProps, ReindexState> {
});
if (res && res.ok) {
// @ts-ignore
const toast = `Successfully started reindexing ${reindexRequest.body.source.index}.The reindex index will be named ${reindexRequest.body.dest.index}.`;
const toast = `Successfully started reindexing ${reindexRequest.body.source.index}.The reindexed index will be named ${reindexRequest.body.dest.index}.`;
const toastInstance = (this.context as CoreStart).notifications.toasts.addSuccess(toast, {
toastLifeTimeMs: 1000 * 60 * 60 * 24 * 5,
});
Expand Down Expand Up @@ -523,55 +523,54 @@ export default class Reindex extends Component<ReindexProps, ReindexState> {

<EuiSpacer />
<CustomFormRow>
<>
<EuiRadioGroup
options={[
{
id: "all",
label: "Reindex all documents",
},
{
id: "subset",
label: "Reindex a subset of documents (Advanced)",
},
]}
idSelected={subset ? "subset" : "all"}
onChange={(id) => {
this.setState({ subset: id === "subset" });
}}
name="subsetOption"
data-test-subj="subsetOption"
legend={{
children: <span>Specify a reindex option</span>,
}}
/>
<EuiSpacer />
{subset ? (
<CustomFormRow
label="Query expression"
isInvalid={!!sourceQueryErr}
error={sourceQueryErr}
labelAppend={
<EuiText size="xs">
<EuiLink href={this.context.docLinks.links.opensearch.queryDSL.base} target="_blank" rel="noopener noreferrer">
learn more about query-dsl
</EuiLink>
</EuiText>
}
>
<JSONEditor
mode="json"
width="100%"
value={sourceQuery}
onChange={this.onSourceQueryChange}
aria-label="Query DSL Editor"
height="150px"
data-test-subj="queryJsonEditor"
/>
</CustomFormRow>
) : null}
</>
<EuiRadioGroup
options={[
{
id: "all",
label: "Reindex all documents",
},
{
id: "subset",
label: "Reindex a subset of documents (Advanced)",
},
]}
idSelected={subset ? "subset" : "all"}
onChange={(id) => {
this.setState({ subset: id === "subset" });
}}
name="subsetOption"
data-test-subj="subsetOption"
legend={{
children: <span>Specify a reindex option</span>,
}}
/>
</CustomFormRow>
<EuiSpacer />
{subset ? (
<CustomFormRow
fullWidth={true}
label="Query expression"
isInvalid={!!sourceQueryErr}
error={sourceQueryErr}
labelAppend={
<EuiText size="xs">
<EuiLink href={this.context.docLinks.links.opensearch.queryDSL.base} target="_blank" rel="noopener noreferrer">
Learn more about query DSL
</EuiLink>
</EuiText>
}
>
<JSONEditor
mode="json"
width="100%"
value={sourceQuery}
onChange={this.onSourceQueryChange}
aria-label="Query DSL Editor"
height="200px"
data-test-subj="queryJsonEditor"
/>
</CustomFormRow>
) : null}
</ContentPanel>

<EuiSpacer />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,11 +212,11 @@ exports[`<Reindex /> spec renders the component 1`] = `
</label>
</div>
</fieldset>
<div
class="euiSpacer euiSpacer--l"
/>
</div>
</div>
<div
class="euiSpacer euiSpacer--l"
/>
</div>
</div>
<div
Expand Down