Skip to content

Commit

Permalink
[Stack Monitoring] use product names constants (#114096) (#114796)
Browse files Browse the repository at this point in the history
* use product names constants

* add missing productName property
# Conflicts:
#	x-pack/plugins/monitoring/public/application/pages/elasticsearch/ccr_page.tsx
#	x-pack/plugins/monitoring/public/application/pages/elasticsearch/ccr_shard_page.tsx
#	x-pack/plugins/monitoring/public/application/pages/elasticsearch/index_page.tsx
#	x-pack/plugins/monitoring/public/application/pages/elasticsearch/indices_page.tsx
#	x-pack/plugins/monitoring/public/application/pages/elasticsearch/ml_jobs_page.tsx
#	x-pack/plugins/monitoring/public/application/pages/elasticsearch/node_page.tsx
#	x-pack/plugins/monitoring/public/application/pages/elasticsearch/nodes_page.tsx
#	x-pack/plugins/monitoring/public/application/pages/kibana/instances.tsx
#	x-pack/plugins/monitoring/public/application/pages/logstash/nodes.tsx
  • Loading branch information
klacabane authored Oct 14, 2021
1 parent eab597b commit 8a34af3
Show file tree
Hide file tree
Showing 11 changed files with 25 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { ApmServerInstances } from '../../../components/apm/instances';
import { SetupModeRenderer } from '../../setup_mode/setup_mode_renderer';
import { SetupModeContext } from '../../../components/setup_mode/setup_mode_context';
import { BreadcrumbContainer } from '../../hooks/use_breadcrumbs';
import { APM_SYSTEM_ID } from '../../../../common/constants';

interface SetupModeProps {
setupMode: any;
Expand Down Expand Up @@ -90,7 +91,7 @@ export const ApmInstancesPage: React.FC<ComponentProps> = ({ clusters }) => {
data-test-subj="apmInstancesPage"
>
<SetupModeRenderer
productName="apm"
productName={APM_SYSTEM_ID}
render={({ setupMode, flyoutComponent, bottomBarComponent }: SetupModeProps) => (
<SetupModeContext.Provider value={{ setupModeSupported: true }}>
{flyoutComponent}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { Listing } from '../../../components/beats/listing';
import { SetupModeRenderer, SetupModeProps } from '../../setup_mode/setup_mode_renderer';
import { SetupModeContext } from '../../../components/setup_mode/setup_mode_context';
import { BreadcrumbContainer } from '../../hooks/use_breadcrumbs';
import { BEATS_SYSTEM_ID } from '../../../../common/constants';

export const BeatsInstancesPage: React.FC<ComponentProps> = ({ clusters }) => {
const globalState = useContext(GlobalStateContext);
Expand Down Expand Up @@ -78,7 +79,7 @@ export const BeatsInstancesPage: React.FC<ComponentProps> = ({ clusters }) => {
>
<div data-test-subj="monitoringBeatsInstancesApp">
<SetupModeRenderer
productName="beats"
productName={BEATS_SYSTEM_ID}
render={({ setupMode, flyoutComponent, bottomBarComponent }: SetupModeProps) => (
<SetupModeContext.Provider value={{ setupModeSupported: true }}>
{flyoutComponent}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,12 @@ import { GlobalStateContext } from '../../contexts/global_state_context';
// @ts-ignore
import { Ccr } from '../../../components/elasticsearch/ccr';
import { ComponentProps } from '../../route_init';
import { SetupModeRenderer } from '../../setup_mode/setup_mode_renderer';
import { SetupModeRenderer, SetupModeProps } from '../../setup_mode/setup_mode_renderer';
import { SetupModeContext } from '../../../components/setup_mode/setup_mode_context';
import { AlertsByName } from '../../../alerts/types';
import { fetchAlerts } from '../../../lib/fetch_alerts';
import { RULE_CCR_READ_EXCEPTIONS } from '../../../../common/constants';
import { RULE_CCR_READ_EXCEPTIONS, ELASTICSEARCH_SYSTEM_ID } from '../../../../common/constants';
import { BreadcrumbContainer } from '../../hooks/use_breadcrumbs';
interface SetupModeProps {
setupMode: any;
flyoutComponent: any;
bottomBarComponent: any;
}

export const ElasticsearchCcrPage: React.FC<ComponentProps> = ({ clusters }) => {
const globalState = useContext(GlobalStateContext);
Expand Down Expand Up @@ -93,6 +88,7 @@ export const ElasticsearchCcrPage: React.FC<ComponentProps> = ({ clusters }) =>
cluster={cluster}
>
<SetupModeRenderer
productName={ELASTICSEARCH_SYSTEM_ID}
render={({ flyoutComponent, bottomBarComponent }: SetupModeProps) => (
<SetupModeContext.Provider value={{ setupModeSupported: true }}>
{flyoutComponent}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,13 @@ import { GlobalStateContext } from '../../contexts/global_state_context';
// @ts-ignore
import { CcrShardReact } from '../../../components/elasticsearch/ccr_shard';
import { ComponentProps } from '../../route_init';
import { SetupModeRenderer } from '../../setup_mode/setup_mode_renderer';
import { SetupModeRenderer, SetupModeProps } from '../../setup_mode/setup_mode_renderer';
import { SetupModeContext } from '../../../components/setup_mode/setup_mode_context';
import { AlertsByName } from '../../../alerts/types';
import { fetchAlerts } from '../../../lib/fetch_alerts';
import { RULE_CCR_READ_EXCEPTIONS } from '../../../../common/constants';
import { RULE_CCR_READ_EXCEPTIONS, ELASTICSEARCH_SYSTEM_ID } from '../../../../common/constants';
import { BreadcrumbContainer } from '../../hooks/use_breadcrumbs';

interface SetupModeProps {
setupMode: any;
flyoutComponent: any;
bottomBarComponent: any;
}

export const ElasticsearchCcrShardPage: React.FC<ComponentProps> = ({ clusters }) => {
const globalState = useContext(GlobalStateContext);
const { services } = useKibana<{ data: any }>();
Expand Down Expand Up @@ -114,6 +108,7 @@ export const ElasticsearchCcrShardPage: React.FC<ComponentProps> = ({ clusters }
data-test-subj="elasticsearchCcrShardPage"
>
<SetupModeRenderer
productName={ELASTICSEARCH_SYSTEM_ID}
instance={instance}
render={({ flyoutComponent, bottomBarComponent }: SetupModeProps) => (
<SetupModeContext.Provider value={{ setupModeSupported: true }}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { ItemTemplate } from './item_template';
import { AdvancedIndex } from '../../../components/elasticsearch/index/advanced';
import { AlertsByName } from '../../../alerts/types';
import { fetchAlerts } from '../../../lib/fetch_alerts';
import { RULE_LARGE_SHARD_SIZE } from '../../../../common/constants';
import { RULE_LARGE_SHARD_SIZE, ELASTICSEARCH_SYSTEM_ID } from '../../../../common/constants';
import { BreadcrumbContainer } from '../../hooks/use_breadcrumbs';

export const ElasticsearchIndexAdvancedPage: React.FC<ComponentProps> = ({ clusters }) => {
Expand Down Expand Up @@ -89,6 +89,7 @@ export const ElasticsearchIndexAdvancedPage: React.FC<ComponentProps> = ({ clust
return (
<ItemTemplate title={title} getPageData={getPageData} id={index} pageType="indices">
<SetupModeRenderer
productName={ELASTICSEARCH_SYSTEM_ID}
render={({ setupMode, flyoutComponent, bottomBarComponent }: SetupModeProps) => (
<SetupModeContext.Provider value={{ setupModeSupported: true }}>
{flyoutComponent}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { indicesByNodes } from '../../../components/elasticsearch/shard_allocati
import { labels } from '../../../components/elasticsearch/shard_allocation/lib/labels';
import { AlertsByName } from '../../../alerts/types';
import { fetchAlerts } from '../../../lib/fetch_alerts';
import { RULE_LARGE_SHARD_SIZE } from '../../../../common/constants';
import { RULE_LARGE_SHARD_SIZE, ELASTICSEARCH_SYSTEM_ID } from '../../../../common/constants';
import { BreadcrumbContainer } from '../../hooks/use_breadcrumbs';

export const ElasticsearchIndexPage: React.FC<ComponentProps> = ({ clusters }) => {
Expand Down Expand Up @@ -114,6 +114,7 @@ export const ElasticsearchIndexPage: React.FC<ComponentProps> = ({ clusters }) =
pageType="indices"
>
<SetupModeRenderer
productName={ELASTICSEARCH_SYSTEM_ID}
render={({ setupMode, flyoutComponent, bottomBarComponent }: SetupModeProps) => (
<SetupModeContext.Provider value={{ setupModeSupported: true }}>
{flyoutComponent}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { useTable } from '../../hooks/use_table';
import { useLocalStorage } from '../../hooks/use_local_storage';
import { AlertsByName } from '../../../alerts/types';
import { fetchAlerts } from '../../../lib/fetch_alerts';
import { RULE_LARGE_SHARD_SIZE } from '../../../../common/constants';
import { RULE_LARGE_SHARD_SIZE, ELASTICSEARCH_SYSTEM_ID } from '../../../../common/constants';
import { BreadcrumbContainer } from '../../hooks/use_breadcrumbs';

export const ElasticsearchIndicesPage: React.FC<ComponentProps> = ({ clusters }) => {
Expand Down Expand Up @@ -106,6 +106,7 @@ export const ElasticsearchIndicesPage: React.FC<ComponentProps> = ({ clusters })
>
<div data-test-subj="elasticsearchIndicesListingPage">
<SetupModeRenderer
productName={ELASTICSEARCH_SYSTEM_ID}
render={({ flyoutComponent, bottomBarComponent }: SetupModeProps) => (
<SetupModeContext.Provider value={{ setupModeSupported: true }}>
{flyoutComponent}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { SetupModeContext } from '../../../components/setup_mode/setup_mode_cont
import { useTable } from '../../hooks/use_table';
import type { MLJobs } from '../../../types';
import { BreadcrumbContainer } from '../../hooks/use_breadcrumbs';
import { ELASTICSEARCH_SYSTEM_ID } from '../../../../common/constants';

interface SetupModeProps {
setupMode: any;
Expand Down Expand Up @@ -90,6 +91,7 @@ export const ElasticsearchMLJobsPage: React.FC<ComponentProps> = ({ clusters })
>
<div data-test-subj="elasticsearchMLJobsListingPage">
<SetupModeRenderer
productName={ELASTICSEARCH_SYSTEM_ID}
render={({ flyoutComponent, bottomBarComponent }: SetupModeProps) => (
<SetupModeContext.Provider value={{ setupModeSupported: true }}>
{flyoutComponent}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import {
RULE_MISSING_MONITORING_DATA,
RULE_DISK_USAGE,
RULE_MEMORY_USAGE,
ELASTICSEARCH_SYSTEM_ID,
} from '../../../../common/constants';
import { BreadcrumbContainer } from '../../hooks/use_breadcrumbs';

Expand Down Expand Up @@ -138,6 +139,7 @@ export const ElasticsearchNodePage: React.FC<ComponentProps> = ({ clusters }) =>
pageType="nodes"
>
<SetupModeRenderer
productName={ELASTICSEARCH_SYSTEM_ID}
render={({ setupMode, flyoutComponent, bottomBarComponent }: SetupModeProps) => (
<SetupModeContext.Provider value={{ setupModeSupported: true }}>
{flyoutComponent}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import {
RULE_THREAD_POOL_WRITE_REJECTIONS,
RULE_MEMORY_USAGE,
RULE_MISSING_MONITORING_DATA,
ELASTICSEARCH_SYSTEM_ID,
} from '../../../../common/constants';

export const ElasticsearchNodesPage: React.FC<ComponentProps> = ({ clusters }) => {
Expand Down Expand Up @@ -117,6 +118,7 @@ export const ElasticsearchNodesPage: React.FC<ComponentProps> = ({ clusters }) =
>
<div data-test-subj="elasticsearchNodesListingPage">
<SetupModeRenderer
productName={ELASTICSEARCH_SYSTEM_ID}
render={({ setupMode, flyoutComponent, bottomBarComponent }: SetupModeProps) => (
<SetupModeContext.Provider value={{ setupModeSupported: true }}>
{flyoutComponent}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,13 @@ import { ComponentProps } from '../../route_init';
// @ts-ignore
import { Listing } from '../../../components/logstash/listing';
import { LogstashTemplate } from './logstash_template';
import { SetupModeRenderer } from '../../setup_mode/setup_mode_renderer';
import { SetupModeRenderer, SetupModeProps } from '../../setup_mode/setup_mode_renderer';
import { SetupModeContext } from '../../../components/setup_mode/setup_mode_context';
import { useTable } from '../../hooks/use_table';
import { RULE_LOGSTASH_VERSION_MISMATCH } from '../../../../common/constants';
import { RULE_LOGSTASH_VERSION_MISMATCH, LOGSTASH_SYSTEM_ID } from '../../../../common/constants';
import { AlertsByName } from '../../../alerts/types';
import { fetchAlerts } from '../../../lib/fetch_alerts';

interface SetupModeProps {
setupMode: any;
flyoutComponent: any;
bottomBarComponent: any;
}

export const LogStashNodesPage: React.FC<ComponentProps> = ({ clusters }) => {
const globalState = useContext(GlobalStateContext);
const { services } = useKibana<{ data: any }>();
Expand Down Expand Up @@ -84,7 +78,7 @@ export const LogStashNodesPage: React.FC<ComponentProps> = ({ clusters }) => {
>
<div>
<SetupModeRenderer
productName="logstash"
productName={LOGSTASH_SYSTEM_ID}
render={({ setupMode, flyoutComponent, bottomBarComponent }: SetupModeProps) => (
<SetupModeContext.Provider value={{ setupModeSupported: true }}>
{flyoutComponent}
Expand Down

0 comments on commit 8a34af3

Please sign in to comment.