Skip to content

Commit

Permalink
revert(content-explorer): Revert rename dialog (#3704)
Browse files Browse the repository at this point in the history
* Revert "chore(content-explorer): migrate renameDialog (#3666)"

This reverts commit f5f1bac.

* chore(content-explorer): keep changes depended by other elements
  • Loading branch information
tjiang-box authored Oct 8, 2024
1 parent fe9f7cc commit 13b8c99
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 335 deletions.
6 changes: 0 additions & 6 deletions i18n/en-US.properties
Original file line number Diff line number Diff line change
Expand Up @@ -592,16 +592,10 @@ be.renameDialogErrorInUse = An item with the same name already exists.
be.renameDialogErrorInvalid = This name is invalid.
# Error text for rename dialog when name is too long
be.renameDialogErrorTooLong = This name is too long.
# Header for rename file dialog
be.renameDialogFileHeader = Rename File
# Header for rename folder dialog
be.renameDialogFolderHeader = Rename Folder
# Label for rename dialog
be.renameDialogLabel = Rename
# Text for rename dialog
be.renameDialogText = Please enter a new name for {name}:
# Header for rename web link dialog
be.renameDialogWebLinkHeader = Rename Link
# Label for resume action for a single file.
be.resume = Resume
# Label for resume action for multiple files.
Expand Down
15 changes: 0 additions & 15 deletions src/elements/common/messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -317,21 +317,6 @@ const messages = defineMessages({
description: 'Error text for rename dialog when name is too long',
defaultMessage: 'This name is too long.',
},
renameDialogFileHeader: {
id: 'be.renameDialogFileHeader',
description: 'Header for rename file dialog',
defaultMessage: 'Rename File',
},
renameDialogFolderHeader: {
id: 'be.renameDialogFolderHeader',
description: 'Header for rename folder dialog',
defaultMessage: 'Rename Folder',
},
renameDialogWebLinkHeader: {
id: 'be.renameDialogWebLinkHeader',
description: 'Header for rename web link dialog',
defaultMessage: 'Rename Link',
},
createDialogLabel: {
id: 'be.createDialogLabel',
description: 'Label for create folder dialog',
Expand Down
1 change: 1 addition & 0 deletions src/elements/content-explorer/ContentExplorer.js
Original file line number Diff line number Diff line change
Expand Up @@ -1783,6 +1783,7 @@ class ContentExplorer extends Component<Props, State> {
isLoading={isLoading}
errorCode={errorCode}
parentElement={this.rootElement}
appElement={this.appElement}
/>
) : null}
{canShare && selected && !!this.appElement ? (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
import type { BoxItem } from '../../common/types/core';

type Props = {
appElement: HTMLElement,
errorCode: string,
intl: IntlShape,
isLoading: boolean,
Expand Down Expand Up @@ -101,6 +102,7 @@ const RenameDialog = ({

return (
<Modal
appElement={appElement}
className={CLASS_MODAL_CONTENT}
contentLabel={intl.formatMessage(messages.renameDialogLabel)}
isOpen={isOpen}
Expand Down
6 changes: 0 additions & 6 deletions src/elements/content-explorer/RenameDialog.scss

This file was deleted.

130 changes: 0 additions & 130 deletions src/elements/content-explorer/RenameDialog.tsx

This file was deleted.

115 changes: 0 additions & 115 deletions src/elements/content-explorer/__tests__/RenameDialog.test.tsx

This file was deleted.

51 changes: 0 additions & 51 deletions src/elements/content-explorer/stories/RenameDialog.stories.tsx

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export const openRenameDialog = {
expect(renameButton).toBeInTheDocument();
await userEvent.click(renameButton);

expect(await screen.findByText('Rename File')).toBeInTheDocument();
expect(await screen.findByText('Please enter a new name for Book Sample:')).toBeInTheDocument();
},
};

Expand All @@ -97,12 +97,12 @@ export const closeRenameDialog = {
expect(renameButton).toBeInTheDocument();
await userEvent.click(renameButton);

expect(await screen.findByText('Rename File')).toBeInTheDocument();
expect(await screen.findByText('Please enter a new name for Book Sample:')).toBeInTheDocument();
const cancelButton = screen.getByText('Cancel');
await userEvent.click(cancelButton);

await waitFor(() => {
expect(screen.queryByText('Rename File')).not.toBeInTheDocument();
expect(screen.queryByText('Please enter a new name for Book Sample:')).not.toBeInTheDocument();
});
},
};
Expand Down
Loading

0 comments on commit 13b8c99

Please sign in to comment.