question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Nested properties not changing on new Changeset

See original GitHub issue

Version

"ember-changeset": "2.1.2"

Test Case

https://ember-twiddle.com/02df9b64f83f5f844a76d63dff4184d8?openFiles=controllers.application.js%2C

Steps to reproduce

  • Create a changeset of an object
  • Set the changeset to a new changeset on the fly
  • Increment changeset fields
  • Call .rollback()

Expected Behavior

  • Clicking on selected button group changes the fields to the new changeset
  • Increment nested fields (max & min) on button click
  • Rollback fields on button click

Actual Behavior

  • The "results.max" & "results.min" field (using changeset-get helper) doesn’t change when creating new changeset
  • When new changeset created on click, the incrementNumber() & rollback() action stops working

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
marshy2201commented, Sep 27, 2019

I found a workaround yesterday by wrapping the changeset-get helpers in a component with an if statement around the components yield. The setupController() hook sets this field (rerenderComplete) to false and then the didRender() hook in the component sets it back to true.

Heres a demo of it https://ember-twiddle.com/bc8feb256ab0744bdf8b4e73cc31a5f0 @bartocc

I think there is some issue with the changeset-get helpers not rendering properly.

1reaction
marshy2201commented, Jun 25, 2019

I think your twiddle crashes because your using the changeset template helpers in your {{table-cell}} component on model.entries that hasn’t been set as a new changeset. By commenting out this code it works.

{{#each model.entries as |entry|}}
  <tr>
    {{#each columns as |column|}}
      <td>{{table-cell changeset=entry column=column}}</td>
    {{/each}}
  </tr>
{{/each}}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Deeply nested properties do not trigger template getter on ...
hey, using latest 2.1.2 with {{changeset-get}} and having same issue where a nested key isn't being updated after it's changed. e.g. new Changeset({...
Read more >
Change sets for nested stacks - AWS CloudFormation
Change sets for nested stacks is enabled by default in the CloudFormation console. For more information, see Creating a change set.
Read more >
Update binding when nested object changes - wpf
I've found I am able to overcome this by either: Assigning a new object to _person (as in the commented out line) Removing...
Read more >
An example of nested forms, nested changesets, and error ...
In this case, that means that Changeset. fetch_change(changeset, :service_gap) will return :error , indicating the user intends no changes to ...
Read more >
Use Change Sets to deploy nested Public Groups
When you deploy public groups with a change set, any nested group structure is not retained in the target organization. Resolution.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found