Skip to content

Commit

Permalink
Address offline review comments
Browse files Browse the repository at this point in the history
Signed-off-by: Sandeep Kumawat <[email protected]>
  • Loading branch information
Sandeep Kumawat committed Aug 29, 2024
1 parent 7ba37c7 commit 5388568
Show file tree
Hide file tree
Showing 12 changed files with 560 additions and 211 deletions.
14 changes: 11 additions & 3 deletions public/components/DeleteModal/DeleteModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,23 @@ export default function DeleteTemplateModal(props: DeleteModalProps) {
return (
<EuiModal onClose={onClose}>
<EuiModalHeader>
<EuiModalHeaderTitle>{props.title}</EuiModalHeaderTitle>
<EuiModalHeaderTitle>
<EuiText size="s">
<h2>{props.title}</h2>
</EuiText>
</EuiModalHeaderTitle>
</EuiModalHeader>

<EuiModalBody>
<div style={{ lineHeight: 1.5 }}>
<p>{props.tips}</p>
<EuiText size="s">
<p>{props.tips}</p>
</EuiText>
<ul style={{ listStyleType: "disc", listStylePosition: "inside" }}>
{selectedItems.map((item) => (
<li key={item}>{item}</li>
<EuiText size="s">
<li key={item}>{item}</li>
</EuiText>
))}
</ul>
<EuiSpacer />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,13 @@ HTMLCollection [
<div
class="euiModalHeader__title"
>
test
<div
class="euiText euiText--small"
>
<h2>
test
</h2>
</div>
</div>
</div>
<div
Expand All @@ -51,15 +57,23 @@ HTMLCollection [
<div
style="line-height: 1.5;"
>
<p>
test
</p>
<div
class="euiText euiText--small"
>
<p>
test
</p>
</div>
<ul
style="list-style-type: disc; list-style-position: inside;"
>
<li>
test
</li>
<div
class="euiText euiText--small"
>
<li>
test
</li>
</div>
</ul>
<div
class="euiSpacer euiSpacer--l"
Expand Down
23 changes: 18 additions & 5 deletions public/containers/ClearCacheModal/ClearCacheModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
EuiModalHeader,
EuiModalHeaderTitle,
EuiSpacer,
EuiText,
} from "@elastic/eui";

export interface ClearCacheModalProps {
Expand Down Expand Up @@ -176,21 +177,29 @@ export default function ClearCacheModal(props: ClearCacheModalProps) {
<div style={{ lineHeight: 1.5 }}>
{unBlockedItems.length > 0 && (
<>
<p>{hint}</p>
<EuiText size="s">
<p>{hint}</p>
</EuiText>
<ul style={{ listStyleType: "disc", listStylePosition: "inside" }}>
{unBlockedItems.map((item) => (
<li key={item}>{item}</li>
<EuiText size="s">
<li key={item}>{item}</li>
</EuiText>
))}
</ul>
<EuiSpacer />
</>
)}
</div>
<EuiCallOut color="warning" iconType="warning" hidden={blockedItems.length == 0} size="s">
<p>{blockHint}</p>
<EuiText size="s">
<p>{blockHint}</p>
</EuiText>
<ul style={{ listStyleType: "disc", listStylePosition: "inside" }}>
{blockedItems.map((item) => (
<li key={item}>{item}</li>
<EuiText size="s">
<li key={item}>{item}</li>
</EuiText>
))}
</ul>
</EuiCallOut>
Expand All @@ -209,7 +218,11 @@ export default function ClearCacheModal(props: ClearCacheModalProps) {
return (
<EuiModal onClose={onClose}>
<EuiModalHeader>
<EuiModalHeaderTitle>Clear cache for {type}</EuiModalHeaderTitle>
<EuiModalHeaderTitle>
<EuiText size="s">
<h2>Clear cache for {type}</h2>
</EuiText>
</EuiModalHeaderTitle>
</EuiModalHeader>

<EuiModalBody>{!!selectedItems && selectedItems.length > 0 ? specificIndexesChildren : noSpecificIndexesChildren}</EuiModalBody>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,14 @@ HTMLCollection [
<div
class="euiModalHeader__title"
>
Clear cache for
indexes
<div
class="euiText euiText--small"
>
<h2>
Clear cache for
indexes
</h2>
</div>
</div>
</div>
<div
Expand Down
29 changes: 23 additions & 6 deletions public/containers/FlushIndexModal/FlushIndexModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
EuiModalHeader,
EuiModalHeaderTitle,
EuiSpacer,
EuiText,
} from "@elastic/eui";
import { CoreStart } from "opensearch-dashboards/public";
import { CoreServicesContext } from "../../components/core_services";
Expand Down Expand Up @@ -157,29 +158,45 @@ export default function FlushIndexModal(props: FlushIndexModalProps) {
return (
<EuiModal onClose={onClose}>
<EuiModalHeader>
<EuiModalHeaderTitle data-test-subj="flushModalTitle">Flush {flushTarget}</EuiModalHeaderTitle>
<EuiModalHeaderTitle data-test-subj="flushModalTitle">
<EuiText size="s">
<h2>Flush {flushTarget}</h2>
</EuiText>
</EuiModalHeaderTitle>
</EuiModalHeader>

<EuiModalBody>
<div style={{ lineHeight: 1.5 }}>
{/* we will not display this part if not flushAll and there is no flushable items */}
{flushAll && <p>{flushAllMessage}</p>}
{flushAll && (
<EuiText size="s">
<p>{flushAllMessage}</p>
</EuiText>
)}
{!!unBlockedItems.length && (
<>
<p>{`The following ${flushTarget} will be flushed:`}</p>
<EuiText size="s">
<p>{`The following ${flushTarget} will be flushed:`}</p>
</EuiText>
<ul style={{ listStyleType: "disc", listStylePosition: "inside" }}>
{unBlockedItems.map((item) => (
<li key={item}>{item}</li>
<EuiText size="s">
<li key={item}>{item}</li>
</EuiText>
))}
</ul>
</>
)}
<EuiSpacer />
<EuiCallOut data-test-subj="flushBlockedCallout" color="warning" size="s" hidden={!blockedItems.length}>
<p>{blockedItemsMessageTemplate(flushTarget)}</p>
<EuiText size="s">
<p>{blockedItemsMessageTemplate(flushTarget)}</p>
</EuiText>
<ul style={{ listStyleType: "disc", listStylePosition: "inside" }}>
{blockedItems.map((item) => (
<li key={item}>{item}</li>
<EuiText size="s">
<li key={item}>{item}</li>
</EuiText>
))}
</ul>
</EuiCallOut>
Expand Down
Loading

0 comments on commit 5388568

Please sign in to comment.