teable
teable copied to clipboard
duplicate rows
related #587
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
8 out of 10 committers have signed the CLA.
:white_check_mark: tea-artist
:white_check_mark: AliceLanniste
:white_check_mark: caoxing9
:white_check_mark: boris-w
:white_check_mark: Sky-FE
:white_check_mark: spiritanand
:white_check_mark: tkymmm
:white_check_mark: simon-moulin
:x: solankimihir
:x: cosark
You have signed the CLA already but the status is still pending? Let us recheck it.
For API e2e testing:
First, run pnpm test-e2e in the backend directory to initialize the testing environment.
Once successful, add the duplication test logic to the apps/nestjs-backend/test/record.e2e-spec.ts file.
Execute the test using the command: pnpm test-e2e apps/nestjs-backend/test/record.e2e-spec.ts.
Pull Request Test Coverage Report for Build 10474103032
Warning: This coverage report may be inaccurate.
This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
- For more information on this, see Tracking coverage changes with pull request builds.
- To avoid this issue with future PRs, see these Recommended CI Configurations.
- For a quick fix, rebase this PR at GitHub. Your next report should be accurate.
Details
- 6 of 24 (25.0%) changed or added relevant lines in 2 files are covered.
- No unchanged relevant lines lost coverage.
- Overall coverage increased (+65.2%) to 82.979%
| Changes Missing Coverage | Covered Lines | Changed/Added Lines | % |
|---|---|---|---|
| apps/nestjs-backend/src/features/selection/selection.controller.ts | 3 | 10 | 30.0% |
| apps/nestjs-backend/src/features/selection/selection.service.ts | 3 | 14 | 21.43% |
| <!-- | Total: | 6 | 24 |
| Totals | |
|---|---|
| Change from base Build 10242225492: | 65.2% |
| Covered Lines: | 30557 |
| Relevant Lines: | 36825 |
💛 - Coveralls
Hi @AliceLanniste , I think you might be heading in the wrong direction. The API for copying a row shouldn’t be designed the same way as the selection-related API. Copying a row is an action for a single row, and only the recordId of the current row is needed, and copy line api tag should belong to record.
For API e2e testing:
First, run
pnpm test-e2ein the backend directory to initialize the testing environment. Once successful, add the duplication test logic to theapps/nestjs-backend/test/record.e2e-spec.tsfile. Execute the test using the command:pnpm test-e2e apps/nestjs-backend/test/record.e2e-spec.ts.
hi, I run pnpm test-e2e to setup test envrionment. I get error:
> @teable/[email protected] prisma-db-seed /root/program/teable/packages/db-main-prisma
> dotenv-flow -p ../../apps/nextjs-app -- pnpm prisma db seed "--" "--e2e"
Running seed command `tsx ./prisma/seed.ts --e2e` ...
node:internal/modules/cjs/loader:415
const err = new Error(
^
Error: Cannot find module '/root/program/teable/packages/db-main-prisma/dist/index.js'. Please verify that the package.json has a valid "main" entry
at tryPackage (node:internal/modules/cjs/loader:415:19)
at Module._findPath (node:internal/modules/cjs/loader:665:18)
at Module._resolveFilename (node:internal/modules/cjs/loader:1034:27)
at a._resolveFilename (/root/program/teable/node_modules/.pnpm/[email protected]/node_modules/tsx/dist/cjs/index.cjs:1:1729)
at Module._load (node:internal/modules/cjs/loader:901:27)
at Module.require (node:internal/modules/cjs/loader:1115:19)
at require (node:internal/modules/helpers:130:18)
at parse (/root/program/teable/packages/db-main-prisma/prisma/seed.ts:6:30)
at Object.<anonymous> (/root/program/teable/packages/db-main-prisma/prisma/seed.ts:68:4)
at Module._compile (node:internal/modules/cjs/loader:1241:14) {
code: 'MODULE_NOT_FOUND',
path: '/root/program/teable/packages/db-main-prisma/package.json',
requestPath: '../'
}
For API e2e testing: First, run
pnpm test-e2ein the backend directory to initialize the testing environment. Once successful, add the duplication test logic to theapps/nestjs-backend/test/record.e2e-spec.tsfile. Execute the test using the command:pnpm test-e2e apps/nestjs-backend/test/record.e2e-spec.ts.hi, I run
pnpm test-e2eto setup test envrionment. I get error:> @teable/[email protected] prisma-db-seed /root/program/teable/packages/db-main-prisma > dotenv-flow -p ../../apps/nextjs-app -- pnpm prisma db seed "--" "--e2e" Running seed command `tsx ./prisma/seed.ts --e2e` ... node:internal/modules/cjs/loader:415 const err = new Error( ^ Error: Cannot find module '/root/program/teable/packages/db-main-prisma/dist/index.js'. Please verify that the package.json has a valid "main" entry at tryPackage (node:internal/modules/cjs/loader:415:19) at Module._findPath (node:internal/modules/cjs/loader:665:18) at Module._resolveFilename (node:internal/modules/cjs/loader:1034:27) at a._resolveFilename (/root/program/teable/node_modules/.pnpm/[email protected]/node_modules/tsx/dist/cjs/index.cjs:1:1729) at Module._load (node:internal/modules/cjs/loader:901:27) at Module.require (node:internal/modules/cjs/loader:1115:19) at require (node:internal/modules/helpers:130:18) at parse (/root/program/teable/packages/db-main-prisma/prisma/seed.ts:6:30) at Object.<anonymous> (/root/program/teable/packages/db-main-prisma/prisma/seed.ts:68:4) at Module._compile (node:internal/modules/cjs/loader:1241:14) { code: 'MODULE_NOT_FOUND', path: '/root/program/teable/packages/db-main-prisma/package.json', requestPath: '../' }
run pnpm build in packages/db-main-prisma can solve this problem
@boris-w has a good suggestion. Since we only allowed duplicates one record at a time, you should put the api under the record controller and use the recordId as a param.
Ok,I GET IT
It would be great to put the button in the edit form dropdown menu so that the user can perform a duplicate on any view.
And Kanban view context menu
It would be great to put the button in the edit form dropdown menu so that the user can perform a duplicate on any view.
And Kanban view context menu
![]()
completed it
Hi @AliceLanniste,
Thank you for your work on the duplicate_row branch. To streamline your PR, we need to recreate your branch, including only the changes relevant to the duplicate row functionality. Here's a step-by-step guide:
-
Ensure you have the latest develop branch:
git fetch origin git checkout -b duplicate_row_new origin/develop -
Identify all your commits:
git log origin/develop..duplicate_row --onelineThis will display all commits on your duplicate_row branch that aren't in the develop branch.
-
Apply all your commits using cherry-pick:
git cherry-pick <oldest-commit-hash>..<newest-commit-hash>Alternatively, if you want to select specific commits:
git cherry-pick <commit-hash1> <commit-hash2> <commit-hash3>If you encounter conflicts, resolve them and then use:
git add <conflicted-file> git cherry-pick --continue -
Verify that all changes are included:
git diff duplicate_row duplicate_row_newIf any changes are missing, add them manually.
-
Squash all changes into a single commit:
git reset --soft origin/develop git commit -m "feat: implement duplicate row functionality" -
Push the new branch to your remote repository:
git push -f origin duplicate_row_new -
On GitHub, close the original PR and create a new one based on this
duplicate_row_newbranch.
And Kanban view context menu