Skip to content

Commit 8b285c0

Browse files
authored
Merge pull request #549 from Lemoncode/feature/#513-create-dialog-import-collection
#513-empty-name-warning-and-space-between-modal-elements
2 parents fbc54a5 + 6bae770 commit 8b285c0

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

src/pods/import-collection/import-panel.pod.module.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
.text-info {
2+
background-color: var(--background-dialog);
3+
padding-top: var(--space-md);
4+
display: flex;
5+
justify-content: center;
6+
}
7+
18
.table-name,
29
.json-textarea {
310
background-color: var(--background-dialog);

src/pods/import-collection/import-panel.pod.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,11 @@ export const ImportPanel: React.FC<ImportPanelProps> = props => {
7676
const handleChangeTableName = (e: React.ChangeEvent<HTMLInputElement>) => {
7777
const tableName: string = e.currentTarget.value;
7878
setEditTable({ ...editTable, tableName });
79+
if (e.currentTarget.value.length === 0) {
80+
setJsonError('Name cannot be empty');
81+
} else {
82+
setJsonError(null);
83+
}
7984
};
8085

8186
return (
@@ -91,7 +96,7 @@ export const ImportPanel: React.FC<ImportPanelProps> = props => {
9196
/>
9297
</label>
9398
</div>
94-
<label>
99+
<label className={classes.textInfo}>
95100
Copy here a document (you can copy it from a collection using a tool
96101
like Mongo Compass)
97102
</label>

0 commit comments

Comments
 (0)