[GitHub] guacamole-client pull request #281: GUACAMOLE-526: Use toArray as necessary ...

2018-04-30 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/guacamole-client/pull/281


---


[GitHub] guacamole-client pull request #281: GUACAMOLE-526: Use toArray as necessary ...

2018-04-30 Thread mike-jumper
GitHub user mike-jumper opened a pull request:

https://github.com/apache/guacamole-client/pull/281

GUACAMOLE-526: Use toArray as necessary for orderBy.

The `toArray` filter is necessary wherever `orderBy` is being used to 
iterate over an object, as iterating over an object is not possible with 
AngularJS 1.6.x. This filter is already being correctly used for the list of 
available protocols in the connection edit screen, but is missing from:

1. The list of share links in the Guacamole menu.
2. The timezone field (on the user edit screen for users from the JDBC 
auth).

These changes add `toArray` to the above locations.

Additionally, as cases like the timezone field require both the key and 
value of each property to be available, these changes modify the `toArray` 
filter to produce an array of key/value pairs rather than just an array of 
values.
 
Further, to avoid 
[infdig](https://docs.angularjs.org/error/$rootScope/infdig) due to constantly 
changing results, the `toArray` filter has been modified to cache the result of 
the previous run within the object converted. A new array is returned only if 
its contents differ from the previous run.

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/mike-jumper/guacamole-client fix-orderby

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/guacamole-client/pull/281.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #281


commit f7ca11df50c217d0c845897bccdbbc24563b9b51
Author: Michael Jumper 
Date:   2018-04-30T19:42:07Z

GUACAMOLE-526: Provide key/value pairs via toArray filter. Consistently 
return same array for same object.

commit ae6994a9124a57aebc16cfc8b4018048c8a64bcd
Author: Michael Jumper 
Date:   2018-04-30T20:37:09Z

GUACAMOLE-526: Use toArray where necessary for orderBy.




---