projecthydra/sufia — pull request #789 by val99erie (2014-12-13 14:39:26+00:00)
Title: Pulled in code from curate to manage add/remove fields on edit forms.  A...

I wasn't able to finish this story by the end of the sprint, so @cam156 asked me to open a pull request so that another developer can pick up the rest of the story.

As far as I know, there are 4 main things left to do:

.1. Fix disabled auto-complete

I replaced the javascript for creating the add/remove buttons next to each field in the edit form with the javascript that I took from curate.

The old javascript: app/assets/javascripts/sufia/multiForm.js
The new javascript: app/assets/javascripts/sufia/manage_repeating_fields.js

Sufia had some auto-completion behavior attached to those old fields, so I had to disable the auto-complete functionality while I was working on the views. I left a TODO message in the file where it is disabled to make sure to go back and fix it:
app/assets/javascripts/sufia/edit_metadata.js

Once the autocomplete is fixed, you can probably delete app/assets/javascripts/sufia/multiForm.js entirely.

.2. Style changes

When you are editing a file, there are 3 tabs. I have already updated the javascript, views, and styles for the "Descriptions" tab, but I haven't had time to work on the "Permissions" tab yet. It looks like the "Permissions" tab has its own javascript. That javascript seems to be working just fine, so maybe it's best not to mess with it, but you might want to update the styles of the adder buttons so that they look like the buttons on the "Descriptions" tab.

.3. Upgrade version of hydra-editor in gemspec

I ran ScholarSphere with sufia pointing to this branch. Then I tried to edit a file in ScholarSphere, but I got an error about calling a method with the wrong number of arguments.

The error is caused by the partial_exists? method in hydra-editor
(app/helpers/concerns/records_helper_behavior.rb)

That method has 1 argument on master of hydra-editor, but it has 2 arguments in hydra-editor 0.4.0.

So, sufia's gemspec needs to be pegged to a higher version of hydra-editor, or else that method needs to be overridden in sufia.

.4. Add something to the release notes

People who upgrade sufia might experience breaking changes, especially if they have overridden the views.