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 2021/07/12 19:49:35 UTC

[GitHub] [brooklyn-ui] algairim commented on a change in pull request #245: Fix/quick launch dialog

algairim commented on a change in pull request #245:
URL: https://github.com/apache/brooklyn-ui/pull/245#discussion_r668015840



##########
File path: ui-modules/utils/quick-launch/quick-launch.js
##########
@@ -178,7 +185,8 @@ export function quickLaunchDirective() {
             }
         }
 
-        function addNewConfigKey() {
+        function addNewConfigKey({ name, type }) {
+            // console.log('$item', {name, type })

Review comment:
       To remove.

##########
File path: ui-modules/utils/quick-launch/quick-launch.js
##########
@@ -147,23 +144,33 @@ export function quickLaunchDirective() {
         function deployApp() {
             $scope.deploying = true;
 
-            Promise.resolve(buildYaml()).then(appYaml => {
-                quickLaunch.planSender(appYaml)
-                    .then((response) => {
-                        if ($scope.callback) {
-                            $scope.callback.apply({}, [{state: 'SUCCESS', data: response.data}]);
-                        } else {
-                            brSnackbar.create('Application Deployed');
-                        }
-                        $scope.deploying = false;
-                    })
-                    .catch((err) => {
-                        $scope.model.deployError = err.data.message;
-                        $scope.deploying = false;
-                    });
-            });
+            Promise.resolve(buildYaml())
+                .then(appYaml => {
+                    quickLaunch.planSender(appYaml)
+                        .then((response) => {
+                            if ($scope.callback) {
+                                $scope.callback.apply({}, [{state: 'SUCCESS', data: response.data}]);
+                            } else {
+                                brSnackbar.create('Application Deployed');
+                            }
+                            $scope.deploying = false;
+                        })
+                        .catch(({ data }) => {
+                            // handling API error
+                            handleDeployError({ message: data.message });

Review comment:
       Can be just `handleDeployError(data)`?

##########
File path: ui-modules/utils/quick-launch/quick-launch.js
##########
@@ -276,7 +281,7 @@ export function quickLaunchDirective() {
                         newApp[BROOKLYN_CONFIG] = newConfig;
                     }
                 }
-                
+
                 // prefer to use the actual yaml input, but if it's not possible
                 let tryMergeByConcatenate =
                     Object.keys(newApp).length ?

Review comment:
       Catch block might be required for the Promise in `showEditor` function. Find below.

##########
File path: ui-modules/utils/quick-launch/quick-launch.js
##########
@@ -43,22 +46,20 @@ export function quickLaunchDirective() {
         },
         controller: ['$scope', '$http', '$location', 'brSnackbar', 'brBrandInfo' , 'quickLaunchOverrides', controller]
     };
-
+f

Review comment:
       to remove `f`




-- 
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