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
7 changes: 5 additions & 2 deletions lib/features/connections/connections_panel_extension.dart
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,12 @@ class _ExtensionConnectionTileState extends State<_ExtensionConnectionTile> {
...widget.moveItems,
MenuButton(
leading: material.Icon(material.Icons.delete_outline_rounded,
size: 18, color: theme.colorScheme.mutedForeground),
size: 18, color: theme.colorScheme.destructive),
onPressed: (_) => widget.onRemove(),
child: const Text('Remove connection'),
child: Text(
'Remove connection',
style: material.TextStyle(color: theme.colorScheme.destructive),
),
),
],
child: material.Padding(
Expand Down
7 changes: 5 additions & 2 deletions lib/features/connections/connections_panel_mongo.dart
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,12 @@ class _MongoConnectionTileState extends State<_MongoConnectionTile> {
...widget.moveItems,
MenuButton(
leading: material.Icon(material.Icons.delete_outline_rounded,
size: 18, color: theme.colorScheme.mutedForeground),
size: 18, color: theme.colorScheme.destructive),
onPressed: (_) => widget.onRemove(),
child: const Text('Remove connection'),
child: Text(
'Remove connection',
style: material.TextStyle(color: theme.colorScheme.destructive),
),
),
],
child: material.Padding(
Expand Down
7 changes: 5 additions & 2 deletions lib/features/connections/connections_panel_mysql.dart
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,12 @@ class _MysqlConnectionTileState extends State<_MysqlConnectionTile> {
...widget.moveItems,
MenuButton(
leading: material.Icon(material.Icons.delete_outline_rounded,
size: 18, color: theme.colorScheme.mutedForeground),
size: 18, color: theme.colorScheme.destructive),
onPressed: (_) => widget.onRemove(),
child: const Text('Remove connection'),
child: Text(
'Remove connection',
style: material.TextStyle(color: theme.colorScheme.destructive),
),
),
],
child: material.Padding(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,12 @@ class _PostgresConnectionTileState extends State<_PostgresConnectionTile> {
...widget.moveItems,
MenuButton(
leading: material.Icon(material.Icons.delete_outline_rounded,
size: 18, color: theme.colorScheme.mutedForeground),
size: 18, color: theme.colorScheme.destructive),
onPressed: (_) => widget.onRemove(),
child: const Text('Remove connection'),
child: Text(
'Remove connection',
style: material.TextStyle(color: theme.colorScheme.destructive),
),
),
],
child: material.Padding(
Expand Down
7 changes: 5 additions & 2 deletions lib/features/connections/connections_panel_redis.dart
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,12 @@ class _RedisConnectionTileState extends State<_RedisConnectionTile> {
...widget.moveItems,
MenuButton(
leading: material.Icon(material.Icons.delete_outline_rounded,
size: 18, color: theme.colorScheme.mutedForeground),
size: 18, color: theme.colorScheme.destructive),
onPressed: (_) => widget.onRemove(),
child: const Text('Remove connection'),
child: Text(
'Remove connection',
style: material.TextStyle(color: theme.colorScheme.destructive),
),
),
],
child: material.Padding(
Expand Down
7 changes: 5 additions & 2 deletions lib/features/connections/connections_panel_sidebar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,12 @@ class _ConnectionTile extends StatelessWidget {
...moveItems,
MenuButton(
leading: material.Icon(material.Icons.delete_outline_rounded,
size: 18, color: theme.colorScheme.mutedForeground),
size: 18, color: theme.colorScheme.destructive),
onPressed: (_) => onRemove(),
child: const Text('Remove connection'),
child: Text(
'Remove connection',
style: material.TextStyle(color: theme.colorScheme.destructive),
),
),
],
child: material.Padding(
Expand Down
7 changes: 5 additions & 2 deletions lib/features/connections/connections_panel_sqlite.dart
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,12 @@ class _SqliteConnectionTileState extends State<_SqliteConnectionTile> {
...widget.moveItems,
MenuButton(
leading: material.Icon(material.Icons.delete_outline_rounded,
size: 18, color: theme.colorScheme.mutedForeground),
size: 18, color: theme.colorScheme.destructive),
onPressed: (_) => widget.onRemove(),
child: const Text('Remove connection'),
child: Text(
'Remove connection',
style: material.TextStyle(color: theme.colorScheme.destructive),
),
),
],
child: material.Padding(
Expand Down
24 changes: 23 additions & 1 deletion test/e2e/01_connection_lifecycle/e2e_connection_crud_test.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import 'package:flutter/gestures.dart' show kSecondaryButton;
import 'package:flutter/widgets.dart' show Draggable, ValueKey;
import 'package:flutter/widgets.dart' show Draggable, Text, ValueKey;
import 'package:flutter_test/flutter_test.dart';
import 'package:querya_desktop/core/storage/app_settings.dart';
import 'package:querya_desktop/core/storage/folders_storage.dart';
import 'package:querya_desktop/core/storage/local_db.dart';
import 'package:querya_desktop/core/theme/querya_theme_scope.dart';
import 'package:querya_desktop/features/connections/connections_panel.dart';

import '../helpers/e2e_app_harness.dart';
Expand Down Expand Up @@ -99,6 +100,27 @@ void main() {
await app.close(tester);
});

testWidgets('Remove connection is drawn as a destructive menu item',
(tester) async {
await app.launch(tester);
final id = await E2eConnections.add(
tester, E2eConnections.redis('E2E Remover'));
await E2eConnections.reloadSidebar(tester);

await tester.tap(inSidebar('E2E Remover').first,
buttons: kSecondaryButton);
await tester.pump(const Duration(milliseconds: 300));

final label = tester.widget<Text>(find.text('Remove connection').last);
final destructive = QueryaThemeScope.of(
tester.element(find.text('Remove connection').last),
).workbench.destructive;
expect(label.style?.color, destructive);

await E2eConnections.remove(tester, id);
await app.close(tester);
});

testWidgets('Move to folder in the connection menu puts it in the folder',
(tester) async {
await app.launch(tester);
Expand Down
Loading