Skip to content

Commit eb12992

Browse files
committed
Merge remote-tracking branch 'origin/main' into dependabot/npm_and_yarn/react-router-dom-7.9.3
2 parents d664a27 + 0375983 commit eb12992

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/pages/secrets/create-edit/SecretCreateEditPage.tsx

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,23 @@ export default function SecretCreateEditPage({
115115
}, [isDirty])
116116

117117
// If we have a sealedSecretName, we are converting the data to the form format
118-
const formData = cloneDeep(data) as SealedSecretFormData
118+
/**
119+
* temporary workaround for wrong data shape send by API
120+
* REF: APL-1333
121+
*/
122+
const formData = cloneDeep(data) as any
123+
119124
if (!isEmpty(data)) {
125+
// hoist template.metadata -> metadata
126+
formData.metadata = {
127+
...(formData.metadata ?? {}),
128+
...(formData.template?.metadata ?? {}),
129+
}
130+
120131
formData.encryptedData = mapObjectToKeyValueArray(formData?.encryptedData as Record<string, string>)
132+
121133
formData.metadata.annotations = mapObjectToKeyValueArray(formData?.metadata?.annotations as Record<string, string>)
134+
122135
formData.metadata.labels = mapObjectToKeyValueArray(formData?.metadata?.labels as Record<string, string>)
123136
}
124137

0 commit comments

Comments
 (0)