Skip to content

Commit 571c500

Browse files
committed
chore: replace react-router imports with react-router-dom
1 parent 7ef87b1 commit 571c500

35 files changed

+94
-87
lines changed

src/Common/Api.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,4 +263,4 @@ export const abortPreviousRequests = <T>(
263263
*/
264264
export const getIsRequestAborted = (error) =>
265265
// The 0 code is common for aborted and blocked requests
266-
error && error.code === 0 && error.message.search('abort\|aborted')
266+
error && error.code === 0 && error.message.search('abort|aborted')

src/Common/AppStatus/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@
1515
*/
1616

1717
export { default as AppStatus } from './AppStatus'
18-
export * from './utils'
18+
export * from './utils'

src/Common/AppStatus/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
import { TIMELINE_STATUS } from "../../Shared/constants"
17+
import { TIMELINE_STATUS } from '../../Shared/constants'
1818

1919
export const triggerStatus = (triggerDetailStatus: string): string => {
2020
const triggerStatus = triggerDetailStatus?.toUpperCase()

src/Common/ClipboardButton/ClipboardButton.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,14 @@ export default function ClipboardButton({
4242
const [copied, setCopied] = useState<boolean>(false)
4343
const [enableTippy, setEnableTippy] = useState<boolean>(false)
4444

45-
const handleTextCopied = () => {setCopied(true)}
45+
const handleTextCopied = () => {
46+
setCopied(true)
47+
}
4648
const handleEnableTippy = () => setEnableTippy(true)
4749
const handleDisableTippy = () => setEnableTippy(false)
4850
const handleCopyContent = useCallback(
4951
(e?) => {
50-
if(e) stopPropagation(e)
52+
if (e) stopPropagation(e)
5153
copyToClipboard(content, handleTextCopied)
5254
},
5355
[content],

src/Common/CodeEditor/CodeEditor.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ function useCodeEditorContext() {
7373
* Thus as a hack we are using this objects reference to call the latest onChange reference
7474
*/
7575
const _onChange = {
76-
onChange: null
76+
onChange: null,
7777
}
7878

7979
const CodeEditor: React.FC<CodeEditorInterface> & CodeEditorComposition = React.memo(

src/Common/Common.service.ts

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,13 @@ export function setImageTags(request, pipelineId: number, artifactId: number) {
8080
return post(`${ROUTES.IMAGE_TAGGING}/${pipelineId}/${artifactId}`, request)
8181
}
8282

83-
const cdMaterialListModal = (artifacts: any[], offset: number, artifactId?: number, artifactStatus?: string, disableDefaultSelection?: boolean) => {
83+
const cdMaterialListModal = (
84+
artifacts: any[],
85+
offset: number,
86+
artifactId?: number,
87+
artifactStatus?: string,
88+
disableDefaultSelection?: boolean,
89+
) => {
8490
if (!artifacts || !artifacts.length) return []
8591

8692
const markFirstSelected = offset === 0
@@ -346,9 +352,7 @@ export function fetchChartTemplateVersions() {
346352
return get(`${ROUTES.DEPLOYMENT_TEMPLATE_LIST}?appId=-1&envId=-1`)
347353
}
348354

349-
export const getDefaultConfig = (): Promise<ResponseType> => {
350-
return get(`${ROUTES.NOTIFIER}/channel/config`)
351-
}
355+
export const getDefaultConfig = (): Promise<ResponseType> => get(`${ROUTES.NOTIFIER}/channel/config`)
352356

353357
export function getEnvironmentListMinPublic(includeAllowedDeploymentTypes?: boolean) {
354358
return get(
@@ -361,13 +365,12 @@ export function getClusterListMin() {
361365
return get(URL)
362366
}
363367

364-
export const getResourceGroupListRaw = (clusterId: string): Promise<ResponseType<ApiResourceType>> => {
365-
return get(`${ROUTES.API_RESOURCE}/${ROUTES.GVK}/${clusterId}`)
366-
}
368+
export const getResourceGroupListRaw = (clusterId: string): Promise<ResponseType<ApiResourceType>> =>
369+
get(`${ROUTES.API_RESOURCE}/${ROUTES.GVK}/${clusterId}`)
367370

368371
export function getNamespaceListMin(clusterIdsCsv: string): Promise<EnvironmentListHelmResponse> {
369-
const URL = `${ROUTES.NAMESPACE}/autocomplete?ids=${clusterIdsCsv}`
370-
return get(URL)
372+
const URL = `${ROUTES.NAMESPACE}/autocomplete?ids=${clusterIdsCsv}`
373+
return get(URL)
371374
}
372375
export function getWebhookEventsForEventId(eventId: string | number) {
373376
const URL = `${ROUTES.GIT_HOST_EVENT}/${eventId}`

src/Common/CustomInput/CustomInput.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,9 @@ export const CustomInput = ({
135135

136136
{getInputError()}
137137
{helperText && (
138-
<div className="flex left top dc__gap-4 fs-11 lh-16 cn-7">
139-
<Info className="icon-dim-16" />
140-
<div>{helperText}</div>
138+
<div className="flex left top dc__gap-4 fs-11 lh-16 cn-7">
139+
<Info className="icon-dim-16" />
140+
<div>{helperText}</div>
141141
</div>
142142
)}
143143
</div>

src/Common/DraggableWrapper/DraggableWrapper.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export default function DraggableWrapper({
3434
parentRef,
3535
boundaryGap = 16,
3636
childDivProps = {},
37-
layoutFixDelta = 0
37+
layoutFixDelta = 0,
3838
}: DraggableWrapperProps) {
3939
const windowSize = useWindowSize()
4040
const nodeRef = useRef<HTMLDivElement>(null)

src/Common/EmptyState/GenericEmptyState.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,7 @@ const GenericEmptyState = ({
8484
>
8585
<div className="flex column dc__gap-8">
8686
<h4 className="title fw-6 cn-9 mt-0 mb-0 lh-24 dc__align-center">{title}</h4>
87-
{subTitle && (
88-
<p className={`subtitle ${isRowLayout ? 'subtitle--text-start' : ''}`}>
89-
{subTitle}
90-
</p>
91-
)}
87+
{subTitle && <p className={`subtitle ${isRowLayout ? 'subtitle--text-start' : ''}`}>{subTitle}</p>}
9288
</div>
9389
{isButtonAvailable && renderButton()}
9490
{children}

src/Common/ErrorPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
import { useHistory } from 'react-router'
17+
import { useHistory } from 'react-router-dom'
1818
import { ERROR_STATUS_CODE, ERROR_EMPTY_SCREEN, ROUTES } from './Constants'
1919
import GenericEmptyState from './EmptyState/GenericEmptyState'
2020
import { ErrorPageType } from './Types'

0 commit comments

Comments
 (0)