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

fix(1657): better name as subject when deleting a flow #1672

Merged
merged 1 commit into from
Dec 3, 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
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ describe('FlowsList.tsx', () => {
});

expect(mockDeleteModalContext.actionConfirmation).toHaveBeenCalledWith({
title: 'Permanently delete flow?',
title: "Do you want to delete the 'route-1234' route?",
text: 'All steps will be lost.',
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,12 @@ export const FlowsList: FunctionComponent<IFlowsList> = (props) => {
variant="plain"
onClick={async (event) => {
const isDeleteConfirmed = await deleteModalContext?.actionConfirmation({
title: 'Permanently delete flow?',
title:
"Do you want to delete the '" +
flow.toVizNode().getId() +
"' " +
flow.toVizNode().getTitle() +
'?',
text: 'All steps will be lost.',
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ describe('ItemDeleteGroup', () => {
fireEvent.click(wrapper.getByText('Delete'));

expect(mockDeleteModalContext.actionConfirmation).toHaveBeenCalledWith({
title: 'Permanently delete flow?',
title: "Do you want to delete the 'undefined' test?",
text: 'All steps will be lost.',
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export const useDeleteGroup = (vizNode: IVisualizationNode) => {
const onDeleteGroup = useCallback(async () => {
/** Open delete confirm modal, get the confirmation */
const isDeleteConfirmed = await deleteModalContext?.actionConfirmation({
title: 'Permanently delete flow?',
title: "Do you want to delete the '" + vizNode.getId() + "' " + vizNode.getTitle() + '?',
text: 'All steps will be lost.',
});

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.pf-v5-c-modal-box {
&__title-text {
white-space: normal;
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Button, ButtonVariant, Modal, ModalVariant, Split, SplitItem } from '@patternfly/react-core';
import { FunctionComponent, PropsWithChildren, createContext, useCallback, useMemo, useRef, useState } from 'react';
import './action-confirmation-modal.provider.scss';

export const ACTION_ID_CANCEL = 'cancel';
export const ACTION_ID_CONFIRM = 'confirm';
Expand Down
Loading