infopark_fiona7 1.1.0.0.1 → 1.1.0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/assets/javascripts/scrivito_patches/models/ajax.js +17 -28
- data/app/controllers/fiona7/release_controller.rb +1 -0
- data/lib/fiona7/engine.rb +1 -0
- data/lib/fiona7/scrivito_patches/basic_obj.rb +16 -0
- data/lib/fiona7/scrivito_patches/cms_routing.rb +6 -2
- data/lib/fiona7/scrivito_patches/obj_params_parser.rb +20 -0
- data/lib/fiona7/version.rb +1 -1
- metadata +3 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 2aa4f95c72dbb1df2df30eb2aecf812eeadfbe0e
         | 
| 4 | 
            +
              data.tar.gz: b2b9ba8c7221323adb1aaa6b9cf2dcf4001e8959
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: aca73230bef220c3bf97df405f9e6d83c4df11860856ac91db5dde5a40dfe4fd269e15253339e8fd68232b06ccb63e66681497c9392d88a05fb15caf5e23e128
         | 
| 7 | 
            +
              data.tar.gz: 566f30c2e5dd1a29086b8e36639c9045b7e8886e6b996ef9661f980fcc18c4d1f1725661a4523e5f57bea637474174f86d0a6fbef3f2ff32413f4890e4a175a7
         | 
| @@ -32,23 +32,12 @@ | |
| 32 32 | 
             
                }, options || {})).then(
         | 
| 33 33 | 
             
                  function(result, text_status, xhr) {
         | 
| 34 34 | 
             
                    return $.Deferred().resolve(result);
         | 
| 35 | 
            -
                  }, function(xhr, text_status,  | 
| 36 | 
            -
                    var error_message;
         | 
| 37 | 
            -
                    var error_code;
         | 
| 35 | 
            +
                  }, function(xhr, text_status, xhr_error) {
         | 
| 38 36 | 
             
                    try {
         | 
| 39 | 
            -
                       | 
| 40 | 
            -
             | 
| 41 | 
            -
                       | 
| 42 | 
            -
                    } catch (SyntaxError) {}
         | 
| 43 | 
            -
             | 
| 44 | 
            -
                    if (!error_message) {
         | 
| 45 | 
            -
                      error_message = error;
         | 
| 37 | 
            +
                      return $.Deferred().reject(JSON.parse(xhr.responseText));
         | 
| 38 | 
            +
                    } catch (SyntaxError) {
         | 
| 39 | 
            +
                      return $.Deferred().reject(xhr_error);
         | 
| 46 40 | 
             
                    }
         | 
| 47 | 
            -
                    return $.Deferred().reject({
         | 
| 48 | 
            -
                      status: xhr.status,
         | 
| 49 | 
            -
                      message: error_message,
         | 
| 50 | 
            -
                      code: error_code
         | 
| 51 | 
            -
                    });
         | 
| 52 41 | 
             
                  }
         | 
| 53 42 | 
             
                );
         | 
| 54 43 | 
             
              };
         | 
| @@ -59,7 +48,7 @@ | |
| 59 48 | 
             
                  if (is_write_request) {
         | 
| 60 49 | 
             
                    options = options || {};
         | 
| 61 50 | 
             
                    // HIGHER TIMEOUT HERE!
         | 
| 62 | 
            -
                    options.timeout =  | 
| 51 | 
            +
                    options.timeout = 60000; // miliseconds
         | 
| 63 52 | 
             
                    scrivito.write_monitor.start_write();
         | 
| 64 53 | 
             
                  }
         | 
| 65 54 |  | 
| @@ -87,23 +76,23 @@ | |
| 87 76 | 
             
                },
         | 
