From 49f2b0b69138428f88b79caff800ad7d8896519b Mon Sep 17 00:00:00 2001 From: Dan Dong Date: Tue, 30 Jul 2024 15:05:02 -0700 Subject: [PATCH 01/14] Updated Data Source Connection paragraph size Signed-off-by: Dan Dong --- .../public/components/data_source_table/data_source_table.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/data_source_management/public/components/data_source_table/data_source_table.tsx b/src/plugins/data_source_management/public/components/data_source_table/data_source_table.tsx index 783371cda7e7..bc75e5a17ad3 100644 --- a/src/plugins/data_source_management/public/components/data_source_table/data_source_table.tsx +++ b/src/plugins/data_source_management/public/components/data_source_table/data_source_table.tsx @@ -318,7 +318,7 @@ export const DataSourceTable = ({ history }: RouteComponentProps) => { style={{ textAlign: 'center' }} data-test-subj="datasourceTableEmptyState" > - + Date: Wed, 31 Jul 2024 13:46:13 -0700 Subject: [PATCH 02/14] Updated paragraph size Signed-off-by: Dan Dong --- .../console/public/application/components/help_panel.tsx | 2 ++ .../containers/console_history/console_history.tsx | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/plugins/console/public/application/components/help_panel.tsx b/src/plugins/console/public/application/components/help_panel.tsx index 1f0fce03bf14..7ba6dda1b7ee 100644 --- a/src/plugins/console/public/application/components/help_panel.tsx +++ b/src/plugins/console/public/application/components/help_panel.tsx @@ -75,6 +75,8 @@ export function HelpPanel(props: Props) { defaultMessage="Keyboard commands" /> + +
Ctrl/Cmd + I
diff --git a/src/plugins/console/public/application/containers/console_history/console_history.tsx b/src/plugins/console/public/application/containers/console_history/console_history.tsx index 925224c53783..b9b6ddf0bf23 100644 --- a/src/plugins/console/public/application/containers/console_history/console_history.tsx +++ b/src/plugins/console/public/application/containers/console_history/console_history.tsx @@ -41,6 +41,7 @@ import { EuiFlexGroup, EuiSmallButtonEmpty, EuiSmallButton, + EuiText, } from '@elastic/eui'; import { useServicesContext } from '../../contexts'; @@ -192,7 +193,9 @@ export function ConsoleHistory({ close }: Props) { })} aria-selected={isSelected} > - {reqDescription} + + {reqDescription} + From ccc4d9cf7c62d0be9358fe1dfd18355c606ac885 Mon Sep 17 00:00:00 2001 From: Dan Dong Date: Wed, 31 Jul 2024 14:00:14 -0700 Subject: [PATCH 03/14] Updated paragraph size Signed-off-by: Dan Dong --- .../create_form/create_data_source_form.tsx | 2 +- .../acceleration_table.tsx | 4 ++-- .../associated_objects_tab.tsx | 4 ++-- .../connection_detail/access_control_tab.tsx | 4 ++-- .../components/field_editor/field_editor.tsx | 16 +++++++++------- 5 files changed, 16 insertions(+), 14 deletions(-) diff --git a/src/plugins/data_source_management/public/components/create_data_source_wizard/components/create_form/create_data_source_form.tsx b/src/plugins/data_source_management/public/components/create_data_source_wizard/components/create_form/create_data_source_form.tsx index e8f738fc9ffa..7fec74bdc0f9 100644 --- a/src/plugins/data_source_management/public/components/create_data_source_wizard/components/create_form/create_data_source_form.tsx +++ b/src/plugins/data_source_management/public/components/create_data_source_wizard/components/create_form/create_data_source_form.tsx @@ -643,7 +643,7 @@ export class CreateDataSourceForm extends React.Component< - + - +

{ACC_PANEL_TITLE}

- {ACC_PANEL_DESC} +

{ACC_PANEL_DESC}

