feat(dataset-table): add inline editing for editable columns#2261
feat(dataset-table): add inline editing for editable columns#2261
Conversation
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- In
MockDatasetApi.datasetsControllerFindByIdAndUpdateV3, consider matching the real service method signature (e.g.(pid: string, body: any)) so tests and future call sites can rely on consistent typing and argument usage. - The
DatasetInlineEditCellComponentsubscribes to the store in the constructor; moving this subscription logic intongOnInitwould better align with Angular lifecycle best practices and make the component easier to reason about. - The new
decorateColumnshelper inDatasetTableComponentonly decoratestype === 'editable'columns; if other dynamic types (e.g. existing custom types) also rely ondynamicCellComponent, consider centralizing all such decorations in this method to avoid diverging configuration paths.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In `MockDatasetApi.datasetsControllerFindByIdAndUpdateV3`, consider matching the real service method signature (e.g. `(pid: string, body: any)`) so tests and future call sites can rely on consistent typing and argument usage.
- The `DatasetInlineEditCellComponent` subscribes to the store in the constructor; moving this subscription logic into `ngOnInit` would better align with Angular lifecycle best practices and make the component easier to reason about.
- The new `decorateColumns` helper in `DatasetTableComponent` only decorates `type === 'editable'` columns; if other dynamic types (e.g. existing custom types) also rely on `dynamicCellComponent`, consider centralizing all such decorations in this method to avoid diverging configuration paths.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
36eea20 to
d9d3c28
Compare
|
Feedback from the UX point of view: |
|
How are the permissions managed? |
The permission rule for the user to see the edit icon should be the same as is for a user to be able to edit a dataset in the dataset detail view. Which is: appConfig.editDatasetEnabled is true AND user is admin OR dataset ownergroup is in users access groups. Of course, if there would be a bug here, the backend wouldn't allow an edit. |
I like having the icons to the left, but I'm not sure about always having the edit icon visible. |
d9d3c28 to
0c0da61
Compare
dissmiss review based on our disucssion
8746344 to
f3e88fb
Compare
…umns Add a new dataset table column type, `editable`. For users with edit permission, editable cells show an edit icon on hover. Clicking the cell opens an inline input with a save button.
## Description Update jsonforms with editable columns type <img width="1531" height="441" alt="image" src="https://github.com/user-attachments/assets/b3953ac2-6d51-43cc-9a7f-18cf99fce8b7" /> ## Motivation Background on use case, changes needed ## Fixes: Please provide a list of the fixes implemented in this PR * Items added ## Changes: Please provide a list of the changes implemented by this PR * changes made ## Tests included - [ ] Included for each change/fix? - [ ] Passing? (Merge will not be approved unless this is checked) ## Documentation - [ ] swagger documentation updated \[required\] - [ ] official documentation updated \[nice-to-have\] ### official documentation info If you have updated the official documentation, please provide PR # and URL of the pages where the updates are included ## Backend version - [ ] Does it require a specific version of the backend - which version of the backend is required: ## Summary by Sourcery Add support for inline-editable dataset table columns and wire them to backend updates. New Features: - Introduce an editable column type in table and dataset configurations to enable inline editing of dataset fields. - Add a DatasetInlineEditCellComponent to render and manage inline editing within dataset table cells, including permissions checks. Enhancements: - Wire a new updatePropertyInline effect and action to persist inline edits via the datasets API and refresh state. - Extend dataset list export handling so editable columns export their underlying values correctly. - Adjust jsonforms card styles to better align array items with action controls in a row layout. Tests: - Add unit tests for the new updatePropertyInline dataset actions and effects. - Add a test stub for the datasetsControllerFindByIdAndUpdateV3 API method to support the new effect.
96379aa to
0da40b1
Compare
Description
This PR makes it possible to configure columns to be editable inline in the dataset table.
Adds a new dataset table column type,
editable.For users with edit permission, editable cells show an edit icon on hover.
Clicking the cell opens an inline input with a save button.
See screencast:
Screencast from 2026-03-12 12-08-58.webm
Motivation
One highly liked feature of Scanlog (MAXIV SciCat alternative frontend) is the possibility to edit the comment field inline in the the dataset table.
Changes:
New dataset table column type, 'editable'.
Tests included
Documentation
I would like to update this, where?
official documentation info
If you have updated the official documentation, please provide PR # and URL of the pages where the updates are included
Backend version
Summary by Sourcery
Introduce inline-editable dataset table columns with a dedicated cell component and necessary wiring.
New Features:
editablecolumn type for dataset table fields that renders cells with an inline edit UI for permitted users.DatasetInlineEditCellComponentto handle inline editing, saving, and permission checks for dataset fields.Enhancements: