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

feat: add delete prompt to file browser #689

Merged
merged 4 commits into from
Jun 29, 2018

Conversation

hacdias
Copy link
Member

@hacdias hacdias commented Jun 28, 2018

image

The commits on this PR are self contained and should be merged without squashing.

@@ -35,17 +42,17 @@ class FilesPage extends React.Component {
doUpdateHash(`/files${link}`)
}

onInspect = (hash) => {
onInspect = ([file]) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why add the array here?

PS: I'm dropping in without much background.

Copy link
Member Author

Choose a reason for hiding this comment

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

We were only sending the required info for each hook: the delete only needed paths, the inspect only needed the hash, etc.

But since now we also need the type of the file, we would have to send two different things for delete hook.

I then decided just to send everything to every hook and the hook uses the data it wants. You can see the changes on this commit.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds good, thank you 👍

let filesNumber = 0
let foldersNumber = 0

files.forEach(file => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't you prefer one liners when it's a simple conditional?

files.forEach(file => file.type === 'directory' ? foldersNumber++ : filesNumber++)

Copy link
Member Author

Choose a reason for hiding this comment

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

For me it's indifferent, I don't think one way is better than the other. I can change it though.

@hacdias hacdias force-pushed the feat/revamp/delete-prompt-applied branch from 6826b6b to 0a0c2cd Compare June 28, 2018 15:30
@hacdias hacdias self-assigned this Jun 29, 2018
@hacdias hacdias added the revamp label Jun 29, 2018
@hacdias
Copy link
Member Author

hacdias commented Jun 29, 2018

@olizilla let's merge this 😄

@olizilla
Copy link
Member

👀

@olizilla
Copy link
Member

screenshot 2018-06-29 10 41 03

There's an issue with the focus outline. The buttons are inheriting the focus state from the parent which looks weird. focus should generally only apply to a single element and isn't inherited. My bad, the .focus-outline selector is too general. Can you fix it and add it to the modal too please, the blue outline around the modal box looks out of place.

@hacdias
Copy link
Member Author

hacdias commented Jun 29, 2018

@olizilla just fixed 😄

image

Copy link
Member

@olizilla olizilla left a comment

Choose a reason for hiding this comment

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

👍

@olizilla olizilla merged commit 81add8d into revamp Jun 29, 2018
@olizilla olizilla deleted the feat/revamp/delete-prompt-applied branch June 29, 2018 12:22
@fsdiogo fsdiogo mentioned this pull request Jun 29, 2018
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.

3 participants