Skip to content

Commit 5bc58b3

Browse files
authored
fix(config-editor): prevent crash when rendering applyResult
2 parents ae022fc + 8be6ca2 commit 5bc58b3

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

thingconnect.pulse.client/src/api/types.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -155,11 +155,11 @@ export interface ConfigurationDiff {
155155
}
156156

157157
export interface ConfigurationApplyResponse {
158-
config_version_id: string;
159-
changes: ConfigurationDiff[];
160-
validation_errors?: string[];
161-
applied_ts: string;
162-
file_hash: string;
158+
configVersionId: string;
159+
added: number;
160+
updated: number;
161+
removed: number;
162+
warnings: string[];
163163
}
164164

165165
// Error response type

thingconnect.pulse.client/src/components/config/ConfigurationEditor.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -372,11 +372,11 @@ export function ConfigurationEditor({ onConfigurationApplied }: ConfigurationEdi
372372
{applyResult && (
373373
<Alert
374374
flex='1'
375-
status='success'
375+
status={'success'}
376376
title={
377-
applyResult.validation_errors?.length
378-
? applyResult.validation_errors[0]
379-
: `Configuration applied: ${applyResult.changes.filter(c => c.type === 'add').length} added, ${applyResult.changes.filter(c => c.type === 'update').length} updated, ${applyResult.changes.filter(c => c.type === 'remove').length} removed`
377+
applyResult.warnings?.length
378+
? `${applyResult.warnings.join('; ')}`
379+
: `Configuration applied: ${applyResult.added} added, ${applyResult.updated} updated, ${applyResult.removed} removed`
380380
}
381381
/>
382382
)}

thingconnect.pulse.client/src/components/status/StatusTable.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ export function StatusTable({ items, isLoading }: StatusTableProps) {
4646
analytics.trackDashboardInteraction('endpoint_details_click', {
4747
table_type: 'status_overview',
4848
endpoint_id: id,
49-
source: 'main_dashboard'
49+
source: 'main_dashboard',
5050
});
51-
51+
5252
void navigate(`/endpoints/${id}`);
5353
};
5454
console.log('isLoading in StatusTable:', items);

0 commit comments

Comments
 (0)