From 64d5891f5742267016b38f4a95a304385af0e283 Mon Sep 17 00:00:00 2001 From: Benjamin Perez Date: Tue, 11 Apr 2023 14:40:08 -0600 Subject: [PATCH] Added Object Version read-only field in Edit Lifecycle Modal Signed-off-by: Benjamin Perez --- .../EditLifecycleConfiguration.tsx | 50 +++++++++++++++---- 1 file changed, 39 insertions(+), 11 deletions(-) diff --git a/portal-ui/src/screens/Console/Buckets/BucketDetails/EditLifecycleConfiguration.tsx b/portal-ui/src/screens/Console/Buckets/BucketDetails/EditLifecycleConfiguration.tsx index d7914aaf3e..68d9d850a6 100644 --- a/portal-ui/src/screens/Console/Buckets/BucketDetails/EditLifecycleConfiguration.tsx +++ b/portal-ui/src/screens/Console/Buckets/BucketDetails/EditLifecycleConfiguration.tsx @@ -310,6 +310,24 @@ const EditLifecycleConfiguration = ({ } }; + let objectVersion = ""; + + if (lifecycleRule.expiration) { + if (lifecycleRule.expiration.days > 0) { + objectVersion = "Current Version"; + } else if (lifecycleRule.expiration.noncurrent_expiration_days) { + objectVersion = "Non-Current Version"; + } + } + + if (lifecycleRule.transition) { + if (lifecycleRule.transition.days > 0) { + objectVersion = "Current Version"; + } else if (lifecycleRule.transition.noncurrent_transition_days) { + objectVersion = "Non-Current Version"; + } + } + return ( { @@ -329,17 +347,7 @@ const EditLifecycleConfiguration = ({ - - {}} - disabled - /> - - + + + {}} + disabled + /> + + + {}} + disabled + /> + {ilmType === "expiry" && lifecycleRule.expiration?.days && (