Skip to content

Commit

Permalink
feat: Set default values on export form, closes #32. Display "server_…
Browse files Browse the repository at this point in the history
…error" message.
  • Loading branch information
jpmckinney committed Aug 14, 2023
1 parent 6cefb6d commit 2da0996
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
6 changes: 5 additions & 1 deletion backend/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@
@csrf_exempt
def app_settings(request):
return JsonResponse(
{"user": settings.GOOGLE_DRIVE_USER, "template": settings.GDOCS_TEMPLATES["DEFAULT_OVERVIEW_TEMPLATE"]},
{
"user": settings.GOOGLE_DRIVE_USER,
"template": settings.GDOCS_TEMPLATES["DEFAULT_BASE_TEMPLATE"],
"folder": settings.GOOGLE_DRIVE_FOLDER,
},
)


Expand Down
1 change: 1 addition & 0 deletions backend/core/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,3 +282,4 @@
"DEFAULT_ERROR_TEMPLATE": os.getenv("DEFAULT_ERROR_TEMPLATE", "1PW7s6SmaP4tia_QzMSZkTt8Oii-6ZXqB7VCuF8bYmv4"),
}
GOOGLE_DRIVE_USER = "[email protected]"
GOOGLE_DRIVE_FOLDER = "1ZVwf9cr29E4uCuWaVRiQLJI7_ejE00h3"
9 changes: 5 additions & 4 deletions frontend/src/components/DatasetReportModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,8 @@
>
<b-row>
<b-col class="width">
{{ $t("datasetReport.status.serverError") }}
{{ $t("datasetReport.status.serverError") }}<br>
{{ errorMessage }}
</b-col>
</b-row>
</b-alert>
Expand Down Expand Up @@ -368,8 +369,8 @@ export default {
data: function () {
return {
isSubmitting: false,
documentId: "",
folderId: "",
documentId: this.$store.getters.settings.template,
folderId: this.$store.getters.settings.folder,
reportName: "",
submitStatus: null,
submitData: null,
Expand Down Expand Up @@ -420,7 +421,7 @@ export default {
})
.catch(error => {
this.submitStatus = "server_error";
this.errorMessage = error.response.statusText;
this.errorMessage = error;
})
.finally(() => {
this.isSubmitting = false;
Expand Down

0 comments on commit 2da0996

Please sign in to comment.