ember-inspector icon indicating copy to clipboard operation
ember-inspector copied to clipboard

Calculating property in "All" view

Open nummi opened this issue 6 years ago • 6 comments

Passing this to the model doesn't work when calculating a property. https://github.com/emberjs/ember-inspector/blob/master/app/templates/components/mixin-details.hbs#L55

Reproduce:

  1. Select "All" view image

  2. Find a CP that needs computing: image

  3. :boom:

Assigning to myself since I wrote it :-|

nummi avatar Sep 05 '19 22:09 nummi

@nummi do you have an example app you are trying this with? There have been lots of other changes, so not sure if model=this is the problem or something else.

RobbieTheWagner avatar Sep 06 '19 12:09 RobbieTheWagner

I discovered this poking around on the Apple Music beta site. Pretty sure this is incorrect because this is the mixin-detail component.

let mixinIndex = this.get('mixinDetails.model.mixins').indexOf(this.model);

this.model is not part of mixinDetails.model.mixins so mixinIndex is -1.

nummi avatar Sep 06 '19 13:09 nummi

@nummi gotcha, I just know a lot has changed in a bunch of areas, so wasn't sure if this was the culprit.

RobbieTheWagner avatar Sep 06 '19 20:09 RobbieTheWagner

Pretty sure the above line is the culprit. It’s a year old 🤢

nummi avatar Sep 06 '19 21:09 nummi

Do we have tests for this?

RobbieTheWagner avatar Sep 06 '19 23:09 RobbieTheWagner

I don’t think so. Not sure how to get a property in the “not computed” state.

nummi avatar Sep 07 '19 01:09 nummi