Skip to content

feat: Add row actions to delete or duplicate a row#1713

Open
juliusknorr wants to merge 3 commits intomainfrom
feat/row-actions
Open

feat: Add row actions to delete or duplicate a row#1713
juliusknorr wants to merge 3 commits intomainfrom
feat/row-actions

Conversation

@juliusknorr
Copy link
Member

@juliusknorr juliusknorr commented Mar 31, 2025

  • Cypress tests
  • Allow to duplicate and edit (from duplicate rows / copy and modify #69)
  • Test cloning in views, discuss if we may want to clone and keep hidden data if we are in a view with limited columns)
  • Handlle unique columns (probably just open an editable modal of the new row)

Follow up

  • Opening an edit modal

@xbluemonkx
Copy link

@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.

@juliusknorr juliusknorr self-assigned this Apr 1, 2025
@juliusknorr juliusknorr added the 2. developing Work in progress label Apr 1, 2025
@github-project-automation github-project-automation bot moved this to 🧭 Planning evaluation (don't pick) in 📝 Productivity team Apr 1, 2025
@enjeck enjeck self-assigned this Oct 30, 2025
@enjeck
Copy link
Contributor

enjeck commented Oct 30, 2025

when duplicating rows please keep in mind that this ticket exists #660

Thanks for the shout! Will keep it in mind

@enjeck enjeck marked this pull request as ready for review December 2, 2025 09:00
@enjeck enjeck requested review from blizzz and enjeck as code owners December 2, 2025 09:00
@enjeck enjeck added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Dec 2, 2025
@enjeck
Copy link
Contributor

enjeck commented Dec 3, 2025

  • Handlle unique columns (probably just open an editable modal of the new row)

At the moment, it currently doesn't allow duplicating a row if there's a unique condition.

@juliusknorr juliusknorr added the enhancement New feature or request label Dec 3, 2025
@juliusknorr juliusknorr moved this from 🧭 Planning evaluation (don't pick) to 🏗️ In progress in 📝 Productivity team Dec 3, 2025
@juliusknorr juliusknorr assigned enjeck and unassigned juliusknorr Dec 11, 2025
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')
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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'
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.'))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@enjeck enjeck force-pushed the feat/row-actions branch from 7e880cb to 7b99dea Compare March 4, 2026 05:30
juliusknorr and others added 3 commits March 4, 2026 08:11
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>
@enjeck enjeck force-pushed the feat/row-actions branch from 7b99dea to 8488437 Compare March 4, 2026 08:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews enhancement New feature or request

Projects

Status: 🏗️ In progress

Development

Successfully merging this pull request may close these issues.

3 participants