Skip to content

Commit f7c66a6

Browse files
committed
Merge branch 'develop' of github.com:devtron-labs/devtron-fe-common-lib into feat/masked-secrets
2 parents 8c1cd14 + c2a4b49 commit f7c66a6

File tree

11 files changed

+878
-39
lines changed

11 files changed

+878
-39
lines changed

package-lock.json

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

package.json

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@devtron-labs/devtron-fe-common-lib",
3-
"version": "1.1.8-beta-1",
3+
"version": "1.1.8-beta-2",
44
"description": "Supporting common component library",
55
"type": "module",
66
"main": "dist/index.js",
@@ -35,6 +35,7 @@
3535
},
3636
"devDependencies": {
3737
"@esbuild-plugins/node-globals-polyfill": "0.2.3",
38+
"@laynezh/vite-plugin-lib-assets": "^0.5.26",
3839
"@sentry/browser": "^7.119.1",
3940
"@testing-library/jest-dom": "^5.16.2",
4041
"@testing-library/react": "^12.1.4",
@@ -60,15 +61,15 @@
6061
"husky": "^7.0.4",
6162
"lint-staged": "^12.5.0",
6263
"moment": "^2.29.4",
63-
"monaco-editor": "0.44.0",
64-
"monaco-yaml": "5.1.1",
6564
"prettier": "^3.1.1",
6665
"react-ga4": "^1.4.1",
67-
"react-mde": "^11.5.0",
6866
"react-toastify": "9.1.3",
67+
"sharp": "^0.33.5",
68+
"svgo": "^3.3.2",
6969
"typescript": "5.5.4",
7070
"vite": "5.4.11",
7171
"vite-plugin-dts": "4.0.3",
72+
"vite-plugin-image-optimizer": "^1.1.8",
7273
"vite-plugin-lib-inject-css": "2.1.1",
7374
"vite-plugin-svgr": "^2.4.0",
7475
"vite-tsconfig-paths": "5.0.1"
@@ -79,27 +80,29 @@
7980
"@rjsf/validator-ajv8": "^5.13.3",
8081
"@typeform/embed-react": "2.20.0",
8182
"dompurify": "^3.0.2",
83+
"monaco-editor": "0.44.0",
84+
"monaco-yaml": "5.1.1",
8285
"react": "^17.0.2",
8386
"react-dom": "^17.0.2",
8487
"react-draggable": "^4.4.5",
8588
"react-ga4": "^1.4.1",
8689
"react-mde": "^11.5.0",
90+
"react-monaco-editor": "^0.54.0",
8791
"react-router-dom": "^5.3.0",
8892
"react-select": "5.8.0",
8993
"rxjs": "^7.8.1",
9094
"yaml": "^2.4.1"
9195
},
9296
"dependencies": {
9397
"@types/react-dates": "^21.8.6",
94-
"marked": "^13.0.3",
9598
"ansi_up": "^5.2.1",
9699
"dayjs": "^1.11.13",
97100
"fast-json-patch": "^3.1.1",
98101
"framer-motion": "^6.5.1",
99102
"jsonpath-plus": "^10.0.0",
103+
"marked": "^13.0.3",
100104
"react-dates": "^21.8.0",
101105
"react-diff-viewer-continued": "^3.4.0",
102-
"react-monaco-editor": "^0.54.0",
103106
"sass": "^1.69.7",
104107
"tslib": "2.7.0"
105108
},

src/Common/Api.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,9 @@ function fetchInTime<T = object>(
204204
options.abortControllerRef.current = new AbortController()
205205
}
206206

