Skip to content

Commit 928eda3

Browse files
committed
adde api changes
1 parent 43a90a4 commit 928eda3

File tree

2 files changed

+6
-21
lines changed

2 files changed

+6
-21
lines changed

src/components/v2/appDetails/k8Resource/nodeDetail/NodeDetail.component.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ function NodeDetailComponent({
117117
},
118118
)
119119
const _resourceContainers = []
120-
if (result?.manifest?.spec) {
120+
if (result?.manifest?.manifestResponse?.spec) {
121121
if (Array.isArray(result.manifest.spec.containers)) {
122122
_resourceContainers.push(
123123
...result.manifest.spec.containers.map((_container) => ({

src/components/v2/appDetails/k8Resource/nodeDetail/NodeDetailTabs/Manifest.component.tsx

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ function ManifestComponent({
5555
const [isResourceMissing, setIsResourceMissing] = useState(false)
5656
const [showInfoText, setShowInfoText] = useState(false)
5757
const [showDecodedData, setShowDecodedData] = useState(false)
58+
const [secretViewAccess, setSecretViewAccess] = useState(false)
5859

5960
useEffect(() => {
6061
selectedTab(NodeDetailTab.MANIFEST, url)
@@ -105,9 +106,9 @@ function ManifestComponent({
105106
])
106107
.then((response) => {
107108
let _manifest: string
108-
109-
_manifest = JSON.stringify(response[0]?.result?.manifest)
110-
setDesiredManifest(response[1]?.result?.manifest || '')
109+
setSecretViewAccess(response[0]?.result?.manifest?.secretViewAccess || false)
110+
_manifest = JSON.stringify(response[0]?.result?.manifest?.manifestResponse)
111+
setDesiredManifest(response[1]?.result?.manifestResponse?.manifest || '')
111112

112113
if (_manifest) {
113114
setManifest(_manifest)
@@ -312,22 +313,6 @@ function ManifestComponent({
312313
}
313314
}
314315

315-
const isDecodeRequired = (): boolean => {
316-
let isDecodedRequired = true
317-
// Don't decode in case of non admin user
318-
const jsonManifestData = YAML.parse(trimedManifestEditorData)
319-
jsonManifestData &&
320-
Object.keys(jsonManifestData[MANIFEST_KEY_FIELDS.DATA])
321-
.map((m) => {
322-
return {
323-
key: m,
324-
value: jsonManifestData[MANIFEST_KEY_FIELDS.DATA][m],
325-
}
326-
})
327-
?.some((m) => {m.value === IS_NON_ADMIN_USER_DATA ? isDecodedRequired = false : isDecodedRequired = true})
328-
return isDecodedRequired
329-
}
330-
331316
const renderShowDecodedValueCheckbox = (codeEditorData) => {
332317
return (
333318
<div className="flex left ml-8">
@@ -461,7 +446,7 @@ function ManifestComponent({
461446
}
462447
className="flex left"
463448
>
464-
{!isEditmode && isDecodeRequired() && renderShowDecodedValueCheckbox(trimedManifestEditorData)}
449+
{!isEditmode && secretViewAccess && renderShowDecodedValueCheckbox(trimedManifestEditorData)}
465450
</CodeEditor.Information>
466451
)}
467452
{activeTab === 'Compare' && (

0 commit comments

Comments
 (0)