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 #239

Merged
merged 190 commits into from
Jun 18, 2024
Merged
Changes from all commits
Commits
Show all changes
190 commits
Select commit Hold shift + click to select a range
14da063
Enable dark mode in personal settings
HDinger Mar 14, 2024
afb7a98
Enable dark mode in personal settings
HDinger Mar 14, 2024
b303f48
Extract sidebar and header styles from the generic primer overrides a…
HDinger Mar 22, 2024
3110b69
Use more variables instead of hexcodes in order to be dark mode compa…
HDinger Mar 22, 2024
91439c1
merge origin/feature/36233-openproject-dark-mode-mvp to feature/36233…
bsatarnejad Apr 24, 2024
4ec3e50
replace deprecated Primer variables with their new names
bsatarnejad Apr 24, 2024
f9c1446
merge dev into feature/36233-openproject-dark-mode-mvp
bsatarnejad Apr 24, 2024
d2f756b
fix errors
bsatarnejad Apr 24, 2024
bd9a8dd
fix font color for primary buttons
bsatarnejad Apr 24, 2024
f8ef12a
add a feature flag for dark mode
bsatarnejad Apr 24, 2024
f04cb2d
Merge branch dev into feature/36233-openproject-dark-mode-mvp
bsatarnejad Jun 3, 2024
7ee5aac
fix primary button color and spot modal colors
bsatarnejad Jun 4, 2024
8f25eb1
fix hover color in wp table
bsatarnejad Jun 4, 2024
62e18d7
fix background color of toolbar in details view and background color…
bsatarnejad Jun 4, 2024
89f6918
use primer var for selected row in wp table
bsatarnejad Jun 4, 2024
1a14096
fix colors in drop down
bsatarnejad Jun 4, 2024
256f122
set correct style for widget boxes
bsatarnejad Jun 4, 2024
0ab2670
fix color value for widget title
bsatarnejad Jun 4, 2024
dc29baf
change background of modal
bsatarnejad Jun 4, 2024
023a764
remove background color for file selection
bsatarnejad Jun 4, 2024
b2b4b83
Merge branch dev into feature/36233-openproject-dark-mode-mvp
bsatarnejad Jun 5, 2024
4c44ef4
change the background color of dropdown
bsatarnejad Jun 5, 2024
4e74d4d
remove value for timeline header in gantt
bsatarnejad Jun 5, 2024
21dd69c
set correct color for full calendar
bsatarnejad Jun 5, 2024
83f2b3e
fix font color in full calendar
bsatarnejad Jun 5, 2024
6d928cb
change background of tooltips
bsatarnejad Jun 5, 2024
3cbf9da
fix hover color for global search box
bsatarnejad Jun 6, 2024
abdfa2c
fix background color for draggable item in configure view modal
bsatarnejad Jun 6, 2024
d30c3da
fix background color for expanded input of global search box
bsatarnejad Jun 6, 2024
003dfdc
fix background and border colors for toasts
bsatarnejad Jun 6, 2024
5d04c61
fix colors for pagination buttons
bsatarnejad Jun 6, 2024
56ac018
fix colors of activity tab and project selection in WP page
bsatarnejad Jun 6, 2024
c8a31de
change color of secondary button and link
bsatarnejad Jun 6, 2024
8744bed
fix color of text in activity module, header of calendar
bsatarnejad Jun 6, 2024
0000818
Merge branch 'dev' into feature/36233-openproject-dark-mode-mvp
bsatarnejad Jun 10, 2024
cdf55bb
fix colors in baseline modal
bsatarnejad Jun 10, 2024
9fb5615
Merge remote-tracking branch 'origin/feature/36233-openproject-dark-m…
bsatarnejad Jun 10, 2024
b89535a
fix color of tile title
bsatarnejad Jun 10, 2024
28887a2
fix colors on task board
bsatarnejad Jun 11, 2024
417f820
fix colors in notification center
bsatarnejad Jun 11, 2024
7f0d181
Get rid of manual html_safe calls in reporting
oliverguenther May 21, 2024
7eb9d17
Remove remnants of debug_fields
oliverguenther May 21, 2024
69eb2dd
change date picker styles
bsatarnejad Jun 11, 2024
2d7b9db
fix info banner in op modal
bsatarnejad Jun 11, 2024
2436143
fix color of search icon in project selection list
bsatarnejad Jun 11, 2024
88d2505
fix hover color for footer of ng-select
bsatarnejad Jun 11, 2024
cde2307
Merge branch 'dev' into feature/36233-openproject-dark-mode-mvp
bsatarnejad Jun 11, 2024
7b2af2e
remove some deprecated variables
bsatarnejad Jun 11, 2024
ee17ac1
Merge remote-tracking branch 'origin/feature/36233-openproject-dark-m…
bsatarnejad Jun 11, 2024
09ca8bf
Update README.md
MayaBerd Jun 11, 2024
9a6088e
fix hover effect colors for ng-select
bsatarnejad Jun 11, 2024
f232be5
fix link color
bsatarnejad Jun 11, 2024
f06c507
remove unused variable for button border
bsatarnejad Jun 12, 2024
30bb505
fix dropdwon colors in ck editor
bsatarnejad Jun 12, 2024
213dd16
fix background color of buttons in textarea
bsatarnejad Jun 12, 2024
874b64e
Update README.md
MayaBerd Jun 12, 2024
8683d1d
fix background color of code block
bsatarnejad Jun 12, 2024
24b2557
fix background color of macros in cd editor
bsatarnejad Jun 13, 2024
30fb737
change background and border color of labels on gantt
bsatarnejad Jun 13, 2024
e9effa4
fix colors of hovering over a disabled field on WP page
bsatarnejad Jun 13, 2024
775ef4b
fix link color mapping
bsatarnejad Jun 13, 2024
6b7a9e2
fix backgrouund color in multi select
bsatarnejad Jun 13, 2024
95a130e
fix badge color
bsatarnejad Jun 13, 2024
9d0ed50
fix color for active switch button
bsatarnejad Jun 13, 2024
ce57c66
fix adding dark mode to select options
bsatarnejad Jun 13, 2024
b77acd4
force to use primer variable for our primary buttons in high-contasr …
bsatarnejad Jun 13, 2024
1ce1882
remove an unused variable for task board
bsatarnejad Jun 13, 2024
1aa9fa0
Merge branch 'dev' into feature/36233-openproject-dark-mode-mvp
bsatarnejad Jun 13, 2024
2c155f9
[#55523] Add Dialog not mobile friendly: don't center align on mobile
judithroth Jun 13, 2024
d9c3723
revert using primer variable for toasts
bsatarnejad Jun 13, 2024
52b21eb
Ensure appsignal logger receives a string
oliverguenther Jun 13, 2024
72410a4
update locales from crowdin [ci skip]
openprojectci Jun 14, 2024
ad0cb5c
Bump lefthook from 1.6.15 to 1.6.16
dependabot[bot] Jun 14, 2024
5cdf34e
Bump aws-sdk-s3 from 1.152.2 to 1.152.3
dependabot[bot] Jun 14, 2024
91e666e
Bump nokogiri from 1.16.5 to 1.16.6
dependabot[bot] Jun 14, 2024
991ec7f
Merge pull request #15852 from opf/fix/appsignal-logger-string
machisuji Jun 14, 2024
c9f3017
Screenshots + section progress reporting
corinnaguenther Jun 14, 2024
8225087
sections about project attributes
corinnaguenther Jun 14, 2024
62e4d53
sections on renaming lists and redundant mails
corinnaguenther Jun 14, 2024
63abbeb
section on meetings
corinnaguenther Jun 14, 2024
a7a9d2d
update release date + fixed heading contributions
corinnaguenther Jun 14, 2024
1a42149
screenshot for warning banner
corinnaguenther Jun 14, 2024
4bfac0e
section on PDF export
corinnaguenther Jun 14, 2024
8827c0c
fixed link?
corinnaguenther Jun 14, 2024
47978ef
[#55529] fixed interface of file info query
Kharonus Jun 14, 2024
a81bf87
[#55529] fixed one drive unit test
Kharonus Jun 14, 2024
5d296a1
feat[#55504] Allow pagination options to be passed in Projects::Table…
akabiru Jun 13, 2024
cb26afa
fix[#55504] Changing page size/page after removing a project from an …
akabiru Jun 14, 2024
74fd3f8
Replace colors with responding primer variables
HDinger Jun 14, 2024
85daf2c
Merge pull request #15859 from opf/bug/55529-special-characters-in-am…
dominic-braeunlein Jun 14, 2024
d18d52d
[#55523] Add Dialog not mobile friendly: don't center align on mobile…
judithroth Jun 14, 2024
1cd7494
Replace some more hardcoded hex colors with correct Primer variables
HDinger Jun 14, 2024
9996ce5
Enforce lighter variants of "primary button" and "accent" color in da…
HDinger Jun 14, 2024
21da4fe
update locales from crowdin [ci skip]
openprojectci Jun 15, 2024
651c056
Bug/55505 Reinstate listing archived projects in project attributes "…
akabiru Jun 15, 2024
4cabf00
[#55488] 14.2 Documentation: Configure which projects are activated f…
MayaBerd Jun 16, 2024
b63910a
update locales from crowdin [ci skip]
openprojectci Jun 17, 2024
f345795
update locales from crowdin [ci skip]
openprojectci Jun 17, 2024
9e4453e
Merge branch 'dev' into merge-release/14.2-20240617033449
dombesz Jun 17, 2024
d9f1413
Merge pull request #15868 from opf/merge-release/14.2-20240617033449
dombesz Jun 17, 2024
07b5ac7
Merge pull request #15858 from opf/dependabot/bundler/dev/nokogiri-1.…
klaustopher Jun 17, 2024
9cf3139
Merge pull request #15856 from opf/dependabot/bundler/dev/lefthook-1.…
klaustopher Jun 17, 2024
5e31ea9
Merge pull request #15857 from opf/dependabot/bundler/dev/aws-sdk-s3-…
klaustopher Jun 17, 2024
9c7805f
Merge pull request #15632 from opf/chore/reporting-html-safety
dombesz Jun 17, 2024
8e7cad4
Archvied projects are no longer visible for non-admins
klaustopher Jun 17, 2024
65c522a
Merge pull request #15869 from opf/fix-persisted-lists-spec
klaustopher Jun 17, 2024
74b3b8c
Allow membership on ProjectQuery
klaustopher May 22, 2024
4fe3a63
Derive entity name from model name, not from the string
klaustopher May 22, 2024
444da61
Add permissions for ProjectQuery
klaustopher May 22, 2024
ea3355e
Refactor user permissible service to allow non-project scoped entity …
klaustopher May 22, 2024
557bd91
Add a TODO
klaustopher May 22, 2024
008a959
Reflect on EntityClass, not Entity
klaustopher May 27, 2024
07b2ab5
Add translations for new permissions
klaustopher May 27, 2024
5cde745
Introduce ProjectQueryRole
klaustopher May 27, 2024
9f1a02f
Add ProejctQueryRole as needed
klaustopher May 27, 2024
301c5b0
Fix Rubocop
klaustopher May 28, 2024
191ab3b
Fix tests regarding seeders
klaustopher May 28, 2024
4a8390e
Fix specs for permission check methods
klaustopher May 28, 2024
2dd6c57
Extract a HasMembers concern
klaustopher May 28, 2024
109ac5e
Fix project_role? method
klaustopher May 28, 2024
73613f2
Remove caching of `latest_project_activity`
klaustopher May 28, 2024
3ea640f
Re-enable caching after merging Jens' fix
klaustopher May 28, 2024
3f27aa3
Add checks for the `allowed_in_any_entity?` for non project-scoped en…
klaustopher May 29, 2024
0c62c05
Introduce allowed_to scope
klaustopher Jun 4, 2024
c202048
Put conditions into join
klaustopher Jun 4, 2024
7db1368
Fix rubocop
klaustopher Jun 4, 2024
6aad6c7
Change query based on permission
klaustopher Jun 6, 2024
7c5d5e8
Add project query stuff to permission mocker
klaustopher Jun 6, 2024
47ce22c
Add methods for access to queries
klaustopher Jun 6, 2024
665656f
Undo unneeded fixes
klaustopher Jun 6, 2024
dc7002c
Add specs for project query allowed scope
klaustopher Jun 6, 2024
3f2b399
Merge pull request #15851 from opf/bug/55523-add-dialog-not-mobile-fr…
judithroth Jun 17, 2024
f34144b
Update README.md
corinnaguenther Jun 17, 2024
9d94a02
[#55506] Adjust modal header sizes to match mockup
judithroth Jun 14, 2024
48a02f4
PDF export screenshot
corinnaguenther Jun 17, 2024
634c73d
Merge pull request #15860 from opf/bug/55504-changing-page-sizepage-a…
ba1ash Jun 17, 2024
1944e9b
Merge pull request #15861 from opf/bug/55506-visual-glitches-on-modal…
judithroth Jun 17, 2024
7890c64
[#55487] 14.2 Documentation: Progress reporting changes https://comm…
MayaBerd Jun 17, 2024
d0aeb53
use primer variable for toasts
bsatarnejad Jun 17, 2024
7062286
[#55483] Project custom field of type link not listed in project sett…
dombesz Jun 10, 2024
e028ef1
Merge pull request #15805 from opf/bug/55483-project-custom-field-of-…
dombesz Jun 17, 2024
c066ca2
Glossary update for 14.2 (#15870)
corinnaguenther Jun 17, 2024
f46eb3e
Merge pull request #15817 from opf/14-2-release-notes-update
oliverguenther Jun 17, 2024
d0b602a
Bump eslint-plugin-jasmine from 4.1.3 to 4.2.0 in /frontend
dependabot[bot] Jun 17, 2024
9681d4e
use primer variable for header and sidebar colors
bsatarnejad Jun 17, 2024
e09921c
Merge pull request #15855 from opf/dependabot/npm_and_yarn/frontend/d…
klaustopher Jun 17, 2024
0dac789
[chore] Add regression tests for storage folders
Kharonus Jun 17, 2024
0b783ff
Merge branch 'dev' into feature/36233-openproject-dark-mode-mvp
bsatarnejad Jun 17, 2024
5a826e5
Replace custom icon solution of gitlab tab with Octicons
HDinger Jun 17, 2024
a6b449c
[#55621] Presenter field on agenda item becomes tiny if the current p…
mrmir Jun 17, 2024
3bba924
Bump appsignal to allow exception logger
oliverguenther Jun 17, 2024
8461369
Merge remote-tracking branch 'origin/release/14.2' into dev
oliverguenther Jun 17, 2024
230b204
Adds 403 handling to OneDrive commands/queries
mereghost Jun 17, 2024
ecbeac5
Change colors for date picker and side bar
bsatarnejad Jun 17, 2024
cd4f434
Merge remote-tracking branch 'origin/feature/36233-openproject-dark-m…
bsatarnejad Jun 17, 2024
6aa096a
[chore] fixed remains of trashed property
Kharonus Jun 17, 2024
9ef6bea
update locales from crowdin [ci skip]
openprojectci Jun 18, 2024
658304d
update locales from crowdin [ci skip]
openprojectci Jun 18, 2024
fbdb61b
Merge branch 'release/14.2' into dev
openprojectci Jun 18, 2024
db5ecc1
Bump @typescript-eslint/eslint-plugin from 7.13.0 to 7.13.1 in /frontend
dependabot[bot] Jun 18, 2024
583072d
Bump @typescript-eslint/parser from 7.13.0 to 7.13.1 in /frontend
dependabot[bot] Jun 18, 2024
c0ea643
Bump rubocop-performance from 1.21.0 to 1.21.1
dependabot[bot] Jun 18, 2024
b1062d8
Bump timecop from 0.9.9 to 0.9.10
dependabot[bot] Jun 18, 2024
2327a86
Merge pull request #15880 from opf/dependabot/bundler/dev/rubocop-per…
klaustopher Jun 18, 2024
d4dd3f3
Update docs/system-admin-guide/projects/project-attributes/README.md
dominic-braeunlein Jun 18, 2024
040511c
Merge branch 'release/14.2' into task/55488-142-documentation-configu…
dominic-braeunlein Jun 18, 2024
bb8e503
Merge pull request #15866 from opf/task/55488-142-documentation-confi…
dominic-braeunlein Jun 18, 2024
62dc5d6
Merge pull request #15881 from opf/dependabot/bundler/dev/timecop-0.9.10
klaustopher Jun 18, 2024
ea93c0b
Merge pull request #15878 from opf/dependabot/npm_and_yarn/frontend/d…
klaustopher Jun 18, 2024
937248c
Merge pull request #15879 from opf/dependabot/npm_and_yarn/frontend/d…
klaustopher Jun 18, 2024
67624aa
Remove formatter for appsignal logger
oliverguenther Jun 18, 2024
eedbb8c
Adapt board shadows and loading indicator to match in dark mode
HDinger Jun 18, 2024
c084dd4
Use primer variables in home screen teaser block
HDinger Jun 18, 2024
412c200
Instrumentation of view components for appsignal
oliverguenther Jun 17, 2024
fac0131
Merge pull request #15366 from opf/feature/36233-openproject-dark-mod…
HDinger Jun 18, 2024
7ce5e8f
Ignore getComputedStyle and chunk error on appsignal
oliverguenther Jun 18, 2024
37fb756
Add correct join for sorting by latest project activity
klaustopher Jun 18, 2024
ad59f3d
Use JOIN sources instead of manually copying
klaustopher Jun 18, 2024
93464c9
Also properly load joins for storage size on sort
klaustopher Jun 18, 2024
5f0b3f4
Properly name `work_package_storage_sql` method
klaustopher Jun 18, 2024
2397b3f
Fix specs
klaustopher Jun 18, 2024
cda0286
Extend the base layout to split into content-header, content-body, an…
HDinger Jun 13, 2024
bb8328f
update sponsors (#15884)
corinnaguenther Jun 18, 2024
bbc7da2
Merge pull request #15871 from opf/maint/403s-for-all
mereghost Jun 18, 2024
e145379
Merge pull request #15883 from opf/fix-sorting-by-latest-activity
oliverguenther Jun 18, 2024
863d640
Merge remote-tracking branch 'origin/release/14.2' into dev
oliverguenther Jun 18, 2024
040fa72
Merge pull request #15644 from opf/rework-membership-on-global-entities
klaustopher Jun 18, 2024
d291d72
Fix the height for the IFC viewer page. Otherwise the xeokit viewer w…
HDinger Jun 18, 2024
2d0993f
Merge pull request #15873 from opf/chore/add-regression-test-for-fold…
Kharonus Jun 18, 2024
3dae20d
Merge pull request #15849 from opf/implementation/55640-provide-rails…
oliverguenther Jun 18, 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
6 changes: 3 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -215,7 +215,7 @@ gem "dry-container"
gem "store_attribute", "~> 1.0"

# Appsignal integration
gem "appsignal", "~> 3.0", require: false
gem "appsignal", "~> 3.8.1", require: false

gem "view_component"
# Lookbook
@@ -388,6 +388,6 @@ gemfiles.each do |file|
send(:eval_gemfile, file) if File.readable?(file)
end

gem "openproject-octicons", "~>19.14.0"
gem "openproject-octicons_helper", "~>19.14.0"
gem "openproject-octicons", "~>19.14.1"
gem "openproject-octicons_helper", "~>19.14.1"
gem "openproject-primer_view_components", "~>0.34.0"
28 changes: 14 additions & 14 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -331,7 +331,7 @@ GEM
airbrake-ruby (6.2.2)
rbtree3 (~> 0.6)
android_key_attestation (0.3.0)
appsignal (3.7.6)
appsignal (3.8.1)
rack
ast (2.4.2)
attr_required (1.0.2)
@@ -347,10 +347,10 @@ GEM
aws-partitions (~> 1, >= 1.651.0)
aws-sigv4 (~> 1.8)
jmespath (~> 1, >= 1.6.1)
aws-sdk-kms (1.83.0)
aws-sdk-kms (1.84.0)
aws-sdk-core (~> 3, >= 3.197.0)
aws-sigv4 (~> 1.1)
aws-sdk-s3 (1.152.2)
aws-sdk-s3 (1.152.3)
aws-sdk-core (~> 3, >= 3.197.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.8)
@@ -670,7 +670,7 @@ GEM
launchy (3.0.1)
addressable (~> 2.8)
childprocess (~> 5.0)
lefthook (1.6.15)
lefthook (1.6.16)
letter_opener (1.10.0)
launchy (>= 2.2, < 4)
letter_opener_web (3.0.0)
@@ -744,7 +744,7 @@ GEM
net-smtp (0.5.0)
net-protocol
nio4r (2.7.3)
nokogiri (1.16.5)
nokogiri (1.16.6)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
oj (3.16.4)
@@ -767,10 +767,10 @@ GEM
validate_email
validate_url
webfinger (~> 2.0)
openproject-octicons (19.14.0)
openproject-octicons_helper (19.14.0)
openproject-octicons (19.14.1)
openproject-octicons_helper (19.14.1)
actionview
openproject-octicons (= 19.14.0)
openproject-octicons (= 19.14.1)
railties
openproject-primer_view_components (0.34.0)
actionview (>= 5.0.0)
@@ -790,7 +790,7 @@ GEM
parallel (1.25.1)
parallel_tests (4.7.1)
parallel
parser (3.3.2.0)
parser (3.3.3.0)
ast (~> 2.4.1)
racc
pdf-core (0.9.0)
@@ -984,7 +984,7 @@ GEM
rubocop (~> 1.41)
rubocop-factory_bot (2.26.1)
rubocop (~> 1.61)
rubocop-performance (1.21.0)
rubocop-performance (1.21.1)
rubocop (>= 1.48.1, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
rubocop-rails (2.25.0)
@@ -1075,7 +1075,7 @@ GEM
text-hyphen (1.5.0)
thor (1.3.1)
thread_safe (0.3.6)
timecop (0.9.9)
timecop (0.9.10)
timeout (0.4.1)
tpm-key_attestation (0.12.0)
bindata (~> 2.4)
@@ -1159,7 +1159,7 @@ DEPENDENCIES
acts_as_tree (~> 2.9.0)
addressable (~> 2.8.0)
airbrake (~> 13.0.0)
appsignal (~> 3.0)
appsignal (~> 3.8.1)
auto_strip_attributes (~> 2.5)
awesome_nested_set (~> 3.6.0)
aws-sdk-core (~> 3.107)
@@ -1257,8 +1257,8 @@ DEPENDENCIES
openproject-job_status!
openproject-ldap_groups!
openproject-meeting!
openproject-octicons (~> 19.14.0)
openproject-octicons_helper (~> 19.14.0)
openproject-octicons (~> 19.14.1)
openproject-octicons_helper (~> 19.14.1)
openproject-openid_connect!
openproject-primer_view_components (~> 0.34.0)
openproject-recaptcha!
2 changes: 1 addition & 1 deletion app/components/projects/table_component.html.erb
Original file line number Diff line number Diff line change
@@ -104,5 +104,5 @@ See COPYRIGHT and LICENSE files for more details.
</div>

<% if paginated? %>
<%= helpers.pagination_links_full model, allowed_params: %i[query_id filters columns sortBy] %>
<%= helpers.pagination_links_full model, pagination_options %>
<% end %>
18 changes: 15 additions & 3 deletions app/components/projects/table_component.rb
Original file line number Diff line number Diff line change
@@ -34,8 +34,8 @@ class TableComponent < ::TableComponent
options :current_user # adds this option to those of the base class
options :query

def initialize(**options)
super(rows: [], **options)
def initialize(**)
super(rows: [], **)
end

def before_render
@@ -52,7 +52,7 @@ def table_id
end

def container_class
"generic-table--container_visible-overflow"
"generic-table--container_visible-overflow generic-table--container_height-100"
end

##
@@ -82,6 +82,18 @@ def paginated?
true
end

def pagination_options
default_pagination_options.merge(optional_pagination_options)
end

def default_pagination_options
{ allowed_params: %i[query_id filters columns sortBy] }
end

def optional_pagination_options
{}
end

def deactivate_class_on_lft_sort
if sorted_by_lft?
"spot-link_inactive"
Original file line number Diff line number Diff line change
@@ -15,7 +15,8 @@

dialog.with_header(
show_divider: false,
visually_hide_title: false
visually_hide_title: false,
variant: :large
)

primer_form_with(
Original file line number Diff line number Diff line change
@@ -43,14 +43,15 @@ def more_menu_items
private

def more_menu_detach_project
if User.current.admin
project = model.first
if User.current.admin && project.active?
{
scheme: :default,
icon: nil,
label: I18n.t("projects.settings.project_custom_fields.actions.deactivate_for_project"),
href: unlink_admin_settings_project_custom_field_path(
id: @table.params[:custom_field].id,
project_custom_field_project_mapping: { project_id: model.first.id }
project_custom_field_project_mapping: { project_id: project.id }
),
data: { turbo_method: :delete }
}
Original file line number Diff line number Diff line change
@@ -39,6 +39,23 @@ 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
11 changes: 9 additions & 2 deletions app/contracts/roles/base_contract.rb
Original file line number Diff line number Diff line change
@@ -33,10 +33,13 @@ class BaseContract < ::ModelContract
validate :check_permission_prerequisites

def assignable_permissions(keep_public: false)
if model.is_a?(GlobalRole)
case model
when GlobalRole
assignable_global_permissions
elsif model.is_a?(WorkPackageRole)
when WorkPackageRole
assignable_work_package_permissions
when ProjectQueryRole
assignable_project_query_permissions
else
assignable_member_permissions
end.reject do |permission|
@@ -54,6 +57,10 @@ def assignable_work_package_permissions
OpenProject::AccessControl.work_package_permissions
end

def assignable_project_query_permissions
OpenProject::AccessControl.project_query_permissions
end

def assignable_member_permissions
permissions_to_remove = case model.builtin
when Role::BUILTIN_NON_MEMBER
Original file line number Diff line number Diff line change
@@ -79,7 +79,7 @@ def link
include_sub_projects: include_sub_projects?)
.call

create_service.on_success { render_project_list }
create_service.on_success { render_project_list(url_for_action: :project_mappings) }

create_service.on_failure do
update_flash_message_via_turbo_stream(
@@ -96,7 +96,7 @@ def unlink
.new(user: current_user, model: @project_custom_field_mapping)
.call

delete_service.on_success { render_project_list }
delete_service.on_success { render_project_list(url_for_action: :project_mappings) }

delete_service.on_failure do
update_flash_message_via_turbo_stream(
@@ -147,7 +147,7 @@ def destroy

private

def render_project_list
def render_project_list(url_for_action: action_name)
update_via_turbo_stream(
component: Settings::ProjectCustomFields::ProjectCustomFieldMapping::NewProjectMappingComponent.new(
project_mapping: ProjectCustomFieldProjectMapping.new(project_custom_field: @custom_field),
@@ -157,7 +157,7 @@ def render_project_list
update_via_turbo_stream(
component: Settings::ProjectCustomFields::ProjectCustomFieldMapping::TableComponent.new(
query: project_custom_field_mappings_query,
params: { custom_field: @custom_field }
params: { custom_field: @custom_field, url_for_action: }
)
)
end
@@ -167,7 +167,6 @@ def project_custom_field_mappings_query
name: "project-custom-field-mappings-#{@custom_field.id}"
) do |query|
query.where(:available_project_attributes, "=", [@custom_field.id])
query.where("active", "=", OpenProject::Database::DB_VALUE_TRUE)
query.select(:name)
query.order("lft" => "asc")
end
4 changes: 3 additions & 1 deletion app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
@@ -278,10 +278,12 @@ def all_lang_options_for_select
end

def theme_options_for_select
[
options = [
[t("themes.light"), "light"],
[t("themes.light_high_contrast"), "light_high_contrast"]
]
options.push([t("themes.dark"), "dark"]) if OpenProject::FeatureDecisions.dark_mode_active?
options
end

def user_theme_data_attributes
36 changes: 36 additions & 0 deletions app/models/concerns/has_members.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# --copyright
# OpenProject is an open source project management software.
# Copyright (C) 2010-2022 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 HasMembers
extend ActiveSupport::Concern

included do
has_many :members, as: :entity, dependent: :destroy
has_many :member_principals, through: :members, class_name: "Principal", source: :principal
end
end
5 changes: 3 additions & 2 deletions app/models/member.rb
Original file line number Diff line number Diff line change
@@ -30,7 +30,8 @@ class Member < ApplicationRecord
include ::Scopes::Scoped

ALLOWED_ENTITIES = [
"WorkPackage"
"WorkPackage",
"Queries::Projects::ProjectQuery"
].freeze

extend DeprecatedAlias
@@ -85,7 +86,7 @@ def some_roles_deletable?
end

def project_role?
entity_id.nil?
entity_id.nil? && project_id.present?
end

def deletable_role?(role)
41 changes: 41 additions & 0 deletions app/models/project_query_role.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# frozen_string_literal: true

#
#-- copyright
# OpenProject is an open source project management software.
# Copyright (C) 2012-2024 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.
#++

class ProjectQueryRole < Role
def self.givable
super
.where(type: "ProjectQueryRole")
end

def member?
true
end
end
Loading
Oops, something went wrong.
Loading
Oops, something went wrong.