Skip to content

Commit

Permalink
feat: add dummy demo lab
Browse files Browse the repository at this point in the history
  • Loading branch information
tamslo committed Nov 21, 2024
1 parent 6633964 commit 6f3bcae
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 7 deletions.
16 changes: 16 additions & 0 deletions app/lib/login/models/dummy_demo_lab.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import '../../common/module.dart';
import 'lab.dart';

class DummyDemoLab extends Lab {
DummyDemoLab({
required super.name,
required this.dataUrl,
});

Uri dataUrl;

@override
Future<(List<LabResult>, List<String>)> loadData() async {
return Lab.fetchData(dataUrl);
}
}
2 changes: 1 addition & 1 deletion app/lib/login/models/lab.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class Lab {
throw UnimplementedError();
}

Future<(List<LabResult>, List<String>)> fetchData(
static Future<(List<LabResult>, List<String>)> fetchData(
Uri dataUrl,
{
Map<String,String>? headers,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,6 @@ class OAuthAuthorizationCodeFlowLab extends Lab {

@override
Future<(List<LabResult>, List<String>)> loadData() async {
return fetchData(dataUrl, headers: {'Authorization': 'Bearer $token'});
return Lab.fetchData(dataUrl, headers: {'Authorization': 'Bearer $token'});
}
}
10 changes: 5 additions & 5 deletions app/lib/login/pages/login.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ import 'package:provider/provider.dart';

import '../../../common/module.dart';
import '../cubit.dart';
import '../models/oauth_authorization_code_flow_lab.dart';
import '../models/dummy_demo_lab.dart';

final labs = [
OAuthAuthorizationCodeFlowLab(
DummyDemoLab(
name: 'Mount Sinai Health System',
authUrl: Uri.http('vm-slosarek01.dhclab.i.hpi.de:28080', 'realms/pharme/protocol/openid-connect/auth'),
tokenUrl: Uri.http('vm-slosarek01.dhclab.i.hpi.de:28080', 'realms/pharme/protocol/openid-connect/token'),
dataUrl: Uri.http('vm-slosarek01.dhclab.i.hpi.de:8081', 'api/v1/star-alleles'),
dataUrl: Uri.parse(
'https://hpi-datastore.duckdns.org/userdata?id=66608824-2ab4-4f03-aef0-03aa007337d3',
),
)
];

Expand Down

0 comments on commit 6f3bcae

Please sign in to comment.