Community
Participate
Working Groups
- we currently only allow favorites that are Orion artifacts (searches, files, folders). The user should be able to favorite anything. - check OSLC to see if there is any API for favorites, etc. - IBM jazz has some ideas in this area
Assigning to Nayna. (Nayna, Szymon asked me to find some well-scoped things that needed to be done for M5). I was imagining we would add a button in the heading of the favorites list that, when pushed, would make a text box visible that one could use to paste or drag-in a URL link. The resulting link would be stored as a favorite and at that point it would behave like the rest (you could rename it, etc.) I don't think we need to worry about grander issues (using favorites from other systems, etc.) at this point. It would just be nice to be able to favorite a bug, or a wiki page, or whatever.
You can attach a patch here and I can review (since commit rights are still being worked out.)
changing milestone. No new features for M6.
Created attachment 191813 [details] Adding a button img besides Favorites Adding the add img(acts as button) besides Favorites Heading
Created attachment 191814 [details] Code for adding a new URL Added the changes to add new URL to the Favorites List
I have implemented the code for adding a new URL. I am attaching the changed files.. Please have a look The changes are : 1. There is one "Add" Image (acts as a button) besides Favorites 2. On clicking it , an inline editing box appears. 3. Once the user types the Url and presses Enter , it gets added to the list. 4. User can drag Url from bookmarks or from the Address Bar to this text box 5. If the user tries to copy the url from another Tab and tries to come back here, the Url dragging is lost, so that cannot be done. 6. If user clicks on some other place than the shown text box, the text box disappears. However, there is one separate issue : With this feature, the user is able to add any Url, whether an html file or complete http path to the Favorites list. Eg.. adding http://www.eclipse.org. So,on the favorites list, this path gets added. Now, if I click on it.. It shows "An error occurred: Unable to load undefined status:404" I think it tries to open as code in editor.. but as such it should be opening it in the different tab as Http page. So, let me know if there is any thought on this. Thanks !!
Created attachment 192176 [details] Updated the code to open the external favorite links correctly I have added the code so that it checks whether the favorite link path is and external web link or Orion file/directory resource. Based on the type of the favorite, it will open it correctly. It currently opens it in the same tab/window.
Thanks, Nayna. As we discussed while you were working on it, it was easier to do things like put the "add favorite" command directly in the HTML and get something up and running rather than have you learn the command service, etc. So what I did was take what you attached here and work on it a bit to fit it in a bit better. I expected to have to do this, so don't worry. I think the best way to transfer knowledge is to have you browse the commit for this bug (6670f7c4d69d0d89f4ab43028c95f2a85b49e33b) using a tool like gitk to look at the changes. To summarize what I did: - I wanted the favorites heading (and command image) to be generated inside the Favorites component. I've been meaning to do that even before this bug, so that when we want to change the look of Favorites, we only need to change the code, rather than tweak the HTML in each page that shows favorites. So I've moved heading generation into the "render" method in Favorites and took it out of the HTML. - I then contributed "add favorite" as a command. Take a look at the initialization in Favorites, and look also in the header where the commands are rendered. The main idea to understand is that we define a command (its look and behavior) and then contribute it to the UI. When we contribute a command using a DOM id, it means the command will get rendered in the specified DOM element. - I decided to place the edit box at the bottom of the favorites list, since that is where a newly added favorite ends up. Otherwise it was easy for the user to get a little lost as to where the favorite went. - I moved the code around so that the editing code was located inside Favorites, not FavoritesService. The reason for this is that the FavoritesService is a "core" thing that doesn't really know how the favorites UI is rendered. It just keeps track of favorites, stores them in preferences, and fires listeners. The Favorites object is the one that knows how it's going to draw things, and thus can make decisions about where to put the edit box, etc. Ping me if you have any questions about this. Thanks for the patches! Fixed.
*** Bug 340869 has been marked as a duplicate of this bug. ***