hydra-editor 3.1.2 → 3.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9f1b6a2a99f4752530dfad51a2525150a783e2fb
4
- data.tar.gz: 49683e80758bd54fea7d815c0689faafcda8f35a
3
+ metadata.gz: 4aa69941a7e31ef9744093bfd27511b7cae32770
4
+ data.tar.gz: 5ec7cc51c46426adeb05be9bee851d41f592c453
5
5
  SHA512:
6
- metadata.gz: 148ccc71482d2134fe79b06ddb5df0b101d3f97c6c6885912b6d39f4cd310a3e39e2a758b8bfc5d651c028a2b0319af69ac640f3ac2da2572ccc56eaa888c7a3
7
- data.tar.gz: 9d5ada72411266500fac5b753a8f9759c93b20b6acbc56065d5fb488192019ac8abf2eb4258e1ea62502f181990e065cab6b0a026e0d5e0e5a4a9bad9fa52acb
6
+ metadata.gz: baba03f40ad042eb73ed87e5b8d0a2e813df19fa7737dc8821d165caf0ab44a90624c4b7155001ac04478ea6a74809aa9ef703426ffbab9f957404552cd8600a
7
+ data.tar.gz: e9c030943c4e947df8af4a9761a94958ad85caafdb3309bf76d083dcb7f05f95b337be56cdc3e2878dbb188d754045070ec8ed30f6dfcbcc898367f3190b4379
@@ -122,7 +122,7 @@ export class FieldManager {
122
122
 
123
123
  getFieldLabel($element, options) {
124
124
  var label = '';
125
- var $label = $element.find("label");
125
+ var $label = $element.find("label").first();
126
126
 
127
127
  if ($label.size && options.labelControls) {
128
128
  var label = $label.data('label') || $.trim($label.contents().filter(function() { return this.nodeType === 3; }).text());
@@ -46,7 +46,7 @@ module HydraEditor
46
46
  end
47
47
 
48
48
  def multiple?(field)
49
- HydraEditor::FieldMetadataService.multiple?(model_class, field)
49
+ field_metadata_service.multiple?(model_class, field)
50
50
  end
51
51
 
52
52
  # Return a hash of all the parameters from the form as a hash.
@@ -32,6 +32,13 @@ module Hydra
32
32
  include ActiveModelPresenter
33
33
  included do
34
34
  class_attribute :_terms, instance_accessor: false
35
+
36
+ # You may want to set your own field_metadata_service that can
37
+ # answer the questions about a fields cardinality regardless of the
38
+ # cardinality of the model
39
+ class_attribute :field_metadata_service
40
+ # This default service just give us the cardiality defined in the model.
41
+ self.field_metadata_service = HydraEditor::FieldMetadataService
35
42
  end
36
43
 
37
44
  def terms
@@ -42,14 +49,14 @@ module Hydra
42
49
  # If the field is a property, delegate to the property.
43
50
  # Otherwise return false
44
51
  def multiple?(field)
45
- HydraEditor::FieldMetadataService.multiple?(model.class, field)
52
+ field_metadata_service.multiple?(model.class, field)
46
53
  end
47
54
 
48
55
  module ClassMethods
49
56
  # @deprecated Because if we use an instance method, there will be no need to set self.model_class in most instances. Note, there is a class method multiple? on the form.
50
57
  def multiple?(field)
51
58
  Deprecation.warn(ClassMethods, 'The class method multiple? has been deprecated. Use the instance method instead. This will be removed in version 2.0')
52
- HydraEditor::FieldMetadataService.multiple?(model_class, field)
59
+ field_metadata_service.multiple?(model_class, field)
53
60
  end
54
61
 
55
62
  def unique?(field)
@@ -1,3 +1,3 @@
1
1
  module HydraEditor
2
- VERSION = '3.1.2'.freeze
2
+ VERSION = '3.2.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hydra-editor
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.2
4
+ version: 3.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Coyne
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-09-21 00:00:00.000000000 Z
12
+ date: 2017-04-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -93,14 +93,14 @@ dependencies:
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: 0.0.3
96
+ version: '0.1'
97
97
  type: :runtime
98
98
  prerelease: false
99
99
  version_requirements: !ruby/object:Gem::Requirement
100
100
  requirements:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: 0.0.3
103
+ version: '0.1'
104
104
  - !ruby/object:Gem::Dependency
105
105
  name: sqlite3
106
106
  requirement: !ruby/object:Gem::Requirement
@@ -299,7 +299,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
299
299
  version: '0'
300
300
  requirements: []
301
301
  rubyforge_project:
302
- rubygems_version: 2.6.4
302
+ rubygems_version: 2.6.10
303
303
  signing_key:
304
304
  specification_version: 4
305
305
  summary: A basic metadata editor for hydra-head