Skip to content

Commit

Permalink
ref: have components and flags tabs use the same constant file (#2751)
Browse files Browse the repository at this point in the history
Refactor the constants.ts file containing measurements constants from components and flags to be at a shared space.
  • Loading branch information
JerrySentry authored Apr 5, 2024
1 parent 6dc03f6 commit 8b631a5
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 40 deletions.
5 changes: 4 additions & 1 deletion src/pages/RepoPage/ComponentsTab/Header/Header.jsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
import PropTypes from 'prop-types'
import { useState } from 'react'

import {
TIME_OPTION_VALUES,
TimeOptions,
} from 'pages/RepoPage/shared/constants'
import { useLocationParams } from 'services/navigation'
import { useRepoBackfilled, useRepoFlagsSelect } from 'services/repo'
import A from 'ui/A'
import Icon from 'ui/Icon'
import MultiSelect from 'ui/MultiSelect'
import Select from 'ui/Select'

import { TIME_OPTION_VALUES, TimeOptions } from '../constants'

const Header = ({ controlsDisabled, children }) => {
const [selectedComponents, setSelectedComponents] = useState([])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { SortingDirection } from 'old_ui/Table/constants'
import {
AFTER_DATE_FORMAT_OPTIONS,
MEASUREMENT_TIME_INTERVALS,
} from 'pages/RepoPage/ComponentsTab/constants'
} from 'pages/RepoPage/shared/constants'
import { useLocationParams } from 'services/navigation'
import { useRepo } from 'services/repo'
import { useRepoFlags } from 'services/repo/useRepoFlags'
Expand Down
5 changes: 4 additions & 1 deletion src/pages/RepoPage/FlagsTab/Header/Header.jsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
import PropTypes from 'prop-types'
import { useState } from 'react'

import {
TIME_OPTION_VALUES,
TimeOptions,
} from 'pages/RepoPage/shared/constants'
import { useLocationParams } from 'services/navigation'
import { useRepoBackfilled, useRepoFlagsSelect } from 'services/repo'
import A from 'ui/A'
import Icon from 'ui/Icon'
import MultiSelect from 'ui/MultiSelect'
import Select from 'ui/Select'

import { TIME_OPTION_VALUES, TimeOptions } from '../constants'

const Header = ({ controlsDisabled, children }) => {
const [selectedFlags, setSelectedFlags] = useState([])
Expand Down
36 changes: 0 additions & 36 deletions src/pages/RepoPage/FlagsTab/constants.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { SortingDirection } from 'old_ui/Table/constants'
import {
AFTER_DATE_FORMAT_OPTIONS,
MEASUREMENT_TIME_INTERVALS,
} from 'pages/RepoPage/FlagsTab/constants'
} from 'pages/RepoPage/shared/constants'
import { useLocationParams } from 'services/navigation'
import { useRepo } from 'services/repo'
import { useRepoFlags } from 'services/repo/useRepoFlags'
Expand Down
File renamed without changes.

0 comments on commit 8b631a5

Please sign in to comment.