Skip to content

feat(dataset-table): add inline editing for editable columns#2261

Merged
emigun merged 3 commits intomasterfrom
inline-edit-comment
Mar 24, 2026
Merged

feat(dataset-table): add inline editing for editable columns#2261
emigun merged 3 commits intomasterfrom
inline-edit-comment

Conversation

@emigun
Copy link
Copy Markdown
Member

@emigun emigun commented Mar 12, 2026

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

  • Included for each change/fix?
  • Passing? (Merge will not be approved unless this is checked)

Documentation

  • official documentation updated [nice-to-have]

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

  • Does it require a specific version of the backend
  • which version of the backend is required:

Summary by Sourcery

Introduce inline-editable dataset table columns with a dedicated cell component and necessary wiring.

New Features:

  • Add a new editable column type for dataset table fields that renders cells with an inline edit UI for permitted users.
  • Provide a DatasetInlineEditCellComponent to handle inline editing, saving, and permission checks for dataset fields.

Enhancements:

  • Decorate table column configuration so editable columns automatically use the inline edit cell component.
  • Ensure editable columns have a default export value based on their configured path or name.

@emigun emigun requested a review from a team as a code owner March 12, 2026 11:10
Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

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

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

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@emigun emigun force-pushed the inline-edit-comment branch 2 times, most recently from 36eea20 to d9d3c28 Compare March 12, 2026 11:30
@nitrosx
Copy link
Copy Markdown
Member

nitrosx commented Mar 13, 2026

Feedback from the UX point of view:
can we show the edit icon to the left of the field and always show it?
When you click it, the editable field becomes active and the edit icon is replaced by the save one?

@nitrosx
Copy link
Copy Markdown
Member

nitrosx commented Mar 13, 2026

How are the permissions managed?

@emigun
Copy link
Copy Markdown
Member Author

emigun commented Mar 17, 2026

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.

@emigun
Copy link
Copy Markdown
Member Author

emigun commented Mar 17, 2026

Feedback from the UX point of view: can we show the edit icon to the left of the field and always show it? When you click it, the editable field becomes active and the edit icon is replaced by the save one?

I like having the icons to the left, but I'm not sure about always having the edit icon visible.

@emigun emigun force-pushed the inline-edit-comment branch from d9d3c28 to 0c0da61 Compare March 18, 2026 14:23
@Junjiequan Junjiequan dismissed nitrosx’s stale review March 19, 2026 22:14

dissmiss review based on our disucssion

Comment thread src/app/datasets/dataset-table/dataset-inline-edit-cell.component.ts Outdated
@emigun emigun force-pushed the inline-edit-comment branch from 8746344 to f3e88fb Compare March 24, 2026 08:57
Copy link
Copy Markdown
Member

@Junjiequan Junjiequan left a comment

Choose a reason for hiding this comment

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

looks good to me

emigun and others added 3 commits March 24, 2026 13:54
…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.
@Junjiequan Junjiequan force-pushed the inline-edit-comment branch from 96379aa to 0da40b1 Compare March 24, 2026 12:54
@emigun emigun merged commit 23b943f into master Mar 24, 2026
8 checks passed
@emigun emigun deleted the inline-edit-comment branch March 24, 2026 13:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants