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

๐Ÿ› Editing a sub collection loses the relationships #183

Closed
1 task
ShanaLMoore opened this issue Mar 20, 2024 · 1 comment
Closed
1 task

๐Ÿ› Editing a sub collection loses the relationships #183

ShanaLMoore opened this issue Mar 20, 2024 · 1 comment
Assignees
Labels
bug something isn't working Mobius Work related to mobius tenants

Comments

@ShanaLMoore
Copy link
Contributor

ShanaLMoore commented Mar 20, 2024

Summary

Create a collection with relationships (subcollections).

If you Edit the subscollection, you will lose the relationship it had with its parent collection.

Acceptance Criteria

  • Editing a sub collection should not lose the relationships with its parent collection(s)
@ShanaLMoore ShanaLMoore added bug something isn't working Mobius Work related to mobius tenants labels Mar 20, 2024
@ShanaLMoore ShanaLMoore changed the title ๐Ÿ› Editing a collection loses the relationships ๐Ÿ› Editing a sub collection loses the relationships Mar 20, 2024
laritakr added a commit to samvera/hyku that referenced this issue Mar 21, 2024
A hyrax bug made it into Hyku via the collections controller decorator.
This removes the unnecessary `collection_params method`.

Refs
- scientist-softserv/hykuup_knapsack#183
- samvera/hyrax@7add213
laritakr added a commit to samvera/hyku that referenced this issue Mar 22, 2024
* ๐Ÿ› Fix collection membership bug

A hyrax bug made it into Hyku via the collections controller decorator.
This removes the unnecessary `collection_params method`.

Refs
- scientist-softserv/hykuup_knapsack#183
- samvera/hyrax@7add213

* Ignore rubocop error
@jillpe
Copy link

jillpe commented Apr 1, 2024

SoftServ QA: โœ…

Before editing subcollection:

Image

After editing subcollection:

Image

@jillpe jillpe closed this as completed Apr 1, 2024
laritakr added a commit to samvera/hyku that referenced this issue Apr 2, 2024
* Delete _repository_content.html.erb

Having this file was causing double rendering of bulkrax links in the sidebar.

Issues:
- #1850
- scientist-softserv/hykuup_knapsack#111

* use hyrax-4-valkyrie-support bulkrax branch

Update bulkrax to point to hyrax-4-valkyrie-support

* ๐Ÿ› App was not loading after updating Hyrax

This commit will adjust for the changes introduced in this commit:
samvera/hyrax@8fc0894

* โš™๏ธ Don't remove backtrace in dev

* remove bulkrax_identifier from Hyku

bulrax_identifier is not a required property. Each client should set their desired source_identifier in their application.

Issue:
- scientist-softserv/hykuup_knapsack#136

* ๐Ÿงน Make the appropriate link generate

This commit will add a decorator to check the `human_readable_type` of
the given object is a Valkyrie migration object (which by convention
ends with 'resource') and adjust the generated link accordingly.  For
example, a GenericWorkResource should generate links like
`/concern/generic_work_resources/...` instead of
`/concern/generic_works/...`.

The models were updated to include the Hyrax::NestedWorks so the `Attach
Child` button would populate the appropriate work types.

Lastly, the `Gemfile.lock` was updated to include the latest version of
Hyrax `double_combo` branch.

* ๐Ÿงน Add Valkyrie test adapter

For us to leverage the useful shared specs of Hyrax, we need a test
adapter.

* ๐Ÿงน Always with the coppers

* Updating Hyrax to latest version

* ๐Ÿงน Rework logic for #hydra_model

Using 'human_readable_type' was going to be flemsy.  Instead we are
opting for adding the `valkyrie_bsi` to the index and asking that.

* ๐Ÿ“š Add docs regarding knapsack

* ๐Ÿงน Favor not using valkyrie for the spec

* โ™ป๏ธ Only enable auto-redirect when Valkyrie enabled.

* ๐Ÿงน Configure Bulkrax

