Merge branch 'dev' into feature/wp-search--ngselect

pull/7016/head
Wieland Lindenthal 6 years ago
commit 1c7278ae46
  1. 2
      Gemfile
  2. 4
      Gemfile.lock
  3. 3
      app/assets/stylesheets/content/_forms.sass
  4. 2
      app/views/wiki/_page_form.html.erb
  5. 2
      config/constants/api_patch_registry.rb
  6. 7
      docs/installation/manual/README.md
  7. 33
      lib/api/open_project_api.rb
  8. 10
      lib/api/patchable_api.rb
  9. 2
      lib/api/v3/root.rb
  10. 3
      lib/open_project/plugins/acts_as_op_engine.rb
  11. 2
      modules/my_project_page/app/views/my_projects_overviews/_block_textilizable.html.erb

@ -273,7 +273,7 @@ end
gem 'bootsnap', '~> 1.3.2', require: true gem 'bootsnap', '~> 1.3.2', require: true
# API gems # API gems
gem 'grape', '~> 1.1' gem 'grape', '~> 1.2.3'
gem 'reform', '~> 2.2.0' gem 'reform', '~> 2.2.0'
gem 'reform-rails', '~> 0.1.7' gem 'reform-rails', '~> 0.1.7'

@ -456,7 +456,7 @@ GEM
actionpack (>= 3.0) actionpack (>= 3.0)
multi_json multi_json
request_store (>= 1.0) request_store (>= 1.0)
grape (1.1.0) grape (1.2.3)
activesupport activesupport
builder builder
mustermann-grape (~> 1.0.0) mustermann-grape (~> 1.0.0)
@ -918,7 +918,7 @@ DEPENDENCIES
friendly_id (~> 5.2.1) friendly_id (~> 5.2.1)
fuubar (~> 2.3.2) fuubar (~> 2.3.2)
gon (~> 6.2.1) gon (~> 6.2.1)
grape (~> 1.1) grape (~> 1.2.3)
grids! grids!
health_check health_check
html-pipeline (~> 2.8.0) html-pipeline (~> 2.8.0)

@ -400,6 +400,9 @@ fieldset.form--fieldset
&.-vertical &.-vertical
display: block display: block
.form--field.-visible-overflow &
overflow: visible
&:nth-of-type(n+2), &:nth-of-type(n+2),
.form--field.-no-label & .form--field.-no-label &
@include grid-offset(2) @include grid-offset(2)

@ -10,7 +10,7 @@
<% end %> <% end %>
<% end %> <% end %>
<div class="attributes-group wiki--content--attribute"> <div class="attributes-group wiki--content--attribute form--field -visible-overflow">
<%= f.text_area :text, <%= f.text_area :text,
cols: 100, cols: 100,
rows: 25, rows: 25,

@ -26,7 +26,7 @@
# See docs/COPYRIGHT.rdoc for more details. # See docs/COPYRIGHT.rdoc for more details.
#++ #++
module API module Constants
class APIPatchRegistry class APIPatchRegistry
class << self class << self
def add_patch(class_name, path, &block) def add_patch(class_name, path, &block)

