You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@guacamole.apache.org by jmuehlner <gi...@git.apache.org> on 2018/03/14 03:17:17 UTC
[GitHub] guacamole-client pull request #265: GUACAMOLE-526: Update webapp to angular ...
GitHub user jmuehlner opened a pull request:
https://github.com/apache/guacamole-client/pull/265
GUACAMOLE-526: Update webapp to angular 1.6.9.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/jmuehlner/guacamole-client angular-1.6.9
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/guacamole-client/pull/265.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 #265
----
commit e5e92e08ec319f80ddf9aef8c17ed42bcd00c193
Author: James Muehlner <ja...@...>
Date: 2018-03-14T02:58:34Z
GUACAMOLE-526: Update webapp to angular 1.6.9.
----
---
[GitHub] guacamole-client pull request #265: GUACAMOLE-526: Update webapp to angular ...
Posted by mike-jumper <gi...@git.apache.org>.
Github user mike-jumper commented on a diff in the pull request:
https://github.com/apache/guacamole-client/pull/265#discussion_r174346819
--- Diff: guacamole/pom.xml ---
@@ -388,9 +388,14 @@
<dependency>
<groupId>org.webjars.bower</groupId>
<artifactId>angular-translate-loader-static-files</artifactId>
- <version>2.8.0</version>
+ <version>2.16.0</version>
<scope>runtime</scope>
</dependency>
+ <dependency>
+ <groupId>org.webjars.bower</groupId>
+ <artifactId>angular-toArrayFilter</artifactId>
--- End diff --
The licenses of bundled dependencies will need to be updated (`guacamole/src/licenses`).
---
[GitHub] guacamole-client pull request #265: GUACAMOLE-526: Update webapp to angular ...
Posted by jmuehlner <gi...@git.apache.org>.
Github user jmuehlner commented on a diff in the pull request:
https://github.com/apache/guacamole-client/pull/265#discussion_r174350111
--- Diff: guacamole/pom.xml ---
@@ -388,9 +388,14 @@
<dependency>
<groupId>org.webjars.bower</groupId>
<artifactId>angular-translate-loader-static-files</artifactId>
- <version>2.8.0</version>
+ <version>2.16.0</version>
<scope>runtime</scope>
</dependency>
+ <dependency>
+ <groupId>org.webjars.bower</groupId>
+ <artifactId>angular-toArrayFilter</artifactId>
--- End diff --
Alright, updated.
---
[GitHub] guacamole-client pull request #265: GUACAMOLE-526: Update webapp to angular ...
Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:
https://github.com/apache/guacamole-client/pull/265
---
[GitHub] guacamole-client pull request #265: GUACAMOLE-526: Update webapp to angular ...
Posted by jmuehlner <gi...@git.apache.org>.
Github user jmuehlner commented on a diff in the pull request:
https://github.com/apache/guacamole-client/pull/265#discussion_r174344419
--- Diff: guacamole/pom.xml ---
@@ -388,9 +388,14 @@
<dependency>
<groupId>org.webjars.bower</groupId>
<artifactId>angular-translate-loader-static-files</artifactId>
- <version>2.8.0</version>
+ <version>2.16.0</version>
<scope>runtime</scope>
</dependency>
+ <dependency>
+ <groupId>org.webjars.bower</groupId>
+ <artifactId>angular-toArrayFilter</artifactId>
--- End diff --
The `orderBy` filter no longer supports objects, which necessitates transforming any object into an array before using it - that's what this new dependency is for.
---
[GitHub] guacamole-client pull request #265: GUACAMOLE-526: Update webapp to angular ...
Posted by mike-jumper <gi...@git.apache.org>.
Github user mike-jumper commented on a diff in the pull request:
https://github.com/apache/guacamole-client/pull/265#discussion_r183948475
--- Diff: guacamole/pom.xml ---
@@ -324,19 +324,25 @@
<dependency>
<groupId>org.webjars.bower</groupId>
<artifactId>angular</artifactId>
- <version>1.3.16</version>
+ <version>1.6.9</version>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.webjars.bower</groupId>
+ <artifactId>angular-cookies</artifactId>
--- End diff --
This dependency was removed via #273.
---
[GitHub] guacamole-client pull request #265: GUACAMOLE-526: Update webapp to angular ...
Posted by mike-jumper <gi...@git.apache.org>.
Github user mike-jumper commented on a diff in the pull request:
https://github.com/apache/guacamole-client/pull/265#discussion_r183616301
--- Diff: guacamole/src/main/webapp/app/rest/services/requestService.js ---
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * Service for converting $http promises that pass the entire response into
+ * promises that pass only the data from that response.
+ */
+angular.module('rest').factory('requestService', ['$q', '$http', 'Error',
+ function requestService($q, $http, Error) {
+
+ function wrappedHttpCall(object) {
--- End diff --
Please also use the same
var someFunc = function someFunc() {
...
};
declaration style used elsewhere within the webapp and JS API.
---
[GitHub] guacamole-client pull request #265: GUACAMOLE-526: Update webapp to angular ...
Posted by jmuehlner <gi...@git.apache.org>.
Github user jmuehlner commented on a diff in the pull request:
https://github.com/apache/guacamole-client/pull/265#discussion_r183946762
--- Diff: guacamole/src/main/webapp/app/rest/services/requestService.js ---
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * Service for converting $http promises that pass the entire response into
+ * promises that pass only the data from that response.
+ */
+angular.module('rest').factory('requestService', ['$q', '$http', 'Error',
+ function requestService($q, $http, Error) {
+
+ function wrappedHttpCall(object) {
+
+ var deferred = $q.defer();
+
+ $http(object)
--- End diff --
Good call. Updated and it looks much cleaner that way.
---
[GitHub] guacamole-client pull request #265: GUACAMOLE-526: Update webapp to angular ...
Posted by mike-jumper <gi...@git.apache.org>.
Github user mike-jumper commented on a diff in the pull request:
https://github.com/apache/guacamole-client/pull/265#discussion_r183612310
--- Diff: guacamole/src/main/webapp/app/rest/services/requestService.js ---
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * Service for converting $http promises that pass the entire response into
+ * promises that pass only the data from that response.
+ */
+angular.module('rest').factory('requestService', ['$q', '$http', 'Error',
+ function requestService($q, $http, Error) {
+
+ function wrappedHttpCall(object) {
--- End diff --
Documentation needed.
---
[GitHub] guacamole-client pull request #265: GUACAMOLE-526: Update webapp to angular ...
Posted by mike-jumper <gi...@git.apache.org>.
Github user mike-jumper commented on a diff in the pull request:
https://github.com/apache/guacamole-client/pull/265#discussion_r183614711
--- Diff: guacamole/src/main/webapp/app/rest/services/requestService.js ---
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * Service for converting $http promises that pass the entire response into
+ * promises that pass only the data from that response.
+ */
+angular.module('rest').factory('requestService', ['$q', '$http', 'Error',
+ function requestService($q, $http, Error) {
+
+ function wrappedHttpCall(object) {
+
+ var deferred = $q.defer();
+
+ $http(object)
--- End diff --
Perhaps it would be cleaner to leverage the `return` / `throw` magic provided by promises? Something like:
```js
return $http(object).then(
function success(request) { return request.data; },
function failure(request) { throw new Error(request.data); }
);
```
would remove one layer from the promise onion and the need for manual use of `$q`.
---
[GitHub] guacamole-client pull request #265: GUACAMOLE-526: Update webapp to angular ...
Posted by jmuehlner <gi...@git.apache.org>.
Github user jmuehlner commented on a diff in the pull request:
https://github.com/apache/guacamole-client/pull/265#discussion_r183946775
--- Diff: guacamole/src/main/webapp/app/index/filters/arrayFilter.js ---
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * A filter for transforming an object into a an array of all non-inherited
--- End diff --
Fixed.
---
[GitHub] guacamole-client pull request #265: GUACAMOLE-526: Update webapp to angular ...
Posted by mike-jumper <gi...@git.apache.org>.
Github user mike-jumper commented on a diff in the pull request:
https://github.com/apache/guacamole-client/pull/265#discussion_r183612542
--- Diff: guacamole/src/main/webapp/app/index/filters/arrayFilter.js ---
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * A filter for transforming an object into a an array of all non-inherited
+ * property values.
+ */
+angular.module('index').filter('toArray', [function toArrayFactory() {
+
+ return function toArrayFiter(input) {
+
+ // If no object is available, just return an empty array
+ if (!input) {
+ return [];
+ }
+
+ return Object.keys(input).map(function fetchValueByKey(key) {
+ return input[key]
--- End diff --
Missing semicolon.
---
[GitHub] guacamole-client pull request #265: GUACAMOLE-526: Update webapp to angular ...
Posted by mike-jumper <gi...@git.apache.org>.
Github user mike-jumper commented on a diff in the pull request:
https://github.com/apache/guacamole-client/pull/265#discussion_r183948571
--- Diff: guacamole/src/main/webapp/index.html ---
@@ -61,15 +61,16 @@
<script type="text/javascript" src="webjars/lodash/2.4.1/dist/lodash.min.js"></script>
<!-- AngularJS -->
- <script type="text/javascript" src="webjars/angular/1.3.16/angular.min.js"></script>
- <script type="text/javascript" src="webjars/angular-route/1.3.16/angular-route.min.js"></script>
- <script type="text/javascript" src="webjars/angular-touch/1.3.16/angular-touch.min.js"></script>
+ <script type="text/javascript" src="webjars/angular/1.6.9/angular.min.js"></script>
+ <script type="text/javascript" src="webjars/angular-cookies/1.6.9/angular-cookies.min.js"></script>
--- End diff --
Same here - this dependency was removed via #273.
---
[GitHub] guacamole-client pull request #265: GUACAMOLE-526: Update webapp to angular ...
Posted by jmuehlner <gi...@git.apache.org>.
Github user jmuehlner commented on a diff in the pull request:
https://github.com/apache/guacamole-client/pull/265#discussion_r183946769
--- Diff: guacamole/src/main/webapp/app/index/filters/arrayFilter.js ---
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * A filter for transforming an object into a an array of all non-inherited
+ * property values.
+ */
+angular.module('index').filter('toArray', [function toArrayFactory() {
+
+ return function toArrayFiter(input) {
+
+ // If no object is available, just return an empty array
+ if (!input) {
+ return [];
+ }
+
+ return Object.keys(input).map(function fetchValueByKey(key) {
+ return input[key]
--- End diff --
Fixed.
---
[GitHub] guacamole-client pull request #265: GUACAMOLE-526: Update webapp to angular ...
Posted by mike-jumper <gi...@git.apache.org>.
Github user mike-jumper commented on a diff in the pull request:
https://github.com/apache/guacamole-client/pull/265#discussion_r174346931
--- Diff: guacamole/pom.xml ---
@@ -388,9 +388,14 @@
<dependency>
<groupId>org.webjars.bower</groupId>
<artifactId>angular-translate-loader-static-files</artifactId>
- <version>2.8.0</version>
+ <version>2.16.0</version>
<scope>runtime</scope>
</dependency>
+ <dependency>
+ <groupId>org.webjars.bower</groupId>
+ <artifactId>angular-toArrayFilter</artifactId>
--- End diff --
Same for the bundled dependencies which are already documented but whose versions have changed:
https://github.com/apache/guacamole-client/blob/a6579ce4e1c70ea436fa1acc26a9ce2bb1e7fe84/guacamole/src/licenses/LICENSE#L214-L220
---
[GitHub] guacamole-client pull request #265: GUACAMOLE-526: Update webapp to angular ...
Posted by jmuehlner <gi...@git.apache.org>.
Github user jmuehlner commented on a diff in the pull request:
https://github.com/apache/guacamole-client/pull/265#discussion_r183946783
--- Diff: guacamole/src/main/webapp/app/rest/services/requestService.js ---
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * Service for converting $http promises that pass the entire response into
+ * promises that pass only the data from that response.
+ */
+angular.module('rest').factory('requestService', ['$q', '$http', 'Error',
+ function requestService($q, $http, Error) {
+
+ function wrappedHttpCall(object) {
--- End diff --
Done.
---
[GitHub] guacamole-client pull request #265: GUACAMOLE-526: Update webapp to angular ...
Posted by mike-jumper <gi...@git.apache.org>.
Github user mike-jumper commented on a diff in the pull request:
https://github.com/apache/guacamole-client/pull/265#discussion_r183612504
--- Diff: guacamole/src/main/webapp/app/index/filters/arrayFilter.js ---
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * A filter for transforming an object into a an array of all non-inherited
--- End diff --
"a an array"
---