Skip to content

Commit

Permalink
enable fullwidth for JSON editor
Browse files Browse the repository at this point in the history
Signed-off-by: Hailong Cui <[email protected]>
  • Loading branch information
Hailong-am committed Dec 20, 2022
1 parent a36ab02 commit a01766e
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 55 deletions.
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

0 comments on commit a01766e

Please sign in to comment.