From c28294017397528e5b5c2802ada09ea8b68aae5b Mon Sep 17 00:00:00 2001 From: Atif Ali Date: Wed, 18 Dec 2024 15:13:17 -0500 Subject: [PATCH] ui lint Signed-off-by: Atif Ali --- .../application-operation-state.tsx | 38 +++++++++++-------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/ui/src/app/applications/components/application-operation-state/application-operation-state.tsx b/ui/src/app/applications/components/application-operation-state/application-operation-state.tsx index 2f95e7ac4f48c1..0edcf32214e10d 100644 --- a/ui/src/app/applications/components/application-operation-state/application-operation-state.tsx +++ b/ui/src/app/applications/components/application-operation-state/application-operation-state.tsx @@ -57,12 +57,12 @@ export const ApplicationOperationState: React.StatelessComponent = ({appl const getFormattedMessage = (message: string) => { const prefix = 'one or more objects failed to apply, reason: '; let cleanMessage = message; - + // Remove duplicate prefix if exists if (message.startsWith(prefix) && message.substring(prefix.length).startsWith(prefix)) { cleanMessage = prefix + message.substring(prefix.length * 2); } - + // Format immutable fields error message if (cleanMessage.includes('attempting to change immutable fields:')) { const [header, ...details] = cleanMessage.split('\n'); @@ -79,27 +79,35 @@ export const ApplicationOperationState: React.StatelessComponent = ({appl return line; }) .join('\n'); - + return `${header}\n${formattedDetails}`; } - + return cleanMessage; }; const operationAttributes = [ {title: 'OPERATION', value: utils.getOperationType(application)}, {title: 'PHASE', value: operationState.phase}, - ...(operationState.message ? [{ - title: 'MESSAGE', - value:
-                {getFormattedMessage(operationState.message)}
-            
- }] : []), {title: 'STARTED AT', value: }, + ...(operationState.message + ? [ + { + title: 'MESSAGE', + value: ( +
+                              {getFormattedMessage(operationState.message)}
+                          
+ ) + } + ] + : []), + {title: 'STARTED AT', value: }, { title: 'DURATION', value: (