From 5388568fc10b5c8f394784604f7b235da3bf17f4 Mon Sep 17 00:00:00 2001 From: Sandeep Kumawat Date: Thu, 29 Aug 2024 15:04:15 +0530 Subject: [PATCH] Address offline review comments Signed-off-by: Sandeep Kumawat --- public/components/DeleteModal/DeleteModal.tsx | 14 +- .../__snapshots__/DeleteModal.test.tsx.snap | 28 +- .../ClearCacheModal/ClearCacheModal.tsx | 23 +- .../ClearCacheModal.test.tsx.snap | 10 +- .../FlushIndexModal/FlushIndexModal.tsx | 29 +- .../FlushIndexModal.test.tsx.snap | 270 +++++++++++++----- public/containers/RefreshAction/index.tsx | 23 +- .../__snapshots__/AliasActions.test.tsx.snap | 140 ++++++--- .../DataStreamsActions.test.tsx.snap | 94 ++++-- .../DeleteDataStreamsModal.test.tsx.snap | 18 +- .../IndicesActions.test.tsx.snap | 104 +++++-- .../DeleteTemplateModal.test.tsx.snap | 18 +- 12 files changed, 560 insertions(+), 211 deletions(-) diff --git a/public/components/DeleteModal/DeleteModal.tsx b/public/components/DeleteModal/DeleteModal.tsx index 30995f67d..8e5c823a9 100644 --- a/public/components/DeleteModal/DeleteModal.tsx +++ b/public/components/DeleteModal/DeleteModal.tsx @@ -42,15 +42,23 @@ export default function DeleteTemplateModal(props: DeleteModalProps) { return ( - {props.title} + + +

{props.title}

+
+
-

{props.tips}

+ +

{props.tips}

+
    {selectedItems.map((item) => ( -
  • {item}
  • + +
  • {item}
  • +
    ))}
diff --git a/public/components/DeleteModal/__snapshots__/DeleteModal.test.tsx.snap b/public/components/DeleteModal/__snapshots__/DeleteModal.test.tsx.snap index 198200d66..9242228f8 100644 --- a/public/components/DeleteModal/__snapshots__/DeleteModal.test.tsx.snap +++ b/public/components/DeleteModal/__snapshots__/DeleteModal.test.tsx.snap @@ -39,7 +39,13 @@ HTMLCollection [
- test +
+

+ test +

+
-

- test -

+
+

+ test +

+
    -
  • - test -
  • +
    +
  • + test +
  • +
{unBlockedItems.length > 0 && ( <> -

{hint}

+ +

{hint}

+
    {unBlockedItems.map((item) => ( -
  • {item}
  • + +
  • {item}
  • +
    ))}
@@ -187,10 +192,14 @@ export default function ClearCacheModal(props: ClearCacheModalProps) { )}
@@ -209,7 +218,11 @@ export default function ClearCacheModal(props: ClearCacheModalProps) { return ( - Clear cache for {type} + + +

Clear cache for {type}

+
+
{!!selectedItems && selectedItems.length > 0 ? specificIndexesChildren : noSpecificIndexesChildren} diff --git a/public/containers/ClearCacheModal/__snapshots__/ClearCacheModal.test.tsx.snap b/public/containers/ClearCacheModal/__snapshots__/ClearCacheModal.test.tsx.snap index a6e05da19..88fbfd626 100644 --- a/public/containers/ClearCacheModal/__snapshots__/ClearCacheModal.test.tsx.snap +++ b/public/containers/ClearCacheModal/__snapshots__/ClearCacheModal.test.tsx.snap @@ -39,8 +39,14 @@ HTMLCollection [
- Clear cache for - indexes +
+

+ Clear cache for + indexes +

+
- Flush {flushTarget} + + +

Flush {flushTarget}

+
+
{/* we will not display this part if not flushAll and there is no flushable items */} - {flushAll &&

{flushAllMessage}

} + {flushAll && ( + +

{flushAllMessage}

+
+ )} {!!unBlockedItems.length && ( <> -

{`The following ${flushTarget} will be flushed:`}

+ +

{`The following ${flushTarget} will be flushed:`}

+
    {unBlockedItems.map((item) => ( -
  • {item}
  • + +
  • {item}
  • +
    ))}
)} diff --git a/public/containers/FlushIndexModal/__snapshots__/FlushIndexModal.test.tsx.snap b/public/containers/FlushIndexModal/__snapshots__/FlushIndexModal.test.tsx.snap index bb47eb31f..c32a59399 100644 --- a/public/containers/FlushIndexModal/__snapshots__/FlushIndexModal.test.tsx.snap +++ b/public/containers/FlushIndexModal/__snapshots__/FlushIndexModal.test.tsx.snap @@ -40,8 +40,14 @@ HTMLCollection [ class="euiModalHeader__title" data-test-subj="flushModalTitle" > - Flush - aliases +
+

+ Flush + aliases +

+
-

- The following aliases will be flushed: -

+
+

+ The following aliases will be flushed: +

+
    -
  • - alias2 -
  • +
    +
  • + alias2 +
  • +
-

- The following aliases will not be flushed because one or more indexes are either closed or in red status: -

+
+

+ The following aliases will not be flushed because one or more indexes are either closed or in red status: +

+
    -
  • - alias1 -
  • -
  • - alias3 -
  • +
    +
  • + alias1 +
  • +
    +
    +
  • + alias3 +
  • +
@@ -186,8 +212,14 @@ HTMLCollection [ class="euiModalHeader__title" data-test-subj="flushModalTitle" > - Flush - data streams +
+

+ Flush + data streams +

+
-

- The following data streams will be flushed: -

+
+

+ The following data streams will be flushed: +

+
    -
  • - ds2 -
  • +
    +
  • + ds2 +
  • +
-

- The following data streams will not be flushed because one or more backing indexes are either closed or in red status: -

+
+

+ The following data streams will not be flushed because one or more backing indexes are either closed or in red status: +

+
    -
  • - ds1 -
  • -
  • - ds3 -
  • +
    +
  • + ds1 +
  • +
    +
    +
  • + ds3 +
  • +
@@ -332,8 +384,14 @@ HTMLCollection [ class="euiModalHeader__title" data-test-subj="flushModalTitle" > - Flush - indexes +
+

+ Flush + indexes +

+
-

- The following indexes will be flushed: -

+
+

+ The following indexes will be flushed: +

+
    -
  • - test_index2 -
  • -
  • - test_index3 -
  • +
    +
  • + test_index2 +
  • +
    +
    +
  • + test_index3 +
  • +
-

- The following indexes will not be flushed because they are either closed or in red status: -

+
+

+ The following indexes will not be flushed because they are either closed or in red status: +

+
    -
  • - test_index1 -
  • -
  • - test_index4 -
  • +
    +
  • + test_index1 +
  • +
    +
    +
  • + test_index4 +
  • +
@@ -481,8 +563,14 @@ HTMLCollection [ class="euiModalHeader__title" data-test-subj="flushModalTitle" > - Flush - indexes +
+

+ Flush + indexes +

+
-

- All open indexes will be flushed. -

+
+

+ All open indexes will be flushed. +

+
@@ -511,9 +603,13 @@ HTMLCollection [
-

- The following indexes will not be flushed because they are either closed or in red status: -

+
+

+ The following indexes will not be flushed because they are either closed or in red status: +

+
    @@ -614,8 +710,14 @@ HTMLCollection [ class="euiModalHeader__title" data-test-subj="flushModalTitle" > - Flush - indexes +
    +

    + Flush + indexes +

    +
-

- The following indexes will be flushed: -

+
+

+ The following indexes will be flushed: +

+
    -
  • - test_index2 -
  • -
  • - test_index3 -
  • +
    +
  • + test_index2 +
  • +
    +
    +
  • + test_index3 +
  • +
-

- The following indexes will not be flushed because they are either closed or in red status: -

+
+

+ The following indexes will not be flushed because they are either closed or in red status: +

+
    diff --git a/public/containers/RefreshAction/index.tsx b/public/containers/RefreshAction/index.tsx index f35457aa3..630122299 100644 --- a/public/containers/RefreshAction/index.tsx +++ b/public/containers/RefreshAction/index.tsx @@ -14,6 +14,7 @@ import { EuiModalHeader, EuiModalHeaderTitle, EuiSpacer, + EuiText, } from "@elastic/eui"; import { CoreStart } from "opensearch-dashboards/public"; import { ServicesContext } from "../../services"; @@ -167,24 +168,34 @@ export default function RefreshActionModal(props: RefreshActionModalProps) { return ( - Refresh {type} + + +

    Refresh {type}

    +
    +
    {selectedItems.length === 0 && blockedItems.length === 0 && ( <> -

    All open indexes will be refreshed.

    + +

    All open indexes will be refreshed.

    +
    )} {!!unBlockedItems.length && ( <> -

    {unblockedWording} will be refreshed.

    + +

    {unblockedWording} will be refreshed.

    +
      {unBlockedItems.map((item) => ( -
    • - {item} -
    • + +
    • + {item} +
    • +
      ))}
    diff --git a/public/pages/Aliases/containers/AliasActions/__snapshots__/AliasActions.test.tsx.snap b/public/pages/Aliases/containers/AliasActions/__snapshots__/AliasActions.test.tsx.snap index d2fc9928c..e26c65f32 100644 --- a/public/pages/Aliases/containers/AliasActions/__snapshots__/AliasActions.test.tsx.snap +++ b/public/pages/Aliases/containers/AliasActions/__snapshots__/AliasActions.test.tsx.snap @@ -174,8 +174,14 @@ exports[` spec refresh alias by calling commonService 1`] = `
    - Refresh - aliases +
    +

    + Refresh + aliases +

    +
    spec refresh alias by calling commonService 1`] = `
    -

    - The following alias - will be refreshed. -

    +
    +

    + The following alias + will be refreshed. +

    +
      -
    • - 2 -
    • +
    • + 2 +
    • +
spec refresh multi alias even failed to get index st
- Refresh - aliases +
+

+ Refresh + aliases +

+
spec refresh multi alias even failed to get index st
-

- The following aliases - will be refreshed. -

+
+

+ The following aliases + will be refreshed. +

+
    -
  • - 1 -
  • -
  • + 1 +
  • +
+
- 2 - +
  • + 2 +
  • +
    - Flush - aliases +
    +

    + Flush + aliases +

    +
    -

    - The following aliases will be flushed: -

    +
    +

    + The following aliases will be flushed: +

    +
      -
    • - alias2 -
    • +
      +
    • + alias2 +
    • +
    -

    - The following aliases will not be flushed because one or more indexes are either closed or in red status: -

    +
    +

    + The following aliases will not be flushed because one or more indexes are either closed or in red status: +

    +
      -
    • - alias1 -
    • -
    • - alias3 -
    • +
      +
    • + alias1 +
    • +
      +
      +
    • + alias3 +
    • +
    diff --git a/public/pages/DataStreams/containers/DataStreamsActions/__snapshots__/DataStreamsActions.test.tsx.snap b/public/pages/DataStreams/containers/DataStreamsActions/__snapshots__/DataStreamsActions.test.tsx.snap index 1e45caa05..3d810d753 100644 --- a/public/pages/DataStreams/containers/DataStreamsActions/__snapshots__/DataStreamsActions.test.tsx.snap +++ b/public/pages/DataStreams/containers/DataStreamsActions/__snapshots__/DataStreamsActions.test.tsx.snap @@ -174,8 +174,14 @@ exports[` spec refresh data streams by calling commonServi
    - Refresh - data streams +
    +

    + Refresh + data streams +

    +
    spec refresh data streams by calling commonServi
    -

    - The following data stream - will be refreshed. -

    +
    +

    + The following data stream + will be refreshed. +

    +
      -
    • - unblocked_data_stream -
    • +
    • + unblocked_data_stream +
    • +
    - Flush - data streams +
    +

    + Flush + data streams +

    +
    -

    - The following data streams will be flushed: -

    +
    +

    + The following data streams will be flushed: +

    +
      -
    • - ds2 -
    • +
      +
    • + ds2 +
    • +
    -

    - The following data streams will not be flushed because one or more backing indexes are either closed or in red status: -

    +
    +

    + The following data streams will not be flushed because one or more backing indexes are either closed or in red status: +

    +
      -
    • - ds1 -
    • -
    • - ds3 -
    • +
      +
    • + ds1 +
    • +
      +
      +
    • + ds3 +
    • +
    diff --git a/public/pages/DataStreams/containers/DeleteDataStreamsModal/__snapshots__/DeleteDataStreamsModal.test.tsx.snap b/public/pages/DataStreams/containers/DeleteDataStreamsModal/__snapshots__/DeleteDataStreamsModal.test.tsx.snap index dfc7f4a59..dcb97df10 100644 --- a/public/pages/DataStreams/containers/DeleteDataStreamsModal/__snapshots__/DeleteDataStreamsModal.test.tsx.snap +++ b/public/pages/DataStreams/containers/DeleteDataStreamsModal/__snapshots__/DeleteDataStreamsModal.test.tsx.snap @@ -39,7 +39,13 @@ HTMLCollection [
    - Delete data streams +
    +

    + Delete data streams +

    +
    -

    - The following data streams will be permanently deleted. The backing indexes belonging to the data streams will also be deleted. -

    +
    +

    + The following data streams will be permanently deleted. The backing indexes belonging to the data streams will also be deleted. +

    +
      diff --git a/public/pages/Indices/containers/IndicesActions/__snapshots__/IndicesActions.test.tsx.snap b/public/pages/Indices/containers/IndicesActions/__snapshots__/IndicesActions.test.tsx.snap index e0bd558c1..d400f2eae 100644 --- a/public/pages/Indices/containers/IndicesActions/__snapshots__/IndicesActions.test.tsx.snap +++ b/public/pages/Indices/containers/IndicesActions/__snapshots__/IndicesActions.test.tsx.snap @@ -309,8 +309,14 @@ exports[` spec refresh selected indexes by calling commonServi
      - Refresh - indexes +
      +

      + Refresh + indexes +

      +
    spec refresh selected indexes by calling commonServi
    -

    - The following index - will be refreshed. -

    +
    +

    + The following index + will be refreshed. +

    +
      -
    • - unblocked_index -
    • +
    • + unblocked_index +
    • +
    - Flush - indexes +
    +

    + Flush + indexes +

    +
    -

    - The following indexes will be flushed: -

    +
    +

    + The following indexes will be flushed: +

    +
      -
    • - test_index2 -
    • -
    • - test_index3 -
    • +
      +
    • + test_index2 +
    • +
      +
      +
    • + test_index3 +
    • +
    -

    - The following indexes will not be flushed because they are either closed or in red status: -

    +
    +

    + The following indexes will not be flushed because they are either closed or in red status: +

    +
      -
    • - test_index1 -
    • -
    • - test_index4 -
    • +
      +
    • + test_index1 +
    • +
      +
      +
    • + test_index4 +
    • +
    diff --git a/public/pages/Templates/containers/DeleteTemplatesModal/__snapshots__/DeleteTemplateModal.test.tsx.snap b/public/pages/Templates/containers/DeleteTemplatesModal/__snapshots__/DeleteTemplateModal.test.tsx.snap index b01932f99..6bd2a0a6a 100644 --- a/public/pages/Templates/containers/DeleteTemplatesModal/__snapshots__/DeleteTemplateModal.test.tsx.snap +++ b/public/pages/Templates/containers/DeleteTemplatesModal/__snapshots__/DeleteTemplateModal.test.tsx.snap @@ -39,7 +39,13 @@ HTMLCollection [
    - Delete Templates +
    +

    + Delete Templates +

    +
    -

    - The following template will be permanently deleted. This action cannot be undone. -

    +
    +

    + The following template will be permanently deleted. This action cannot be undone. +

    +