infopark_fiona7 1.5.2.1.0.pre.beta1 → 1.5.3.2.0.pre.beta1

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: d09cc0745bc37e2f791a58f3d0e1a8bc99ad16d6
4
- data.tar.gz: fc71738b1f4cccedd1bc60583a6821639299514e
3
+ metadata.gz: 3f8ceabc9a40f129ac8e7d02bf075eed4b08499a
4
+ data.tar.gz: cd6864e0a21e6eb51a39e9c083cd3d929c6dfc96
5
5
  SHA512:
6
- metadata.gz: 6dd5dd123b3a866da27aa07a9daa68a6847fe85b94f2257b543390986114359ec8b565ac72db292279382ce65f2ca3eabb1f8cd9c7fe8c03f9de844cc00ac304
7
- data.tar.gz: e407f9c445403f1fee0707fa10c28afbc2704e1ce80ff9dfb7ef317db95c3811e957c0bfd6f7e02f8cfb4aa52aedf90f165039bed0f90f7918d6eef148f66364
6
+ metadata.gz: 0e5d5782ceb31de8e1034673283426fd50f553cd778a7deefb580bd8726389ecb763a35a373cd14951cbfc5f5eb0669e2dd12ca387b296642e805cdb8f63d446
7
+ data.tar.gz: c5c6e74804cacf6f4d8172e4924f07e8490eb2897f2d7a08baf73c25864b62fefffc608b8cacc28f5c96ade72b6948d2e340166966557d8398f6fa9781e3426f
@@ -111,12 +111,12 @@
111
111
  'commands.release_obj.dialog.confirm': 'Freigeben',
112
112
  'commands.release_obj.failed': 'Freigabe fehlgeschlagen',
113
113
 
114
- 'commands.edit_obj.title': 'Seite bearbeiten',
115
- 'commands.edit_obj.dialog.title': 'Seite bearbeiten?',
114
+ 'commands.edit_obj.title': 'Workflow starten',
115
+ 'commands.edit_obj.dialog.title': 'Workflow starten?',
116
116
  'commands.edit_obj.dialog.description': 'Es wird eine neue Arbeitsversion erstellt.',
117
117
  'commands.edit_obj.dialog.placeholder': 'Bitte Kommentar eintragen',
118
- 'commands.edit_obj.dialog.confirm': 'Bearbeiten',
119
- 'commands.edit_obj.failed': 'Bearbeitung fehlgeschlagen',
118
+ 'commands.edit_obj.dialog.confirm': 'Starten',
119
+ 'commands.edit_obj.failed': 'Workflow fehlgeschlagen',
120
120
 
121
121
  'commands.forward_obj.title': 'Seite weiterleiten',
122
122
  'commands.forward_obj.dialog.title': 'Seite weiterleiten?',
@@ -166,12 +166,12 @@
166
166
  'commands.release_obj.dialog.confirm': 'Release',
167
167
  'commands.release_obj.failed': 'Release failed',
168
168
 
169
- 'commands.edit_obj.title': 'Edit page',
170
- 'commands.edit_obj.dialog.title': 'Edit this page?',
169
+ 'commands.edit_obj.title': 'Start a workflow',
170
+ 'commands.edit_obj.dialog.title': 'Start a workflow for this page?',
171
171
  'commands.edit_obj.dialog.description': 'A new version of this page will be created.',
172
172
  'commands.edit_obj.dialog.placeholder': 'Comment',
173
- 'commands.edit_obj.dialog.confirm': 'Edit',
174
- 'commands.edit_obj.failed': 'Edit failed',
173
+ 'commands.edit_obj.dialog.confirm': 'Start a workflow',
174
+ 'commands.edit_obj.failed': 'Workflow failed',
175
175
 
176
176
  'commands.forward_obj.title': 'Forward page',
177
177
  'commands.forward_obj.dialog.title': 'Forward this page?',
@@ -19,7 +19,7 @@ Gem::Specification.new do |s|
19
19
  end.sort
20
20
 
21
21
  s.add_dependency "rails", "~> 4.2.2"
22
- s.add_dependency "scrivito", "= 1.5.2"
22
+ s.add_dependency "scrivito", "= 1.5.3"
23
23
  s.add_dependency "scrivito_sdk"
24
24
  s.add_dependency "scrivito_editors"
25
25
  s.add_dependency "infopark_fiona_connector", "= 7.0.1.beta2"
@@ -10,7 +10,10 @@ module Fiona7
10
10
  end
11
11
 
12
12
  def attributes
13
+ # Select all known (i.e. registered) classes
13
14
  obj_classes = Fiona7::ObjClassesFromCms.new(@type_register).obj_classes
