From 9cb0a2d6488eb567f3661d1ea59e20cc708e3cd4 Mon Sep 17 00:00:00 2001
From: Pranav Rao <56097527+pranavrao145@users.noreply.github.com>
Date: Mon, 14 Oct 2024 13:52:41 -0400
Subject: [PATCH] feat(retain-old-grading-data-option): only show option if
collected submission exists
---
.../javascripts/Components/repo_browser.jsx | 25 +++++++++++--------
config/locales/views/submissions/en.yml | 6 ++---
2 files changed, 17 insertions(+), 14 deletions(-)
diff --git a/app/assets/javascripts/Components/repo_browser.jsx b/app/assets/javascripts/Components/repo_browser.jsx
index 3f7c1fdbd4..151ac71a84 100644
--- a/app/assets/javascripts/Components/repo_browser.jsx
+++ b/app/assets/javascripts/Components/repo_browser.jsx
@@ -87,6 +87,7 @@ class RepoBrowser extends React.Component {
late_penalty={this.props.late_penalty}
grouping_id={this.props.grouping_id}
revision_identifier={this.state.revision_identifier}
+ collected_revision_id={this.props.collected_revision_id}
/>
);
}
@@ -175,17 +176,19 @@ class ManualCollectionForm extends React.Component {
{I18n.t("submissions.collect.apply_late_penalty")}
-
- {
- this.setState({retainExistingGrading: e.target.checked});
- }}
- />
-
-
+ {this.props.collected_revision_id && (
+
+ {
+ this.setState({retainExistingGrading: e.target.checked});
+ }}
+ />
+
+
+ )}