diff --git a/api/app/serializers/dataset_serializer.rb b/api/app/serializers/dataset_serializer.rb index 7e767b8c0..9fddda7df 100644 --- a/api/app/serializers/dataset_serializer.rb +++ b/api/app/serializers/dataset_serializer.rb @@ -13,6 +13,8 @@ class DatasetSerializer < ApplicationSerializer attributes :programming_language, :zipfile, :name def zipfile + return if object.zipfile.blank? + url_for(object.zipfile) end end diff --git a/api/test/controllers/reports_controller_test.rb b/api/test/controllers/reports_controller_test.rb index 839023208..865622e0c 100644 --- a/api/test/controllers/reports_controller_test.rb +++ b/api/test/controllers/reports_controller_test.rb @@ -74,4 +74,15 @@ class ReportsControllerTest < ActionDispatch::IntegrationTest assert_response :not_found end end + + test 'should successfully show purged reports' do + delete report_url(@report), as: :json + assert_response :no_content + + @report.reload + assert_equal @report.status, 'purged' + + get report_url(@report), as: :json + assert_response :success + end end diff --git a/web/src/components/upload/UploadFormCard.vue b/web/src/components/upload/UploadFormCard.vue index e2a64bb0a..9cc60e1fe 100644 --- a/web/src/components/upload/UploadFormCard.vue +++ b/web/src/components/upload/UploadFormCard.vue @@ -1,5 +1,5 @@ diff --git a/web/src/components/upload/UploadsTableDeleteDialog.vue b/web/src/components/upload/UploadsTableDeleteDialog.vue index 12822db14..f813cdf49 100644 --- a/web/src/components/upload/UploadsTableDeleteDialog.vue +++ b/web/src/components/upload/UploadsTableDeleteDialog.vue @@ -32,7 +32,7 @@ const confirm = async (): Promise => { try { // Attempt to delete the upload. // Only delete the upload if a report id is present and the report is not already deleted. - if (props.report.id && props.report.status !== "deleted") { + if (props.report.id && props.report.status !== "purged") { await axios.delete(reports.getReportUrlById(props.report.id)); } @@ -72,7 +72,7 @@ const confirm = async (): Promise => { - +
Are you sure you want to delete "{{ props.report.name }}" from the list?
diff --git a/web/src/components/upload/UploadsTableInfoDialog.vue b/web/src/components/upload/UploadsTableInfoDialog.vue index 33bd7305d..62b59bbc5 100644 --- a/web/src/components/upload/UploadsTableInfoDialog.vue +++ b/web/src/components/upload/UploadsTableInfoDialog.vue @@ -31,7 +31,7 @@ const isDone = computed( props.report.status === "finished" || props.report.status === "error" || props.report.status === "failed" || - props.report.status === "deleted" + props.report.status === "purged" ); @@ -117,7 +117,7 @@ const isDone = computed( -