diff --git a/public/components/datasources/components/__tests__/__snapshots__/associated_objects_tab.test.tsx.snap b/public/components/datasources/components/__tests__/__snapshots__/associated_objects_tab.test.tsx.snap index a39d380dcc..e1a0522114 100644 --- a/public/components/datasources/components/__tests__/__snapshots__/associated_objects_tab.test.tsx.snap +++ b/public/components/datasources/components/__tests__/__snapshots__/associated_objects_tab.test.tsx.snap @@ -728,7 +728,7 @@ exports[`AssociatedObjectsTab Component renders correctly with associated object Object { "actions": Array [ Object { - "description": "Discover this object", + "description": "Query in Observability Logs", "icon": "discoverApp", "name": "Discover", "onClick": [Function], @@ -1286,7 +1286,7 @@ exports[`AssociatedObjectsTab Component renders correctly with associated object Object { "actions": Array [ Object { - "description": "Discover this object", + "description": "Query in Observability Logs", "icon": "discoverApp", "name": "Discover", "onClick": [Function], @@ -1991,7 +1991,7 @@ exports[`AssociatedObjectsTab Component renders correctly with associated object actions={ Array [ Object { - "description": "Discover this object", + "description": "Query in Observability Logs", "icon": "discoverApp", "name": "Discover", "onClick": [Function], @@ -2017,7 +2017,7 @@ exports[`AssociatedObjectsTab Component renders correctly with associated object @@ -2256,7 +2256,7 @@ exports[`AssociatedObjectsTab Component renders correctly with associated object actions={ Array [ Object { - "description": "Discover this object", + "description": "Query in Observability Logs", "icon": "discoverApp", "name": "Discover", "onClick": [Function], @@ -2282,7 +2282,7 @@ exports[`AssociatedObjectsTab Component renders correctly with associated object @@ -2521,7 +2521,7 @@ exports[`AssociatedObjectsTab Component renders correctly with associated object actions={ Array [ Object { - "description": "Discover this object", + "description": "Query in Observability Logs", "icon": "discoverApp", "name": "Discover", "onClick": [Function], @@ -2555,7 +2555,7 @@ exports[`AssociatedObjectsTab Component renders correctly with associated object @@ -2890,7 +2890,7 @@ exports[`AssociatedObjectsTab Component renders correctly with associated object actions={ Array [ Object { - "description": "Discover this object", + "description": "Query in Observability Logs", "icon": "discoverApp", "name": "Discover", "onClick": [Function], @@ -2924,7 +2924,7 @@ exports[`AssociatedObjectsTab Component renders correctly with associated object @@ -3259,7 +3259,7 @@ exports[`AssociatedObjectsTab Component renders correctly with associated object actions={ Array [ Object { - "description": "Discover this object", + "description": "Query in Observability Logs", "icon": "discoverApp", "name": "Discover", "onClick": [Function], @@ -3293,7 +3293,7 @@ exports[`AssociatedObjectsTab Component renders correctly with associated object @@ -3628,7 +3628,7 @@ exports[`AssociatedObjectsTab Component renders correctly with associated object actions={ Array [ Object { - "description": "Discover this object", + "description": "Query in Observability Logs", "icon": "discoverApp", "name": "Discover", "onClick": [Function], @@ -3662,7 +3662,7 @@ exports[`AssociatedObjectsTab Component renders correctly with associated object @@ -3997,7 +3997,7 @@ exports[`AssociatedObjectsTab Component renders correctly with associated object actions={ Array [ Object { - "description": "Discover this object", + "description": "Query in Observability Logs", "icon": "discoverApp", "name": "Discover", "onClick": [Function], @@ -4031,7 +4031,7 @@ exports[`AssociatedObjectsTab Component renders correctly with associated object diff --git a/public/components/datasources/components/__tests__/__snapshots__/data_connection.test.tsx.snap b/public/components/datasources/components/__tests__/__snapshots__/data_connection.test.tsx.snap index b119d3f40d..a0cc385e53 100644 --- a/public/components/datasources/components/__tests__/__snapshots__/data_connection.test.tsx.snap +++ b/public/components/datasources/components/__tests__/__snapshots__/data_connection.test.tsx.snap @@ -341,7 +341,7 @@ exports[`Data Connection Page test Renders S3 data connection page with data 1`] - Query in Discover + Query in Observability Logs diff --git a/public/components/datasources/components/__tests__/acceleration_table.test.tsx b/public/components/datasources/components/__tests__/acceleration_table.test.tsx index b9ba8365aa..2806c095cf 100644 --- a/public/components/datasources/components/__tests__/acceleration_table.test.tsx +++ b/public/components/datasources/components/__tests__/acceleration_table.test.tsx @@ -159,7 +159,7 @@ describe('AccelerationTable Component', () => { }); const activeStatusRows = wrapper!.find('tr.euiTableRow').filterWhere((node) => { - return node.find('.euiFlexItem').someWhere((subNode) => subNode.text() === 'active'); + return node.find('.euiFlexItem').someWhere((subNode) => subNode.text() === 'Active'); }); expect(activeStatusRows.length).toBe( @@ -177,7 +177,7 @@ describe('AccelerationTable Component', () => { }); wrapper!.update(); - const expectedLocalizedTime = 'Thu, 14 Mar 2024 04:05:53'; + const expectedLocalizedTime = '3/14/2024, 4:05:53 AM'; expect(wrapper!.text()).toContain(expectedLocalizedTime); }); diff --git a/public/components/datasources/components/manage/accelerations/acceleration_action_overlay.tsx b/public/components/datasources/components/manage/accelerations/acceleration_action_overlay.tsx index ce5cff4367..8d6f0a281a 100644 --- a/public/components/datasources/components/manage/accelerations/acceleration_action_overlay.tsx +++ b/public/components/datasources/components/manage/accelerations/acceleration_action_overlay.tsx @@ -48,13 +48,13 @@ export const AccelerationActionOverlay: React.FC switch (actionType) { case 'vacuum': - title = `Vacuum acceleration ${displayIndexName} on ${displayFullPath}?`; + title = `Vacuum acceleration ${displayIndexName} on ${displayFullPath} ?`; description = ACC_VACUUM_MSG; confirmButtonText = 'Vacuum'; confirmEnabled = confirmationInput === displayIndexName; break; case 'delete': - title = `Delete acceleration ${displayIndexName} on ${displayFullPath}?`; + title = `Delete acceleration ${displayIndexName} on ${displayFullPath} ?`; description = ACC_DELETE_MSG; confirmButtonText = 'Delete'; break; diff --git a/public/components/datasources/components/manage/accelerations/acceleration_table.tsx b/public/components/datasources/components/manage/accelerations/acceleration_table.tsx index afc5691c67..42deb7b426 100644 --- a/public/components/datasources/components/manage/accelerations/acceleration_table.tsx +++ b/public/components/datasources/components/manage/accelerations/acceleration_table.tsx @@ -4,7 +4,6 @@ */ import { - EuiBasicTableColumn, EuiButton, EuiEmptyPrompt, EuiFlexGroup, @@ -15,6 +14,7 @@ import { EuiLoadingSpinner, EuiPanel, EuiSpacer, + EuiTableFieldDataColumnType, EuiText, } from '@elastic/eui'; import React, { useCallback, useEffect, useState } from 'react'; @@ -150,14 +150,16 @@ export const AccelerationTable = ({ ); }; + const displayUpdatedTime = updatedTime ? new Date(updatedTime).toLocaleString() : ''; + const AccelerationTableHeader = () => { return ( <> - + -

{ACC_PANEL_TITLE}

-

{ACC_PANEL_DESC}

+

{ACC_PANEL_TITLE}

+ {ACC_PANEL_DESC}
@@ -174,10 +176,10 @@ export const AccelerationTable = ({ {updatedTime && ( - {'Last updated'} + {'Last updated at:'} - {updatedTime} + {displayUpdatedTime} )} @@ -200,8 +202,8 @@ export const AccelerationTable = ({ const tableActions = [ { - name: 'Discover', - description: 'Open in Discover', + name: 'Query Data', + description: 'Query in Observability Logs', icon: 'discoverApp', type: 'icon', onClick: (acc: CachedAcceleration) => { @@ -274,27 +276,27 @@ export const AccelerationTable = ({ default: label = 'INVALID TYPE'; } - return {label}; + return {label}; }, }, { field: 'database', name: 'Database', sortable: true, - render: (database: string) => {database}, + render: (database: string) => {database}, }, { field: 'table', name: 'Table', sortable: true, - render: (table: string) => {table || '-'}, + render: (table: string) => {table || '-'}, }, { field: 'refreshType', name: 'Refresh Type', sortable: true, render: (autoRefresh: boolean, acceleration: CachedAcceleration) => { - return {acceleration.autoRefresh ? 'Auto refresh' : 'Manual'}; + return {acceleration.autoRefresh ? 'Auto refresh' : 'Manual'}; }, }, { @@ -312,7 +314,7 @@ export const AccelerationTable = ({ name: 'Actions', actions: tableActions, }, - ] as Array>; + ] as Array>; const pagination = { initialPageSize: 10, @@ -335,7 +337,6 @@ export const AccelerationTable = ({ - {isRefreshing ? ( ) : ( diff --git a/public/components/datasources/components/manage/accelerations/utils/acceleration_utils.tsx b/public/components/datasources/components/manage/accelerations/utils/acceleration_utils.tsx index 8811aa42cd..31dca1dc63 100644 --- a/public/components/datasources/components/manage/accelerations/utils/acceleration_utils.tsx +++ b/public/components/datasources/components/manage/accelerations/utils/acceleration_utils.tsx @@ -28,6 +28,14 @@ export const getAccelerationName = (acceleration: CachedAcceleration) => { return acceleration.indexName || 'skipping_index'; }; +export const getCapitalizedStatusColumnContent = (status: string) => { + return status + .toLowerCase() + .split(' ') + .map((word) => word.charAt(0).toUpperCase() + word.slice(1)) + .join(' '); +}; + export const getAccelerationFullPath = (acceleration: CachedAcceleration, dataSource: string) => { switch (acceleration.type) { case 'skipping': @@ -94,24 +102,25 @@ export const CreateAccelerationFlyoutButton = ({ }; export const AccelerationStatus = ({ status }: { status: string }) => { - const label = status; + const capitalizedStatusColumn = getCapitalizedStatusColumnContent(status); + let color; - switch (status) { - case 'active': + switch (capitalizedStatusColumn) { + case 'Active': color = 'success'; break; - case 'refreshing': + case 'Refreshing': color = 'warning'; break; - case 'deleted': + case 'Deleted': color = 'danger'; break; default: color = 'subdued'; } - return {label}; + return {capitalizedStatusColumn}; }; export const AccelerationHealth = ({ health }: { health: string }) => { diff --git a/public/components/datasources/components/manage/associated_objects/modules/associated_objects_table.tsx b/public/components/datasources/components/manage/associated_objects/modules/associated_objects_table.tsx index 0cb1834054..797aae2435 100644 --- a/public/components/datasources/components/manage/associated_objects/modules/associated_objects_table.tsx +++ b/public/components/datasources/components/manage/associated_objects/modules/associated_objects_table.tsx @@ -139,7 +139,7 @@ export const AssociatedObjectsTable = (props: AssociatedObjectsTableProps) => { description: i18n.translate( 'datasources.associatedObjectsTab.action.discover.description', { - defaultMessage: 'Discover this object', + defaultMessage: 'Query in Observability Logs', } ), type: 'icon', diff --git a/public/components/datasources/components/manage/data_connection.tsx b/public/components/datasources/components/manage/data_connection.tsx index 535a0ffdcc..f488742ce5 100644 --- a/public/components/datasources/components/manage/data_connection.tsx +++ b/public/components/datasources/components/manage/data_connection.tsx @@ -162,7 +162,7 @@ export const DataConnection = (props: any) => { selectable={{ onClick: onclickDiscoverCard, isDisabled: false, - children: 'Query in Discover', + children: 'Query in Observability Logs', }} />