Skip to content

Commit

Permalink
Revert "fix(RHINENG-5276): System "removal" instead of "deletion" (#2195
Browse files Browse the repository at this point in the history
)"

This reverts commit 08db5df.
  • Loading branch information
leSamo committed May 16, 2024
1 parent 08db5df commit 73f754b
Show file tree
Hide file tree
Showing 16 changed files with 65 additions and 68 deletions.
6 changes: 3 additions & 3 deletions doc/props_detail.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,13 @@ Callback function that is fired when user clicks on application tab.

*function*

Callback function that is fired when user removes currently observed system.
Callback function that is fired when user deletes currently observed system.

## showDelete

*boolean*

Toggle to display remove button for removing system from inventory DB.
Toggle to display delete button for removing system from inventory DB.

## appList

Expand Down Expand Up @@ -122,7 +122,7 @@ React element to be rendered as wrapper for tags element value, including tags m

*element*

React element to be rendered as wrapper for rendering remove button.
React element to be rendered as wrapper for rendering delete button.

## ActionsWrapper

Expand Down
1 change: 0 additions & 1 deletion src/Utilities/DeleteModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ const DeleteModal = ({
<Button
variant="danger"
ouiaId="confirm-inventory-delete"
data-testid="confirm-inventory-delete"
onClick={onConfirm}
>
Remove
Expand Down
2 changes: 0 additions & 2 deletions src/Utilities/__snapshots__/DeleteModal.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,6 @@ exports[`DeleteModal DOM should render correctly with multiple systems 1`] = `
data-ouia-component-id="confirm-inventory-delete"
data-ouia-component-type="PF5/Button"
data-ouia-safe="true"
data-testid="confirm-inventory-delete"
type="button"
>
Remove
Expand Down Expand Up @@ -403,7 +402,6 @@ exports[`DeleteModal DOM should render correctly with one system 1`] = `
data-ouia-component-id="confirm-inventory-delete"
data-ouia-component-type="PF5/Button"
data-ouia-safe="true"
data-testid="confirm-inventory-delete"
type="button"
>
Remove
Expand Down
6 changes: 3 additions & 3 deletions src/components/InventoryDetail/TopBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,12 @@ const TopBar = ({
onClick={() => setIsModalOpen(true)}
variant="secondary"
>
Remove
Delete
</Button>
) : (
<Tooltip content={NO_MODIFY_HOST_TOOLTIP_MESSAGE}>
<Button isAriaDisabled variant="secondary">
Remove
Delete
</Button>
</Tooltip>
)}
Expand Down Expand Up @@ -174,7 +174,7 @@ const TopBar = ({
addNotification({
id: 'remove-initiated',
variant: 'warning',
title: 'Remove operation initiated',
title: 'Delete operation initiated',
description: `Removal of ${entity.display_name} started.`,
dismissable: false,
});
Expand Down
8 changes: 4 additions & 4 deletions src/components/InventoryDetail/TopBar.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ describe('TopBar', () => {
).not.toBeInTheDocument();
});

it('shows remove button by default', () => {
it('shows delete button by default', () => {
render(
<TestWrapper>
<TopBar entity={entity} loaded showDelete />
Expand All @@ -102,12 +102,12 @@ describe('TopBar', () => {

expect(
screen.getByRole('button', {
name: /remove/i,
name: /delete/i,
})
).toHaveAttribute('aria-disabled', 'false');
});

it('disables remove button', () => {
it('disables delete button', () => {
render(
<TestWrapper>
<TopBar entity={entity} loaded showDelete={false} />
Expand All @@ -116,7 +116,7 @@ describe('TopBar', () => {

expect(
screen.getByRole('button', {
name: /remove/i,
name: /delete/i,
})
).toHaveAttribute('aria-disabled', 'true');
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ describe('RemoveHostsFromGroupModal', () => {
expect(setIsModalOpen).toBeCalled();
});

it('can cancel the removal', async () => {
it('can cancel the deletion', async () => {
render(
<RemoveHostsFromGroupModal
isModalOpen
Expand Down
4 changes: 2 additions & 2 deletions src/components/InventoryHostStaleness/HostStalenessCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ const HostStalenessCard = ({ canModifyHostStaleness }) => {
<Card id={'HostStalenessCard'}>
<CardHeader>
<Title headingLevel="h4" size="xl" id="HostTitle">
Organization level system staleness and removal
Organization level system staleness and deletion
<InventoryHostStalenessPopover hasEdgeSystems={hasEdgeSystems} />
</Title>
</CardHeader>
Expand Down Expand Up @@ -364,7 +364,7 @@ const HostStalenessCard = ({ canModifyHostStaleness }) => {
ouiaId="BasicModal"
>
{`Changing the organization level setting for system staleness and
removal may impact your systems. Some systems may be removed as a result.`}
deletion may impact your systems. Some systems may be deleted as a result.`}
</Modal>
</Flex>
)}{' '}
Expand Down
32 changes: 16 additions & 16 deletions src/components/InventoryHostStaleness/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export const conditionalDropdownError = (newFormValues, dropdownItems) => {
className="pf-v5-u-font-size-sm pf-v5-u-danger-color-100"
style={{ width: '200px' }}
>
Staleness must be before removal
Staleness must be before deletion
</p>
);
} else {
Expand All @@ -87,7 +87,7 @@ export const conditionalDropdownError = (newFormValues, dropdownItems) => {
className="pf-v5-u-font-size-sm pf-v5-u-danger-color-100"
style={{ width: '200px' }}
>
Stale warning must be before removal
Stale warning must be before deletion
</p>
);
} else if (formValue < newFormValues['conventional_time_to_stale']) {
Expand All @@ -114,7 +114,7 @@ export const conditionalDropdownError = (newFormValues, dropdownItems) => {
className="pf-v5-u-font-size-sm pf-v5-u-danger-color-100"
style={{ width: '200px' }}
>
Removal must be after staleness
Deletion must be after staleness
</p>
);
} else if (formValue < newFormValues['conventional_time_to_stale']) {
Expand All @@ -123,7 +123,7 @@ export const conditionalDropdownError = (newFormValues, dropdownItems) => {
className="pf-v5-u-font-size-sm pf-v5-u-danger-color-100"
style={{ width: '200px' }}
>
Removal must be after stale warning
Deletion must be after stale warning
</p>
);
} else {
Expand Down Expand Up @@ -151,7 +151,7 @@ export const conditionalDropdownError = (newFormValues, dropdownItems) => {
className="pf-v5-u-font-size-sm pf-v5-u-danger-color-100"
style={{ width: '200px' }}
>
Staleness must be before removal
Staleness must be before deletion
</p>
);
} else {
Expand All @@ -169,7 +169,7 @@ export const conditionalDropdownError = (newFormValues, dropdownItems) => {
className="pf-v5-u-font-size-sm pf-v5-u-danger-color-100 "
style={{ width: '200px' }}
>
Stale warning must be before removal
Stale warning must be before deletion
</p>
);
} else if (formValue < newFormValues['immutable_time_to_stale']) {
Expand All @@ -196,7 +196,7 @@ export const conditionalDropdownError = (newFormValues, dropdownItems) => {
className="pf-v5-u-font-size-sm pf-v5-u-danger-color-100"
style={{ width: '200px' }}
>
Removal must be after staleness
Deletion must be after staleness
</p>
);
} else if (formValue < newFormValues['immutable_time_to_stale']) {
Expand All @@ -205,7 +205,7 @@ export const conditionalDropdownError = (newFormValues, dropdownItems) => {
className="pf-v5-u-font-size-sm pf-v5-u-danger-color-100"
style={{ width: '200px' }}
>
Removal must be after stale warning
Deletion must be after stale warning
</p>
);
} else {
Expand Down Expand Up @@ -239,7 +239,7 @@ export const HostStalenessResetDefaultPopover = ({ activeTabKey }) => {
</span>

<span className="pf-v5-u-font-size-sm">
- Systems are removed after 2 years since last check-in.
- Systems are deleted after 2 years since last check-in.
</span>
</Flex>
) : (
Expand All @@ -256,7 +256,7 @@ export const HostStalenessResetDefaultPopover = ({ activeTabKey }) => {
</span>

<span className="pf-v5-u-font-size-sm">
- Systems are removed after 14 days since last check-in.
- Systems are deleted after 14 days since last check-in.
</span>
</Flex>
)
Expand Down Expand Up @@ -286,7 +286,7 @@ export const InventoryHostStalenessPopover = ({ hasEdgeSystems }) => {
<Flex direction={{ default: 'column' }}>
<p className="pf-v5-u-font-size-sm">
Configure the number of days it will take for your systems to be
marked as stale, stale warning, and be removed.
marked as stale, stale warning, and be deleted.
</p>
<Flex
direction={{ default: 'column' }}
Expand All @@ -305,7 +305,7 @@ export const InventoryHostStalenessPopover = ({ hasEdgeSystems }) => {
check-in.
</span>
<span className="pf-v5-u-font-size-sm">
- Systems are removed after 14 days since last check-in.
- Systems are deleted after 14 days since last check-in.
</span>
</Flex>
{hasEdgeSystems && (
Expand All @@ -327,7 +327,7 @@ export const InventoryHostStalenessPopover = ({ hasEdgeSystems }) => {
check-in.
</span>
<span className="pf-v5-u-font-size-sm">
- Systems are removed after 2 years since last check-in.
- Systems are deleted after 2 years since last check-in.
</span>
</Flex>
)}
Expand Down Expand Up @@ -412,7 +412,7 @@ export const systemStalenessWarningItems = (activeTabKey) => {
: 'conventional_time_to_stale_warning',
title: 'System stale warning',
modalMessage:
'A stale warning status on a system indicates that your system has not checked-in in a while, and is at risk of being removed from your inventory.',
'A stale warning status on a system indicates that your system has not checked-in in a while, and is at risk of being deleted from your inventory.',
},
{
name: '14 days',
Expand Down Expand Up @@ -481,9 +481,9 @@ export const systemDeletionItems = (activeTabKey) => {
apiKey: activeTabKey
? 'immutable_time_to_delete'
: 'conventional_time_to_delete',
title: 'System removal',
title: 'System deletion',
modalMessage:
'This is the time at which your system will be removed from your inventory. Once your system is removed, it will have to be re-registered to be added back to your inventory.',
'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.',
},
{
name: '21 days',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const BulkDeleteButton = ({ selectedSystems, ...props }) => {
ouiaId="bulk-delete-button"
{...props}
>
Remove
Delete
</ActionButton>
);
};
Expand Down Expand Up @@ -266,7 +266,7 @@ const ConventionalSystemsTab = ({
addNotificationAction({
id: 'remove-initiated',
variant: 'warning',
title: 'Remove operation initiated',
title: 'Delete operation initiated',
description: `Removal of ${displayName} started.`,
dismissable: false,
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ describe('ConventionalSystemsTab', () => {

expect(
screen.getByRole('button', {
name: /remove/i,
name: /delete/i,
})
).toBeEnabled();

Expand All @@ -164,7 +164,7 @@ describe('ConventionalSystemsTab', () => {
).toBeEnabled();
});

it('can remove items', async () => {
it('can delete items', async () => {
hosts.apiHostDeleteHostById = jest.fn();
const selected = new Map();
selected.set(system1.id, system1);
Expand All @@ -184,15 +184,19 @@ describe('ConventionalSystemsTab', () => {

await userEvent.click(
screen.getByRole('button', {
name: /remove/i,
name: /delete/i,
})
);
expect(
screen.getByRole('heading', {
name: /remove from inventory/i,
})
).toBeVisible();
await userEvent.click(screen.getByTestId('confirm-inventory-delete'));
await userEvent.click(
screen.getByRole('button', {
name: /remove/i,
})
);
expect(
screen.queryByRole('heading', {
name: /remove from inventory/i,
Expand All @@ -203,7 +207,7 @@ describe('ConventionalSystemsTab', () => {
description: `Removal of ${system1.display_name} started.`,
dismissable: false,
id: 'remove-initiated',
title: 'Remove operation initiated',
title: 'Delete operation initiated',
variant: 'warning',
},
type: '@@INSIGHTS-CORE/NOTIFICATIONS/ADD_NOTIFICATION',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const useTableActions = (
]}
noAccessTooltip={NO_MODIFY_HOST_TOOLTIP_MESSAGE}
>
Remove
Delete
</ActionDropdownItem>
),
},
Expand Down
Loading

0 comments on commit 73f754b

Please sign in to comment.