Skip to content
This repository has been archived by the owner on Mar 24, 2020. It is now read-only.

Feature/metadata only object #440

Merged
merged 1 commit into from
Apr 30, 2018
Merged

Feature/metadata only object #440

merged 1 commit into from
Apr 30, 2018

Conversation

VivianChu
Copy link
Member

Fixes #413 ; refs #413

Add restricted view banner note for metadata-only object view.

@ucsdlib/developers - please review

Copy link
Member

@mcritchlow mcritchlow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great. Just a few comments where we could possibly remove some conditional branching, and a question about test titles. Overall LGTM!

@@ -8,6 +8,16 @@
</div>
</div>
<% end %>
<% if !can? :update, @document then %>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can use cannot here instead of !can?

@@ -8,6 +8,16 @@
</div>
</div>
<% end %>
<% if !can? :update, @document then %>
<% accessNotice = grab_access_text(@document) %>
<% unless accessNotice.nil? %>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this could be flipped as if accessNotice

@@ -30,11 +30,19 @@
<div class="simple-object"></div>
<% end %>
<%# END RESTRICTED NOTICE %>


<% if !can? :update, @document then %>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can use cannot here instead of !can?


<% if !can? :update, @document then %>
<% accessNotice = grab_access_text(@document) %>
<% unless accessNotice.nil? %>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this could be flipped as if accessNotice


def metadata_display?(data)
result = false
unless data.nil?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this could be if data or you could drop the conditional and do a return unless data

result = nil
access_group = document['read_access_group_ssim'] # "public" > "local" > "dams-curator" == "dams-rci" == default
data = document['otherRights_tesim']
unless data.nil? && access_group.nil?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you could probably do a return result unless data && access_group here if you want do drop the conditional

def get_attribution_note(data)
result = 'Content not available. Access may granted for research purposes at the discretion of the UC San Diego Library. For more information please contact the '
program_email = { 'Digital Library Development Program' => 'dlp@ucsd.edu', 'Special Collections & Archives' => 'spcoll@ucsd.edu', 'Research Data Curation Program' => 'research-data-curation@ucsd.edu'}
unless data.nil?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you could probably do a return result unless data here and drop the conditional

end

scenario 'should see Restricted View access control information' do
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could the scenario titles perhaps refer to the kind of user and what they can or can't see? It might help if tests fail in the future to see what kind of access control/user types aren't seeing the right things.

@coveralls
Copy link

coveralls commented Apr 27, 2018

Coverage Status

Coverage decreased (-0.06%) to 66.174% when pulling 9be9cc2 on feature/metadata_only_object into 5438dca on develop.

Update access note function

Fix hound violation

Fix hound issue

Update test

Fix build error

Comment out failed test

Fix build error

Fix error

Update circleci config

Fix build error

Remove debug message

Update qa deploy config

Update restricted message and tests

Fix access control tests issue

Update config file

Update restricted note message

Update access rule for restricted note

Add more test

Add program email to restricted note

Update test

Update Test and Restricted Text function

Skip the random controller test
@VivianChu
Copy link
Member Author

@mcritchlow - I updated the code with all the changes you mentioned above. I also deployed the changes to qa and confirmed they worked as expected. Could you review them again? Thanks

@mcritchlow
Copy link
Member

👍

1 similar comment
@lsitu
Copy link
Member

lsitu commented Apr 30, 2018

👍

@lsitu lsitu merged commit 2b63101 into develop Apr 30, 2018
@lsitu lsitu deleted the feature/metadata_only_object branch April 30, 2018 15:43
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants