[Freeipa-devel] [PATCH] 002 Fixed adding host without DNS reverse zone
Petr Vobornik
pvoborni at redhat.com
Thu Aug 4 09:22:11 UTC 2011
new version attached
On Fri, 2011-07-29 at 12:11 -0500, Endi Sukma Dewata wrote:
> On 7/29/2011 11:12 AM, Petr Vobornik wrote:
> > There was a small error in add.js:162. Fixed!
>
> Nice job on the dialog boxes.
>
> There's a problem though, the Retry doesn't quite work. This is because
> 'this' object passed to IPA.error_dialog actually points to Ajax context
> instead of the IPA.command, so calling execute() on it will fail.
Fixed
>
> When Ajax call returns, it passes a context via 'this' object to the
> callback function. The object might contain some useful information
> which we would not be able to get any other way. The original code tries
> to maintain the context by passing 'this' object along the chain using
> call(). Feel free to add comments in the code to clarify this.
>
> So in dialog_open() you should pass 'that' into the 'command' parameter.
> You also need pass 'this' using another parameter so you can use it to
> call the error handler if you click Cancel.
>
> Also these changes should be reverted back to maintain the Ajax context:
>
> - that.on_error.call(this, xhr, text_status, error_thrown);
> + that.on_error(xhr, text_status, error_thrown);
>
> - that.on_success.call(this, data, text_status, xhr);
> + that.on_success(data, text_status, xhr);
Reverted back. Just for my information: ajax context is preserved for
some future use, or it is already used somewhere?
> The IPA.add_dialog can store the command object as an instance variable
> so the IPA.host_adder_dialog can refer to it from the error handler.
>
> Another thing, in the init() you can access the spec object directly, so
> don't really have to pass it as a parameter.
Yeah, I know. The purpose for this was to be able to call init method
again later (which was made public as xxx_init(spec)). But probably it
isn't in compliance with removes of public init methods.
petr
-------------- next part --------------
A non-text attachment was scrubbed...
Name: freeipa-pvoborni-0002-5-Fixed-adding-host-without-DNS-reverse-zone.patch
Type: text/x-patch
Size: 10333 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20110804/312b94d7/attachment.bin>
More information about the Freeipa-devel
mailing list