hyrax icon indicating copy to clipboard operation
hyrax copied to clipboard

Batch add works to collection from collection admin show page when some fail doesn't forward as expected

Open elrayle opened this issue 6 years ago • 0 comments

Descriptive summary

This issue lays out expected forwarding behavior when adding works to a collection through Dashboard->Collections->collection show page fails for some works.

NOTE: This likely uses the same forwarding behavior as adding works to a collection through Dashboard ->Works. This issue and issue #4007 are tightly related and the fix for one may fix both.

Rationale

Provide intuitive forwarding behavior that focuses on the actions a user will most likely want to take next. Provide error message that is easy to understand.

Expected behavior

When adding multiple works to a collection from Dashboard -> Collections -> collection show page...

FAILURE to add some of the works should:

  • [x] forward to collection's admin show page
  • [ ] shows flash error (yellow): Collections Error: You have attempted to add works to more than one collection of the same single-membership collection type (collection type: name of collection type, collections: list of effected collections). Some of the works were not added.

Testing

  • [ ] Need to update specs added in PR #2687 to match the forwards described in this issue.

Actual behavior

When adding multiple works to a collection from Dashboard -> Collections -> collection show page...

FAILURE of all works added:

  • forwards to collection's admin show page, as expected
  • shows success message (green): Collection was successfully updated.
  • shows flash error message (red): Collections Error: You have specified more than one of the same single-membership collection type (type: name of collection type, collections: list of effected collections)

Steps to reproduce the behavior

Prerequisites:

Need a collection type that is set to allow single membership. If testing on Nurax, this collection type may already exist. Look for Collection Type Single Membership. If it doesn't exist, then create a single membership collection type using...

  • Dashboard -> Settings -> Collection Types -> Create new collection type
  • Assign type name Single Membership and Save
  • On Settings tab, uncheck MULTIPLE MEMBERSHIP and Save changes

Need two collections of type Single Membership. You can create using...

  • Dashboard -> Collections -> New Collection -> select Single Membership type -> Create Collection
  • Assign suitable titles for the two collections and save. This issue will refer to them as SM1 and SM2.

Create 2 works and add one to collection SM1 using...

  • Dashboard -> Works -> Add new work -> fill in requirements -> Save. This issue will refer to them as Work1 and Work2
  • Dashboard -> Works -> check box beside Work1 -> Add to Collection -> select SM1 -> Save changes

Test:

Verify FAILURE to add some works to second collection of the same Single Membership type.

  1. Dashboard -> Collections -> click title for collection SM2 -> click button Add existing works to this collection >>
  2. check box beside Work1 and Work2 -> Add to Collection -> Save changes

Verify forwards to SM2 admin show page. (Admin show page is the show page for the collection with the admin menu on the left.)

Verify flash error (yellow) with message "Collections Error: You have attempted to add works to more than one collection of the same single-membership collection type (collection type: Single Membership, collections: SM1, SM2). Some of the works were not added.

Related work

  • Issue #4006 Batch add works to collection from Dashboard->Works when all fail doesn't forward as expected
  • Issue #4007 Batch add works to collection from Dashboard->Works when some fail doesn't forward as expected
  • Issue #4008 Batch add works to collection from collection admin show page when all fail doesn't forward as expected
  • Issue #4010 Adding work to multiple single membership collections from new work form does not forward as expected
  • Issue #4011 Adding work to multiple single membership collections from edit work form does not forward as expected
  • PR #2687 - fix single membership and add single/multi-membership spec tests

elrayle avatar Sep 17 '19 13:09 elrayle