Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

System "removal" instead of "deletion" #2195

Merged
merged 1 commit into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 deletes currently observed system.
Callback function that is fired when user removes currently observed system.

## showDelete

*boolean*

Toggle to display delete button for removing system from inventory DB.
Toggle to display remove 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 delete button.
React element to be rendered as wrapper for rendering remove button.

## ActionsWrapper

Expand Down
1 change: 1 addition & 0 deletions src/Utilities/DeleteModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ const DeleteModal = ({
<Button
variant="danger"
ouiaId="confirm-inventory-delete"
data-testid="confirm-inventory-delete"
onClick={onConfirm}
>
Remove
Expand Down
2 changes: 2 additions & 0 deletions src/Utilities/__snapshots__/DeleteModal.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ 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 @@ -402,6 +403,7 @@ 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"
>
Delete
Remove
</Button>
) : (
<Tooltip content={NO_MODIFY_HOST_TOOLTIP_MESSAGE}>
<Button isAriaDisabled variant="secondary">
Delete
Remove
</Button>
</Tooltip>
)}
Expand Down Expand Up @@ -174,7 +174,7 @@ const TopBar = ({
addNotification({
id: 'remove-initiated',
variant: 'warning',
title: 'Delete operation initiated',
title: 'Remove 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 delete button by default', () => {
it('shows remove button by default', () => {
render(
<TestWrapper>
<TopBar entity={entity} loaded showDelete />
Expand All @@ -102,12 +102,12 @@ describe('TopBar', () => {

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

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

expect(
screen.getByRole('button', {
name: /delete/i,
name: /remove/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 deletion', async () => {
it('can cancel the removal', 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 deletion
Organization level system staleness and removal
<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
deletion may impact your systems. Some systems may be deleted as a result.`}
removal may impact your systems. Some systems may be removed 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 deletion
Staleness must be before removal
</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 deletion
Stale warning must be before removal
</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' }}
>
Deletion must be after staleness
Removal 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' }}
>
Deletion must be after stale warning
Removal 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 deletion
Staleness must be before removal
</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 deletion
Stale warning must be before removal
</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' }}
>
Deletion must be after staleness
Removal 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' }}
>
Deletion must be after stale warning
Removal 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 deleted after 2 years since last check-in.
- Systems are removed 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 deleted after 14 days since last check-in.
- Systems are removed 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 deleted.
marked as stale, stale warning, and be removed.
</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 deleted after 14 days since last check-in.
- Systems are removed 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 deleted after 2 years since last check-in.
- Systems are removed 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 deleted 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 removed 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 deletion',
title: 'System removal',
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.',
'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.',
},
{
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}
>
Delete
Remove
</ActionButton>
);
};
Expand Down Expand Up @@ -266,7 +266,7 @@ const ConventionalSystemsTab = ({
addNotificationAction({
id: 'remove-initiated',
variant: 'warning',
title: 'Delete operation initiated',
title: 'Remove 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: /delete/i,
name: /remove/i,
})
).toBeEnabled();

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

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

await userEvent.click(
screen.getByRole('button', {
name: /delete/i,
name: /remove/i,
})
);
expect(
screen.getByRole('heading', {
name: /remove from inventory/i,
})
).toBeVisible();
await userEvent.click(
screen.getByRole('button', {
name: /remove/i,
})
);
await userEvent.click(screen.getByTestId('confirm-inventory-delete'));
expect(
screen.queryByRole('heading', {
name: /remove from inventory/i,
Expand All @@ -207,7 +203,7 @@ describe('ConventionalSystemsTab', () => {
description: `Removal of ${system1.display_name} started.`,
dismissable: false,
id: 'remove-initiated',
title: 'Delete operation initiated',
title: 'Remove 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}
>
Delete
Remove
</ActionDropdownItem>
),
},
Expand Down
Loading