-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #103 from premieroctet/fix/search-select
Store formData in context
- Loading branch information
Showing
20 changed files
with
315 additions
and
185 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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@premieroctet/next-admin": patch | ||
--- | ||
|
||
Fix search for relationship fields and enum fields |
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 @@ | ||
--- | ||
"@premieroctet/next-admin": patch | ||
--- | ||
|
||
Only allow the relationship field in the configuration, not the field that carries the relationship at all - this allows several fields to be used in the Prisma @relation options |
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 @@ | ||
--- | ||
"@premieroctet/next-admin": patch | ||
--- | ||
|
||
Form submitted with error will keep the state with user modification |
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
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
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 |
---|---|---|
|
@@ -18,7 +18,7 @@ export const dataTest: DataTest = { | |
}, | ||
Post: { | ||
title: "MY_POST", | ||
authorId: "User 0 ([email protected])", | ||
author: "User 0 ([email protected])", | ||
}, | ||
Category: { | ||
name: "MY_CATEGORY", | ||
|
@@ -32,7 +32,7 @@ const dataTestUpdate: DataTest = { | |
}, | ||
Post: { | ||
title: "UPDATE_MY_POST", | ||
authorId: "User 1 ([email protected])", | ||
author: "User 1 ([email protected])", | ||
}, | ||
Category: { | ||
name: "UPDATE_MY_CATEGORY", | ||
|
@@ -98,8 +98,8 @@ export const fillForm = async ( | |
break; | ||
case "Post": | ||
await page.fill('input[id="title"]', dataTest.Post.title); | ||
await page.getByLabel("authorId*").click(); | ||
await page.getByText(dataTest.Post.authorId).click(); | ||
await page.getByLabel("author*").click(); | ||
await page.getByText(dataTest.Post.author).click(); | ||
break; | ||
case "Category": | ||
await page.fill('input[id="name"]', dataTest.Category.name); | ||
|
@@ -132,8 +132,8 @@ export const readForm = async ( | |
expect(await page.inputValue('input[id="title"]')).toBe( | ||
dataTest.Post.title | ||
); | ||
expect(await page.inputValue('input[id="authorId"]')).toBe( | ||
dataTest.Post.authorId | ||
expect(await page.inputValue('input[id="author"]')).toBe( | ||
dataTest.Post.author | ||
); | ||
break; | ||
case "Category": | ||
|
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
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
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
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
56 changes: 31 additions & 25 deletions
56
packages/next-admin/src/components/inputs/MultiSelectWidget.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
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
Oops, something went wrong.