marmelab / marmelab/ng-admin

The template scope's Datastore variable bug (in showView)

Open
#1,365 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
3.9k
Forks
703
PR merge metrics
No merged PRs in 30d

Description

It seems when using the datastore variable to compare what is saved in the database and what is on the server you get a lengthy json blob of the entire datastore if those values differ. I am trying to develop a workaround for this. An example of the comparison in my template is below:

<span ng-if="datastore._entries.teacher_name_14_values[0].values.years == entry.values.teacher_name_years_on_server" ...

Every time a teacher name is added or removed from the database the integer (14) is incremented or decremented causing the hard-coded value to be changed every time. Is there a fix for this?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the template-scope handling in showView and reproduce the comparison shown in the issue. Trace how datastore is exposed to the template and how a differing comparison produces the JSON blob. Done means the comparison no longer renders the entire datastore and does not require a changing hard-coded _entries key.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.