marmelab / marmelab/ng-admin

Fields marked as not editable should not be sent to the server on save

Open
#808 2 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
JavaScript
Stars
3.9k
Forks
703
PR merge metrics
No merged PRs in 30d

Description

The issue is we have a bunch of embedded documents that aren't practical to edit from the Admin, so we usually perform some modification via `.map`, then render using either `'json'` or a `'template'`.

However, if the `.map` changes the value in any way, this is sent back to the server on save, even though the field is not editable, resulting in corrupted data. This is pretty unexpected, since the field is not editable, yet the value is being edited (via map).

I'm currently using a few techniques to prevent the issue, but it's pretty tricky, especially when embedded objects are being flattened, so you can't just map them to a fake field.

Alternatively, maybe we need a way to flag fields that shouldn't be sent back.

Contributor guide

No contributing guide indexed for this repository

Research direction

The issue names no files, tests, or entry points; start by tracing the admin save path for mapped, non-editable embedded fields and reproduce the JSON/template case described. Completion requires a decided behavior that prevents such fields, including flattened embedded objects, from being sent on save, with regression coverage.

Written by the indexing model from the issue text.

Assessment

Tech stack
angularjs, javascript
Domain
frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.