Skip to content

Commit

Permalink
update api keys to the merged BE PR
Browse files Browse the repository at this point in the history
  • Loading branch information
adonispuente committed Dec 11, 2023
1 parent b8421e2 commit 2cc5e53
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ describe('Table Renders', () => {
const stalenessData = {
conventional_time_to_stale: 86400,
conventional_time_to_stale_warning: 604800,
conventional_time_to_deletion: 1209600,
conventional_time_to_delete: 1209600,
immutable_time_to_stale: 172800,
immutable_time_to_stale_warning: 1290600,
immutable_time_to_deletion: 15552000,
immutable_time_to_delete: 15552000,
id: 'system_default',
};

Expand Down
62 changes: 31 additions & 31 deletions src/components/InventoryHostStaleness/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,16 @@ export const daysToSecondsConversion = (days, filterKey) => {
export const hostStalenessApiKeys = [
'conventional_time_to_stale',
'conventional_time_to_stale_warning',
'conventional_time_to_deletion',
'conventional_time_to_delete',
'immutable_time_to_stale',
'immutable_time_to_stale_warning',
'immutable_time_to_deletion',
'immutable_time_to_delete',
];

export const conventionalApiKeys = [
'conventional_time_to_stale',
'conventional_time_to_stale_warning',
'conventional_time_to_deletion',
'conventional_time_to_delete',
];

export const conditionalDropdownError = (newFormValues, dropdownItems) => {
Expand All @@ -67,7 +67,7 @@ export const conditionalDropdownError = (newFormValues, dropdownItems) => {
Staleness must be before stale warning
</p>
);
} else if (formValue > newFormValues['conventional_time_to_deletion']) {
} else if (formValue > newFormValues['conventional_time_to_delete']) {
return (
<p
className="pf-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_deletion']) {
if (formValue > newFormValues['conventional_time_to_delete']) {
return (
<p
className="pf-u-font-size-sm pf-v5-u-danger-color-100"
Expand All @@ -107,7 +107,7 @@ export const conditionalDropdownError = (newFormValues, dropdownItems) => {
);
}
}
if (apiKey === 'conventional_time_to_deletion') {
if (apiKey === 'conventional_time_to_delete') {
if (formValue < newFormValues['conventional_time_to_stale_warning']) {
return (
<p
Expand Down Expand Up @@ -145,7 +145,7 @@ export const conditionalDropdownError = (newFormValues, dropdownItems) => {
Staleness must be before stale warning
</p>
);
} else if (formValue > newFormValues['immutable_time_to_deletion']) {
} else if (formValue > newFormValues['immutable_time_to_delete']) {
return (
<p
className="pf-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_deletion']) {
if (formValue > newFormValues['immutable_time_to_delete']) {
return (
<p
className="pf-u-font-size-sm pf-v5-u-danger-color-100 "
Expand All @@ -189,7 +189,7 @@ export const conditionalDropdownError = (newFormValues, dropdownItems) => {
);
}
}
if (apiKey === 'immutable_time_to_deletion') {
if (apiKey === 'immutable_time_to_delete') {
if (formValue < newFormValues['immutable_time_to_stale_warning']) {
return (
<p
Expand Down Expand Up @@ -479,8 +479,8 @@ export const systemDeletionItems = (activeTabKey) => {
name: '14 days',
value: 14,
apiKey: activeTabKey
? 'immutable_time_to_deletion'
: 'conventional_time_to_deletion',
? 'immutable_time_to_delete'
: 'conventional_time_to_delete',
title: 'System deletion',
modalMessage:
'This is the time at which your system will be deleted from your inventory. Once your system is deleted, it will have to be re-registered to be added back to your inventory.',
Expand All @@ -489,64 +489,64 @@ export const systemDeletionItems = (activeTabKey) => {
name: '21 days',
value: 21,
apiKey: activeTabKey
? 'immutable_time_to_deletion'
: 'conventional_time_to_deletion',
? 'immutable_time_to_delete'
: 'conventional_time_to_delete',
},
{
name: '30 days',
value: 30,
apiKey: activeTabKey
? 'immutable_time_to_deletion'
: 'conventional_time_to_deletion',
? 'immutable_time_to_delete'
: 'conventional_time_to_delete',
},
{
name: '60 days',
value: 60,
apiKey: activeTabKey
? 'immutable_time_to_deletion'
: 'conventional_time_to_deletion',
? 'immutable_time_to_delete'
: 'conventional_time_to_delete',
},
{
name: '90 days',
value: 90,
apiKey: activeTabKey
? 'immutable_time_to_deletion'
: 'conventional_time_to_deletion',
? 'immutable_time_to_delete'
: 'conventional_time_to_delete',
},
{
name: '120 days',
value: 120,
apiKey: activeTabKey
? 'immutable_time_to_deletion'
: 'conventional_time_to_deletion',
? 'immutable_time_to_delete'
: 'conventional_time_to_delete',
},
{
name: '150 days',
value: 150,
apiKey: activeTabKey
? 'immutable_time_to_deletion'
: 'conventional_time_to_deletion',
? 'immutable_time_to_delete'
: 'conventional_time_to_delete',
},
{
name: '180 days',
value: 180,
apiKey: activeTabKey
? 'immutable_time_to_deletion'
: 'conventional_time_to_deletion',
? 'immutable_time_to_delete'
: 'conventional_time_to_delete',
},
{
name: '1 year',
value: 365,
apiKey: activeTabKey
? 'immutable_time_to_deletion'
: 'conventional_time_to_deletion',
? 'immutable_time_to_delete'
: 'conventional_time_to_delete',
},
{
name: '2 years',
value: 730,
apiKey: activeTabKey
? 'immutable_time_to_deletion'
: 'conventional_time_to_deletion',
? 'immutable_time_to_delete'
: 'conventional_time_to_delete',
},
];
};
Expand All @@ -572,14 +572,14 @@ export const formValidation = async (newFormValues, setIsFormValid) => {
}
if (
apiKey === 'conventional_time_to_stale_warning' &&
formValue > newFormValues['conventional_time_to_deletion']
formValue > newFormValues['conventional_time_to_delete']
) {
setIsFormValid(false);
break;
}
if (
apiKey === 'immutable_time_to_stale_warning' &&
formValue > newFormValues['immutable_time_to_deletion']
formValue > newFormValues['immutable_time_to_delete']
) {
setIsFormValid(false);
break;
Expand Down

0 comments on commit 2cc5e53

Please sign in to comment.