mintsweet commented on code in PR #4099:
URL: 
https://github.com/apache/incubator-devlake/pull/4099#discussion_r1061237555


##########
config-ui/src/error/components/bp-upgrade/use-bp-upgrade.ts:
##########
@@ -118,7 +118,9 @@ export const useBPUpgrade = ({ id, onResetError }: 
UseBPUpgradeProps) => {
   const upgradeConnection = async (connection: any) => {
     const { plugin, connectionId } = connection;
 
-    const scopeList = await Promise.all(connection.scope.map((sc: any) => 
upgradeScope(plugin, connectionId, sc)));
+    const scopeList = connection.scope

Review Comment:
   `const scopeList = await Promise.all((connection.scope ?? []).map((sc: any) 
=> upgradeScope(plugin, connectionId, sc)));`



##########
config-ui/src/pages/blueprint/detail/panel/configuration.tsx:
##########
@@ -64,7 +64,7 @@ export const Configuration = ({ blueprint, operating, 
onUpdate, onRefresh }: Pro
             name: plugin.name,
             connectionId: cs.connectionId,
             entities: plugin.entities,
-            selectedEntites: cs.scopes[0].entities,
+            selectedEntites: cs.scopes.length > 0 ? cs.scopes[0].entities : [],

Review Comment:
   `cs.scopes?.[0].entities ?? []`



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to