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 15, 2024
1 parent 8572ef9 commit c6ff19e
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/lib/login/cubit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class LoginCubit extends Cubit<LoginState> {
? context.l10n.auth_loading_data
// ignore: use_build_context_synchronously
: context.l10n.auth_updating_data;
emit(LoginState.loadingUserData(loadingMessage, ));
emit(LoginState.loadingUserData(loadingMessage));
if (shouldFetchDiplotypes()) {
final (labData, activeDrugList) = await lab.loadData();
await saveDiplotypesAndActiveDrugs(
Expand Down
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);
}
}
10 changes: 5 additions & 5 deletions app/lib/login/pages/login.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ import 'package:provider/provider.dart';
import '../../../common/module.dart';
import '../cubit.dart';
import '../models/deep_link_share_flow_lab.dart';
import '../models/dummy_demo_lab.dart';
import '../models/lab.dart';
import '../models/oauth_authorization_code_flow_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 c6ff19e

Please sign in to comment.