Skip to content

Commit 526732b

Browse files
committed
refactor: ♻️ reintroduce api key flow + help text
1 parent 1238a5e commit 526732b

File tree

2 files changed

+30
-2
lines changed

2 files changed

+30
-2
lines changed

assets/css/main.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -937,7 +937,7 @@ details[open] > summary::before {
937937
display: inline !important;
938938
margin-top: 1rem !important;
939939
align-self: center !important;
940-
width: 258px !important;
940+
width: 280px !important;
941941
border: none !important;
942942
}
943943

preload.js

+29-1
Original file line numberDiff line numberDiff line change
@@ -995,7 +995,35 @@ const addBfAccount = async (ev, verifyingOrganization = False) => {
995995
document.getElementsByClassName("swal2-popup")[0].style.width = "43rem";
996996
div_footer.style.flexDirection = "column";
997997
div_footer.style.alignItems = "center";
998-
if (verifyingOrganization) {
998+
if (!verifyingOrganization) {
999+
let swal_actions = document.getElementsByClassName("swal2-actions")[0];
1000+
let api_button = document.createElement("button");
1001+
let api_arrow = document.createElement("i");
1002+
let helpText = document.createElement("p")
1003+
helpText.innerText = "Recommended only if you sign in to Pennsieve with your ORCID iD."
1004+
helpText.classList.add("tip-content");
1005+
// set margin to auto
1006+
helpText.style.margin = "auto";
1007+
1008+
api_button.innerText = "Connect with API key instead";
1009+
// set length to 270
1010+
api_button.setAttribute("onclick", "showBFAddAccountSweetalert()");
1011+
api_arrow.classList.add("fas");
1012+
api_arrow.classList.add("fa-arrow-right");
1013+
api_arrow.style.marginLeft = "10px";
1014+
api_button.type = "button";
1015+
api_button.style.border = "";
1016+
api_button.id = "api_connect_btn";
1017+
api_button.classList.add("transition-btn");
1018+
api_button.classList.add("api_key-btn");
1019+
api_button.classList.add("back");
1020+
api_button.style.display = "inline";
1021+
api_button.appendChild(api_arrow);
1022+
swal_actions.parentElement.insertBefore(api_button, div_footer);
1023+
swal_actions.parentElement.insertBefore(helpText, div_footer);
1024+
1025+
}
1026+
else {
9991027
// hide the cancel button
10001028
let cancel_button = document.getElementsByClassName("swal2-cancel")[0];
10011029
cancel_button.style.display = "none";

0 commit comments

Comments
 (0)