mirror of
https://github.com/datahub-project/datahub.git
synced 2025-11-14 18:31:59 +00:00
fix(summary-tab): show correct feedback when trying to add duplicate link (#14817)
Co-authored-by: Chris Collins <chriscollins3456@gmail.com>
This commit is contained in:
parent
5c79114cb2
commit
23389d0344
@ -11,6 +11,11 @@ export default function ExternalUrlMenuAction({ shouldFillAllAvailableSpace }: P
|
|||||||
const { urn: entityUrn, entityData } = useEntityData();
|
const { urn: entityUrn, entityData } = useEntityData();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ViewInPlatform urn={entityUrn} data={entityData} shouldFillAllAvailableSpace={shouldFillAllAvailableSpace} />
|
<ViewInPlatform
|
||||||
|
urn={entityUrn}
|
||||||
|
data={entityData}
|
||||||
|
shouldFillAllAvailableSpace={shouldFillAllAvailableSpace}
|
||||||
|
isEntityPageHeader
|
||||||
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -262,6 +262,7 @@ function EntityActions(props: Props) {
|
|||||||
variant="outline"
|
variant="outline"
|
||||||
onClick={() => setIsBatchAddGlossaryTermModalVisible(true)}
|
onClick={() => setIsBatchAddGlossaryTermModalVisible(true)}
|
||||||
data-testid="glossary-batch-add"
|
data-testid="glossary-batch-add"
|
||||||
|
size="sm"
|
||||||
>
|
>
|
||||||
<LinkOutlined /> Add to Assets
|
<LinkOutlined /> Add to Assets
|
||||||
</Button>
|
</Button>
|
||||||
@ -273,6 +274,7 @@ function EntityActions(props: Props) {
|
|||||||
variant="outline"
|
variant="outline"
|
||||||
onClick={() => setIsBatchSetDomainModalVisible(true)}
|
onClick={() => setIsBatchSetDomainModalVisible(true)}
|
||||||
data-testid="domain-batch-add"
|
data-testid="domain-batch-add"
|
||||||
|
size="sm"
|
||||||
>
|
>
|
||||||
<LinkOutlined /> Add to Assets
|
<LinkOutlined /> Add to Assets
|
||||||
</Button>
|
</Button>
|
||||||
@ -285,7 +287,7 @@ function EntityActions(props: Props) {
|
|||||||
placement="bottom"
|
placement="bottom"
|
||||||
data-testid="data-product-batch-add"
|
data-testid="data-product-batch-add"
|
||||||
>
|
>
|
||||||
<Button variant="outline" onClick={() => setIsBatchSetDataProductModalVisible(true)}>
|
<Button variant="outline" onClick={() => setIsBatchSetDataProductModalVisible(true)} size="sm">
|
||||||
<LinkOutlined />
|
<LinkOutlined />
|
||||||
Add Assets
|
Add Assets
|
||||||
</Button>
|
</Button>
|
||||||
|
|||||||
@ -88,6 +88,8 @@ export default function LinksList() {
|
|||||||
handleConfirm={handleDelete}
|
handleConfirm={handleDelete}
|
||||||
modalTitle="Confirm Delete"
|
modalTitle="Confirm Delete"
|
||||||
modalText="Are you sure you want to delete this link?"
|
modalText="Are you sure you want to delete this link?"
|
||||||
|
confirmButtonText="Delete"
|
||||||
|
isDeleteModal
|
||||||
/>
|
/>
|
||||||
{showEditLinkModal && (
|
{showEditLinkModal && (
|
||||||
<AddEditLinkModal
|
<AddEditLinkModal
|
||||||
|
|||||||
@ -132,7 +132,8 @@ export default function ModuleMenu({ module, position }: Props) {
|
|||||||
: 'Are you sure you want to remove this module? You can always create a new one later if needed.'
|
: 'Are you sure you want to remove this module? You can always create a new one later if needed.'
|
||||||
}
|
}
|
||||||
closeButtonText="Cancel"
|
closeButtonText="Cancel"
|
||||||
confirmButtonText="Confirm"
|
confirmButtonText="Remove"
|
||||||
|
isDeleteModal
|
||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
@ -36,6 +36,7 @@ interface Props {
|
|||||||
modalText?: string | React.ReactNode;
|
modalText?: string | React.ReactNode;
|
||||||
closeButtonText?: string;
|
closeButtonText?: string;
|
||||||
confirmButtonText?: string;
|
confirmButtonText?: string;
|
||||||
|
isDeleteModal?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const ConfirmationModal = ({
|
export const ConfirmationModal = ({
|
||||||
@ -46,6 +47,7 @@ export const ConfirmationModal = ({
|
|||||||
modalText,
|
modalText,
|
||||||
closeButtonText,
|
closeButtonText,
|
||||||
confirmButtonText,
|
confirmButtonText,
|
||||||
|
isDeleteModal,
|
||||||
}: Props) => {
|
}: Props) => {
|
||||||
return (
|
return (
|
||||||
<StyledModal
|
<StyledModal
|
||||||
@ -57,7 +59,12 @@ export const ConfirmationModal = ({
|
|||||||
<Button variant="text" color="gray" onClick={handleClose} data-testid="modal-cancel-button">
|
<Button variant="text" color="gray" onClick={handleClose} data-testid="modal-cancel-button">
|
||||||
{closeButtonText || 'Cancel'}
|
{closeButtonText || 'Cancel'}
|
||||||
</Button>
|
</Button>
|
||||||
<Button variant="filled" onClick={handleConfirm} data-testid="modal-confirm-button">
|
<Button
|
||||||
|
variant="filled"
|
||||||
|
onClick={handleConfirm}
|
||||||
|
color={isDeleteModal ? 'red' : 'primary'}
|
||||||
|
data-testid="modal-confirm-button"
|
||||||
|
>
|
||||||
{confirmButtonText || 'Yes'}
|
{confirmButtonText || 'Yes'}
|
||||||
</Button>
|
</Button>
|
||||||
</ButtonsContainer>
|
</ButtonsContainer>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user