Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] dev from opf:dev #229

Merged
merged 54 commits into from
May 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
86909ef
rename persisted project query
toy May 14, 2024
6b5f461
fix projects menu
toy May 16, 2024
5ddcb59
test projects menu
toy May 17, 2024
e469061
split single huge persisting queries spec into multiple
toy May 21, 2024
9adc0ec
Prevent plain text from being inlinable
oliverguenther May 22, 2024
aec8632
Add spec
oliverguenther May 22, 2024
a8b8d98
Fix eslint template parser to allow eslint to run
oliverguenther May 22, 2024
a257a10
Merge pull request #15638 from opf/fix/prevent-plain-text-inlinable
oliverguenther May 22, 2024
d3929b5
update locales from crowdin [ci skip]
openprojectci May 23, 2024
0ea3e1a
update locales from crowdin [ci skip]
openprojectci May 23, 2024
e70767e
update locales from crowdin [ci skip]
openprojectci May 23, 2024
0d7b6a2
Merge remote-tracking branch 'origin/release/14.1' into dev
ulferts May 23, 2024
b229550
Bump rdoc from 6.6.3.1 to 6.7.0
dependabot[bot] May 23, 2024
aa137e2
Bump sys-filesystem from 1.4.4 to 1.4.5
dependabot[bot] May 23, 2024
f835dc3
Bump the fullcalendar group in /frontend with 7 updates
dependabot[bot] May 23, 2024
5b97575
Add info and link to advisory to CVE-2024-135224 to the release notes
klaustopher May 23, 2024
7bdd4de
Merge pull request #15651 from opf/add-CVE-2024-135224-to-release-notes
klaustopher May 23, 2024
5a41497
Merge pull request #15646 from opf/dependabot/bundler/dev/sys-filesys…
ulferts May 23, 2024
959732f
Merge pull request #15647 from opf/dependabot/bundler/dev/rdoc-6.7.0
ulferts May 23, 2024
0be63d4
Merge pull request #15649 from opf/dependabot/npm_and_yarn/frontend/d…
ulferts May 23, 2024
1a0ba25
don't allow renaming modified project list and modifying the list whi…
toy May 22, 2024
3422e51
Bump primer_view_components to 0.31.0
HDinger May 23, 2024
61ccb2d
Merge pull request #15652 from opf/housekeeping/bump-primer-0-31
HDinger May 23, 2024
3798b41
Fix ContentSecurityPolicy for lookbook
klaustopher May 23, 2024
064cfd6
[#55158] Add complete attribute to storage representer
Kharonus May 23, 2024
068a88d
Merge pull request #15559 from opf/feature/51673-renaming-persisted-p…
toy May 23, 2024
d94691e
Merge pull request #15654 from opf/fix-csop-for-lookbook
cbliard May 23, 2024
91512a0
update locales from crowdin [ci skip]
openprojectci May 24, 2024
773293e
update locales from crowdin [ci skip]
openprojectci May 24, 2024
5f4fd28
Bump rubocop from 1.63.5 to 1.64.0
dependabot[bot] May 24, 2024
4adca2b
Bump the angular group in /frontend with 17 updates
dependabot[bot] May 24, 2024
8ba58f8
Merge pull request #15657 from opf/dependabot/bundler/dev/rubocop-1.64.0
ulferts May 24, 2024
60892a9
Merge remote-tracking branch 'origin/release/14.1' into dev
ulferts May 24, 2024
971b944
bump Ascii85
ulferts May 24, 2024
811ed73
bump aws-partitions & minitest
ulferts May 24, 2024
33d48d1
bump aws-sdk-kms
ulferts May 24, 2024
1fad834
bump google-apis-core
ulferts May 24, 2024
0d6a857
bump lookbook
ulferts May 24, 2024
2de35e1
bump rb-inotify
ulferts May 24, 2024
d50b29b
bump redis-client
ulferts May 24, 2024
6bdc2d5
bump rspec-mocks
ulferts May 24, 2024
b80d85b
bump simpleidn
ulferts May 24, 2024
1713888
bump activerecord-import
ulferts May 24, 2024
c5d0f3d
bump commonmarker
ulferts May 24, 2024
496583b
bump doorkeeper
ulferts May 24, 2024
239ef8d
bump rack-timeout
ulferts May 24, 2024
62ac650
bump aws-sdk-sns
ulferts May 24, 2024
7307e09
bump mime-types-data
ulferts May 24, 2024
b18e468
Merge pull request #15659 from opf/dependabot/npm_and_yarn/frontend/d…
ulferts May 24, 2024
50cb24c
attempt to fix flickering spec
ulferts May 24, 2024
5af1496
Merge pull request #15660 from opf/fix/bump_gems
ulferts May 24, 2024
f01cf46
[#55158] added PR comments
Kharonus May 24, 2024
50d5877
Merge pull request #15655 from opf/code-maintenance/55158-extend-stor…
Kharonus May 24, 2024
1536de6
update locales from crowdin [ci skip]
openprojectci May 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ ruby File.read(".ruby-version").strip

gem "actionpack-xml_parser", "~> 2.0.0"
gem "activemodel-serializers-xml", "~> 1.0.1"
gem "activerecord-import", "~> 1.6.0"
gem "activerecord-import", "~> 1.7.0"
gem "activerecord-session_store", "~> 2.1.0"
gem "ox"
gem "rails", "~> 7.1.3"
Expand All @@ -46,7 +46,7 @@ gem "ffi", "~> 1.15"

gem "rdoc", ">= 2.4.2"

gem "doorkeeper", "~> 5.6.6"
gem "doorkeeper", "~> 5.7.0"
# Maintain our own omniauth due to relative URL root issues
# see upstream PR: https://github.com/omniauth/omniauth/pull/903
gem "omniauth", git: "https://github.com/opf/omniauth", ref: "fe862f986b2e846e291784d2caa3d90a658c67f0"
Expand Down Expand Up @@ -83,7 +83,7 @@ gem "htmldiff"
gem "stringex", "~> 2.8.5"

# CommonMark markdown parser with GFM extension
gem "commonmarker", "~> 1.0.3"
gem "commonmarker", "~> 1.1.3"

# HTML pipeline for transformations on text formatter output
# such as sanitization or additional features
Expand Down Expand Up @@ -184,7 +184,7 @@ gem "sprockets-rails", "~> 3.4.2"

gem "puma", "~> 6.4"
gem "puma-plugin-statsd", "~> 2.0"
gem "rack-timeout", "~> 0.6.3", require: "rack/timeout/base"
gem "rack-timeout", "~> 0.7.0", require: "rack/timeout/base"

gem "nokogiri", "~> 1.16.0"

Expand Down Expand Up @@ -386,4 +386,4 @@ end

gem "openproject-octicons", "~>19.12.0"
gem "openproject-octicons_helper", "~>19.12.0"
gem "openproject-primer_view_components", "~>0.30.1"
gem "openproject-primer_view_components", "~>0.31.0"
56 changes: 26 additions & 30 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ PATH
remote: modules/two_factor_authentication
specs:
openproject-two_factor_authentication (1.0.0)
aws-sdk-sns (~> 1.74.0)
aws-sdk-sns (~> 1.75.0)
messagebird-rest (~> 1.4.2)
rotp (~> 6.1)
webauthn (~> 3.0)
Expand All @@ -225,7 +225,7 @@ PATH
GEM
remote: https://rubygems.org/
specs:
Ascii85 (1.1.0)
Ascii85 (1.1.1)
actioncable (7.1.3.3)
actionpack (= 7.1.3.3)
activesupport (= 7.1.3.3)
Expand Down Expand Up @@ -291,7 +291,7 @@ GEM
activemodel (= 7.1.3.3)
activesupport (= 7.1.3.3)
timeout (>= 0.4.0)
activerecord-import (1.6.0)
activerecord-import (1.7.0)
activerecord (>= 4.2)
activerecord-nulldb-adapter (1.0.1)
activerecord (>= 5.2.0, < 7.2)
Expand Down Expand Up @@ -341,20 +341,20 @@ GEM
activerecord (>= 4.0.0, < 7.2)
awrence (1.2.1)
aws-eventstream (1.3.0)
aws-partitions (1.929.0)
aws-partitions (1.934.0)
aws-sdk-core (3.196.1)
aws-eventstream (~> 1, >= 1.3.0)
aws-partitions (~> 1, >= 1.651.0)
aws-sigv4 (~> 1.8)
jmespath (~> 1, >= 1.6.1)
aws-sdk-kms (1.81.0)
aws-sdk-kms (1.82.0)
aws-sdk-core (~> 3, >= 3.193.0)
aws-sigv4 (~> 1.1)
aws-sdk-s3 (1.151.0)
aws-sdk-core (~> 3, >= 3.194.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.8)
aws-sdk-sns (1.74.0)
aws-sdk-sns (1.75.0)
aws-sdk-core (~> 3, >= 3.193.0)
aws-sigv4 (~> 1.1)
aws-sigv4 (1.8.0)
Expand Down Expand Up @@ -420,7 +420,7 @@ GEM
descendants_tracker (~> 0.0.1)
color_conversion (0.1.1)
colored2 (4.0.0)
commonmarker (1.0.4)
commonmarker (1.1.3)
rb_sys (~> 0.9)
compare-xml (0.66)
nokogiri (~> 1.8)
Expand Down Expand Up @@ -458,7 +458,7 @@ GEM
disposable (0.6.3)
declarative (>= 0.0.9, < 1.0.0)
representable (>= 3.1.1, < 4)
doorkeeper (5.6.9)
doorkeeper (5.7.0)
railties (>= 5)
dotenv (3.1.2)
dotenv-rails (3.1.2)
Expand Down Expand Up @@ -571,7 +571,7 @@ GEM
fugit (>= 1.1)
railties (>= 6.0.0)
thor (>= 0.14.1)
google-apis-core (0.14.1)
google-apis-core (0.15.0)
addressable (~> 2.5, >= 2.5.1)
googleauth (~> 1.9)
httpclient (>= 2.8.1, < 3.a)
Expand Down Expand Up @@ -693,7 +693,7 @@ GEM
loofah (2.22.0)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
lookbook (2.3.0)
lookbook (2.3.1)
activemodel
css_parser
htmlbeautifier (~> 1.3)
Expand All @@ -719,11 +719,11 @@ GEM
method_source (1.1.0)
mime-types (3.5.2)
mime-types-data (~> 3.2015)
mime-types-data (3.2024.0305)
mime-types-data (3.2024.0507)
mini_magick (4.12.0)
mini_mime (1.1.5)
mini_portile2 (2.8.6)
minitest (5.23.0)
minitest (5.23.1)
msgpack (1.7.2)
multi_json (1.15.0)
mustermann (3.0.0)
Expand Down Expand Up @@ -772,7 +772,7 @@ GEM
actionview
openproject-octicons (= 19.12.0)
railties
openproject-primer_view_components (0.30.1)
openproject-primer_view_components (0.31.0)
actionview (>= 5.0.0)
activesupport (>= 5.0.0)
openproject-octicons (>= 19.12.0)
Expand Down Expand Up @@ -866,7 +866,7 @@ GEM
rack (< 3)
rack-test (2.1.0)
rack (>= 1.3)
rack-timeout (0.6.3)
rack-timeout (0.7.0)
rack_session_access (0.2.0)
builder (>= 2.0.0)
rack (>= 1.0.0)
Expand Down Expand Up @@ -912,17 +912,17 @@ GEM
rainbow (3.1.1)
rake (13.2.1)
rb-fsevent (0.11.2)
rb-inotify (0.10.1)
rb-inotify (0.11.1)
ffi (~> 1.0)
rb_sys (0.9.97)
rbtree3 (0.7.1)
rdoc (6.6.3.1)
rdoc (6.7.0)
psych (>= 4.0.0)
recaptcha (5.16.0)
redcarpet (3.6.0)
redis (5.2.0)
redis-client (>= 0.22.0)
redis-client (0.22.1)
redis-client (0.22.2)
connection_pool
regexp_parser (2.9.2)
reline (0.5.7)
Expand Down Expand Up @@ -953,7 +953,7 @@ GEM
rspec-expectations (3.13.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-mocks (3.13.0)
rspec-mocks (3.13.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-rails (6.1.2)
Expand All @@ -967,7 +967,7 @@ GEM
rspec-retry (0.6.2)
rspec-core (> 3.3)
rspec-support (3.13.1)
rubocop (1.63.5)
rubocop (1.64.0)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
Expand Down Expand Up @@ -1040,8 +1040,7 @@ GEM
faraday (>= 0.17.5, < 3.a)
jwt (>= 1.5, < 3.0)
multi_json (~> 1.10)
simpleidn (0.2.2)
unf (~> 0.1.4)
simpleidn (0.2.3)
smart_properties (1.17.0)
spreadsheet (1.3.1)
bigdecimal
Expand Down Expand Up @@ -1073,7 +1072,7 @@ GEM
attr_required (>= 0.0.5)
faraday (~> 2.0)
faraday-follow_redirects
sys-filesystem (1.4.4)
sys-filesystem (1.4.5)
ffi (~> 1.1)
table_print (1.5.7)
terminal-table (3.0.2)
Expand Down Expand Up @@ -1101,9 +1100,6 @@ GEM
tzinfo-data (1.2024.1)
tzinfo (>= 1.0.0)
uber (0.1.0)
unf (0.1.4)
unf_ext
unf_ext (0.0.9.1)
unicode-display_width (2.5.0)
uri (0.13.0)
validate_email (0.1.6)
Expand Down Expand Up @@ -1162,7 +1158,7 @@ PLATFORMS
DEPENDENCIES
actionpack-xml_parser (~> 2.0.0)
activemodel-serializers-xml (~> 1.0.1)
activerecord-import (~> 1.6.0)
activerecord-import (~> 1.7.0)
activerecord-nulldb-adapter (~> 1.0.0)
activerecord-session_store (~> 2.1.0)
acts_as_list (~> 1.1.0)
Expand All @@ -1188,7 +1184,7 @@ DEPENDENCIES
climate_control
closure_tree (~> 7.4.0)
colored2
commonmarker (~> 1.0.3)
commonmarker (~> 1.1.3)
compare-xml (~> 0.66)
costs!
csv (~> 3.3)
Expand All @@ -1200,7 +1196,7 @@ DEPENDENCIES
debug
deckar01-task_list (~> 2.3.1)
disposable (~> 0.6.2)
doorkeeper (~> 5.6.6)
doorkeeper (~> 5.7.0)
dotenv-rails
dry-container
email_validator (~> 2.2.3)
Expand Down Expand Up @@ -1269,7 +1265,7 @@ DEPENDENCIES
openproject-octicons (~> 19.12.0)
openproject-octicons_helper (~> 19.12.0)
openproject-openid_connect!
openproject-primer_view_components (~> 0.30.1)
openproject-primer_view_components (~> 0.31.0)
openproject-recaptcha!
openproject-reporting!
openproject-storages!
Expand Down Expand Up @@ -1298,7 +1294,7 @@ DEPENDENCIES
rack-mini-profiler
rack-protection (~> 3.2.0)
rack-test (~> 2.1.0)
rack-timeout (~> 0.6.3)
rack-timeout (~> 0.7.0)
rack_session_access
rails (~> 7.1.3)
rails-controller-testing (~> 1.0.2)
Expand Down
1 change: 1 addition & 0 deletions app/components/filters_component.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<div class="op-filters-header">
<%= render(Primer::Beta::Button.new(
scheme: :secondary,
disabled:,
data: { 'filters-target': 'filterFormToggle',
'action': 'filters#toggleDisplayFilters',
'test-selector': 'filter-component-toggle' })) do %>
Expand Down
1 change: 1 addition & 0 deletions app/components/filters_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@

class FiltersComponent < ApplicationComponent
options :query
options :disabled
options output_format: "params"

renders_many :buttons, lambda { |**system_arguments|
Expand Down
13 changes: 11 additions & 2 deletions app/components/projects/index_page_header_component.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,15 @@
"aria-label": t(:label_more),
data: { "test-selector": "project-more-dropdown-menu" }
}) do |menu|
if can_rename?
menu.with_item(
label: t('button_rename'),
href: rename_projects_query_path(query),
) do |item|
item.with_leading_visual_icon(icon: :pencil)
end
end

if gantt_portfolio_project_ids.any?
menu.with_item(
tag: :a,
Expand Down Expand Up @@ -92,15 +101,15 @@
render(Primer::OpenProject::PageHeader.new) do |header|
header.with_title(data: { 'test-selector': 'project-query-name'}) do
primer_form_with(model: query,
url: projects_queries_path,
url: @query.new_record? ? projects_queries_path : projects_query_path(@query),
scope: 'query',
data: {
controller: "params-from-query",
'application-target': "dynamic",
'params-from-query-allowed-value': '["filters", "columns", "query_id", "sortBy"]'
},
id: 'project-save-form') do |f|
render(Queries::Projects::Create.new(f))
render(Queries::Projects::Form.new(f, query:))
end
end
header.with_breadcrumbs(breadcrumb_items)
Expand Down
23 changes: 13 additions & 10 deletions app/components/projects/index_page_header_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,13 @@
class Projects::IndexPageHeaderComponent < ApplicationComponent
include OpPrimer::ComponentHelpers
include Primer::FetchOrFallbackHelper
include Menus::ProjectsHelper

attr_accessor :current_user,
:query,
:state,
:params

STATE_DEFAULT = :show
STATE_EDIT = :edit
STATE_OPTIONS = [STATE_DEFAULT, STATE_EDIT].freeze
STATE_OPTIONS = %i[show edit rename].freeze

def initialize(current_user:, query:, params:, state: :show)
super
Expand Down Expand Up @@ -75,6 +72,8 @@ def can_save_as? = may_save_as? && query.changed?

def can_save? = can_save_as? && query.persisted? && query.user == current_user

def can_rename? = may_save_as? && query.persisted? && query.user == current_user && !query.changed?

def show_state?
state == :show
end
Expand All @@ -89,17 +88,21 @@ def breadcrumb_items
def current_breadcrumb_element
return page_title if query.name.blank?

current_object = first_level_menu_items.find do |section|
section.children.any?(&:selected)
end

if current_object && current_object.header.present?
I18n.t("menus.breadcrumb.nested_element", section_header: current_object.header, title: query.name).html_safe
if current_section && current_section.header.present?
I18n.t("menus.breadcrumb.nested_element", section_header: current_section.header, title: query.name).html_safe
else
page_title
end
end

def current_section
return @current_section if defined?(@current_section)

projects_menu = Menus::Projects.new(controller_path:, params:, current_user:)

@current_section = projects_menu.first_level_menu_items.find { |section| section.children.any?(&:selected) }
end

def header_save_action(header:, message:, label:, href:, method: nil)
header.with_action_text { message }

Expand Down
7 changes: 4 additions & 3 deletions app/controllers/projects/menus_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,14 @@
# ++
module Projects
class MenusController < ApplicationController
include Menus::ProjectsHelper

# No authorize as every user (or logged in user)
# is allowed to see the menu.

def show
@sidebar_menu_items = first_level_menu_items
projects_menu = Menus::Projects.new(controller_path: params[:controller_path], params:, current_user:)

@sidebar_menu_items = projects_menu.first_level_menu_items

render layout: nil
end
end
Expand Down
Loading
Loading