@@ -68,11 +68,6 @@ const EditLifecycleConfiguration = ({
6868 const [ expiredObjectDM , setExpiredObjectDM ] = useState < boolean > ( false ) ;
6969 const [ NCExpirationDays , setNCExpirationDays ] = useState < string > ( "0" ) ;
7070 const [ NCTransitionDays , setNCTransitionDays ] = useState < string > ( "0" ) ;
71-
72- const [ newerNCExpirationVersions , setNewerNCExpirationVersions ] =
73- useState < string > ( "0" ) ;
74- const [ newerNCTransitionVersions , setNewerNCTransitionVersions ] =
75- useState < string > ( "0" ) ;
7671 const [ ilmType , setIlmType ] = useState < "transition" | "expiry" > ( "expiry" ) ;
7772 const [ expiryDays , setExpiryDays ] = useState < string > ( "0" ) ;
7873 const [ transitionDays , setTransitionDays ] = useState < string > ( "0" ) ;
@@ -138,14 +133,6 @@ const EditLifecycleConfiguration = ({
138133 setIlmType ( "transition" ) ;
139134 transitionMode = true ;
140135 }
141- if (
142- lifecycleRule . transition . newer_noncurrent_transition_versions &&
143- lifecycleRule . transition . newer_noncurrent_transition_versions > 0
144- ) {
145- setNewerNCTransitionVersions (
146- lifecycleRule . transition . newer_noncurrent_transition_versions . toString ( ) ,
147- ) ;
148- }
149136 if (
150137 lifecycleRule . transition . noncurrent_transition_days &&
151138 lifecycleRule . transition . noncurrent_transition_days !== 0
@@ -186,14 +173,7 @@ const EditLifecycleConfiguration = ({
186173 setIlmType ( "expiry" ) ;
187174 transitionMode = false ;
188175 }
189- if (
190- lifecycleRule . expiration . newer_noncurrent_expiration_versions &&
191- lifecycleRule . expiration . newer_noncurrent_expiration_versions > 0
192- ) {
193- setNewerNCExpirationVersions (
194- lifecycleRule . expiration . newer_noncurrent_expiration_versions . toString ( ) ,
195- ) ;
196- }
176+
197177 // Fallback to old rules by date
198178 if (
199179 lifecycleRule . expiration . date &&
@@ -260,11 +240,7 @@ const EditLifecycleConfiguration = ({
260240 expiry [ "noncurrentversion_expiration_days" ] =
261241 parseInt ( NCExpirationDays ) ;
262242 }
263- if ( lifecycleRule . expiration ?. newer_noncurrent_expiration_versions ) {
264- expiry [ "newer_noncurrent_expiration_versions" ] = parseInt (
265- newerNCExpirationVersions ,
266- ) ;
267- }
243+
268244 rules = {
269245 ...expiry ,
270246 } ;
@@ -407,38 +383,18 @@ const EditLifecycleConfiguration = ({
407383 ) }
408384
409385 { ilmType === "expiry" &&
410- ( lifecycleRule . expiration ?. noncurrent_expiration_days ||
411- lifecycleRule . expiration
412- ?. newer_noncurrent_expiration_versions ) && (
413- < Fragment >
414- { lifecycleRule . expiration ?. noncurrent_expiration_days && (
415- < InputBox
416- type = "number"
417- id = "noncurrentversion_expiration_days"
418- name = "noncurrentversion_expiration_days"
419- onChange = { ( e : React . ChangeEvent < HTMLInputElement > ) => {
420- setNCExpirationDays ( e . target . value ) ;
421- } }
422- label = "Non-current Expiration Days"
423- value = { NCExpirationDays }
424- min = "0"
425- />
426- ) }
427- { lifecycleRule . expiration
428- ?. newer_noncurrent_expiration_versions && (
429- < InputBox
430- type = "number"
431- id = "newer_noncurrentversion_expiration_versions"
432- name = "newer_noncurrentversion_expiration_versions"
433- onChange = { ( e : React . ChangeEvent < HTMLInputElement > ) => {
434- setNewerNCExpirationVersions ( e . target . value ) ;
435- } }
436- label = "Non-current Expiration Versions"
437- value = { newerNCExpirationVersions }
438- min = "0"
439- />
440- ) }
441- </ Fragment >
386+ lifecycleRule . expiration ?. noncurrent_expiration_days && (
387+ < InputBox
388+ type = "number"
389+ id = "noncurrentversion_expiration_days"
390+ name = "noncurrentversion_expiration_days"
391+ onChange = { ( e : React . ChangeEvent < HTMLInputElement > ) => {
392+ setNCExpirationDays ( e . target . value ) ;
393+ } }
394+ label = "Non-current Expiration Days"
395+ value = { NCExpirationDays }
396+ min = "0"
397+ />
442398 ) }
443399 { ilmType === "transition" && lifecycleRule . transition ?. days && (
444400 < Fragment >
@@ -467,37 +423,19 @@ const EditLifecycleConfiguration = ({
467423 ) }
468424
469425 { ilmType === "transition" &&
470- ( lifecycleRule . transition ?. noncurrent_transition_days ||
471- lifecycleRule . transition
472- ?. newer_noncurrent_transition_versions ) && (
426+ lifecycleRule . transition ?. noncurrent_transition_days && (
473427 < Fragment >
474- { lifecycleRule . transition ?. noncurrent_transition_days && (
475- < InputBox
476- type = "number"
477- id = "noncurrentversion_transition_days"
478- name = "noncurrentversion_transition_days"
479- onChange = { ( e : React . ChangeEvent < HTMLInputElement > ) => {
480- setNCTransitionDays ( e . target . value ) ;
481- } }
482- label = "Non-current Transition Days"
483- value = { NCTransitionDays }
484- min = "0"
485- />
486- ) }
487- { lifecycleRule . transition
488- ?. newer_noncurrent_transition_versions && (
489- < InputBox
490- type = "number"
491- id = "newer_noncurrentversion_transition_versions"
492- name = "newer_noncurrentversion_transition_versions"
493- onChange = { ( e : React . ChangeEvent < HTMLInputElement > ) => {
494- setNewerNCTransitionVersions ( e . target . value ) ;
495- } }
496- label = "Non-current Transition Versions"
497- value = { newerNCTransitionVersions }
498- min = "0"
499- />
500- ) }
428+ < InputBox
429+ type = "number"
430+ id = "noncurrentversion_transition_days"
431+ name = "noncurrentversion_transition_days"
432+ onChange = { ( e : React . ChangeEvent < HTMLInputElement > ) => {
433+ setNCTransitionDays ( e . target . value ) ;
434+ } }
435+ label = "Non-current Transition Days"
436+ value = { NCTransitionDays }
437+ min = "0"
438+ />
501439 < InputBox
502440 id = "noncurrentversion_t_SC"
503441 name = "noncurrentversion_t_SC"
0 commit comments