Skip to content

Commit 737b585

Browse files
committed
chore: remove numner option type
1 parent e0ea887 commit 737b585

File tree

3 files changed

+9
-13
lines changed

3 files changed

+9
-13
lines changed

src/components/app/details/AboutAppInfoModal.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,10 @@ import {
2424
ToastVariantType,
2525
ComponentSizeType,
2626
InfoBlock,
27+
OptionType,
2728
} from '@devtron-labs/devtron-fe-common-lib'
2829
import { ReactComponent as Close } from '../../../assets/icons/ic-cross.svg'
29-
import { AboutAppInfoModalProps, NumberOptionType } from '../types'
30+
import { AboutAppInfoModalProps } from '../types'
3031
import { editApp } from '../service'
3132
import { projectChangeMessage } from './utils'
3233

@@ -40,8 +41,8 @@ export default function AboutAppInfoModal({
4041
projectsList,
4142
appType,
4243
}: AboutAppInfoModalProps) {
43-
const [projectsOptions, setProjectsOption] = useState<NumberOptionType[]>([])
44-
const [selectedProject, setSelectedProject] = useState<NumberOptionType>()
44+
const [projectsOptions, setProjectsOption] = useState<OptionType<number, string>[]>([])
45+
const [selectedProject, setSelectedProject] = useState<OptionType<number, string>>()
4546
const [submitting, setSubmitting] = useState(false)
4647
const isJobOverview = appType === 'job'
4748

@@ -67,7 +68,7 @@ export default function AboutAppInfoModal({
6768
)
6869
}
6970

70-
const handleProjectSelection = (selected: NumberOptionType): void => {
71+
const handleProjectSelection = (selected: OptionType<number, string>): void => {
7172
setSelectedProject(selected)
7273
}
7374

src/components/app/types.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,6 @@ import { APP_TYPE } from '@Config/constants'
3232
import { CreateAppFormStateType } from '@Pages/App/CreateAppModal/types'
3333
import { CDMaterialProps } from './details/triggerView/types'
3434

35-
export interface NumberOptionType {
36-
label: string
37-
value: number
38-
}
39-
4035
interface CDModalProps {
4136
cdPipelineId?: number
4237
triggerType?: string

src/components/v2/values/chartValuesDiff/ProjectUpdateModal.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ import {
2424
SelectPicker,
2525
ComponentSizeType,
2626
InfoBlock,
27+
OptionType,
2728
} from '@devtron-labs/devtron-fe-common-lib'
2829
import { ReactComponent as Close } from '../../assets/icons/ic-close.svg'
2930
import { ProjectSelectorTypes } from './ChartValuesView.type'
3031
import { updateHelmAppProject } from '../../../charts/charts.service'
3132
import { ProjectChangeMessageList } from './constant'
32-
import { NumberOptionType } from '@Components/app/types'
3333

3434
export default function ProjectUpdateModal({
3535
appId,
@@ -39,8 +39,8 @@ export default function ProjectUpdateModal({
3939
projectList,
4040
getAppMetaInfoRes,
4141
}: ProjectSelectorTypes) {
42-
const [projectOptions, setProjectOptions] = useState<NumberOptionType[]>([])
43-
const [selectedProject, setSelectedProject] = useState<NumberOptionType>()
42+
const [projectOptions, setProjectOptions] = useState<OptionType<number, string>[]>([])
43+
const [selectedProject, setSelectedProject] = useState<OptionType<number, string>>()
4444
const [isSubmitting, setSubmitting] = useState(false)
4545

4646
useEffect(() => {
@@ -64,7 +64,7 @@ export default function ProjectUpdateModal({
6464
)
6565
}
6666

67-
const handleProjectSelection = (selected: NumberOptionType): void => {
67+
const handleProjectSelection = (selected: OptionType<number, string>): void => {
6868
setSelectedProject(selected)
6969
}
7070

0 commit comments

Comments
 (0)