diff --git a/tdrs-backend/tdpservice/data_files/serializers.py b/tdrs-backend/tdpservice/data_files/serializers.py index 60559c164..1749b66e7 100644 --- a/tdrs-backend/tdpservice/data_files/serializers.py +++ b/tdrs-backend/tdpservice/data_files/serializers.py @@ -43,8 +43,7 @@ class DataFileSerializer(serializers.ModelSerializer): ssp = serializers.BooleanField(write_only=True) has_error = serializers.SerializerMethodField() summary = DataFileSummarySerializer(many=False, read_only=True) - reparse_file_metas = serializers.SerializerMethodField() - has_outdated_error_report = serializers.SerializerMethodField() + latest_reparse_file_meta = serializers.SerializerMethodField() class Meta: """Metadata.""" @@ -69,8 +68,7 @@ class Meta: 's3_versioning_id', 'has_error', 'summary', - 'reparse_file_metas', - 'has_outdated_error_report', + 'latest_reparse_file_meta', ] read_only_fields = ("version",) @@ -80,28 +78,12 @@ def get_has_error(self, obj): parser_errors = ParserError.objects.filter(file=obj.id) return len(parser_errors) > 0 - def get_reparse_file_metas(self, instance): + def get_latest_reparse_file_meta(self, instance): """Return related reparse_file_metas, ordered by finished_at decending.""" reparse_file_metas = instance.reparse_file_metas.all().order_by('-finished_at') - return ReparseFileMetaSerializer(reparse_file_metas, many=True, read_only=True).data - - def get_has_outdated_error_report(self, instance): - """Return a boolean indicating whether the file's error report is outdated.""" - original_submission_date = instance.created_at - - cutoff_date = make_aware(settings.OUTDATED_SUBMISSION_CUTOFF) - - if original_submission_date < cutoff_date: - reparse_file_metas = instance.reparse_file_metas.all().order_by('-finished_at') - - if reparse_file_metas.count() > 0: - last_reparse_date = reparse_file_metas.first().finished_at - if last_reparse_date is None or last_reparse_date < cutoff_date: - return True - - return True - - return False + if reparse_file_metas.count() > 0: + return ReparseFileMetaSerializer(reparse_file_metas.first(), many=False, read_only=True).data + return None def create(self, validated_data): """Create a new entry with a new version number.""" diff --git a/tdrs-frontend/src/components/SubmissionHistory/CaseAggregatesTable.jsx b/tdrs-frontend/src/components/SubmissionHistory/CaseAggregatesTable.jsx index 12f53d327..56b1b5ecc 100644 --- a/tdrs-frontend/src/components/SubmissionHistory/CaseAggregatesTable.jsx +++ b/tdrs-frontend/src/components/SubmissionHistory/CaseAggregatesTable.jsx @@ -31,18 +31,8 @@ const CaseAggregatesRow = ({ file }) => { <> - {formatDate(file.createdAt)} - {hasReparsed(file) && ( - <> -
-
- {'Reprocessed: ' + formatDate(getReprocessedDate(file))} - - )} - - - - {file.submittedBy} + {formatDate(file.createdAt) + ' by ' + file.submittedBy} + {hasReparsed(file) && <>} @@ -92,9 +82,6 @@ export const CaseAggregatesTable = ({ files }) => ( Submitted On - - Submitted By - File Name diff --git a/tdrs-frontend/src/components/SubmissionHistory/SubmissionHistory.jsx b/tdrs-frontend/src/components/SubmissionHistory/SubmissionHistory.jsx index 78c3b0663..3b245a754 100644 --- a/tdrs-frontend/src/components/SubmissionHistory/SubmissionHistory.jsx +++ b/tdrs-frontend/src/components/SubmissionHistory/SubmissionHistory.jsx @@ -73,27 +73,8 @@ const SubmissionHistory = ({ filterValues }) => { } }, [hasFetchedFiles, files, dispatch, filterValues]) - const hasOutdatedSubmissions = () => - files.some((element, index, array) => element.has_outdated_error_report) - return ( <> - {hasOutdatedSubmissions() && ( -
-
-

- Please note that error reports and submission history content for - files submitted prior to May 31, 2024 may be outdated. Please - resubmit to get access to updated information. -

-
-
- )} -
{ <> - {formatDate(file.createdAt)} - {hasReparsed(file) && ( - <> -
-
- {'Reprocessed: ' + formatDate(getReprocessedDate(file))} - - )} - - - - {file.submittedBy} + {formatDate(file.createdAt) + ' by ' + file.submittedBy} + {hasReparsed(file) && <>} @@ -86,9 +76,6 @@ export const TotalAggregatesTable = ({ files }) => ( Submitted On - - Submitted By - File Name diff --git a/tdrs-frontend/src/components/SubmissionHistory/helpers.jsx b/tdrs-frontend/src/components/SubmissionHistory/helpers.jsx index 26aaaf179..3b7bb183c 100644 --- a/tdrs-frontend/src/components/SubmissionHistory/helpers.jsx +++ b/tdrs-frontend/src/components/SubmissionHistory/helpers.jsx @@ -38,9 +38,7 @@ export const getErrorReportStatus = (file) => { file.summary.status !== 'Pending' ) { const errorFileName = `${file.year}-${file.quarter}-${file.section}` - if (file.has_outdated_error_report) { - return 'This file was submitted prior to May 31, 2024. Please resubmit to get access to updated information.' - } else if (file.hasError) { + if (file.hasError) { return (