diff --git a/app/helpers/registration_helper.rb b/app/helpers/registration_helper.rb index 54faa9b0a..2b84b51e9 100644 --- a/app/helpers/registration_helper.rb +++ b/app/helpers/registration_helper.rb @@ -24,13 +24,6 @@ def apo_list(permission_keys) end end - def valid_object_types - [ - %w[Item item], - ['Workflow Definition', 'workflow'] - ] - end - def valid_content_types [ 'Book (ltr)', diff --git a/app/javascript/registration/register.js b/app/javascript/registration/register.js index ad0455c2b..0124ae70d 100644 --- a/app/javascript/registration/register.js +++ b/app/javascript/registration/register.js @@ -4,7 +4,6 @@ import pathTo from './pathTo' export default function DorRegistration(initOpts) { var $t = { defaultValues: { - objectType: 'item', projectName: '', apoId: 'druid:hv992ry2431', // TODO: uber APO druid must be pulled from config, not hardcoded workflowId: null, @@ -32,7 +31,6 @@ export default function DorRegistration(initOpts) { register : function(rowid, progressFunction) { var apo = $t.apoId; - var sourcePrefix = $t.metadataSource; progressFunction = progressFunction || function() {} // Grab list of tags from textarea, split, and reject blanks @@ -46,11 +44,9 @@ export default function DorRegistration(initOpts) { data.id = rowid var params = { - 'object_type' : $t.objectType, 'admin_policy' : apo, 'project' : $t.projectName, 'workflow_id' : $('#workflow_id').val(), - 'metadata_source' : ($t.metadataSource !== 'label') ? null : $t.metadataSource, 'label' : data.label || ':auto', 'tag' : tags, 'rights' : $('#rights').val(), @@ -61,7 +57,7 @@ export default function DorRegistration(initOpts) { params.source_id = data.source_id; } - params.other_id = sourcePrefix + ':' + data.metadata_id; + params.other_id = $t.metadataSource + ':' + data.metadata_id; if (data.druid) { params.pid = 'druid:' + data.druid; @@ -131,8 +127,7 @@ export default function DorRegistration(initOpts) { return false; } } - var sourcePrefix = $t.metadataSource; - if (sourcePrefix === 'symphony') { + if ($t.metadataSource === 'symphony') { if ($.grep(mdIds,function(id) { return id.trim() === '' }).length > 0) { $t.displayRequirements('Metadata source was detected as "symphony", which requires metadata IDs for all items.'); return false @@ -158,7 +153,6 @@ export default function DorRegistration(initOpts) { registerAll : function() { var apo = $t.apoId; - var sourcePrefix = $t.metadataSource; if (this.validate()) { var ids = $t.getDataIds(); $t.progress(true); diff --git a/app/views/items/register.html.erb b/app/views/items/register.html.erb index e97f3f293..68d97334c 100644 --- a/app/views/items/register.html.erb +++ b/app/views/items/register.html.erb @@ -6,33 +6,33 @@ var dor_path = "<%= fedora_base %>"; <% end %> +
diff --git a/spec/controllers/dor/objects_controller_spec.rb b/spec/controllers/dor/objects_controller_spec.rb index df3eea209..944521211 100644 --- a/spec/controllers/dor/objects_controller_spec.rb +++ b/spec/controllers/dor/objects_controller_spec.rb @@ -24,11 +24,9 @@ context 'when source_id is not provided' do let(:submitted) do { - object_type: 'item', admin_policy: 'druid:hv992ry2431', collection: 'druid:hv992ry7777', workflow_id: 'registrationWF', - metadata_source: 'label', label: 'test parameters for registration', tag: ['Process : Content Type : Book (ltr)', 'Registered By : jcoyne85'], @@ -48,11 +46,9 @@ context 'when register is successful with default rights' do let(:submitted) do { - object_type: 'item', admin_policy: 'druid:hv992ry2431', collection: 'druid:hv992ry7777', workflow_id: 'registrationWF', - metadata_source: 'label', label: 'test parameters for registration', tag: ['Process : Content Type : Document', 'Registered By : jcoyne85'], @@ -95,11 +91,9 @@ context 'when register is successful with explicit rights' do let(:submitted) do { - object_type: 'item', admin_policy: 'druid:hv992ry2431', collection: 'druid:hv992ry7777', workflow_id: 'registrationWF', - metadata_source: 'label', label: 'test parameters for registration', tag: ['Process : Content Type : Image', 'Registered By : jcoyne85'], @@ -144,11 +138,9 @@ context 'when register is successful with location access' do let(:submitted) do { - object_type: 'item', admin_policy: 'druid:hv992ry2431', collection: 'druid:hv992ry7777', workflow_id: 'registrationWF', - metadata_source: 'label', label: 'test parameters for registration', tag: ['Process : Content Type : Book (ltr)', 'Registered By : jcoyne85'], @@ -193,11 +185,9 @@ context 'when register is successful with no-download' do let(:submitted) do { - object_type: 'item', admin_policy: 'druid:hv992ry2431', collection: 'druid:hv992ry7777', workflow_id: 'registrationWF', - metadata_source: 'label', label: 'test parameters for registration', tag: ['Process : Content Type : Image', 'Registered By : jcoyne85'], @@ -242,11 +232,9 @@ context 'when register is successful with dark' do let(:submitted) do { - object_type: 'item', admin_policy: 'druid:hv992ry2431', collection: 'druid:hv992ry7777', workflow_id: 'registrationWF', - metadata_source: 'label', label: 'test parameters for registration', tag: ['Process : Content Type : Image', 'Registered By : jcoyne85'], diff --git a/spec/features/item_registration_spec.rb b/spec/features/item_registration_spec.rb index af0903b50..5b8e8cdb5 100644 --- a/spec/features/item_registration_spec.rb +++ b/spec/features/item_registration_spec.rb @@ -63,10 +63,8 @@ # to check the params below. expect(page).to have_css('span.glyphicon-exclamation-sign', visible: true) expect(registration_params).to include( - 'object_type' => 'item', 'admin_policy' => 'druid:hv992ry2431', 'workflow_id' => 'goobiWF', - 'metadata_source' => 'label', 'label' => 'object title', 'tag' => ['Process : Content Type : Book (ltr)', 'tag : test', "Registered By : #{user.sunetid}"], 'rights' => 'default',