You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brooklyn.apache.org by GitBox <gi...@apache.org> on 2022/05/17 08:45:15 UTC

[GitHub] [brooklyn-ui] jcabrerizo opened a new pull request, #325: Add `order` as module property and use it when is present before using name for ordering modules

jcabrerizo opened a new pull request, #325:
URL: https://github.com/apache/brooklyn-ui/pull/325

   Allows to set up an order for listing the modules in the home page and the header menu. Also it renames the `App inspector` to just `Inspector` as it Apache Brooklyn can manage more than applications. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@brooklyn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [brooklyn-ui] grkvlt commented on a diff in pull request #325: Add `order` as module property and use it when is present before using name for ordering modules

Posted by GitBox <gi...@apache.org>.
grkvlt commented on code in PR #325:
URL: https://github.com/apache/brooklyn-ui/pull/325#discussion_r875633721


##########
ui-modules/utils/utils/general.js:
##########
@@ -54,10 +54,23 @@ export function isNonEmpty(object) {
     return true; 
 }
 
+export function uiModuleComparator(moduleA, moduleB) {
+    if(moduleA.order && moduleB.order){
+        if (moduleA.order > moduleB.order) {

Review Comment:
   another simplification maybe `if (moduleA.order != moduleB.order) return moduleA.order - moduleB.order`



##########
ui-modules/utils/utils/general.js:
##########
@@ -54,10 +54,23 @@ export function isNonEmpty(object) {
     return true; 
 }
 
+export function uiModuleComparator(moduleA, moduleB) {
+    if(moduleA.order && moduleB.order){
+        if (moduleA.order > moduleB.order) {
+            return 1;
+        }
+        if(moduleA.order < moduleB.order) {
+            return -1;
+        }
+    }
+    // If no order implemented or is the same, order by name
+    return moduleA.name > moduleB.name ? 1: -1;

Review Comment:
   is something like `moduleA.name.localeCompare(moduleB.name)` better?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@brooklyn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [brooklyn-ui] jcabrerizo merged pull request #325: Add `order` as module property and use it when is present before using name for ordering modules

Posted by GitBox <gi...@apache.org>.
jcabrerizo merged PR #325:
URL: https://github.com/apache/brooklyn-ui/pull/325


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@brooklyn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [brooklyn-ui] jcabrerizo commented on pull request #325: Add `order` as module property and use it when is present before using name for ordering modules

Posted by GitBox <gi...@apache.org>.
jcabrerizo commented on PR #325:
URL: https://github.com/apache/brooklyn-ui/pull/325#issuecomment-1129810960

   Thank you for the comments @grkvlt. I merge the code addressing 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@brooklyn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [brooklyn-ui] grkvlt commented on a diff in pull request #325: Add `order` as module property and use it when is present before using name for ordering modules

Posted by GitBox <gi...@apache.org>.
grkvlt commented on code in PR #325:
URL: https://github.com/apache/brooklyn-ui/pull/325#discussion_r875645168


##########
ui-modules/app-inspector/package.json:
##########
@@ -37,7 +37,7 @@
     "npm": ">=5.0.0"
   },
   "brooklyn": {
-    "appname": "App Inspector"
+    "appname": "Inspector"

Review Comment:
   Should this be in this PR?



##########
ui-modules/app-inspector/src/main/resources/ui-module/config.yaml:
##########
@@ -15,7 +15,8 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-name: App Inspector
+name: Inspector

Review Comment:
   Same?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@brooklyn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org