We configure Bulkrax to use the `ValkyrieObjectFactory` along with the
`ValkyrieMigrationCoercer` so a `GenericWork` will create a
`GenericWorkResource`.  Also, updated the revision of Bulkrax.

* Revert "๐Ÿงน Remove files declared in Knapsack"

This reverts commit d9fa1a2.

* Revert "remove bulkrax_identifier from Hyku"

This reverts commit 887fbf2.

* โ™ป๏ธ Bump Hyrax ref

* โ™ป๏ธ Favor Hyrax::SolrService

Ideally the code would reference the SolrService in one manner.  This is
an effort to create an insulating layer around that.

* make find_by_bulkrax_identifier.rb more dynamic

Not all applications will use bulkrax_identifier as their source_identifier. This code makes it more dynamic.

TODO: Make Wings::CustomQueries more dynamic

* Leverage updated IIIF Print

* ๐Ÿงน Appeasing rubocop

* find_by_source_identifier files moved to bulkrax

ref:
- samvera/bulkrax@29f2264

* Revert "find_by_source_identifier files moved to bulkrax"

This reverts commit 78d26c5.

* update bulkrax and iiif_print versions

find_by_source_identifier files were moved into bulkrax.

* ๐Ÿงน apply conditional to hyku indexing

specs refer to object as @object, and thus caused a lot of spec failures without this.

* ๐Ÿ’„ rubocop fix

* ๐Ÿงน Fix set child flag

This commit will make sure that the set child flag transaction fires
when ingesting with Bulkrax.  Also fixed a weird bug where the extra
space in the query was causing the query to fail.

* add guard for ActiveFedora's member_ids

AF's member_ids returns an array of ids so mapping (:id) will not work.

* Update Bulkrax and IiifPrint

Pull in fixes to make bulkrax relationships work for valkyrie. It also fixed the setting of is_child and the linking of relationships

Related:
- samvera/bulkrax#908
- scientist-softserv/iiif_print#328

* remove HYKU_IIIF_PRINT conditional

Per Rob, remove HYKU_IIIF_PRINT conditional. Iiif print will be enabled by default.

* update hyrax and iiif print

* Valkyrize reindex rake tasks

This commit adds reindexing for Valkyrie objects.

Issue:
- scientist-softserv/hykuup_knapsack#146

Co-Authored-By: Kirk Wang <k3wang@gmail.com>

* ๐Ÿ› Ensure underlying change to permissions

* Fix for xray-rails not working

Issue:
- scientist-softserv/hykuup_knapsack#71

Co-Authored-By: C Barton <43180845+CB987@users.noreply.github.com>

* Bumping Hyrax version

* ๐Ÿ’„rubocop fixes

Co-Authored-By: C Barton <43180845+CB987@users.noreply.github.com>

* update hyrax, bulkrax, iiif_print

* update hyrax

* Pin Hyrax to functioning build

* Delete find_by_source_identifier_spec.rb

This spec is no longer needed as its relevant code moved into bulkrax.

* Update iiif_print

ref: add a reindex after the child work has been saved.
- scientist-softserv/iiif_print#332

* ๐Ÿงน Remove `form` key from with_pdf_viewer

The `show_pdf_viewer` and `show_pdf_download_button` fields were showing
up on the form even though in the yaml they were set to false.  It looks
like just removing the `form` key from the yaml file will prevent them
from showing up.  Also updated the `Gemfile.lock` file.

* ๐Ÿงน Fix specs to reflect usage of Double Combo

* ๐Ÿ› Use registered instead of restricted

Restricted is the visibility, registered is the concept.  This fixes
that misnomer.

* ๐Ÿงน Amend spec to highlight double combo nuance

* ๐Ÿงน Rework lease expiry tests

See
https://github.com/samvera/hyku/wiki/Updating-Hyku-6-with-Hyrax-5-Developer-Notes#access-control-list-acl-considerations

* ๐Ÿ’„ endless and ever appeasing of the coppers

* ๐Ÿงน Fix broken spec

* ๐Ÿ’„ endless and ever appeasing of the cops

* Adding documentation

