@@ -20,6 +20,7 @@ import { deepEqual, noop, YAMLStringify } from '@Common/Helper'
20
20
21
21
import { ManifestTemplateDTO } from '@Pages/Applications'
22
22
import {
23
+ CMSecretExternalType ,
23
24
ConfigMapSecretDataConfigDatumDTO ,
24
25
ConfigMapSecretDataDTO ,
25
26
ConfigResourceType ,
@@ -326,6 +327,25 @@ const getDiffState = (compareToValue: DeploymentHistoryDetail, compareWithValue:
326
327
return DeploymentConfigDiffState . NO_DIFF
327
328
}
328
329
330
+ const getCMSecretHistoryDataForDiffState = (
331
+ configMapSecretData : ConfigMapSecretDataConfigDatumDTO ,
332
+ historyData : DeploymentHistoryDetail ,
333
+ ) => {
334
+ // CHECKING FOR EXTERNAL CM/CS
335
+ if (
336
+ configMapSecretData &&
337
+ configMapSecretData . external &&
338
+ ( configMapSecretData . externalType === '' ||
339
+ configMapSecretData . externalType === CMSecretExternalType . KubernetesSecret )
340
+ ) {
341
+ const historyDataWhenExternal = structuredClone ( historyData )
342
+ historyDataWhenExternal . codeEditorValue . value = 'external'
343
+ return historyDataWhenExternal
344
+ }
345
+
346
+ return historyData
347
+ }
348
+
329
349
/**
330
350
* Prepares the data for displaying the diff view between two configuration items.
331
351
*
@@ -378,7 +398,10 @@ const getDiffViewData = (
378
398
return {
379
399
compareToDiff,
380
400
compareWithDiff,
381
- diffState : getDiffState ( compareToDiff , compareWithDiff ) ,
401
+ diffState : getDiffState (
402
+ getCMSecretHistoryDataForDiffState ( compareTo , compareToDiff ) ,
403
+ getCMSecretHistoryDataForDiffState ( compareWith , compareWithDiff ) ,
404
+ ) ,
382
405
}
383
406
}
384
407
0 commit comments