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

Grouping servers as tree view - completed #252

Closed
wants to merge 10 commits into from

Conversation

wacki4
Copy link
Contributor

@wacki4 wacki4 commented Feb 14, 2019

Completed saving and viewing for tree folders view.

TODO:

  • i don't know how to correct edit icon for folders in server configuration view,
  • some strange 'box' inside folder name - i don't know where does it get there
  • overall check for such big change ;)

Regarding to #72

@cschindl
Copy link
Collaborator

Hi @wacki4,

thanks for your help. I'll look into it in the next few days. It would be good if you could fix the merge conflicts.

@wacki4
Copy link
Contributor Author

wacki4 commented Feb 15, 2019

I think is done. I made it by page, so could be some code mistake, but i think that everything is allright.

Copy link
Collaborator

@cschindl cschindl left a comment

Choose a reason for hiding this comment

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

Hi @wacki4,

thank for your great work. I add some comments. Feel free to ask me if you don't understand something. The following points are global things that i could not comment in the source code.

Enhancement:

  • Check source code formatting (.jsbeautifyrc)
  • Treeview: sort folders before servers
  • Folder structure: check circular relations (actually folder A can be a parent of folder B, but at the same time folder B can also be parent of folder A)

Error:

  • Disable drag/drop handler for folders
  • Changes on global storage object are used in tree view even if i doesn't save the configuration.
  • Folder options in select will not be loaded if i open the configuration view. After i click the edit button and go back, the options will be added.
  • After saving the configuration the folder and servers will not be added.
  • When I click the edit folder button in the configuration and go back, the first server in the list is selected. This is confusing :)

lib/config/folder-schema.json Outdated Show resolved Hide resolved
lib/helper/storage.js Show resolved Hide resolved
lib/helper/storage.js Outdated Show resolved Hide resolved
lib/helper/storage.js Outdated Show resolved Hide resolved
lib/helper/storage.js Outdated Show resolved Hide resolved

// Events
server.getConnector().on('log', (msg) => {
self.ftpLogView.addLine(msg);
Copy link
Collaborator

Choose a reason for hiding this comment

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

ftpLogView doesn't exists in this class. Better create functions onDidServerAdd, onDidFolderAdd functions for this class. In treeview where you call the addServer function, you can also set this function as callback.

Copy link
Contributor Author

@wacki4 wacki4 Feb 20, 2019

Choose a reason for hiding this comment

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

I don't really know what to do :) So i removed ftplogger, and if You think that something need to change - fell free for change.

lib/views/folder-view.js Show resolved Hide resolved
lib/views/configuration-view.js Outdated Show resolved Hide resolved
lib/helper/storage.js Outdated Show resolved Hide resolved
return self.servers;
}

getTree() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Where you use this function? You never need the whole tree structure. You always only need the parent or children folder(s).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I use it in tree view - i need to build somewhere a tree, so i thought that te best place to make it would be Storage helper, than tree view. Maybe we would need it in future somewhere else.

@wacki4
Copy link
Contributor Author

wacki4 commented Feb 20, 2019

So i put some corrections, resolved checks i've set to resolved, not - made a comment. I think that i done everything.

Additional to Your message:

Enhancement:

  • Check source code formatting (.jsbeautifyrc) - i think that done, is there any way to 'beautify entire project' in atom?
  • Treeview: sort folders before servers - done, easy, i thought that we will allow to sort for user as they want (by name), but maybe it is better option, so i only removed resorting on end,
  • Folder structure: check circular relations (actually folder A can be a parent of folder B, but at the same time folder B can also be parent of folder A) - as i think i've done fully circular check. It won't allow user to make such error,

Error:

  • Disable drag/drop handler for folders - Done
  • Changes on global storage object are used in tree view even if i doesn't save the configuration. - TODO - any idea how to make it now?
  • Folder options in select will not be loaded if i open the configuration view. After i click the edit button and go back, the options will be added. - TODO - as i understand You mean reloading folders after edit them? Or something else?
  • After saving the configuration the folder and servers will not be added. - TODO - always? in file or on the view?
  • When I click the edit folder button in the configuration and go back, the first server in the list is selected. This is confusing :) - Done

@wacki4
Copy link
Contributor Author

wacki4 commented Feb 21, 2019

I have idea for

  • Changes on global storage object are used in tree view even if i doesn't save the configuration.

Maybe if clicked cancle/close window reload from config all data? And on save - always save it? It would be simplest way to do it.

@cschindl
Copy link
Collaborator

Your idea could work like this. I will check and test your changes promptly.

@cschindl
Copy link
Collaborator

Most of the adjustments look good. Some things can still be optimized but I could do that later. During testing I noticed some mistakes:

folder configuration

  • If no folders have been created (which is the case when I open the configuration for the first time), the input fields in the configuration folder should not be editable either. The fields should only be editable after clicking on new and generating a new entry.
  • After I create a folder for the first time and click on save and return to the server configuration, the folder I just created is not offered as a selection. This is only available after a restart.
  • Circular relations between the folders still exist. E.g. If you click on new 2 times, 2 folders will be created. Now I switch to folder 1 and assign folder 2 as parents. Now I switch to folder 2 and assign folder 1 as parents, which should not work. When saving it comes to an error because there is a circle relation.
  • When I delete a folder, the first folder in the list is selected. Unfortunately, the data in the input fields are not updated. They still show the data of the deleted folder.
  • Your idea for changes on global storage object would not work. For example, open the server configuration and change something on the currently selected server. Now click on Edit at the folder button, create a new folder and click on save. Now the folder has been saved to the configuration. Unfortunately also the changes I made to the server before. If I now click on cancel the changes are still saved on the server what is wrong. The only idea I have is to work with a copy of the storage object in the configuration and only save it when saving the configuration. The storage object should reload the new configuration.

