Skip to content

Commit

Permalink
fix(ESSNTL-5612): Update Staleness & Deletion Keys + Route Protection (
Browse files Browse the repository at this point in the history
…#2114)

* fix(ESSNTL-5612): Update Staleness & Deletion Keys

* fix(RHINENG-5860): Add feature flag for staleness route

* fix(ESSNTL-5612): Update Staleness & Deletion Keys
  • Loading branch information
adonispuente authored Dec 13, 2023
1 parent 5871f3a commit aff72b5
Show file tree
Hide file tree
Showing 3 changed files with 103 additions and 95 deletions.
10 changes: 9 additions & 1 deletion src/Routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { getSearchParams } from './constants';
import RenderWrapper from './Utilities/Wrapper';
import useFeatureFlag from './Utilities/useFeatureFlag';
import { Bullseye, Spinner } from '@patternfly/react-core';
import LostPage from './components/LostPage';
import AsyncComponent from '@redhat-cloud-services/frontend-components/AsyncComponent';
import ErrorState from '@redhat-cloud-services/frontend-components/ErrorState';
import { inventoryHasEdgeSystems } from './Utilities/edge';
Expand Down Expand Up @@ -52,6 +53,9 @@ export const Routes = () => {
const edgeParityInventoryListEnabled = useFeatureFlag(
'edgeParity.inventory-list'
);

const stalenessAndDeletionEnabled = useFeatureFlag('hbi.custom-staleness');

useEffect(() => {
try {
(async () => {
Expand Down Expand Up @@ -103,7 +107,11 @@ export const Routes = () => {
},
{
path: '/staleness-and-deletion',
element: <InventoryHostStaleness />,
element: stalenessAndDeletionEnabled ? (
<InventoryHostStaleness />
) : (
<LostPage />
),
},
]);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ import { instance } from '@redhat-cloud-services/frontend-components-utilities/i
describe('Table Renders', () => {
const mock = new MockAdapter(instance);
const stalenessData = {
conventional_staleness_delta: 86400,
conventional_stale_warning_delta: 604800,
conventional_culling_delta: 1209600,
immutable_staleness_delta: 172800,
immutable_stale_warning_delta: 1290600,
immutable_culling_delta: 15552000,
conventional_time_to_stale: 86400,
conventional_time_to_stale_warning: 604800,
conventional_time_to_delete: 1209600,
immutable_time_to_stale: 172800,
immutable_time_to_stale_warning: 1290600,
immutable_time_to_delete: 15552000,
id: 'system_default',
};

Expand Down
Loading

0 comments on commit aff72b5

Please sign in to comment.