lib/scrivito/client_config.rb in scrivito_sdk-0.30.0 vs lib/scrivito/client_config.rb in scrivito_sdk-0.40.0.rc1

- old
+ new

@@ -5,13 +5,13 @@ super(obj, editing_context, lookup_context, *options.values_at(:resource, :return_to)) end def to_json config = {} + config[:current_page] = current_page_config config[:editing_context] = editing_context_config config[:i18n] = i18n_config - config[:obj] = obj_config config[:resource_dialog] = resource_dialog_config config[:user] = user_config config[:user_permissions] = user_permissions_config config.to_json end @@ -37,21 +37,19 @@ def i18n_config {locale: I18n.locale} end - def obj_config + def current_page_config if obj { - current_page: { - id: obj.id, - obj_class_name: obj.obj_class_name, - has_children: obj.children.any?, - has_conflict: obj.has_conflict?, - has_details_view: obj_has_details_view?, - modification: modification(obj), - restriction_messages: editor.restriction_messages_for(obj), - } + id: obj.id, + obj_class_name: obj.obj_class_name, + has_children: obj.children.any?, + has_conflict: obj.has_conflict?, + has_details_view: obj_has_details_view?, + modification: modification(obj), + restriction_messages: editor.restriction_messages_for(obj), } else {} end end