Skip to content

Commit

Permalink
chore: remove console logs
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronm-2112 committed Jan 22, 2024
1 parent e3c4904 commit 39c4811
Show file tree
Hide file tree
Showing 21 changed files with 6 additions and 140 deletions.
1 change: 0 additions & 1 deletion public/imports.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ document.addEventListener('DOMContentLoaded', async function () {
}
if (allPresentInDom) {
clearInterval(interval)
console.log("Finished loading html")
resolve()
} else {
console.log('Nothing in DOM yet, waiting 100ms')
Expand Down
5 changes: 0 additions & 5 deletions public/nav.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import Swal from "sweetalert2";
while (!window.htmlPagesAdded) {
await new Promise((resolve) => setTimeout(resolve, 100))
}
console.log("Going for it")


// this variable is here to keep track of when the Organize datasets/Continue button is enabled or disabled
Expand Down Expand Up @@ -82,7 +81,6 @@ const handleSectionTrigger = async (event) => {
}

if (sectionId === "guided_mode-section") {
console.log("IN this section")
// Disallow the transition if an upload is in progress
if (document.getElementById("returnButton") !== null) {
Swal.fire({
Expand Down Expand Up @@ -226,10 +224,8 @@ const handleSectionTrigger = async (event) => {
];

if (showSidebarSections.includes(sectionId)) {
console.log("Here?")
forceActionSidebar("show");
} else {
console.log("In elese statement")
forceActionSidebar("hide");
}

Expand All @@ -254,7 +250,6 @@ const handleSectionTrigger = async (event) => {
};

function showMainContent() {
console.log(document.querySelector(".js-nav").classList)
document.querySelector(".js-nav").classList.add("is-shown");
document.querySelector(".js-content").classList.add("is-shown");
}
Expand Down
2 changes: 0 additions & 2 deletions src/main/strain.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ ipcMain.handle("getStrainData", async (event, rridInfo) => {
let data = "";
let dataReady = false;
if (res.statusCode === 200) {
console.log("Status code is 200?")
res.setEncoding("utf8");
res.on("data", (d) => {
data += d;
Expand All @@ -29,7 +28,6 @@ ipcMain.handle("getStrainData", async (event, rridInfo) => {
})
})

console.log("Data is", data)


// let xmlSerializer = new XMLSerializer();
Expand Down
4 changes: 1 addition & 3 deletions src/preload/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ fixPath();

import "v8-compile-cache";

console.log(log);
console.log(log.transports);
console.log(log.transports.file);

log.initialize();

// Custom APIs for renderer
Expand Down
1 change: 0 additions & 1 deletion src/preload/update-path-darwin.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ const fixPath = () => {
window.process.env.PATH,
].join(":");

console.log("PATH updated to: " + window.process.env.PATH)
}
};

Expand Down
1 change: 0 additions & 1 deletion src/renderer/src/assets/imports.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ document.addEventListener('DOMContentLoaded', async function () {
}
if (allPresentInDom) {
clearInterval(interval)
console.log("Finished loading html")
resolve()
} else {
console.log('Nothing in DOM yet, waiting 100ms')
Expand Down
5 changes: 0 additions & 5 deletions src/renderer/src/assets/nav.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import Swal from "sweetalert2";
while (!window.htmlPagesAdded) {
await new Promise((resolve) => setTimeout(resolve, 100))
}
console.log("Going for it")


// this variable is here to keep track of when the Organize datasets/Continue button is enabled or disabled
Expand Down Expand Up @@ -81,7 +80,6 @@ const handleSectionTrigger = async (event) => {
}

if (sectionId === "guided_mode-section") {
console.log("IN this section")
// Disallow the transition if an upload is in progress
if (document.getElementById("returnButton") !== null) {
Swal.fire({
Expand Down Expand Up @@ -225,10 +223,8 @@ const handleSectionTrigger = async (event) => {
];

if (showSidebarSections.includes(sectionId)) {
console.log("Here?")
forceActionSidebar("show");
} else {
console.log("In elese statement")
forceActionSidebar("hide");
}

Expand All @@ -253,7 +249,6 @@ const handleSectionTrigger = async (event) => {
};

function showMainContent() {
console.log(document.querySelector(".js-nav").classList)
document.querySelector(".js-nav").classList.add("is-shown");
document.querySelector(".js-content").classList.add("is-shown");
}
Expand Down
2 changes: 0 additions & 2 deletions src/renderer/src/scripts/globals.js
Original file line number Diff line number Diff line change
Expand Up @@ -1365,7 +1365,6 @@ window.openDropdownPrompt = async (ev, dropdown, show_timer = true) => {
}

let result = responseObject.data.datasets;
console.log("Dataset results: ", result)
window.datasetList = [];
window.datasetList = result;
window.refreshDatasetList();
Expand Down Expand Up @@ -1701,7 +1700,6 @@ window.openDropdownPrompt = async (ev, dropdown, show_timer = true) => {
},
});

console.log(result)

if (result) {
await window.openDropdownPrompt(this, "bf");
Expand Down
32 changes: 2 additions & 30 deletions src/renderer/src/scripts/guided-mode/guided-curate-dataset.js
Original file line number Diff line number Diff line change
Expand Up @@ -3259,7 +3259,6 @@ const generateProgressCardElement = (progressFileJSONObj) => {
};

const guidedRenderProgressCards = async () => {
console.log("Loading the render progress cards func");
const progressCardsContainer = document.getElementById("guided-container-progress-cards");
const progressCardLoadingDiv = document.getElementById("guided-section-loading-progress-cards");

Expand Down Expand Up @@ -3429,7 +3428,6 @@ window.guidedOpenManifestEditSwal = async (highLevelFolderName) => {

//upon receiving a reply of the spreadsheet, handle accordingly
window.electron.ipcRenderer.on("spreadsheet-reply", async (event, result) => {
console.log("Spreadsheet reply from guided curate");
if (!result || result === "") {
window.electron.ipcRenderer.removeAllListeners("spreadsheet-reply");
return;
Expand Down Expand Up @@ -3936,7 +3934,6 @@ const setActiveProgressionTab = (targetPageID) => {
let targetProgressionTab = $(`#${targetProgressionTabID}`);
targetProgressionTab.addClass("selected-tab");
};
console.log(window.api);
let homeDir = await window.electron.ipcRenderer.invoke("get-app-path", "home");
let guidedProgressFilePath = window.path.join(homeDir, "SODA", "Guided-Progress");

Expand Down Expand Up @@ -4834,17 +4831,14 @@ const updateGuidedRadioButtonsFromJSON = (parentPageID) => {
};

const guidedAddUsersAndTeamsToDropdown = (usersArray, teamsArray) => {
console.log("HERE?");
const guidedUsersAndTeamsDropdown = document.getElementById("guided_bf_list_users_and_teams");
// Reset the dropdown
guidedUsersAndTeamsDropdown.innerHTML =
"<option>Select individuals or teams to grant permissions to</option>";

console.log(usersArray);

// Loop through the users and add them to the dropdown
for (const userString of usersArray) {
console.log(userString);
const userNameAndEmail = userString.split("!|**|!")[0].trim();
const userID = userString.split("!|**|!")[1].trim();
const userOption = `
Expand Down Expand Up @@ -5037,7 +5031,6 @@ const handleNextButtonVisibility = (targetPageID) => {
// //If the keys exist, extract the data from the window.sodaJSONObj and populate the page
// //If the keys do not exist, reset the page (inputs, tables etc.) to the default state
window.openPage = async (targetPageID) => {
console.log("TargetPageID is: ", targetPageID);
//NOTE: 2 Bottom back buttons (one handles sub pages, and the other handles main pages)
//Back buttons should be disabled and the function setLoading should be (set as false?)

Expand Down Expand Up @@ -6076,10 +6069,8 @@ window.openPage = async (targetPageID) => {
//Banner is returned as an s3 bucket url but image needs to be converted as
//base64 to save and write to users local system

console.log(res);

let img_base64 = await window.getBase64(res); // encode image to base64
console.log("Not failing hehjasfhjk");
let guided_img_url = res;
let imageType = "";
let fullBase64Image = "";
Expand Down Expand Up @@ -6152,7 +6143,6 @@ window.openPage = async (targetPageID) => {
}
window.sodaJSONObj["pages-fetched-from-pennsieve"].push("guided-banner-image-tab");
} catch (error) {
console.log("Failure is here");
clientError(error);
const emessage = userErrorMessage(error);
await guidedShowOptionalRetrySwal(emessage, "guided-banner-image-tab");
Expand Down Expand Up @@ -9425,7 +9415,6 @@ window.openGuidedAddContributorSwal = async () => {
confirmButtonText: "Add contributor",
confirmButtonColor: "#3085d6 !important",
willOpen: () => {
console.log("Loading up the add contributor modal. ON wil open");
//Create Affiliation(s) tagify for each contributor
const contributorAffiliationInput = document.getElementById(
"guided-contributor-affiliation-input"
Expand Down Expand Up @@ -9740,7 +9729,6 @@ const renderDatasetDescriptionContributorsTable = () => {
};

const addContributorField = () => {
console.log("Adding contributor");
const contributorsContainer = document.getElementById("contributors-container");
//create a new div to hold contributor fields
const newContributorField = document.createElement("div");
Expand Down Expand Up @@ -10839,7 +10827,6 @@ window.specifyPool = (event, poolNameInput) => {
setActiveSubPage("guided-organize-subjects-into-pools-page");
return;
} else {
console.log("Pools here?");
//Add left border back to subject dropdown cell to separate pool name and subject dropdown
poolSubjectsDropdownCell.removeClass("remove-left-border");

Expand Down Expand Up @@ -12229,7 +12216,6 @@ const createPennsievePermissionsTableRowElement = (entityType, name, permission,
}
};
const renderPermissionsTable = () => {
console.log("Rendering permissions table?");
// when rendering permissions we will need to check if the permission was fetched from pennsieve
// we will then create a different table element that will behave differently
// visually showing user that the permission will be deleted upon upload
Expand Down Expand Up @@ -12500,7 +12486,6 @@ const setGuidedDatasetPiOwner = (newPiOwnerObj) => {
};

const guidedAddUserPermission = (newUserPermissionObj) => {
console.log("Adding user permissions");
//If an existing user with the same ID already exists, update the existing user's position
for (userPermission of window.sodaJSONObj["digital-metadata"]["user-permissions"]) {
if (
Expand Down Expand Up @@ -13076,7 +13061,6 @@ document.getElementById("button-homepage-guided-mode").addEventListener("click",
attachGuidedMethodsToSodaJSONObj();
guidedTransitionFromHome();

console.log("About to unlock sidebar");
guidedUnLockSideBar();

guidedUnSkipPage("guided-select-starting-point-tab");
Expand All @@ -13094,7 +13078,6 @@ document.querySelector("#button-homepage-freeform-mode").addEventListener("click
});

$("#guided-button-add-permission-user-or-team").on("click", function () {
console.log("Here finally");
try {
//get the selected permission element
const newPermissionElement = $("#guided_bf_list_users_and_teams option:selected");
Expand Down Expand Up @@ -13681,7 +13664,6 @@ $("#guided-input-destination-getting-started-locally").on("click", () => {
});

const guidedCreateOrRenameDataset = async (bfAccount, datasetName) => {
console.log("That is the dataset name: ", datasetName);
document.getElementById("guided-dataset-name-upload-tr").classList.remove("hidden");
const datasetNameUploadText = document.getElementById("guided-dataset-name-upload-text");

Expand Down Expand Up @@ -14574,7 +14556,6 @@ window.electron.ipcRenderer.on(
// Remove unnecessary key from sodaJSONObjCopy since we don't need to
// check if the account details are valid during local generation
delete sodaJSONObjCopy["bf-account-selected"];
console.log("making post request to /curate_datasets/curation");

updateDatasetUploadProgressTable("local", {
"Current action": `Preparing dataset for local generation`,
Expand All @@ -14601,7 +14582,6 @@ window.electron.ipcRenderer.on(
const { data } = response;
const main_curate_progress_message = data["main_curate_progress_message"];
if (main_curate_progress_message === "Success: COMPLETED!") {
console.log("Done with generation");
break; // Exit the loop when generation is done
}
const elapsed_time_formatted = data["elapsed_time_formatted"];
Expand Down Expand Up @@ -14646,10 +14626,7 @@ window.electron.ipcRenderer.on(
updateDatasetUploadProgressTable("local", {
"Current action": `Generating metadata files`,
});
console.log(
"Subjects path: ",
window.path.join(filePath, guidedDatasetName, "subjects.xlsx")
);

// Generate all dataset metadata files
await guidedGenerateSubjectsMetadata(
window.path.join(filePath, guidedDatasetName, "subjects.xlsx")
Expand Down Expand Up @@ -14992,10 +14969,7 @@ const guidedGenerateDatasetDescriptionMetadata = async (destination) => {
);
}

console.log("guidedDatasetInformation", guidedDatasetInformation);
console.log("guidedStudyInformation", guidedStudyInformation);
console.log("guidedContributorInformation", guidedContributorInformation);
console.log("datasetLinks", datasetLinks);

try {
await client.post(
`/prepare_metadata/dataset_description_file`,
Expand Down Expand Up @@ -16128,7 +16102,6 @@ $("#guided-generate-changes-file").on("click", () => {
});

$("#guided-generate-dataset-button").on("click", async function () {
console.log("Generating for GM");
// Ensure that the current workspace is the workspace the user confirmed
const currentWorkspace = guidedGetCurrentUserWorkSpace();
const datasetWorkspace = window.sodaJSONObj["digital-metadata"]["dataset-workspace"];
Expand Down Expand Up @@ -16217,7 +16190,6 @@ $("#guided-generate-dataset-button").on("click", async function () {
});

const guidedSaveBannerImage = async () => {
console.log("Wowawhoo");
$("#guided-para-dataset-banner-image-status").html("Please wait...");
//Save cropped image locally and check size
let imageFolder = path.join(homeDirectory, "SODA", "guided-banner-images");
Expand Down
2 changes: 0 additions & 2 deletions src/renderer/src/scripts/manage-dataset/manage-dataset.js
Original file line number Diff line number Diff line change
Expand Up @@ -1656,7 +1656,6 @@ const showDatasetDescription = async () => {
};

window.getBase64 = async (url) => {
console.log("THe url passed down will be: ", url)
return await window.electron.ipcRenderer.invoke("get-string-representation-of-buffer", url, "binary")
};

Expand Down Expand Up @@ -2034,7 +2033,6 @@ const uploadBannerImage = async () => {
} else {
//final size is greater than 5mb so compress image here (image already created and stored in temp file)
let scaledImagePath = await window.scaleBannerImage(imagePath); //scaled image will be in temp folder
console.log("Scaled image path value: ", scaledImagePath)
let image_file_size = window.fs.fileSizeSync(scaledImagePath); //update size for analytics
try {
let uploadBannerImage = await client.put(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1283,7 +1283,6 @@ window.edit_current_con_id = (ev) => {

const memorizeAffiliationInfo = (values) => {
window.createMetadataDir();
console.log("affiliationConfigPath", window.affiliationConfigPath)
var content = window.parseJson(window.affiliationConfigPath);
content["affiliation"] = values;
window.fs.writeFileSync(window.affiliationConfigPath, JSON.stringify(content));
Expand Down
2 changes: 0 additions & 2 deletions src/renderer/src/scripts/metadata-files/downloadTemplates.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ let templateArray = [
const downloadTemplates = async (templateItem, destinationFolder) => {
let currentDirectory = await window.electron.ipcRenderer.invoke("get-current-directory");
let templatePath = window.path.join(currentDirectory, "..", "renderer", "file_templates", templateItem);
console.log(templatePath)
let destinationPath = window.path.join(destinationFolder, templateItem);
console.log(destinationPath)

if (window.fs.existsSync(destinationPath)) {
let emessage = "File '" + templateItem + "' already exists in " + destinationFolder;
Expand Down
Loading

0 comments on commit 39c4811

Please sign in to comment.