Skip to content

Commit 0d8193f

Browse files
Merge branch 'main' into fixes/dependency-add-ga
2 parents db9d33f + bd24067 commit 0d8193f

File tree

13 files changed

+501
-453
lines changed

13 files changed

+501
-453
lines changed

src/components/charts/list/ChartListPopUp.tsx

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useContext, useState } from 'react'
1+
import React, { useState } from 'react'
22
import { ChartListPopUpType } from '../charts.types'
33
import {
44
showError,
@@ -16,15 +16,14 @@ import { toast } from 'react-toastify'
1616
import { EMPTY_STATE_STATUS, TOAST_INFO } from '../../../config/constantMessaging'
1717
import { reSyncChartRepo } from '../../chartRepo/chartRepo.service'
1818
import { ReactComponent as Help } from '../../../assets/icons/ic-help.svg'
19-
import { NavLink, useHistory } from 'react-router-dom'
20-
import { SERVER_MODE, URLS } from '../../../config'
19+
import { NavLink } from 'react-router-dom'
20+
import { URLS } from '../../../config'
2121
import { ReactComponent as Add } from '../../../assets/icons/ic-add.svg'
2222
import EmptyFolder from '../../../assets/img/Empty-folder.png'
2323
import NoResults from '../../../assets/img/[email protected]'
2424
import AddChartSource from './AddChartSource'
2525
import ChartListPopUpRow from './ChartListPopUpRow'
2626
import { ReactComponent as SyncIcon } from '../../../assets/icons/ic-arrows_clockwise.svg'
27-
import { mainContext } from '../../common/navigation/NavigationRoutes'
2827

2928
function ChartListPopUp({
3029
onClose,
@@ -34,13 +33,11 @@ function ChartListPopUp({
3433
setFilteredChartList,
3534
setShowSourcePopoUp,
3635
}: ChartListPopUpType) {
37-
const { serverMode } = useContext(mainContext)
3836
const [searchApplied, setSearchApplied] = useState<boolean>(false)
3937
const [searchText, setSearchText] = useState<string>('')
4038
const [fetching, setFetching] = useState<boolean>(false)
4139
const [showAddPopUp, setShowAddPopUp] = useState<boolean>(false)
4240
const isEmpty = chartList.length && !filteredChartList.length
43-
const history = useHistory()
4441

4542
const setStore = (event): void => {
4643
setSearchText(event.target.value)
@@ -60,20 +57,12 @@ function ChartListPopUp({
6057
setShowAddPopUp(!showAddPopUp)
6158
}
6259

63-
const onClickAddSource = (e) => {
64-
if (serverMode === SERVER_MODE.EA_ONLY) {
65-
history.push(URLS.GLOBAL_CONFIG_CHART)
66-
} else {
67-
toggleAddPopUp(e)
68-
}
69-
}
70-
7160
const renderChartListHeaders = () => {
7261
return (
7362
<div className="pt-12 pb-12 pl-16 flex dc__content-space dc__border-bottom fw-6">
7463
<span>Helm chart sources</span>
7564
<div className="flex">
76-
<div className="flex cb-5 fw-6 cursor mr-12" onClick={onClickAddSource}>
65+
<div className="flex cb-5 fw-6 cursor mr-12" onClick={toggleAddPopUp}>
7766
<Add className="icon-dim-20 fcb-5 mr-8" />
7867
Add
7968
</div>

src/components/common/Accordian/Accordian.tsx

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,20 @@
1-
import React, { useContext, useState } from 'react'
1+
import React, { useState } from 'react'
22
import { ReactComponent as Dropdown } from '../../../assets/icons/ic-chevron-down.svg'
33
import { CHECKBOX_VALUE, Checkbox } from '@devtron-labs/devtron-fe-common-lib'
44
import { ReactComponent as AddIcon } from '../../../assets/icons/ic-add.svg'
55
import AddChartSource from '../../charts/list/AddChartSource'
6-
import { mainContext } from '../../common/navigation/NavigationRoutes'
7-
import { SERVER_MODE, URLS } from '../../../config'
8-
import { useHistory } from 'react-router-dom'
96

107
export function Accordian({ header, options, value, onChange, onClickViewChartButton,dataTestId }) {
11-
const { serverMode } = useContext(mainContext)
128
const [collapsed, setCollapse] = useState<boolean>(true)
139
const [showAddSource, toggleAddSource] = useState<boolean>(false)
1410
const toggleDropdown = (): void => {
1511
setCollapse(!collapsed)
1612
}
17-
const history = useHistory()
1813

1914
const handleTogleAddSource = () => {
2015
toggleAddSource(!showAddSource)
2116
}
2217

23-
const onClickAddSource = (e) => {
24-
if (serverMode === SERVER_MODE.EA_ONLY) {
25-
history.push(URLS.GLOBAL_CONFIG_CHART)
26-
} else {
27-
handleTogleAddSource()
28-
}
29-
}
30-
3118
return (
3219
<div>
3320
<div
@@ -47,7 +34,7 @@ export function Accordian({ header, options, value, onChange, onClickViewChartBu
4734
<button
4835
type="button"
4936
className="dc__position-rel dc__transparent dc__hover-n50 cursor flex left cb-5 fs-13 fw-6 lh-20 h-32 pl-10 w-100"
50-
onClick={onClickAddSource}
37+
onClick={handleTogleAddSource}
5138
>
5239
<AddIcon className="icon-dim-16 fcb-5 mr-8" />
5340
Add chart source

src/components/deploymentConfig/DeploymentTemplateView/DeploymentTemplateEditorView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ export default function DeploymentTemplateEditorView({
339339
<div className="code-editor__header flex left w-100 p-0-imp">
340340
<div className="flex left fs-12 fw-6 cn-9 dc__border-right h-32 pl-12 pr-12">
341341
<span className="fw-n" style={{ width: '85px' }}>
342-
Compare with:{' '}
342+
Compare with:
343343
</span>
344344
<CompareWithDropdown
345345
envId={envId}

0 commit comments

Comments
 (0)