Skip to content

Commit

Permalink
Merge branch 'dev' into impl/add-health-info-to-storages
Browse files Browse the repository at this point in the history
  • Loading branch information
ba1ash authored Nov 21, 2023
2 parents c169a09 + a0aa11b commit d841568
Show file tree
Hide file tree
Showing 243 changed files with 3,654 additions and 866 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/continuous-delivery.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,17 @@ jobs:
if: github.repository == 'opf/openproject'
runs-on: ubuntu-latest
steps:
- name: Trigger SaaS workflow
env:
TOKEN: ${{ secrets.OPENPROJECT_CI_TOKEN }}
REPOSITORY: opf/saas-openproject
WORKFLOW_ID: continuous-delivery-saas.yml
run: |
curl -i --fail-with-body -H"authorization: Bearer $TOKEN" \
-XPOST -H"Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/$REPOSITORY/actions/workflows/$WORKFLOW_ID/dispatches \
-d '{"ref": "${{ github.ref }}"}'
- name: Trigger Flavours workflow
env:
TOKEN: ${{ secrets.OPENPROJECT_CI_TOKEN }}
Expand Down
6 changes: 3 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ gem 'svg-graph', '~> 2.2.0'

gem 'date_validator', '~> 0.12.0'
gem 'email_validator', '~> 2.2.3'
gem 'json_schemer', '~> 2.0.0'
gem 'json_schemer', '~> 2.1.0'
gem 'ruby-duration', '~> 3.2.0'

# `config/initializers/mail_starttls_patch.rb` has also been patched to
Expand Down Expand Up @@ -329,7 +329,7 @@ end
gem 'bootsnap', '~> 1.17.0', require: false

# API gems
gem 'grape', '~> 1.8.0'
gem 'grape', '~> 2.0.0'
gem 'grape_logging', '~> 1.8.4'
gem 'roar', '~> 1.2.0'

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

