Skip to content

Commit

Permalink
Merge branch 'feature/54733-primerise-the-activity-panel' into featur…
Browse files Browse the repository at this point in the history
…e/40437-emoji-reactions-to-work-package-comments
  • Loading branch information
jjabari-op authored Oct 7, 2024
2 parents 560d7f9 + ec33bc0 commit e86f322
Show file tree
Hide file tree
Showing 759 changed files with 20,410 additions and 3,719 deletions.
10 changes: 7 additions & 3 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,16 @@ LOCAL_DEV_CHECK=1
# want to develop ckeditor locally.
CKEDITOR_BUILD_DIR=./frontend/src/vendor/ckeditor/

HOST=0.0.0.0
PORT=4200
# Local backend development host and port
HOST=localhost
PORT=3000
# Local frontend development host and port
FE_HOST=localhost
FE_PORT=4200

# Use this variables to configure hostnames for frontend and backend, e.g. to enable HTTPS in docker development setup
OPENPROJECT_DEV_HOST=localhost
OPENPROJECT_DEV_URL=http://${OPENPROJECT_DEV_HOST}:${PORT}
OPENPROJECT_DEV_URL=http://${OPENPROJECT_DEV_HOST}:${FE_PORT}

# Select edition from: ['standard','bim']
OPENPROJECT_EDITION=standard
Expand Down
17 changes: 11 additions & 6 deletions .github/workflows/version-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ permissions:
pull-requests: write # to comment on the PR

jobs:
check-pr:
version-check:
if: contains(github.event.pull_request.labels.*.name, 'needs review')
runs-on: ubuntu-latest

Expand All @@ -22,22 +22,27 @@ jobs:

- name: Verify linked version matches core version
id: version-check
run: ./script/ci/version_check.sh "${{ github.event.pull_request.body }}"
env:
PR_BODY: ${{ github.event.pull_request.body }}
run: ./script/ci/version_check.sh "$PR_BODY"

- name: Add comment if versions differ
if: steps.version-check.outputs.version_mismatch == 'true'
uses: marocchino/sticky-pull-request-comment@v2
with:
header: version-mismatch-comment
message: |
The provided work package version does not match the core version:
> [!CAUTION]
> The provided work package version does not match the core version
Details:
- Work package URL: ${{ steps.version-check.outputs.wp_url }}
- Work package version: ${{steps.version-check.outputs.wp_version}}
- Core version: ${{steps.version-check.outputs.core_version}}
Please make sure that:
- The work package version OR your pull request target branch is correct
- name: Version check passed
if: steps.version-check.outputs.version_mismatch != 'true'
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -399,4 +399,4 @@ end

