Closed lukehollis closed 1 year 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?
Hi all, this PR includes the following now as well:
2ec1c81 was already reviewed
59e6957 upgrades Ruby and a lot of gems. There are a lot of changes; presumably these were in
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.
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.
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!
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.
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.
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?
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.
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.
4e7987d is good.
743e5aa seems to be mostly a condensed version of previous commits:
models/concerns/did.rb
removes attributes for the Drupal identifier and MODS metadata. latin1
character set, or utf8mb4
. We’ll need UTF-8 at least for internationalization.
9e11682 is good.
0dd29be:
have_many
other communities.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.
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?
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 join
s and where
s in the collection controller. In the collection model, it looks like the collection is the owner
of many thumbnails?
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
38fbe8a:
depositor
of a collection is a user. Does the depositor have special permissions? What happens if the associated user is deleted?
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.
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.
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.
296c9ff
as: owner
has been taken out.collection.collections
-> collection.core_files
, yay!ce82bbe looks good.
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
:
create_members
method on the community model should explicitly determine the user's role. We can define the undefined behavior. Tests are needed here.to_json
in the template for showing communities. It might be to aid the readability of pm[:roles][0]
?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
:
admin_at
column on the user model? It could be a boolean value instead of a datetime one. What does the latter buy us?Comments re: #82:
add_institution
in the communities controller.) We don't need users to provide anything like that information, so we should remove institutions as an entity or put in a test that adds institutional data if provided.add_members
should allow empty fields for project members and editors. Later: It looks like those fields are optional, but the add_members
method still needs some cleanup.
add_members
.discard
, or a soft delete, for getting rid of a community. This is more like archiving the community rather than deleting the entity. We should work through what should happen when someone wants to delete a community.accessible_by(current_ability)
instead of a SQL query.new
was some kind of hack or test code, so fair enough. The user still needs to be able to designate 'ographies when creating and editing the core file..kept
in files.collections.kept.first
because of soft-deleted collections. Will need to revisit this logic.Back to #82:
five_*
methods to something like preview_*
project_members
has been rewritten to get only the users with member type of "member", rather than all users associated with the community. We are now missing a method to see all users associated with a community, regardless of role.user_type
refers to users' relationship to core files, and member_type
is the relationship with projects/collections?UsersCoreFile
has been renamed to CoreFilesUser
ROLES
constant (e.g. for site admin) has been deleted
forem_name
is. Edit: This is a gem that was previously commented out.app/views/communities/_data_form.html.haml
, the name
is removed from the label and field for thumbnail. This seems like it would remove attributes linking the two, making the form inaccessible for screen readers. We need to add name: "thumbnail"
back in both places.Left off with the core file data form.
Continuing with #82:
config/routes.rb
adds destroy
to usersLast part of #82!
A couple weird things about the users index view:
Starting #83
devise_invitable
gem is added.apps/views/catalog/_search_results.html.erb
expands the page a good deal, but adds an "Actions"—if the user can manage the resource, they have the option of editing or deleting the item. We think it's strange to put that in search results.Continuing #83 :
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:
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.