Skip to content

Commit

Permalink
address pr comments
Browse files Browse the repository at this point in the history
Signed-off-by: Derek Ho <dxho@amazon.com>
  • Loading branch information
derek-ho committed Sep 6, 2023
1 parent 3d9314e commit 8c3190f
Show file tree
Hide file tree
Showing 18 changed files with 31 additions and 276 deletions.
1 change: 0 additions & 1 deletion common/constants/custom_panels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { v4 as uuidv4 } from 'uuid';
export const CUSTOM_PANELS_API_PREFIX = '/api/observability/operational_panels';
export const CUSTOM_PANELS_DOCUMENTATION_URL =
'https://opensearch.org/docs/latest/observability-plugin/operational-panels/';
export const OPENSEARCH_DOCUMENTATION_URL = 'https://opensearch.org/docs/latest';
export const CREATE_PANEL_MESSAGE =
'Enter a name to describe the purpose of this Observability Dashboard.';

Expand Down
10 changes: 0 additions & 10 deletions common/constants/explorer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,6 @@ export const CREATE_TAB_PARAM = {
} as const;
export const HAS_SAVED_TIMESTAMP = 'hasSavedTimestamp';
export const FILTER_OPTIONS = ['Visualization', 'Query', 'Metric'];
export const ASSET_FILTER_OPTIONS = ['index-pattern', 'search', 'visualization', 'dashboard'];
export const INTEGRATION_TEMPLATE_OPTIONS = ['nginx', 'aws_elb'];
export const INTEGRATION_CATEOGRY_OPTIONS = [
'communication',
'http',
'cloud',
'aws_elb',
'container',
'logs',
];
export const SAVED_QUERY = 'savedQuery';
export const SAVED_VISUALIZATION = 'savedVisualization';
export const SAVED_OBJECT_ID = 'savedObjectId';
Expand Down
16 changes: 16 additions & 0 deletions common/constants/integrations.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/

export const OPENSEARCH_DOCUMENTATION_URL = 'https://opensearch.org/docs/latest';
export const ASSET_FILTER_OPTIONS = ['index-pattern', 'search', 'visualization', 'dashboard'];
export const INTEGRATION_TEMPLATE_OPTIONS = ['nginx', 'aws_elb'];
export const INTEGRATION_CATEOGRY_OPTIONS = [
'communication',
'http',
'cloud',
'aws_elb',
'container',
'logs',
];
4 changes: 2 additions & 2 deletions public/components/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { observabilityID, observabilityTitle } from '../../common/constants/shar
import { store } from '../framework/redux/store';
import { AppPluginStartDependencies } from '../types';
import { Home as ApplicationAnalyticsHome } from './application_analytics/home';
import { Home as PlaceholderHome } from './integrations/home';
import { Home as IntegrationsHome } from './integrations/home';
import { MetricsListener } from './common/metrics_listener';
import { Home as CustomPanelsHome } from './custom_panels/home';
import { EventAnalytics } from './event_analytics';
Expand Down Expand Up @@ -43,7 +43,7 @@ const pages = {
traces: TraceAnalyticsHome,
notebooks: NotebooksHome,
dashboards: CustomPanelsHome,
integrations: PlaceholderHome,
integrations: IntegrationsHome,
};

