Skip to content

Commit

Permalink
refactor: remove unused imports & ? checks
Browse files Browse the repository at this point in the history
  • Loading branch information
Elessar1802 committed Mar 1, 2024
1 parent 471fc53 commit 8d27d9f
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,7 @@ export default function EnvTriggerView({ filteredAppIds, isVirtualEnv }: AppGrou
setDefaultConfig(_isDefaultConfig)
setConfigPresent(isConfigPresent)
})
.catch((error) => {
showError(error)
})
.catch()
}

const preserveSelection = (_workflows: WorkflowType[]) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,8 @@ export default function DeploymentTemplateOverrideForm({
: await api(+appId, +envId, payload)
if (deploymentTemplateResp.result?.isLockConfigError && !saveEligibleChanges) {
// checking if any locked changes and opening drawer to show eligible and locked ones
setLockedOverride(deploymentTemplateResp.result?.lockedOverride)
setDisableSaveEligibleChanges(deploymentTemplateResp.result?.disableSaveEligibleChanges)
setLockedOverride(deploymentTemplateResp.result.lockedOverride)
setDisableSaveEligibleChanges(deploymentTemplateResp.result.disableSaveEligibleChanges)
handleLockedDiffDrawer(true)
return
}
Expand All @@ -242,10 +242,10 @@ export default function DeploymentTemplateOverrideForm({

if (envOverrideValuesWithBasic) {
editorOnChange(YAML.stringify(envOverrideValuesWithBasic, { indent: 2 }), true)
} else {
} else if (deploymentTemplateResp.result?.envOverrideValues) {
dispatch({
type: DeploymentConfigStateActionTypes.tempFormData,
payload: YAML.stringify(deploymentTemplateResp.result?.envOverrideValues),
payload: YAML.stringify(deploymentTemplateResp.result.envOverrideValues),
})
}
toast.success(
Expand Down
4 changes: 1 addition & 3 deletions src/components/app/details/appDetails/AppDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -334,9 +334,7 @@ export const Details: React.FC<DetailsType> = ({
}
},
)
.catch((error) => {
showError(error)
})
.catch()
},
[
params.appId,
Expand Down
8 changes: 2 additions & 6 deletions src/components/app/details/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,7 @@ export default function AppDetailsPage({ isV2 }: AppDetailsProps) {
_groupFilterOption.sort(sortOptionsByLabel)
setGroupFilterOptions(_groupFilterOption)
}
} catch (error) {
showError(error)
}
} catch {}
setAppListLoading(false)
}

Expand All @@ -132,9 +130,7 @@ export default function AppDetailsPage({ isV2 }: AppDetailsProps) {
.sort(sortOptionsByLabel),
)
}
} catch (error) {
showError(error)
}
} catch {}
setAppListLoading(false)
}

Expand Down
4 changes: 1 addition & 3 deletions src/components/app/details/triggerView/TriggerView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,7 @@ class TriggerView extends Component<TriggerViewProps, TriggerViewState> {
const _isDefaultConfig = response.result.is_default_configured
this.setState({ configs: isConfigPresent, isDefaultConfigPresent: _isDefaultConfig })
})
.catch((error) => {
showError(error)
})
.catch()
}

getWorkflows = (isFromOnMount?: boolean) => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/helpers/Helpers.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useState, useEffect, useCallback, useRef, useMemo, RefObject, useLayoutEffect } from 'react'
import React, { useState, useEffect, useCallback, useRef, useMemo } from 'react'
import {
showError,
useThrottledEffect,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export default function DeploymentConfigFormCTA({
const deploymentTemplateResp = await checkForProtectedLockedChanges()
if (deploymentTemplateResp.result?.isLockConfigError) {
setShowLockedDiffForApproval(true)
setLockedOverride(deploymentTemplateResp.result?.lockedOverride)
setLockedOverride(deploymentTemplateResp.result.lockedOverride)
handleLockedDiffDrawer(true)
} else {
setShowLockedDiffForApproval(false)
Expand Down
4 changes: 1 addition & 3 deletions src/components/login/Login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,7 @@ export default class Login extends Component<LoginProps, LoginFormState> {
loginList: list,
})
})
.catch(error => {
showError(error)
})
.catch()
if (typeof Storage !== 'undefined') {
if (localStorage.isDashboardAccessed) {
return
Expand Down
6 changes: 2 additions & 4 deletions src/components/v2/appDetails/AppDetails.component.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useEffect, useRef, useState } from 'react'
import './appDetails.scss'
import { useLocation, useParams } from 'react-router'
import { DeploymentAppTypes, Progressing, showError } from '@devtron-labs/devtron-fe-common-lib'
import { DeploymentAppTypes, Progressing } from '@devtron-labs/devtron-fe-common-lib'
import { AppDetailsComponentType, AppType } from './appDetails.type'
import IndexStore from './index.store'
import EnvironmentStatusComponent from './sourceInfo/environmentStatus/EnvironmentStatus.component'
Expand Down Expand Up @@ -105,9 +105,7 @@ const AppDetailsComponent = ({
}
},
)
.catch((error) => {
showError(error)
})
.catch()
}

const processDeploymentStatusData = (deploymentStatusDetailRes: DeploymentStatusDetailsType): void => {
Expand Down

0 comments on commit 8d27d9f

Please sign in to comment.