Skip to content

Commit

Permalink
fix(dashboard): update property name for tables when displaying alarms
Browse files Browse the repository at this point in the history
  • Loading branch information
jmbuss committed Apr 7, 2023
1 parent 0e90781 commit d8d5541
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ it('can map an asset description to asset summary', () => {
properties: [
{
propertyId: 'e70495ff-c016-4175-9012-62c37857e0d1',
name: 'AWS/ALARM_STATE',
name: 'windSpeedAlarm',
unit: undefined,
alias: undefined,
dataType: 'STRUCT',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ const mapPropertySummary = ({ id, name, unit, dataType, alias }: AssetProperty):
const mapCompositeModelToAlarmSummary = (model: AssetCompositeModel): AlarmSummary => ({
name: model.name,
id: model?.id,
properties: model.properties?.filter(isAlarmState).map(mapPropertySummary) ?? [],
properties:
model.properties
?.filter(isAlarmState)
.map(({ id, unit, dataType, alias }) => mapPropertySummary({ id, unit, dataType, alias, name: model.name })) ??
[],
});

export const mapAssetDescriptionToAssetSummary = (description: DescribeAssetResponse): AssetSummary => ({
Expand Down

0 comments on commit d8d5541

Please sign in to comment.