NEU-DSG / tapas_rails

Hydra Head for the TAPAS project
1 stars 6 forks source link

Ruby/Rails package updates; code maintenance and remove dependency of legacy cerberus_core package #56

Closed lukehollis closed 1 year ago

lukehollis commented 4 years ago
amclark42 commented 4 years ago

Hello, @lukehollis! I'm trying to get the new code running on my laptop for testing, but I'm having no luck. (Admittedly, I am a Rails novice.) Could you add some documentation on installation, perhaps to the README?

Are there any configuration changes or new system assumptions for the production and staging environments?

lukehollis commented 4 years ago

Hi all, this PR includes the following now as well:

amclark42 commented 2 years ago

2ec1c81 was already reviewed

59e6957 upgrades Ruby and a lot of gems. There are a lot of changes; presumably these were in

amclark42 commented 2 years ago

065cd2f : The removal of bootsy makes sense, as it’s no longer maintained. However, it was a WYSIWYG associated with News Items and Pages, replacing similar features in Drupal. TAPAS users don’t have currently access to this functionality; it seems safe to just use text fields that can accept HTML.

amclark42 commented 2 years ago

59190ce : Comments out search_params_logic in collections_controller (and communities, core_files, users). This means that a Solr instance would have no knowledge of Core Files’ permissions, nor trickle-down permissions from Communities and Collections to Core Files. Permissions handling will likely need to be added back with search indexes.

amclark42 commented 2 years ago

75a6f46 : TODO item and commented-out code that may be important down the line? We may have to revisit this.

app/controllers/core_files_controller.rb, line 13 – 14:

# TODO investigate this after ruby version upgrades complete
# skip_before_action :load_asset, :load_datastream, :authorize_download!
amclark42 commented 2 years ago

f05ec11 : Uncomments code that makes view packages info into the TAPAS home page. We already knew we’d have to change that, but this is where it happened.

In users_controller, there’s a comment about a Rails deprecated helper, but the new return value is just the root path instead of a revised bit of code.

amclark42 commented 2 years ago

69d06558 : Fairly straightforward, but we should make sure that the character sets match TAPAS users’ needs. Ideally an international encoding standard like UTF-8 should be used for any table with fields that users can edit.

amclark42 commented 2 years ago

fa1db84 looks straightforward. We’re not sure why the five_* methods exist. :community_members -> memberships?

aa8a4cd is good.

90e2de4: What are :community_communities and :collection_collections, and parent communities/collections? What are the indexes supporting?

amclark42 commented 2 years ago

19600da Puzzling over:

Return the collection where we store TEI files that reference non-existant collections. If it doesn't exist create it.

Collection records created in Rails because Drupal didn’t explicitly tell Rails to create them...?

2cfb33c:

26223ad removes Fedora and Solr queries.

amclark42 commented 2 years ago

d4779e1 Why use bigint rather than integer in column datatypes?

7ebc714 Introduces CanCan(Can?) gem for authorization.

7d9bab7 looks good. When do users get thumbnails?

5f9b9cf Institutions don’t need to be models, they’re simple strings, metadata. Nothing is done with an Institution-as-entity. Institutions may have been added to confer TEI membership. Since TAPAS will be free to all users, we definitely don’t need this.

amclark42 commented 2 years ago

4e7987d is good.

743e5aa seems to be mostly a condensed version of previous commits:

9e11682 is good.

0dd29be:

amclark42 commented 2 years ago

0440da0 looks good

d88a5c3: The database schema adds a limit on the number of characters allowed in the CSS and JS text fields for view packages. Worth keeping an eye on, since TAPAS users don't control view packages; we do.

fbdbe58 Seems to introduce a regression in the database schema — things that were changed in the last commit get changed back. In the Community spec, the test for "as_json" is commented out. We're wondering if that method was intended to pass data to Drupal, in which case maybe we don't need it at all. The User spec has a test that doesn't do anything, and a typo. We're assuming that gets fixed later.

