Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add scripts for file upload #42

Merged
merged 3 commits into from
Aug 15, 2020
Merged

Conversation

bismitaguha
Copy link
Contributor

Description

Fixes #11

Type of Change:

  • Code

Code/Quality Assurance Only

  • New feature (non-breaking change which adds functionality pre-approved by mentors)

How Has This Been Tested?

N/A

Checklist:

  • My PR follows the style guidelines of this project
  • I have performed a self-review of my own code or materials

Code/Quality Assurance Only

  • My changes generate no new warnings
  • Any dependent changes have been published in downstream modules

@bismitaguha bismitaguha requested review from abha224 and sidvenu July 16, 2020 21:58
@bismitaguha
Copy link
Contributor Author

@abha224 @sidvenu I am having doubts regarding the URL of upload. So I needed help there

@bismitaguha bismitaguha force-pushed the upload branch 2 times, most recently from d6e166c to 3e844e1 Compare July 16, 2020 22:39
@sidvenu
Copy link

sidvenu commented Jul 20, 2020

@bismitaguha could you comment the doubts here?

sidvenu
sidvenu previously approved these changes Jul 20, 2020
Copy link

@sidvenu sidvenu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good till the work done.

@abha224
Copy link
Contributor

abha224 commented Jul 20, 2020

@bismitaguha Is the issue resolved?

@bismitaguha
Copy link
Contributor Author

@abha224 @sidvenu the URL is throwing errors.

@abha224
Copy link
Contributor

abha224 commented Jul 21, 2020

@bismitaguha can you add a screenshot of the error for reference?

@bismitaguha
Copy link
Contributor Author

URL error
Screenshot from 2020-07-21 23-27-15

@sidvenu
Copy link

sidvenu commented Jul 23, 2020

This sounds like you're appending a JS object to a string. Try running the following in your browser console:

const obj = {
    name: "John Smith",
    email: "johnsmith@nomail.com"
};
const urlPath = '/' + obj
urlPath

This will print /[object Object].

Can you recheck your code for a similar pattern?

@bismitaguha
Copy link
Contributor Author

Screenshot from 2020-08-03 20-27-25
I am constantly receiving this error and have tried modifying the .env file also based on these sources docs & github issue.
If @sidvenu and @abha224 you could look into this and help me out here. I have referred to this blog while writing the code.

@abha224 abha224 added the Program: GSOC Related to work completed during the Google Summer of Code Program. label Aug 3, 2020
@sidvenu
Copy link

sidvenu commented Aug 3, 2020

Update: Bismita and I discussed this in our 1:1, and we found that this is a problem caused by the .env file not getting loaded. @bismitaguha is working to solve that.

@bismitaguha
Copy link
Contributor Author

Update: The env problem is solved. Now I am receiving a different error
SignatureDoesNotMatch: The request signature we calculated does not match the signature you provided. Check your key and signing method.

I am working on this, meanwhile if anyone finds any resource please send a link. @sidvenu @abha224

@bismitaguha
Copy link
Contributor Author

The complete config:
Screenshot from 2020-08-04 01-19-45

@bismitaguha bismitaguha changed the title [WIP]: Add scripts for file upload Add scripts for file upload Aug 5, 2020
@bismitaguha bismitaguha requested a review from sidvenu August 5, 2020 19:59
@bismitaguha
Copy link
Contributor Author

@sidvenu @abha224 All issues are resolved please review!!!!

@@ -0,0 +1,73 @@
import React, { Component } from 'react'
// import { postUpload } from '../actions/upload'
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If not necessary, remove.

Comment on lines 6 to 10
require('dotenv').config();

export default class Upload extends Component {
constructor(props) {
super(props)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A code comment here would be appropriate.

src/urls.js Outdated
@@ -27,6 +27,10 @@ export function submission() {
return `${urlBaseFrontend()}submission`
}

export function file() {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
export function file() {
export function urlFileUpload() {

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename the references to this function too.

@bismitaguha
Copy link
Contributor Author

bismitaguha commented Aug 8, 2020

@sidvenu this is the sample script which will be reused in a separate component in the form responses. So this part will get deleted there completely. So right now do I need to add comments here because I will be resuing this in a different component and adding comments there makes sense maybe???

@sidvenu
Copy link

sidvenu commented Aug 9, 2020

@bismitaguha In that case, you can copy and paste the comment as well. I feel an individual contributor should be able to understand this repo's code at all points in history, and thus comments are important no matter how redundant it would be in the future. @abha224 what do you think?

@bismitaguha bismitaguha requested a review from sidvenu August 15, 2020 17:32
Copy link
Contributor

@abha224 abha224 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed and tested. PR looks good to me 👍

Copy link

@sidvenu sidvenu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@sidvenu sidvenu merged commit 1d224b7 into anitab-org:develop Aug 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Program: GSOC Related to work completed during the Google Summer of Code Program.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

As an User, I am able to upload files to OSP
3 participants