207+
// Note: This is not catered in case abortControllerRef is passed since
208+
// the API is rejected with abort signal from line 202
209+
// FIXME: Remove once signal is removed
207210
reject({
208211
code: 408,
209212
errors: [{ code: 408, internalMessage: 'Request cancelled', userMessage: 'Request Cancelled' }],
@@ -224,6 +227,7 @@ function fetchInTime<T = object>(
224227
if (err instanceof ServerErrors) {
225228
throw err
226229
} else {
230+
// FIXME: Can be removed once signal is removed
227231
throw new ServerErrors({
228232
code: 408,
229233
errors: [

src/Common/Constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,7 @@ export const API_STATUS_CODES = {
512512
UNAUTHORIZED: 401,
513513
PERMISSION_DENIED: 403,
514514
NOT_FOUND: 404,
515+
REQUEST_TIMEOUT: 408,
515516
EXPECTATION_FAILED: 417,
516517
UNPROCESSABLE_ENTITY: 422,
517518
LOCKED: 423,

src/Common/Helper.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ import regexIcon from '@Icons/ic-regex.svg'
4949
import pullRequest from '@Icons/ic-pull-request.svg'
5050
import tagIcon from '@Icons/ic-tag.svg'
5151
import { SourceTypeMap } from '@Common/Common.service'
52+
import { getIsRequestAborted } from './Api'
5253

5354
export function showError(serverError, showToastOnUnknownError = true, hideAccessError = false) {
5455
if (serverError instanceof ServerErrors && Array.isArray(serverError.errors)) {
@@ -71,7 +72,7 @@ export function showError(serverError, showToastOnUnknownError = true, hideAcces
7172
}
7273
})
7374
} else {
74-
if (serverError.code !== 403 && serverError.code !== 408) {
75+
if (serverError.code !== 403 && serverError.code !== 408 && !getIsRequestAborted(serverError)) {
7576
Sentry.captureException(serverError)
7677
}
7778

src/Common/Modals/VisibleModal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ export class VisibleModal extends React.Component<{
3434
}
3535

3636
escFunction(event) {
37-
stopPropagation(event)
3837
if (event.keyCode === 27 || event.key === 'Escape') {
38+
stopPropagation(event)
3939
if (this.props.onEscape) {
4040
this.props.onEscape(event)
4141
} else if (this.props.close) {

src/Shared/Components/CICDHistory/TriggerOutput.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,14 +166,11 @@ const ProgressingStatus = React.memo(({ status, stage, type }: ProgressingStatus
166166
variant: ToastVariantType.success,
167167
description: 'Build Aborted',
168168
})
169-
setAbortConfirmation(false)
170169
setAbortError({
171170
status: false,
172171
message: '',
173172
})
174173
} catch (error) {
175-
setAborting(false)
176-
setAbortConfirmation(false)
177174
if (error.code === 400) {
178175
// code 400 is for aborting a running build
179176
const { errors } = error
@@ -182,6 +179,9 @@ const ProgressingStatus = React.memo(({ status, stage, type }: ProgressingStatus
182179
message: errors[0].userMessage,
183180
})
184181
}
182+
} finally {
183+
setAborting(false)
184+
setAbortConfirmation(false)
185185
}
186186
}
187187

src/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiffMain.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,11 @@ export const DeploymentConfigDiffMain = ({
194194
<DiffViewer
195195
oldValue={primaryList.codeEditorValue.value}
196196
newValue={secondaryList.codeEditorValue.value}
197-
leftTitle={primaryHeading}
198-
rightTitle={secondaryHeading}
197+
// Need to hide the title since the null state is controlled explicitly
198+
{...(primaryList.codeEditorValue.value !== secondaryList.codeEditorValue.value && {
199+
leftTitle: primaryHeading,
200+
rightTitle: secondaryHeading,
201+
})}
199202
codeFoldMessageRenderer={renderDiffViewNoDifferenceState(
200203
primaryList.codeEditorValue.value,
201204
secondaryList.codeEditorValue.value,

src/Shared/Components/Header/IframePromoButton.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
import { useState, useCallback } from 'react'
12
import { GenericEmptyState, VisibleModal } from '@Common/index'
23
import { ComponentSizeType } from '@Shared/constants'
3-
import { useState, useCallback } from 'react'
4+
import ReactGA from 'react-ga4'
45
import { ReactComponent as Close } from '@Icons/ic-close.svg'
56
import { Button, ButtonStyleType, ButtonVariantType } from '../Button'
67

@@ -13,7 +14,13 @@ export const IframePromoButton = () => {
1314
FEATURE_PROMO_EMBEDDED_IFRAME_URL,
1415
} = window._env_
1516

16-
const onClickShowIframeModal = useCallback(() => setEmbeddedIframeModal(true), [])
17+
const onClickShowIframeModal = useCallback(() => {
18+
setEmbeddedIframeModal(true)
19+
ReactGA.event({
20+
category: 'PRIMARY_HEADER',
21+
action: 'HEADER_IFRAME_BUTTON_CLICKED',
22+
})
23+
}, [])
1724
const onClickCloseIframeModal = useCallback(() => setEmbeddedIframeModal(false), [])
1825

1926
const renderIframeDrawer = () => (

src/index.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ export interface customEnv {
1919
SENTRY_ERROR_ENABLED?: boolean
2020
SENTRY_PERFORMANCE_ENABLED?: boolean
2121
SENTRY_DSN?: string
22+
/**
23+
* Release version for sentry
24+
*
25+
* @default 'dashboard@${SHORT_GIT_HASH}'
26+
*/
27+
SENTRY_RELEASE_VERSION?: string
2228
SENTRY_TRACES_SAMPLE_RATE?: number
2329
HOTJAR_ENABLED?: boolean
2430
CLUSTER_NAME?: boolean

0 commit comments

Comments
 (0)