Remaining bug 1288450 work.

Benji York benji.york at canonical.com
Thu Mar 20 19:55:01 UTC 2014


I didn't have time to finish my work on bug 1288450 before my EOD and
I'm going to be out tomorrow so here is what I've found.

The root issue is that the container of the "Discard changes" and
"Save changes" buttons
defined in app/templates/service-configuration.handlebars is not having
its "closed" class removed when a file is selected.  Fixing that is
easy, just apply this diff:

--- a/app/views/viewlets/configfile-view-extension.js
+++ b/app/views/viewlets/configfile-view-extension.js
@@ -59,11 +59,13 @@ YUI.add('configfile-view-extension', function(Y) {
       @param {Y.EventFacade} e An event object.
     */
     handleFileChange: function(e) {
       var file = e.currentTarget.get('files').shift(),
           reader = new FileReader();
       reader.onerror = Y.bind(this.onFileError, this);
       reader.onload = Y.bind(this.onFileLoaded, this, file.name);
       reader.readAsText(file);
+      this.get('container').one('.controls').removeClass('closed');
     },

When the file is removed (by clicking the button again) the current
behavior is already correct.

Two additional things have to be changed for the bug to be fixed:
clicking on the "Discard Changes" button should cause the onRemoveFile
method in app/views/viewlets/configfile-view-extension.js to be called
and the "closed" class should be added back to the button container.

Additionally, clicking on "Save Changes" (which is handled by
"saveConfig" in app/views/viewlets/service-config.js) should do the same
thing that clicking "Deploy" on a ghost with a configuration file
selected.

Good luck, we're all counting on you.
-- 
Benji York



More information about the Juju-GUI mailing list