gem "openproject-octicons", '~>19.7.0'
gem "openproject-octicons_helper", '~>19.7.0'
gem "openproject-primer_view_components", '~>0.13.0'
gem "openproject-primer_view_components", '~>0.16.0'
55 changes: 28 additions & 27 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ GEM
activerecord (7.0.8)
activemodel (= 7.0.8)
activesupport (= 7.0.8)
activerecord-import (1.5.0)
activerecord-import (1.5.1)
activerecord (>= 4.2)
activerecord-nulldb-adapter (1.0.1)
activerecord (>= 5.2.0, < 7.2)
Expand Down Expand Up @@ -310,16 +310,16 @@ GEM
awesome_nested_set (3.6.0)
activerecord (>= 4.0.0, < 7.2)
aws-eventstream (1.2.0)
aws-partitions (1.845.0)
aws-sdk-core (3.186.0)
aws-partitions (1.853.0)
aws-sdk-core (3.187.0)
aws-eventstream (~> 1, >= 1.0.2)
aws-partitions (~> 1, >= 1.651.0)
aws-sigv4 (~> 1.5)
jmespath (~> 1, >= 1.6.1)
aws-sdk-kms (1.72.0)
aws-sdk-core (~> 3, >= 3.184.0)
aws-sigv4 (~> 1.1)
aws-sdk-s3 (1.136.0)
aws-sdk-s3 (1.137.0)
aws-sdk-core (~> 3, >= 3.181.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.6)
Expand All @@ -340,7 +340,7 @@ GEM
ice_nine (~> 0.11.0)
thread_safe (~> 0.3, >= 0.3.1)
base64 (0.2.0)
bcrypt (3.1.19)
bcrypt (3.1.20)
better_html (2.0.2)
actionview (>= 6.0)
activesupport (>= 6.0)
Expand Down Expand Up @@ -375,7 +375,7 @@ GEM
carrierwave_direct (2.1.0)
carrierwave (>= 1.0.0)
fog-aws
cgi (0.3.6)
cgi (0.4.0)
climate_control (1.2.0)
closure_tree (7.4.0)
activerecord (>= 4.2.10)
Expand All @@ -400,7 +400,7 @@ GEM
ferrum (~> 0.14.0)
daemons (1.4.1)
dalli (3.2.6)
date (3.3.3)
date (3.3.4)
date_validator (0.12.0)
activemodel (>= 3)
activesupport (>= 3)
Expand Down Expand Up @@ -545,7 +545,7 @@ GEM
multi_json (~> 1.11)
os (>= 0.9, < 2.0)
signet (>= 0.16, < 2.a)
grape (1.8.0)
grape (2.0.0)
activesupport (>= 5)
builder
dry-types (>= 1.1)
Expand Down Expand Up @@ -579,7 +579,7 @@ GEM
ice_nine (0.11.2)
interception (0.5)
io-console (0.6.0)
irb (1.8.3)
irb (1.9.0)
rdoc
reline (>= 0.3.8)
iso8601 (0.13.0)
Expand All @@ -593,7 +593,7 @@ GEM
faraday-follow_redirects
json-schema (4.1.1)
addressable (>= 2.8)
json_schemer (2.0.0)
json_schemer (2.1.0)
hana (~> 1.3)
regexp_parser (~> 2.0)
simpleidn (~> 0.2)
Expand Down Expand Up @@ -621,7 +621,7 @@ GEM
activesupport (>= 4)
railties (>= 4)
request_store (~> 1.0)
loofah (2.21.4)
loofah (2.22.0)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
lookbook (2.1.1)
Expand Down Expand Up @@ -660,18 +660,18 @@ GEM
ruby2_keywords (~> 0.0.1)
mustermann-grape (1.0.2)
mustermann (>= 1.0.0)
net-imap (0.4.4)
net-imap (0.4.5)
date
net-protocol
net-ldap (0.18.0)
net-pop (0.1.2)
net-protocol
net-protocol (0.2.1)
net-protocol (0.2.2)
timeout
net-smtp (0.4.0)
net-protocol
nio4r (2.5.9)
nokogiri (1.15.4)
nio4r (2.6.0)
nokogiri (1.15.5)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
oj (3.16.1)
Expand All @@ -698,7 +698,7 @@ GEM
actionview
openproject-octicons (= 19.7.0)
railties
openproject-primer_view_components (0.13.1)
openproject-primer_view_components (0.16.0)
actionview (>= 5.0.0)
activesupport (>= 5.0.0)
openproject-octicons (>= 19.7.0)
Expand Down Expand Up @@ -748,7 +748,7 @@ GEM
pry (>= 0.12.0)
psych (5.1.1.1)
stringio
public_suffix (5.0.3)
public_suffix (5.0.4)
puffing-billy (4.0.0)
addressable (~> 2.5)
em-http-request (~> 1.1, >= 1.1.0)
Expand Down Expand Up @@ -837,7 +837,7 @@ GEM
redis-client (0.18.0)
connection_pool
regexp_parser (2.8.2)
reline (0.3.9)
reline (0.4.0)
io-console (~> 0.5)
representable (3.2.0)
declarative (< 0.1.0)
Expand Down Expand Up @@ -902,10 +902,11 @@ GEM
rubocop-performance (1.19.1)
rubocop (>= 1.7.0, < 2.0)
rubocop-ast (>= 0.4.0)
rubocop-rails (2.22.1)
rubocop-rails (2.22.2)
activesupport (>= 4.2.0)
rack (>= 1.1)
rubocop (>= 1.33.0, < 2.0)
rubocop-ast (>= 1.30.0, < 2.0)
rubocop-rspec (2.25.0)
rubocop (~> 1.40)
rubocop-capybara (~> 2.17)
Expand Down Expand Up @@ -947,7 +948,7 @@ GEM
smart_properties (1.17.0)
spreadsheet (1.3.0)
ruby-ole
spring (4.1.1)
spring (4.1.2)
spring-commands-rspec (1.0.4)
spring (>= 0.9.1)
spring-commands-rubocop (0.4.0)
Expand All @@ -964,7 +965,7 @@ GEM
store_attribute (1.1.1)
activerecord (>= 6.0)
stringex (2.8.6)
stringio (3.0.8)
stringio (3.0.9)
structured_warnings (0.4.0)
svg-graph (2.2.2)
swd (2.0.2)
Expand All @@ -980,7 +981,7 @@ GEM
thor (1.3.0)
thread_safe (0.3.6)
timecop (0.9.8)
timeout (0.4.0)
timeout (0.4.1)
trailblazer-option (0.1.2)
ttfunk (1.7.0)
turbo-rails (1.5.0)
Expand All @@ -996,7 +997,7 @@ GEM
uber (0.1.0)
unf (0.1.4)
unf_ext
unf_ext (0.0.8.2)
unf_ext (0.0.9.1)
unicode-display_width (2.5.0)
validate_email (0.1.6)
activemodel (>= 3.0)
Expand Down Expand Up @@ -1100,13 +1101,13 @@ DEPENDENCIES
gon (~> 6.4.0)
google-apis-gmail_v1
googleauth
grape (~> 1.8.0)
grape (~> 2.0.0)
grape_logging (~> 1.8.4)
grids!
html-pipeline (~> 2.14.0)
htmldiff
i18n-js (~> 4.2.3)
json_schemer (~> 2.0.0)
json_schemer (~> 2.1.0)
json_spec (~> 1.1.4)
ladle
launchy (~> 2.5.0)
Expand Down Expand Up @@ -1145,7 +1146,7 @@ DEPENDENCIES
openproject-octicons (~> 19.7.0)
openproject-octicons_helper (~> 19.7.0)
openproject-openid_connect!
openproject-primer_view_components (~> 0.13.0)
openproject-primer_view_components (~> 0.16.0)
openproject-recaptcha!
openproject-reporting!
openproject-storages!
Expand Down Expand Up @@ -1235,4 +1236,4 @@ RUBY VERSION
ruby 3.2.1p31