diff --git a/src/plugins/data_source_management/public/components/direct_query_data_sources_components/associated_object_management/associated_objects_tab.tsx b/src/plugins/data_source_management/public/components/direct_query_data_sources_components/associated_object_management/associated_objects_tab.tsx index 648488f50500..9dcd2e5e1158 100644 --- a/src/plugins/data_source_management/public/components/direct_query_data_sources_components/associated_object_management/associated_objects_tab.tsx +++ b/src/plugins/data_source_management/public/components/direct_query_data_sources_components/associated_object_management/associated_objects_tab.tsx @@ -141,9 +141,9 @@ export const AssociatedObjectsTab: React.FC = (props) return ( - +

{panelTitle}

- {panelDescription} +

{panelDescription}

diff --git a/src/plugins/data_source_management/public/components/direct_query_data_sources_components/connection_detail/access_control_tab.tsx b/src/plugins/data_source_management/public/components/direct_query_data_sources_components/connection_detail/access_control_tab.tsx index 187b13fdc6f5..d5420a620d46 100644 --- a/src/plugins/data_source_management/public/components/direct_query_data_sources_components/connection_detail/access_control_tab.tsx +++ b/src/plugins/data_source_management/public/components/direct_query_data_sources_components/connection_detail/access_control_tab.tsx @@ -102,9 +102,9 @@ export const AccessControlTab = (props: AccessControlTabProps) => { return ( - +

Access control

- Control which OpenSearch users have access to this data source. +

Control which OpenSearch users have access to this data source.

diff --git a/src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx b/src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx index 33eef159d1d8..c47de51f9a4e 100644 --- a/src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx +++ b/src/plugins/index_pattern_management/public/components/field_editor/field_editor.tsx @@ -603,7 +603,7 @@ export class FieldEditor extends PureComponent - +
- - - + + + + +
From f196781826038ecbce79502c47c8e66bdddfc683 Mon Sep 17 00:00:00 2001 From: Dan Dong Date: Wed, 31 Jul 2024 16:00:25 -0700 Subject: [PATCH 04/14] Updated paragraph size Signed-off-by: Dan Dong --- .../application/components/help_panel.tsx | 4 +- .../utils/get_no_items_message.tsx | 58 ++++++++++--------- .../components/header/header.tsx | 2 +- .../create_data_source_panel_header.tsx | 2 +- .../data_source_page_header.tsx | 2 +- .../utils/no_access_page.tsx | 2 +- .../components/header/header.tsx | 35 ++++++----- .../edit_index_pattern/edit_index_pattern.tsx | 2 +- .../components/header/header.tsx | 2 +- .../components/header/header.tsx | 2 +- .../index_pattern_table.tsx | 2 +- 11 files changed, 58 insertions(+), 55 deletions(-) diff --git a/src/plugins/console/public/application/components/help_panel.tsx b/src/plugins/console/public/application/components/help_panel.tsx index 7ba6dda1b7ee..e8fd264d432b 100644 --- a/src/plugins/console/public/application/components/help_panel.tsx +++ b/src/plugins/console/public/application/components/help_panel.tsx @@ -55,7 +55,7 @@ export function HelpPanel(props: Props) { - +

-
-
Ctrl/Cmd + I
diff --git a/src/plugins/dashboard/public/application/utils/get_no_items_message.tsx b/src/plugins/dashboard/public/application/utils/get_no_items_message.tsx index 460fbe9b877d..15f97ceb6130 100644 --- a/src/plugins/dashboard/public/application/utils/get_no_items_message.tsx +++ b/src/plugins/dashboard/public/application/utils/get_no_items_message.tsx @@ -46,34 +46,36 @@ export const getNoItemsMessage = ( } body={ -

- -

-

- - application.navigateToApp('home', { - path: '#/tutorial_directory/sampleData', - }) - } - > - - - ), - }} - /> -

+ +

+ +

+

+ + application.navigateToApp('home', { + path: '#/tutorial_directory/sampleData', + }) + } + > + + + ), + }} + /> +

