-
-
Notifications
You must be signed in to change notification settings - Fork 631
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
feat: implement duplicate row functionality #930
Conversation
Pull Request Test Coverage Report for Build 10951572039Details
💛 - Coveralls |
Oops, conflict leading to new feature(comment), fortunately it is easy to resolve, i'll review it. |
> Hi, I've been waiting too long for the merge pr.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's also the fact that it's currently duplicate a single line, but the interface definition and endpoint return type appear to be multiple lines
const onDuplicate = async (tableId: string, recordId: string) => { | ||
await duplicateRecords(tableId, recordId, { | ||
viewId: viewId || '', | ||
anchorId: recordId, | ||
position: 'after', | ||
}); | ||
toast({ description: t('expandRecord.duplicateRecord') }); | ||
}; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After a successful duplicate, the current expand card should be updated with the new record, rather than just closing the expand card.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I found it. I know that recordsServerData
triggers rendering. When I duplicate record, the length of recordsServerData
keep same. I don't know how to update RecordsServerData.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I found it. I know that
recordsServerData
triggers rendering. When I duplicate record, the length ofrecordsServerData
keep same. I don't know how to update RecordsServerData.
In fact, recordsServerData will not be updated, recordsServerData is only the initialization data needed for ssr, and will not be used when the page is rendered and the socket is connected, so don't care about it!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I see. Now I have to force refresh the page for the duplicated record to render. I have no cules to solve it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try it.
// source
const createdRecords =await this.createRecords(tableId, createRecordsRo);
// aliternative
const createdRecords = await this.prismaService.$tx(
async () => {
return await this.createRecords(tableId, createRecordsRo);
}
);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you ,it works
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe that every single-record right-click menu in each view needs to have a "Duplicate Record" menu item added, including both the grid view and the kanban view.
When I started to implement the duplicate functionality, I actually did it . the comment in #796 (comment), let me implement it in expand card. I'm a little dissatisfied with the current implementation,it can't insert a duplicate record after the index of the target record. |
@boris-w hi, I have completed the pr. can you merge it? |
Looks like there's a problem merging some files. |
what can't files be merged. the result of ci is no conflicts with the base branch. so I don't know what to do next. |
It looks like you're using merge instead of rebase. |
042a2d2
to
06240f5
Compare
OK ,now it‘s work tree is clean |
close #796