BUNDLED WITH
2.4.6
2.4.7
1 change: 1 addition & 0 deletions app/components/_index.sass
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
@import "work_packages/share/modal_body_component"
@import "work_packages/share/invite_user_form_component"
Original file line number Diff line number Diff line change
@@ -1,24 +1,48 @@
<%=
component_wrapper do
component_wrapper(data: { controller: "user-limit",
'user-limit-open-seats-value': OpenProject::Enterprise.open_seats_count,
'application-target': "dynamic" }) do
if sharing_manageable?
primer_form_with(
model: new_share,
url: work_package_shares_path(@work_package)
) do |form|
flex_layout do |new_user_row|
new_user_row.with_column(flex: :auto, mr: 2) do
grid_layout('invite-user-form',
tag: :div,
data: { 'user-limit-target': 'inviteUserForm' }) do |invite_form|
invite_form.with_area('invitee') do
render(WorkPackages::Share::Invitee.new(form))
end

new_user_row.with_column(mr: 2) do
invite_form.with_area('permission') do
render(WorkPackages::Share::PermissionButtonComponent.new(share: new_share,
form_arguments: { builder: form, name: "role_id" },
data: { 'test-selector': 'op-share-wp-invite-role' }))
end

new_user_row.with_column do
invite_form.with_area('submit') do
render(Primer::Beta::Button.new(scheme: :primary, type: :submit)) { I18n.t('work_package.sharing.share') }
end

if OpenProject::Enterprise.user_limit.present?
invite_form.with_area('userLimit',
data: {
'user-limit-target': 'limitWarning',
'test-selector': 'op-share-wp-user-limit'
},
display: :none) do
flex_layout do |user_limit_row|
user_limit_row.with_column(mr: 2) do
render(Primer::Beta::Octicon.new(icon: :'alert-fill', color: :danger))
end

user_limit_row.with_column do
render(Primer::Beta::Text.new(color: :danger)) { I18n.t("work_package.sharing.warning_user_limit_reached#{'_admin' if User.current.admin?}",
upgrade_url: OpenProject::Enterprise.upgrade_url).html_safe }
end
end
end
end
end
end
else
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.invite-user-form
display: grid
grid-template-columns: 1fr auto auto
grid-template-areas: "invitee permission submit" "userLimit userLimit userLimit"
grid-column-gap: 0.5rem
10 changes: 5 additions & 5 deletions app/components/work_packages/share/modal_body_component.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
controller: 'work-packages--share--bulk-selection',
application_target: 'dynamic' }) do
border_box_with_id(insert_target_modifier_id) do |border_box|
border_box.with_header(color: :subtle, data: { 'test-selector': 'op-share-wp-header' }) do
border_box.with_header(color: :muted, data: { 'test-selector': 'op-share-wp-header' }) do
grid_layout('op-share-wp-modal-body--header', tag: :div, align_items: :center) do |header_grid|
header_grid.with_area(:counter, tag: :div) do
render(WorkPackages::Share::CounterComponent.new(work_package: @work_package, count: @shares.size))
Expand All @@ -38,9 +38,9 @@
header_actions.with_column(mr: 2) do
render(Primer::Alpha::ActionMenu.new(anchor_align: :end,
select_variant: :single,
color: :subtle,
color: :muted,
data: { 'test-selector': 'op-share-wp-filter-type' })) do |menu|
menu.with_show_button(scheme: :invisible, color: :subtle) do |button|
menu.with_show_button(scheme: :invisible, color: :muted) do |button|
button.with_trailing_action_icon(icon: "triangle-down")
I18n.t('work_package.sharing.filter.type')
end
Expand All @@ -58,9 +58,9 @@
header_actions.with_column do
render(Primer::Alpha::ActionMenu.new(anchor_align: :end,
select_variant: :single,
color: :subtle,
color: :muted,
data: { 'test-selector': 'op-share-wp-filter-role' })) do |menu|
menu.with_show_button(scheme: :invisible, color: :subtle) do |button|
menu.with_show_button(scheme: :invisible, color: :muted) do |button|
button.with_trailing_action_icon(icon: "triangle-down")
I18n.t('work_package.sharing.filter.role')
end
Expand Down
14 changes: 10 additions & 4 deletions app/controllers/concerns/accounts/user_limits.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,16 @@ def show_user_limit_error!
end

def user_limit_warning
warning = I18n.t(
:warning_user_limit_reached,
upgrade_url: OpenProject::Enterprise.upgrade_url
)
warning = if current_user.admin?
I18n.t(
:warning_user_limit_reached_admin,
upgrade_url: OpenProject::Enterprise.upgrade_url
)
else
I18n.t(
:warning_user_limit_reached
)
end

warning.html_safe
end
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/oauth_clients_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def callback
end
end

def ensure_access
def ensure_connection
client_id = params.fetch(:oauth_client_id)
storage_id = params.fetch(:storage_id)
oauth_client = OAuthClient.find_by(client_id:, integration_id: storage_id)
Expand Down
1 change: 1 addition & 0 deletions app/forms/work_packages/share/invitee.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class Invitee < ApplicationForm
name: :user_id,
label: I18n.t('work_package.sharing.label_search'),
visually_hide_label: true,
data: { 'work-packages--share--user-limit-target': 'autocompleter' },
autocomplete_options: {
id: "op-share-wp-invite-autocomplete",
placeholder: I18n.t('work_package.sharing.label_search_placeholder'),
Expand Down
Loading

0 comments on commit d841568

Please sign in to comment.