Skip to content

Commit f462038

Browse files
committed
revert: json validation for gui schema editor
1 parent 9433bb6 commit f462038

File tree

4 files changed

+53
-65
lines changed

4 files changed

+53
-65
lines changed

package-lock.json

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

package.json

Lines changed: 4 additions & 4 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.2.5-beta-3",
3+
"version": "1.2.5-beta-7",
44
"description": "Supporting common component library",
55
"type": "module",
66
"main": "dist/index.js",
@@ -66,6 +66,8 @@
6666
"react-toastify": "9.1.3",
6767
"sharp": "^0.33.5",
6868
"svgo": "^3.3.2",
69+
"monaco-editor": "0.44.0",
70+
"monaco-yaml": "5.1.1",
6971
"typescript": "5.5.4",
7072
"vite": "5.4.11",
7173
"vite-plugin-dts": "4.0.3",
@@ -80,14 +82,11 @@
8082
"@rjsf/validator-ajv8": "^5.13.3",
8183
"@typeform/embed-react": "2.20.0",
8284
"dompurify": "^3.0.2",
83-
"monaco-editor": "0.44.0",
84-
"monaco-yaml": "5.1.1",
8585
"react": "^17.0.2",
8686
"react-dom": "^17.0.2",
8787
"react-draggable": "^4.4.5",
8888
"react-ga4": "^1.4.1",
8989
"react-mde": "^11.5.0",
90-
"react-monaco-editor": "^0.54.0",
9190
"react-router-dom": "^5.3.0",
9291
"react-select": "5.8.0",
9392
"rxjs": "^7.8.1",
@@ -102,6 +101,7 @@
102101
"jsonpath-plus": "^10.0.0",
103102
"marked": "^13.0.3",
104103
"react-dates": "^21.8.0",
104+
"react-monaco-editor": "^0.54.0",
105105
"react-diff-viewer-continued": "^3.4.0",
106106
"sass": "^1.69.7",
107107
"tslib": "2.7.0"

src/Shared/Components/InvalidYAMLTippy/utils.tsx

Lines changed: 26 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,32 @@ import { DEFAULT_INVALID_YAML_ERROR } from './constants'
33
import { InvalidYAMLTippyWrapperProps } from './types'
44

55
export const getInvalidTippyContent = ({
6+
type = 'yaml',
67
parsingError,
78
restoreLastSavedYAML,
8-
}: Pick<InvalidYAMLTippyWrapperProps, 'parsingError' | 'restoreLastSavedYAML'>) => (
9-
<div className="flexbox-col dc__gap-8 py-6">
10-
<div className="flexbox-col dc__gap-4">
11-
<h6 className="m-0 fs-12 fw-6 lh-18">Invalid YAML</h6>
12-
<p className="m-0 cn-50 fs-12 fw-4 lh-18 dc__truncate--clamp-3">
13-
{parsingError || DEFAULT_INVALID_YAML_ERROR}
14-
</p>
15-
</div>
9+
}: Pick<InvalidYAMLTippyWrapperProps, 'parsingError' | 'restoreLastSavedYAML'> & { type?: 'yaml' | 'json' }) => {
10+
const text = type.toUpperCase()
11+
12+
return (
13+
<div className="flexbox-col dc__gap-8 py-6">
14+
<div className="flexbox-col dc__gap-4">
15+
<h6 className="m-0 fs-12 fw-6 lh-18">Invalid {text}</h6>
16+
<p className="m-0 cn-50 fs-12 fw-4 lh-18 dc__truncate--clamp-3">
17+
{parsingError || DEFAULT_INVALID_YAML_ERROR}
18+
</p>
19+
</div>
1620

17-
{restoreLastSavedYAML && (
18-
<button
19-
type="button"
20-
data-testid="restore-last-saved-yaml"
21-
className="flexbox dc__gap-6 dc__transparent cn-0 fs-12 fw-6 lh-20 p-0 dc__align-items-center"
22-
onClick={restoreLastSavedYAML}
23-
>
24-
<ICArrowCounterClockwise className="dc__no-shrink icon-dim-16 scn-0" />
25-
Restore last saved YAML
26-
</button>
27-
)}
28-
</div>
29-
)
21+
{restoreLastSavedYAML && (
22+
<button
23+
type="button"
24+
data-testid="restore-last-saved-yaml"
25+
className="flexbox dc__gap-6 dc__transparent cn-0 fs-12 fw-6 lh-20 p-0 dc__align-items-center"
26+
onClick={restoreLastSavedYAML}
27+
>
28+
<ICArrowCounterClockwise className="dc__no-shrink icon-dim-16 scn-0" />
29+
Restore last saved {text}
30+
</button>
31+
)}
32+
</div>
33+
)
34+
}

src/yaml.worker.ts

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)