-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
UI: Set the CODE view as the default view for editing KV's #4651
Conversation
ui-v2/app/controllers/dc/kv/edit.js
Outdated
@@ -10,7 +10,7 @@ export default Controller.extend({ | |||
encoder: service('btoa'), | |||
setProperties: function(model) { | |||
// TODO: Potentially save whether json has been clicked to the model | |||
set(this, 'json', false); | |||
set(this, 'json', true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not just change this in the controller json: false
above?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good spot, the json: false
should have been changed to json: true
also.
But you bringing this up prompted me to think about why I was set
ting it here also. So after checking this I must have previously decided that this setting should always reset itself to the default (previously off, but this PR is about changing it to true) every single time you visited the KV page. In order to do this I reset it here to the default so it resets on every visit to the KV form.
I'm still so in two minds over this, so just checked in with @opihana who's tipped me the other way. So we've changed this so the KV code toggle acts more like a global setting, instead of just for whilst you are in the edit form. I definitely think this is better, made a commit reflecting this.
I think further work will be putting this now global setting into localStorage to last between sessions.
Previously we forced the KV toggle back to a default setting for every time you visited a KV form page. We've now changed this so that the KV code toggle button acts as a 'global' toggle. So whatever you set it as will be the same for every KV for the lifetime of your 'ember session' If we are to keep this, then consider saving this into localStorage settings or similar, added some thoughts re: this as it's very likely to happen.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updates look good!
Sets the code toggle on the KV edit/create page to be on by default, we figured most people probably prefer this view.
Fixes: #4558
And whilst doesn't completely address #4255 I would hazard a guess that it improves matters.