Skip to content

Commit

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

* add missing productName property
  • Loading branch information
klacabane authored Oct 7, 2021
1 parent a7fd1e2 commit 213c342
Show file tree
Hide file tree
Showing 12 changed files with 24 additions and 4 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 @@ -15,6 +15,7 @@ import { Ccr } from '../../../components/elasticsearch/ccr';
import { ComponentProps } from '../../route_init';
import { SetupModeRenderer } from '../../setup_mode/setup_mode_renderer';
import { SetupModeContext } from '../../../components/setup_mode/setup_mode_context';
import { ELASTICSEARCH_SYSTEM_ID } from '../../../../common/constants';

interface SetupModeProps {
setupMode: any;
Expand Down Expand Up @@ -68,6 +69,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 @@ -16,6 +16,7 @@ import { CcrShardReact } from '../../../components/elasticsearch/ccr_shard';
import { ComponentProps } from '../../route_init';
import { SetupModeRenderer } from '../../setup_mode/setup_mode_renderer';
import { SetupModeContext } from '../../../components/setup_mode/setup_mode_context';
import { ELASTICSEARCH_SYSTEM_ID } from '../../../../common/constants';

interface SetupModeProps {
setupMode: any;
Expand Down Expand Up @@ -78,6 +79,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 @@ -16,6 +16,7 @@ import { useCharts } from '../../hooks/use_charts';
import { ItemTemplate } from './item_template';
// @ts-ignore
import { AdvancedIndex } from '../../../components/elasticsearch/index/advanced';
import { ELASTICSEARCH_SYSTEM_ID } from '../../../../common/constants';

export const ElasticsearchIndexAdvancedPage: React.FC<ComponentProps> = ({ clusters }) => {
const globalState = useContext(GlobalStateContext);
Expand Down Expand Up @@ -51,6 +52,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 @@ -20,6 +20,7 @@ import { ItemTemplate } from './item_template';
import { indicesByNodes } from '../../../components/elasticsearch/shard_allocation/transformers/indices_by_nodes';
// @ts-ignore
import { labels } from '../../../components/elasticsearch/shard_allocation/lib/labels';
import { ELASTICSEARCH_SYSTEM_ID } from '../../../../common/constants';

export const ElasticsearchIndexPage: React.FC<ComponentProps> = ({ clusters }) => {
const globalState = useContext(GlobalStateContext);
Expand Down Expand Up @@ -77,6 +78,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 @@ -16,6 +16,7 @@ import { SetupModeRenderer, SetupModeProps } from '../../setup_mode/setup_mode_r
import { SetupModeContext } from '../../../components/setup_mode/setup_mode_context';
import { useTable } from '../../hooks/use_table';
import { useLocalStorage } from '../../hooks/use_local_storage';
import { ELASTICSEARCH_SYSTEM_ID } from '../../../../common/constants';

export const ElasticsearchIndicesPage: React.FC<ComponentProps> = ({ clusters }) => {
const globalState = useContext(GlobalStateContext);
Expand Down Expand Up @@ -80,6 +81,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 @@ -16,6 +16,7 @@ import { SetupModeRenderer } from '../../setup_mode/setup_mode_renderer';
import { SetupModeContext } from '../../../components/setup_mode/setup_mode_context';
import { useTable } from '../../hooks/use_table';
import type { MLJobs } from '../../../types';
import { ELASTICSEARCH_SYSTEM_ID } from '../../../../common/constants';

interface SetupModeProps {
setupMode: any;
Expand Down Expand Up @@ -80,6 +81,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 @@ -19,6 +19,7 @@ import { useCharts } from '../../hooks/use_charts';
import { nodesByIndices } from '../../../components/elasticsearch/shard_allocation/transformers/nodes_by_indices';
// @ts-ignore
import { labels } from '../../../components/elasticsearch/shard_allocation/lib/labels';
import { ELASTICSEARCH_SYSTEM_ID } from '../../../../common/constants';

export const ElasticsearchNodePage: React.FC<ComponentProps> = ({ clusters }) => {
const globalState = useContext(GlobalStateContext);
Expand Down Expand Up @@ -92,6 +93,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 @@ -17,6 +17,7 @@ import { SetupModeRenderer, SetupModeProps } from '../../setup_mode/setup_mode_r
import { SetupModeContext } from '../../../components/setup_mode/setup_mode_context';
import { useTable } from '../../hooks/use_table';
import { BreadcrumbContainer } from '../../hooks/use_breadcrumbs';
import { ELASTICSEARCH_SYSTEM_ID } from '../../../../common/constants';

export const ElasticsearchNodesPage: React.FC<ComponentProps> = ({ clusters }) => {
const globalState = useContext(GlobalStateContext);
Expand Down Expand Up @@ -84,6 +85,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 @@ -19,6 +19,7 @@ import { KibanaInstances } from '../../../components/kibana/instances';
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 { KIBANA_SYSTEM_ID } from '../../../../common/constants';

export const KibanaInstancesPage: React.FC<ComponentProps> = ({ clusters }) => {
const { cluster_uuid: clusterUuid, ccs } = useContext(GlobalStateContext);
Expand Down Expand Up @@ -79,7 +80,7 @@ export const KibanaInstancesPage: React.FC<ComponentProps> = ({ clusters }) => {
>
<div data-test-subj="monitoringKibanaInstancesApp">
<SetupModeRenderer
productName="kibana"
productName={KIBANA_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 @@ -16,6 +16,7 @@ import { LogstashTemplate } from './logstash_template';
import { SetupModeRenderer } from '../../setup_mode/setup_mode_renderer';
import { SetupModeContext } from '../../../components/setup_mode/setup_mode_context';
import { useTable } from '../../hooks/use_table';
import { LOGSTASH_SYSTEM_ID } from '../../../../common/constants';

interface SetupModeProps {
setupMode: any;
Expand Down Expand Up @@ -68,7 +69,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 213c342

Please sign in to comment.