gem "openproject-octicons", "~>19.18.0"
gem "openproject-octicons_helper", "~>19.18.0"
gem "openproject-primer_view_components", "~>0.47.0"
gem "openproject-primer_view_components", "~>0.47.1"
30 changes: 15 additions & 15 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -283,9 +283,9 @@ GEM
globalid (>= 0.3.6)
activemodel (7.1.4)
activesupport (= 7.1.4)
activemodel-serializers-xml (1.0.2)
activemodel (> 5.x)
activesupport (> 5.x)
activemodel-serializers-xml (1.0.3)
activemodel (>= 5.0.0.a)
activesupport (>= 5.0.0.a)
builder (~> 3.1)
activerecord (7.1.4)
activemodel (= 7.1.4)
Expand Down Expand Up @@ -342,8 +342,8 @@ GEM
activerecord (>= 4.0.0, < 8.0)
awrence (1.2.1)
aws-eventstream (1.3.0)
aws-partitions (1.977.0)
aws-sdk-core (3.208.0)
aws-partitions (1.981.0)
aws-sdk-core (3.209.1)
aws-eventstream (~> 1, >= 1.3.0)
aws-partitions (~> 1, >= 1.651.0)
aws-sigv4 (~> 1.9)
Expand Down Expand Up @@ -700,7 +700,7 @@ GEM
launchy (3.0.1)
addressable (~> 2.8)
childprocess (~> 5.0)
lefthook (1.7.16)
lefthook (1.7.18)
letter_opener (1.10.0)
launchy (>= 2.2, < 4)
letter_opener_web (3.0.0)
Expand Down Expand Up @@ -745,7 +745,7 @@ GEM
markly (0.12.1)
matrix (0.4.2)
messagebird-rest (1.4.2)
meta-tags (2.22.0)
meta-tags (2.22.1)
actionpack (>= 6.0.0, < 8.1)
method_source (1.1.0)
mime-types (3.5.2)
Expand Down Expand Up @@ -804,7 +804,7 @@ GEM
actionview
openproject-octicons (= 19.18.0)
railties
openproject-primer_view_components (0.47.0)
openproject-primer_view_components (0.47.1)
actionview (>= 5.0.0)
activesupport (>= 5.0.0)
openproject-octicons (>= 19.17.0)
Expand Down Expand Up @@ -973,7 +973,7 @@ GEM
actionpack (>= 5.2)
railties (>= 5.2)
retriable (3.1.2)
rexml (3.3.7)
rexml (3.3.8)
rinku (2.0.6)
roar (1.2.0)
representable (~> 3.1)
Expand Down Expand Up @@ -1022,10 +1022,10 @@ GEM
rubocop (~> 1.61)
rubocop-openproject (0.1.0)
rubocop
rubocop-performance (1.22.0)
rubocop-performance (1.22.1)
rubocop (>= 1.48.1, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
rubocop-rails (2.26.1)
rubocop-rails (2.26.2)
activesupport (>= 4.2.0)
rack (>= 1.1)
rubocop (>= 1.52.0, < 2.0)
Expand Down Expand Up @@ -1083,7 +1083,7 @@ GEM
spring (>= 0.9.1)
spring-commands-rubocop (0.4.0)
spring (>= 1.0)
sprockets (3.7.4)
sprockets (3.7.5)
base64
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
Expand Down Expand Up @@ -1143,7 +1143,7 @@ GEM
public_suffix
vcr (6.3.1)
base64
view_component (3.14.0)
view_component (3.16.0)
activesupport (>= 5.2.0, < 8.0)
concurrent-ruby (~> 1.0)
method_source (~> 1.0)
Expand All @@ -1168,7 +1168,7 @@ GEM
activesupport
faraday (~> 2.0)
faraday-follow_redirects
webmock (3.23.1)
webmock (3.24.0)
addressable (>= 2.8.0)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
Expand Down Expand Up @@ -1303,7 +1303,7 @@ DEPENDENCIES
openproject-octicons (~> 19.18.0)
openproject-octicons_helper (~> 19.18.0)
openproject-openid_connect!
openproject-primer_view_components (~> 0.47.0)
openproject-primer_view_components (~> 0.47.1)
openproject-recaptcha!
openproject-reporting!
openproject-storages!
Expand Down
2 changes: 1 addition & 1 deletion Procfile.dev
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
web: bundle exec rails server -p 3000 -b ${HOST:="127.0.0.1"} --environment ${RAILS_ENV:="development"}
web: bundle exec rails server
angular: npm run serve
worker: bundle exec good_job start
19 changes: 9 additions & 10 deletions app/components/add_button_component.html.erb
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
<li class="<%= li_css_class %>">
<a href="<%= dynamic_path %>"
id="<%= id %>"
title="<%= title %>"
arial-label="<%= aria_label %>"
class="<%= link_css_class %>">
<%= icon %>
<%= label %>
</a>
</li>
<a href="<%= dynamic_path %>"
id="<%= id %>"
title="<%= title %>"
arial-label="<%= aria_label %>"
class="<%= link_css_class %>">
<%= icon %>
<%= label %>
</a>

4 changes: 0 additions & 4 deletions app/components/add_button_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,6 @@ def id
raise "Implement the id for this component"
end

def li_css_class
"toolbar-item"
end

def title
accessibility_label_text
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,10 @@ def more_menu_detach_project
def detach_from_project_url
url_helpers.custom_field_project_path(
custom_field_id: @table.params[:custom_field].id,
custom_fields_project: { project_id: project.id }
custom_fields_project: { project_id: project.id },
page: current_page
)
end

def project = model.first
end
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ module Admin
module CustomFields
module CustomFieldProjects
class TableComponent < Projects::TableComponent
include OpTurbo::Streamable
include ::Projects::Concerns::TableComponent::StreamablePaginationLinksConstraints

def columns
@columns ||= query.selects.reject { |select| select.is_a?(Queries::Selects::NotExistingSelect) }
Expand All @@ -39,23 +39,6 @@ def columns
def sortable?
false
end

# @override optional_pagination_options are passed to the pagination_options
# which are passed to #pagination_links_full in pagination_helper.rb
#
# In Turbo streamable components, we need to be able to specify the url_for(action:) so that links are
# generated in the context of the component index action, instead of any turbo stream actions performing
# partial updates on the page.
#
# params[:url_for_action] is passed to the pagination_options making it's way down to any pagination links
# that are generated via link_to which calls url_for which uses the params[:url_for_action] to specify
# the controller action that link_to should use.
#
def optional_pagination_options
return super unless params[:url_for_action]

super.merge(params: { action: params[:url_for_action] })
end
end
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,15 @@ See COPYRIGHT and LICENSE files for more details.
tab.with_text { t(:label_details) }
end

if @custom_field.field_format_hierarchy?
tab_nav.with_tab(
selected: tab_selected?(:items),
href: custom_field_items_path(@custom_field)
) do |tab|
tab.with_text { t(:label_item_plural) }
end
end

tab_nav.with_tab(
selected: tab_selected?(:custom_field_projects),
href: custom_field_projects_path(@custom_field)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ module CustomFields
class EditFormHeaderComponent < ApplicationComponent
TAB_NAVS = %i[
edit
items
custom_field_projects
].freeze

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,27 +27,23 @@ See COPYRIGHT and LICENSE files for more details.
++#%>

<div class="op-toast--wrapper">
<div class="op-toast--casing">
<div id="errorExplanation"
data-members-form-target="errorExplanation"
class="op-toast errorExplanation -error <%= local_assigns[:classes] || '' %>"
tabindex="0"
role="alert">
<div class="op-toast--content">
<% if content_for?(:error_details) %>
<p>
<strong><%= error_message %></strong>
</p>
<%= content_for :error_details %>
<% else %>
<%= error_message %>
<% end %>
</div>

<span class="close-handler" role="button" tabindex="0" aria-label="{{ ::I18n.t('js.close_popup_title') }}">
<%= op_icon('icon-close') %>
</span>
</div>
</div>
</div>
<%=
component_wrapper do
flex_layout do |container|
container.with_row(mb: 3) do
render Primer::Beta::Blankslate.new(border: true) do |component|
component.with_visual_icon(icon: "list-ordered")
component.with_heading(tag: :h3).with_content(I18n.t("custom_fields.admin.items.blankslate.title"))
component.with_description { I18n.t("custom_fields.admin.items.blankslate.description") }
end
end

container.with_row do
render Primer::Beta::Button.new(scheme: :primary) do |button|
button.with_leading_visual_icon(icon: :plus)
I18n.t(:label_item)
end
end
end
end
%>
38 changes: 38 additions & 0 deletions app/components/admin/custom_fields/hierarchy/item_component.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#-- copyright
# OpenProject is an open source project management software.
# Copyright (C) the OpenProject GmbH
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License version 3.
#
# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
# Copyright (C) 2006-2013 Jean-Philippe Lang
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# See COPYRIGHT and LICENSE files for more details.
#++

module Admin
module CustomFields
module Hierarchy
class ItemComponent < ApplicationComponent
include OpTurbo::Streamable
include OpPrimer::ComponentHelpers
end
end
end
end
21 changes: 21 additions & 0 deletions app/components/custom_fields/details_component.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<%=
component_wrapper do
flex_layout do |content|
content.with_row(mb: 3) do
render Primer::Alpha::Banner.new(scheme: :default, icon: :info, dismiss_scheme: :hide) do
I18n.t("custom_fields.admin.notice.remember_items_and_projects")
end
end

content.with_row do
primer_form_with(
model:,
scope: :custom_field,
id: "custom_field_form",
url: custom_field_path(model),
method: :put
) { |form| render CustomFields::DetailsForm.new(form) }
end
end
end
%>
Loading

0 comments on commit e86f322

Please sign in to comment.