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

Folder rearranging feature(#349) #396

Closed
wants to merge 16 commits into from

Conversation

ymtdzzz
Copy link
Contributor

@ymtdzzz ymtdzzz commented Apr 6, 2020

related issue: #349

Added folder tree component to the storage edit page.

Folder pathnames are transformed to folderTreeData.

Example
/
/FolderA
/FolderA/FolderA-A
/FolderA/FolderA-B
/FolderA/FolderA-B/FolderA-B-A
/FolderB

[
  {
    "title": "TestA",
    "pathname": "/TestA",
    "isDirectory": true,
    "children": [
      {
        "title": "TestAA",
        "pathname": "/TestA/TestAA",
        "isDirectory": true,
        "children": [
          {
            "title": "testAAA",
            "pathname": "/TestA/TestAA/testAAA",
            "isDirectory": true
          }
        ],
        "expanded": true
      }
    ],
    "expanded": true
  },
  {
    "title": "TestB",
    "pathname": "/TestB",
    "isDirectory": true
  }
]

By using this data and react-sortable-tree library, we can get each folder's before & after pathname.
(Please try to push the update folders button after rearranging folders.)

debug log
${after pathname}(${before pathname})

/FolderA(/FolderA)
/FolderA/FolderA-B-A(/FolderA/FolderA-B/FolderA-B-A)
/FolderA-A(/FolderA/FolderA-A)
/FolderB(/FolderB)
/FolderB/FolderA-B(/FolderA/FolderA-B)

Todos:

  • Add functions to transform pathnames to folder tree data
  • Remove the key 'isDirectory' from folderTreeDatas because all folderTreeDatas are directory
  • Add functions to execute updating all folders' pathnames within storage
  • Support folder's order
  • Add validation to check no duplicated pathnames
  • Styling (loading indicator, css)
  • Add tests

IssueHunt Summary

Referenced issues

This pull request has been submitted to:


IssueHunt has been backed by the following sponsors. Become a sponsor

@ymtdzzz ymtdzzz marked this pull request as ready for review April 12, 2020 13:49
@ymtdzzz
Copy link
Contributor Author

ymtdzzz commented Apr 12, 2020

I have implemented all features above.
Please give me a review.

Screenshot
screencast 2020-04-12 22-26-03

Thank you.

@ymtdzzz ymtdzzz changed the title [WIP] Folder rearranging feature(#349) Folder rearranging feature(#349) Apr 12, 2020
@Flexo013 Flexo013 added the awaiting review ❇️ Pull request is awaiting a review. label Apr 12, 2020
@Rokt33r
Copy link
Member

Rokt33r commented Apr 26, 2020

@zeroclock
Great work! But sadly, I've made tons of changes in v0.4.0 and there are so many conflicts between the current master and this pr. Can you fix the conflicts?

@Rokt33r Rokt33r added awaiting changes 🖊️ Pull request has been reviewed, but contributor needs to make changes. and removed awaiting review ❇️ Pull request is awaiting a review. labels Apr 26, 2020
@ymtdzzz
Copy link
Contributor Author

ymtdzzz commented Apr 27, 2020

@Rokt33r
I've fixed merge conflicts.

@Rokt33r Rokt33r added this to the v0.5.0 milestone Apr 28, 2020
@Rokt33r Rokt33r added awaiting review ❇️ Pull request is awaiting a review. and removed awaiting changes 🖊️ Pull request has been reviewed, but contributor needs to make changes. labels May 1, 2020
@Rokt33r Rokt33r modified the milestones: v0.5.0, v0.7.0 Jun 6, 2020
@Rokt33r Rokt33r removed this from the v0.7.0 milestone Jul 26, 2020
@peoray
Copy link

peoray commented Aug 6, 2020

Why hasn't this been merged yet? This is a great feature to implement

@ChrisCorrigan
Copy link

ChrisCorrigan commented Aug 19, 2020

In my opinion, it would be better to not have an 'update folders' button, but rather it updates every time you drop the folder after a move. So being able to update the folders by drag and drop on the left, without needing an edit state (on the right).

This would be consistent with how most people would expect, and less prone to conflicts if the app allows concurrent collaboration (or ever will). Also some people might forget or not notice to click. And less clicks, the better.

@Rokt33r Rokt33r modified the milestones: v0.9.0, v0.10.0 Sep 1, 2020
@Rokt33r
Copy link
Member

Rokt33r commented Sep 1, 2020

@peoray Sorry for the delay. I still need to think about how to introduce this feature properly.

@Rokt33r
Copy link
Member

Rokt33r commented Sep 1, 2020

@ChrisCorrigan I agree with you. Folder orders should be managed by dragging and drop in the navigator.

FYI, we're already trying to provide concurrent collaboration. And the app has the rearranging feature in real-time. Please check this out http://boosthub.io/ The app will be integrated into this app one day.

@kazup01 kazup01 removed this from the v0.10.0 milestone Aug 24, 2021
@Rokt33r
Copy link
Member

Rokt33r commented Aug 24, 2021

It's been fixed in other prs. Sorry for my late response.

@Rokt33r Rokt33r closed this Aug 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting review ❇️ Pull request is awaiting a review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants