Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/release/14.6' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
ulferts committed Oct 17, 2024
2 parents cab89d4 + 2702f50 commit dc02c84
Show file tree
Hide file tree
Showing 11 changed files with 78 additions and 75 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ jobs:
path: public/
name: public-assets-${{ github.sha }}
overwrite: true
# Since v4.4, hidden files are excluded by default.
# We need to include public/assets/.sprockets-manifest-*.json
include-hidden-files: true
outputs:
version: ${{ steps.extract_version.outputs.version }}
checkout_ref: ${{ steps.extract_version.outputs.checkout_ref }}
Expand Down
12 changes: 12 additions & 0 deletions app/controllers/admin/settings_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,18 @@ def update
def show_plugin
@partial = @plugin.settings[:partial]
@settings = Setting["plugin_#{@plugin.id}"]

page_title_key = @plugin.settings[:page_title_key]
@page_title = page_title_key ? I18n.t(page_title_key) : @plugin.name

additional_breadcrumb_elements = @plugin.settings[:breadcrumb_elements]
if additional_breadcrumb_elements.present?
@breadcrumb_elements = if additional_breadcrumb_elements.respond_to?(:call)
instance_exec(&additional_breadcrumb_elements)
else
additional_breadcrumb_elements
end
end
end

def update_plugin
Expand Down
17 changes: 15 additions & 2 deletions app/views/admin/settings/show_plugin.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,20 @@ See COPYRIGHT and LICENSE files for more details.
++#%>
<% html_title t(:label_administration), @plugin.name %>
<%= render partial: @partial, locals: {settings: @settings}%>
<%=
render(Primer::OpenProject::PageHeader.new) do |header|
header.with_title { @page_title }
header.with_breadcrumbs([{ href: admin_index_path, text: t("label_administration") },
*(@breadcrumb_elements if @breadcrumb_elements.present?),
@page_title])
end
%>

<div id="settings">
<%= styled_form_tag({controller: '/admin/settings', action: 'update_plugin' }) do %>
<%= render partial: @partial, locals: {settings: @settings}%>
<%= styled_submit_tag t(:button_apply), class: '-primary' %>
<% end %>
</div>
2 changes: 1 addition & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@
get "/", to: redirect("/admin/settings/general")

# Plugin settings
get "plugin/:id", action: :show_plugin
get "plugin/:id", action: :show_plugin, as: :show_plugin
post "plugin/:id", action: :update_plugin
end

Expand Down
4 changes: 2 additions & 2 deletions docker/dev/backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ruby:3.3.4-bullseye as develop
FROM ruby:3.3.4-bullseye AS develop
MAINTAINER [email protected]

ARG DEV_UID=1000
Expand Down Expand Up @@ -67,7 +67,7 @@ RUN gem install bundler --version "${BUNDLER_VERSION}" --no-document

####### Testing image below #########

FROM develop as test
FROM develop AS test

USER root

Expand Down
6 changes: 3 additions & 3 deletions docker/prod/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ARG RUBY_VERSION="3.3.4"
FROM ruby:${RUBY_VERSION}-bookworm as base
FROM ruby:${RUBY_VERSION}-bookworm AS base
LABEL maintainer="[email protected]"

ARG BUNDLER_VERSION="2.5.13"
Expand Down Expand Up @@ -80,7 +80,7 @@ RUN cp Gemfile.lock.bak Gemfile.lock && rm Gemfile.lock.bak && \
# -------------------------------------
# slim (public)
# -------------------------------------
FROM base as slim
FROM base AS slim

USER $APP_USER
EXPOSE 8080
Expand All @@ -91,7 +91,7 @@ VOLUME ["$APP_DATA_PATH"]
# -------------------------------------
# all-in-one (public)
# -------------------------------------
FROM base as all-in-one
FROM base AS all-in-one

ENV OPENPROJECT_RAILS__CACHE__STORE=memcache
ENV DATABASE_URL=postgres://openproject:[email protected]/openproject
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ OpenProject provides two container flavors with a number of target tags:

