-
Notifications
You must be signed in to change notification settings - Fork 361
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: [M3-7305] - Correct Object Storage folder links containing speci…
…al characters (#10822) * Add Intellij IDEA module files to .gitignore. * fix: [M3-7305] - Correct Object Storage folder links containing special characters. * Added changeset: Correct Object Storage folder links containing special characters. * fix: [M3-7305] - code review comment applied: table explicit declaration replaced with wrapWithTableBody * fix: [M3-7305] - corrected import for TableRowProps. * Update packages/manager/.changeset/pr-10819-fixed-1724404332335.md Co-authored-by: cpathipa <119517080+cpathipa@users.noreply.github.com> * Update packages/manager/src/features/ObjectStorage/BucketDetail/FolderTableRow.test.tsx Co-authored-by: cpathipa <119517080+cpathipa@users.noreply.github.com> * fix typo --------- Co-authored-by: cpathipa <119517080+cpathipa@users.noreply.github.com> Co-authored-by: Alban Bailly <abailly@akamai.com>
- Loading branch information
1 parent
2c891f9
commit a169d1d
Showing
4 changed files
with
48 additions
and
6 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
|
@@ -11,6 +11,7 @@ lib | |
# editor configuration | ||
.vscode | ||
.idea | ||
**/*.iml | ||
|
||
# misc | ||
.DS_Store | ||
|
This file contains 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 | ||
--- | ||
|
||
Correct links to Object Storage folders that contain special characters. ([#10819](https://github.com/linode/manager/pull/10819)) |
27 changes: 27 additions & 0 deletions
27
packages/manager/src/features/ObjectStorage/BucketDetail/FolderTableRow.test.tsx
This file contains 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,27 @@ | ||
import { render } from '@testing-library/react'; | ||
import * as React from 'react'; | ||
|
||
import { FolderTableRow } from 'src/features/ObjectStorage/BucketDetail/FolderTableRow'; | ||
import { wrapWithTableBody } from 'src/utilities/testHelpers'; | ||
|
||
import type { FolderTableRowProps } from 'src/features/ObjectStorage/BucketDetail/FolderTableRow'; | ||
|
||
describe('FolderTableRow', () => { | ||
it('renders a link with URI-encoded special characters', () => { | ||
const specialCharsProps: FolderTableRowProps = { | ||
displayName: 'folder-with-special-chars...', | ||
folderName: 'folder-with-special-chars <>#%+{}|^[]`;?:@=&$', | ||
handleClickDelete: () => {}, | ||
manuallyCreated: false, | ||
}; | ||
|
||
const { getByRole } = render( | ||
wrapWithTableBody(<FolderTableRow {...specialCharsProps} />) | ||
); | ||
|
||
expect(getByRole('link')).toHaveAttribute( | ||
'href', | ||
'/?prefix=folder-with-special-chars%20%3C%3E%23%25%2B%7B%7D%7C%5E%5B%5D%60%3B%3F%3A%40%3D%26%24' | ||
); | ||
}); | ||
}); |
This file contains 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