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

[WIP] Update Dependencies and Small Improvements #605

Merged
merged 3 commits into from
Nov 22, 2017

Conversation

hacdias
Copy link
Member

@hacdias hacdias commented Nov 12, 2017

Update Dependencies and Other Improvements

  • Update Dependencies on package.json
  • Fix File's preview page
  • Replace safe-buffer by native Buffer
  • Fix Object's page
    • View object by Hash (Path changed from /objects/\\ipfs\\{hash} to /objects/ipfs/{hash}.
    • View object by Path
  • Fix Currently doesn't work for production build #603
    • Same-name directory issue
    • Firefox Upload (can't reproduce)
  • Fix build
  • Review tests to work with new deps

File Manager/Preview Improvements (secondary)

  • File Explorer and File Preview navigation is the same
  • File Preview no longer renders errors
  • File Explorer and File Preview now have different URLs for different files
  • Upload Button on File Manager
  • Prettier Action Bar (?)
  • Prettier File Listing (?)
  • Preview PDFs too (?)
  • Rename
    • Context Menu
    • Action Bar
    • Pretty Dialog Box
  • "Move to" dialog
  • "Copy to" dialog
  • Shortcuts
    • F2 - rename
    • ESC - clear selection
    • CTRL + Click - select multiple files or directories
    • SHIFT + Click - select a range of files or directories
    • DEL - delete current selection

@ghost ghost assigned hacdias Nov 12, 2017
@ghost ghost added the status/in-progress In progress label Nov 12, 2017
@ghost ghost assigned daviddias Nov 12, 2017
@daviddias
Copy link
Member

@hacdias Is this working for you locally? Maybe I started reviewing way too early :) Sorry about that!

@hacdias
Copy link
Member Author

hacdias commented Nov 12, 2017

@diasdavid everything but file previews and objects' page.

@hacdias
Copy link
Member Author

hacdias commented Nov 12, 2017

@diasdavid:

  1. Is there any specific reason to use HashHistory (e.g.: address/#path) instead of BrowserHistory (e.g.: address/path)?
  2. What's the difference between 'containers' and "legacy" pages?

@daviddias
Copy link
Member

Ah, the error was on my end, I was using another branch of go-ipfs. Now I see it working:

image

Great work with the deps update, @hacdias! 👏🏽

re: Is there any specific reason to use HashHistory (e.g.: address/#path) instead of BrowserHistory (e.g.: address/path)?

When you use a # you are certain that information never goes to the server, it stays on the front end app.

What's the difference between 'containers' and "legacy" pages?

Containers come from Redux, are you familiar with it?

@hacdias
Copy link
Member Author

hacdias commented Nov 12, 2017

I'm not, but I'll get familiar to it ;) I'm still updating object's page.

Right now, on master, previews are not working but they're working now. Although, I'm receiving a very strange error which doesn't have any side effect apparently.

image

Another thing I noticed are the 'Unmapped range' errors I'm getting on Connections page. I already know their source but I'm not understanding why they are happening here.

image

Do you have any thoughts on this?

@daviddias
Copy link
Member

I'm also checking what's happening there, it seems that here:

https://github.com/ipfs/webui/blob/master/src/app/js/pages/connections.js#L56

We call getLocation (which is lookupPretty) with a PeerId and a multiaddr, but then it returns an error "Unmapped range" coming from https://github.com/ipfs/ipfs-geoip/blob/master/src/pretty.js#L15-L17 which only happens when we pass an empty array.

Now checking what goes inside the Peer :)

@daviddias
Copy link
Member

daviddias commented Nov 12, 2017

It's actually coming from https://github.com/ipfs/ipfs-geoip/blob/master/src/lookup.js#L50. Bad error names, let me change that. Nevertheless, this means that geoip doesn't have info from the location of that IP, this should not error to the user and only show that location is Unknown. @hacdias think you can improve that part of the experience?

@hacdias
Copy link
Member Author

hacdias commented Nov 12, 2017

Good to know you found the problem so fast 😮

@daviddias
Copy link
Member

I've been around this codebase before 😉

geoip will need:

Until then, webui should not fail on the user, it should just show n/a

@daviddias daviddias self-requested a review November 12, 2017 21:45
@daviddias
Copy link
Member

@hacdias mind looking into #603 as well?

@hacdias
Copy link
Member Author

hacdias commented Nov 12, 2017

@diasdavid sure thing.

@hacdias
Copy link
Member Author

hacdias commented Nov 13, 2017

@diasdavid sorry, there are some things I'm needing help with:

  1. This code is generating a Unexpected token A in JSON at position 0 which I think it's because 'name' will be 'undefined' at first. See more. FIXED 😄
  2. Later, I will probably need some help with the tests. I'm not used to write tests and I haven't already understood how they work (I'll try to dig more into them though).
  3. I'm not fully understanding why the objects page is not working as expected. Although, the current version on master also produces some errors but works better.
  4. What do you think is the most safe and simple URL scheme to use here:
    • #/files/?name=/path/to/dir
    • #/files\/path/to/dir - This because hashes don't go into the server.

In the meanwhile, I'll make some improvements to the File Manager and the preview page and update this PR accordingly.

Edit (14th Nov, 10:32am): the object's page is now working better. The URLs' hash scheme is #/objects/ipfs/{hash}. Hashes with paths like #/objects/ipfs/QmYwAPJzv5CZsnA625s3Xf2nemtYgPpHdWEz79ojWnPbdG/readme don't work yet and the error Non-base58 character is produced from js-ipfs-api.

@hacdias hacdias changed the title [WIP] Update Dependencies [WIP] Update Dependencies and Small Improvements Nov 13, 2017
@hacdias
Copy link
Member Author

hacdias commented Nov 16, 2017

@diasdavid take a look at the checkboxes above 😄 There are a lot of new ones!! I'd like to know if you could help me with the unchecked checkboxes from the first section ("Update Dependencies and Other Improvements").

About the File Manager: do you think a download button for files/folders would be great? What about a slightly improved design? One more question: we're using Bootstrap, right? 😃

Edit: what do you think about using Semantic UI instead of Bootstrap? They've got an official package for React and it doesn't seem that our current library (react-bootstrap) isn't getting much love recently!

@daviddias
Copy link
Member

Still some deps to be updated

image

Here is a handy module to check things http://npmjs.com/npm-check-updates

@hacdias
Copy link
Member Author

hacdias commented Nov 17, 2017

Yeah, I've been using that module. Thanks 😄

@daviddias
Copy link
Member

daviddias commented Nov 17, 2017

Hi @hacdias! Just got to review your work, lots of progress here! Congratz 👏🏽👏🏽👏🏽

This PR is a bit exploding in size, let's focus on wrapping it up so that then multiple things can be tackled at the same time.

From what I understand, the things that are essential to merge this PR are:

  • Update tests and make sure CI is green
  • Update remaining dependencies
  • Fiz search by Object Path

Also, important question, are we able now to generate a build version to deploy with the next go-ipfs? The current webui go-ipfs ships is kind of out of date (//cc @whyrusleeping )

About the File Manager: do you think a download button for files/folders would be great? What about a slightly improved design? One more question: we're using Bootstrap, right? 😃

Edit: what do you think about using Semantic UI instead of Bootstrap? They've got an official package for React and it doesn't seem that our current library (react-bootstrap) isn't getting much love recently!

We picked Bootstrap at the time because of its community support, documentation and stability. I understand that the world has changed and that new UI frameworks can fit us better.

Before we jump to a decision, let's create a issue (you create it :)) in this repo to discuss what is the best and then we ask our community to help us decide given their experience.

Btw, since you are also a designed, how experienced are you with Invision and Sketch? Wanna work on the next UI together? I can create a team and invite you there.

@hacdias
Copy link
Member Author

hacdias commented Nov 17, 2017

Thanks!

This PR is a bit exploding in size, let's focus on wrapping it up so that then multiple things can be tackled at the same time.

Sure, let's focus on its initial topic and update the dependencies. I'll need some help with the tests and the object by path. The remaining dependencies are updated 😄

We picked Bootstrap at the time because of its community support, documentation and stability. I understand that the world has changed and that new UI frameworks can fit us better.

Before we jump to a decision, let's create a issue (you create it :)) in this repo to discuss what is the best and then we ask our community to help us decide given their experience.

Btw, since you are also a designed, how experienced are you with Invision and Sketch? Wanna work on the next UI together? I can create a team and invite you there.

I'll open an issue then. I'm not experienced with Invision nor Sketch. Yeah, I'd like to work on the next UI 😮 It seems to be a challenging work to do and I could learn more about design I guess. 😄

@hacdias
Copy link
Member Author

hacdias commented Nov 21, 2017

@diasdavid I think there is some kind of error on js-ipfs-api in config.replace which is returning File argument 'file' is required when we try to save the file. Could you check that, please?

@daviddias
Copy link
Member

@hacdias I believe that was a bug introduced with ipfs-inactive/js-ipfs-http-client#629 which changed how files are sent to the daemon, wanna try figure that one out and added a test to make sure it works well? @pgte can help you by answering your questions :)

@hacdias
Copy link
Member Author

hacdias commented Nov 21, 2017

I'll check that this evening. In the meanwhile, everything is greeen 😄

Edit: rebased everything atop of master. Also opened a PR on HenrikJoreteg/hjs-webpack#349 to support ES6.

Update dependencies

Update dependencies

Update dependencies

Update Dependencies

update dependencies!

Fix Object Links

Fix Globe Texture

Update Babel to Version 7

Update React

chore: remove lock files

docs: give some love to the README

Make views refresh the right way

Make preview work

Update GeoIP

Fix "same-name directory" issue #603

Remove unused param

Objects page already display the hash table

Fix link to Objects page

Fix nameon preview

Remove unnecessary elements

Fix object's view

Update File Explorer and File Preview Styles

Sweet file explorer!

Use urls like /objects/ipfs/hash instead of /objects\/ipfs\hash

avoid double slash

Add upload button to action bar

Remove safe-buffer and use built-ins

Update js-ipfs-api

Rudimentary Rename (not working)

Make Move work :D

F2, esc and del keys

Rename on Action Bar

CTRL+Click, Multiple files

shift-CLICK to select range of files

update dependencies

Remove fetch objects by path

remove useless comments

update deps

fix 'npm run build'

remove coment and add pr link

Use fork of hjs-webpack

update some tests

fix config.spec.js

update circle.yml
@daviddias
Copy link
Member

👏🏽👏🏽👏🏽👏🏽👏🏽👏🏽 Excellent work @hacdias

This means that we finally can ship new WebUIs to go-ipfs //cc @whyrusleeping

@hacdias
Copy link
Member Author

hacdias commented Nov 21, 2017

Thanks @diasdavid!

Copy link
Member

@daviddias daviddias left a comment

Choose a reason for hiding this comment

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

Some tidbits, otherwise it LGTM :)

I would appreciate some review from the folks that have worked on the webui project before.

"webpack": "^3.0.0"
"style-loader": "^0.19.0",
"url-loader": "^0.6.2",
"webpack": "^3.8.1"
},
"pre-commit": [
"lint"
Copy link
Member

Choose a reason for hiding this comment

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

Sooo greeeen! :D

Copy link
Member Author

Choose a reason for hiding this comment

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

Am I supposed to change anything in here? 😮

Copy link
Member

Choose a reason for hiding this comment

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

just happy :)

break
}

this.selectAllBetween(fi, la)
Copy link
Member

Choose a reason for hiding this comment

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

@hacdias can we convert this loop into something more JavaScript'y/Functional? Check out all the beautiful array methods https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array and try to use variable names that try to be more explicit (it is ok to use full words in JS land)

for (let i = fi; i <= la; i++) {
const filePath = join(root, list[i].Name)
select(filePath)
}
Copy link
Member

Choose a reason for hiding this comment

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

Yeah, let's make this more JavaScripty, I have no idea what is fi and la

@daviddias daviddias merged commit 2c2a305 into master Nov 22, 2017
@daviddias daviddias deleted the update-dependencies branch November 22, 2017 10:29
@ghost ghost removed the status/in-progress In progress label Nov 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants