Skip to content

Commit 76a7400

Browse files
authored
fix(designer): Sets right run data from repetition for nested components instead of general run data (#5347)
* Update aria label * Update run data based on repetitionCount if its in loop * Update snapshots * Remove success callback and relay on cachedata
1 parent a4a337b commit 76a7400

File tree

8 files changed

+74
-135
lines changed

8 files changed

+74
-135
lines changed

Localize/lang/strings.json

+2
Original file line numberDiff line numberDiff line change
@@ -2625,6 +2625,7 @@
26252625
"_xHyhqO.comment": "First bullet point of stateless type",
26262626
"_xJ6vjn.comment": "Label for description of custom uriComponentToString Function",
26272627
"_xJQeeC.comment": "Time zone value ",
2628+
"_xK8r1/.comment": "Run information loading text",
26282629
"_xMgLd8.comment": "title for retry minimum interval setting",
26292630
"_xN3GEX.comment": "Client Certificate Password Placeholder Text",
26302631
"_xQQ9ko.comment": "title for pagination user input",
@@ -3335,6 +3336,7 @@
33353336
"xHyhqO": "Optimized for low latency",
33363337
"xJ6vjn": "Returns a string representation of a URI encoded string",
33373338
"xJQeeC": "(UTC+02:00) Istanbul",
3339+
"xK8r1/": "Run information loading",
33383340
"xMgLd8": "Minimum interval",
33393341
"xN3GEX": "Enter password as plain text or use a secure parameter",
33403342
"xQQ9ko": "Threshold",

apps/Standalone/src/designer/app/AzureLogicAppsDesigner/Services/WorkflowAndArtifacts.tsx

+1-7
Original file line numberDiff line numberDiff line change
@@ -181,12 +181,7 @@ const getWorkflowAndArtifactsConsumption = async (workflowId: string): Promise<W
181181
return response.data;
182182
};
183183

184-
export const useRunInstanceStandard = (
185-
workflowName: string,
186-
onRunInstanceSuccess: (data: LogicAppsV2.RunInstanceDefinition) => void,
187-
appId?: string,
188-
runId?: string
189-
) => {
184+
export const useRunInstanceStandard = (workflowName: string, appId?: string, runId?: string) => {
190185
return useQuery(
191186
['getRunInstance', appId, workflowName, runId],
192187
async () => {
@@ -218,7 +213,6 @@ export const useRunInstanceStandard = (
218213
refetchOnMount: false,
219214
refetchOnReconnect: false,
220215
refetchOnWindowFocus: false,
221-
onSuccess: onRunInstanceSuccess,
222216
}
223217
);
224218
};

apps/Standalone/src/designer/app/AzureLogicAppsDesigner/laDesigner.tsx

+13-11
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ import {
4545
isArmResourceId,
4646
optional,
4747
} from '@microsoft/logic-apps-shared';
48-
import type { ContentType, IWorkflowService, LogicAppsV2 } from '@microsoft/logic-apps-shared';
48+
import type { ContentType, IWorkflowService } from '@microsoft/logic-apps-shared';
4949
import type { AllCustomCodeFiles, CustomCodeFileNameMapping, Workflow } from '@microsoft/logic-apps-designer';
5050
import {
5151
DesignerProvider,
@@ -104,16 +104,7 @@ const DesignerEditor = () => {
104104
const parameters = useMemo(() => data?.properties.files[Artifact.ParametersFile] ?? {}, [data?.properties.files]);
105105
const queryClient = getReactQueryClient();
106106

107-
const onRunInstanceSuccess = async (runDefinition: LogicAppsV2.RunInstanceDefinition) => {
108-
if (isMonitoringView) {
109-
const standardAppInstance = {
110-
...workflow,
111-
definition: runDefinition.properties.workflow.properties.definition,
112-
};
113-
setWorkflow(standardAppInstance);
114-
}
115-
};
116-
const { data: runInstanceData } = useRunInstanceStandard(workflowName, onRunInstanceSuccess, appId, runId);
107+
const { data: runInstanceData } = useRunInstanceStandard(workflowName, appId, runId);
117108

118109
const connectionsData = useMemo(
119110
() =>
@@ -193,6 +184,17 @@ const DesignerEditor = () => {
193184
}
194185
}, []);
195186

187+
useEffect(() => {
188+
if (isMonitoringView && runInstanceData) {
189+
setWorkflow((previousWorkflow: any) => {
190+
return {
191+
...previousWorkflow,
192+
definition: runInstanceData.properties.workflow.properties.definition,
193+
};
194+
});
195+
}
196+
}, [isMonitoringView, runInstanceData]);
197+
196198
useEffect(() => {
197199
setWorkflow(data?.properties.files[Artifact.WorkflowFile]);
198200
}, [data?.properties.files]);

libs/designer-ui/src/lib/monitoring/statuspill/__test__/__snapshots__/statusicon.spec.tsx.snap

+10-67
Original file line numberDiff line numberDiff line change
@@ -194,74 +194,17 @@ exports[`lib/monitoring/statuspill/statusicon > renders (status = Unknown, has r
194194
`;
195195

196196
exports[`lib/monitoring/statuspill/statusicon > renders (status = Waiting, has retries = false) 1`] = `
197-
<svg
198-
fill="none"
199-
height="24"
200-
viewBox="0 0 32 33"
201-
width="24"
202-
xmlns="http://www.w3.org/2000/svg"
197+
<div
198+
aria-label="Run information loading"
199+
className="fui-Spinner r1k3z50n"
200+
role="progressbar"
203201
>
204-
<g
205-
filter="url(#filter0_d)"
202+
<span
203+
className="fui-Spinner__spinner rvgcg50 ___ruqntd0_k4fqbj0 fjamq6b f64fuq3 f1v3ph3m"
206204
>
207-
<circle
208-
cx="16"
209-
cy="16"
210-
fill="#fff"
211-
r="14"
205+
<span
206+
className="fui-Spinner__spinnerTail r1lregi5"
212207
/>
213-
</g>
214-
<circle
215-
cx="16"
216-
cy="16"
217-
fill="#fff"
218-
r="12"
219-
/>
220-
<path
221-
d="M27.5664 19.1875L25.6417 18.6439L25.6398 18.6507L25.6379 18.6575L27.5664 19.1875ZM26.3594 22.0586L28.0797 23.0786L28.0836 23.072L26.3594 22.0586ZM22.0469 26.3594L21.0335 24.6351L21.0269 24.639L22.0469 26.3594ZM19.1875 27.5781L19.7175 29.5066L19.7243 29.5048L19.7311 29.5028L19.1875 27.5781ZM12.8125 27.5781L12.2689 29.5028L12.2757 29.5048L12.2825 29.5066L12.8125 27.5781ZM9.94141 26.3594L8.92138 28.0797L8.92803 28.0836L9.94141 26.3594ZM7.51562 24.4844L6.09387 25.891L6.10139 25.8986L6.10899 25.9061L7.51562 24.4844ZM5.64062 22.0586L3.91636 23.072L3.92029 23.0786L5.64062 22.0586ZM4.42188 19.1875L2.49337 19.7175L2.49525 19.7243L2.49717 19.7311L4.42188 19.1875ZM4.42188 12.8125L2.49717 12.2689L2.49525 12.2757L2.49337 12.2825L4.42188 12.8125ZM5.64062 9.95312L7.36097 10.9732L7.36488 10.9665L5.64062 9.95312ZM9.94141 5.64062L8.92802 3.91636L8.92138 3.92029L9.94141 5.64062ZM12.8125 4.43359L13.3425 6.3621L13.3493 6.36022L13.3561 6.3583L12.8125 4.43359ZM19.1875 4.43359L18.6439 6.3583L18.6507 6.36022L18.6575 6.3621L19.1875 4.43359ZM22.0469 5.64062L21.0268 7.36097L21.0335 7.36488L22.0469 5.64062ZM24.4727 7.52734L23.0509 8.93397L23.0584 8.94158L23.066 8.9491L24.4727 7.52734ZM26.3594 9.95312L24.6351 10.9665L24.639 10.9731L26.3594 9.95312ZM27.5664 12.8125L25.6379 13.3425L25.6398 13.3493L25.6417 13.3561L27.5664 12.8125ZM26 16C26 16.9244 25.879 17.8036 25.6417 18.6439L29.4911 19.7311C29.8319 18.5245 30 17.2788 30 16H26ZM25.6379 18.6575C25.4019 19.5162 25.0671 20.3102 24.6351 21.0452L28.0836 23.072C28.6985 22.0258 29.1684 20.9056 29.4949 19.7175L25.6379 18.6575ZM24.639 21.0386C24.2018 21.776 23.6761 22.4525 23.0584 23.0702L25.8869 25.8986C26.7379 25.0475 27.4701 24.1068 28.0797 23.0786L24.639 21.0386ZM23.0584 23.0702C22.4525 23.6761 21.7787 24.1971 21.0335 24.6351L23.0603 28.0836C24.0963 27.4747 25.0397 26.7457 25.8869 25.8986L23.0584 23.0702ZM21.0269 24.639C20.2986 25.0708 19.5064 25.4098 18.6439 25.6534L19.7311 29.5028C20.9155 29.1683 22.0295 28.6948 23.0669 28.0797L21.0269 24.639ZM18.6575 25.6496C17.8132 25.8817 16.9293 26 16 26V30C17.2738 30 18.5149 29.8371 19.7175 29.5066L18.6575 25.6496ZM16 26C15.0707 26 14.1868 25.8817 13.3425 25.6496L12.2825 29.5066C13.4851 29.8371 14.7262 30 16 30V26ZM13.3561 25.6534C12.4923 25.4095 11.6937 25.0694 10.9548 24.6351L8.92803 28.0836C9.97033 28.6962 11.0858 29.1687 12.2689 29.5028L13.3561 25.6534ZM10.9614 24.639C10.2201 24.1995 9.54121 23.675 8.92226 23.0626L6.10899 25.9061C6.95879 26.7469 7.89706 27.4724 8.92138 28.0797L10.9614 24.639ZM8.93738 23.0777C8.32501 22.4588 7.80049 21.7799 7.36096 21.0386L3.92029 23.0786C4.52763 24.1029 5.25312 25.0412 6.09387 25.891L8.93738 23.0777ZM7.36488 21.0452C6.93059 20.3063 6.59055 19.5077 6.34658 18.6439L2.49717 19.7311C2.83132 20.9142 3.30379 22.0297 3.91637 23.072L7.36488 21.0452ZM6.35038 18.6575C6.11835 17.8132 6 16.9293 6 16H2C2 17.2738 2.1629 18.5149 2.49337 19.7175L6.35038 18.6575ZM6 16C6 15.0707 6.11835 14.1868 6.35038 13.3425L2.49337 12.2825C2.1629 13.4851 2 14.7262 2 16H6ZM6.34658 13.3561C6.59019 12.4936 6.92918 11.7014 7.36096 10.9731L3.92029 8.9331C3.30519 9.97051 2.83169 11.0845 2.49717 12.2689L6.34658 13.3561ZM7.36488 10.9665C7.80285 10.2213 8.32385 9.54754 8.92984 8.94156L6.10141 6.11313C5.25427 6.96027 4.52527 7.9037 3.91637 8.93975L7.36488 10.9665ZM8.92984 8.94156C9.54753 8.32386 10.224 7.7982 10.9614 7.36096L8.92138 3.92029C7.89319 4.52993 6.95247 5.26208 6.10141 6.11313L8.92984 8.94156ZM10.9548 7.36488C11.6898 6.93289 12.4838 6.59808 13.3425 6.3621L12.2825 2.50509C11.0944 2.83161 9.97424 3.30149 8.92803 3.91637L10.9548 7.36488ZM13.3561 6.3583C14.1964 6.12096 15.0756 6 16 6V2C14.7212 2 13.4755 2.1681 12.2689 2.50889L13.3561 6.3583ZM16 6C16.9244 6 17.8036 6.12096 18.6439 6.3583L19.7311 2.50889C18.5245 2.1681 17.2788 2 16 2V6ZM18.6575 6.3621C19.515 6.59773 20.3026 6.93151 21.0269 7.36096L23.0669 3.92029C22.0256 3.30286 20.9069 2.83196 19.7175 2.50509L18.6575 6.3621ZM21.0335 7.36488C21.7748 7.80057 22.4461 8.32271 23.0509 8.93397L25.8944 6.12071C25.046 5.26323 24.1002 4.52755 23.0603 3.91637L21.0335 7.36488ZM23.066 8.9491C23.6773 9.55386 24.1994 10.2252 24.6351 10.9665L28.0836 8.93975C27.4724 7.89982 26.7368 6.95395 25.8793 6.10559L23.066 8.9491ZM24.639 10.9731C25.0685 11.6974 25.4023 12.485 25.6379 13.3425L29.4949 12.2825C29.168 11.0931 28.6971 9.97443 28.0797 8.9331L24.639 10.9731ZM25.6417 13.3561C25.879 14.1964 26 15.0756 26 16H30C30 14.7212 29.8319 13.4755 29.4911 12.2689L25.6417 13.3561Z"
222-
fill="#979593"
223-
/>
224-
<defs>
225-
<filter
226-
colorInterpolationFilters="sRGB"
227-
filterUnits="userSpaceOnUse"
228-
height="31.6"
229-
id="filter0_d"
230-
width="31.6"
231-
x="0.2"
232-
y="0.8"
233-
>
234-
<feFlood
235-
floodOpacity="0"
236-
result="BackgroundImageFix"
237-
/>
238-
<feColorMatrix
239-
in="SourceAlpha"
240-
type="matrix"
241-
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
242-
/>
243-
<feOffset
244-
dy="0.6"
245-
/>
246-
<feGaussianBlur
247-
stdDeviation="0.9"
248-
/>
249-
<feColorMatrix
250-
type="matrix"
251-
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"
252-
/>
253-
<feBlend
254-
in2="BackgroundImageFix"
255-
mode="normal"
256-
result="effect1_dropShadow"
257-
/>
258-
<feBlend
259-
in="SourceGraphic"
260-
in2="effect1_dropShadow"
261-
mode="normal"
262-
result="shape"
263-
/>
264-
</filter>
265-
</defs>
266-
</svg>
208+
</span>
209+
</div>
267210
`;
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,14 @@
1-
import { useTheme } from '@fluentui/react';
1+
import { Spinner } from '@fluentui/react-components';
2+
import { useIntl } from 'react-intl';
23

34
export const Waiting: React.FC = () => {
4-
const { isInverted } = useTheme();
5-
const circleFill = isInverted ? '#323130' : '#fff';
6-
const pathFill = isInverted ? '#979593' : '#979593';
7-
8-
return (
9-
<svg width="24" height="24" viewBox="0 0 32 33" fill="none" xmlns="http://www.w3.org/2000/svg">
10-
<g filter="url(#filter0_d)">
11-
<circle cx="16" cy="16" r="14" fill={circleFill} />
12-
</g>
13-
<circle cx="16" cy="16" r="12" fill={circleFill} />
14-
<path
15-
d="M27.5664 19.1875L25.6417 18.6439L25.6398 18.6507L25.6379 18.6575L27.5664 19.1875ZM26.3594 22.0586L28.0797 23.0786L28.0836 23.072L26.3594 22.0586ZM22.0469 26.3594L21.0335 24.6351L21.0269 24.639L22.0469 26.3594ZM19.1875 27.5781L19.7175 29.5066L19.7243 29.5048L19.7311 29.5028L19.1875 27.5781ZM12.8125 27.5781L12.2689 29.5028L12.2757 29.5048L12.2825 29.5066L12.8125 27.5781ZM9.94141 26.3594L8.92138 28.0797L8.92803 28.0836L9.94141 26.3594ZM7.51562 24.4844L6.09387 25.891L6.10139 25.8986L6.10899 25.9061L7.51562 24.4844ZM5.64062 22.0586L3.91636 23.072L3.92029 23.0786L5.64062 22.0586ZM4.42188 19.1875L2.49337 19.7175L2.49525 19.7243L2.49717 19.7311L4.42188 19.1875ZM4.42188 12.8125L2.49717 12.2689L2.49525 12.2757L2.49337 12.2825L4.42188 12.8125ZM5.64062 9.95312L7.36097 10.9732L7.36488 10.9665L5.64062 9.95312ZM9.94141 5.64062L8.92802 3.91636L8.92138 3.92029L9.94141 5.64062ZM12.8125 4.43359L13.3425 6.3621L13.3493 6.36022L13.3561 6.3583L12.8125 4.43359ZM19.1875 4.43359L18.6439 6.3583L18.6507 6.36022L18.6575 6.3621L19.1875 4.43359ZM22.0469 5.64062L21.0268 7.36097L21.0335 7.36488L22.0469 5.64062ZM24.4727 7.52734L23.0509 8.93397L23.0584 8.94158L23.066 8.9491L24.4727 7.52734ZM26.3594 9.95312L24.6351 10.9665L24.639 10.9731L26.3594 9.95312ZM27.5664 12.8125L25.6379 13.3425L25.6398 13.3493L25.6417 13.3561L27.5664 12.8125ZM26 16C26 16.9244 25.879 17.8036 25.6417 18.6439L29.4911 19.7311C29.8319 18.5245 30 17.2788 30 16H26ZM25.6379 18.6575C25.4019 19.5162 25.0671 20.3102 24.6351 21.0452L28.0836 23.072C28.6985 22.0258 29.1684 20.9056 29.4949 19.7175L25.6379 18.6575ZM24.639 21.0386C24.2018 21.776 23.6761 22.4525 23.0584 23.0702L25.8869 25.8986C26.7379 25.0475 27.4701 24.1068 28.0797 23.0786L24.639 21.0386ZM23.0584 23.0702C22.4525 23.6761 21.7787 24.1971 21.0335 24.6351L23.0603 28.0836C24.0963 27.4747 25.0397 26.7457 25.8869 25.8986L23.0584 23.0702ZM21.0269 24.639C20.2986 25.0708 19.5064 25.4098 18.6439 25.6534L19.7311 29.5028C20.9155 29.1683 22.0295 28.6948 23.0669 28.0797L21.0269 24.639ZM18.6575 25.6496C17.8132 25.8817 16.9293 26 16 26V30C17.2738 30 18.5149 29.8371 19.7175 29.5066L18.6575 25.6496ZM16 26C15.0707 26 14.1868 25.8817 13.3425 25.6496L12.2825 29.5066C13.4851 29.8371 14.7262 30 16 30V26ZM13.3561 25.6534C12.4923 25.4095 11.6937 25.0694 10.9548 24.6351L8.92803 28.0836C9.97033 28.6962 11.0858 29.1687 12.2689 29.5028L13.3561 25.6534ZM10.9614 24.639C10.2201 24.1995 9.54121 23.675 8.92226 23.0626L6.10899 25.9061C6.95879 26.7469 7.89706 27.4724 8.92138 28.0797L10.9614 24.639ZM8.93738 23.0777C8.32501 22.4588 7.80049 21.7799 7.36096 21.0386L3.92029 23.0786C4.52763 24.1029 5.25312 25.0412 6.09387 25.891L8.93738 23.0777ZM7.36488 21.0452C6.93059 20.3063 6.59055 19.5077 6.34658 18.6439L2.49717 19.7311C2.83132 20.9142 3.30379 22.0297 3.91637 23.072L7.36488 21.0452ZM6.35038 18.6575C6.11835 17.8132 6 16.9293 6 16H2C2 17.2738 2.1629 18.5149 2.49337 19.7175L6.35038 18.6575ZM6 16C6 15.0707 6.11835 14.1868 6.35038 13.3425L2.49337 12.2825C2.1629 13.4851 2 14.7262 2 16H6ZM6.34658 13.3561C6.59019 12.4936 6.92918 11.7014 7.36096 10.9731L3.92029 8.9331C3.30519 9.97051 2.83169 11.0845 2.49717 12.2689L6.34658 13.3561ZM7.36488 10.9665C7.80285 10.2213 8.32385 9.54754 8.92984 8.94156L6.10141 6.11313C5.25427 6.96027 4.52527 7.9037 3.91637 8.93975L7.36488 10.9665ZM8.92984 8.94156C9.54753 8.32386 10.224 7.7982 10.9614 7.36096L8.92138 3.92029C7.89319 4.52993 6.95247 5.26208 6.10141 6.11313L8.92984 8.94156ZM10.9548 7.36488C11.6898 6.93289 12.4838 6.59808 13.3425 6.3621L12.2825 2.50509C11.0944 2.83161 9.97424 3.30149 8.92803 3.91637L10.9548 7.36488ZM13.3561 6.3583C14.1964 6.12096 15.0756 6 16 6V2C14.7212 2 13.4755 2.1681 12.2689 2.50889L13.3561 6.3583ZM16 6C16.9244 6 17.8036 6.12096 18.6439 6.3583L19.7311 2.50889C18.5245 2.1681 17.2788 2 16 2V6ZM18.6575 6.3621C19.515 6.59773 20.3026 6.93151 21.0269 7.36096L23.0669 3.92029C22.0256 3.30286 20.9069 2.83196 19.7175 2.50509L18.6575 6.3621ZM21.0335 7.36488C21.7748 7.80057 22.4461 8.32271 23.0509 8.93397L25.8944 6.12071C25.046 5.26323 24.1002 4.52755 23.0603 3.91637L21.0335 7.36488ZM23.066 8.9491C23.6773 9.55386 24.1994 10.2252 24.6351 10.9665L28.0836 8.93975C27.4724 7.89982 26.7368 6.95395 25.8793 6.10559L23.066 8.9491ZM24.639 10.9731C25.0685 11.6974 25.4023 12.485 25.6379 13.3425L29.4949 12.2825C29.168 11.0931 28.6971 9.97443 28.0797 8.9331L24.639 10.9731ZM25.6417 13.3561C25.879 14.1964 26 15.0756 26 16H30C30 14.7212 29.8319 13.4755 29.4911 12.2689L25.6417 13.3561Z"
16-
fill={pathFill}
17-
/>
18-
<defs>
19-
<filter id="filter0_d" x="0.2" y="0.8" width="31.6" height="31.6" filterUnits="userSpaceOnUse" colorInterpolationFilters="sRGB">
20-
<feFlood floodOpacity="0" result="BackgroundImageFix" />
21-
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" />
22-
<feOffset dy="0.6" />
23-
<feGaussianBlur stdDeviation="0.9" />
24-
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0" />
25-
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow" />
26-
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow" result="shape" />
27-
</filter>
28-
</defs>
29-
</svg>
30-
);
5+
const intl = useIntl();
6+
const intlText = {
7+
connectionsLoading: intl.formatMessage({
8+
defaultMessage: 'Run information loading',
9+
id: 'xK8r1/',
10+
description: 'Run information loading text',
11+
}),
12+
};
13+
return <Spinner size="tiny" aria-label={intlText.connectionsLoading} />;
3114
};

libs/designer/src/lib/core/parsers/BJSWorkflow/BJSDeserializer.ts

+13-4
Original file line numberDiff line numberDiff line change
@@ -461,12 +461,21 @@ const addActionsInstanceMetaData = (nodesMetadata: NodesMetadata, runInstance: L
461461
Object.entries(updatedNodesData).forEach(([key, node]) => {
462462
const nodeRunData = runInstanceActions?.[key];
463463
if (!isNullOrUndefined(nodeRunData)) {
464+
const repetitionRunData = isNullOrUndefined(nodeRunData.repetitionCount)
465+
? {
466+
runData: {
467+
...nodeRunData,
468+
duration: getDurationStringPanelMode(
469+
Date.parse(nodeRunData.endTime) - Date.parse(nodeRunData.startTime),
470+
/* abbreviated */ true
471+
),
472+
},
473+
}
474+
: {};
475+
464476
updatedNodesData[key] = {
465477
...node,
466-
runData: {
467-
...nodeRunData,
468-
duration: getDurationStringPanelMode(Date.parse(nodeRunData.endTime) - Date.parse(nodeRunData.startTime), /* abbreviated */ true),
469-
},
478+
...repetitionRunData,
470479
runIndex: 0,
471480
};
472481
}

libs/designer/src/lib/ui/CustomNodes/OperationCardNode.tsx

+14-10
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,8 @@ import { setRepetitionRunData } from '../../core/state/workflow/workflowSlice';
4747
import { getRepetitionName } from '../common/LoopsPager/helper';
4848
import { DropZone } from '../connections/dropzone';
4949
import { MessageBarType } from '@fluentui/react';
50-
import { RunService, useNodeIndex } from '@microsoft/logic-apps-shared';
50+
import { isNullOrUndefined, RunService, useNodeIndex } from '@microsoft/logic-apps-shared';
5151
import { Card } from '@microsoft/designer-ui';
52-
import type { LogicAppsV2 } from '@microsoft/logic-apps-shared';
5352
import { memo, useCallback, useEffect, useMemo, useState } from 'react';
5453
import { useDrag } from 'react-dnd';
5554
import { useIntl } from 'react-intl';
@@ -79,7 +78,7 @@ const DefaultNode = ({ targetPosition = Position.Top, sourcePosition = Position.
7978
const nodesMetaData = useNodesMetadata();
8079
const repetitionName = getRepetitionName(parentRunIndex, id, nodesMetaData, operationsInfo);
8180
const isSecureInputsOutputs = useSecureInputsOutputs(id);
82-
const { status: statusRun, error: errorRun, code: codeRun, repetitionCount } = runData ?? {};
81+
const { status: statusRun, error: errorRun, code: codeRun } = runData ?? {};
8382

8483
const suppressDefaultNodeSelect = useSuppressDefaultNodeSelectFunctionality();
8584
const nodeSelectCallbackOverride = useNodeSelectAdditionalCallback();
@@ -101,22 +100,27 @@ const DefaultNode = ({ targetPosition = Position.Top, sourcePosition = Position.
101100
return RunService().getRepetition({ nodeId: id, runId: runInstance?.id }, repetitionName);
102101
};
103102

104-
const onRunRepetitionSuccess = async (runDefinition: LogicAppsV2.RunInstanceDefinition) => {
105-
dispatch(setRepetitionRunData({ nodeId: id, runData: runDefinition.properties as any }));
106-
};
107-
108-
const { refetch, isFetching: isRepetitionLoading } = useQuery<any>(
103+
const {
104+
refetch,
105+
isFetching: isRepetitionLoading,
106+
data: repetitionData,
107+
} = useQuery<any>(
109108
['runInstance', { nodeId: id, runId: runInstance?.id, repetitionName, parentStatus: parenRunData?.status }],
110109
getRunRepetition,
111110
{
112111
refetchOnWindowFocus: false,
113112
initialData: null,
114113
refetchIntervalInBackground: true,
115-
onSuccess: onRunRepetitionSuccess,
116-
enabled: parentRunIndex !== undefined && isMonitoringView && repetitionCount !== undefined,
114+
enabled: parentRunIndex !== undefined && isMonitoringView,
117115
}
118116
);
119117

118+
useEffect(() => {
119+
if (!isNullOrUndefined(repetitionData)) {
120+
dispatch(setRepetitionRunData({ nodeId: id, runData: repetitionData.properties as any }));
121+
}
122+
}, [dispatch, id, repetitionData, runInstance?.id]);
123+
120124
useEffect(() => {
121125
if (parentRunIndex !== undefined && isMonitoringView) {
122126
refetch();

0 commit comments

Comments
 (0)