Skip to content

Commit ceb48fa

Browse files
committed
fix(config-editor): prevent crash when rendering applyResult
1 parent dd0fc7a commit ceb48fa

File tree

4 files changed

+11
-12
lines changed

4 files changed

+11
-12
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/HistoryTable.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,6 @@ export function HistoryTable({ data, bucket, pageSize = 20, isLoading }: History
197197
fontSize='sm'
198198
color={row.error ? 'red.600' : 'gray.500'}
199199
_dark={{ color: row.error ? 'red.400' : 'gray.400' }}
200-
maxW='200px'
201200
overflow='hidden'
202201
textOverflow='ellipsis'
203202
whiteSpace='nowrap'

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)