OpenProject follows semantic versioning, and tags are pushed on [Docker Hub openproject/openproject](https://hub.docker.com/r/openproject/openproject/tags) in the following way:

- `X.Y.Z`, `X.Y.Z-slim` : **non-floating** tags to provide exactly one release of OpenProject, and you have to update these tags when a new release is made
- `X.Y`, `X-Y.slim` **floating** tags that get pushed whenever a new patch release is made. Please keep in mind that in case of urgent fixes, database migrations might still occur in patch releases, so you need to be able to run the seeder/migrations job. Refer to the installation method of your choice for information on how to do that.
- `X`, `X-Y.slim` **floating** tags that get pushed whenever a new patch or minor release is made. If you use these tags, you are aware that application changes will occur.
- `X.Y.Z`, `X.Y.Z-slim` : **non-floating** tags to provide exactly one release of OpenProject, and you have to update these tags when a new release is made.
- `X.Y`, `X.Y-slim` **floating** tags that get pushed whenever a new patch release is made. Please keep in mind that in case of urgent fixes, database migrations might still occur in patch releases, so you need to be able to run the seeder/migrations job. Refer to the installation method of your choice for information on how to do that.
- `X`, `X-slim` **floating** tags that get pushed whenever a new patch or minor release is made. If you use these tags, you are aware that application changes will occur.
- `dev`, `dev-slim` **floating** tag that gets pushed nightly with the latest development version. These tags are automatically deployed to our QA instances, and are useful for testing and _early_ feedback. We try to keep these versions usable, but we strongly recommend against using them for anything with production data.


Expand Down Expand Up @@ -479,7 +479,7 @@ sudo docker run -it -p 8080:80 \
-e OPENPROJECT_HTTPS=false \
-e OPENPROJECT_DEFAULT__LANGUAGE=en \
--mount type=bind,source=$(pwd)/my_root.crt,target=/tmp/my_root.crt \ #mount my_root.crt to /tmp
-e SSL_CERT_FILE=/tmp/my_root.crt \ #set the SSL_CERT_FILE to the path of my_root.crt
-e SSL_CERT_FILE=/tmp/my_root.crt \ #set the SSL_CERT_FILE to the path of my_root.crt
openproject/openproject:14
```

Expand Down
55 changes: 20 additions & 35 deletions modules/avatars/app/views/settings/_openproject_avatars.html.erb
Original file line number Diff line number Diff line change
@@ -1,39 +1,24 @@
<% manager = ::OpenProject::Avatars::AvatarManager %>

<%=
render(Primer::OpenProject::PageHeader.new) do |header|
header.with_title { I18n.t(:label_avatar_plural) }
header.with_breadcrumbs([{ href: admin_index_path, text: t("label_administration") },
{ href: admin_settings_users_path, text: t(:label_user_and_permission) },
I18n.t(:label_avatar_plural)])
end
%>
<fieldset class="form--fieldset">
<legend class="form--fieldset-legend" title="<%= t 'avatars.label_gravatar' %>"><%= t 'avatars.label_gravatar' %></legend>

<div id="settings">
<%= styled_form_tag({controller: '/admin/settings', action: 'update_plugin' }) do %>
<fieldset class="form--fieldset">
<legend class="form--fieldset-legend" title="<%= t 'avatars.label_gravatar' %>"><%= t 'avatars.label_gravatar' %></legend>
<div class="form--field">
<%= styled_label_tag 'settings-enable-gravatars', t('avatars.settings.enable_gravatars') %>
<%= hidden_field_tag 'settings[enable_gravatars]', 0 %>
<div class="form--field-container">
<%= styled_check_box_tag 'settings[enable_gravatars]', 1, manager.gravatar_enabled?, container_class: '-xslim', id: 'settings-enable-gravatars' %>
</div>
</div>
</fieldset>

<div class="form--field">
<%= styled_label_tag 'settings-enable-gravatars', t('avatars.settings.enable_gravatars') %>
<%= hidden_field_tag 'settings[enable_gravatars]', 0 %>
<div class="form--field-container">
<%= styled_check_box_tag 'settings[enable_gravatars]', 1, manager.gravatar_enabled?, container_class: '-xslim', id: 'settings-enable-gravatars' %>
</div>
</div>
</fieldset>

<fieldset class="form--fieldset">
<legend class="form--fieldset-legend" title="<%= t 'avatars.label_local_avatar' %>"><%= t 'avatars.label_local_avatar' %></legend>
<div class="form--field">
<%= styled_label_tag 'settings-enable-local-avatars', t('avatars.settings.enable_local_avatars') %>
<%= hidden_field_tag 'settings[enable_local_avatars]', 0 %>
<div class="form--field-container">
<%= styled_check_box_tag 'settings[enable_local_avatars]', 1, manager.local_avatars_enabled?, container_class: '-xslim', id: 'settings-enable-local-avatars' %>
</div>
</div>
</fieldset>

<%= styled_submit_tag t(:button_apply), class: '-primary' %>
<% end %>
</div>
<fieldset class="form--fieldset">
<legend class="form--fieldset-legend" title="<%= t 'avatars.label_local_avatar' %>"><%= t 'avatars.label_local_avatar' %></legend>
<div class="form--field">
<%= styled_label_tag 'settings-enable-local-avatars', t('avatars.settings.enable_local_avatars') %>
<%= hidden_field_tag 'settings[enable_local_avatars]', 0 %>
<div class="form--field-container">
<%= styled_check_box_tag 'settings[enable_local_avatars]', 1, manager.local_avatars_enabled?, container_class: '-xslim', id: 'settings-enable-local-avatars' %>
</div>
</div>
</fieldset>
1 change: 1 addition & 0 deletions modules/avatars/lib/open_project/avatars/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class Engine < ::Rails::Engine
enable_local_avatars: !Rails.env.test?
},
partial: "settings/openproject_avatars",
breadcrumb_elements: -> { [{ href: admin_settings_users_path, text: I18n.t(:label_user_and_permission) }] },
menu_item: :user_avatars
},
bundled: true do
Expand Down
41 changes: 13 additions & 28 deletions modules/costs/app/views/settings/_costs.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -27,32 +27,17 @@ See COPYRIGHT and LICENSE files for more details.
++#%>

<%=
render(Primer::OpenProject::PageHeader.new) do |header|
header.with_title { I18n.t(:project_module_costs) }
header.with_breadcrumbs([{ href: admin_index_path, text: t("label_administration") },
{ href: url_for({ controller: "/admin/settings", action: "show_plugin", id: :costs }), text: t(:project_module_costs) },
I18n.t(:label_setting_plural)])
end
%>

<div id="settings">
<%= styled_form_tag({controller: '/admin/settings', action: 'update_plugin' }) do %>

<div class="form--field">
<%= styled_label_tag :label_currency, t(:label_currency) %>
<div class="form--field-container">
<%= styled_text_field_tag 'settings[costs_currency]', @settings['costs_currency'], container_class: '-xslim' %>
</div>
</div>

<div class="form--field">
<%= styled_label_tag :label_currency_format, t(:label_currency_format) %>
<div class="form--field-container">
<%= styled_text_field_tag 'settings[costs_currency_format]', @settings['costs_currency_format'], container_class: '-xslim' %>
</div>
</div>

<%= styled_submit_tag t(:button_apply), class: '-primary' %>
<% end %>

<div class="form--field">
<%= styled_label_tag :label_currency, t(:label_currency) %>
<div class="form--field-container">
<%= styled_text_field_tag 'settings[costs_currency]', @settings['costs_currency'], container_class: '-xslim' %>
</div>
</div>

<div class="form--field">
<%= styled_label_tag :label_currency_format, t(:label_currency_format) %>
<div class="form--field-container">
<%= styled_text_field_tag 'settings[costs_currency_format]', @settings['costs_currency_format'], container_class: '-xslim' %>
</div>
</div>
4 changes: 4 additions & 0 deletions modules/costs/lib/costs/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ class Engine < ::Rails::Engine
settings: {
default: { "costs_currency" => "EUR", "costs_currency_format" => "%n %u" },
partial: "settings/costs",
page_title_key: :label_setting_plural,
breadcrumb_elements: -> {
[{ href: admin_settings_show_plugin_path(:costs), text: I18n.t(:project_module_costs) }]
},
menu_item: :costs_setting
} do
project_module :costs do
Expand Down

0 comments on commit dc02c84

Please sign in to comment.