-
-
Notifications
You must be signed in to change notification settings - Fork 112
merge dev to main (v2.2.4) #1527
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
a14bf29
fix(delegate): push base-level id assignment to base payload when cre…
ymc9 b34531d
fix(delegate): make sure concrete fields are included when a polymorp…
ymc9 09ebea0
chore: bump version (#1525)
ymc9 3e77974
fix(delegate): make sure nested `createMany` is converted into regula…
ymc9 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 |
---|---|---|
|
@@ -9,7 +9,7 @@ plugins { | |
} | ||
|
||
group = "dev.zenstack" | ||
version = "2.2.3" | ||
version = "2.2.4" | ||
|
||
repositories { | ||
mavenCentral() | ||
|
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,31 @@ | ||
import { loadSchema } from '@zenstackhq/testtools'; | ||
describe('issue 1518', () => { | ||
it('regression', async () => { | ||
const { enhance } = await loadSchema( | ||
` | ||
model Activity { | ||
id String @id @default(uuid()) | ||
title String | ||
type String | ||
@@delegate(type) | ||
@@allow('all', true) | ||
} | ||
|
||
model TaskActivity extends Activity { | ||
description String | ||
@@map("task_activity") | ||
@@allow('all', true) | ||
} | ||
` | ||
); | ||
|
||
const db = enhance(); | ||
await db.taskActivity.create({ | ||
data: { | ||
id: '00000000-0000-0000-0000-111111111111', | ||
title: 'Test Activity', | ||
description: 'Description of task', | ||
}, | ||
}); | ||
}); | ||
}); |
This file contains hidden or 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,70 @@ | ||
import { loadSchema } from '@zenstackhq/testtools'; | ||
|
||
describe('issue 1520', () => { | ||
it('regression', async () => { | ||
const { enhance } = await loadSchema( | ||
` | ||
model Course { | ||
id Int @id @default(autoincrement()) | ||
title String | ||
addedToNotifications AddedToCourseNotification[] | ||
} | ||
|
||
model Group { | ||
id Int @id @default(autoincrement()) | ||
addedToNotifications AddedToGroupNotification[] | ||
} | ||
|
||
model Notification { | ||
id Int @id @default(autoincrement()) | ||
createdAt DateTime @default(now()) | ||
type String | ||
senderId Int | ||
receiverId Int | ||
@@delegate (type) | ||
} | ||
|
||
model AddedToGroupNotification extends Notification { | ||
groupId Int | ||
group Group @relation(fields: [groupId], references: [id], onDelete: Cascade) | ||
} | ||
|
||
model AddedToCourseNotification extends Notification { | ||
courseId Int | ||
course Course @relation(fields: [courseId], references: [id], onDelete: Cascade) | ||
} | ||
`, | ||
{ enhancements: ['delegate'] } | ||
); | ||
|
||
const db = enhance(); | ||
const r = await db.course.create({ | ||
data: { | ||
title: 'English classes', | ||
addedToNotifications: { | ||
createMany: { | ||
data: [ | ||
{ | ||
id: 1, | ||
receiverId: 1, | ||
senderId: 2, | ||
}, | ||
], | ||
}, | ||
}, | ||
}, | ||
include: { addedToNotifications: true }, | ||
}); | ||
|
||
expect(r.addedToNotifications).toEqual( | ||
expect.arrayContaining([ | ||
expect.objectContaining({ | ||
id: 1, | ||
courseId: 1, | ||
receiverId: 1, | ||
senderId: 2, | ||
}), | ||
]) | ||
); | ||
}); | ||
}); |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.