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

Set visibility based on Date Created #708

Merged
merged 1 commit into from
Dec 28, 2017

Conversation

tpendragon
Copy link
Contributor

Closes #691.

This adds a new checkbox to automatically set visibility/rights statement based on what the date of the object is. The checkbox looks like this:

screen shot 2017-12-27 at 1 28 44 pm

return unless date
Time.zone.parse(date)
rescue
Rails.logger.debug("Unable to parse created date: #{change_set.resource.primary_imported_metadata.created}")
Copy link
Contributor

Choose a reason for hiding this comment

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

Is debug normally used for these types of errors, or would warn be needed? (I'm uncertain as to whether or not the logging level might affect this).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Switched it to warn.

@@ -623,4 +623,55 @@
expect(solr_record["member_of_ssim"]).to eq ["id-#{parent.id}"]
end
end

context "setting visibility from remote metadata" do
Copy link
Member

Choose a reason for hiding this comment

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

Add a test for the case where it's not checked?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added.


def calculated_rights_statement
if public_access?
"http://rightsstatements.org/vocab/NKC/1.0/"
Copy link
Member

Choose a reason for hiding this comment

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

We're using this as a default somewhere else, too. At what point to we consider loading these into constants? Perhaps a new ticket.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Created #709

@jrgriffiniii jrgriffiniii merged commit a5f8b02 into master Dec 28, 2017
@jrgriffiniii jrgriffiniii deleted the set_visibility_automatically branch December 28, 2017 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants