Skip to content

Commit 16d17b1

Browse files
committed
fix: review
1 parent 70cc517 commit 16d17b1

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

src/containers/Tenant/ObjectSummary/CreateDirectoryDialog/CreateDirectoryDialog.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {ResponseError} from '../../../../components/Errors/ResponseError';
66
import {schemaApi} from '../../../../store/reducers/schema/schema';
77
import {cn} from '../../../../utils/cn';
88
import i18n from '../../i18n';
9+
import {transformPath} from '../transformPath';
910

1011
import './CreateDirectoryDialog.scss';
1112

@@ -76,6 +77,8 @@ export function CreateDirectoryDialog({
7677
});
7778
};
7879

80+
const relativeParentPath = transformPath(parentPath, databaseFullPath);
81+
7982
return (
8083
<Dialog open={open} onClose={handleClose} size="s" initialFocus={inputRef}>
8184
<Dialog.Header caption={i18n('schema.tree.dialog.header')} />
@@ -94,7 +97,7 @@ export function CreateDirectoryDialog({
9497
<span className={b('description')}>
9598
{i18n('schema.tree.dialog.description')}
9699
</span>
97-
{`${parentPath}/`}
100+
{`${relativeParentPath}/`}
98101
</label>
99102
<div className={b('input-wrapper')}>
100103
<TextInput

src/containers/Tenant/ObjectSummary/SchemaTree/SchemaTree.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,7 @@ export function SchemaTree(props: SchemaTreeProps) {
112112
}, [currentPath, onActivePathUpdate, databaseFullPath]);
113113

114114
const handleSuccessSubmit = (relativePath: string) => {
115-
const prefix = databaseFullPath === parentPath ? '' : `${databaseFullPath}/`;
116-
const newPath = `${prefix}${parentPath}/${relativePath}`;
115+
const newPath = `${parentPath}/${relativePath}`;
117116
onActivePathUpdate(newPath);
118117
setSchemaTreeKey(newPath);
119118
};

src/containers/Tenant/utils/schemaActions.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ const bindActions = (
9494
return {
9595
createDirectory: showCreateDirectoryDialog
9696
? () => {
97-
showCreateDirectoryDialog(params.relativePath);
97+
showCreateDirectoryDialog(params.path);
9898
}
9999
: undefined,
100100
getConnectToDBDialog: () => getConnectToDBDialog?.({database: params.database}),

0 commit comments

Comments
 (0)