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

Added option to expand or collapse details on metadata view #66

Open
wants to merge 2 commits into
base: 7.x
Choose a base branch
from

Conversation

jyobb
Copy link

@jyobb jyobb commented Dec 18, 2017

JIRA Ticket: https://jira.duraspace.org/browse/ISLANDORA-1252

What does this Pull Request do?

Added a configuration option that allows users to select the default collapse state of the details metadata

What's new?

Added a drupal variable to the config form. Set this value as a template variable. Check the variable in the template at display time.

How should this be tested?

Enable and disable details view collapse and check that the behaviour was as expected.

Additional Notes:

Hope I did this correctly

May want to change documentation to reflect this new option.

Interested parties

@Islandora/7-x-1-x-committers

Copy link
Contributor

@DiegoPino DiegoPino left a comment

Choose a reason for hiding this comment

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

Hi @jyobb. You have a few Drupal Coding standard issues, see here https://travis-ci.org/Islandora/islandora_solr_metadata/jobs/318325673#L704-L713 Mostly spacing/identation

@bencomp
Copy link
Contributor

bencomp commented May 26, 2018

I haven't tested this, but if I understand the code correctly, changing the machine name of the metadata will leave the variable that contains the 'expand/collapse' state unchanged. I don't supposed many people will change the machine name of their metadata profiles often, but if you edit them this will leave unmanaged variables in the database.

EDIT: I just realised you cannot change the machine name of a configuration. So this wouldn't cause problems.

@rosiel
Copy link
Member

rosiel commented Jul 12, 2018

This seems like a worthy addition to me. @jyobb if you can look at the remaining coding standards errors,

sites/all/modules/islandora_solr_metadata/includes/config.inc:
+225: [minor] No space before comment text; expected "// Add in truncation fields for description." but found "//Add in truncation fields for description."

sites/all/modules/islandora_solr_metadata/theme/theme.inc:
+68: [minor] Inline comments must end in full-stops, exclamation marks, or question marks
+68: [minor] Line exceeds 80 characters; contains 89 characters
+69: [minor] Whitespace found at end of line

and a naming consideration: Since the variable is titled "Display fields expanded" and 1 (checked) results in the details expanded, could you rename:

  • islandora_solr_metadata_collapse_{config_id} to islandora_solr_metadata_expand_{config_id}
  • $collapse to $expand_metadata in
  • $collapse_default to $expand_default in theme.inc
  • $variables['not_collapsed'] to $variables['expanded']

And add 'collapsible' even when not collapsed by default?

Also, all variables added by this module need to be removed in the install file's uninstall hook, and/or deleted when the configuration was deleted. (Alternately, another way to save this variable could be in the database table islandora_solr_metadata_associations, though that would require a schema update, it would probably be the technically better way to do this)

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.

4 participants