Skip to content

Commit

Permalink
fix: Expanding a template without subtrial does nothing on Dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
ibrahimozkn committed Jul 29, 2024
1 parent f888c09 commit cf95529
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
28 changes: 28 additions & 0 deletions designer_v2/lib/features/dashboard/studies_table_item.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import 'package:studyu_designer_v2/features/dashboard/studies_table.dart';
import 'package:studyu_designer_v2/features/study/study_participation_badge.dart';
import 'package:studyu_designer_v2/features/study/study_status_badge.dart';
import 'package:studyu_designer_v2/features/study/study_type_badge.dart';
import 'package:studyu_designer_v2/localization/app_translation.dart';
import 'package:studyu_designer_v2/theme.dart';
import 'package:studyu_designer_v2/utils/extensions.dart';
import 'package:studyu_designer_v2/utils/model_action.dart';
Expand Down Expand Up @@ -111,6 +112,33 @@ class _StudiesTableItemState extends State<StudiesTableItem> {
);
subRows.add(_buildStudyRow(theme, subStudy, actions: subActions));
}
} else if (widget.isExpanded && studyGroup.subStudies.isEmpty) {
subRows.add(
Divider(
thickness: isHovering ? 1.5 : 0.75,
color: theme.colorScheme.primaryContainer.withOpacity(0.9),
height: 0.0,
),
);

subRows.add(
Container(
decoration: BoxDecoration(
color: theme.colorScheme.primaryContainer.withOpacity(0.3),
),
padding: const EdgeInsets.symmetric(horizontal: 48, vertical: 32),
child: Row(
children: [
Text(
tr.substudies_not_found,
style: widget.normalTextStyle,
maxLines: 3,
overflow: TextOverflow.fade,
),
],
),
),
);
}

return Column(
Expand Down
1 change: 1 addition & 0 deletions designer_v2/lib/localization/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@
"studies_list_header_participants_active": "Active",
"studies_list_header_participants_completed": "Completed",
"studies_not_found": "No Studies found",
"substudies_not_found": "Sub-studies not found for this Template Trial",
"modify_query": "Modify your query",
"studies_empty": "You don't have any studies yet",
"studies_empty_description": "Build your own study from scratch or create a new draft copy from an already published study!",
Expand Down

0 comments on commit cf95529

Please sign in to comment.