* ๐Ÿงน Adjust AdminSet spec count to reflect query service

* ๐Ÿงน Address assumptive redirect for /concern/generic_work/

* ๐Ÿงน Fixing redirect assumptions for insitutional visibility

* ๐Ÿงน Favor up to date double_combo

* Fixing a few specs to reflection Valkyriziation

* ๐Ÿงน Updating Hyrax version

Grab the latest sweet sweet double combo

* include Bulkrax helpers and update Bulkrax

* Rework spec to not rely on reload

* ๐Ÿงน Fixing tests to use generic_resource_factory

The factory is directly copied from Hyrax; and is not fully functional,
but it's better than what we've got.

* Fixing a spec that needs a #to_a

* โ™ป๏ธ Add Hyku.bulkrax_enabled?

Also refactor to set the default work type for Bulkrax later in the
application boot cycle.  When it was where it was at, I encountered
issues with wings model registration.

* โ™ป๏ธ Favor re-using the controller and hopefully routes

* Demonstrate how we're using lazy migrations and model naming

* โ™ป๏ธ Remove generated files

Favor the Lazy migration strategy

* ๐Ÿงน endless and ever appeasing of the coppers

* โ˜‘๏ธ Tidying up tests

* โ˜‘๏ธ Fixing a few broken tests

By extending the ability class to include all of the collection models,
we open up some additional considerations.

* Move ability declarations out of loop, where loop not needed

* ๐Ÿ’„ endless and ever appeasing of the coppers

* โ˜‘๏ธ Fill out require attributes

* โ˜‘๏ธ Working through failing tests

This does involve fixing a bug that is masking another underlying bug.

* Fixing broken specs

* ๐Ÿ› Refactor collection ability class

* Add elsif for FileSet and configure IIIF Print

This commit will add an elsif statement to the wings adapter to handle
FileSet objects. It will also add the configuration for IIIF Print to
use the IiifPrint::PersistenceLayer::ValkyrieAdapter.

* Bumping double_combo version

* Favor helper method over instance variable

* โ˜‘๏ธ We need to create a method to stub

* โ˜‘๏ธ Ever working towards tests

* ๐Ÿ’„ endless and ever appeasing of the coppers

* ๐ŸŽ Add some FileSet interface friendliness

* โ˜‘๏ธ Favor factory over process through actor stack

* โ˜‘๏ธ Adding tests for GenericWorkResrouce

* ๐ŸŽ Favor inheriting from admin_set

* โ˜‘๏ธ Removing spec/factories defined Hyrax

* ๐Ÿ’„ endless and ever appeasing of the coppers

* โ™ป๏ธ Fixing some tests to rely on factories instead of actor

* ๐Ÿšง Update Hyrax and IIIF Print

This commit will update the Hyrax and IIIF Print revisions which should
allow us to ingest images and have it render in the UV.  Uploading a PDF
should also work but PDF splitting current does not work.

* โ˜‘๏ธ Fixing a few tests by re-purposing some factories

* WIP

* Removing unneeded decorator and associated spec

* ๐Ÿงน Ignore vendor/gems directory

* โ˜‘๏ธ Adding documentation regarding Factories

* โ˜‘๏ธ Fixing tests and factories for roles_service

* โ™ป๏ธ Favor site configuration for allow downloads

Hyrax 5 has a display_media_download_link configuration option that we
can repurpose for the allow_downloads functionality that we are looking
to back-port from Hyku.

* โ˜‘๏ธ Fixing a broken test

* Fixing a few broken specs, still some broken

* ๐Ÿ’„ endless and ever appeasing of the coppers

* Removing long-ago removable code

* Modify Collection & Admin Set Valkyrization

Addresses:

โ˜„๏ธ EPIC: Valkyrize Hyku scientist-softserv/hykuup_knapsack#35
valkyrize collection and admin set resources scientist-softserv/hykuup_knapsack#94

