Skip to content

Commit 9f8f239

Browse files
preetriti1Priti Sambandam
and
Priti Sambandam
authored
fix(designer): Fix loading indicator while adding new action (#4716)
Co-authored-by: Priti Sambandam <[email protected]>
1 parent 8a80d00 commit 9f8f239

File tree

2 files changed

+19
-20
lines changed

2 files changed

+19
-20
lines changed

libs/designer/src/lib/core/actions/bjsworkflow/add.ts

+18-19
Original file line numberDiff line numberDiff line change
@@ -233,22 +233,9 @@ export const initializeOperationDetails = async (
233233
addTokensAndVariables(nodeId, type, initData, state, dispatch);
234234
}
235235

236-
if (!isConnectionRequired) {
237-
updateDynamicDataInNode(
238-
nodeId,
239-
isTrigger,
240-
operationInfo,
241-
undefined,
242-
initData.nodeDependencies,
243-
initData.nodeInputs,
244-
initData.settings as Settings,
245-
getAllVariables(getState().tokens.variables),
246-
dispatch,
247-
getState
248-
);
249-
} else if (connector) {
236+
if (isConnectionRequired) {
250237
try {
251-
await trySetDefaultConnectionForNode(nodeId, connector, dispatch, isConnectionRequired);
238+
await trySetDefaultConnectionForNode(nodeId, connector as Connector, dispatch, isConnectionRequired);
252239
} catch (e: any) {
253240
dispatch(
254241
updateErrorDetails({
@@ -259,12 +246,25 @@ export const initializeOperationDetails = async (
259246
},
260247
})
261248
);
262-
dispatch(setIsPanelLoading(false));
263249
}
250+
} else {
251+
updateDynamicDataInNode(
252+
nodeId,
253+
isTrigger,
254+
operationInfo,
255+
undefined,
256+
initData.nodeDependencies,
257+
initData.nodeInputs,
258+
initData.settings as Settings,
259+
getAllVariables(getState().tokens.variables),
260+
dispatch,
261+
getState
262+
);
264263
}
265264

266-
const schemaService = staticResultService.getOperationResultSchema(connectorId, operationId, swagger || parsedManifest);
267-
schemaService.then((schema) => {
265+
dispatch(setIsPanelLoading(false));
266+
267+
staticResultService.getOperationResultSchema(connectorId, operationId, swagger || parsedManifest).then((schema) => {
268268
if (schema) {
269269
dispatch(addResultSchema({ id: `${connectorId}-${operationId}`, schema: schema }));
270270
}
@@ -279,7 +279,6 @@ export const initializeOperationDetails = async (
279279
}
280280

281281
updateAllUpstreamNodes(getState() as RootState, dispatch);
282-
dispatch(setIsPanelLoading(false));
283282
};
284283

285284
export const initializeSwitchCaseFromManifest = async (id: string, manifest: OperationManifest, dispatch: Dispatch): Promise<void> => {

libs/designer/src/lib/ui/panel/panelRoot.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export const PanelRoot = (props: PanelRootProps): JSX.Element => {
7777
</div>
7878
);
7979

80-
return (!isLoadingPanel && isUndefined(currentPanelMode)) || currentPanelMode === 'Operation' ? (
80+
return !isLoadingPanel && (isUndefined(currentPanelMode) || currentPanelMode === 'Operation') ? (
8181
<NodeDetailsPanel {...commonPanelProps} />
8282
) : (
8383
<Panel

0 commit comments

Comments
 (0)