diff --git a/src/components/InventoryHostStaleness/__test__/InventoryHostStaleness.test.js b/src/components/InventoryHostStaleness/__test__/InventoryHostStaleness.test.js index 5ac82d066..aaf340c5c 100644 --- a/src/components/InventoryHostStaleness/__test__/InventoryHostStaleness.test.js +++ b/src/components/InventoryHostStaleness/__test__/InventoryHostStaleness.test.js @@ -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', }; diff --git a/src/components/InventoryHostStaleness/constants.js b/src/components/InventoryHostStaleness/constants.js index ac79bb272..425e9fe6d 100644 --- a/src/components/InventoryHostStaleness/constants.js +++ b/src/components/InventoryHostStaleness/constants.js @@ -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) => { @@ -67,7 +67,7 @@ export const conditionalDropdownError = (newFormValues, dropdownItems) => { Staleness must be before stale warning
); - } else if (formValue > newFormValues['conventional_time_to_deletion']) { + } else if (formValue > newFormValues['conventional_time_to_delete']) { return ({ } } if (apiKey === 'conventional_time_to_stale_warning') { - if (formValue > newFormValues['conventional_time_to_deletion']) { + if (formValue > newFormValues['conventional_time_to_delete']) { return (
{ ); } } - if (apiKey === 'conventional_time_to_deletion') { + if (apiKey === 'conventional_time_to_delete') { if (formValue < newFormValues['conventional_time_to_stale_warning']) { return (
{ Staleness must be before stale warning
); - } else if (formValue > newFormValues['immutable_time_to_deletion']) { + } else if (formValue > newFormValues['immutable_time_to_delete']) { return ({ } } if (apiKey === 'immutable_time_to_stale_warning') { - if (formValue > newFormValues['immutable_time_to_deletion']) { + if (formValue > newFormValues['immutable_time_to_delete']) { return (
{ ); } } - if (apiKey === 'immutable_time_to_deletion') { + if (apiKey === 'immutable_time_to_delete') { if (formValue < newFormValues['immutable_time_to_stale_warning']) { return (
{ 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.', @@ -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', }, ]; }; @@ -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;