treeview:

  • Keyboard shortcut (right key) doesn't open the file or expand the folder like in the master version.
    Line 683 Wrong: if (!current.view().isExpanded) {
    Line 683 OK: if (!current.view().isExpanded()) {

ftp-remote-editable.js

  • found self.info.password. Please check. I think this is included by merging again.

@wacki4
Copy link
Contributor Author

wacki4 commented Feb 21, 2019

  • Your idea for changes on global storage object would not work. For example, open the server configuration and change something on the currently selected server. Now click on Edit at the folder button, create a new folder and click on save. Now the folder has been saved to the configuration. Unfortunately also the changes I made to the server before. If I now click on cancel the changes are still saved on the server what is wrong. The only idea I have is to work with a copy of the storage object in the configuration and only save it when saving the configuration. The storage object should reload the new configuration.

About that - maybe simpler would be saving only folder part when folder editing? Because now, in Your way - it looks for me like if i save Folder, and after that cancle server config - it won't be save as i would predict. Maybe make a copy of servers for configuration view, and also copy of folders for folder configuration view? But there it could became a bug when we delete folder on folders view... This case look really hard as i see it. Maybe, we shouldn't combine this in current way, but make 'edit folders' on context menu on remote pane?

@cschindl
Copy link
Collaborator

And if we implement my suggestion and remove in the folder configuration the save butten. Then you could only manage the folders there but saving the whole configuration, including the server settings, would only happen in the server configuration. This would make everything logical again.

@wacki4
Copy link
Contributor Author

wacki4 commented Feb 21, 2019

So we only have 'Close button' on Folder Configuriation view, and if we made some error, we close this window and close ConfigurationView, and reopen it, and everything is allright after that? It looks good and logical.

Only hard for now would be copy of Storage object, but it probably only look so hard ;)

@wacki4
Copy link
Contributor Author

wacki4 commented Feb 21, 2019

So maybe if we don't have save button over Folder Configuration View, reloading after closing and not saving ConfigurationView would be ok? It will make everything easier.

@cschindl
Copy link
Collaborator

Yes it would be ok. The result should be the same.

@wacki4
Copy link
Contributor Author

wacki4 commented Feb 21, 2019

So i will try to complete it this week. Some of problems i've resolved localy.

@wacki4
Copy link
Contributor Author

wacki4 commented Feb 21, 2019

I am to stubborn to get to sleep with such a problems in my head ;) I think that now everything.

I will only remember You problem with button next to folder chooser, and strange box inside folder name input ;) I don't know how where is there a problem.

Copy link
Collaborator

@cschindl cschindl left a comment

Choose a reason for hiding this comment

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

Circular relations between the folders still exist. I Think best place would be in folder-configuration-view.js in fillInputFields function. The rest of the changes look good.

lib/ftp-remote-edit.js Outdated Show resolved Hide resolved
lib/ftp-remote-edit.js Outdated Show resolved Hide resolved
lib/views/configuration-view.js Show resolved Hide resolved
lib/views/configuration-view.js Show resolved Hide resolved
lib/views/configuration-view.js Show resolved Hide resolved
@wacki4
Copy link
Contributor Author

wacki4 commented Feb 22, 2019

Circular relations between the folders still exist

Can You tell me how to reproduce circular relations? I've tried yesterday many combination but nothing allowed mi such a change.

@cschindl
Copy link
Collaborator

E.g. If you click on new 2 times, 2 folders will be created. Now I switch to folder 1 and assign folder 2 as parents. Now I switch to folder 2 and assign folder 1 as parents, which should not work. When saving it comes to an error because there is a circle relation.

@wacki4
Copy link
Contributor Author

wacki4 commented Feb 22, 2019

Ok i will try at home to reproduce and correct it.

@wacki4
Copy link
Contributor Author

wacki4 commented Feb 22, 2019

I didn't close review requesting which i didn't change/didn't found on code. Please check on Your side.

I think that now we are really close.

@cschindl
Copy link
Collaborator

Thanks for your help. Everything looks good so far. I will try to solve the connection problems from the issues first. After that I will make the last adjustments. You helped me a lot. Thank you very much for that.

@wacki4
Copy link
Contributor Author

wacki4 commented Feb 28, 2019

Always ready to help, cannot wait for this release ;) Next things coming from me :)

@wacki4 wacki4 closed this Feb 28, 2019
@wacki4
Copy link
Contributor Author

wacki4 commented Mar 3, 2019

When do You plan release ? :)

@cschindl
Copy link
Collaborator

cschindl commented Mar 4, 2019

Unfortunately, it took a little longer to fix the connection errors. But now that they seem to have been fixed, I can take care of the implementation of new features. So I will try to start this week. I don't have an exact date for the release yet. It will be released when it is finished) ;)

@wacki4
Copy link
Contributor Author

wacki4 commented Mar 4, 2019

I know, i also make everything in my free time ;) I have now only problem cause on my home computer i have new config, so everytime i have to run atom from console :D And also waiting for all changes on master, to make new ones, cause now beacause of changes there is realy big mess between branches ;)

@cschindl
Copy link
Collaborator

Hi @wacki4 ,

I have now made the adjustments in the branch "feature/grouping-servers". Can you test everything again from your side?

@wacki4
Copy link
Contributor Author

wacki4 commented Mar 15, 2019

Only problem that i found - when i've added one folder, get to servers, set on some of them this folder, got back to folders and added child folder for previous one - it wasn't seen on folders in server config. after save and getting back to server config - it was seen correctly.

Also, when deleting folder with servers, and folder has parent - maybe better would be to move servers to parent folder? It should not be hard to done.

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