infopark_fiona7 1.1.0.0.3 → 1.1.0.0.4

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: 38e1fa4de2f2c2a04c38458c85453f4ec0392a00
4
- data.tar.gz: 349f9e81560e27809f5c92f6b091a5648fa85e42
3
+ metadata.gz: 0e4faba12e3777d253526addb84018eccbd43d47
4
+ data.tar.gz: 3a977b389028604ec428e740d27817d8850c89fe
5
5
  SHA512:
6
- metadata.gz: e6830670ae4b149c9f8e205f4f1b2d82e89ca820a43dc47c56dd945fb609e1384da6b45d2247eaa7b7a70633df43117e1cbcddfaa04aade179ac7316d36f70b3
7
- data.tar.gz: 1d9fea097086ecfceb74caa058b41f784bf5ddee9cc740aad5d712b665581ad42d9609284d74c0f06aec8e682800dbf269426cad326af4843cb197e6524db106
6
+ metadata.gz: fa45a12ba6bf41a71a95297a5068b578e90350515e593cce94c374b855094634a5cc35029bb6cbb727db333e5b544ed2e9fd4017be19560ee74f3b85460ef169
7
+ data.tar.gz: 838319f5d92587be802dda0b0a73275e3dfce799a8ebfe55fcf1a1daadf65a6371f031ce05c0fd8d818ede2ae30ccb995fb6b76702a5dc29c94666368e627827
@@ -236,19 +236,6 @@
236
236
  open_release_dialog(obj.id()).done(function(objIds, comment) {
237
237
  scrivito.with_saving_overlay(scrivito.ajax('PUT', 'objs/release', {data: {objs: objIds, comment: comment}}).then(function() {
238
238
  scrivito.reload();
239
- }).fail(function(error) {
240
- scrivito.alert_dialog(scrivito.t('commands.'+action+'_obj.failed'));
241
- }));
242
- });
243
-
244
- return;
245
-
246
- /* TODO: implement permission check */
247
- open_confirmation_dialog(action, dialog_icons[action]).done(function(comment) {
248
- scrivito.with_saving_overlay(scrivito.ajax('PUT', 'objs/' + obj.id() + '/release?comment=' + (comment || "")).then(function() {
249
- scrivito.reload();
250
- }).fail(function(error) {
251
- scrivito.alert_dialog(scrivito.t('commands.'+action+'_obj.failed'));
252
239
  }));
253
240
  });
254
241
  }
@@ -11,12 +11,18 @@ module Fiona7
11
11
 
12
12
  carefully_release(errors, main_obj, comment)
13
13
  objs.each do |other_obj|
14
- carefully_release(errors, other_obj)
14
+ carefully_release(errors, other_obj, comment)
15
15
  end
16
16
  end
17
17
 
18
- ensure
19
- render json: {}
18
+ if errors.empty?
19
+ render json: {}
20
+ else
21
+ render json: {message: errors.join("\n"), message_for_editor: errors.join("\n")}, status: 412
22
+ end
23
+
24
+ rescue => e
25
+ render json: {message: e.message}, status: 500
20
26
  end
21
27
 
22
28
  def preview
@@ -41,12 +47,19 @@ module Fiona7
41
47
 
42
48
  def carefully_release(errors, obj, comment=nil)
43
49
  obj.take
44
- obj.release!(comment)
50
+ obj.release!(comment) if obj.really_edited?
45
51
 
46
52
  complex_object = Fiona7::ComplexObject.new(obj)
47
53
  complex_object.widgets.each do |widget_obj|
48
- widget_obj.take
49
- widget_obj.release!(comment)
54
+ begin
55
+ widget_obj.take
56
+ widget_obj.release!(comment) if widget_obj.really_edited?
57
+ rescue => e
58
+ Rails.logger.error("Error occured when releasing #{obj.id}: unable to release Object with ID #{widget_obj.id} (#{widget_obj.path} because: #{e.inspect}")
59
+ # TODO: translate
60
+ error = "Unable to release Object with ID #{widget_obj.id} because: #{e.message}"
61
+ errors << error
62
+ end
50
63
  end
51
64
  #complex_object.binaries.each do |widget_obj|
52
65
  # widget_obj.take
@@ -1,3 +1,3 @@
1
1
  module Fiona7
2
- VERSION = "1.1.0.0.3"
2
+ VERSION = "1.1.0.0.4"
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.1.0.0.3
4
+ version: 1.1.0.0.4
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-03-01 00:00:00.000000000 Z
11
+ date: 2016-03-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails