Skip to content

Commit

Permalink
Changing Variable to UPPERCASE
Browse files Browse the repository at this point in the history
Signed-off-by: Kishore Kumaar Natarajan <[email protected]>
  • Loading branch information
Kishore Kumaar Natarajan committed Jan 17, 2025
1 parent cfa0154 commit aae3b05
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
14 changes: 7 additions & 7 deletions public/pages/Configuration/Configuration.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ import { useHistory, useLocation } from 'react-router-dom';
import { CoreStart } from 'opensearch-dashboards/public';
import { QUERY_INSIGHTS, MetricSettings } from '../TopNQueries/TopNQueries';
import {
metricTypes,
timeUnits,
minutesOptions,
METRIC_TYPES,
TIME_UNITS,
MINUTES_OPTIONS,
DEFAULT_TOP_N_SIZE,
DEFAULT_WINDOW_SIZE,
} from '../Utils/Constants';
Expand Down Expand Up @@ -131,7 +131,7 @@ const Configuration = ({
<EuiSelect
id="minutes"
required={true}
options={minutesOptions}
options={MINUTES_OPTIONS}
value={windowSize}
onChange={onWindowSizeChange}
/>
Expand All @@ -147,7 +147,7 @@ const Configuration = ({
/>
);

const WindowChoice = time === timeUnits[0].value ? MinutesBox : HoursBox;
const WindowChoice = time === TIME_UNITS[0].value ? MinutesBox : HoursBox;

const isChanged =
isEnabled !== metricSettingsMap[metric].isEnabled ||
Expand All @@ -158,7 +158,7 @@ const Configuration = ({
const isValid = (() => {
const nVal = parseInt(topNSize, 10);
if (nVal < 1 || nVal > 100) return false;
if (time === timeUnits[0].value) return true;
if (time === TIME_UNITS[0].value) return true;
const windowVal = parseInt(windowSize, 10);
return windowVal >= 1 && windowVal <= 24;
})();
Expand Down Expand Up @@ -196,7 +196,7 @@ const Configuration = ({
<EuiSelect
id="metricType"
required={true}
options={metricTypes}
options={METRIC_TYPES}
value={metric}
onChange={onMetricChange}
/>
Expand Down
6 changes: 3 additions & 3 deletions public/pages/Utils/Constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
* SPDX-License-Identifier: Apache-2.0
*/

export const metricTypes = [
export const METRIC_TYPES = [
{ value: 'latency', text: 'Latency' },
{ value: 'cpu', text: 'CPU' },
{ value: 'memory', text: 'Memory' },
];

export const timeUnits = [
export const TIME_UNITS = [
{ value: 'MINUTES', text: 'Minute(s)' },
{ value: 'HOURS', text: 'Hour(s)' },
];

export const minutesOptions = [
export const MINUTES_OPTIONS = [
{ value: '1', text: '1' },
{ value: '5', text: '5' },
{ value: '10', text: '10' },
Expand Down

0 comments on commit aae3b05

Please sign in to comment.