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

Users can un-favorite items from favorites portlet #203

Merged
merged 16 commits into from
Jan 16, 2014

Conversation

apetro
Copy link
Member

@apetro apetro commented Jan 16, 2014

Add un-favorite functionality to Favorites portlet via EDIT portlet mode.

Note that this is a pull request for adding un-favoriting functionality to the favorites feature branch, not a pull request against trunk.

Known shortcomings, deferred work, and technical debt

  • This implementation doesn't align perfectly with the locally-at-UW-developed functionality for favoriting. Needs merge.
  • This implementation hard-codes messages in the Java and JSP layers. Should instead use message bundles. TODO's sprinkled inline where this should be done.
  • Lacks automated tests for much of the functionality.
  • This code and the feature branch being merged into are behind master. This pull request deliberately does not rebase against latest master, deferring that to cleanup in the favorites feature branch itself.
  • While the portlet confirms success of an un-favoriting with a lovely success message, it does not offer the user the opportunity to un-do an inadvertent un-favoriting, but almost certainly should.

Big picture design

  • Favorites is just another view on traditional layout as regards tabs ("collections of favorites).
  • Individually favorited items are represented as portlets in folders of type="favorites"
  • Un-favoriting is removing from layout
  • UI for editing favorites is implemented as the actual EDIT mode of the Favorites portlet.
  • Un-favoriting clicks are real ActionRequests generated via <portlet:ActionURL/>s (not AJAX)

Edit UI features

real_edit_favorites

  • Edit UI reflects whether favorites are delete-able by the user per DLM (lock glyph, only deleteable items appear to be clickable hyperlinks). Help text displayed explaining meaning of lock glyph (only shown if lock glyph is shown).
  • Edit UI provides a link to exit EDIT mode (return to VIEW mode).

lack_permission_to_un-favorite

  • Non-delete-ability of non-delete-able favorites is communicated via tool-tip on hover (click on touchscreens).
  • Backing controller filters delete requests for target node being in-layout, user permission to delete, signaling appropriate error messages to UI, and signaling success to UI when node successfully deleted from layout ("un-favorited').
  • Edit UI displays error and success messages so signaled (translated to model errorMessage and successMessage by the edit mode RenderRequest handler).

successful_un_favorite

Backing code

  • UserLayoutFolderDescription now reflects the underlying folder type attribute rather than being constrained to four hard-coded possible values. This is how type="favorites" is visible to the Favorites portlet.
  • Copy constructors in UserLayout*Description classes now do more of the copying you probably thought they already did. :) In particular, they now copy DLM attributes. This is demonstrated by unit tests.
  • UserLayout*Description classes now have richer toString()s to facilitate detailed logging at trace level in the Edit controller.

Change from representing folder type as one of four integer values to representing folder type as exactly the String type attribute on the underlying folder XML element.  This makes novel type values available through the Java API.
Switch to identifying the folder containing favorites by its type attribute rather than by its name.
Pulls favorites functionality into a Helper class.
Changes nomenclature to “collections” of favorites rather than “tabs”.
Fixes favorites view mode to display all favorited collections (tabs).
…ration

Initialize parameters Hashtable at declaration rather than inline in constructors.
Reflect more of channel description state in toString(), making logging of channel descriptions more useful.
Without the fix to `UserLayoutNodeDescription`, the assertions that DLM attributes copied fail in included unit test.
…utes.

Switch UserLayoutChannelDescription copy constructor to invoke superclass copy constructor so as to copy superclass-managed attributes.  Exercised by included unit test.  Test of copy of Node attributes fails without this fix.
Reflect in the `edit.jsp` whether items can be un-favorited.  Detect in controller when attempts to un-favorite will fail for lack of permissions.
timlevett added a commit that referenced this pull request Jan 16, 2014
Users can un-favorite items from favorites portlet
@timlevett timlevett merged commit a628994 into UP-3896 Jan 16, 2014
@timlevett timlevett deleted the unfavorite_from_favorites_portlet branch January 16, 2014 22:59
apetro pushed a commit that referenced this pull request Jul 8, 2015
MUMUP-1119 : Add in fname parameter so we can add portlets via fname
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.

None yet

2 participants