[Freeipa-devel] [PATCH] 0036 Fix displaying of success message

Ana Krivokapic akrivoka at redhat.com
Thu Jun 13 15:33:01 UTC 2013


On 06/13/2013 05:18 PM, Petr Vobornik wrote:
> On 06/13/2013 04:16 PM, Ana Krivokapic wrote:
>> Hello,
>>
>> Make sure that the success message in web UI is properly populated with actual
>> number of items that were successfully added/removed.
>>
>> https://fedorahosted.org/freeipa/ticket/3708
>>
>
> The changes look good. But I've found an existing issue in the code which was
> moved to get_succeeded:
>
> When no operation succeeds following code behaves incorrectly:
>
> +    var succeeded = data.result.completed;
> +
> +    if (!succeeded) {
>
> The condition is evaluated as true when data.result.completed === 0. It's not
> desired because the subsequent commands in the if block will raise JS error
> (data.result doesn't have results obj).
>
> So we should check for:
>     if (typeof succeeded !== 'number')
>
>

Nice catch, thanks. Updated patch attached.

-- 
Regards,

Ana Krivokapic
Associate Software Engineer
FreeIPA team
Red Hat Inc.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: freeipa-akrivoka-0036-02-Fix-displaying-of-success-message.patch
Type: text/x-patch
Size: 5272 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20130613/6f0f7f76/attachment.bin>


More information about the Freeipa-devel mailing list