15
+ # Select classes with the given attribute
16
+ obj_classes = obj_classes.select {|obj_class| @type_register.read(obj_class).find_attribute(@attribute) }
14
17
  obj_classes.map {|obj_class| Fiona7::AttributeNameMangler.new(@attribute, obj_class).mangle }.uniq
15
18
  end
16
19
  end
@@ -34,7 +34,13 @@ module Fiona7
34
34
 
35
35
  ensure_obj_class_exists
36
36
 
37
- @obj.name = @name unless @name.blank?
37
+ # NOTE: name is an object attribute and not content attribute
38
+ # changing content attributes requires permissionWrite
39
+ # but changing the name attribute requires permissionRoot
40
+ #
41
+ # setting the name without changing the value counts
42
+ # as changing the name attribute for the CM
43
+ @obj.name = @name if !@name.blank? && @name != @obj.name
38
44
  # TODO: move (parent change)
39
45
  end
40
46
 
@@ -178,7 +178,13 @@ module Fiona7
178
178
  }.to_json)
179
179
  end
180
180
 
181
- response[:facets] = facets.map {|facet| FacetBuilder.new(facet.symbolize_keys, query, klass).build } unless facets.empty?
181
+ if !facets.empty?
182
+ if Fiona7.facetting_enabled?
183
+ response[:facets] = facets.map {|facet| FacetBuilder.new(facet.symbolize_keys, query, klass).build }
184
+ else
185
+ response[:facets] = []
186
+ end
187
+ end
182
188
 
183
189
  return ::JSON.parse(::ActiveSupport::JSON.encode(response))
184
190
  end
data/lib/fiona7/engine.rb CHANGED
@@ -126,14 +126,32 @@ module Fiona7
126
126
  end
127
127
 
128
128
  def self.workflows_enabled?
129
- true
129
+ !!self.read_config.features.workflows_enabled
130
130
  end
131
131
 
132
- class Config < Struct.new("Config", :mode, :instance, :host, :port, :username, :secret, :root_mode, :dont_yell_at_me_for_abusing_attributes)
132
+ def self.facetting_enabled?
133
+ !!self.read_config.features.facetting_enabled
134
+ end
135
+
136
+ class Config < Struct.new("Config", :mode, :instance, :host, :port, :username, :secret, :root_mode, :dont_yell_at_me_for_abusing_attributes, :features)
137
+ def initialize(*args)
138
+ super
139
+ self.features = Features.new unless self.features
140
+ end
141
+ end
142
+
143
+ class Features < Struct.new("Features", :workflows_enabled, :facetting_enabled)
144
+ def initialize(workflows_enabled=true, facetting_enabled=true)
145
+ super
146
+ end
133
147
  end
134
148
 
135
149
  mattr_accessor :config
136
150
 
151
+ def self.read_config
152
+ self.config || raise("Fiona7 gem not configured! Please create `config/initializers/fiona7.rb` and use Fiona7.configure")
153
+ end
154
+
137
155
  def self.configure(&block)
138
156
  self.config = Config.new.tap do |config|
139
157
  yield config
@@ -140,14 +140,17 @@ module Fiona7
140
140
  fields = [field.to_s]
141
141
  else
142
142
  fields = Fiona7::AttributeNamesFromQueries.new(field.to_s, @query).attributes || Fiona7::AttributeNamesFromCms.new(field.to_s).attributes || [field.to_s]
143
+ # NOTE: verity does not like more than 94 fields in its queries
144
+ # so to be safe we limit the number of fields to 80
145
+ fields = fields[0, 80]
143
146
  end
144
147
 
145
148
  sanitized_values = values.map {|v| "`#{self.class.sanitize(v)}`" }
146
- %|(<#OR> ((#{sanitized_values.join(', ')}) <#IN> (#{fields.join(', ')})))|
149
+ %|<#OR> ((#{sanitized_values.join(', ')}) <#IN> (#{fields.join(', ')}))|
147
150
  end
148
151
 
149
152
  def search_not_in(field, values)
150
- %|(<#NOT> (#{search_in(field, values)}))|
153
+ %|<#NOT> (#{search_in(field, values)})|
151
154
  end
152
155
 
153
156
  def search_term(field, operator, values, options={})
@@ -1,3 +1,3 @@
1
1
  module Fiona7
2
- VERSION = "1.5.2.1.0-beta1"
2
+ VERSION = "1.5.3.2.0-beta1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: infopark_fiona7
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.2.1.0.pre.beta1
4
+ version: 1.5.3.2.0.pre.beta1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tomasz Przedmojski
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-08 00:00:00.000000000 Z
11
+ date: 2016-11-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 1.5.2
33
+ version: 1.5.3
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 1.5.2
40
+ version: 1.5.3
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: scrivito_sdk
43
43
  requirement: !ruby/object:Gem::Requirement