-
Notifications
You must be signed in to change notification settings - Fork 407
fix: [M3-9034] - Use empty string instead of unknown for delete dialog titles #12701
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
Merged
hana-akamai
merged 5 commits into
linode:develop
from
hana-akamai:M3-9034-delete-domain-dialog
Aug 15, 2025
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
b2a7131
use empty string as fallback for delete dialog titles instead of unknown
hana-akamai 70bc38c
Added changeset: Use empty string instead of unknown for delete dialoβ¦
hana-akamai 0c96c21
address feedback pt 1
hana-akamai 1a4b85e
fix test failures
hana-akamai 41a491e
remove space
hana-akamai File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@linode/manager": Fixed | ||
| --- | ||
|
|
||
| Use empty string instead of unknown for delete dialog titles ([#12701](https://github.com/linode/manager/pull/12701)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 0 additions & 44 deletions
44
packages/manager/src/features/Domains/DeleteDomain.test.tsx
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
68 changes: 68 additions & 0 deletions
68
packages/manager/src/features/Domains/DeleteDomainDialog.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| import { useDeleteDomainMutation } from '@linode/queries'; | ||
| import { Notice, Typography } from '@linode/ui'; | ||
| import { useSnackbar } from 'notistack'; | ||
| import * as React from 'react'; | ||
|
|
||
| import { TypeToConfirmDialog } from 'src/components/TypeToConfirmDialog/TypeToConfirmDialog'; | ||
|
|
||
| import type { APIError } from '@linode/api-v4'; | ||
| export interface DeleteDomainProps { | ||
| domainError: APIError[] | null; | ||
| domainId?: number; | ||
| domainLabel?: string; | ||
| isFetching: boolean; | ||
| onClose?: () => void; | ||
| // Function that is invoked after Domain has been successfully deleted. | ||
| onSuccess?: () => void; | ||
| open: boolean; | ||
| } | ||
|
|
||
| export const DeleteDomainDialog = (props: DeleteDomainProps) => { | ||
| const { domainError, domainId, domainLabel, open, onClose, isFetching } = | ||
| props; | ||
| const { enqueueSnackbar } = useSnackbar(); | ||
|
|
||
| const { | ||
| error, | ||
| isPending, | ||
| mutateAsync: deleteDomain, | ||
| } = useDeleteDomainMutation(domainId ?? 0); | ||
|
|
||
| const onDelete = () => { | ||
| deleteDomain().then(() => { | ||
| enqueueSnackbar('Domain deleted successfully.', { | ||
| variant: 'success', | ||
| }); | ||
| if (props.onSuccess) { | ||
| props.onSuccess(); | ||
| } | ||
| }); | ||
| }; | ||
|
|
||
| return ( | ||
| <TypeToConfirmDialog | ||
| entity={{ | ||
| action: 'deletion', | ||
| error: domainError, | ||
| name: domainLabel, | ||
| primaryBtnText: 'Delete Domain', | ||
| type: 'Domain', | ||
| }} | ||
| errors={error} | ||
| isFetching={isFetching} | ||
| label="Domain Name" | ||
| loading={isPending} | ||
| onClick={onDelete} | ||
| onClose={onClose} | ||
| open={open} | ||
| title={`Delete Domain${domainLabel ? ` ${domainLabel}` : ''}?`} | ||
| > | ||
| <Notice variant="warning"> | ||
| <Typography> | ||
| <strong>Warning:</strong> Deleting this domain is permanent and canβt | ||
| be undone. | ||
| </Typography> | ||
| </Notice> | ||
| </TypeToConfirmDialog> | ||
| ); | ||
| }; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.