Skip to content

Commit b44314a

Browse files
committed
chore: version bump
2 parents 2093099 + 29d438d commit b44314a

File tree

9 files changed

+51
-42
lines changed

9 files changed

+51
-42
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.6.10-beta-1",
3+
"version": "1.6.12-beta-1",
44
"description": "Supporting common component library",
55
"type": "module",
66
"main": "dist/index.js",

src/Common/CodeEditor/CodeEditor.components.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export const Header = ({ children, className, hideDefaultSplitHeader }: CodeEdit
4343

4444
export const Warning = ({ className, text, children }: CodeEditorStatusBarProps) => (
4545
<div
46-
className={`code-editor__warning fs-12 fw-4 lh-16 cn-9 py-8 px-16 bcy-1 bw-1 ey-2 dc__height-auto ${className || ''}`}
46+
className={`code-editor__warning fs-12 fw-4 lh-16 cn-9 py-8 px-16 bcy-1 dc__border-bottom-y2 dc__height-auto ${className || ''}`}
4747
>
4848
<ICWarningY5 className="code-editor__status-info-icon" />
4949
{text}
@@ -52,7 +52,7 @@ export const Warning = ({ className, text, children }: CodeEditorStatusBarProps)
5252
)
5353

5454
export const ErrorBar = ({ className, text, children }: CodeEditorStatusBarProps) => (
55-
<div className={`code-editor__error fs-12 fw-4 lh-16 py-8 px-16 dc__border-bottom bco-1 co-5 ${className || ''}`}>
55+
<div className={`code-editor__error fs-12 fw-4 lh-16 py-8 px-16 bco-1 co-5 dc__border-bottom ${className || ''}`}>
5656
<ErrorIcon className="code-editor__status-info-icon" />
5757
{text}
5858
{children}
@@ -61,7 +61,7 @@ export const ErrorBar = ({ className, text, children }: CodeEditorStatusBarProps
6161

6262
export const Information = ({ className, children, text }: CodeEditorStatusBarProps) => (
6363
<div
64-
className={`code-editor__information fs-12 fw-4 lh-16 cn-9 dc__height-auto py-8 px-16 dc__border-bottom bcb-1 ${className || ''}`}
64+
className={`code-editor__information fs-12 fw-4 lh-16 cn-9 py-8 px-16 bcb-1 dc__border-bottom dc__height-auto ${className || ''}`}
6565
>
6666
<Info className="code-editor__status-info-icon" />
6767
{text}

src/Common/CodeEditor/Extensions/yamlParseLinter.ts

Lines changed: 35 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -8,34 +8,44 @@ export const yamlParseLinter =
88
const diagnostics: Diagnostic[] = []
99
const text = view.state.doc.toString()
1010

11-
// Parse YAML
12-
const documents = YAML.parseAllDocuments(text)
11+
try {
12+
// Parse YAML
13+
const documents = YAML.parseAllDocuments(text)
1314

14-
// Handle YAML parse errors
15-
documents.forEach(({ errors }) => {
16-
errors.forEach((err) => {
17-
if (err instanceof YAMLParseError) {
18-
const { linePos = [], message } = err
19-
const { from } = view.state.doc.line(linePos[0]?.line || 0)
15+
// Handle YAML parse errors
16+
documents.forEach(({ errors }) => {
17+
errors.forEach((err) => {
18+
if (err instanceof YAMLParseError) {
19+
const { linePos = [], message } = err
20+
const { from } = view.state.doc.line(linePos[0]?.line || 0)
2021

21-
diagnostics.push({
22-
from,
23-
to: from + (linePos[0]?.col || 0),
24-
message: message.replace(/\n+/g, '\n'),
25-
severity: 'error',
26-
source: err.name,
27-
})
28-
} else {
29-
diagnostics.push({
30-
from: 0,
31-
to: text.length,
32-
message: err instanceof Error ? err.message : 'Unknown error',
33-
severity: 'error',
34-
source: err.name,
35-
})
36-
}
22+
diagnostics.push({
23+
from,
24+
to: Math.min(from + (linePos[0]?.col || 0), text.length),
25+
message: message.replace(/\n+/g, '\n'),
26+
severity: 'error',
27+
source: err.name,
28+
})
29+
} else {
30+
diagnostics.push({
31+
from: 0,
32+
to: text.length,
33+
message: err instanceof Error ? err.message : 'Unknown error',
34+
severity: 'error',
35+
source: err.name,
36+
})
37+
}
38+
})
3739
})
38-
})
40+
} catch (err) {
41+
diagnostics.push({
42+
from: 0,
43+
to: text.length,
44+
message: err instanceof Error ? err.message : 'Yaml lint failed',
45+
severity: 'error',
46+
source: err.name,
47+
})
48+
}
3949

4050
return diagnostics
4151
}

src/Shared/Components/CMCS/ConfigMapSecretReadyOnly.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ const ConfigMapSecretReadyOnly = ({
5050
<div
5151
className={
5252
containerClassName ||
53-
`bg__primary flex-grow-1 flexbox-col dc__gap-12 dc__overflow-auto ${!hideCodeEditor ? 'p-16' : ''}`
53+
`bg__primary flexbox-col dc__gap-12 dc__overflow-auto ${!hideCodeEditor ? 'p-16' : ''}`
5454
}
5555
>
5656
{hasHashiOrAWS(configMapSecretData?.externalType) && renderHashiOrAwsDeprecatedInfo()}

src/Shared/Components/GettingStartedCard/GettingStarted.tsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,20 @@ import './gettingStarted.scss'
2424
import { Button, ButtonStyleType, ButtonVariantType } from '../Button'
2525

2626
const GettingStartedCard = ({ className, hideGettingStartedCard }: GettingStartedType) => {
27-
const onClickedOkay = async (e) => {
27+
const onClickedOkay = async () => {
2828
setActionWithExpiry('clickedOkay', 1)
2929
hideGettingStartedCard()
30-
await handlePostHogEventUpdate(e)
30+
await handlePostHogEventUpdate(POSTHOG_EVENT_ONBOARDING.TOOLTIP_OKAY)
3131
}
3232

33-
const onClickedDontShowAgain = async (e) => {
33+
const onClickedDontShowAgain = async () => {
3434
const updatedPayload = {
3535
key: LOGIN_COUNT,
3636
value: `${MAX_LOGIN_COUNT}`,
3737
}
3838
await updateLoginCount(updatedPayload)
3939
hideGettingStartedCard(updatedPayload.value)
40-
await handlePostHogEventUpdate(e)
40+
await handlePostHogEventUpdate(POSTHOG_EVENT_ONBOARDING.TOOLTIP_DONT_SHOW_AGAIN)
4141
}
4242

4343
return (
@@ -53,15 +53,13 @@ const GettingStartedCard = ({ className, hideGettingStartedCard }: GettingStarte
5353
size={ComponentSizeType.xs}
5454
dataTestId="getting-started-okay"
5555
onClick={onClickedOkay}
56-
data-posthog={POSTHOG_EVENT_ONBOARDING.TOOLTIP_OKAY}
5756
/>
5857
<Button
5958
text="Don't show again"
6059
size={ComponentSizeType.xs}
6160
dataTestId="getting-started-don't-show-again"
6261
onClick={onClickedDontShowAgain}
6362
style={ButtonStyleType.neutral}
64-
data-posthog={POSTHOG_EVENT_ONBOARDING.TOOLTIP_DONT_SHOW_AGAIN}
6563
variant={ButtonVariantType.secondary}
6664
/>
6765
</div>

src/Shared/Components/Header/PageHeader.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ const PageHeader = ({
100100
hideGettingStartedCard()
101101
}
102102

103-
const onClickHelp = async (e) => {
103+
const onClickHelp = async () => {
104104
if (
105105
!window._env_.K8S_CLIENT &&
106106
currentServerInfo.serverInfo?.installationType !== InstallationType.ENTERPRISE
@@ -113,7 +113,7 @@ const PageHeader = ({
113113
}
114114
setActionWithExpiry('clickedOkay', 1)
115115
hideGettingStartedCard()
116-
await handlePostHogEventUpdate(e, POSTHOG_EVENT_ONBOARDING.HELP)
116+
await handlePostHogEventUpdate(POSTHOG_EVENT_ONBOARDING.HELP)
117117
ReactGA.event({
118118
category: 'Main Navigation',
119119
action: `Help Clicked`,

src/Shared/Components/Header/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@
1616

1717
export { default as PageHeader } from './PageHeader'
1818
export * from './HeaderWithCreateButton'
19+
export * from './utils'

src/Shared/Components/Header/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ import { LOGIN_COUNT } from '../../../Common'
2020
const millisecondsInDay = 86400000
2121
export const getDateInMilliseconds = (days) => 1 + new Date().valueOf() + (days ?? 0) * millisecondsInDay
2222

23-
export const handlePostHogEventUpdate = async (e, eventName?: string): Promise<void> => {
23+
export const handlePostHogEventUpdate = async (eventName: string): Promise<void> => {
2424
const payload = {
25-
eventType: eventName || e.target?.dataset.posthog,
25+
eventType: eventName,
2626
key: LOGIN_COUNT,
2727
value: '',
2828
active: true,

0 commit comments

Comments
 (0)