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

UI: Set the CODE view as the default view for editing KV's #4651

Merged
merged 2 commits into from
Sep 13, 2018

Conversation

johncowen
Copy link
Contributor

@johncowen johncowen commented Sep 11, 2018

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.

@johncowen johncowen requested a review from a team September 11, 2018 11:39
@johncowen johncowen added the theme/ui Anything related to the UI label Sep 11, 2018
@johncowen johncowen requested a review from pearkes September 11, 2018 18:07
@johncowen johncowen added this to the 1.2.3 milestone Sep 12, 2018
@@ -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);
Copy link
Contributor

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?

Copy link
Contributor Author

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 setting 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.
Copy link
Contributor

@pearkes pearkes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updates look good!

@johncowen johncowen merged commit 028875a into master Sep 13, 2018
@johncowen johncowen deleted the feature/ui-kv-code-as-default branch September 13, 2018 08:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme/ui Anything related to the UI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants