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
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ui-v2/app/controllers/dc/kv/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.

this.changeset = new Changeset(model.item, lookupValidator(validations), validations);
this._super({
...model,
Expand Down