Skip to content

Commit ca8efcb

Browse files
authored
Merge pull request #388 from devtron-labs/feat/kubecon-lock-manifest
feat: lock config for k8s manifest (KubeCon 2024)
2 parents f5edc56 + 8efbd07 commit ca8efcb

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
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": "0.6.0-patch-1-beta-10",
3+
"version": "0.6.2-beta-8",
44
"description": "Supporting common component library",
55
"type": "module",
66
"main": "dist/index.js",

src/Common/Helper.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import React, { SyntheticEvent, useCallback, useEffect, useMemo, useRef, useState } from 'react'
1818
import DOMPurify from 'dompurify'
1919
import { JSONPath, JSONPathOptions } from 'jsonpath-plus'
20-
import { compare as compareJSON, applyPatch } from 'fast-json-patch'
20+
import { compare as compareJSON, applyPatch, unescapePathComponent } from 'fast-json-patch'
2121
import { components } from 'react-select'
2222
import * as Sentry from '@sentry/browser'
2323
import moment from 'moment'
@@ -595,7 +595,7 @@ const buildObjectFromPathTokens = (index: number, tokens: string[], value: any)
595595
const isKeyNumber = !Number.isNaN(numberKey)
596596
return isKeyNumber
597597
? [...Array(numberKey).fill(null), buildObjectFromPathTokens(index + 1, tokens, value)]
598-
: { [key]: buildObjectFromPathTokens(index + 1, tokens, value) }
598+
: { [unescapePathComponent(key)]: buildObjectFromPathTokens(index + 1, tokens, value) }
599599
}
600600

601601
/**
@@ -644,10 +644,7 @@ export const powerSetOfSubstringsFromStart = (strings: string[], regex: RegExp)
644644
})
645645

646646
export const convertJSONPointerToJSONPath = (pointer: string) =>
647-
pointer
648-
.replace(/\/([\*0-9]+)\//g, '[$1].')
649-
.replace(/\//g, '.')
650-
.replace(/\./, '$.')
647+
unescapePathComponent(pointer.replace(/\/([\*0-9]+)\//g, '[$1].').replace(/\//g, '.').replace(/\./, '$.'))
651648

652649
export const flatMapOfJSONPaths = (
653650
paths: string[],

0 commit comments

Comments
 (0)