| Summary: | Able to add the same file to Favourites more than once | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [ECD] Orion | Reporter: | Pradyut Sarma <pradyutksarma> | ||||
| Component: | Client | Assignee: | Susan McCourt <susan> | ||||
| Status: | RESOLVED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | andrew.eisenberg, simon_kaegi | ||||
| Version: | unspecified | ||||||
| Target Milestone: | 0.4 M2 | ||||||
| Hardware: | PC | ||||||
| OS: | Windows 7 | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
|
Description
Pradyut Sarma
Created attachment 198239 [details]
Favourites View Discrepancy
Susan, are you working on this right now? I was going to take a stab at fixing this if you currently are not. Pull request: https://github.com/eclipse/orion.client/pull/11 I wrote all this code and have the rights to contribute it to Eclipse under the eclipse.org web site terms of use. Some comments on this: 1. I did not write any tests. I didn't see any test infrastructure for this area, but if you would like me to add a test (and can point me to something similar), I will. 2. I made a change from - if (faves[i].directory) { to + if (faves[i].isFavorite) { I am not sure I fully understand what the previous code was doing. It looks like it may have been a bug. thanks, Andrew! I'll take a look a little later today (In reply to comment #4) > thanks, Andrew! I'll take a look a little later today it'll be tomorrow, after our conf call. *** Bug 369010 has been marked as a duplicate of this bug. *** per duplicate bug by Andrew, the original fix was not complete. To reproduce: 1. In the navigator, click on the '+' icon next to 'Favorites' 2. In the text box that appears, type 'http://eclipse.org' 3. repeat When all cases are fixed, you can update this bug. Note also that I removed the function "favoriteExists" from the fix for bug 368896 since it wasn't technically part of that fix. So you may need to pull the latest and add it back. When done, let me know the pull request. Thanks for working on this. sorry if this ends up causing more trouble. I originally thought you had reopened this bug and so decided to try to commit bug 368896 first. Then I pulled the function out. Then I realized you intended to commit this bug, then bug 368896, then the one I marked duplicate. At any rate, at this point, it would be cool to have one commit that fixes both problems. Not trying to haze you, just got confused a little. Sorry for the confusion. I'm just trying to get a handle on committing things via git. I'll try to get this all done in one commit. Here we go. This one is better. https://github.com/aeisenberg/orion.client/commit/2acd664edb624537ba2885c009dbaea922faf16d As always, I wrote all this code and have the rights to contribute it to Eclipse under the eclipse.org web site terms of use. While I was trying to squash all the changes into one commit, I wound up deleting the repository and simply losing the changes. :( Thankfully, not hard to recreate everything. The commit here fixes this bug, Bug 369010 (for dealing with duplicate favorites). Also, there is a change for ensuring that case insensitive sorting of favorites occur (the current solution does a case-sensitive sort and looks quite strange). Hope this works for you. (In reply to comment #9) > Sorry for the confusion. I'm just trying to get a handle on committing things > via git. I'll try to get this all done in one commit. No worries, we're just learning about the best way to get contributions (and will probably modify Orion to make this simpler). For now, it's helpful to mention not just the commit but what branch in your repo it is in. That way I can find it via a git log in Orion and cherry pick it. (A better way is for us to be able to cherry pick from the git commit page, I'll open a bug for that.) Pushed the fix. There was typo in one of the messages, so while I was there I changed the message to specify what item is the duplicate. That can be helpful if the user fumble fingers the item and wonders what happened/if they selected the right one. I also noticed that it was still possible to add duplicate folders so I fixed it since I was there anyway. The problem is that the favorites service stores item.ChildrenLocation if there is one (for folders) and item.Location for files. So the code checking for dups has to provide the ChildrenLocation if there is one. It's a bit of knowledge leak that the client code knew this, but I'm not really up for reorganizing the favorites code right now. (If you were interested in doing so see also bug 334201. Ultimately I'd like to see all kinds of URLs stored as favorites, with user groupings, etc. The way it's organized now (with searches as a separate thing) is quite arbitrary. Thanks again for the fix! |