Moves away from directly using Hyrax::PcdmCollection and
Hyrax::AdministrativeSet instead favoring inheriting from those
(with CollectionResource and AdminSetResource). This allows for
inheriting from Hyrax factories and extending them; thus bringing
Hykuโ€™s testing ecosystem closer to Hyrax.

Note: There are a few of the new specs that still fail.
-

* Coppers again

* โ˜‘๏ธ Favor explicit load of FactoryBot factories

* โ˜‘๏ธ Working on getting more tests passing

* Fixing ever more specs that keep breaking underneath me

* ๐Ÿ’„ endless and ever appeasing of the coppers

* โ™ป๏ธ Verify AdminSetResource factory build

* Adding specs to demonstrate factories

* ๐Ÿงน Avoid assuming factory-bot is available.

* ๐Ÿงน We want to create admin set resources

* ๐Ÿงน Fix broken spec due to not assuming admin group

* โ˜‘๏ธ Fixing specs by re-using factories

* โ˜‘๏ธ Adjust spec to use proper collection factory

* โ˜‘๏ธ Favor factory over instance double

* โ˜‘๏ธ Favor factory over explicit class

* โ˜‘๏ธ Favor factory over stub, and correct form class

* โ˜‘๏ธ Ensuring we start from a clean slate

* Fixing specs

* โ˜‘๏ธ Fixing tests squashing bugs that might show up

* Fixing specs to use resource classes

* Bumping version of IIIF Print

* ๐Ÿ› Add .each to find_all call

Without this, we pass a block to a method that does not anticipate
receiving a block.

* Fixing feature specs by ensuring admin_group

* ๐Ÿ› Fixing a couple of different bugs

Ever more to do.

* ๐Ÿ’„ endless and ever appeasing of the coppers

* WIP

* โ™ป๏ธ Adding further collection ability testing

* โ™ป๏ธ Put long list of objects into a loop

* โ™ป๏ธ Adding more valkyrie native collection specs

* โ™ป๏ธ Re-arranging collection declarations

* โ™ป๏ธ Working in the spec mines regarding permission

* Adding specs for disable

* โ™ป๏ธ Reworking specs and addressing significant typo

* ๐Ÿงน Fix specs concerning collection management

* Ever hacking on the specs

* ๐Ÿ’„ endless and ever appeasing of the coppers

* ๐Ÿงน Fix tests regarding collection management

* ๐Ÿงน Fixing Hyrax::CollectionType#collections query

* ๐Ÿงน Fixing a few broken specs

* ๐Ÿงน Reworking factory process

* ๐Ÿ’„ endless and ever appeasing of the coppers

* โ™ป๏ธ Favor member_ids_ssim over file_set_ids_ssim

For several years Hyrax has index `file_set_ids_ssim` as a verbatim copy
of `member_ids_ssim`.  With Hyrax 5, we're removing the
`file_set_ids_ssim` from indexing; And given that it's been a verbatim
copy since 2017 or so, it's relatively safe to assume that we can favor,
without application impact, the `member_ids_ssim` over the
`file_set_ids_ssim` value.

It would be nice to have `file_set_ids_ssim` but not as a verbatim copy.
Someday, we might have nice things.

Related to:
- samvera/hyrax#6513
- samvera/hyrax@7108409

* โ˜‘๏ธ Add role trait to reflect tests

* ๐Ÿงน Set various presenter's with correct file_presenter_class

Related to:

- samvera/hyrax#6717

* Bumping the double_combo

* Bumping version of IIIF Print and Bulkrax

* ๐Ÿ’„ endless and ever appeasing of the coppers

* Adding tests to snare failing specs that work locally

* โ™ป๏ธ Working on factory bot creation of permission templates

* โ™ป๏ธ Fix spec harness for permissions

* ๐Ÿ“š Add spec for factories to explain what happens

* Update double_combo and add bulkrax migrations

* Fixing some underlying specs

* โ™ป๏ธ Fix selector issue

* โ˜‘๏ธ Let These Specs Pass!

* โ˜‘๏ธ Typo

* ๐Ÿ’„ endless and ever appeasing of the coppers

* Remove redundant declaration

* โ˜‘๏ธ Remove flakey tests

These tests relied on existing data in solr but did not seek to have
clean data, thus received leaking data from other tests.

Meaning they would fail.

Ugh, tests should (by default) favor starting from a "clean state"
instead of inheriting state from other tests.

* โ˜‘๏ธ Favor FactoryBot.valkyrie_create

To do otherwise, invites a series of weird interactions.

* โ˜‘๏ธ Add explicit setting of models before discovery factories

* ๐Ÿงน Bump to new double_combo

* Remove transient as the underlying problem fixed

* โ™ป๏ธ Remove auto-creation of file

* โ˜‘๏ธ Favor Hyrax::SolrService.connection to match interface

* Bumping to new version of Hyrax double combo

* Update Hyrax

pulling in Jeremy's changes: custom queries and assigned strategies.

* Removing mocked tests that don't prove much

* Add embargo and lease to wings

We started seeing problems with the embargo (and presumably lease) now
allowing us to save the work.  This commit adds the necessary fields to
the big else statement in the wings initializer.

Ref:
  - scientist-softserv/hykuup_knapsack#157

* Update riiif config to replace deprecated method

The `cache_duration_in_days` is deprecated and locally it was causing
the web service to freeze.

* Adding tenant for request spec

* Updating factory spec to catch a failure

* Update Hyrax to move binaries

This commit will update Hyrax with the ability to move the binaries from
Fedora to Disk.  There are also some changes to the database schema to
make persisting work.  Wings initializer was updated to map the
Hydra::PCDM::File to the Hyrax::FileMetadata class as well.

* start spec to test file set migration

* ๐Ÿ› Fix Account switch bug

* โ™ป๏ธ Remove method as duplicate of Hyrax

The Hyrax::Group.new override handles the "find_by" logic we introduced.

* ๐ŸŽ Auto-magically migrate file sets and binaries

* ๐Ÿ’„ endless and ever appeasing of the coppers

* โ™ป๏ธ Remove stray puts statement

* Attempting to squash a flakey set of specs

* Update #parent_path to account for various case statements

The previous assumption was that we'd always have a SolrDocument, which is not true. This method has been updated to be more flexible.

* ๐Ÿ’„ endless and ever appeasing of the coppers

* I had to bail and copy the factories from Hyrax

* ๐Ÿ’„ endless and ever appeasing of the coppers

* โ™ป๏ธ Disable some consistently failing specs

Note, this likely means I can revert a previous commit about adjusting
the copies of factories from Hyrax.

* Update hyrax version

pulls in thumbnail loading fix

* Revert "I had to bail and copy the factories from Hyrax"

This reverts commit b0cbbac.

* Update Hyrax

pulls in WIP for af to valkyrie thumbnails + fix for serving thumbnails

* Bumping Hyrax version

* Updating Hyrax to latest build with FS fixes

* Merge branch 'i35-valkyrize-hyku' of https://github.com/samvera/hyku into i35-valkyrize-hyku

* โ™ป๏ธ Update Hyku to new Double Combo and config file_set_model

* ๐Ÿ’„ endless and ever appeasing of the coppers

* Addressing potential routing errors

Co-authored-by: Shana Moore <shana@scientist.com>

* Remove indexing of collection membership

Looking at the Hyrax code, it appears that it should already be done.

* โ™ป๏ธ Adding Hyku::Application.work_types (see docs)

* โ™ป๏ธ Configure `Bulkrax.*_model_class` methods

* copy Rob's reprocessor script from GBH into Hyku

Co-authored-by: Rob Kaufman <rob@notch8.com>

* resolve most rubocop warnings

* update rubocop_todo

Since we're mostly bringing over the reprocessor script as-is,
refactoring the method length is out of scope.

* Load HykuKnapsack decorators

This commit will allow the HykuKnapsack decorators to be loaded by the
application rb as well.

* temp: debug build issues

* Revert "temp: debug build issues"

This reverts commit 06350fc.

* Update Bulkrax

* Update Bulkrax

