Skip to content

Commit

Permalink
fix(RHINENG-8899): Update Staleness conditionals (#2170)
Browse files Browse the repository at this point in the history
  • Loading branch information
adonispuente authored Apr 3, 2024
1 parent 63bd361 commit d995090
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/components/InventoryHostStaleness/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export const conditionalDropdownError = (newFormValues, dropdownItems) => {
let formValue = newFormValues[apiKey];

if (apiKey === 'conventional_time_to_stale') {
if (formValue > newFormValues['conventional_time_to_stale_warning']) {
if (formValue >= newFormValues['conventional_time_to_stale_warning']) {
return (
<p
className="pf-v5-u-font-size-sm pf-v5-u-danger-color-100"
Expand All @@ -81,7 +81,7 @@ export const conditionalDropdownError = (newFormValues, dropdownItems) => {
}
}
if (apiKey === 'conventional_time_to_stale_warning') {
if (formValue > newFormValues['conventional_time_to_delete']) {
if (formValue >= newFormValues['conventional_time_to_delete']) {
return (
<p
className="pf-v5-u-font-size-sm pf-v5-u-danger-color-100"
Expand Down Expand Up @@ -136,7 +136,7 @@ export const conditionalDropdownError = (newFormValues, dropdownItems) => {
}

if (apiKey === 'immutable_time_to_stale') {
if (formValue > newFormValues['immutable_time_to_stale_warning']) {
if (formValue >= newFormValues['immutable_time_to_stale_warning']) {
return (
<p
className="pf-v5-u-font-size-sm pf-v5-u-danger-color-100"
Expand All @@ -163,7 +163,7 @@ export const conditionalDropdownError = (newFormValues, dropdownItems) => {
}
}
if (apiKey === 'immutable_time_to_stale_warning') {
if (formValue > newFormValues['immutable_time_to_delete']) {
if (formValue >= newFormValues['immutable_time_to_delete']) {
return (
<p
className="pf-v5-u-font-size-sm pf-v5-u-danger-color-100 "
Expand Down Expand Up @@ -558,28 +558,28 @@ export const formValidation = async (newFormValues, setIsFormValid) => {

if (
apiKey === 'conventional_time_to_stale' &&
formValue > newFormValues['conventional_time_to_stale_warning']
formValue >= newFormValues['conventional_time_to_stale_warning']
) {
setIsFormValid(false);
break;
}
if (
apiKey === 'immutable_time_to_stale' &&
formValue > newFormValues['immutable_time_to_stale_warning']
formValue >= newFormValues['immutable_time_to_stale_warning']
) {
setIsFormValid(false);
break;
}
if (
apiKey === 'conventional_time_to_stale_warning' &&
formValue > newFormValues['conventional_time_to_delete']
formValue >= newFormValues['conventional_time_to_delete']
) {
setIsFormValid(false);
break;
}
if (
apiKey === 'immutable_time_to_stale_warning' &&
formValue > newFormValues['immutable_time_to_delete']
formValue >= newFormValues['immutable_time_to_delete']
) {
setIsFormValid(false);
break;
Expand Down

0 comments on commit d995090

Please sign in to comment.