Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature discussion] ability to configure value for "Hide Empty Model Types" #741

Closed
ghost opened this issue Dec 20, 2017 · 4 comments · Fixed by #742
Closed

[feature discussion] ability to configure value for "Hide Empty Model Types" #741

ghost opened this issue Dec 20, 2017 · 4 comments · Fixed by #742

Comments

@ghost
Copy link

ghost commented Dec 20, 2017

use case

As a developer in a large app, we use a number of different ember data models. Often when developing one section, I only care about seeing one's loaded in the store. Thus I would like to be able to save a preference to toggle this on.
I would see this as simple checkbox navigated to from Ember Inspector's options link:
screen shot 2017-12-20 at 1 50 27 pm

prior work

https://github.com/emberjs/ember-inspector/pull/458/files

@teddyzeenny
Copy link
Contributor

That sounds reasonable. What do you think about remembering your last choice instead of making it a configuration? On a related note, I think a search feature would be really useful for large apps as well.

@ghost
Copy link
Author

ghost commented Dec 20, 2017

ah, yeah that is more sensible. Basically persisting it via the addon's install state. (localStorage under the hood I imagine?)
Yes, search would be great.

@teddyzeenny
Copy link
Contributor

Are you interested in submitting a PR?
It would consist of making this property a CP instead of an options property.

Something like:

  hideEmptyModels: computed({
    get() {
      return !!this.get('storage').getItem('are-model-types-hidden');
    },
    set(key, value) {
      this.get('storage').setItem('are-model-types-hidden', value);
      return value;
    }
  })

Here's a similar approach.

@ghost
Copy link
Author

ghost commented Dec 21, 2017

@teddyzeenny definitely. I can try to put something together over the next few weeks. I like how simple your snippet is; will make implementing a breeze.

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 a pull request may close this issue.

1 participant