* Update Bulkrax and Hyrax

* ๐Ÿงน Update bulkrax gem

* Update Bulkrax

* ๐Ÿ› Fix undefined local variable iiif_print

There was a change in this version of IIIF Print that needed an update
to routes.rb.

Ref:
  - scientist-softserv/iiif_print#302

* ๐Ÿ› Fix collection membership bug (#2169)

* ๐Ÿ› Fix collection membership bug

A hyrax bug made it into Hyku via the collections controller decorator.
This removes the unnecessary `collection_params method`.

Refs
- scientist-softserv/hykuup_knapsack#183
- samvera/hyrax@7add213

* Ignore rubocop error

* update Bulkrax

* Show PDF.js viewer when PDF.js FlipFlop is true

This is a workaround to unblock Mobius ingests. If the feature flipper to display PDF.js is true, we will display that viewer regardless of the property values of :show_pdf_viewer and :show_pdf_download_button.

We will revisit valkyrizing this feature fully in the future, when we start the iiif x valkyrie epic.

Issue:
- scientist-softserv/hykuup_knapsack#185

Co-Authored-By: Kirk Wang <k3wang@gmail.com>

* revert previous commit and update logic of #show_pdf_viewer instead

This fixes a failing spec while still rendering PDF.js in the UI

Co-Authored-By: Kirk Wang <k3wang@gmail.com>

* Update valkyrie gem

* update valkyrie gem

* Update bulkrax to fix bug

Refs scientist-softserv/hykuup_knapsack#182

* ๐Ÿงน Clean up featured works and collections

The featured works and collections had some funky css problems where it
made sorting them impossible.  This commit will override some Hyrax scss
and fix some css classes on partials to make the featured
works/collections a better user experience.

* Update IiifPrint (#2172)

Fixes bug deleting works & file sets.

Refs scientist-softserv/hykuup_knapsack#187

* โ™ป๏ธ Favor method_missing over delegation

In the `double_combo` branch, we replaced the need for delegation with
method_missing.  Thus we can remove the delegate declarations and
instead rely on method missing behavior.

* โ™ป๏ธ Remove config that was there for flakey tests

* Update app/forms/hyrax/forms/admin/appearance_decorator.rb

* Favor published valkyrie gem version

* ๐ŸŽ Valkyrize Reindex jobs (#2173)

Addresses all reindex jobs to ensure that they will work for
either valkyrie or active fedora objects.

Ensures that works and collections are appropriately reindexed as
default work and collection images are added OR removed (previously,
reindexing didn't occur with removal of default images, resulting in
works displaying with a missing image.)

* update gemfile to add support for sentry

* ๐Ÿ—ก Stab in the dark at fixing an intermittent bug

* add conditional to support HykuUp Knapsack specs

* add conditional to support HykuUp Knapsack specs

* ๐Ÿ’„ rubocop fix

* ๐Ÿ’„ rubocop fix

* ๐Ÿงน Add core to hash in spec

Since we changed the SolrEndpoint, this spec was failing.  This change
should fix it.

* ๐Ÿงน Add storage/files as a persisted volumn

This commit will add storage/files as a persisted volume for rancher
set ups.  Hyrax uses this directory to store the binaries.

* update bulkrax, hyrax, iiif_print

* bump to rc3

---------

Co-authored-by: Kirk Wang <kirk.wang@scientist.com>
Co-authored-by: Jeremy Friesen <jeremy.n.friesen@gmail.com>
Co-authored-by: Kirk Wang <k3wang@gmail.com>
Co-authored-by: C Barton <43180845+CB987@users.noreply.github.com>
Co-authored-by: LaRita Robinson <larita@scientist.com>
Co-authored-by: Benjamin Kiah Stroud <32469930+bkiahstroud@users.noreply.github.com>
Co-authored-by: Rob Kaufman <rob@notch8.com>
Co-authored-by: LaRita Robinson <laritakr@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something isn't working Mobius Work related to mobius tenants
Projects
None yet
Development

No branches or pull requests

3 participants