From fe184010c832f421fd06f4952621d913056a5b8e Mon Sep 17 00:00:00 2001
From: Emily <44536222+emi-hi@users.noreply.github.com>
Date: Mon, 8 Apr 2024 10:08:17 -0700
Subject: [PATCH] feat: updates radio text and order (#274)
---
frontend/src/uploads/UploadContainer.js | 2 +-
frontend/src/uploads/components/UploadPage.js | 9 +++++----
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/frontend/src/uploads/UploadContainer.js b/frontend/src/uploads/UploadContainer.js
index f6b7b75d..44532f6a 100644
--- a/frontend/src/uploads/UploadContainer.js
+++ b/frontend/src/uploads/UploadContainer.js
@@ -33,7 +33,7 @@ const UploadContainer = () => {
setDatasetList(response.data);
setRefresh(false);
axios.get(ROUTES_USERS.CURRENT).then((currentUserResp) => {
- if (currentUserResp.data.user_permissions.admin === true) {
+ if (currentUserResp.data && currentUserResp.data.user_permissions && currentUserResp.data.user_permissions.admin === true) {
setAdminUser(true);
setCurrentUser(currentUserResp.data.idir);
}
diff --git a/frontend/src/uploads/components/UploadPage.js b/frontend/src/uploads/components/UploadPage.js
index d64b70f8..330ff4a4 100644
--- a/frontend/src/uploads/components/UploadPage.js
+++ b/frontend/src/uploads/components/UploadPage.js
@@ -55,18 +55,19 @@ const UploadPage = (props) => {
value={replaceData ? "replace" : "add"}
name="radio-buttons-group"
onChange={handleRadioChange}
+ defaultValue="add"
>
}
- label="Replace existing data"
+ label="Add to existing data (default)"
/>
}
- label="Add to existing data"
+ label="Replace existing data (data cannot be restored, proceed only if you are certain that the new file contains all required data)."
/>