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

Hide 'View Published' for published records in unpublished repositories #2727

Merged
merged 1 commit into from Jul 18, 2022
Merged

Hide 'View Published' for published records in unpublished repositories #2727

merged 1 commit into from Jul 18, 2022

Conversation

andrew-morrison
Copy link
Contributor

Description

Currently, the 'View Published' toolbar button in the staff interface is hidden for unpublished records. However, it is still visible for records (resources, archival objects, digital objects, accessions) which belong to a repository which isn't published. Clicking the button in such cases returns a 404 page, as it should, but the presence of the button could make people incorrectly think they are published. It is a minor issue, but can cause confusion, if using an unpublished repository as a staging area.

This change fixes that, by adding a new condition that must be met for the button to be displayed:

if current_repo.publish || !record.repository

The second clause is needed to allow global records (e.g. agents) that don't belong to the repository the staff user has currently activated to be previewed.

Related JIRA Ticket or GitHub Issue

None

How Has This Been Tested?

On development system (and in a local plug-in on a production system.)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have read the CONTRIBUTING document.
  • I have authority to submit this code.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@mark-cooper mark-cooper self-assigned this Jun 29, 2022
@mark-cooper mark-cooper merged commit caba8e7 into archivesspace:master Jul 18, 2022
@cdibella cdibella added the community code contributed by community members not on or contracted by the ArchivesSpace program team label Aug 10, 2022
@cdibella cdibella added this to the 3.3.0 milestone Aug 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community code contributed by community members not on or contracted by the ArchivesSpace program team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants