-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Conversation
I was checking the dialogs that use templates, and the only real difference is the content inside |
Hi @TomMalbran -- we finally got around to discussing this one. Overall, the approach looks great, but we had a couple of suggestions:
|
Thanks for checking this.
|
For (2), I think the reason it doesn't seem that useful to have it factored out into the JSON file is that most of these dialogs are only used once anyway, so you might as well just have the caller pass in the buttons. (The "title" and "message" fields are all blank in the JSON anyway, and they always get replaced with custom titles/messages so there isn't really any point in having those factored out either.) The only dialog in that list that gets reused often is the error dialog, and in that case there's just an "OK" button anyway. |
Thanks for the merge. Any thoughts on getting rid of the JSON file per the last comment above? |
Yes, I will make it another parameter of About extending the promise object. Right now we are only using the done method, since it can't never actually fail. So it might be easier to have a done method on the returned Dialog object, that invokes the done method of the promise? If is required to use any other method/property of the promise object you could just retrieve it like now and use it. |
I've made the following changes on this update:
|
NativeFileSystem = require("file/NativeFileSystem").NativeFileSystem, | ||
ProjectManager = require("project/ProjectManager"), | ||
DocumentManager = require("document/DocumentManager"), | ||
EditorManager = require("editor/EditorManager"), | ||
FileViewController = require("project/FileViewController"), |
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.
This 2 modules aren't required anymore so I removed them.
Hey @TomMalbran - thanks for the updates. The changes all look good. I just had a couple minor comments. |
@gruehle Thanks for the review. I addressed all your comments and added a few more fixes that I found going over the code multiple times. |
I noticed that I haven't addressed what was mentioned in #3522. Even if the changes where not used, some of the things mentioned could still be used. The Dialog class could have the handle key function as one of the method and the Dialog would store the autoDismiss property, we we can then save an array of Dialogs. The dialog could also have the add and remove listeners methods. |
@TomMalbran @gruehle I think as long as the nested dialog key handling code that we ended up going with (using the To make sure it's still working, just bring up Extension Manager and click on the Install from URL button, then make sure you can type into the install field, and that the first ESC closes the install dialog and the second ESC closes the extension manager. |
I tested with nested dialogs and everything worked fine. @TomMalbran - there is a merge conflict in FileSyncManager.js. Could you clean that up? Everything else is ready to go. |
@gruehle Merged with master and solved the conflict issue. If I didn't missed any change, which I believe I didn't, this might be ready. |
Looks good to me. Thanks @TomMalbran! |
[ARCH] Improving the Dialog API
It looks like this change breaks modal dialogs in the EWF extension. Would someone mind emailing the brackets-dev Google group with a little summary of the changes and perhaps some advice on how clients can update their code? Thanks! |
@TomMalbran - could you add the API changes to the Sprint 26 release notes? |
@iwehrman The problem is that @gruehle I'll try to add it, but I might need some help, so if you can, please let me know or change what would be required after. |
@TomMalbran Thanks for the info! Hey, I'm just gonna throw this out there: it looks like you did a bang-up job patching up the modals in Brackets on this pull; if you want to help out with another project, it would be awesome if you could do the same for the Adobe Edge Web Fonts Brackets extension. If you don't have time, no biggie; it looks like the changes will be straightforward. But, if you do, mention issue adobe/brackets-edge-web-fonts#133 and I'll merge it in straightaway! |
This pull request addresses the following issues in the Dialogs API:
258: Now the templates that don't use a template are templatized. This is done by using a generic template for all, a JSON object to define the variables for the default dialogs and a title and message parameters that replace the template variables if defined. The template is rendered and then the dialog is generated. This also adds a new function to create a new Dialog by passing an object instead of using the pre-defined ones.
3077: All the show dialog functions now return a new Dialog instance, which has the promise the dialog element and a close method. These can then be easily expanded to add more methods.
Since the buttons are links and there is only one button at the left side, by removing the
float: right
and aligning them to the right I was able to be displayed in the order they appear in the template.1089: Since now the buttons are displayed in the order they appear in the template, by going back to the old styles I was able to reverse the order of the Save/Cancel buttons just on windows.
I can split the request if needed, but since all are related to the dialogs I thought it was better to address them all together.