Skip to content

Commit 9b8f226

Browse files
committed
Primerizse Admin > aggregation time page
1 parent 2b16e71 commit 9b8f226

File tree

4 files changed

+67
-25
lines changed

4 files changed

+67
-25
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# frozen_string_literal: true
2+
3+
#-- copyright
4+
# OpenProject is an open source project management software.
5+
# Copyright (C) the OpenProject GmbH
6+
#
7+
# This program is free software; you can redistribute it and/or
8+
# modify it under the terms of the GNU General Public License version 3.
9+
#
10+
# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
11+
# Copyright (C) 2006-2013 Jean-Philippe Lang
12+
# Copyright (C) 2010-2013 the ChiliProject Team
13+
#
14+
# This program is free software; you can redistribute it and/or
15+
# modify it under the terms of the GNU General Public License
16+
# as published by the Free Software Foundation; either version 2
17+
# of the License, or (at your option) any later version.
18+
#
19+
# This program is distributed in the hope that it will be useful,
20+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
21+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22+
# GNU General Public License for more details.
23+
#
24+
# You should have received a copy of the GNU General Public License
25+
# along with this program; if not, write to the Free Software
26+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
27+
#
28+
# See COPYRIGHT and LICENSE files for more details.
29+
#++
30+
31+
module Admin
32+
module Settings
33+
class AggregationSettingsForm < ApplicationForm
34+
include Redmine::I18n
35+
36+
settings_form do |f|
37+
f.text_field name: :journal_aggregation_time_minutes,
38+
type: :number,
39+
min: 0,
40+
input_width: :medium,
41+
trailing_visual: { text: { text: I18n.t("datetime.units.minute_abbreviated", count: 2) } }
42+
43+
f.submit
44+
end
45+
end
46+
end
47+
end
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<%= render(Primer::Beta::Text.new(tag: :p)) do %>
2+
<%= link_translate("admin.journal_aggregation.caption", links: { webhook_link: url_helpers.admin_outgoing_webhooks_path }) %>
3+
<% end %>
4+
<%= render(Primer::OpenProject::InlineMessage.new(scheme: :warning, size: :small)) do %>
5+
<%= render(Primer::Beta::Text.new(tag: :p)) do %>
6+
<%= I18n.t(:text_hint_disable_with_0) %>
7+
<% end %>
8+
<% end %>

app/views/admin/settings/aggregation_settings/show.html.erb

Lines changed: 10 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -40,25 +40,13 @@ See COPYRIGHT and LICENSE files for more details.
4040
end
4141
%>
4242

43-
<%= styled_form_tag(admin_settings_aggregation_path, method: :patch) do %>
44-
<div class="form--field">
45-
<%= setting_number_field :journal_aggregation_time_minutes,
46-
unit: t(:label_minute_plural),
47-
min: 0,
48-
container_class: "-xslim" %>
49-
<span class="form--field-instructions">
50-
<%= t(
51-
:"admin.journal_aggregation.explanation.text",
52-
webhook_link: link_to(
53-
t(:"admin.journal_aggregation.explanation.link"),
54-
admin_outgoing_webhooks_path,
55-
target: "_blank"
56-
)
57-
).html_safe %>
58-
<br>
59-
<%= t(:text_hint_disable_with_0) %>
60-
</span>
61-
</div>
62-
63-
<%= styled_button_tag t(:button_save), class: "-primary -with-icon icon-checkmark" %>
64-
<% end %>
43+
<%=
44+
settings_primer_form_with(
45+
url: admin_settings_aggregation_path,
46+
scope: :settings,
47+
method: :patch,
48+
data: { turbo: false }
49+
) do |form|
50+
render Admin::Settings::AggregationSettingsForm.new(form)
51+
end
52+
%>

config/locales/en.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,8 @@ en:
116116
trial: "Trial"
117117
jemalloc_allocator: Jemalloc memory allocator
118118
journal_aggregation:
119-
explanation:
120-
text: "Individual actions of a user (e.g. updating a work package twice) are aggregated into a single action if their age difference is less than the specified timespan. They will be displayed as a single action within the application. This will also delay notifications by the same amount of time reducing the number of emails being sent and will also affect %{webhook_link} delay."
121-
link: "webhook"
119+
caption: >
120+
Individual actions of a user (e.g. updating a work package twice) are aggregated into a single action if their age difference is less than the specified timespan. They will be displayed as a single action within the application. This will also delay notifications by the same amount of time reducing the number of emails being sent and will also affect the [webhook](webhook_link) delay.
122121
import:
123122
title: "Import"
124123
jira:

0 commit comments

Comments
 (0)