Skip to content

Commit

Permalink
removed unneeded comments
Browse files Browse the repository at this point in the history
  • Loading branch information
subnub committed Dec 8, 2020
1 parent 1e28ba1 commit 13dc080
Show file tree
Hide file tree
Showing 22 changed files with 0 additions and 82 deletions.
4 changes: 0 additions & 4 deletions backend/controllers/file.ts
Expand Up @@ -147,8 +147,6 @@ class FileController {

const id = req.params.id;
const userID = req.user._id;

console.log("remove link", id);

await fileService.removeLink(userID, id)

Expand Down Expand Up @@ -547,8 +545,6 @@ class FileController {
const fileID = req.body.id;
const userID = req.user._id;
const parentID = req.body.parent;

console.log(fileID, userID, parentID);

await fileService.moveFile(userID, fileID, parentID);

Expand Down
6 changes: 0 additions & 6 deletions backend/controllers/user.ts
Expand Up @@ -82,14 +82,10 @@ class UserController {

try {

console.log("\nCreating New Refresh Token...")

const user = req.user;

if (!user) throw new NotFoundError("User Not Found");

console.log("tokens", user.tokens.length);

const {accessToken, refreshToken} = await user.generateAuthToken(req.clientIp);

if (!accessToken || !refreshToken) throw new InternalServerError("User/Access/Refresh Token Missing");
Expand All @@ -98,8 +94,6 @@ class UserController {

res.status(201).send();

console.log("New Refresh Token And Access Token Sent");

} catch (e) {

console.log("\nGet Refresh Token User Route Error:", e.message);
Expand Down
2 changes: 0 additions & 2 deletions backend/cookies/createCookies.ts
Expand Up @@ -7,8 +7,6 @@ const maxAgeStreamVideo = 60 * 1000 * 60 * 24;

const secureCookies = env.secureCookies ? env.secureCookies === "true" ? true : false : false;

console.log("Secure Cookies", secureCookies);

export const createLoginCookie = (res: Response, accessToken: string, refreshToken: string) => {

res.cookie("access-token",accessToken, {
Expand Down
3 changes: 0 additions & 3 deletions backend/db/utils/folderUtils/index.ts
Expand Up @@ -56,8 +56,6 @@ class DbUtil {
// query = {...query, "personalFolder": null}
// }

console.log("folder query", query);

const folderList = await Folder.find(query)
.sort(sortBy) as FolderInterface[];

Expand All @@ -71,7 +69,6 @@ class DbUtil {
if (type) {
if (type === "mongo") {
query = {...query, "personalFolder": null}
console.log("mongo query", query)
} else {
query = {...query, "personalFolder": true}
}
Expand Down
2 changes: 0 additions & 2 deletions backend/models/user.ts
Expand Up @@ -251,7 +251,6 @@ userSchema.statics.findByCreds = async(email: string, password: string) => {
const isMatch = await bcrypt.compare(password, user.password);

if (!isMatch) {
console.log("incorrect password")
throw new Error("Incorrect password");
}

Expand Down Expand Up @@ -596,7 +595,6 @@ userSchema.methods.decryptS3Data = async function() {

userSchema.methods.generatePasswordResetToken = async function() {

console.log("generating reset password token")
const iv = crypto.randomBytes(16);

const user = this as UserInterface;
Expand Down
3 changes: 0 additions & 3 deletions backend/services/ChunkService/FileSystemService.ts
Expand Up @@ -404,7 +404,6 @@ class FileSystemService implements ChunkInterface {
await awaitStream(readStream.pipe(decipher), res, allStreamsToErrorCatch);

if (file.metadata.linkType === "one") {
console.log("removing public link");
await dbUtilsFile.removeOneTimePublicLink(fileID);
}
}
Expand Down Expand Up @@ -468,8 +467,6 @@ class FileSystemService implements ChunkInterface {

deleteAll = async(userID: string) => {

console.log("remove all request")

await Folder.deleteMany({"owner": userID});

const fileList = await dbUtilsFile.getFileListByOwner(userID);
Expand Down
3 changes: 0 additions & 3 deletions backend/services/ChunkService/MongoService.ts
Expand Up @@ -271,7 +271,6 @@ class MongoService implements ChunkInterface {
await awaitStream(readStream.pipe(decipher), res, allStreamsToErrorCatch);

if (file.metadata.linkType === "one") {
console.log("removing public link");
await dbUtilsFile.removeOneTimePublicLink(fileID);
}
}
Expand Down Expand Up @@ -454,8 +453,6 @@ class MongoService implements ChunkInterface {

deleteAll = async(userID: string) => {

console.log("remove all request")

let bucket = new mongoose.mongo.GridFSBucket(conn.db, {
chunkSizeBytes: 1024 * 255
});
Expand Down
5 changes: 0 additions & 5 deletions backend/services/ChunkService/S3Service.ts
Expand Up @@ -203,8 +203,6 @@ class S3Service implements ChunkInterface {

const decipher = crypto.createDecipheriv('aes256', CIPHER_KEY, IV);

console.log("download personal file", currentFile.filename);

res.set('Content-Type', 'binary/octet-stream');
res.set('Content-Disposition', 'attachment; filename="' + currentFile.filename + '"');
res.set('Content-Length', currentFile.metadata.size.toString());
Expand Down Expand Up @@ -466,7 +464,6 @@ class S3Service implements ChunkInterface {
await awaitStream(readStream.pipe(decipher), res, allStreamsToErrorCatch);

if (file.metadata.linkType === "one") {
console.log("removing public link");
await dbUtilsFile.removeOneTimePublicLink(fileID);
}
}
Expand Down Expand Up @@ -538,8 +535,6 @@ class S3Service implements ChunkInterface {

deleteAll = async(userID: string) => {

console.log("remove all request")

await Folder.deleteMany({"owner": userID});

const fileList = await dbUtilsFile.getFileListByOwner(userID);
Expand Down
2 changes: 0 additions & 2 deletions backend/services/FolderService/index.ts
Expand Up @@ -171,8 +171,6 @@ class FolderService {

if (rootID === currentID) break;

console.log("finding ID", currentID)

const currentFolder = await this.getFolderInfo(userID, currentID);
const currentSubFolders = await this.getFolderList(user, {parent: currentFolder._id});

Expand Down
1 change: 0 additions & 1 deletion backend/services/UserService/index.ts
Expand Up @@ -70,7 +70,6 @@ class UserService {

if (currentEncryptedToken === encryptedToken) {

console.log("Refresh Token Found Logout!");
user.tokens.splice(i, 1);
await user.save();
break;
Expand Down
3 changes: 0 additions & 3 deletions backend/utils/createQuery.ts
Expand Up @@ -64,9 +64,6 @@ const createQuery = (owner: string, parent: string, sortBy: string, startAt: num
// query = {...query, "metadata.personalFile": true}
// }

console.log("storage type", storageType)
console.log("query", query);

return query;

}
Expand Down
1 change: 0 additions & 1 deletion backend/utils/sendShareEmail.ts
Expand Up @@ -24,7 +24,6 @@ const sendShareEmail = async (file: any, respient: string) => {
}

await sgMail.send(msg);
console.log("Share email sent");
}

export default sendShareEmail
2 changes: 0 additions & 2 deletions backend/utils/userUpdateCheck.ts
Expand Up @@ -19,8 +19,6 @@ type userAccessType = {

const userUpdateCheck = async(res: Response, id: string, ipAddress: string | undefined) => {

console.log("Loading full user for email verification check");

const updatedUser = await User.findById(id);

if (!updatedUser) throw new NotFoundError("Cannot find updated user auth");
Expand Down
4 changes: 0 additions & 4 deletions src/actions/auth.js
Expand Up @@ -35,8 +35,6 @@ export const startLogin = (email, password, currentRoute) => {

//window.localStorage.setItem("token", token);

console.log("USER SERVICE LOGIN RESPONSE", response.data.user);

if (emailVerified) {

dispatch(setLoginFailed(false))
Expand Down Expand Up @@ -115,8 +113,6 @@ export const startLoginCheck = (currentRoute) => {
return (dispatch) => {

axios.get("/user-service/user").then((response) => {

console.log("USER SERVICE LOGIN CHECK RESPONSE", response.data);

const emailVerified = response.data.emailVerified;

Expand Down
21 changes: 0 additions & 21 deletions src/actions/files.js
Expand Up @@ -67,8 +67,6 @@ export const startSetFileAndFolderItems = (historyKey, parent="/", sortby="DEFAU
if (search && search !== "") {

//fileURL =
console.log("Searching");

// if (storageType === "stripe") {

// console.log("Pied Search")
Expand Down Expand Up @@ -190,8 +188,6 @@ export const startSetAllItems = (clearCache, parent="/", sortby="DEFAULT", searc

const quickItemsURL = !env.googleDriveEnabled ? `/file-service/quick-list` : `/file-service-google-mongo/quick-list`;

console.log("google drive enabled", env.googleDriveEnabled);

dispatch(setFiles([]))
dispatch(setFolders([]))
dispatch(setQuickFiles([]))
Expand Down Expand Up @@ -235,12 +231,8 @@ export const startSetFiles = (parent="/", sortby="DEFAULT", search="", isGoogle=
dispatch(setFiles([]))
dispatch(setLoading(true))

console.log("Fetching file list");

if (env.googleDriveEnabled) {

console.log("is google")

axios.get(`/file-service-google/list?parent=${parent}&sortby=${sortby}&search=${search}&limit=${limit}&storageType=${storageType}`).then((results) => {

const googleList = results.data;
Expand All @@ -259,8 +251,6 @@ export const startSetFiles = (parent="/", sortby="DEFAULT", search="", isGoogle=
})
} else if (env.googleDriveEnabled && parent === "/") {

console.log("is not google")

// Temp Google Drive API
axios.get(`/file-service-google-mongo/list?parent=${parent}&sortby=${sortby}&search=${search}&limit=${limit}&storageType=${storageType}`).then((results) => {
// console.log("Google Data", results.data.data.files);
Expand All @@ -283,9 +273,6 @@ export const startSetFiles = (parent="/", sortby="DEFAULT", search="", isGoogle=
})
} else {

console.log("is not google")


axios.get(`/file-service/list?parent=${parent}&sortby=${sortby}&search=${search}&limit=${limit}&storageType=${storageType}`).then((results) => {

const mongoData = results.data;
Expand Down Expand Up @@ -316,19 +303,13 @@ export const startLoadMoreFiles = (parent="/", sortby="DEFAULT", search="", star

return (dispatch) => {

console.log("search", search)

//dispatch(setLoading(true))

dispatch(setLoadingMoreItems(true));

let limit = window.localStorage.getItem("list-size") || 50
limit = parseInt(limit)

if (isGoogle) {

console.log("is google")

// Temp Google Drive API
axios.get(`/file-service-google/list?limit=${limit}&parent=${parent}&sortby=${sortby}&search=${search}&startAt=${true}&startAtDate=${startAtDate}&startAtName=${startAtName}&pageToken=${pageToken}`).then((results) => {

Expand All @@ -351,8 +332,6 @@ export const startLoadMoreFiles = (parent="/", sortby="DEFAULT", search="", star

} else {

console.log("is not google")

axios.get(`/file-service/list?limit=${limit}&parent=${parent}&sortby=${sortby}&search=${search}&startAt=${true}&startAtDate=${startAtDate}&startAtName=${startAtName}`).then((results) => {

//console.log("load more files result", results.data.length)
Expand Down
2 changes: 0 additions & 2 deletions src/actions/folders.js
Expand Up @@ -112,8 +112,6 @@ export const startRemoveFolder = (id, parentList, isGoogle=false, parent, person

const url = isGoogle ? `/folder-service-google/remove` : personalFolder ? `/folder-service-personal/remove` : `/folder-service/remove`;

console.log("personal folder", personalFolder);

axios.delete(url, {
data
}).then((response) => {
Expand Down
2 changes: 0 additions & 2 deletions src/actions/selectedItem.js
Expand Up @@ -25,8 +25,6 @@ export const startSetSelectedItem = (id, file, fromQuickItems, isGoogleDrive) =>

axios.get(`/file-service-google/info/${id}`).then((results) => {

console.log("file info google", results.data, results.data.id);

const data = results.data;

const {filename: name, length: size, uploadDate: date, parentName: location, metadata, _id: id} = results.data;
Expand Down
6 changes: 0 additions & 6 deletions src/components/Dataform/index.js
Expand Up @@ -17,8 +17,6 @@ class DataFormContainer extends React.Component {

changeListViewMode = () => {

console.log("changing list view", this.props.listView);

if (!this.props.listView) {
this.props.dispatch(enableListView())
} else {
Expand Down Expand Up @@ -55,10 +53,6 @@ class DataFormContainer extends React.Component {

loadMoreItems = () => {

// return;

console.log("load more items dataform");

let limit = window.localStorage.getItem("list-size") || 50
limit = parseInt(limit)

Expand Down
3 changes: 0 additions & 3 deletions src/components/Header/index.js
Expand Up @@ -52,9 +52,6 @@ class HeaderContainer extends React.Component {
const value = e.target.value;
this.searchValue = value;

console.log("search on change", value);


this.props.dispatch(setSearch(value))
this.searchSuggested()
}
Expand Down
3 changes: 0 additions & 3 deletions src/components/Homepage/index.js
Expand Up @@ -48,7 +48,6 @@ class HomePageContainer extends React.Component {
this.props.dispatch(startResetParentList());

} else if (pathname.includes("/search")) {
console.log("login check set search")
this.setSearchItems();
return;

Expand Down Expand Up @@ -189,8 +188,6 @@ class HomePageContainer extends React.Component {
const storageType = url.searchParams.get("storageType") || undefined;
const folderSearch = url.searchParams.get("folder_search") || undefined;

console.log("Search", value, parent, storageType, folderSearch);

this.props.dispatch(startResetCache())
this.props.dispatch(setCurrentRouteType("search"))
this.props.dispatch(setCachedSearch(value))
Expand Down
2 changes: 0 additions & 2 deletions src/components/SettingsPage/index.js
Expand Up @@ -70,8 +70,6 @@ class SettingsPageContainer extends React.Component {
env.emailAddress = response.data.email
this.props.dispatch(setParent(uuid.v4()))

console.log("user detailed", response.data)

this.setState(() => {
return {
...this.state,
Expand Down
2 changes: 0 additions & 2 deletions webUI/src/index.js
@@ -1,7 +1,5 @@
import axios from "axios";

console.log("Hello, there", process.env.PORT);

const formElement = document.getElementById("form-submit")
const inputElement = document.getElementById("input-password");
const mainDiv = document.getElementById("main-div")
Expand Down

0 comments on commit 13dc080

Please sign in to comment.