Skip to content

Commit

Permalink
Added Samples, help text, standardized tables (#217)
Browse files Browse the repository at this point in the history
* added new samples and modified workspace height

Signed-off-by: Shenoy Pratik <sgguruda@amazon.com>

* updated documentation links and help text

Signed-off-by: Shenoy Pratik <sgguruda@amazon.com>

* standardized empty table buttons

Signed-off-by: Shenoy Pratik <sgguruda@amazon.com>

* merged add samples logic

Signed-off-by: Shenoy Pratik <sgguruda@amazon.com>

* updated panel tests, added sample modal

Signed-off-by: Shenoy Pratik <sgguruda@amazon.com>
  • Loading branch information
ps48 authored Nov 10, 2021
1 parent 9a52fd9 commit 131e3e6
Show file tree
Hide file tree
Showing 36 changed files with 7,725 additions and 254 deletions.
2 changes: 1 addition & 1 deletion dashboards-observability/common/constants/custom_panels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
*/

export const CUSTOM_PANELS_API_PREFIX = '/api/observability/operational_panels';
export const CUSTOM_PANELS_DOCUMENTATION_URL = 'https://www.opensearch.org';
export const CUSTOM_PANELS_DOCUMENTATION_URL = 'https://opensearch.org/docs/latest/observability-plugins/operational-panels/';
export const CREATE_PANEL_MESSAGE = 'Enter a name to describe the purpose of this custom panel.';
3 changes: 2 additions & 1 deletion dashboards-observability/common/constants/explorer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
* Modifications Copyright OpenSearch Contributors. See
* GitHub history for details.
*/


export const EVENT_ANALYTICS_DOCUMENTATION_URL = 'https://opensearch.org/docs/latest/observability-plugins/event-analytics/'
export const RAW_QUERY = 'rawQuery';
export const FINAL_QUERY = 'finalQuery';
export const SELECTED_DATE_RANGE = 'selectedDateRange';
Expand Down
2 changes: 1 addition & 1 deletion dashboards-observability/common/constants/notebooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const NOTEBOOKS_API_PREFIX = '/api/observability/notebooks';
export const NOTEBOOKS_SELECTED_BACKEND = 'DEFAULT'; // ZEPPELIN || DEFAULT
export const NOTEBOOKS_FETCH_SIZE = 1000;
export const CREATE_NOTE_MESSAGE = 'Enter a name to describe the purpose of this notebook.';
export const NOTEBOOKS_DOCUMENTATION_URL = 'https://opensearch.org/docs/dashboards/notebooks/';
export const NOTEBOOKS_DOCUMENTATION_URL = 'https://opensearch.org/docs/latest/observability-plugins/notebooks/';

export const zeppelinURL = 'http://localhost:8080';

Expand Down
1 change: 1 addition & 0 deletions dashboards-observability/common/constants/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export const observabilityTitle = 'Observability';
export const observabilityPluginOrder = 6000;

// Shared Constants
export const PPL_DOCUMENTATION_URL ='https://opensearch.org/docs/latest/observability-plugins/ppl/commands/'
export const UI_DATE_FORMAT = 'MM/DD/YYYY hh:mm A';
export const PPL_DATE_FORMAT = 'YYYY-MM-DD HH:mm:ss';
export const PPL_STATS_REGEX = /\|\s*stats/i;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const SERVICE_MAP_MAX_NODES = 500;
// size limit when requesting edge related queries, not necessarily the number of edges
export const SERVICE_MAP_MAX_EDGES = 1000;
export const TRACES_MAX_NUM = 3000;
export const TRACE_ANALYTICS_DOCUMENTATION_LINK = 'https://docs-beta.opensearch.org/monitoring-plugins/trace/';
export const TRACE_ANALYTICS_DOCUMENTATION_LINK = 'https://opensearch.org/docs/latest/observability-plugins/trace/index/';

export const TRACE_ANALYTICS_INDICES_ROUTE = '/api/observability/trace_analytics/indices';
export const TRACE_ANALYTICS_DSL_ROUTE = '/api/observability/trace_analytics/query';
4 changes: 2 additions & 2 deletions dashboards-observability/common/types/custom_panels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
export type CustomPanelListType = {
name: string;
id: string;
dateCreated: string;
dateModified: string;
dateCreated: number;
dateModified: number;
};

export type VisualizationType = {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*
* Modifications Copyright OpenSearch Contributors. See
* GitHub history for details.
*/

import React from 'react';
import { EuiOverlayMask, EuiConfirmModal } from '@elastic/eui';

export const getSampleDataModal = (
onCancel: (
event?: React.KeyboardEvent<HTMLDivElement> | React.MouseEvent<HTMLButtonElement, MouseEvent>
) => void,
onConfirm: (event?: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void
) => {
return (
<EuiOverlayMask>
<EuiConfirmModal
title="Add samples"
onCancel={onCancel}
onConfirm={onConfirm}
cancelButtonText="Cancel"
confirmButtonText="Yes"
defaultFocusedButton="confirm"
>
<p>
Do you want to add sample data? This will also add Dashboards sample flights and logs
data if they have not been added.
</p>
</EuiConfirmModal>
</EuiOverlayMask>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import {
EuiText,
EuiTitle,
} from '@elastic/eui';
import { PPL_DOCUMENTATION_URL } from '../../../../common/constants/shared';
import _ from 'lodash';
import React, { useState } from 'react';
import { FlyoutContainers } from '../flyout_containers';
Expand Down Expand Up @@ -74,11 +75,7 @@ export const PPLReferenceFlyout = ({ module, closeFlyout }: Props) => {
</EuiFlexItem>
<EuiFlexItem style={{ justifyContent: 'center' }}>
<EuiText size="s" color="subdued">
<EuiLink
target="_blank"
href="https://opensearch.org/docs/latest/search-plugins/ppl/commands/"
external
>
<EuiLink target="_blank" href={PPL_DOCUMENTATION_URL} external>
Learn More
</EuiLink>
</EuiText>
Expand Down
Loading

0 comments on commit 131e3e6

Please sign in to comment.