Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ class AlarmDetailsDatasource implements IAlarmDetailsDatasource {
required String comment,
}) {
return thingsboardClient.getAlarmService().postAlarmComment(
AlarmComment(null, null, alarmId, null, AlarmCommentType.OTHER, {'text': comment}, null),
AlarmComment(null, null, alarmId, null, AlarmCommentType.OTHER, comment, null),

);
}

Expand All @@ -48,7 +49,7 @@ class AlarmDetailsDatasource implements IAlarmDetailsDatasource {
required String comment,
}) {
return thingsboardClient.getAlarmService().postAlarmComment(
AlarmComment(id, null, alarmId, null, AlarmCommentType.OTHER, {'text': comment, 'edited': 'true'}, null),
AlarmComment(id, null, alarmId, null, AlarmCommentType.OTHER, comment, null)
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class _AlarmEditCommentState extends State<AlarmEditCommentTextField> {

@override
void initState() {
textController.text = (widget.commentToEdit.comment as AlarmCommentJsonNode).text;
textController.text = widget.commentToEdit.comment.toString();
super.initState();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class SystemActivityWidget extends StatelessWidget {
),
),
Text(
(activity.comment as AlarmCommentJsonNode).text,
activity.comment.toString(),
style: TbTextStyles.bodyLarge.copyWith(
color: Colors.black.withValues(alpha: .54),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ class _UserCommentState extends State<UserCommentWidget> {
),
const SizedBox(width: 4),
Visibility(
visible: (widget.activity.comment as AlarmCommentJsonNode).edited,
visible: widget.activity.comment.edited == true,
child: Text(
' ${S.of(context).edited}',
style: TbTextStyles.bodyMedium.copyWith(
Expand All @@ -174,7 +174,7 @@ class _UserCommentState extends State<UserCommentWidget> {
],
),
Text(
(widget.activity.comment as AlarmCommentJsonNode).text,
widget.activity.comment.toString(),
style: TbTextStyles.bodyLarge.copyWith(
color: Colors.black.withValues(alpha: .54),
),
Expand Down