Skip to content

Commit

Permalink
Update Leaderboard Submission Dialog to Pass Parameters to ViewModel
Browse files Browse the repository at this point in the history
This commit updates the Leaderboard Submission Dialog to pass the team name, repository URL, and commit SHA as parameters to the submitToLeaderboard function in the SkillTreeViewModel. These changes ensure that the dialog and the ViewModel are aligned in terms of parameter requirements, facilitating efficient and accurate leaderboard submissions.
  • Loading branch information
hunteraraujo committed Sep 27, 2023
1 parent ec03170 commit 105b801
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import 'package:flutter/material.dart';
import 'package:shared_preferences/shared_preferences.dart';

class LeaderboardSubmissionDialog extends StatefulWidget {
final VoidCallback? onSubmit;
final Function(String, String, String)? onSubmit;

const LeaderboardSubmissionDialog({
Key? key,
Expand Down Expand Up @@ -73,7 +73,8 @@ class _LeaderboardSubmissionDialogState

if (isValid) {
_saveToSharedPreferences();
widget.onSubmit?.call();
widget.onSubmit?.call(_teamNameController.text, _repoUrlController.text,
_commitShaController.text);
} else {
setState(() {});
}
Expand Down
5 changes: 4 additions & 1 deletion frontend/lib/views/task_queue/task_queue_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,10 @@ class TaskQueueView extends StatelessWidget {
showDialog(
context: context,
builder: (context) => LeaderboardSubmissionDialog(
onSubmit: viewModel.submitToLeaderboard,
onSubmit: (teamName, repoUrl, commitSha) {
viewModel.submitToLeaderboard(
teamName, repoUrl, commitSha);
},
),
);
},
Expand Down

0 comments on commit 105b801

Please sign in to comment.