+
} actions={ diff --git a/src/plugins/data_source_management/public/components/create_data_source_wizard/components/header/header.tsx b/src/plugins/data_source_management/public/components/create_data_source_wizard/components/header/header.tsx index cc8c2cf086da..370e83ecefeb 100644 --- a/src/plugins/data_source_management/public/components/create_data_source_wizard/components/header/header.tsx +++ b/src/plugins/data_source_management/public/components/create_data_source_wizard/components/header/header.tsx @@ -36,7 +36,7 @@ export const Header = () => { - +

{ - +

= () => { - +

{ iconType="alert" title={

{'No permissions to access'}

} body={ - + { 'You are missing permissions to view connection details. Contact your administrator for permissions.' } diff --git a/src/plugins/data_source_management/public/components/edit_data_source/components/header/header.tsx b/src/plugins/data_source_management/public/components/edit_data_source/components/header/header.tsx index 8e016a80299e..a6cadae0ade3 100644 --- a/src/plugins/data_source_management/public/components/edit_data_source/components/header/header.tsx +++ b/src/plugins/data_source_management/public/components/edit_data_source/components/header/header.tsx @@ -15,6 +15,7 @@ import { EuiConfirmModal, EuiSmallButton, EuiSmallButtonEmpty, + EuiText, } from '@elastic/eui'; import { i18n } from '@osd/i18n'; import { FormattedMessage } from '@osd/i18n/react'; @@ -121,22 +122,24 @@ export const Header = ({ defaultFocusedButton="confirm" data-test-subj="editDatasourceDeleteConfirmModal" > -

- { - - } -

-

- { - - } -

+ +

+ { + + } +

+

+ { + + } +

+
) : null} diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx b/src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx index 8cfcadbcc08d..76689ab7c553 100644 --- a/src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx +++ b/src/plugins/index_pattern_management/public/components/edit_index_pattern/edit_index_pattern.tsx @@ -222,7 +222,7 @@ export const EditIndexPattern = withRouter( )} - +

( /> - +

( /> - +

{

{title}

- +

Date: Thu, 1 Aug 2024 19:05:27 +0000 Subject: [PATCH 05/14] Changeset file for PR #7603 created/updated --- changelogs/fragments/7603.yml | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 changelogs/fragments/7603.yml diff --git a/changelogs/fragments/7603.yml b/changelogs/fragments/7603.yml new file mode 100644 index 000000000000..6ca9213c4fcd --- /dev/null +++ b/changelogs/fragments/7603.yml @@ -0,0 +1,2 @@ +Refactor: +- [Look&Feel] Update paragraph text sizes across remaining OSD ([#7603](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7603)) \ No newline at end of file From a35c0da0944d9dca3c8e3e24ee3877706cc73dd8 Mon Sep 17 00:00:00 2001 From: Dan Dong Date: Thu, 1 Aug 2024 12:15:45 -0700 Subject: [PATCH 06/14] Removed paragraph tags Signed-off-by: Dan Dong --- .../acceleration_management/acceleration_table.tsx | 2 +- .../associated_object_management/associated_objects_tab.tsx | 2 +- .../connection_detail/access_control_tab.tsx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/data_source_management/public/components/direct_query_data_sources_components/acceleration_management/acceleration_table.tsx b/src/plugins/data_source_management/public/components/direct_query_data_sources_components/acceleration_management/acceleration_table.tsx index b0611b6beeb9..a92313d74a07 100644 --- a/src/plugins/data_source_management/public/components/direct_query_data_sources_components/acceleration_management/acceleration_table.tsx +++ b/src/plugins/data_source_management/public/components/direct_query_data_sources_components/acceleration_management/acceleration_table.tsx @@ -160,7 +160,7 @@ export const AccelerationTable = ({

{ACC_PANEL_TITLE}

-

{ACC_PANEL_DESC}

+ {ACC_PANEL_DESC}
diff --git a/src/plugins/data_source_management/public/components/direct_query_data_sources_components/associated_object_management/associated_objects_tab.tsx b/src/plugins/data_source_management/public/components/direct_query_data_sources_components/associated_object_management/associated_objects_tab.tsx index 9dcd2e5e1158..69a72226391c 100644 --- a/src/plugins/data_source_management/public/components/direct_query_data_sources_components/associated_object_management/associated_objects_tab.tsx +++ b/src/plugins/data_source_management/public/components/direct_query_data_sources_components/associated_object_management/associated_objects_tab.tsx @@ -143,7 +143,7 @@ export const AssociatedObjectsTab: React.FC = (props)

{panelTitle}

-

{panelDescription}

+ {panelDescription}
diff --git a/src/plugins/data_source_management/public/components/direct_query_data_sources_components/connection_detail/access_control_tab.tsx b/src/plugins/data_source_management/public/components/direct_query_data_sources_components/connection_detail/access_control_tab.tsx index d5420a620d46..e5665d4884c0 100644 --- a/src/plugins/data_source_management/public/components/direct_query_data_sources_components/connection_detail/access_control_tab.tsx +++ b/src/plugins/data_source_management/public/components/direct_query_data_sources_components/connection_detail/access_control_tab.tsx @@ -104,7 +104,7 @@ export const AccessControlTab = (props: AccessControlTabProps) => {

Access control

-

Control which OpenSearch users have access to this data source.

+ Control which OpenSearch users have access to this data source.
From 7b1478b43314d7ad936a3a8239757d4f1772fefc Mon Sep 17 00:00:00 2001 From: Dan Dong Date: Thu, 1 Aug 2024 12:28:53 -0700 Subject: [PATCH 07/14] Updated Snapshot Testing Signed-off-by: Dan Dong --- ...ate_data_source_panel_header.test.tsx.snap | 4 +- .../data_source_page_header.test.tsx.snap | 4 +- .../data_source_table.test.tsx.snap | 12 +- .../acceleration_table.test.tsx.snap | 2 +- .../access_control_tab.test.tsx.snap | 2 +- .../no_access_page.test.tsx.snap | 4 +- .../header/__snapshots__/header.test.tsx.snap | 2 +- .../header/__snapshots__/header.test.tsx.snap | 4 +- .../__snapshots__/field_editor.test.tsx.snap | 130 +++++++++++------- 9 files changed, 103 insertions(+), 61 deletions(-) diff --git a/src/plugins/data_source_management/public/components/data_source_creation_panel/__snapshots__/create_data_source_panel_header.test.tsx.snap b/src/plugins/data_source_management/public/components/data_source_creation_panel/__snapshots__/create_data_source_panel_header.test.tsx.snap index 37a770d5b362..052b2ca8e2c0 100644 --- a/src/plugins/data_source_management/public/components/data_source_creation_panel/__snapshots__/create_data_source_panel_header.test.tsx.snap +++ b/src/plugins/data_source_management/public/components/data_source_creation_panel/__snapshots__/create_data_source_panel_header.test.tsx.snap @@ -20,7 +20,9 @@ exports[`CreateDataSourcePanelHeader renders correctly 1`] = ` - +

- +

- +

- +

Accelerations

Accelerations optimize query performance by indexing external data into OpenSearch.
Last updated at:
3/14/2024, 4:05:53 AM

Actions
Name
Status
Refreshing
Type
materialized
Database
default
Table
-
Refresh Type
Auto refresh
Destination Index
flint_mys3_default_http_count_view
Name
Status
Refreshing
Type
materialized
Database
default
Table
-
Refresh Type
Auto refresh
Destination Index
flint_mys3_default_http_count_view_alt
Name
Status
Deleted
Type
materialized
Database
default
Table
-
Refresh Type
Auto refresh
Destination Index
flint_mys3_default_http_logs
Name
Status
Active
Type
skipping
Database
default
Table
http_logs
Refresh Type
Manual
Destination Index
-
Name
Status
Refreshing
Type
materialized
Database
other
Table
-
Refresh Type
Auto refresh
Destination Index
flint_mys3_other_http_count_view
"`; +exports[`AccelerationTable Component matches snapshot 1`] = `"

Accelerations

Accelerations optimize query performance by indexing external data into OpenSearch.
Last updated at:
3/14/2024, 4:05:53 AM

Actions
Name
Status
Refreshing
Type
materialized
Database
default
Table
-
Refresh Type
Auto refresh
Destination Index
flint_mys3_default_http_count_view
Name
Status
Refreshing
Type
materialized
Database
default
Table
-
Refresh Type
Auto refresh
Destination Index
flint_mys3_default_http_count_view_alt
Name
Status
Deleted
Type
materialized
Database
default
Table
-
Refresh Type
Auto refresh
Destination Index
flint_mys3_default_http_logs
Name
Status
Active
Type
skipping
Database
default
Table
http_logs
Refresh Type
Manual
Destination Index
-
Name
Status
Refreshing
Type
materialized
Database
other
Table
-
Refresh Type
Auto refresh
Destination Index
flint_mys3_other_http_count_view
"`; diff --git a/src/plugins/data_source_management/public/components/direct_query_data_sources_components/connection_detail/__snapshots__/access_control_tab.test.tsx.snap b/src/plugins/data_source_management/public/components/direct_query_data_sources_components/connection_detail/__snapshots__/access_control_tab.test.tsx.snap index 4771e034f4ad..311cf24611ed 100644 --- a/src/plugins/data_source_management/public/components/direct_query_data_sources_components/connection_detail/__snapshots__/access_control_tab.test.tsx.snap +++ b/src/plugins/data_source_management/public/components/direct_query_data_sources_components/connection_detail/__snapshots__/access_control_tab.test.tsx.snap @@ -46,7 +46,7 @@ exports[`AccessControlTab Component matches snapshot 1`] = ` class="euiFlexItem" >

} body={ - + You are missing permissions to view connection details. Contact your administrator for permissions. } diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/components/header/__snapshots__/header.test.tsx.snap b/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/components/header/__snapshots__/header.test.tsx.snap index 8ca2e010a65d..e049fe1325c4 100644 --- a/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/components/header/__snapshots__/header.test.tsx.snap +++ b/src/plugins/index_pattern_management/public/components/edit_index_pattern/scripted_fields_table/components/header/__snapshots__/header.test.tsx.snap @@ -13,7 +13,7 @@ exports[`Header should render normally 1`] = ` Scripted fields

You can use scripted fields in visualizations and display them in your documents. However, you cannot search scripted fields. diff --git a/src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/header/__snapshots__/header.test.tsx.snap b/src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/header/__snapshots__/header.test.tsx.snap index 1f380d68a5af..4e2006c72f7b 100644 --- a/src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/header/__snapshots__/header.test.tsx.snap +++ b/src/plugins/index_pattern_management/public/components/edit_index_pattern/source_filters_table/components/header/__snapshots__/header.test.tsx.snap @@ -13,7 +13,9 @@ exports[`Header should render normally 1`] = ` /> - +

- +
- - - + + + +
@@ -382,7 +388,9 @@ exports[`FieldEditor should render edit scripted field correctly 1`] = ` /> - +
- - - + + + +
@@ -661,7 +673,9 @@ exports[`FieldEditor should show conflict field warning 1`] = ` /> - +
- - - + + + +
@@ -960,7 +978,9 @@ exports[`FieldEditor should show deprecated lang warning 1`] = ` /> - +
- - - + + + +
@@ -1295,7 +1319,9 @@ exports[`FieldEditor should show multiple type field warning with a table contai /> - +
- - - + + + +
From 3624322b2517b497b3c13133c31bd6d3fbf95593 Mon Sep 17 00:00:00 2001 From: Dan Dong Date: Thu, 1 Aug 2024 17:30:28 -0700 Subject: [PATCH 08/14] Updated snapshot testing Signed-off-by: Dan Dong --- .../utils/get_no_items_message.test.tsx | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/plugins/dashboard/public/application/utils/get_no_items_message.test.tsx diff --git a/src/plugins/dashboard/public/application/utils/get_no_items_message.test.tsx b/src/plugins/dashboard/public/application/utils/get_no_items_message.test.tsx new file mode 100644 index 000000000000..999f6412f6fc --- /dev/null +++ b/src/plugins/dashboard/public/application/utils/get_no_items_message.test.tsx @@ -0,0 +1,16 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +import { getNoItemsMessage } from './get_no_items_message'; +import { mountWithIntl } from 'test_utils/enzyme_helpers'; +import { ApplicationStart } from 'opensearch-dashboards/public'; + +describe('dashboard listing table with no item', () => { + test('and no write controls', () => { + const component = mountWithIntl(getNoItemsMessage(true, jest.fn(), {} as ApplicationStart)); + + expect(component).toMatchSnapshot(); + }); +}); From 8b3e4f620fc61084fbba58936b75bc4e9a705b3d Mon Sep 17 00:00:00 2001 From: Dan Dong Date: Thu, 1 Aug 2024 17:36:36 -0700 Subject: [PATCH 09/14] Updated help panel Signed-off-by: Dan Dong --- .../application/components/help_panel.tsx | 162 +++++++++--------- 1 file changed, 83 insertions(+), 79 deletions(-) diff --git a/src/plugins/console/public/application/components/help_panel.tsx b/src/plugins/console/public/application/components/help_panel.tsx index e8fd264d432b..7031132dfe3b 100644 --- a/src/plugins/console/public/application/components/help_panel.tsx +++ b/src/plugins/console/public/application/components/help_panel.tsx @@ -55,19 +55,21 @@ export function HelpPanel(props: Props) { - +

-

- -

+ +

+ +

+

-
-
Ctrl/Cmd + I
-
- -
-
Ctrl/Cmd + /
-
- -
-
Ctrl + Space
-
- -
-
Ctrl/Cmd + Enter
-
- -
-
Ctrl/Cmd + Up/Down
-
- -
-
Ctrl/Cmd + Alt + L
-
- -
-
Ctrl/Cmd + Option + 0
-
- -
-
Down arrow
-
- -
-
Enter/Tab
-
- -
-
Esc
-
- -
-
+ +
+
Ctrl/Cmd + I
+
+ +
+
Ctrl/Cmd + /
+
+ +
+
Ctrl + Space
+
+ +
+
Ctrl/Cmd + Enter
+
+ +
+
Ctrl/Cmd + Up/Down
+
+ +
+
Ctrl/Cmd + Alt + L
+
+ +
+
Ctrl/Cmd + Option + 0
+
+ +
+
Down arrow
+
+ +
+
Enter/Tab
+
+ +
+
Esc
+
+ +
+
+
From 0f8d8b1e6201fb6c00bbcdd383c9b63dfb7a6de7 Mon Sep 17 00:00:00 2001 From: Dan Dong Date: Thu, 1 Aug 2024 18:17:42 -0700 Subject: [PATCH 10/14] Updated Snapshot Testing for get_no_items_message Signed-off-by: Dan Dong --- .../get_no_items_message.test.tsx.snap | 273 ++++++++++++++++++ 1 file changed, 273 insertions(+) create mode 100644 src/plugins/dashboard/public/application/utils/__snapshots__/get_no_items_message.test.tsx.snap diff --git a/src/plugins/dashboard/public/application/utils/__snapshots__/get_no_items_message.test.tsx.snap b/src/plugins/dashboard/public/application/utils/__snapshots__/get_no_items_message.test.tsx.snap new file mode 100644 index 000000000000..1edc1fb5dd89 --- /dev/null +++ b/src/plugins/dashboard/public/application/utils/__snapshots__/get_no_items_message.test.tsx.snap @@ -0,0 +1,273 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`dashboard listing table with no item and no write controls 1`] = ` + +

+ +

+ + } +> +
+ + + + +
+ + + +
+

+ + Looks like you don't have any dashboards. + +

+
+
+
+
+ +`; From 27152ad786356240548fcff52fe8dce91a842cd9 Mon Sep 17 00:00:00 2001 From: Dan Dong Date: Fri, 2 Aug 2024 10:19:51 -0700 Subject: [PATCH 11/14] Updated Snapshot Testing for get_no_items_message Signed-off-by: Dan Dong --- .../get_no_items_message.test.tsx.snap | 485 ++++++++++++++++++ .../utils/get_no_items_message.test.tsx | 6 + 2 files changed, 491 insertions(+) diff --git a/src/plugins/dashboard/public/application/utils/__snapshots__/get_no_items_message.test.tsx.snap b/src/plugins/dashboard/public/application/utils/__snapshots__/get_no_items_message.test.tsx.snap index 1edc1fb5dd89..3907c106ebf6 100644 --- a/src/plugins/dashboard/public/application/utils/__snapshots__/get_no_items_message.test.tsx.snap +++ b/src/plugins/dashboard/public/application/utils/__snapshots__/get_no_items_message.test.tsx.snap @@ -271,3 +271,488 @@ exports[`dashboard listing table with no item and no write controls 1`] = `
`; + +exports[`dashboard listing table with no item and with write controls 1`] = ` + + + + } + body={ + + +

+ +

+

+ + + , + } + } + /> +

+
+
+ } + iconType="dashboardApp" + intl={ + Object { + "defaultFormats": Object {}, + "defaultLocale": "en", + "formatDate": [Function], + "formatHTMLMessage": [Function], + "formatMessage": [Function], + "formatNumber": [Function], + "formatPlural": [Function], + "formatRelative": [Function], + "formatTime": [Function], + "formats": Object { + "date": Object { + "full": Object { + "day": "numeric", + "month": "long", + "weekday": "long", + "year": "numeric", + }, + "long": Object { + "day": "numeric", + "month": "long", + "year": "numeric", + }, + "medium": Object { + "day": "numeric", + "month": "short", + "year": "numeric", + }, + "short": Object { + "day": "numeric", + "month": "numeric", + "year": "2-digit", + }, + }, + "number": Object { + "currency": Object { + "style": "currency", + }, + "percent": Object { + "style": "percent", + }, + }, + "relative": Object { + "days": Object { + "units": "day", + }, + "hours": Object { + "units": "hour", + }, + "minutes": Object { + "units": "minute", + }, + "months": Object { + "units": "month", + }, + "seconds": Object { + "units": "second", + }, + "years": Object { + "units": "year", + }, + }, + "time": Object { + "full": Object { + "hour": "numeric", + "minute": "numeric", + "second": "numeric", + "timeZoneName": "short", + }, + "long": Object { + "hour": "numeric", + "minute": "numeric", + "second": "numeric", + "timeZoneName": "short", + }, + "medium": Object { + "hour": "numeric", + "minute": "numeric", + "second": "numeric", + }, + "short": Object { + "hour": "numeric", + "minute": "numeric", + }, + }, + }, + "formatters": Object { + "getDateTimeFormat": [Function], + "getMessageFormat": [Function], + "getNumberFormat": [Function], + "getPluralFormat": [Function], + "getRelativeFormat": [Function], + }, + "locale": "en", + "messages": Object {}, + "now": [Function], + "onError": [Function], + "textComponent": Symbol(react.fragment), + "timeZone": null, + } + } + title={ + +

+ +

+
+ } +> +
+ + + + +
+ + + +
+

+ + Create your first dashboard + +

+
+
+
+ + + +
+ + +
+ +
+

+ + You can combine data views from any OpenSearch Dashboards app into one dashboard and see everything in one place. + +

+

+ + + , + } + } + > + New to OpenSearch Dashboards? + + + + to take a test drive. + +

+
+
+
+
+ + + +
+ + + + + + + + +
+ +`; diff --git a/src/plugins/dashboard/public/application/utils/get_no_items_message.test.tsx b/src/plugins/dashboard/public/application/utils/get_no_items_message.test.tsx index 999f6412f6fc..bbddf1848247 100644 --- a/src/plugins/dashboard/public/application/utils/get_no_items_message.test.tsx +++ b/src/plugins/dashboard/public/application/utils/get_no_items_message.test.tsx @@ -13,4 +13,10 @@ describe('dashboard listing table with no item', () => { expect(component).toMatchSnapshot(); }); + + test('and with write controls', () => { + const component = mountWithIntl(getNoItemsMessage(false, jest.fn(), {} as ApplicationStart)); + + expect(component).toMatchSnapshot(); + }); }); From 2193514b37ab7267cd03d01a0ff14cbca78130f7 Mon Sep 17 00:00:00 2001 From: "opensearch-changeset-bot[bot]" <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com> Date: Fri, 2 Aug 2024 17:22:17 +0000 Subject: [PATCH 12/14] Changeset file for PR #7603 created/updated --- changelogs/fragments/7603.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelogs/fragments/7603.yml b/changelogs/fragments/7603.yml index 6ca9213c4fcd..bf1eac98e419 100644 --- a/changelogs/fragments/7603.yml +++ b/changelogs/fragments/7603.yml @@ -1,2 +1,2 @@ Refactor: -- [Look&Feel] Update paragraph text sizes across remaining OSD ([#7603](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7603)) \ No newline at end of file +- [Look&Feel] Update paragraph text sizes across remaining experiences ([#7603](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7603)) \ No newline at end of file From 1272bafbf7cb57900b8544e22b9162f6dd43cb1d Mon Sep 17 00:00:00 2001 From: "opensearch-changeset-bot[bot]" <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com> Date: Fri, 2 Aug 2024 17:22:27 +0000 Subject: [PATCH 13/14] Changeset file for PR #7603 created/updated --- changelogs/fragments/7603.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelogs/fragments/7603.yml b/changelogs/fragments/7603.yml index bf1eac98e419..6ca9213c4fcd 100644 --- a/changelogs/fragments/7603.yml +++ b/changelogs/fragments/7603.yml @@ -1,2 +1,2 @@ Refactor: -- [Look&Feel] Update paragraph text sizes across remaining experiences ([#7603](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7603)) \ No newline at end of file +- [Look&Feel] Update paragraph text sizes across remaining OSD ([#7603](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/7603)) \ No newline at end of file From 75e1c697a6ebd9f8dac5c82c4f42de2da2e2a755 Mon Sep 17 00:00:00 2001 From: Dan Dong Date: Fri, 2 Aug 2024 13:12:00 -0700 Subject: [PATCH 14/14] Updated Testing for get_no_items_message Signed-off-by: Dan Dong --- .../utils/get_no_items_message.test.tsx | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/plugins/dashboard/public/application/utils/get_no_items_message.test.tsx b/src/plugins/dashboard/public/application/utils/get_no_items_message.test.tsx index bbddf1848247..785e1d334b80 100644 --- a/src/plugins/dashboard/public/application/utils/get_no_items_message.test.tsx +++ b/src/plugins/dashboard/public/application/utils/get_no_items_message.test.tsx @@ -5,7 +5,10 @@ import { getNoItemsMessage } from './get_no_items_message'; import { mountWithIntl } from 'test_utils/enzyme_helpers'; -import { ApplicationStart } from 'opensearch-dashboards/public'; +import { ApplicationStart, Capabilities, PublicAppInfo } from 'opensearch-dashboards/public'; +import { EuiLink } from '@elastic/eui'; +import { RecursiveReadonly } from '@osd/utility-types'; +import { Observable } from 'rxjs'; describe('dashboard listing table with no item', () => { test('and no write controls', () => { @@ -15,8 +18,19 @@ describe('dashboard listing table with no item', () => { }); test('and with write controls', () => { - const component = mountWithIntl(getNoItemsMessage(false, jest.fn(), {} as ApplicationStart)); + const application = { + capabilities: {} as RecursiveReadonly, + applications$: {} as Observable>, + navigateToApp: jest.fn(), + navigateToUrl: jest.fn(), + getUrlForApp: jest.fn(), + registerMountContext: jest.fn(), + currentAppId$: {} as Observable, + }; + const component = mountWithIntl(getNoItemsMessage(false, jest.fn(), application)); expect(component).toMatchSnapshot(); + component.find(EuiLink).simulate('click'); + expect(application.navigateToApp).toHaveBeenCalledTimes(1); }); });