Skip to content

Commit b754de5

Browse files
committed
feat: remove central api from local storage
1 parent a5adaf5 commit b754de5

File tree

5 files changed

+4
-49
lines changed

5 files changed

+4
-49
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@devtron-labs/devtron-fe-common-lib",
3-
"version": "1.10.0-patch-5",
3+
"version": "1.10.0-patch-6",
44
"description": "Supporting common component library",
55
"type": "module",
66
"main": "dist/index.js",

src/Shared/Helpers.tsx

Lines changed: 1 addition & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ import {
5151
import {
5252
AggregationKeys,
5353
BorderConfigType,
54-
CentralAPILocalConfig,
5554
GitTriggers,
5655
IntersectionChangeHandler,
5756
IntersectionOptions,
@@ -61,12 +60,7 @@ import {
6160
TargetPlatformsDTO,
6261
WebhookEventNameType,
6362
} from './types'
64-
import {
65-
CENTRAL_API_LOCAL_STORAGE_KEY,
66-
DEPLOYMENT_STATUS,
67-
TIMELINE_STATUS,
68-
UNSAVED_CHANGES_PROMPT_MESSAGE,
69-
} from './constants'
63+
import { DEPLOYMENT_STATUS, TIMELINE_STATUS, UNSAVED_CHANGES_PROMPT_MESSAGE } from './constants'
7064
import {
7165
AggregatedNodes,
7266
DeploymentStatusDetailsBreakdownDataType,
@@ -1076,34 +1070,3 @@ export const getClassNameForStickyHeaderWithShadow = (isStuck: boolean, topClass
10761070
export const clearCookieOnLogout = () => {
10771071
document.cookie = `${TOKEN_COOKIE_NAME}=; expires=Thu, 01-Jan-1970 00:00:01 GMT;path=/`
10781072
}
1079-
1080-
export const getCentralAPIHealthObjectFromLocalStorage = (): CentralAPILocalConfig => {
1081-
try {
1082-
const localStorageString = localStorage.getItem(CENTRAL_API_LOCAL_STORAGE_KEY)
1083-
const healthObj: CentralAPILocalConfig = JSON.parse(localStorageString)
1084-
1085-
const { lastUpdatedDate, isConnected, updateCount } = healthObj
1086-
1087-
return {
1088-
lastUpdatedDate: lastUpdatedDate || '',
1089-
updateCount: updateCount || 0,
1090-
isConnected: isConnected || false,
1091-
}
1092-
} catch {
1093-
localStorage.removeItem(CENTRAL_API_LOCAL_STORAGE_KEY)
1094-
return {
1095-
lastUpdatedDate: '',
1096-
updateCount: 0,
1097-
isConnected: false,
1098-
}
1099-
}
1100-
}
1101-
1102-
/**
1103-
*
1104-
* @returns null if we do not know yet
1105-
*/
1106-
export const getCentralAPIHealthFromLocalStorage = (): boolean | null => {
1107-
const healthObject = getCentralAPIHealthObjectFromLocalStorage()
1108-
return healthObject.isConnected
1109-
}

src/Shared/constants.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,4 @@ export const Routes = {
536536

537537
export const ENTERPRISE_SUPPORT_LINK = 'enterprise@devtron.ai'
538538

539-
export const CENTRAL_API_LOCAL_STORAGE_KEY = 'central-api-connection-config'
540-
541539
export const INVALID_LICENSE_KEY = 'inValid'

src/Shared/types.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1097,12 +1097,6 @@ export type DevtronLicenseDTO<isCentralDashboard extends boolean = false> = Devt
10971097

10981098
export type CountryISO2Type = ParsedCountry['iso2']
10991099

1100-
export interface CentralAPILocalConfig {
1101-
lastUpdatedDate: string // date on which local storage is updated
1102-
isConnected: boolean | null // true/false acc to connection, null for first time
1103-
updateCount: number // number of times it has been updated, max 3
1104-
}
1105-
11061100
export enum ResponseHeaders {
11071101
LICENSE_STATUS = 'X-License-Status',
11081102
}

0 commit comments

Comments
 (0)