feat: Add row actions to delete or duplicate a row#1713
feat: Add row actions to delete or duplicate a row#1713juliusknorr wants to merge 3 commits intomainfrom
Conversation
76b0f38 to
201244b
Compare
|
@juliusknorr - great that you are working on this. - when duplicating rows please keep in mind that this ticket exists #660 There are good reasons to provide a "unique" setting for fields. - even this is not yet an existing feature, please keep in mind that it might be implemented one day and copying rows must not circumvent this setting. |
Thanks for the shout! Will keep it in mind |
201244b to
9525e2e
Compare
666eb51 to
7e880cb
Compare
At the moment, it currently doesn't allow duplicating a row if there's a unique condition. |
| cy.get('[data-cy="editRowModal"] .notecard--error').should('not.exist') | ||
| cy.get('[data-cy="editRowModal"] .slot input').first().clear() | ||
| cy.get('[data-cy="editRowModal"] .notecard--error').should('exist') | ||
| //cy.get('[data-cy="editRowModal"] .notecard--error').should('exist') |
There was a problem hiding this comment.
This is an unexpected change, can you explain?
| import { useDataStore } from '../../../../store/data.js' | ||
| import { NcCheckboxRadioSwitch, NcButton, NcActions, NcActionButton } from '@nextcloud/vue' | ||
| import { showError, showSuccess } from '@nextcloud/dialogs' | ||
| import Pencil from 'vue-material-design-icons/Pencil.vue' |
There was a problem hiding this comment.
Pencil is unused now, I would actually vote to move from the Fullscreen to the Pencil icon for editing as that is more commonly used in Nextcloud for editing
| if (!res) { | ||
| showError(t('tables', 'Could not duplicate row.')) | ||
| } else { | ||
| showSuccess(t('tables', 'Row duplicated successfully.')) |
There was a problem hiding this comment.
We can avoid a success message here if the new row is visible right away.
| async handleCloneRow() { | ||
| const data = this.row.data.reduce((acc, curr) => { | ||
| const column = this.visibleColumns.find(col => col.id === curr.columnId) | ||
| // Skip unique text columns to avoid constraint violations |
There was a problem hiding this comment.
I'm unsure what the expected behaviour is. The test checks that this fails, but the logic here seems to be around skipping the values then on the newly inserted rows.
However when testing this it did not skip the row. I'm fine either way, but should be clear what happens then
Signed-off-by: Julius Knorr <jus@bitgrid.net>
…ponent Signed-off-by: Enjeck C <patrathewhiz@gmail.com>
Signed-off-by: Enjeck C. <patrathewhiz@gmail.com>
Follow up