amclark42 commented 2 years ago

d2c9f6b looks good

ae2c899 looks good

8c87f9d is overall good. I’m a little concerned about taking logic out of the HTML templates for search results. The empty <div>s are there, possibly so that a JS asynchronous call can populate it. But Rails has the data and can start populating the page; JS can take over and make the page of results responsive. Rails is built for filling in templates and making websites; why not make use of its capabilities?

amclark42 commented 2 years ago

2aee5dc The mix of HAML and ERB is irritating. It’s hard to switch from reading one to the other. Otherwise good.

e65e15c looks good.

a004414 has joins and wheres in the collection controller. In the collection model, it looks like the collection is the owner of many thumbnails?

amclark42 commented 2 years ago

a004414 What did mass_permissions accomplish in the older code? It was replaced with is_public, but we don’t know what the old system was.

Also, we’ll need to revisit the data_form template. A community/project setting of “private” should cascade down to collections. A collection in private community should have its visibility set to private, and the form’s checkbox should be disabled, with an explanatory note on why the collection cannot be made public.

7ac98fe looks good; see last paragraph on future revisions to the form

amclark42 commented 2 years ago

38fbe8a:

amclark42 commented 2 years ago

7fb651c The code that confused Charles was actually added by Archimedes. It seems to be resolved in later commits, though! Collections will belong to only one community.

a5eed45 looks good.

4f1abf9 Users become owners of Core Files, a relationship that likely became necessary because Drupal had taken on that logic.

amclark42 commented 2 years ago

0b8f200 looks good.

78713de

7da7bac The index method in the users controller has code that needs to be moved elsewhere for security. This commit is preparing to make Users as authors and contributors to a file, but those fields are just supposed to be text fields.

9d3c693 This is where core files' authors and contributors become user entities instead of strings.

amclark42 commented 2 years ago

b79bd06 removes code duplicated from the Core File upsert method. We may still want to kick off a MODS generation process on TEI upload.

8baa16b looks good

5c261a4 looks good

3afc726 is a start at documentation.

8229892 removes some of the logic originally in the Core File model method project. May have to beef that up.

amclark42 commented 2 years ago

296c9ff

ce82bbe looks good.

amclark42 commented 2 years ago

8a5cdca adds and streamlines the destroy methods in the community and collection controllers. When a community is deleted, its collections and core files should be deleted. Not sure this is represented implicitly, it doesn't seem to be represented explicitly in most current code. For collections, their core files should only be deleted if they have no other associations with still-existing collections. Tests would help here! We should dig more into this.

d4ad8bf is good

06b2223:

amclark42 commented 2 years ago

38b4861 adds default_scope to the community model, which is apparently awful practice. But the most recent code removes it, so, good! The to_json thing from the last commit was removed.

e299e3b Make sure we're modifying redirect_to ... and return, the return bit is unneccessary. The Core File "thumbnails" are likely associated image files; rename?

ac7eb98:

amclark42 commented 1 year ago

Comments re: #82:

amclark42 commented 1 year ago

Back to #82:

Left off with the core file data form.

amclark42 commented 1 year ago

Continuing with #82:

amclark42 commented 1 year ago

Last part of #82!

A couple weird things about the users index view:

amclark42 commented 1 year ago

Starting #83

amclark42 commented 1 year ago

Continuing #83 :

amclark42 commented 1 year ago

In commit 26db5c1, Solr configuration and gems are removed, as other gems for faceted search are added. Because we wanted to keep Solr (and eXist, and the view package system), we are going to stop merging Archimedes' commits after c1b8b02.

Skimming the rest of the commits in the PR, here's what we're choosing to skip out on:

amclark42 commented 1 year ago

Reviewing c1b8b02, we decided we don't actually want to merge it in either. It makes the Core File controller inherit from the Application controller instead of the Catalog controller, but if we're keeping Solr and Blacklight (and we are!) then we are just fine with keeping the original inheritance.

FINIS.