export const App = ({
Expand Down
150 changes: 0 additions & 150 deletions public/components/common/side_nav.tsx

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright OpenSearch Contributors
* SPDX-License-Identifier: Apache-2.0
*/

import {
doTypeValidation,
doNestedPropertyValidation,
Expand Down
79 changes: 1 addition & 78 deletions public/components/integrations/components/added_integration.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import {
import React, { useEffect, useState } from 'react';
import _ from 'lodash';
import { PanelTitle } from '../../trace_analytics/components/common/helper_functions';
import { ASSET_FILTER_OPTIONS, FILTER_OPTIONS } from '../../../../common/constants/explorer';
import { ASSET_FILTER_OPTIONS } from '../../../../common/constants/integrations';
import { INTEGRATIONS_BASE, OBSERVABILITY_BASE } from '../../../../common/constants/shared';
import { DeleteModal } from '../../common/helpers/delete_modal';
import { AddedIntegrationProps } from './integration_types';
Expand Down Expand Up @@ -282,83 +282,6 @@ export function AddedIntegration(props: AddedIntegrationProps) {
);
}

function AddedIntegrationFields(fieldProps: any) {
const data = fieldProps.data?.fields || [];

const search = {
box: {
incremental: true,
},
filters: [
{
type: 'field_value_selection',
field: 'type',
name: 'Type',
multiSelect: false,
options: FILTER_OPTIONS.map((i) => ({
value: i,
name: i,
view: i,
})),
},
],
};

const tableColumns = [
{
field: 'name',
name: 'Name',
sortable: true,
truncateText: true,
render: (value, record) => (
<EuiText data-test-subj={`${record.name}IntegrationLink`}>
{_.truncate(record.description, { length: 100 })}
</EuiText>
),
},
{
field: 'type',
name: 'Type',
sortable: true,
truncateText: true,
render: (value, record) => (
<EuiText data-test-subj={`${record.type}IntegrationDescription`}>
{_.truncate(record.type, { length: 100 })}
</EuiText>
),
},
{
field: 'category',
name: 'Category',
sortable: true,
truncateText: true,
render: (value, record) => (
<EuiText data-test-subj={`${record.type}IntegrationDescription`}>
{_.truncate(record.category, { length: 100 })}
</EuiText>
),
},
] as Array<EuiTableFieldDataColumnType<any>>;

return (
<EuiPanel>
<PanelTitle title={'Integration Fields'} />
<EuiSpacer size="l" />
<EuiInMemoryTable
itemId="id"
loading={false}
items={data}
columns={tableColumns}
pagination={{
initialPageSize: 10,
pageSizeOptions: [5, 10, 15],
}}
search={search}
/>
</EuiPanel>
);
}

return (
<EuiPage>
<EuiPageBody>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { AddedIntegrationsTableProps } from './added_integration_overview_page';
import {
ASSET_FILTER_OPTIONS,
INTEGRATION_TEMPLATE_OPTIONS,
} from '../../../../common/constants/explorer';
} from '../../../../common/constants/integrations';
import { DeleteModal } from '../../../../public/components/common/helpers/delete_modal';
import { INTEGRATIONS_BASE } from '../../../../common/constants/shared';
import { useToast } from '../../../../public/components/common/toast';
Expand Down Expand Up @@ -154,17 +154,8 @@ export function AddedIntegrationsTable(props: AddedIntegrationsTableProps) {
pageSizeOptions: [5, 10, 15],
}}
search={search}
// sorting={{
// sort: {
// field: 'dateModified',
// direction: 'desc',
// },
// }}
allowNeutralSort={false}
isSelectable={true}
// selection={{
// onSelectionChange: (items) => setSelectedApplications(items),
// }}
/>
) : (
<>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,9 @@ export function AvailableIntegrationsCardView(props: AvailableIntegrationsCardVi
isClearable={false}
placeholder="Search..."
data-test-subj="search-bar-input-box"
// value={query}
// onClick = {() => query.current.}
onChange={(e) => {
props.setQuery(e.target.value);
// query.current
// setGlobalQuery(e.target.value);
}}
// onSearch={props.refresh}
/>
</EuiFlexItem>
<EuiFlexItem grow={false}>{props.renderCateogryFilters()}</EuiFlexItem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import {
} from '@elastic/eui';
import _ from 'lodash';
import React, { useState } from 'react';
import { ASSET_FILTER_OPTIONS } from 'common/constants/explorer';
import { AvailableIntegrationsTableProps } from './available_integration_overview_page';
import { badges } from './integration_category_badge_group';

Expand Down Expand Up @@ -128,17 +127,8 @@ export function AvailableIntegrationsTable(props: AvailableIntegrationsTableProp
pageSizeOptions: [5, 10, 15],
}}
search={search}
// sorting={{
// sort: {
// field: 'dateModified',
// direction: 'desc',
// },
// }}
allowNeutralSort={false}
isSelectable={true}
// selection={{
// onSelectionChange: (items) => setSelectedApplications(items),
// }}
/>
) : (
<>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ import {
import React from 'react';
import _ from 'lodash';
import { PanelTitle } from '../../trace_analytics/components/common/helper_functions';

const FILTER_OPTIONS = ['index-pattern', 'search', 'visualization', 'dashboard'];
import { ASSET_FILTER_OPTIONS } from '../../../../common/constants/integrations';

export function IntegrationAssets(props: any) {
const [config, assets] = [props.integration, props.integrationAssets];
Expand All @@ -29,7 +28,7 @@ export function IntegrationAssets(props: any) {
field: 'type',
name: 'Type',
multiSelect: false,
options: FILTER_OPTIONS.map((i) => ({
options: ASSET_FILTER_OPTIONS.map((i) => ({
value: i,
name: i,
view: i,
Expand Down
Loading

0 comments on commit 8c3190f

Please sign in to comment.