@ -92,7 +92,8 @@ Lastly, exit the system user
### Using MySQL instead ### Using MySQL instead
We recommend against using MySQL. If you have to use MySQL instead, please ensure a version of >= 5.7 as it supports special characters such as emojis (emoticons) out of the box. We recommend against using MySQL. If you have to use MySQL instead, please ensure a version of >= 5.7
(MariaDB version >= 10.2) as it supports special characters such as emojis (emoticons) out of the box.
If your Linux distribution only provides older versions of MySQL it is worth considering If your Linux distribution only provides older versions of MySQL it is worth considering
[adding MySQL as an `apt` source](https://dev.mysql.com/doc/mysql-apt-repo-quick-guide/en/). [adding MySQL as an `apt` source](https://dev.mysql.com/doc/mysql-apt-repo-quick-guide/en/).
@ -116,7 +117,7 @@ the OpenProject database.
You may replace the string `openproject` with the desired username and You may replace the string `openproject` with the desired username and
database name. The password `my_password` should definitely be changed. database name. The password `my_password` should definitely be changed.
**On MySQL version 5.7 or greater (recommended)** **On MySQL version 5.7 (MariaDB 10.2) or greater (recommended)**
```sql ```sql
mysql> CREATE DATABASE openproject CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; mysql> CREATE DATABASE openproject CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
@ -236,7 +237,7 @@ production:
password: openproject password: openproject
``` ```
** MySQL installation: version 5.7 or greater (recommended)** ** MySQL installation: version 5.7 (MariaDB 10.2) or greater (recommended)**
The encoding should be set to `utf8mb4` as we created the DB with that encoding The encoding should be set to `utf8mb4` as we created the DB with that encoding
a few steps ago. a few steps ago.

@ -28,6 +28,37 @@
module API module API
class OpenProjectAPI < ::Grape::API class OpenProjectAPI < ::Grape::API
include ::API::PatchableAPI class << self
def inherited(api, *)
super
# run unscoped patches (i.e. patches that are on the class root, not in a namespace)
api.apply_patches(nil)
end
end
end
end
Grape::DSL::Routing::ClassMethods.module_eval do
# Be reload safe. otherwise, an infinite loop occurs on reload.
unless instance_methods.include?(:orig_namespace)
alias :orig_namespace :namespace
end
def namespace(space = nil, options = {}, &block)
orig_namespace(space, options) do
instance_eval(&block)
apply_patches(space)
end
end
def apply_patches(path)
(patches[path] || []).each do |patch|
instance_eval(&patch)
end
end
def patches
::Constants::APIPatchRegistry.patches_for(base)
end end
end end

@ -29,15 +29,17 @@
module API module API
module PatchableAPI module PatchableAPI
def self.included(base) def self.included(base)
base.extend ClassMethods base.class_eval do
prepend ClassMethods
end
end end
module ClassMethods module ClassMethods
def inherited(subclass) def inherited(api, base_instance_parent = Grape::API::Instance)
super super
# run unscoped patches (i.e. patches that are on the class root, not in a namespace) # run unscoped patches (i.e. patches that are on the class root, not in a namespace)
subclass.send(:execute_patches_for, nil) api.send(:execute_patches_for, nil)
end end
def namespace(name, *args, &block) def namespace(name, *args, &block)
@ -64,7 +66,7 @@ module API
end end
def patches def patches
::API::APIPatchRegistry.patches_for(self) ::Constants::APIPatchRegistry.patches_for(self)
end end
end end
end end

@ -30,7 +30,7 @@
# Root class of the API v3 # Root class of the API v3
# This is the place for all API v3 wide configuration, helper methods, exceptions # This is the place for all API v3 wide configuration, helper methods, exceptions
# rescuing, mounting of differnet API versions etc. # rescuing, mounting of different API versions etc.
module API module API
module V3 module V3

@ -27,6 +27,7 @@
#++ #++
require_dependency 'open_project/ui/extensible_tabs' require_dependency 'open_project/ui/extensible_tabs'
require_dependency 'config/constants/api_patch_registry'
module OpenProject::Plugins module OpenProject::Plugins
module ActsAsOpEngine module ActsAsOpEngine
@ -225,7 +226,7 @@ module OpenProject::Plugins
# 1. it does not seem possible to pass it as constant (auto loader not ready yet) # 1. it does not seem possible to pass it as constant (auto loader not ready yet)
# 2. we can't constantize it here, because that would evaluate # 2. we can't constantize it here, because that would evaluate
# the API before it can be patched # the API before it can be patched
::API::APIPatchRegistry.add_patch base_endpoint, path, &block ::Constants::APIPatchRegistry.add_patch base_endpoint, path, &block
end end
end end

@ -51,7 +51,7 @@ See doc/COPYRIGHT.md for more details.
</div> </div>
</div> </div>
<div class="form--field -required"> <div class="form--field -required -visible-overflow">
<%= styled_label_tag "textile_#{block_name}", t('info_custom_text') %> <%= styled_label_tag "textile_#{block_name}", t('info_custom_text') %>
<div class="form--field-container" ng-non-bindable> <div class="form--field-container" ng-non-bindable>

Loading…
Cancel
Save