| 88 77 |  | 
| 89 78 | 
             
                display_ajax_error: function(error) {
         | 
| 90 | 
            -
                  var  | 
| 91 | 
            -
             | 
| 92 | 
            -
                  if (_. | 
| 93 | 
            -
                     | 
| 94 | 
            -
             | 
| 95 | 
            -
             | 
| 96 | 
            -
             | 
| 97 | 
            -
                    error_message = scrivito.t('ajax.error', ajax_error);
         | 
| 79 | 
            +
                  var message, message_for_editor;
         | 
| 80 | 
            +
             | 
| 81 | 
            +
                  if (_.isObject(error)) {
         | 
| 82 | 
            +
                    message = scrivito.t('ajax.error', error.message);
         | 
| 83 | 
            +
                    message_for_editor = error.message_for_editor;
         | 
| 84 | 
            +
                  } else if (_.contains(['abort', 'parsererror', 'timeout'], error)) {
         | 
| 85 | 
            +
                    message = scrivito.t('ajax.error.communication');
         | 
| 98 86 | 
             
                  } else {
         | 
| 99 | 
            -
                     | 
| 87 | 
            +
                    message = scrivito.t('ajax.error', error);
         | 
| 100 88 | 
             
                  }
         | 
| 101 89 |  | 
| 102 90 | 
             
                  if (scrivito.is_development_mode) {
         | 
| 103 | 
            -
                    scrivito.alert_dialog( | 
| 91 | 
            +
                    scrivito.alert_dialog(message);
         | 
| 104 92 | 
             
                  } else {
         | 
| 105 | 
            -
                    scrivito.log_error( | 
| 106 | 
            -
                    scrivito. | 
| 93 | 
            +
                    scrivito.log_error(message);
         | 
| 94 | 
            +
                    scrivito.error_dialog(message_for_editor || scrivito.t('ajax.error.message_for_editor'),
         | 
| 95 | 
            +
                      [error.timestamp, message]);
         | 
| 107 96 | 
             
                  }
         | 
| 108 97 | 
             
                }
         | 
| 109 98 | 
             
              });
         | 
    
        data/lib/fiona7/engine.rb
    CHANGED
    
    | @@ -32,6 +32,7 @@ require "fiona7/scrivito_patches/layout_tags" | |
| 32 32 | 
             
            require "fiona7/scrivito_patches/log_subscriber"
         | 
| 33 33 | 
             
            require "fiona7/scrivito_patches/link_parser"
         | 
| 34 34 | 
             
            require "fiona7/scrivito_patches/migrator"
         | 
| 35 | 
            +
            require "fiona7/scrivito_patches/obj_params_parser"
         | 
| 35 36 | 
             
            require "fiona7/scrivito_patches/page_config"
         | 
| 36 37 | 
             
            require "fiona7/scrivito_patches/preset_routes"
         | 
| 37 38 | 
             
            require "fiona7/scrivito_patches/routing_extensions"
         | 
| @@ -86,6 +86,22 @@ module Scrivito | |
| 86 86 |  | 
| 87 87 | 
             
                  def inherited(subclass,*args)
         | 
| 88 88 | 
             
                    super
         | 
| 89 | 
            +
                    # Under certain condition a circular dependency may arise in rails when
         | 
| 90 | 
            +
                    # loading classes, especially when eager_load = true
         | 
| 91 | 
            +
                    # Thusfar it has only been observed in standalone-mode thus far:
         | 
| 92 | 
            +
                    # Loading Obj < Scrivito::BasicObj triggers this hook
         | 
| 93 | 
            +
                    # which tries to set RailsConnector::Obj to a reasonable value,
         | 
| 94 | 
            +
                    # RailsConnector::AbstractObj provided by reactor.
         | 
| 95 | 
            +
                    # RailsConnector::AbstractObj tries set itself to couple of
         | 
| 96 | 
            +
                    # values, one of which is ::Obj
         | 
| 97 | 
            +
                    # If this occurs with eager_load = true Rails may get confused
         | 
| 98 | 
            +
                    # and trigger circular dependency error. 
         | 
| 99 | 
            +
                    # We work around this problem by hijacking intelligent initialization
         | 
| 100 | 
            +
                    # of RailsConnector::AbstractObj in reactor and set it to a
         | 
| 101 | 
            +
                    # desired value ourselves.
         | 
| 102 | 
            +
                    if subclass.name == 'Obj' && !::RailsConnector.const_defined?('AbstractObj', false)
         | 
| 103 | 
            +
                      ::RailsConnector.const_set('AbstractObj', ::RailsConnector::BasicObj)
         | 
| 104 | 
            +
                    end
         | 
| 89 105 | 
             
                    if subclass.name == 'Obj' && !::RailsConnector.const_defined?('Obj', false)
         | 
| 90 106 | 
             
                      ::RailsConnector.const_set('Obj', ::RailsConnector::AbstractObj)
         | 
| 91 107 | 
             
                    end
         | 
| @@ -46,9 +46,13 @@ module Scrivito | |
| 46 46 | 
             
                    # use fiona connector routes when possible
         | 
| 47 47 | 
             
                    if Fiona7.mode == :legacy
         | 
| 48 48 | 
             
                      if binary = obj.binary
         | 
| 49 | 
            -
                         | 
| 49 | 
            +
                        params = {
         | 
| 50 | 
            +
                          id: obj.id,
         | 
| 51 | 
            +
                          slug: obj.slug,
         | 
| 52 | 
            +
                          format: obj.file_extension
         | 
| 53 | 
            +
                        }
         | 
| 50 54 |  | 
| 51 | 
            -
                        context.public_send("cms_id_#{path_or_url}",  | 
| 55 | 
            +
                        context.public_send("cms_id_#{path_or_url}", params)
         | 
| 52 56 | 
             
                      else
         | 
| 53 57 | 
             
                        LINK_TO_EMPTY_BLOB
         | 
| 54 58 | 
             
                      end
         | 
| @@ -0,0 +1,20 @@ | |
| 1 | 
            +
            require "scrivito/obj_params_parser"
         | 
| 2 | 
            +
             | 
| 3 | 
            +
             | 
| 4 | 
            +
            module Scrivito
         | 
| 5 | 
            +
              class ObjParamsParser
         | 
| 6 | 
            +
                private
         | 
| 7 | 
            +
                def parse_binary_params(params)
         | 
| 8 | 
            +
                  return unless params
         | 
| 9 | 
            +
             | 
| 10 | 
            +
                  if params.kind_of?(Hash) && params[:copy]
         | 
| 11 | 
            +
                    parse_copy_binary_params(params[:copy])
         | 
| 12 | 
            +
                  else
         | 
| 13 | 
            +
                    # Uploaded binary may contain anything at this point
         | 
| 14 | 
            +
                    # an ID (string) or a File or even UploadedFile
         | 
| 15 | 
            +
                    # but the backed will sort this out
         | 
| 16 | 
            +
                    UploadedBinary.new(params)
         | 
| 17 | 
            +
                  end
         | 
| 18 | 
            +
                end
         | 
| 19 | 
            +
              end
         | 
| 20 | 
            +
            end
         | 
    
        data/lib/fiona7/version.rb
    CHANGED
    
    
    
        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. | 
| 4 | 
            +
              version: 1.1.0.0.2
         | 
| 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-02- | 
| 11 | 
            +
            date: 2016-02-23 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: rails
         | 
| @@ -234,6 +234,7 @@ files: | |
| 234 234 | 
             
            - lib/fiona7/scrivito_patches/link_parser.rb
         | 
| 235 235 | 
             
            - lib/fiona7/scrivito_patches/log_subscriber.rb
         | 
| 236 236 | 
             
            - lib/fiona7/scrivito_patches/migrator.rb
         | 
| 237 | 
            +
            - lib/fiona7/scrivito_patches/obj_params_parser.rb
         | 
| 237 238 | 
             
            - lib/fiona7/scrivito_patches/page_config.rb
         | 
| 238 239 | 
             
            - lib/fiona7/scrivito_patches/preset_routes.rb
         | 
| 239 240 | 
             
            - lib/fiona7/scrivito_patches/routing_extensions.rb
         |