diff --git a/.dockerignore b/.dockerignore index a8ba0c44986..abe0a0be0be 100644 --- a/.dockerignore +++ b/.dockerignore @@ -22,11 +22,18 @@ browserslist !/docs/api/apiv3/tags !/docs/api/apiv3/components +# Ignore spec/** folders +spec/** +# Allow factories in case we use lookbook +!spec/factories +!spec/factories/** +!spec/support +!spec/support/** + extra features help log/*.log -spec /tmp frontend/.angular/cache frontend/node_modules diff --git a/.env.example b/.env.example index 0192ff3ca85..c31d0776cd6 100644 --- a/.env.example +++ b/.env.example @@ -1,6 +1,6 @@ #-- copyright # OpenProject is an open source project management software. -# Copyright (C) 2012-2020 the OpenProject GmbH +# 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. diff --git a/.env.test.local.example b/.env.test.local.example index 4c2682c3b12..4c6076b4ae0 100644 --- a/.env.test.local.example +++ b/.env.test.local.example @@ -1,6 +1,6 @@ #-- copyright # OpenProject is an open source project management software. -# Copyright (C) 2012-2020 the OpenProject GmbH +# 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. diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index 74ffad708a4..73c621a03c0 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -1,14 +1,12 @@ # .git-blame-ignore-revs -# lint with rubocop --autocorrect (safe cops only) -48a4f1b6adb1e847a90a61f2ab277f28bcd77608 -# Update copyright information for 2023 -21a696ef9b170e14ad2daf53364a4c2113822c2f -# Update copyright information for 2024 -c795874f7f281297bbd3bad2fdb58b24cb4ce624 # rubocop autocorrections +48a4f1b6adb1e847a90a61f2ab277f28bcd77608 f3c99ee5dded81ad55f2b6f3706216d5fa765677 5c72ea0046a6b5230bf456f55a296ed6fd579535 9e4934cd0a468f46d8f0fc0f11ebc2d4216f789c 6678cab48d443b5782fa93b171d62093819ee4fc fa5d03eae00bc8931f99598a74ffd76e0cbca3da b10e6d718cc49e3574837d97fab268e3ecb3fcbd +# accidental merge +7787e457a37d8d1ef5b6d0c2e326bdc42338ac7b +3b2121f7333f0ce7f3515b29c760c0580c31a245 diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 45cd46cc80a..a3cf31fc013 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -21,3 +21,9 @@ updates: target-branch: "dev" open-pull-requests-limit: 3 versioning-strategy: lockfile-only + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" + target-branch: "dev" + open-pull-requests-limit: 3 diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 00000000000..e945cf1b8c7 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,23 @@ +# Ticket + + + + + + +# What are you trying to accomplish? + + +## Screenshots + + +# What approach did you choose and why? + + +# Merge checklist + +- [ ] Added/updated tests +- [ ] Added/updated documentation in Lookbook (patterns, previews, etc) +- [ ] Tested major browsers (Chrome, Firefox, Edge, ...) diff --git a/.github/workflows/brakeman-scan-core.yml b/.github/workflows/brakeman-scan-core.yml index 3160d431daf..216690b7705 100644 --- a/.github/workflows/brakeman-scan-core.yml +++ b/.github/workflows/brakeman-scan-core.yml @@ -25,7 +25,7 @@ jobs: RUBY_GC_HEAP_INIT_SLOTS: 100000 steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup Ruby uses: ruby/setup-ruby@v1 @@ -44,6 +44,6 @@ jobs: --output output.sarif.json - name: Upload SARIF - uses: github/codeql-action/upload-sarif@v2 + uses: github/codeql-action/upload-sarif@v3 with: sarif_file: output.sarif.json diff --git a/.github/workflows/crowdin.yml b/.github/workflows/crowdin.yml index 3aed630b858..bfc94d1d796 100644 --- a/.github/workflows/crowdin.yml +++ b/.github/workflows/crowdin.yml @@ -41,7 +41,7 @@ jobs: - dev - "${{ needs.setup.outputs.latest_release_branch }}" steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: ref: ${{ matrix.branch }} fetch-depth: 1 @@ -65,7 +65,7 @@ jobs: bundle exec script/i18n/generate_seeders_i18n_source_file fi - name: "Crowdin: upload sources and download translations" - uses: crowdin/github-action@v1 + uses: crowdin/github-action@v2 with: # Upload current source files upload_sources: true diff --git a/.github/workflows/danger.yml b/.github/workflows/danger.yml index 841d0c523ac..eab13d3a371 100644 --- a/.github/workflows/danger.yml +++ b/.github/workflows/danger.yml @@ -17,8 +17,8 @@ jobs: - uses: actions/checkout@v4 - uses: ruby/setup-ruby@v1 with: - ruby-version: '3.3.3' - - uses: MeilCli/danger-action@v5 + ruby-version: '3.3.4' + - uses: MeilCli/danger-action@v6 with: danger_file: 'Dangerfile' danger_id: 'danger-pr' diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index b0a0d0f7d91..3db90e894c3 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -85,10 +85,11 @@ jobs: ./docker/prod/setup/precompile-assets.sh # public/assets will be saved as artifact, so temporarily copying config file there as well cp config/frontend_assets.manifest.json public/assets/frontend_assets.manifest.json - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: path: public/ name: public-assets-${{ github.sha }} + overwrite: true outputs: version: ${{ steps.extract_version.outputs.version }} checkout_ref: ${{ steps.extract_version.outputs.checkout_ref }} @@ -106,22 +107,27 @@ jobs: matrix: include: - platform: linux/amd64 + digest: amd64-slim bim_support: true target: slim runner: runner=4cpu-linux-x64 - platform: linux/arm64/v8 + digest: arm64-slim bim_support: false target: slim runner: runner=4cpu-linux-arm64 - platform: linux/amd64 + digest: amd64-aio bim_support: true target: all-in-one runner: runner=4cpu-linux-x64 - platform: linux/arm64/v8 + digest: arm64-aio bim_support: false target: all-in-one runner: runner=4cpu-linux-arm64 - platform: linux/ppc64le + digest: ppc-aio bim_support: false target: all-in-one runner: runner=4cpu-linux-x64 @@ -134,7 +140,7 @@ jobs: run: | cp ./docker/prod/Dockerfile ./Dockerfile - name: Download precompiled public assets - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: public-assets-${{ github.sha }} path: public/ @@ -164,7 +170,7 @@ jobs: password: ${{ secrets.DOCKER_PASSWORD }} - name: Docker meta id: meta - uses: docker/metadata-action@v4 + uses: docker/metadata-action@v5 with: context: git labels: | @@ -177,7 +183,7 @@ jobs: ${{ env.REGISTRY_IMAGE }} - name: Build image id: build - uses: docker/build-push-action@v4 + uses: docker/build-push-action@v6 with: context: . platforms: ${{ matrix.platform }} @@ -209,7 +215,7 @@ jobs: wget -O- --retry-on-http-error=503,502 --retry-connrefused http://localhost:8080/api/v3 - name: Push image id: push - uses: docker/build-push-action@v4 + uses: docker/build-push-action@v6 with: context: . platforms: ${{ matrix.platform }} @@ -226,9 +232,9 @@ jobs: digest="${{ steps.push.outputs.digest }}" touch "/tmp/digests/${digest#sha256:}" - name: Upload digest - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: - name: digests-${{ matrix.target }} + name: digests-${{ matrix.target }}-${{ matrix.digest }} path: /tmp/digests/* if-no-files-found: error retention-days: 1 @@ -241,10 +247,16 @@ jobs: - setup - build steps: - - name: Download digests - uses: actions/download-artifact@v3 + - name: Merge digests + uses: actions/upload-artifact/merge@v4 with: - name: digests-${{ matrix.target }} + pattern: "digests-${{ matrix.target }}-*" + overwrite: true + name: "merged-digests-${{ matrix.target }}-${{ github.run_number }}-${{ github.run_attempt }}" + - name: Download digests + uses: actions/download-artifact@v4 + with: + name: "merged-digests-${{ matrix.target }}-${{ github.run_number }}-${{ github.run_attempt }}" path: /tmp/digests - name: Set suffix id: set_suffix @@ -256,7 +268,7 @@ jobs: uses: docker/setup-buildx-action@v3 - name: Docker meta id: meta - uses: docker/metadata-action@v4 + uses: docker/metadata-action@v5 with: images: ${{ env.REGISTRY_IMAGE }} labels: | diff --git a/.github/workflows/eslint-core.yml b/.github/workflows/eslint-core.yml index 4e4ede7f0a2..9c24db41635 100644 --- a/.github/workflows/eslint-core.yml +++ b/.github/workflows/eslint-core.yml @@ -14,10 +14,10 @@ jobs: name: eslint runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: node-version: '18.13' cache: npm diff --git a/.github/workflows/i18n-tasks.yml b/.github/workflows/i18n-tasks.yml new file mode 100644 index 00000000000..fdc79ac2324 --- /dev/null +++ b/.github/workflows/i18n-tasks.yml @@ -0,0 +1,44 @@ +name: i18n-inconsistency-check + +on: + push: + branches: + - dev + - release/* + paths-ignore: + - 'docs/**' + - 'help/**' + pull_request: + types: [opened, reopened, synchronize] + paths-ignore: + - 'docs/**' + - 'help/**' + - 'packaging/**' + - '.pkgr.yml' + +permissions: + contents: read + +jobs: + i18n-tasks: + permissions: + contents: read + if: github.repository == 'opf/openproject' + name: I18n inconsistency check + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Ruby + uses: ruby/setup-ruby@v1 + + - name: Setup i18n-tasks + run: | + gem install i18n-tasks + + - name: Run inconsistent translations check + run: | + i18n-tasks \ + check-consistent-interpolations \ + --config config/i18n-tasks-all-files.yml diff --git a/.github/workflows/openapi.yaml b/.github/workflows/openapi.yaml index 8ff68ce878c..459376056b5 100644 --- a/.github/workflows/openapi.yaml +++ b/.github/workflows/openapi.yaml @@ -18,11 +18,11 @@ jobs: if: github.repository == 'opf/openproject' runs-on: [ubuntu-latest] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: ruby/setup-ruby@v1 with: bundler-cache: true - - uses: actions/setup-node@v2 + - uses: actions/setup-node@v4 with: node-version: '20' - run: ./script/api/validate_spec diff --git a/.github/workflows/pullpreview.yml b/.github/workflows/pullpreview.yml index ac546b1ff3f..ce7f0ba31dc 100644 --- a/.github/workflows/pullpreview.yml +++ b/.github/workflows/pullpreview.yml @@ -24,7 +24,7 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 60 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Generate .env.pullpreview file run: | echo "OPENPROJECT_SEED_ADMIN_USER_PASSWORD_RESET=false" >> .env.pullpreview diff --git a/.github/workflows/rubocop-core.yml b/.github/workflows/rubocop-core.yml index 1cec9bf1086..ecd47277ae6 100644 --- a/.github/workflows/rubocop-core.yml +++ b/.github/workflows/rubocop-core.yml @@ -9,10 +9,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Fetch head commit of base branch - run: git fetch --depth 1 origin ${{ github.event.pull_request.base.sha }} - uses: ruby/setup-ruby@v1 - - uses: opf/action-rubocop@master + - uses: reviewdog/action-rubocop@v2 with: github_token: ${{ secrets.github_token }} rubocop_version: gemfile diff --git a/.github/workflows/test-core.yml b/.github/workflows/test-core.yml index e5b9afcf86e..30d3d658d32 100644 --- a/.github/workflows/test-core.yml +++ b/.github/workflows/test-core.yml @@ -27,6 +27,7 @@ jobs: labels: - runs-on - runner=32cpu-linux-x64 + - family=m7 - run-id=${{ github.run_id }} timeout-minutes: 40 env: diff --git a/.github/workflows/version-check.yml b/.github/workflows/version-check.yml new file mode 100644 index 00000000000..0405fd47f94 --- /dev/null +++ b/.github/workflows/version-check.yml @@ -0,0 +1,47 @@ +name: Check work package version + +on: + pull_request: + types: [labeled, synchronize] + +permissions: + contents: read # to fetch code (actions/checkout) + pull-requests: write # to comment on the PR + +jobs: + check-pr: + if: contains(github.event.pull_request.labels.*.name, 'needs review') + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + + - name: Verify linked version matches core version + id: version-check + run: ./script/ci/version_check.sh "${{ github.event.pull_request.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: + + - 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' + uses: marocchino/sticky-pull-request-comment@v2 + with: + header: version-mismatch-comment + delete: true diff --git a/.gitignore b/.gitignore index f258caa4173..0a27bf8e565 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ #-- copyright # OpenProject is an open source project management software. -# Copyright (C) 2012-2022 the OpenProject GmbH +# 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. diff --git a/.pkgr.yml b/.pkgr.yml index ac00306c834..62354658845 100644 --- a/.pkgr.yml +++ b/.pkgr.yml @@ -49,7 +49,7 @@ wizards: - https://github.com/pkgr/addon-legacy-installer.git - ./packaging/addons/openproject-edition - https://github.com/pkgr/addon-postgres - - https://github.com/pkgr/addon-apache2.git + - https://github.com/pkgr/addon-apache2.git#set-host-header - ./packaging/addons/repositories - https://github.com/pkgr/addon-memcached.git - ./packaging/addons/openproject diff --git a/.rubocop.yml b/.rubocop.yml index 799e8c4def8..821c3902e52 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -143,7 +143,7 @@ Naming/VariableNumber: AllowedPatterns: - '\w_20\d\d' # allow dates like christmas_2022 or date_2034_04_12 - '\w\d++(_\d++)+' # allow hierarchical data like child1_2_5 (second + in regex is possessive qualifier) - + - 'custom_field_\d+' # allow custom field method names to be called with send :custom_field_1001 # There are valid cases in which to use methods like: # * update_all # * touch_all @@ -208,6 +208,17 @@ Rails/DynamicFindBy: - 'spec/features/**/*.rb' - 'spec/support/**/*.rb' - 'modules/*/spec/features/**/*.rb' + Whitelist: + - find_by_login + +# Allow reorder to prevent find each cop triggering +Rails/FindEach: + AllowedMethods: + - order + - reorder + - limit + - select + - lock # We have config.active_record.belongs_to_required_by_default = false , # which means, we do have to declare presence validators on belongs_to relations. @@ -236,6 +247,8 @@ RSpec/DescribeMethod: # Don't force the second argument of describe # to match the exact file name RSpec/SpecFilePathFormat: + CustomTransform: + OAuthClients: oauth_clients IgnoreMethods: true # Prevent "fit" or similar to be committed @@ -459,3 +472,10 @@ Style/HashTransformValues: Performance/Casecmp: Enabled: false + +OpenProject/AddPreviewForViewComponent: + Include: + - app/components/op_turbo/**.rb + - app/components/op_primer/**.rb + - app/components/open_project/**.rb + - app/components/concerns/**.rb diff --git a/.ruby-version b/.ruby-version index 619b5376684..a0891f563f3 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.3.3 +3.3.4 diff --git a/COPYRIGHT_short b/COPYRIGHT_short index f6628456eb3..d4773d9e476 100644 --- a/COPYRIGHT_short +++ b/COPYRIGHT_short @@ -1,5 +1,5 @@ OpenProject is an open source project management software. -Copyright (C) 2012-2024 the OpenProject GmbH +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. diff --git a/Gemfile b/Gemfile index 60f1c7aefff..46aa10862b5 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,6 @@ #-- copyright # OpenProject is an open source project management software. -# Copyright (C) 2012-2024 the OpenProject GmbH +# 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. @@ -61,9 +61,9 @@ gem "friendly_id", "~> 5.5.0" gem "acts_as_list", "~> 1.2.0" gem "acts_as_tree", "~> 2.9.0" -gem "awesome_nested_set", "~> 3.6.0" +gem "awesome_nested_set", "~> 3.7.0" gem "closure_tree", "~> 7.4.0" -gem "rubytree", "~> 2.0.0" +gem "rubytree", "~> 2.1.0" # Only used in down migrations now. # Is to be removed once the referencing migrations have been squashed. gem "typed_dag", "~> 2.0.2", require: false @@ -158,14 +158,14 @@ gem "structured_warnings", "~> 0.4.0" gem "airbrake", "~> 13.0.0", require: false gem "markly", "~> 0.10" # another markdown parser like commonmarker, but with AST support used in PDF export -gem "md_to_pdf", git: "https://github.com/opf/md-to-pdf", ref: "32603f09a249999a00e8ca23eb17215b46a26c0f" +gem "md_to_pdf", git: "https://github.com/opf/md-to-pdf", ref: "fe05b4f8bae8fd46f4fa93b8e0adee6295ef7388" gem "prawn", "~> 2.4" gem "ttfunk", "~> 1.7.0" # remove after https://github.com/prawnpdf/prawn/issues/1346 resolved. # prawn implicitly depends on matrix gem no longer in ruby core with 3.1 gem "matrix", "~> 0.4.2" -gem "meta-tags", "~> 2.21.0" +gem "meta-tags", "~> 2.22.0" gem "paper_trail", "~> 15.1.0" @@ -204,29 +204,32 @@ gem "plaintext", "~> 0.3.2" gem "ruby-progressbar", "~> 1.13.0", require: false -gem "mini_magick", "~> 4.13.0", require: false +gem "mini_magick", "~> 5.0.1", require: false gem "validate_url" # Storages support code +gem "dry-auto_inject" gem "dry-container" gem "dry-monads" +gem "dry-validation" # ActiveRecord extension which adds typecasting to store accessors gem "store_attribute", "~> 1.0" # Appsignal integration -gem "appsignal", "~> 3.8.1", require: false +gem "appsignal", "~> 3.10.0", require: false gem "view_component" # Lookbook gem "lookbook", "~> 2.3.0" # Require factory_bot for usage with openproject plugins testing -gem "factory_bot", "~> 6.4.0", require: false +gem "factory_bot", "~> 6.5.0", require: false # require factory_bot_rails for convenience in core development gem "factory_bot_rails", "~> 6.4.0", require: false +gem "turbo_power", "~> 0.6.2" gem "turbo-rails", "~> 2.0.0" gem "httpx" @@ -238,13 +241,13 @@ group :test do # Test prof provides factories from code # and other niceties - gem "test-prof", "~> 1.3.0" + gem "test-prof", "~> 1.4.0" gem "turbo_tests", github: "opf/turbo_tests", ref: "with-patches" gem "rack_session_access" gem "rspec", "~> 3.13.0" # also add to development group, so 'spec' rake task gets loaded - gem "rspec-rails", "~> 6.1.0", group: :development + gem "rspec-rails", "~> 7.0.0", group: :development # Retry failures within the same environment gem "retriable", "~> 3.1.1" @@ -272,7 +275,7 @@ group :test do gem "selenium-devtools" gem "selenium-webdriver", "~> 4.20" - gem "fuubar", "~> 2.5.0" + gem "fuubar", "~> 2.5.0", require: false gem "timecop", "~> 0.9.0" # Record your test suite's HTTP interactions and replay them during future test runs for fast, deterministic, accurate tests. @@ -319,6 +322,9 @@ group :development, :test do gem "ruby-prof", require: false gem "stackprof", require: false + # Output a stack trace anytime, useful when a process is stuck + gem "rbtrace" + # REPL with debug commands gem "debug" @@ -342,10 +348,10 @@ group :development, :test do gem "erblint-github", require: false # Brakeman scanner - gem "brakeman", "~> 6.1.0" + gem "brakeman", "~> 6.2.0" # i18n-tasks helps find and manage missing and unused translations. - gem "i18n-tasks", "~> 1.0.13" + gem "i18n-tasks", "~> 1.0.13", require: false end gem "bootsnap", "~> 1.18.0", require: false @@ -390,6 +396,6 @@ gemfiles.each do |file| send(:eval_gemfile, file) if File.readable?(file) end -gem "openproject-octicons", "~>19.15.0" -gem "openproject-octicons_helper", "~>19.15.0" -gem "openproject-primer_view_components", "~>0.36.0" +gem "openproject-octicons", "~>19.18.0" +gem "openproject-octicons_helper", "~>19.18.0" +gem "openproject-primer_view_components", "~>0.47.0" diff --git a/Gemfile.lock b/Gemfile.lock index 9effb3a5492..d2790851f0a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -8,10 +8,10 @@ GIT GIT remote: https://github.com/opf/md-to-pdf - revision: 32603f09a249999a00e8ca23eb17215b46a26c0f - ref: 32603f09a249999a00e8ca23eb17215b46a26c0f + revision: fe05b4f8bae8fd46f4fa93b8e0adee6295ef7388 + ref: fe05b4f8bae8fd46f4fa93b8e0adee6295ef7388 specs: - md_to_pdf (0.1.1) + md_to_pdf (0.1.2) color_conversion (~> 0.1) front_matter_parser (~> 1.0) json-schema (~> 4.3) @@ -206,7 +206,7 @@ PATH remote: modules/two_factor_authentication specs: openproject-two_factor_authentication (1.0.0) - aws-sdk-sns (~> 1.77.0) + aws-sdk-sns (~> 1.82.0) messagebird-rest (~> 1.4.2) rotp (~> 6.1) webauthn (~> 3.0) @@ -226,35 +226,35 @@ GEM remote: https://rubygems.org/ specs: Ascii85 (1.1.1) - actioncable (7.1.3.4) - actionpack (= 7.1.3.4) - activesupport (= 7.1.3.4) + actioncable (7.1.4) + actionpack (= 7.1.4) + activesupport (= 7.1.4) nio4r (~> 2.0) websocket-driver (>= 0.6.1) zeitwerk (~> 2.6) - actionmailbox (7.1.3.4) - actionpack (= 7.1.3.4) - activejob (= 7.1.3.4) - activerecord (= 7.1.3.4) - activestorage (= 7.1.3.4) - activesupport (= 7.1.3.4) + actionmailbox (7.1.4) + actionpack (= 7.1.4) + activejob (= 7.1.4) + activerecord (= 7.1.4) + activestorage (= 7.1.4) + activesupport (= 7.1.4) mail (>= 2.7.1) net-imap net-pop net-smtp - actionmailer (7.1.3.4) - actionpack (= 7.1.3.4) - actionview (= 7.1.3.4) - activejob (= 7.1.3.4) - activesupport (= 7.1.3.4) + actionmailer (7.1.4) + actionpack (= 7.1.4) + actionview (= 7.1.4) + activejob (= 7.1.4) + activesupport (= 7.1.4) mail (~> 2.5, >= 2.5.4) net-imap net-pop net-smtp rails-dom-testing (~> 2.2) - actionpack (7.1.3.4) - actionview (= 7.1.3.4) - activesupport (= 7.1.3.4) + actionpack (7.1.4) + actionview (= 7.1.4) + activesupport (= 7.1.4) nokogiri (>= 1.8.5) racc rack (>= 2.2.4) @@ -265,31 +265,31 @@ GEM actionpack-xml_parser (2.0.1) actionpack (>= 5.0) railties (>= 5.0) - actiontext (7.1.3.4) - actionpack (= 7.1.3.4) - activerecord (= 7.1.3.4) - activestorage (= 7.1.3.4) - activesupport (= 7.1.3.4) + actiontext (7.1.4) + actionpack (= 7.1.4) + activerecord (= 7.1.4) + activestorage (= 7.1.4) + activesupport (= 7.1.4) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (7.1.3.4) - activesupport (= 7.1.3.4) + actionview (7.1.4) + activesupport (= 7.1.4) builder (~> 3.1) erubi (~> 1.11) rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) - activejob (7.1.3.4) - activesupport (= 7.1.3.4) + activejob (7.1.4) + activesupport (= 7.1.4) globalid (>= 0.3.6) - activemodel (7.1.3.4) - activesupport (= 7.1.3.4) + activemodel (7.1.4) + activesupport (= 7.1.4) activemodel-serializers-xml (1.0.2) activemodel (> 5.x) activesupport (> 5.x) builder (~> 3.1) - activerecord (7.1.3.4) - activemodel (= 7.1.3.4) - activesupport (= 7.1.3.4) + activerecord (7.1.4) + activemodel (= 7.1.4) + activesupport (= 7.1.4) timeout (>= 0.4.0) activerecord-import (1.7.0) activerecord (>= 4.2) @@ -302,13 +302,13 @@ GEM multi_json (~> 1.11, >= 1.11.2) rack (>= 2.0.8, < 4) railties (>= 6.1) - activestorage (7.1.3.4) - actionpack (= 7.1.3.4) - activejob (= 7.1.3.4) - activerecord (= 7.1.3.4) - activesupport (= 7.1.3.4) + activestorage (7.1.4) + actionpack (= 7.1.4) + activejob (= 7.1.4) + activerecord (= 7.1.4) + activesupport (= 7.1.4) marcel (~> 1.0) - activesupport (7.1.3.4) + activesupport (7.1.4) base64 bigdecimal concurrent-ruby (~> 1.0, >= 1.0.2) @@ -318,7 +318,7 @@ GEM minitest (>= 5.1) mutex_m tzinfo (~> 2.0) - acts_as_list (1.2.1) + acts_as_list (1.2.2) activerecord (>= 6.1) activesupport (>= 6.1) acts_as_tree (2.9.1) @@ -332,39 +332,39 @@ GEM airbrake-ruby (6.2.2) rbtree3 (~> 0.6) android_key_attestation (0.3.0) - appsignal (3.8.1) + appsignal (3.10.0) rack ast (2.4.2) attr_required (1.0.2) auto_strip_attributes (2.6.0) activerecord (>= 4.0) - awesome_nested_set (3.6.0) - activerecord (>= 4.0.0, < 7.2) + awesome_nested_set (3.7.0) + activerecord (>= 4.0.0, < 8.0) awrence (1.2.1) aws-eventstream (1.3.0) - aws-partitions (1.950.0) - aws-sdk-core (3.201.0) + aws-partitions (1.974.0) + aws-sdk-core (3.205.0) aws-eventstream (~> 1, >= 1.3.0) aws-partitions (~> 1, >= 1.651.0) - aws-sigv4 (~> 1.8) + aws-sigv4 (~> 1.9) jmespath (~> 1, >= 1.6.1) - aws-sdk-kms (1.88.0) - aws-sdk-core (~> 3, >= 3.201.0) + aws-sdk-kms (1.91.0) + aws-sdk-core (~> 3, >= 3.205.0) aws-sigv4 (~> 1.5) - aws-sdk-s3 (1.156.0) - aws-sdk-core (~> 3, >= 3.201.0) + aws-sdk-s3 (1.162.0) + aws-sdk-core (~> 3, >= 3.205.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.5) - aws-sdk-sns (1.77.0) - aws-sdk-core (~> 3, >= 3.197.0) - aws-sigv4 (~> 1.1) - aws-sigv4 (1.8.0) + aws-sdk-sns (1.82.0) + aws-sdk-core (~> 3, >= 3.201.0) + aws-sigv4 (~> 1.5) + aws-sigv4 (1.9.1) aws-eventstream (~> 1, >= 1.0.2) - axe-core-api (4.9.1) + axe-core-api (4.10.0) dumb_delegator virtus - axe-core-rspec (4.9.1) - axe-core-api (= 4.9.1) + axe-core-rspec (4.10.0) + axe-core-api (= 4.10.0) dumb_delegator virtus axiom-types (0.1.1) @@ -382,9 +382,9 @@ GEM smart_properties bigdecimal (3.1.8) bindata (2.5.0) - bootsnap (1.18.3) + bootsnap (1.18.4) msgpack (~> 1.2) - brakeman (6.1.2) + brakeman (6.2.1) racc browser (6.0.0) builder (3.3.0) @@ -411,7 +411,8 @@ GEM fog-aws cbor (0.5.9.8) cgi (0.4.1) - childprocess (5.0.0) + childprocess (5.1.0) + logger (~> 1.5) climate_control (1.2.0) closure_tree (7.4.0) activerecord (>= 4.2.10) @@ -419,16 +420,16 @@ GEM coderay (1.1.3) coercible (1.0.0) descendants_tracker (~> 0.0.1) - color_conversion (0.1.1) + color_conversion (0.1.2) colored2 (4.0.0) - commonmarker (1.1.4) + commonmarker (1.1.5) rb_sys (~> 0.9) compare-xml (0.66) nokogiri (~> 1.8) - concurrent-ruby (1.3.3) + concurrent-ruby (1.3.4) connection_pool (2.4.1) cookiejar (0.3.4) - cose (1.3.0) + cose (1.3.1) cbor (~> 0.5.9) openssl-signature_algorithm (~> 1.0) crack (1.0.0) @@ -466,12 +467,19 @@ GEM dotenv (= 3.1.2) railties (>= 6.1) drb (2.2.1) + dry-auto_inject (1.0.1) + dry-core (~> 1.0) + zeitwerk (~> 2.6) + dry-configurable (1.2.0) + dry-core (~> 1.0, < 2) + zeitwerk (~> 2.6) dry-container (0.11.0) concurrent-ruby (~> 1.0) dry-core (1.0.1) concurrent-ruby (~> 1.0) zeitwerk (~> 2.6) - dry-inflector (1.0.0) + dry-inflector (1.1.0) + dry-initializer (3.1.1) dry-logic (1.5.0) concurrent-ruby (~> 1.0) dry-core (~> 1.0, < 2) @@ -480,6 +488,14 @@ GEM concurrent-ruby (~> 1.0) dry-core (~> 1.0, < 2) zeitwerk (~> 2.6) + dry-schema (1.13.4) + concurrent-ruby (~> 1.0) + dry-configurable (~> 1.0, >= 1.0.1) + dry-core (~> 1.0, < 2) + dry-initializer (~> 3.0) + dry-logic (>= 1.4, < 2) + dry-types (>= 1.7, < 2) + zeitwerk (~> 2.6) dry-types (1.7.2) bigdecimal (~> 3.0) concurrent-ruby (~> 1.0) @@ -487,6 +503,12 @@ GEM dry-inflector (~> 1.0) dry-logic (~> 1.4) zeitwerk (~> 2.6) + dry-validation (1.10.0) + concurrent-ruby (~> 1.0) + dry-core (~> 1.0, < 2) + dry-initializer (~> 3.0) + dry-schema (>= 1.12, < 2) + zeitwerk (~> 2.6) dumb_delegator (1.0.0) em-http-request (1.1.7) addressable (>= 2.3.4) @@ -494,7 +516,8 @@ GEM em-socksify (>= 0.3) eventmachine (>= 1.0.3) http_parser.rb (>= 0.6.0) - em-socksify (0.3.2) + em-socksify (0.3.3) + base64 eventmachine (>= 1.0.0.beta.4) em-synchrony (1.0.6) eventmachine (>= 1.0.0.beta.1) @@ -502,12 +525,12 @@ GEM activemodel equivalent-xml (0.6.0) nokogiri (>= 1.4.3) - erb_lint (0.5.0) + erb_lint (0.6.0) activesupport better_html (>= 2.0.1) parser (>= 2.7.1.4) rainbow - rubocop + rubocop (>= 1) smart_properties erblint-github (1.0.1) erubi (1.13.0) @@ -516,17 +539,18 @@ GEM tzinfo eventmachine (1.2.7) eventmachine_httpserver (0.2.1) - excon (0.110.0) - factory_bot (6.4.6) + excon (0.111.0) + factory_bot (6.5.0) activesupport (>= 5.0.0) factory_bot_rails (6.4.3) factory_bot (~> 6.4) railties (>= 5.0.0) - faraday (2.9.2) + faraday (2.10.1) faraday-net_http (>= 2.0, < 3.2) + logger faraday-follow_redirects (0.3.0) faraday (>= 1, < 3) - faraday-net_http (3.1.0) + faraday-net_http (3.1.1) net-http fastimage (2.3.1) ferrum (0.15) @@ -536,11 +560,12 @@ GEM websocket-driver (~> 0.7) ffi (1.17.0) flamegraph (0.9.5) - fog-aws (3.23.0) + fog-aws (3.27.0) + base64 (~> 0.2.0) fog-core (~> 2.1) fog-json (~> 1.1) fog-xml (~> 0.1) - fog-core (2.4.0) + fog-core (2.5.0) builder excon (~> 0.71) formatador (>= 0.2, < 2.0) @@ -555,7 +580,7 @@ GEM friendly_id (5.5.1) activerecord (>= 4.0.0) front_matter_parser (1.0.1) - fugit (1.11.0) + fugit (1.11.1) et-orbi (~> 1, >= 1.2.11) raabro (~> 1.4) fuubar (2.5.1) @@ -576,14 +601,14 @@ GEM fugit (>= 1.1) railties (>= 6.0.0) thor (>= 0.14.1) - google-apis-core (0.15.0) + google-apis-core (0.15.1) addressable (~> 2.5, >= 2.5.1) googleauth (~> 1.9) - httpclient (>= 2.8.1, < 3.a) + httpclient (>= 2.8.3, < 3.a) mini_mime (~> 1.0) + mutex_m representable (~> 3.0) retriable (>= 2.0, < 4.a) - rexml google-apis-gmail_v1 (0.41.0) google-apis-core (>= 0.15.0, < 2.a) google-cloud-env (2.1.1) @@ -595,7 +620,7 @@ GEM multi_json (~> 1.11) os (>= 0.9, < 2.0) signet (>= 0.16, < 2.a) - grape (2.1.2) + grape (2.1.3) activesupport (>= 6) dry-types (>= 1.1) mustermann-grape (~> 1.1.0) @@ -606,21 +631,22 @@ GEM rack gravatar_image_tag (1.2.0) hana (1.3.7) - hashdiff (1.1.0) + hashdiff (1.1.1) hashery (2.1.2) hashie (3.6.0) - highline (3.0.1) + highline (3.1.1) + reline html-pipeline (2.14.3) activesupport (>= 2) nokogiri (>= 1.4) htmlbeautifier (1.4.3) htmldiff (0.0.1) htmlentities (4.3.4) - http-2-next (1.0.3) + http-2 (1.0.1) http_parser.rb (0.6.0) httpclient (2.8.3) - httpx (1.2.6) - http-2-next (>= 1.0.3) + httpx (1.3.1) + http-2 (>= 1.0.0) i18n (1.14.5) concurrent-ruby (~> 1.0) i18n-js (4.2.3) @@ -636,13 +662,13 @@ GEM rails-i18n rainbow (>= 2.2.2, < 4.0) terminal-table (>= 1.5.1) - icalendar (2.10.1) + icalendar (2.10.2) ice_cube (~> 0.16) - ice_cube (0.16.4) + ice_cube (0.17.0) ice_nine (0.11.2) interception (0.5) io-console (0.7.2) - irb (1.13.2) + irb (1.14.0) rdoc (>= 4.0.0) reline (>= 0.4.2) iso8601 (0.13.0) @@ -655,7 +681,7 @@ GEM bindata faraday (~> 2.0) faraday-follow_redirects - json-schema (4.3.0) + json-schema (4.3.1) addressable (>= 2.8) json_schemer (2.3.0) bigdecimal @@ -673,7 +699,7 @@ GEM launchy (3.0.1) addressable (~> 2.8) childprocess (~> 5.0) - lefthook (1.6.18) + lefthook (1.7.15) letter_opener (1.10.0) launchy (>= 2.2, < 4) letter_opener_web (3.0.0) @@ -688,7 +714,7 @@ GEM omniauth (~> 1.1) omniauth-openid-connect (>= 0.2.1) rails (>= 3.2.21) - logger (1.6.0) + logger (1.6.1) lograge (0.14.0) actionpack (>= 4) activesupport (>= 4) @@ -715,29 +741,29 @@ GEM net-pop net-smtp marcel (1.0.4) - markly (0.10.0) + markly (0.12.1) matrix (0.4.2) messagebird-rest (1.4.2) - meta-tags (2.21.0) - actionpack (>= 6.0.0, < 7.2) + meta-tags (2.22.0) + actionpack (>= 6.0.0, < 8.1) method_source (1.1.0) mime-types (3.5.2) mime-types-data (~> 3.2015) - mime-types-data (3.2024.0604) - mini_magick (4.13.1) + mime-types-data (3.2024.0903) + mini_magick (5.0.1) mini_mime (1.1.5) mini_portile2 (2.8.7) - minitest (5.24.1) + minitest (5.25.1) msgpack (1.7.2) multi_json (1.15.0) - mustermann (3.0.0) + mustermann (3.0.3) ruby2_keywords (~> 0.0.1) mustermann-grape (1.1.0) mustermann (>= 1.0.0) mutex_m (0.2.0) net-http (0.4.1) uri - net-imap (0.4.13) + net-imap (0.4.14) date net-protocol net-ldap (0.19.0) @@ -748,11 +774,12 @@ GEM net-smtp (0.5.0) net-protocol nio4r (2.7.3) - nokogiri (1.16.6) + nokogiri (1.16.7) mini_portile2 (~> 2.8.2) racc (~> 1.4) - oj (3.16.4) + oj (3.16.6) bigdecimal (>= 3.0) + ostruct (>= 0.2) okcomputer (1.18.5) omniauth-saml (1.10.3) omniauth (~> 1.3, >= 1.3.2) @@ -771,30 +798,32 @@ GEM validate_email validate_url webfinger (~> 2.0) - openproject-octicons (19.15.0) - openproject-octicons_helper (19.15.0) + openproject-octicons (19.18.0) + openproject-octicons_helper (19.18.0) actionview - openproject-octicons (= 19.15.0) + openproject-octicons (= 19.18.0) railties - openproject-primer_view_components (0.36.0) + openproject-primer_view_components (0.47.0) actionview (>= 5.0.0) activesupport (>= 5.0.0) - openproject-octicons (>= 19.15.0) + openproject-octicons (>= 19.17.0) view_component (>= 3.1, < 4.0) openproject-token (4.0.0) activemodel openssl (3.2.0) openssl-signature_algorithm (1.3.0) openssl (> 2.0) + optimist (3.1.0) os (1.1.4) + ostruct (0.6.0) ox (2.14.18) paper_trail (15.1.0) activerecord (>= 6.1) request_store (~> 1.4) - parallel (1.25.1) - parallel_tests (4.7.1) + parallel (1.26.3) + parallel_tests (4.7.2) parallel - parser (3.3.3.0) + parser (3.3.5.0) ast (~> 2.4.1) racc pdf-core (0.9.0) @@ -806,7 +835,7 @@ GEM hashery (~> 2.0) ruby-rc4 ttfunk - pg (1.5.6) + pg (1.5.8) plaintext (0.3.4) activesupport (> 2.2.1) nokogiri (~> 1.10, >= 1.10.4) @@ -832,7 +861,7 @@ GEM pry (>= 0.12.0) psych (5.1.2) stringio - public_suffix (6.0.0) + public_suffix (6.0.1) puffing-billy (4.0.0) addressable (~> 2.5) em-http-request (~> 1.1, >= 1.1.0) @@ -846,7 +875,7 @@ GEM puma-plugin-statsd (2.6.0) puma (>= 5.0, < 7) raabro (1.4.0) - racc (1.8.0) + racc (1.8.1) rack (2.2.9) rack-attack (6.7.0) rack (>= 1.0, < 4) @@ -875,20 +904,20 @@ GEM rackup (1.0.0) rack (< 3) webrick - rails (7.1.3.4) - actioncable (= 7.1.3.4) - actionmailbox (= 7.1.3.4) - actionmailer (= 7.1.3.4) - actionpack (= 7.1.3.4) - actiontext (= 7.1.3.4) - actionview (= 7.1.3.4) - activejob (= 7.1.3.4) - activemodel (= 7.1.3.4) - activerecord (= 7.1.3.4) - activestorage (= 7.1.3.4) - activesupport (= 7.1.3.4) + rails (7.1.4) + actioncable (= 7.1.4) + actionmailbox (= 7.1.4) + actionmailer (= 7.1.4) + actionpack (= 7.1.4) + actiontext (= 7.1.4) + actionview (= 7.1.4) + activejob (= 7.1.4) + activemodel (= 7.1.4) + activerecord (= 7.1.4) + activestorage (= 7.1.4) + activesupport (= 7.1.4) bundler (>= 1.15.0) - railties (= 7.1.3.4) + railties (= 7.1.4) rails-controller-testing (1.0.5) actionpack (>= 5.0.1.rc1) actionview (>= 5.0.1.rc1) @@ -903,9 +932,9 @@ GEM rails-i18n (7.0.9) i18n (>= 0.7, < 2) railties (>= 6.0.0, < 8) - railties (7.1.3.4) - actionpack (= 7.1.3.4) - activesupport (= 7.1.3.4) + railties (7.1.4) + actionpack (= 7.1.4) + activesupport (= 7.1.4) irb rackup (>= 1.0.0) rake (>= 12.2) @@ -916,7 +945,11 @@ GEM rb-fsevent (0.11.2) rb-inotify (0.11.1) ffi (~> 1.0) - rb_sys (0.9.97) + rb_sys (0.9.102) + rbtrace (0.5.1) + ffi (>= 1.0.6) + msgpack (>= 0.4.3) + optimist (>= 3.0.0) rbtree3 (0.7.1) rdoc (6.7.0) psych (>= 4.0.0) @@ -927,7 +960,7 @@ GEM redis-client (0.22.2) connection_pool regexp_parser (2.9.2) - reline (0.5.9) + reline (0.5.10) io-console (~> 0.5) representable (3.2.0) declarative (< 0.1.0) @@ -939,8 +972,7 @@ GEM actionpack (>= 5.2) railties (>= 5.2) retriable (3.1.2) - rexml (3.3.1) - strscan + rexml (3.3.7) rinku (2.0.6) roar (1.2.0) representable (~> 3.1) @@ -950,18 +982,18 @@ GEM rspec-core (~> 3.13.0) rspec-expectations (~> 3.13.0) rspec-mocks (~> 3.13.0) - rspec-core (3.13.0) + rspec-core (3.13.1) rspec-support (~> 3.13.0) - rspec-expectations (3.13.1) + rspec-expectations (3.13.3) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) rspec-mocks (3.13.1) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) - rspec-rails (6.1.3) - actionpack (>= 6.1) - activesupport (>= 6.1) - railties (>= 6.1) + rspec-rails (7.0.1) + actionpack (>= 7.0) + activesupport (>= 7.0) + railties (>= 7.0) rspec-core (~> 3.13) rspec-expectations (~> 3.13) rspec-mocks (~> 3.13) @@ -969,18 +1001,17 @@ GEM rspec-retry (0.6.2) rspec-core (> 3.3) rspec-support (3.13.1) - rubocop (1.64.1) + rubocop (1.66.1) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) - regexp_parser (>= 1.8, < 3.0) - rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.31.1, < 2.0) + regexp_parser (>= 2.4, < 3.0) + rubocop-ast (>= 1.32.2, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.31.3) + rubocop-ast (1.32.3) parser (>= 3.3.1.0) rubocop-capybara (2.21.0) rubocop (~> 1.41) @@ -988,15 +1019,15 @@ GEM rubocop (~> 1.61) rubocop-openproject (0.1.0) rubocop - rubocop-performance (1.21.1) + rubocop-performance (1.22.0) rubocop (>= 1.48.1, < 2.0) rubocop-ast (>= 1.31.1, < 2.0) - rubocop-rails (2.25.1) + rubocop-rails (2.26.1) activesupport (>= 4.2.0) rack (>= 1.1) - rubocop (>= 1.33.0, < 2.0) + rubocop (>= 1.52.0, < 2.0) rubocop-ast (>= 1.31.1, < 2.0) - rubocop-rspec (3.0.2) + rubocop-rspec (3.0.5) rubocop (~> 1.61) rubocop-rspec_rails (2.30.0) rubocop (~> 1.61) @@ -1009,22 +1040,22 @@ GEM ruby-prof (1.7.0) ruby-progressbar (1.13.0) ruby-rc4 (0.1.5) - ruby-saml (1.16.0) + ruby-saml (1.17.0) nokogiri (>= 1.13.10) rexml ruby2_keywords (0.0.5) - rubytree (2.0.3) + rubytree (2.1.0) json (~> 2.0, > 2.3.1) rubyzip (2.3.2) safety_net_attestation (0.4.0) jwt (~> 2.0) - sanitize (6.1.1) + sanitize (6.1.3) crass (~> 1.0.2) nokogiri (>= 1.12.0) secure_headers (6.5.0) - selenium-devtools (0.126.0) + selenium-devtools (0.128.0) selenium-webdriver (~> 4.2) - selenium-webdriver (4.22.0) + selenium-webdriver (4.24.0) base64 (~> 0.2) logger (~> 1.4) rexml (~> 3.2, >= 3.2.5) @@ -1032,7 +1063,7 @@ GEM websocket (~> 1.0) semantic (1.6.1) shoulda-context (2.0.0) - shoulda-matchers (6.2.0) + shoulda-matchers (6.4.0) activesupport (>= 5.2.0) signet (0.19.0) addressable (~> 2.8) @@ -1049,21 +1080,20 @@ GEM spring (>= 0.9.1) spring-commands-rubocop (0.4.0) spring (>= 1.0) - sprockets (3.7.3) + sprockets (3.7.4) base64 concurrent-ruby (~> 1.0) rack (> 1, < 3) - sprockets-rails (3.5.1) + sprockets-rails (3.5.2) actionpack (>= 6.1) activesupport (>= 6.1) sprockets (>= 3.0.0) ssrf_filter (1.0.8) stackprof (0.2.26) - store_attribute (1.2.0) - activerecord (>= 6.0) + store_attribute (1.3.0) + activerecord (>= 6.1) stringex (2.8.6) stringio (3.1.1) - strscan (3.1.0) structured_warnings (0.4.0) svg-graph (2.2.2) swd (2.0.3) @@ -1076,39 +1106,42 @@ GEM table_print (1.5.7) terminal-table (3.0.2) unicode-display_width (>= 1.1.1, < 3) - test-prof (1.3.3.1) + test-prof (1.4.2) text-hyphen (1.5.0) - thor (1.3.1) + thor (1.3.2) thread_safe (0.3.6) timecop (0.9.10) timeout (0.4.1) - tpm-key_attestation (0.12.0) + tpm-key_attestation (0.12.1) bindata (~> 2.4) openssl (> 2.0) openssl-signature_algorithm (~> 1.0) trailblazer-option (0.1.2) ttfunk (1.7.0) - turbo-rails (2.0.5) + turbo-rails (2.0.6) actionpack (>= 6.0.0) activejob (>= 6.0.0) railties (>= 6.0.0) + turbo_power (0.6.2) + turbo-rails (>= 1.3.0) typed_dag (2.0.2) rails (>= 5.0.4) tzinfo (2.0.6) concurrent-ruby (~> 1.0) - tzinfo-data (1.2024.1) + tzinfo-data (1.2024.2) tzinfo (>= 1.0.0) uber (0.1.0) - unicode-display_width (2.5.0) - uri (0.13.0) + unicode-display_width (2.6.0) + uri (0.13.1) validate_email (0.1.6) activemodel (>= 3.0) mail (>= 2.2.5) validate_url (1.0.15) activemodel (>= 3.0.0) public_suffix - vcr (6.2.0) - view_component (3.12.1) + vcr (6.3.1) + base64 + view_component (3.14.0) activesupport (>= 5.2.0, < 8.0) concurrent-ruby (~> 1.0) method_source (~> 1.0) @@ -1138,7 +1171,7 @@ GEM crack (>= 0.3.2) hashdiff (>= 0.4.0, < 2.0.0) webrick (1.8.1) - websocket (1.2.10) + websocket (1.2.11) websocket-driver (0.7.6) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) @@ -1148,8 +1181,8 @@ GEM zeitwerk (>= 2.6) xpath (3.2.0) nokogiri (~> 1.8) - yard (0.9.36) - zeitwerk (2.6.16) + yard (0.9.37) + zeitwerk (2.6.18) PLATFORMS ruby @@ -1164,15 +1197,15 @@ DEPENDENCIES acts_as_tree (~> 2.9.0) addressable (~> 2.8.0) airbrake (~> 13.0.0) - appsignal (~> 3.8.1) + appsignal (~> 3.10.0) auto_strip_attributes (~> 2.5) - awesome_nested_set (~> 3.6.0) + awesome_nested_set (~> 3.7.0) aws-sdk-core (~> 3.107) aws-sdk-s3 (~> 1.91) axe-core-rspec bcrypt (~> 3.1.6) bootsnap (~> 1.18.0) - brakeman (~> 6.1.0) + brakeman (~> 6.2.0) browser (~> 6.0.0) budgets! capybara (~> 3.40.0) @@ -1197,14 +1230,16 @@ DEPENDENCIES disposable (~> 0.6.2) doorkeeper (~> 5.7.0) dotenv-rails + dry-auto_inject dry-container dry-monads + dry-validation email_validator (~> 2.2.3) equivalent-xml (~> 0.6) erb_lint erblint-github escape_utils (~> 1.3) - factory_bot (~> 6.4.0) + factory_bot (~> 6.5.0) factory_bot_rails (~> 6.4.0) ffi (~> 1.15) flamegraph @@ -1236,8 +1271,8 @@ DEPENDENCIES markly (~> 0.10) matrix (~> 0.4.2) md_to_pdf! - meta-tags (~> 2.21.0) - mini_magick (~> 4.13.0) + meta-tags (~> 2.22.0) + mini_magick (~> 5.0.1) multi_json (~> 1.15.0) my_page! net-ldap (~> 0.19.0) @@ -1263,10 +1298,10 @@ DEPENDENCIES openproject-job_status! openproject-ldap_groups! openproject-meeting! - openproject-octicons (~> 19.15.0) - openproject-octicons_helper (~> 19.15.0) + openproject-octicons (~> 19.18.0) + openproject-octicons_helper (~> 19.18.0) openproject-openid_connect! - openproject-primer_view_components (~> 0.36.0) + openproject-primer_view_components (~> 0.47.0) openproject-recaptcha! openproject-reporting! openproject-storages! @@ -1300,6 +1335,7 @@ DEPENDENCIES rails (~> 7.1.3) rails-controller-testing (~> 1.0.2) rails-i18n (~> 7.0.0) + rbtrace rdoc (>= 2.4.2) redis (~> 5.2.0) request_store (~> 1.7.0) @@ -1309,7 +1345,7 @@ DEPENDENCIES roar (~> 1.2.0) rouge (~> 4.3.0) rspec (~> 3.13.0) - rspec-rails (~> 6.1.0) + rspec-rails (~> 7.0.0) rspec-retry (~> 0.6.1) rubocop rubocop-capybara @@ -1322,7 +1358,7 @@ DEPENDENCIES ruby-duration (~> 3.2.0) ruby-prof ruby-progressbar (~> 1.13.0) - rubytree (~> 2.0.0) + rubytree (~> 2.1.0) sanitize (~> 6.1.0) secure_headers (~> 6.5.0) selenium-devtools @@ -1342,10 +1378,11 @@ DEPENDENCIES svg-graph (~> 2.2.0) sys-filesystem (~> 1.5.0) table_print (~> 1.5.6) - test-prof (~> 1.3.0) + test-prof (~> 1.4.0) timecop (~> 0.9.0) ttfunk (~> 1.7.0) turbo-rails (~> 2.0.0) + turbo_power (~> 0.6.2) turbo_tests! typed_dag (~> 2.0.2) tzinfo-data (~> 1.2024.1) @@ -1359,7 +1396,7 @@ DEPENDENCIES with_advisory_lock (~> 5.1.0) RUBY VERSION - ruby 3.3.3p89 + ruby 3.3.4p94 BUNDLED WITH 2.5.13 diff --git a/Guardfile b/Guardfile index 83e8583758b..4d787422605 100644 --- a/Guardfile +++ b/Guardfile @@ -1,6 +1,6 @@ #-- copyright # OpenProject is an open source project management software. -# Copyright (C) 2012-2024 the OpenProject GmbH +# 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. diff --git a/Rakefile b/Rakefile index 30e586c3e06..829f4601de6 100755 --- a/Rakefile +++ b/Rakefile @@ -1,7 +1,7 @@ #!/usr/bin/env rake #-- copyright # OpenProject is an open source project management software. -# Copyright (C) 2012-2024 the OpenProject GmbH +# 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. diff --git a/app/assets/images/enterprise/attribute-help-texts.png b/app/assets/images/enterprise/attribute-help-texts.png deleted file mode 100644 index 58fa216c7a9..00000000000 Binary files a/app/assets/images/enterprise/attribute-help-texts.png and /dev/null differ diff --git a/app/assets/images/installation_alerts.svg b/app/assets/images/installation_alerts.svg index bcd280fda89..836f8650ae1 100644 --- a/app/assets/images/installation_alerts.svg +++ b/app/assets/images/installation_alerts.svg @@ -1,148 +1,16 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + diff --git a/app/assets/images/professional_support.svg b/app/assets/images/professional_support.svg new file mode 100644 index 00000000000..176f092f0b5 --- /dev/null +++ b/app/assets/images/professional_support.svg @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/assets/images/security_alerts.jpg b/app/assets/images/security_alerts.jpg deleted file mode 100644 index fc3b6f1b877..00000000000 Binary files a/app/assets/images/security_alerts.jpg and /dev/null differ diff --git a/app/assets/images/security_alerts.svg b/app/assets/images/security_alerts.svg new file mode 100644 index 00000000000..85eb34b8b54 --- /dev/null +++ b/app/assets/images/security_alerts.svg @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/app/assets/images/system_maintenance.jpg b/app/assets/images/system_maintenance.jpg deleted file mode 100644 index f0b1155d91a..00000000000 Binary files a/app/assets/images/system_maintenance.jpg and /dev/null differ diff --git a/app/components/_index.sass b/app/components/_index.sass index a05d3e6b1e6..d20f0a29e39 100644 --- a/app/components/_index.sass +++ b/app/components/_index.sass @@ -1,7 +1,11 @@ @import "shares/modal_body_component" @import "shares/invite_user_form_component" +@import "work_packages/details/tab_component" @import "work_packages/progress/modal_body_component" +@import "work_packages/split_view_component" @import "open_project/common/attribute_component" +@import "open_project/common/submenu_component" @import "filter/filters_component" @import "projects/row_component" -@import "settings/project_custom_fields/project_custom_field_mapping/new_project_mapping_component" +@import "op_primer/border_box_table_component" +@import "work_packages/exports/modal_dialog_component" diff --git a/app/components/activities/days_component.html.erb b/app/components/activities/days_component.html.erb index c0fd1098bf5..ced326e3a91 100644 --- a/app/components/activities/days_component.html.erb +++ b/app/components/activities/days_component.html.erb @@ -1,6 +1,6 @@ <%#-- copyright OpenProject is an open source project management software. -Copyright (C) 2012-2024 the OpenProject GmbH +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. diff --git a/app/components/activities/days_component.rb b/app/components/activities/days_component.rb index fe76971cb6c..cdd9303991e 100644 --- a/app/components/activities/days_component.rb +++ b/app/components/activities/days_component.rb @@ -2,7 +2,7 @@ #-- copyright # OpenProject is an open source project management software. -# Copyright (C) 2012-2024 the OpenProject GmbH +# 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. diff --git a/app/components/activities/item_component.html.erb b/app/components/activities/item_component.html.erb index 5237f1ba1f9..540337fc93d 100644 --- a/app/components/activities/item_component.html.erb +++ b/app/components/activities/item_component.html.erb @@ -1,6 +1,6 @@ <%#-- copyright OpenProject is an open source project management software. -Copyright (C) 2012-2024 the OpenProject GmbH +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. diff --git a/app/components/activities/item_component.rb b/app/components/activities/item_component.rb index 485b46ae02d..2b95b2d0107 100644 --- a/app/components/activities/item_component.rb +++ b/app/components/activities/item_component.rb @@ -2,7 +2,7 @@ #-- copyright # OpenProject is an open source project management software. -# Copyright (C) 2012-2024 the OpenProject GmbH +# 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. diff --git a/app/components/activities/item_subtitle_component.html.erb b/app/components/activities/item_subtitle_component.html.erb index 2b9edbce4e7..05b60d4a1af 100644 --- a/app/components/activities/item_subtitle_component.html.erb +++ b/app/components/activities/item_subtitle_component.html.erb @@ -1,6 +1,6 @@ <%#-- copyright OpenProject is an open source project management software. -Copyright (C) 2012-2024 the OpenProject GmbH +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. diff --git a/app/components/activities/item_subtitle_component.rb b/app/components/activities/item_subtitle_component.rb index f27954e1cd3..81de3fd04be 100644 --- a/app/components/activities/item_subtitle_component.rb +++ b/app/components/activities/item_subtitle_component.rb @@ -2,7 +2,7 @@ #-- copyright # OpenProject is an open source project management software. -# Copyright (C) 2012-2024 the OpenProject GmbH +# 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. diff --git a/app/components/add_button_component.rb b/app/components/add_button_component.rb index 956d16c5fec..a2b91bc9206 100644 --- a/app/components/add_button_component.rb +++ b/app/components/add_button_component.rb @@ -2,7 +2,7 @@ # -- copyright # OpenProject is an open source project management software. -# Copyright (C) 2023 the OpenProject GmbH +# 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. diff --git a/app/components/admin/attachments_settings_header_component.html.erb b/app/components/admin/attachments_settings_header_component.html.erb index 9374b9a49ad..a264231f9aa 100644 --- a/app/components/admin/attachments_settings_header_component.html.erb +++ b/app/components/admin/attachments_settings_header_component.html.erb @@ -1,6 +1,6 @@ <%#-- copyright OpenProject is an open source project management software. -Copyright (C) 2012-2024 the OpenProject GmbH +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. @@ -29,7 +29,7 @@ See COPYRIGHT and LICENSE files for more details. <% helpers.html_title t(:label_administration), @title %> -<%= render(Primer::OpenProject::PageHeader.new(border_bottom: 0)) do |header| +<%= render(Primer::OpenProject::PageHeader.new) do |header| header.with_title { t(:"attributes.attachments") } header.with_breadcrumbs([{ href: admin_index_path, text: t("label_administration") }, { href: admin_settings_storages_path, text: t("project_module_storages") }, diff --git a/app/components/admin/attachments_settings_header_component.rb b/app/components/admin/attachments_settings_header_component.rb index 88d13b0c180..af967d00555 100644 --- a/app/components/admin/attachments_settings_header_component.rb +++ b/app/components/admin/attachments_settings_header_component.rb @@ -2,7 +2,7 @@ #-- copyright # OpenProject is an open source project management software. -# Copyright (C) 2012-2024 the OpenProject GmbH +# 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. diff --git a/app/components/admin/backups/show_page_header_component.html.erb b/app/components/admin/backups/show_page_header_component.html.erb new file mode 100644 index 00000000000..4b1ddcd8bca --- /dev/null +++ b/app/components/admin/backups/show_page_header_component.html.erb @@ -0,0 +1,65 @@ +<%#-- 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. + +++#%> +<%= + render(Primer::OpenProject::PageHeader.new) do |header| + header.with_title { t(:label_backup) } + header.with_breadcrumbs([{ href: admin_index_path, text: t(:label_administration) }, + t(:label_backup)]) + + header.with_action_button(tag: :a, + scheme: button_scheme, + mobile_label: button_title, + mobile_icon: button_icon, + size: :medium, + href: reset_token_admin_backups_path, + aria: { label: button_title }, + title: button_title) do |button| + button.with_leading_visual_icon(icon: button_icon) + button_title + end + + if @backup_token.present? + header.with_action_button(tag: :a, + scheme: :danger, + mobile_icon: :trash, + mobile_label: t("backup.label_delete_token"), + size: :medium, + href: delete_token_admin_backups_path, + aria: { label: I18n.t("backup.label_delete_token") }, + data: { + confirm: I18n.t(:text_are_you_sure), + method: :post + }, + title: I18n.t(:button_delete)) do |button| + button.with_leading_visual_icon(icon: :trash) + t("backup.label_delete_token") + end + end + end +%> diff --git a/app/components/admin/backups/show_page_header_component.rb b/app/components/admin/backups/show_page_header_component.rb new file mode 100644 index 00000000000..3b7dc6f70b9 --- /dev/null +++ b/app/components/admin/backups/show_page_header_component.rb @@ -0,0 +1,61 @@ +# frozen_string_literal: true + +# -- 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 Backups + class ShowPageHeaderComponent < ApplicationComponent + include OpPrimer::ComponentHelpers + include ApplicationHelper + + def initialize(backup_token:) + super + @backup_token = backup_token + end + + def breadcrumb_items + [{ href: admin_index_path, text: t(:label_administration) }, + t(:label_backup)] + end + + def button_title + button_action = @backup_token.present? ? "reset" : "create" + t("backup.label_#{button_action}_token") + end + + def button_icon + @backup_token.present? ? :"op-reload" : :plus + end + + def button_scheme + @backup_token.present? ? :default : :primary + end + end + end +end diff --git a/app/components/settings/project_custom_fields/project_custom_field_mapping/new_project_mapping_form_component.html.erb b/app/components/admin/custom_fields/custom_field_projects/new_custom_field_projects_form_modal_component.html.erb similarity index 82% rename from app/components/settings/project_custom_fields/project_custom_field_mapping/new_project_mapping_form_component.html.erb rename to app/components/admin/custom_fields/custom_field_projects/new_custom_field_projects_form_modal_component.html.erb index eaf048dfd0f..a7596230ea1 100644 --- a/app/components/settings/project_custom_fields/project_custom_field_mapping/new_project_mapping_form_component.html.erb +++ b/app/components/admin/custom_fields/custom_field_projects/new_custom_field_projects_form_modal_component.html.erb @@ -1,6 +1,6 @@ <%#-- copyright OpenProject is an open source project management software. -Copyright (C) 2012-2024 the OpenProject GmbH +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. @@ -30,20 +30,20 @@ See COPYRIGHT and LICENSE files for more details. <%= component_wrapper do primer_form_with( - class: "op-new-project-mapping-form", - model: @project_mapping, - url: link_admin_settings_project_custom_field_path(@project_custom_field), + model: , + url:, data: { turbo: true }, method: :post ) do |form| concat(render(Primer::Alpha::Dialog::Body.new( - id: DIALOG_BODY_ID, test_selector: DIALOG_BODY_ID, aria: { label: title }, + id: dialog_body_id, test_selector: dialog_body_id, aria: { label: title }, style: "min-height: 300px" )) do - render(Projects::CustomFields::CustomFieldMappingForm.new(form, project_mapping: @project_mapping)) + render(Projects::CustomFields::CustomFieldMappingForm.new(form, project_mapping: @custom_field_project_mapping)) end) + concat(render(Primer::Alpha::Dialog::Footer.new(show_divider: false)) do - concat(render(Primer::ButtonComponent.new(data: { 'close-dialog-id': DIALOG_ID })) { cancel_button_text }) + concat(render(Primer::ButtonComponent.new(data: { 'close-dialog-id': dialog_id })) { cancel_button_text }) concat(render(Primer::ButtonComponent.new(scheme: :primary, type: :submit)) { submit_button_text }) end) end diff --git a/app/components/admin/custom_fields/custom_field_projects/new_custom_field_projects_form_modal_component.rb b/app/components/admin/custom_fields/custom_field_projects/new_custom_field_projects_form_modal_component.rb new file mode 100644 index 00000000000..647e2fec7ac --- /dev/null +++ b/app/components/admin/custom_fields/custom_field_projects/new_custom_field_projects_form_modal_component.rb @@ -0,0 +1,70 @@ +#-- 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 CustomFieldProjects + class NewCustomFieldProjectsFormModalComponent < ApplicationComponent + include OpTurbo::Streamable + + DIALOG_ID = "new-custom-field-projects-modal".freeze + DIALOG_BODY_ID = "new-custom-field-projects-modal-body".freeze + + def initialize(custom_field_project_mapping:, custom_field:, **) + @custom_field_project_mapping = custom_field_project_mapping + @custom_field = custom_field + + super(@custom_field_project_mapping, **) + end + + private + + def url + url_helpers.custom_field_projects_path(@custom_field) + end + + def dialog_id = DIALOG_ID + def dialog_body_id = DIALOG_BODY_ID + + attr_reader :custom_field_project_mapping, :custom_field + + def title + I18n.t(:label_add_projects) + end + + def cancel_button_text + I18n.t("button_cancel") + end + + def submit_button_text + I18n.t("button_add") + end + end + end + end +end diff --git a/app/components/admin/custom_fields/custom_field_projects/new_custom_field_projects_modal_component.html.erb b/app/components/admin/custom_fields/custom_field_projects/new_custom_field_projects_modal_component.html.erb new file mode 100644 index 00000000000..346ef80311d --- /dev/null +++ b/app/components/admin/custom_fields/custom_field_projects/new_custom_field_projects_modal_component.html.erb @@ -0,0 +1,18 @@ +<%= + render( + Primer::Alpha::Dialog.new( + id: dialog_id, + title:, + test_selector: dialog_id, + size: :large + ) + ) do |dialog| + dialog.with_header( + show_divider: false, + visually_hide_title: false, + variant: :large + ) + + render(form_modal_component) + end +%> diff --git a/app/components/admin/custom_fields/custom_field_projects/new_custom_field_projects_modal_component.rb b/app/components/admin/custom_fields/custom_field_projects/new_custom_field_projects_modal_component.rb new file mode 100644 index 00000000000..e264b251323 --- /dev/null +++ b/app/components/admin/custom_fields/custom_field_projects/new_custom_field_projects_modal_component.rb @@ -0,0 +1,64 @@ +#-- 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 CustomFieldProjects + class NewCustomFieldProjectsModalComponent < ApplicationComponent + include OpTurbo::Streamable + + def initialize(custom_field_project_mapping:, custom_field:, **) + @custom_field_project_mapping = custom_field_project_mapping + @custom_field = custom_field + super(@custom_field_project_mapping, **) + end + + def render? + !custom_field.is_for_all? + end + + private + + attr_reader :custom_field_project_mapping, :custom_field + + def dialog_id = NewCustomFieldProjectsFormModalComponent::DIALOG_ID + def dialog_body_id = NewCustomFieldProjectsFormModalComponent::DIALOG_BODY_ID + + def title + I18n.t(:label_add_projects) + end + + def form_modal_component + Admin::CustomFields::CustomFieldProjects::NewCustomFieldProjectsFormModalComponent.new( + custom_field_project_mapping:, custom_field: + ) + end + end + end + end +end diff --git a/app/components/settings/project_custom_fields/project_custom_field_mapping/row_component.html.erb b/app/components/admin/custom_fields/custom_field_projects/row_component.html.erb similarity index 97% rename from app/components/settings/project_custom_fields/project_custom_field_mapping/row_component.html.erb rename to app/components/admin/custom_fields/custom_field_projects/row_component.html.erb index 097b38764a0..cf694aa0c31 100644 --- a/app/components/settings/project_custom_fields/project_custom_field_mapping/row_component.html.erb +++ b/app/components/admin/custom_fields/custom_field_projects/row_component.html.erb @@ -1,6 +1,6 @@ <%#-- copyright OpenProject is an open source project management software. -Copyright (C) 2012-2024 the OpenProject GmbH +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. diff --git a/app/components/admin/custom_fields/custom_field_projects/row_component.rb b/app/components/admin/custom_fields/custom_field_projects/row_component.rb new file mode 100644 index 00000000000..fe94c8e9f65 --- /dev/null +++ b/app/components/admin/custom_fields/custom_field_projects/row_component.rb @@ -0,0 +1,45 @@ +#-- 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 CustomFieldProjects + class RowComponent < Projects::RowComponent + include OpTurbo::Streamable + + def wrapper_uniq_by + "project-#{project.id}" + end + + def more_menu_items + [] + end + end + end + end +end diff --git a/app/components/admin/custom_fields/custom_field_projects/table_component.rb b/app/components/admin/custom_fields/custom_field_projects/table_component.rb new file mode 100644 index 00000000000..9ef7650dab1 --- /dev/null +++ b/app/components/admin/custom_fields/custom_field_projects/table_component.rb @@ -0,0 +1,62 @@ +#-- 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 CustomFieldProjects + class TableComponent < Projects::TableComponent + include OpTurbo::Streamable + + def columns + @columns ||= query.selects.reject { |select| select.is_a?(Queries::Selects::NotExistingSelect) } + end + + 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 +end diff --git a/app/components/admin/custom_fields/edit_form_header_component.html.erb b/app/components/admin/custom_fields/edit_form_header_component.html.erb new file mode 100644 index 00000000000..140535ca0d4 --- /dev/null +++ b/app/components/admin/custom_fields/edit_form_header_component.html.erb @@ -0,0 +1,52 @@ +<%#-- 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. + +++#%> + +<%= + render(Primer::OpenProject::PageHeader.new(test_selector: "custom-fields--page-header")) do |header| + header.with_title { @custom_field.name } + + header.with_breadcrumbs(breadcrumbs_items) + + header.with_tab_nav(label: nil, test_selector: :custom_field_detail_header) do |tab_nav| + tab_nav.with_tab( + selected: tab_selected?(:edit), + href: edit_custom_field_path(@custom_field) + ) do |tab| + tab.with_text { t(:label_details) } + end + + tab_nav.with_tab( + selected: tab_selected?(:custom_field_projects), + href: custom_field_projects_path(@custom_field) + ) do |tab| + tab.with_text { t(:label_project_plural) } + end + end + end +%> diff --git a/app/components/admin/custom_fields/edit_form_header_component.rb b/app/components/admin/custom_fields/edit_form_header_component.rb new file mode 100644 index 00000000000..c64d79dc8c5 --- /dev/null +++ b/app/components/admin/custom_fields/edit_form_header_component.rb @@ -0,0 +1,57 @@ +#-- 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 + class EditFormHeaderComponent < ApplicationComponent + TAB_NAVS = %i[ + edit + custom_field_projects + ].freeze + + def initialize(custom_field:, selected:, **) + @custom_field = custom_field + @selected = selected + super(custom_field, **) + end + + def tab_selected?(tab_name) + TAB_NAVS.include?(tab_name) && tab_name == @selected + end + + private + + def breadcrumbs_items + [{ href: admin_index_path, text: t(:label_administration) }, + { href: custom_fields_path, text: t(:label_custom_field_plural) }, + { href: custom_fields_path(tab: @custom_field.type), text: I18n.t(@custom_field.type_name) }, + @custom_field.name] + end + end + end +end diff --git a/app/components/admin/quarantined_attachments/row_component.rb b/app/components/admin/quarantined_attachments/row_component.rb index 0af393a4b4d..5d83c4926be 100644 --- a/app/components/admin/quarantined_attachments/row_component.rb +++ b/app/components/admin/quarantined_attachments/row_component.rb @@ -2,7 +2,7 @@ #-- copyright # OpenProject is an open source project management software. -# Copyright (C) 2012-2024 the OpenProject GmbH +# 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. diff --git a/app/components/admin/quarantined_attachments/table_component.rb b/app/components/admin/quarantined_attachments/table_component.rb index 7ea4e52020f..a05f3617087 100644 --- a/app/components/admin/quarantined_attachments/table_component.rb +++ b/app/components/admin/quarantined_attachments/table_component.rb @@ -2,7 +2,7 @@ #-- copyright # OpenProject is an open source project management software. -# Copyright (C) 2012-2024 the OpenProject GmbH +# 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. diff --git a/app/components/application_component.rb b/app/components/application_component.rb index e603d119458..53dc6caf507 100644 --- a/app/components/application_component.rb +++ b/app/components/application_component.rb @@ -2,7 +2,7 @@ #-- copyright # OpenProject is an open source project management software. -# Copyright (C) 2012-2024 the OpenProject GmbH +# 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. diff --git a/app/components/attribute_groups/attribute_group_component.html.erb b/app/components/attribute_groups/attribute_group_component.html.erb index 36c6ad38aa4..f539a04a85b 100644 --- a/app/components/attribute_groups/attribute_group_component.html.erb +++ b/app/components/attribute_groups/attribute_group_component.html.erb @@ -1,6 +1,6 @@ <%#-- copyright OpenProject is an open source project management software. -Copyright (C) 2012-2024 the OpenProject GmbH +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. diff --git a/app/components/attribute_groups/attribute_group_component.rb b/app/components/attribute_groups/attribute_group_component.rb index ec401d6d7ca..df5e418a729 100644 --- a/app/components/attribute_groups/attribute_group_component.rb +++ b/app/components/attribute_groups/attribute_group_component.rb @@ -2,7 +2,7 @@ #-- copyright # OpenProject is an open source project management software. -# Copyright (C) 2012-2024 the OpenProject GmbH +# 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. diff --git a/app/components/attribute_groups/attribute_group_header_component.html.erb b/app/components/attribute_groups/attribute_group_header_component.html.erb index b93babe89bd..720bc5fad9c 100644 --- a/app/components/attribute_groups/attribute_group_header_component.html.erb +++ b/app/components/attribute_groups/attribute_group_header_component.html.erb @@ -1,6 +1,6 @@ <%#-- copyright OpenProject is an open source project management software. -Copyright (C) 2012-2024 the OpenProject GmbH +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. diff --git a/app/components/attribute_groups/attribute_group_header_component.rb b/app/components/attribute_groups/attribute_group_header_component.rb index dc74e61d38a..ae2d8299430 100644 --- a/app/components/attribute_groups/attribute_group_header_component.rb +++ b/app/components/attribute_groups/attribute_group_header_component.rb @@ -2,7 +2,7 @@ #-- copyright # OpenProject is an open source project management software. -# Copyright (C) 2012-2024 the OpenProject GmbH +# 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. diff --git a/app/components/attribute_groups/attribute_key_value_component.html.erb b/app/components/attribute_groups/attribute_key_value_component.html.erb index a36d9c5defd..2bbbfc1a62a 100644 --- a/app/components/attribute_groups/attribute_key_value_component.html.erb +++ b/app/components/attribute_groups/attribute_key_value_component.html.erb @@ -1,6 +1,6 @@ <%#-- copyright OpenProject is an open source project management software. -Copyright (C) 2012-2024 the OpenProject GmbH +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. diff --git a/app/components/attribute_groups/attribute_key_value_component.rb b/app/components/attribute_groups/attribute_key_value_component.rb index f96b6c92cbc..0f98310bb0e 100644 --- a/app/components/attribute_groups/attribute_key_value_component.rb +++ b/app/components/attribute_groups/attribute_key_value_component.rb @@ -2,7 +2,7 @@ #-- copyright # OpenProject is an open source project management software. -# Copyright (C) 2012-2024 the OpenProject GmbH +# 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. diff --git a/app/views/placeholder_users/_toolbar.html.erb b/app/components/attribute_help_texts/index_page_header_component.html.erb similarity index 68% rename from app/views/placeholder_users/_toolbar.html.erb rename to app/components/attribute_help_texts/index_page_header_component.html.erb index 47de2c2c7ae..602390526de 100644 --- a/app/views/placeholder_users/_toolbar.html.erb +++ b/app/components/attribute_help_texts/index_page_header_component.html.erb @@ -1,6 +1,6 @@ <%#-- copyright OpenProject is an open source project management software. -Copyright (C) 2012-2024 the OpenProject GmbH +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. @@ -26,14 +26,17 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. See COPYRIGHT and LICENSE files for more details. ++#%> -<%= breadcrumb_toolbar(@placeholder_user.new_record? ? t(:label_placeholder_user_new) : @placeholder_user.name) do %> - <% unless @placeholder_user.new_record? %> -
  • - <%= link_to placeholder_user_path(@placeholder_user), class: 'button' do %> - <%= op_icon('button--icon icon-user') %> - <%= t(:label_profile) %> - <% end %> -
  • - <%= render partial: 'placeholder_users/toolbar_delete' %> - <% end %> -<% end %> +<%= + render(Primer::OpenProject::PageHeader.new) do |header| + header.with_title { I18n.t(:"attribute_help_texts.label_plural") } + header.with_breadcrumbs(breadcrumb_items, selected_item_font_weight: :normal) + + header.with_tab_nav(label: nil) do |tab_nav| + @tabs.each do |tab| + tab_nav.with_tab(selected: currently_selected_tab == tab, href: tab[:path]) do |t| + t.with_text { I18n.t(tab[:label]) } + end + end + end if @tabs.present? + end +%> diff --git a/app/components/attribute_help_texts/index_page_header_component.rb b/app/components/attribute_help_texts/index_page_header_component.rb new file mode 100644 index 00000000000..0e0637a472e --- /dev/null +++ b/app/components/attribute_help_texts/index_page_header_component.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true + +# -- 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. +# ++ + +class AttributeHelpTexts::IndexPageHeaderComponent < ApplicationComponent + include OpPrimer::ComponentHelpers + include ApplicationHelper + include TabsHelper + + def initialize(tabs: nil) + super + @tabs = tabs + end + + def breadcrumb_items + [{ href: admin_index_path, text: t("label_administration") }, + I18n.t("menus.breadcrumb.nested_element", section_header: t(:"attribute_help_texts.label_plural"), + title: I18n.t(currently_selected_tab[:label].to_s)).html_safe] + end + + def currently_selected_tab + @currently_selected_tab ||= selected_tab(@tabs) + end +end diff --git a/app/components/colors/edit_page_header_component.html.erb b/app/components/colors/edit_page_header_component.html.erb new file mode 100644 index 00000000000..55dde57ac10 --- /dev/null +++ b/app/components/colors/edit_page_header_component.html.erb @@ -0,0 +1,52 @@ +<%#-- 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. + +++#%> +<%= + render(Primer::OpenProject::PageHeader.new) do |header| + header.with_title { @color.name } + header.with_breadcrumbs(breadcrumb_items) + + if @color.persisted? + header.with_action_button(tag: :a, + scheme: :danger, + mobile_icon: :trash, + mobile_label: t(:button_delete), + size: :medium, + href: color_path(@color), + aria: { label: I18n.t(:button_delete) }, + data: { + confirm: I18n.t(:text_are_you_sure), + method: :delete + }, + title: I18n.t(:button_delete)) do |button| + button.with_leading_visual_icon(icon: :trash) + t(:button_delete) + end + end + end +%> diff --git a/app/components/colors/edit_page_header_component.rb b/app/components/colors/edit_page_header_component.rb new file mode 100644 index 00000000000..e02859a411e --- /dev/null +++ b/app/components/colors/edit_page_header_component.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +# -- 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 Colors + class EditPageHeaderComponent < ApplicationComponent + include OpPrimer::ComponentHelpers + include ApplicationHelper + + def initialize(color:) + super + @color = color + end + + def breadcrumb_items + [ + { href: admin_index_path, text: t(:label_administration) }, + { href: colors_path, text: t(:label_color_plural) }, + @color.name + ] + end + end +end diff --git a/app/components/components/on_off_status_component.html.erb b/app/components/components/on_off_status_component.html.erb index 4a805303bbf..4a64e60e31f 100644 --- a/app/components/components/on_off_status_component.html.erb +++ b/app/components/components/on_off_status_component.html.erb @@ -1,6 +1,6 @@ <%#-- copyright OpenProject is an open source project management software. -Copyright (C) 2012-2024 the OpenProject GmbH +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. diff --git a/app/components/components/on_off_status_component.rb b/app/components/components/on_off_status_component.rb index 439a23248a7..cc87876539b 100644 --- a/app/components/components/on_off_status_component.rb +++ b/app/components/components/on_off_status_component.rb @@ -2,7 +2,7 @@ #-- copyright # OpenProject is an open source project management software. -# Copyright (C) 2012-2024 the OpenProject GmbH +# 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. diff --git a/app/components/concerns/op_turbo/streamable.rb b/app/components/concerns/op_turbo/streamable.rb index 000bdc1088c..dfad026a782 100644 --- a/app/components/concerns/op_turbo/streamable.rb +++ b/app/components/concerns/op_turbo/streamable.rb @@ -1,6 +1,6 @@ #-- copyright # OpenProject is an open source project management software. -# Copyright (C) 2012-2024 the OpenProject GmbH +# 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. @@ -32,6 +32,8 @@ module OpTurbo class MissingComponentWrapper < StandardError; end # rubocop:enable OpenProject/AddPreviewForViewComponent + INLINE_ACTIONS = %i[dialog flash].freeze + extend ActiveSupport::Concern class_methods do @@ -43,7 +45,7 @@ module OpTurbo included do def render_as_turbo_stream(view_context:, action: :update) case action - when :update, :dialog + when :update, *INLINE_ACTIONS @inner_html_only = true template = render_in(view_context) when :replace @@ -56,7 +58,7 @@ module OpTurbo raise ArgumentError, "Unsupported action #{action}" end - if action != :dialog && !wrapped? + if INLINE_ACTIONS.exclude?(action) && !wrapped? raise MissingComponentWrapper, "Wrap your component in a `component_wrapper` block in order to use turbo-stream methods" end diff --git a/app/components/custom_actions/row_component.rb b/app/components/custom_actions/row_component.rb index a8f2f3586ce..9a51a70d1c1 100644 --- a/app/components/custom_actions/row_component.rb +++ b/app/components/custom_actions/row_component.rb @@ -2,7 +2,7 @@ #-- copyright # OpenProject is an open source project management software. -# Copyright (C) 2012-2024 the OpenProject GmbH +# 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. diff --git a/app/components/custom_actions/table_component.rb b/app/components/custom_actions/table_component.rb index 0c7dfe58fd4..4d5d9bf8709 100644 --- a/app/components/custom_actions/table_component.rb +++ b/app/components/custom_actions/table_component.rb @@ -2,7 +2,7 @@ #-- copyright # OpenProject is an open source project management software. -# Copyright (C) 2012-2024 the OpenProject GmbH +# 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. diff --git a/app/views/workflows/_toolbar.html.erb b/app/components/custom_fields/index_page_header_component.html.erb similarity index 67% rename from app/views/workflows/_toolbar.html.erb rename to app/components/custom_fields/index_page_header_component.html.erb index aae1f2430f3..f91e3f13d79 100644 --- a/app/views/workflows/_toolbar.html.erb +++ b/app/components/custom_fields/index_page_header_component.html.erb @@ -1,6 +1,6 @@ <%#-- copyright OpenProject is an open source project management software. -Copyright (C) 2012-2024 the OpenProject GmbH +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. @@ -26,18 +26,17 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. See COPYRIGHT and LICENSE files for more details. ++#%> +<%= + render(Primer::OpenProject::PageHeader.new) do |header| + header.with_title { I18n.t(:label_custom_field_plural) } + header.with_breadcrumbs(breadcrumb_items, selected_item_font_weight: :normal) -<%= toolbar title: title do %> -
  • - <%= link_to({ action: 'copy' }, class: 'button') do %> - <%= op_icon('button--icon icon-copy') %> - <%= t(:button_copy) %> - <% end %> -
  • -
  • - <%= link_to({ action: 'show' }, class: 'button') do %> - <%= op_icon('button--icon icon-info1') %> - <%= t(:label_workflow_summary) %> - <% end %> -
  • -<% end %> + header.with_tab_nav(label: nil, test_selector: "custom-fields--tab-nav") do |tab_nav| + @tabs.each do |tab| + tab_nav.with_tab(selected: currently_selected_tab == tab, href: tab[:path]) do |t| + t.with_text { I18n.t(tab[:label]) } + end + end + end if @tabs.present? + end +%> diff --git a/app/components/custom_fields/index_page_header_component.rb b/app/components/custom_fields/index_page_header_component.rb new file mode 100644 index 00000000000..bfefb5b22ec --- /dev/null +++ b/app/components/custom_fields/index_page_header_component.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true + +# -- 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. +# ++ + +class CustomFields::IndexPageHeaderComponent < ApplicationComponent + include OpPrimer::ComponentHelpers + include ApplicationHelper + include TabsHelper + + def initialize(tabs: nil) + super + @tabs = tabs + end + + def breadcrumb_items + [{ href: admin_index_path, text: t("label_administration") }, + I18n.t("menus.breadcrumb.nested_element", section_header: t(:label_custom_field_plural), + title: I18n.t(currently_selected_tab[:label].to_s)).html_safe] + end + + def currently_selected_tab + @currently_selected_tab ||= selected_tab(@tabs) + end +end diff --git a/app/components/enumerations/row_component.rb b/app/components/enumerations/row_component.rb index 9c885f3a375..4ba4c7f21dd 100644 --- a/app/components/enumerations/row_component.rb +++ b/app/components/enumerations/row_component.rb @@ -2,7 +2,7 @@ #-- copyright # OpenProject is an open source project management software. -# Copyright (C) 2012-2024 the OpenProject GmbH +# 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. diff --git a/app/components/enumerations/table_component.rb b/app/components/enumerations/table_component.rb index bba8eff05e1..177f8510186 100644 --- a/app/components/enumerations/table_component.rb +++ b/app/components/enumerations/table_component.rb @@ -2,7 +2,7 @@ #-- copyright # OpenProject is an open source project management software. -# Copyright (C) 2012-2024 the OpenProject GmbH +# 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. diff --git a/app/components/filter/filter_button_component.html.erb b/app/components/filter/filter_button_component.html.erb index 2b624db592d..f17a4b500bd 100644 --- a/app/components/filter/filter_button_component.html.erb +++ b/app/components/filter/filter_button_component.html.erb @@ -1,8 +1,10 @@ -<%= render(Primer::Beta::Button.new(scheme: :secondary, +<%= component_wrapper tag: "turbo-frame" do %> + <%= render(Primer::Beta::Button.new(scheme: :secondary, disabled:, data: { "filter--filters-form-target": "filterFormToggle", action: "filter--filters-form#toggleDisplayFilters" }, test_selector: "filter-component-toggle")) do |button| %> - <% button.with_trailing_visual_counter(count: filters_count, test_selector: "filters-button-counter") %> - <%= t(:label_filter) %> + <% button.with_trailing_visual_counter(count: filters_count, test_selector: "filters-button-counter") %> + <%= t(:label_filter) %> + <% end %> <% end %> diff --git a/app/components/filter/filter_button_component.rb b/app/components/filter/filter_button_component.rb index 4df3f77cbba..7b065bde8c7 100644 --- a/app/components/filter/filter_button_component.rb +++ b/app/components/filter/filter_button_component.rb @@ -2,7 +2,7 @@ # -- copyright # OpenProject is an open source project management software. -# Copyright (C) 2010-2024 the OpenProject GmbH +# 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. @@ -31,11 +31,17 @@ module Filter # rubocop:disable OpenProject/AddPreviewForViewComponent class FilterButtonComponent < ApplicationComponent # rubocop:enable OpenProject/AddPreviewForViewComponent + include OpTurbo::Streamable + options :query options :disabled def filters_count @filters_count ||= query.filters.count end + + def wrapper_key + "filter-button" + end end end diff --git a/app/components/filter/filter_component.html.erb b/app/components/filter/filter_component.html.erb index 0d4759bebca..00705953975 100644 --- a/app/components/filter/filter_component.html.erb +++ b/app/components/filter/filter_component.html.erb @@ -17,8 +17,8 @@ <% autocomplete_filter = additional_options.key?(:autocomplete_options) %>
  • - <% unless EnterpriseToken.allows_to?(:custom_fields_in_projects_list)%> - <%= - helpers.angular_component_tag 'op-enterprise-banner', - inputs: { - collapsible: true, - textMessage: t('ee.upsale.project_filters.description_html'), - moreInfoLink: OpenProject::Static::Links.links[:enterprise_docs][:custom_field_projects][:href], - } - %> - <% end %> <% end %> diff --git a/app/components/filter/filter_component.rb b/app/components/filter/filter_component.rb index 01f58a5bdf5..6b625627b2d 100644 --- a/app/components/filter/filter_component.rb +++ b/app/components/filter/filter_component.rb @@ -2,7 +2,7 @@ # -- copyright # OpenProject is an open source project management software. -# Copyright (C) 2010-2024 the OpenProject GmbH +# 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. @@ -51,7 +51,7 @@ module Filter def allowed_filters query - .available_filters + .available_advanced_filters end protected @@ -65,7 +65,8 @@ module Filter # @return [Hash] the additional attributes for the filter, that will be yielded in the each_filter method def additional_filter_attributes(filter) case filter - when Queries::Filters::Shared::ProjectFilter + when Queries::Filters::Shared::ProjectFilter::Required, + Queries::Filters::Shared::ProjectFilter::Optional { autocomplete_options: { component: "opce-project-autocompleter", diff --git a/app/components/groups/edit_page_header_component.html.erb b/app/components/groups/edit_page_header_component.html.erb new file mode 100644 index 00000000000..62302ef4d8f --- /dev/null +++ b/app/components/groups/edit_page_header_component.html.erb @@ -0,0 +1,71 @@ +<%#-- 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. + +++#%> +<%= + render(Primer::OpenProject::PageHeader.new) do |header| + header.with_title { @group.name } + header.with_breadcrumbs(breadcrumb_items) + + header.with_action_button(tag: :a, + mobile_icon: :person, + mobile_label: t(:label_profile), + size: :medium, + href: show_group_path(@group), + aria: { label: I18n.t(:label_profile) }, + title: I18n.t(:label_profile)) do |button| + button.with_leading_visual_icon(icon: :person) + t(:label_profile) + end + + if @current_user.admin? + header.with_action_button(tag: :a, + scheme: :danger, + mobile_icon: :trash, + mobile_label: t(:button_delete), + size: :medium, + href: group_path(@group), + aria: { label: I18n.t(:button_delete) }, + data: { + confirm: t(:text_are_you_sure), + method: :delete, + }, + title: I18n.t(:button_delete)) do |button| + button.with_leading_visual_icon(icon: :trash) + t(:button_delete) + end + end + + header.with_tab_nav(label: nil) do |tab_nav| + @tabs.each do |tab| + tab_nav.with_tab(selected: selected_tab(@tabs) == tab, href: tab[:path]) do |t| + t.with_text { I18n.t("js.#{tab[:label]}") } + end + end + end if @tabs.present? + end +%> diff --git a/app/components/groups/edit_page_header_component.rb b/app/components/groups/edit_page_header_component.rb new file mode 100644 index 00000000000..89e0fbf6a06 --- /dev/null +++ b/app/components/groups/edit_page_header_component.rb @@ -0,0 +1,51 @@ +# frozen_string_literal: true + +# -- 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 Groups + class EditPageHeaderComponent < ApplicationComponent + include OpPrimer::ComponentHelpers + include ApplicationHelper + include TabsHelper + + def initialize(group:, current_user:, tabs: nil) + super + @group = group + @tabs = tabs + @current_user = current_user + end + + def breadcrumb_items + [{ href: admin_index_path, text: t("label_administration") }, + { href: admin_settings_users_path, text: t(:label_user_and_permission) }, + { href: groups_path, text: t(:label_group_plural) }, + @group.name] + end + end +end diff --git a/app/components/groups/show_page_header_component.html.erb b/app/components/groups/show_page_header_component.html.erb new file mode 100644 index 00000000000..f42886dfed3 --- /dev/null +++ b/app/components/groups/show_page_header_component.html.erb @@ -0,0 +1,64 @@ +<%#-- 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. + +++#%> +<%= + render(Primer::OpenProject::PageHeader.new) do |header| + header.with_title(test_selector: "groups--title") { @group.name } + header.with_breadcrumbs(breadcrumb_items) + + if @current_user.admin? + header.with_action_button(tag: :a, + mobile_icon: :pencil, + mobile_label: t(:button_edit), + size: :medium, + href: edit_group_path(@group), + aria: { label: I18n.t(:button_edit) }, + data: { "test-selector": "groups--edit-group-button" }, + title: I18n.t(:button_edit)) do |button| + button.with_leading_visual_icon(icon: :pencil) + t(:button_edit) + end + + header.with_action_button(tag: :a, + scheme: :danger, + mobile_icon: :trash, + mobile_label: t(:button_delete), + size: :medium, + href: group_path(@group), + aria: { label: I18n.t(:button_delete) }, + data: { + confirm: t(:text_are_you_sure), + method: :delete, + }, + title: I18n.t(:button_delete)) do |button| + button.with_leading_visual_icon(icon: :trash) + t(:button_delete) + end + end + end +%> diff --git a/app/components/groups/show_page_header_component.rb b/app/components/groups/show_page_header_component.rb new file mode 100644 index 00000000000..14a34d03869 --- /dev/null +++ b/app/components/groups/show_page_header_component.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true + +# -- 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 Groups + class ShowPageHeaderComponent < ApplicationComponent + include OpPrimer::ComponentHelpers + include ApplicationHelper + + def initialize(group:, current_user:) + super + @group = group + @current_user = current_user + end + + def breadcrumb_items + [{ href: groups_path, text: t(:label_group_plural) }, + @group.name] + end + end +end diff --git a/app/components/individual_principal_base_filter_component.html.erb b/app/components/individual_principal_base_filter_component.html.erb index 265c4a8ad61..4c7b44a7154 100644 --- a/app/components/individual_principal_base_filter_component.html.erb +++ b/app/components/individual_principal_base_filter_component.html.erb @@ -1,6 +1,6 @@ <%#-- copyright OpenProject is an open source project management software. -Copyright (C) 2012-2024 the OpenProject GmbH +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. diff --git a/app/components/individual_principal_base_filter_component.rb b/app/components/individual_principal_base_filter_component.rb index b82f9f6bd26..7e1291b6cfe 100644 --- a/app/components/individual_principal_base_filter_component.rb +++ b/app/components/individual_principal_base_filter_component.rb @@ -2,13 +2,13 @@ #-- copyright # OpenProject is an open source project management software. -# Copyright (C) 2012-2024 the OpenProject GmbH +# 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-2017 Jean-Philippe Lang +# 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 diff --git a/app/components/ldap_auth_sources/row_component.rb b/app/components/ldap_auth_sources/row_component.rb index 975c87e4625..f1ee95ed1a9 100644 --- a/app/components/ldap_auth_sources/row_component.rb +++ b/app/components/ldap_auth_sources/row_component.rb @@ -2,7 +2,7 @@ #-- copyright # OpenProject is an open source project management software. -# Copyright (C) 2012-2024 the OpenProject GmbH +# 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. diff --git a/app/components/ldap_auth_sources/table_component.rb b/app/components/ldap_auth_sources/table_component.rb index ffbf507c6b3..fd174d9a938 100644 --- a/app/components/ldap_auth_sources/table_component.rb +++ b/app/components/ldap_auth_sources/table_component.rb @@ -2,7 +2,7 @@ #-- copyright # OpenProject is an open source project management software. -# Copyright (C) 2012-2024 the OpenProject GmbH +# 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. diff --git a/app/components/mailer/label_component.html.erb b/app/components/mailer/label_component.html.erb index 6458d760521..dfb09abfc2d 100644 --- a/app/components/mailer/label_component.html.erb +++ b/app/components/mailer/label_component.html.erb @@ -1,6 +1,6 @@ <%#-- copyright OpenProject is an open source project management software. -Copyright (C) 2012-2024 the OpenProject GmbH +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. diff --git a/app/components/mailer/label_component.rb b/app/components/mailer/label_component.rb index ac7f62c3285..14ac26f9e4a 100644 --- a/app/components/mailer/label_component.rb +++ b/app/components/mailer/label_component.rb @@ -2,7 +2,7 @@ #-- copyright # OpenProject is an open source project management software. -# Copyright (C) 2012-2024 the OpenProject GmbH +# 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. diff --git a/app/components/members/delete_member_dialog_component.html.erb b/app/components/members/delete_member_dialog_component.html.erb index b64bc38eea4..fa1b200f681 100644 --- a/app/components/members/delete_member_dialog_component.html.erb +++ b/app/components/members/delete_member_dialog_component.html.erb @@ -1,6 +1,6 @@ <%#-- copyright OpenProject is an open source project management software. -Copyright (C) 2012-2024 the OpenProject GmbH +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. diff --git a/app/components/members/delete_member_dialog_component.rb b/app/components/members/delete_member_dialog_component.rb index bb8cf602d9a..881fd94ba33 100644 --- a/app/components/members/delete_member_dialog_component.rb +++ b/app/components/members/delete_member_dialog_component.rb @@ -2,7 +2,7 @@ #-- copyright # OpenProject is an open source project management software. -# Copyright (C) 2012-2024 the OpenProject GmbH +# 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. diff --git a/app/components/members/delete_work_package_shares_dialog_component.html.erb b/app/components/members/delete_work_package_shares_dialog_component.html.erb index ebd80af1a1c..202e3bc69e7 100644 --- a/app/components/members/delete_work_package_shares_dialog_component.html.erb +++ b/app/components/members/delete_work_package_shares_dialog_component.html.erb @@ -1,6 +1,6 @@ <%#-- copyright OpenProject is an open source project management software. -Copyright (C) 2012-2024 the OpenProject GmbH +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. diff --git a/app/components/members/delete_work_package_shares_dialog_component.rb b/app/components/members/delete_work_package_shares_dialog_component.rb index 27cc84d2d37..c651329c92f 100644 --- a/app/components/members/delete_work_package_shares_dialog_component.rb +++ b/app/components/members/delete_work_package_shares_dialog_component.rb @@ -2,7 +2,7 @@ #-- copyright # OpenProject is an open source project management software. -# Copyright (C) 2012-2024 the OpenProject GmbH +# 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. diff --git a/app/components/members/index_page_header_component.rb b/app/components/members/index_page_header_component.rb index 167c97d4ad3..c0df1b1bbd9 100644 --- a/app/components/members/index_page_header_component.rb +++ b/app/components/members/index_page_header_component.rb @@ -2,7 +2,7 @@ # -- copyright # OpenProject is an open source project management software. -# Copyright (C) 2010-2024 the OpenProject GmbH +# 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. diff --git a/app/components/members/index_sub_header_component.rb b/app/components/members/index_sub_header_component.rb index 1ee814e243f..1f4efa876b5 100644 --- a/app/components/members/index_sub_header_component.rb +++ b/app/components/members/index_sub_header_component.rb @@ -2,7 +2,7 @@ # -- copyright # OpenProject is an open source project management software. -# Copyright (C) 2010-2024 the OpenProject GmbH +# 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. diff --git a/app/components/members/role_form_component.html.erb b/app/components/members/role_form_component.html.erb index eb562af91c9..b0b1112f1e7 100644 --- a/app/components/members/role_form_component.html.erb +++ b/app/components/members/role_form_component.html.erb @@ -1,6 +1,6 @@ <%#-- copyright OpenProject is an open source project management software. -Copyright (C) 2012-2024 the OpenProject GmbH +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. diff --git a/app/components/members/role_form_component.rb b/app/components/members/role_form_component.rb index c207c31c03d..ae11149e7db 100644 --- a/app/components/members/role_form_component.rb +++ b/app/components/members/role_form_component.rb @@ -2,7 +2,7 @@ #-- copyright # OpenProject is an open source project management software. -# Copyright (C) 2012-2024 the OpenProject GmbH +# 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. diff --git a/app/components/members/row_component.rb b/app/components/members/row_component.rb index 41b96e6a06b..5820e45f88a 100644 --- a/app/components/members/row_component.rb +++ b/app/components/members/row_component.rb @@ -2,7 +2,7 @@ #-- copyright # OpenProject is an open source project management software. -# Copyright (C) 2012-2024 the OpenProject GmbH +# 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. diff --git a/app/components/members/table_component.rb b/app/components/members/table_component.rb index 9ab1fc921b0..4b4c4895263 100644 --- a/app/components/members/table_component.rb +++ b/app/components/members/table_component.rb @@ -2,7 +2,7 @@ #-- copyright # OpenProject is an open source project management software. -# Copyright (C) 2012-2024 the OpenProject GmbH +# 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. diff --git a/app/components/members/user_filter_component.rb b/app/components/members/user_filter_component.rb index 0ef24a8de7f..87eee13dd37 100644 --- a/app/components/members/user_filter_component.rb +++ b/app/components/members/user_filter_component.rb @@ -2,7 +2,7 @@ #-- copyright # OpenProject is an open source project management software. -# Copyright (C) 2012-2024 the OpenProject GmbH +# 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. diff --git a/app/components/my/access_token/access_token_created_dialog_component.html.erb b/app/components/my/access_token/access_token_created_dialog_component.html.erb new file mode 100644 index 00000000000..cd773f77eda --- /dev/null +++ b/app/components/my/access_token/access_token_created_dialog_component.html.erb @@ -0,0 +1,63 @@ +<%#-- 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. + +++#%> + +<%= + render(Primer::OpenProject::FeedbackDialog.new( + id:, + title: nil, + size: :large + )) do |dialog| + dialog.with_feedback_message do |message| + message.with_heading(tag: :h2) { I18n.t("my.access_token.create_dialog.header", type: "API") } + end + + dialog.with_additional_content do + flex_layout do |flex| + flex.with_row(mb: 2) do + render(Primer::OpenProject::InputGroup.new) do |input_group| + input_group.with_text_input(name: :openproject_api_access_token, + label: Token::API.model_name.human, + visually_hide_label: false, + value: @token_value) + input_group.with_trailing_action_clipboard_copy_button( + value: @token_value, + aria: { + label: I18n.t('button_copy_to_clipboard') + }) + end + end + flex.with_row do + render(Primer::Alpha::Banner.new(scheme: :warning, icon: :alert)) do + I18n.t("my.access_token.create_dialog.warning") + end + end + end + end + end +%> diff --git a/app/components/my/access_token/access_token_created_dialog_component.rb b/app/components/my/access_token/access_token_created_dialog_component.rb new file mode 100644 index 00000000000..4dce63aade4 --- /dev/null +++ b/app/components/my/access_token/access_token_created_dialog_component.rb @@ -0,0 +1,47 @@ +#-- 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. +#++ + +# This component renders a dialog with the new access token which the user has to copy. +module My + module AccessToken + class AccessTokenCreatedDialogComponent < ApplicationComponent + include OpTurbo::Streamable + include OpPrimer::ComponentHelpers + + def initialize(token_value:) + super + + @token_value = token_value + end + + def id + "access-token-created-dialog" + end + end + end +end diff --git a/app/components/my/access_token/api/row_component.rb b/app/components/my/access_token/api/row_component.rb new file mode 100644 index 00000000000..70641421e9c --- /dev/null +++ b/app/components/my/access_token/api/row_component.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true + +#-- 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 My + module AccessToken + module API + class RowComponent < ::RowComponent + def api_token + model + end + + def token_name + if api_token.token_name.nil? + t("my_account.access_tokens.api.static_token_name") + else + api_token.token_name + end + end + + def created_at + helpers.format_time(api_token.created_at) + end + + def expires_on + I18n.t("my_account.access_tokens.indefinite_expiration") + end + + def button_links + [delete_link].compact + end + + def delete_link + link_to "", + { + controller: :my, + action: "revoke_api_key", + token_id: api_token.id + }, + method: :delete, + data: { confirm: t("my_account.access_tokens.simple_revoke_confirmation"), test_selector: "api-token-revoke" }, + class: "icon icon-delete" + end + end + end + end +end diff --git a/app/components/my/access_token/api/table_component.rb b/app/components/my/access_token/api/table_component.rb new file mode 100644 index 00000000000..dc0cd690e53 --- /dev/null +++ b/app/components/my/access_token/api/table_component.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true + +#-- 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 My + module AccessToken + module API + class TableComponent < ::TableComponent + def initial_sort + %i[id asc] + end + + def sortable? + false + end + + def headers + [ + ["token_name", { caption: I18n.t("attributes.name") }], + ["created_at", { caption: User.human_attribute_name(:created_at) }], + ["expires_on", { caption: I18n.t("my_account.access_tokens.headers.expiration") }] + ] + end + + def columns + headers.map(&:first) + end + end + end + end +end diff --git a/app/components/my/access_token/api_tokens_section_component.html.erb b/app/components/my/access_token/api_tokens_section_component.html.erb new file mode 100644 index 00000000000..cd6206d5638 --- /dev/null +++ b/app/components/my/access_token/api_tokens_section_component.html.erb @@ -0,0 +1,57 @@ +<%#-- 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. + +++#%> + +<%= component_wrapper do %> +
    +
    +
    +

    <%= t("my_account.access_tokens.api.title") %>

    +
    +
    +
    +

    + <%= t("my_account.access_tokens.api.text_hint") %> +

    + <% if Setting.rest_api_enabled? %> + <% if @api_tokens.any? %> + <%= render My::AccessToken::API::TableComponent.new(rows: @api_tokens) %> + <% end %> + <%= render My::AccessToken::NewAccessTokenComponent.new %> + <% else %> +
    + +
    + <% end %> +
    +
    +<% end %> diff --git a/app/components/my/access_token/api_tokens_section_component.rb b/app/components/my/access_token/api_tokens_section_component.rb new file mode 100644 index 00000000000..e6aa64c2835 --- /dev/null +++ b/app/components/my/access_token/api_tokens_section_component.rb @@ -0,0 +1,47 @@ +#-- 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. +#++ + +# This components renders a dialog to confirm the deletion of a project from a storage. +module My + module AccessToken + class APITokensSectionComponent < ::ApplicationComponent + include OpTurbo::Streamable + include Redmine::I18n + + def initialize(api_tokens:) + super + + @api_tokens = api_tokens + end + + def id + "api-tokens-section-component" + end + end + end +end diff --git a/app/components/my/access_token/new_access_token_component.html.erb b/app/components/my/access_token/new_access_token_component.html.erb index e7eaae379dc..fcda19cf2ea 100644 --- a/app/components/my/access_token/new_access_token_component.html.erb +++ b/app/components/my/access_token/new_access_token_component.html.erb @@ -1,6 +1,6 @@ <%#-- copyright OpenProject is an open source project management software. -Copyright (C) 2012-2024 the OpenProject GmbH +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. diff --git a/app/components/my/access_token/new_access_token_component.rb b/app/components/my/access_token/new_access_token_component.rb index 3c80550c9c5..45e15b3a213 100644 --- a/app/components/my/access_token/new_access_token_component.rb +++ b/app/components/my/access_token/new_access_token_component.rb @@ -2,7 +2,7 @@ #-- copyright # OpenProject is an open source project management software. -# Copyright (C) 2012-2023 the OpenProject GmbH +# 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. diff --git a/app/components/my/access_token/new_access_token_form.rb b/app/components/my/access_token/new_access_token_form.rb index 93d78649488..398e481a363 100644 --- a/app/components/my/access_token/new_access_token_form.rb +++ b/app/components/my/access_token/new_access_token_form.rb @@ -2,7 +2,7 @@ #-- copyright # OpenProject is an open source project management software. -# Copyright (C) 2012-2023 the OpenProject GmbH +# 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. diff --git a/app/components/my/access_token/new_access_token_form_component.html.erb b/app/components/my/access_token/new_access_token_form_component.html.erb index 90c080753f0..e179d484ec2 100644 --- a/app/components/my/access_token/new_access_token_form_component.html.erb +++ b/app/components/my/access_token/new_access_token_form_component.html.erb @@ -1,6 +1,6 @@ <%#-- copyright OpenProject is an open source project management software. -Copyright (C) 2012-2024 the OpenProject GmbH +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. diff --git a/app/components/my/access_token/new_access_token_form_component.rb b/app/components/my/access_token/new_access_token_form_component.rb index d6b8a91ebd6..8a38ec8aac5 100644 --- a/app/components/my/access_token/new_access_token_form_component.rb +++ b/app/components/my/access_token/new_access_token_form_component.rb @@ -2,7 +2,7 @@ #-- copyright # OpenProject is an open source project management software. -# Copyright (C) 2012-2023 the OpenProject GmbH +# 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. diff --git a/app/components/notifications/index_page_header_component.html.erb b/app/components/notifications/index_page_header_component.html.erb new file mode 100644 index 00000000000..2c56ef78df3 --- /dev/null +++ b/app/components/notifications/index_page_header_component.html.erb @@ -0,0 +1,15 @@ +<%= render(Primer::OpenProject::PageHeader.new) do |header| + header.with_title { page_title } + header.with_breadcrumbs(breadcrumb_items) + + header.with_action_button(tag: :a, + mobile_icon: :gear, + mobile_label: I18n.t(:label_setting_plural), + href: my_notifications_path, + size: :medium, + target: "_blank", + aria: { label: I18n.t("js.notifications.settings.title") }) do |button| + button.with_leading_visual_icon(icon: :gear) + I18n.t(:label_setting_plural) + end +end %> diff --git a/app/components/notifications/index_page_header_component.rb b/app/components/notifications/index_page_header_component.rb new file mode 100644 index 00000000000..2589da0ccec --- /dev/null +++ b/app/components/notifications/index_page_header_component.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +# -- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2010-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. +# ++ + +module Notifications + class IndexPageHeaderComponent < ApplicationComponent + include ApplicationHelper + + def initialize(project: nil) + super + @project = project + end + + def page_title + I18n.t("js.notifications.title") + end + + def breadcrumb_items + [parent_element, + page_title] + end + + def parent_element + { href: home_path, text: I18n.t(:label_home) } + end + end +end diff --git a/app/components/notifications/index_sub_header_component.html.erb b/app/components/notifications/index_sub_header_component.html.erb new file mode 100644 index 00000000000..3554007d2c7 --- /dev/null +++ b/app/components/notifications/index_sub_header_component.html.erb @@ -0,0 +1,25 @@ +<%= render(Primer::OpenProject::SubHeader.new) do |subheader| + subheader.with_filter_component do + render(Primer::Alpha::SegmentedControl.new("aria-label": I18n.t(:label_filter_plural))) do |control| + control.with_item(tag: :a, + href: notifications_path(facet: nil, **current_filters), + label: t("notifications.facets.unread"), + title: t("notifications.facets.unread_title"), + selected: @facet != "all") + control.with_item(tag: :a, + href: notifications_path(facet: "all", **current_filters), + label: t("notifications.facets.all"), + title: t("notifications.facets.all_title"), + selected: @facet == "all") + end + end + + subheader.with_action_button(tag: :a, + href: mark_all_read_notifications_path(**current_filters), + data: { method: :post }, + size: :medium, + aria: { label: I18n.t("js.notifications.center.mark_all_read") }) do |button| + button.with_leading_visual_icon(icon: :'op-read-all') + I18n.t("js.notifications.center.mark_all_read") + end +end %> diff --git a/app/components/notifications/index_sub_header_component.rb b/app/components/notifications/index_sub_header_component.rb new file mode 100644 index 00000000000..6ee231797e4 --- /dev/null +++ b/app/components/notifications/index_sub_header_component.rb @@ -0,0 +1,49 @@ +# frozen_string_literal: true + +# -- copyright +# OpenProject is an open source project management software. +# Copyright (C) 2010-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. +# ++ + +module Notifications + class IndexSubHeaderComponent < ApplicationComponent + include ApplicationHelper + + attr_reader :facet, :filter_type, :filter_name + + def initialize(project: nil, facet: nil, filter_type: nil, filter_name: nil) + super + @project = project + @facet = facet + @filter_type = filter_type + @filter_name = filter_name + end + + def current_filters + @current_filters ||= { filter: @filter_type, name: @filter_name }.compact + end + end +end diff --git a/app/components/oauth/applications/application_row_component.html.erb b/app/components/oauth/applications/application_row_component.html.erb new file mode 100644 index 00000000000..0a7e9787336 --- /dev/null +++ b/app/components/oauth/applications/application_row_component.html.erb @@ -0,0 +1,43 @@ +<%= + component_wrapper(data: { 'test-selector': "op-admin-oauth--application" }) do + flex_layout(align_items: :center, justify_content: :space_between) do |oauth_application_container| + oauth_application_container.with_column(flex_layout: true) do |application_information| + application_information.with_column(mr: 2) do + render(Primer::Beta::Link.new(href: oauth_application_path(@application), font_weight: :bold)) do + @application.name + end + end + + application_information.with_column(mr: 2) do + render(Primer::Beta::Text.new(font_size: :small, color: :subtle)) do + if @application.builtin? + t("oauth.application.builtin") + else + t(:label_created_by, user: @application.owner) + end + end + end + + unless @application.builtin? + application_information.with_column do + render(Primer::Beta::Label.new) do + @application.confidential? ? t("oauth.application.confidential") : t("oauth.application.non_confidential") + end + end + end + end + + # Actions + oauth_application_container.with_column do + render(Primer::Alpha::ToggleSwitch.new( + src: toggle_oauth_application_path(@application), + csrf_token: form_authenticity_token, + checked: @application.enabled?, + data: { + 'test-selector': "op-admin-oauth--application-enabled-toggle-switch" + } + )) + end + end + end +%> diff --git a/app/components/oauth/applications/application_row_component.rb b/app/components/oauth/applications/application_row_component.rb new file mode 100644 index 00000000000..8ee4387de71 --- /dev/null +++ b/app/components/oauth/applications/application_row_component.rb @@ -0,0 +1,43 @@ +#-- 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 OAuth + module Applications + class ApplicationRowComponent < ApplicationComponent + include ApplicationHelper + include OpPrimer::ComponentHelpers + include OpTurbo::Streamable + + def initialize(application:) + @application = application + + super + end + end + end +end diff --git a/app/components/oauth/applications/index_component.html.erb b/app/components/oauth/applications/index_component.html.erb new file mode 100644 index 00000000000..e5f0d0b4bee --- /dev/null +++ b/app/components/oauth/applications/index_component.html.erb @@ -0,0 +1,55 @@ +<%= + component_wrapper do + flex_layout do |index_container| + if OpenProject::FeatureDecisions.built_in_oauth_applications_active? + index_container.with_row do + render(border_box_container(mb: 4, data: { + 'test-selector': "op-admin-oauth--built-in-applications" + })) do |component| + component.with_header(font_weight: :bold) do + render(Primer::Beta::Text.new) do + t("oauth.header.builtin_applications") + end + end + + if @built_in_applications.empty? + component.with_row do + render(Primer::Beta::Text.new(data: { + 'test-selector': "op-admin-oauth--built-in-applications-placeholder" + })) do + t("oauth.empty_application_lists") + end + end + end + + @built_in_applications.each do |application| + component.with_row { render(OAuth::Applications::ApplicationRowComponent.new(application:)) } + end + end + end + end + + index_container.with_row do + render(border_box_container(mb: 4)) do |component| + component.with_header(font_weight: :bold) do + render(Primer::Beta::Text.new) do + t("oauth.header.other_applications") + end + end + + if @other_applications.empty? + component.with_row do + render(Primer::Beta::Text.new(data: { 'test-selector': "op-admin-oauth--applications-placeholder" })) do + t("oauth.empty_application_lists") + end + end + end + + @other_applications.each do |application| + component.with_row { render(OAuth::Applications::ApplicationRowComponent.new(application:)) } + end + end + end + end + end +%> diff --git a/spec/support/pages/notifications/split_screen.rb b/app/components/oauth/applications/index_component.rb similarity index 74% rename from spec/support/pages/notifications/split_screen.rb rename to app/components/oauth/applications/index_component.rb index 0f8c943c0bf..81027eea51f 100644 --- a/spec/support/pages/notifications/split_screen.rb +++ b/app/components/oauth/applications/index_component.rb @@ -1,6 +1,6 @@ #-- copyright # OpenProject is an open source project management software. -# Copyright (C) 2012-2024 the OpenProject GmbH +# 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. @@ -26,17 +26,18 @@ # See COPYRIGHT and LICENSE files for more details. #++ -require "support/pages/page" -require "support/pages/work_packages/split_work_package" +module OAuth + module Applications + class IndexComponent < ApplicationComponent + include ApplicationHelper + include OpPrimer::ComponentHelpers + include OpTurbo::Streamable -module Pages - module Notifications - class SplitScreen < ::Pages::SplitWorkPackage - include ::Components::Autocompleter::NgSelectAutocompleteHelpers + def initialize(oauth_applications:) + @built_in_applications = oauth_applications.select(&:builtin?) + @other_applications = oauth_applications.reject(&:builtin?) - def initialize(work_package, project = nil) super - @selector = ".work-packages--details" end end end diff --git a/app/components/oauth/applications/table_component.rb b/app/components/oauth/applications/table_component.rb deleted file mode 100644 index 144742596aa..00000000000 --- a/app/components/oauth/applications/table_component.rb +++ /dev/null @@ -1,76 +0,0 @@ -# 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. -#++ - -module OAuth - module Applications - class TableComponent < ::TableComponent - class << self - def row_class - ::OAuth::Applications::RowComponent - end - end - - def initial_sort - %i[id asc] - end - - def sortable? - false - end - - def columns - headers.map(&:first) - end - - def inline_create_link - link_to new_oauth_application_path, - aria: { label: t("oauth.application.new") }, - class: "wp-inline-create--add-link", - title: t("oauth.application.new") do - helpers.op_icon("icon icon-add") - end - end - - def empty_row_message - I18n.t :no_results_title_text - end - - def headers - [ - ["name", { caption: ::Doorkeeper::Application.human_attribute_name(:name) }], - ["owner", { caption: ::Doorkeeper::Application.human_attribute_name(:owner) }], - ["client_credentials", { caption: I18n.t("oauth.client_credentials") }], - ["redirect_uri", { caption: ::Doorkeeper::Application.human_attribute_name(:redirect_uri) }], - ["confidential", { caption: ::Doorkeeper::Application.human_attribute_name(:confidential) }] - ] - end - end - end -end diff --git a/app/components/oauth/show_page_header_component.html.erb b/app/components/oauth/show_page_header_component.html.erb new file mode 100644 index 00000000000..8bb3d06627e --- /dev/null +++ b/app/components/oauth/show_page_header_component.html.erb @@ -0,0 +1,64 @@ +<%#-- 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. + +++#%> + +<%= + render Primer::OpenProject::PageHeader.new do |header| + header.with_title { h(@application.name) } + header.with_breadcrumbs(breadcrumb_items) + + unless @application.builtin? + header.with_action_button(tag: :a, + mobile_icon: :pencil, + mobile_label: t(:button_edit), + size: :medium, + href: edit_oauth_application_path(@application), + aria: { label: I18n.t(:button_edit) }, + title: I18n.t(:button_edit)) do |button| + button.with_leading_visual_icon(icon: :pencil) + t(:button_edit) + end + + header.with_action_button(tag: :a, + scheme: :danger, + mobile_icon: :trash, + mobile_label: t(:button_delete), + size: :medium, + href: oauth_application_path(@application), + aria: { label: I18n.t(:button_delete) }, + data: { + confirm: I18n.t(:text_are_you_sure), + method: :delete + }, + title: I18n.t(:button_delete)) do |button| + button.with_leading_visual_icon(icon: :trash) + t(:button_delete) + end + end + end +%> diff --git a/app/components/oauth/show_page_header_component.rb b/app/components/oauth/show_page_header_component.rb new file mode 100644 index 00000000000..531ff53dfb4 --- /dev/null +++ b/app/components/oauth/show_page_header_component.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +#-- 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. +#++ + +class OAuth::ShowPageHeaderComponent < ApplicationComponent + include OpPrimer::ComponentHelpers + include ApplicationHelper + + def initialize(application:) + super + @application = application + end + + def breadcrumb_items + [{ href: admin_index_path, text: t(:label_administration) }, + { href: admin_settings_authentication_path, text: t(:label_authentication) }, + { href: oauth_applications_path, text: t("oauth.application.plural") }, + h(@application.name)] + end +end diff --git a/app/views/placeholder_users/_toolbar_delete.html.erb b/app/components/op_primer/border_box_row_component.html.erb similarity index 62% rename from app/views/placeholder_users/_toolbar_delete.html.erb rename to app/components/op_primer/border_box_row_component.html.erb index db90328a763..f2ffcf6ad83 100644 --- a/app/views/placeholder_users/_toolbar_delete.html.erb +++ b/app/components/op_primer/border_box_row_component.html.erb @@ -1,6 +1,6 @@ <%#-- copyright OpenProject is an open source project management software. -Copyright (C) 2012-2024 the OpenProject GmbH +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. @@ -27,22 +27,22 @@ See COPYRIGHT and LICENSE files for more details. ++#%> -<% if can_delete_placeholder_user?(@placeholder_user) %> -
  • - <%= link_to deletion_info_placeholder_user_path(@placeholder_user), - class: 'button' do %> - <%= op_icon('button--icon icon-delete') %> - <%= t(:button_delete) %> - <% end %> -
  • -<% else %> -
  • - <%= content_tag :span, title: I18n.t('placeholder_users.right_to_manage_members_missing') do %> - <%= link_to '#', - class: 'button -disabled' do %> - <%= op_icon('button--icon icon-delete') %> - <%= t(:button_delete) %> +<%= + render Primer::BaseComponent.new( + tag: :div, + id: row_css_id, + classes: "#{table.grid_class} #{row_css_class}", + ) do %> + <% columns.each do |column| %> + <%= render(Primer::BaseComponent.new(tag: :div, classes: column_css_class(column), **column_args(column))) { column_value(column) } %> + <% end %> + + <% if table.has_actions? %> + <%= flex_layout(align_items: :center, justify_content: :flex_end) do |flex| %> + <% button_links.each_with_index do |link, i| %> + <% args = i == (button_links.count - 1) ? {} : { mr: 1 } %> + <% flex.with_column(**args) { link } %> <% end %> <% end %> -
  • + <% end %> <% end %> diff --git a/app/components/op_primer/border_box_row_component.rb b/app/components/op_primer/border_box_row_component.rb new file mode 100644 index 00000000000..5c3b2112015 --- /dev/null +++ b/app/components/op_primer/border_box_row_component.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +#-- 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 OpPrimer + class BorderBoxRowComponent < RowComponent # rubocop:disable OpenProject/AddPreviewForViewComponent + include ComponentHelpers + + def column_args(_column) + {} + end + + def checkmark(condition) + if condition + render(Primer::Beta::Octicon.new(icon: :check)) + end + end + end +end diff --git a/app/components/op_primer/border_box_table_component.html.erb b/app/components/op_primer/border_box_table_component.html.erb new file mode 100644 index 00000000000..6b28c0c49e1 --- /dev/null +++ b/app/components/op_primer/border_box_table_component.html.erb @@ -0,0 +1,53 @@ +<%#-- 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. + +++#%> + +<%= + render( + border_box_container( + classes: container_class, + test_selector:, + )) do |component| + component.with_header(classes: grid_class, color: :muted) do + headers.each do |name, args| + caption = args.delete(:caption) + concat render(Primer::Beta::Text.new(font_weight: :semibold, **header_args(name))) { caption } + end + + if has_actions? + concat render(Primer::BaseComponent.new(tag: :div)) + end + end + + rows.each do |row| + component.with_row(scheme: :default) do + render(row_class.new(row:, table: self)) + end + end + end +%> diff --git a/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/file_ids_query.rb b/app/components/op_primer/border_box_table_component.rb similarity index 70% rename from modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/file_ids_query.rb rename to app/components/op_primer/border_box_table_component.rb index 0335b6b6126..84f5dee8361 100644 --- a/modules/storages/app/common/storages/peripherals/storage_interaction/nextcloud/file_ids_query.rb +++ b/app/components/op_primer/border_box_table_component.rb @@ -1,6 +1,8 @@ +# frozen_string_literal: true + #-- copyright # OpenProject is an open source project management software. -# Copyright (C) 2012-2024 the OpenProject GmbH +# 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. @@ -26,24 +28,31 @@ # See COPYRIGHT and LICENSE files for more details. #++ -module Storages::Peripherals::StorageInteraction::Nextcloud - class FileIdsQuery - def initialize(storage) - @query = ::Storages::Peripherals::StorageInteraction::Nextcloud::Internal::PropfindQueryLegacy.new(storage) +module OpPrimer + class BorderBoxTableComponent < TableComponent + include ComponentHelpers + + def before_render + raise ArgumentError, "BorderBoxTableComponent cannot be #sortable?" if sortable? + + super end - def self.call(storage:, path:) - new(storage).call(path:) + def header_args(_column) + {} end - def call(path:) - query_params = { - depth: "1", - path:, - props: %w[oc:fileid] - } + # Default grid class with equal weights + def grid_class + "op-border-box-grid" + end - @query.call(**query_params) + def has_actions? + false + end + + def sortable? + false end end end diff --git a/app/components/op_primer/border_box_table_component.sass b/app/components/op_primer/border_box_table_component.sass new file mode 100644 index 00000000000..254c212dffc --- /dev/null +++ b/app/components/op_primer/border_box_table_component.sass @@ -0,0 +1,7 @@ +.op-border-box-grid + display: grid + justify-content: flex-start + align-items: center + // Distribute columns evenly by default + grid-auto-columns: minmax(0, 1fr) + grid-auto-flow: column diff --git a/app/components/op_primer/box_collection_component.html.erb b/app/components/op_primer/box_collection_component.html.erb index bb48bb9b959..7a001ae20a0 100644 --- a/app/components/op_primer/box_collection_component.html.erb +++ b/app/components/op_primer/box_collection_component.html.erb @@ -1,6 +1,6 @@ <%#-- copyright OpenProject is an open source project management software. -Copyright (C) 2012-2024 the OpenProject GmbH +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. diff --git a/app/components/op_primer/box_collection_component.rb b/app/components/op_primer/box_collection_component.rb index 91cc31be24b..5f3dc5b2940 100644 --- a/app/components/op_primer/box_collection_component.rb +++ b/app/components/op_primer/box_collection_component.rb @@ -1,6 +1,6 @@ #-- copyright # OpenProject is an open source project management software. -# Copyright (C) 2012-2024 the OpenProject GmbH +# 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. diff --git a/app/components/op_primer/component_collection_component.html.erb b/app/components/op_primer/component_collection_component.html.erb index 6eda7cd0f6e..634948f2cf2 100644 --- a/app/components/op_primer/component_collection_component.html.erb +++ b/app/components/op_primer/component_collection_component.html.erb @@ -1,6 +1,6 @@ <%#-- copyright OpenProject is an open source project management software. -Copyright (C) 2012-2024 the OpenProject GmbH +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. diff --git a/app/components/op_primer/component_collection_component.rb b/app/components/op_primer/component_collection_component.rb index 7ff21122438..2d1018b2ab2 100644 --- a/app/components/op_primer/component_collection_component.rb +++ b/app/components/op_primer/component_collection_component.rb @@ -1,6 +1,6 @@ #-- copyright # OpenProject is an open source project management software. -# Copyright (C) 2012-2024 the OpenProject GmbH +# 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. diff --git a/app/components/op_primer/component_helpers.rb b/app/components/op_primer/component_helpers.rb index 79a91a46ba0..affe44f5945 100644 --- a/app/components/op_primer/component_helpers.rb +++ b/app/components/op_primer/component_helpers.rb @@ -1,6 +1,6 @@ #-- copyright # OpenProject is an open source project management software. -# Copyright (C) 2012-2024 the OpenProject GmbH +# 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. diff --git a/app/components/op_primer/expandable_list_component.html.erb b/app/components/op_primer/expandable_list_component.html.erb index d404045d160..b997e9f6fe5 100644 --- a/app/components/op_primer/expandable_list_component.html.erb +++ b/app/components/op_primer/expandable_list_component.html.erb @@ -1,8 +1,8 @@ <%= component_wrapper(data: wrapper_data_attributes) do if elements.count == 0 - render(Primer::Beta::Text.new(color: :subtle)) { t("label_meeting_no_items") } - elsif elements.count <= @cutoff_limit + render(Primer::Beta::Text.new(color: :subtle)) { t("label_meeting_no_participants") } + elsif @cutoff_limit.nil? || elements.count <= @cutoff_limit flex_layout do |list| elements.each do |item| list.with_row(mt: 1) { item.to_s } @@ -13,26 +13,26 @@ elements.take(@cutoff_limit).each do |item| list.with_row(mt: 1) { item.to_s } end - - list.with_row do - flex_layout do |flex| - flex.with_row(display: :none, data: { 'expandable-list-target': "hiddenElements" }) do - flex_layout do |hidden_user_list| - elements[@cutoff_limit..].each do |item| - hidden_user_list.with_row(mt: 1) { item.to_s } - end - end + list.with_row(display: :none, data: { "expandable-list-target": "hiddenElements" }) do + flex_layout do |hidden_user_list| + elements[@cutoff_limit..].each do |item| + hidden_user_list.with_row(mt: 1) { item.to_s } end - flex.with_row(mt: 1) do + hidden_user_list.with_row(mt: 2) do render(Primer::Beta::Button.new( - scheme: :link, - data: { 'expandable-list-target': "showHideButton", - action: 'click->expandable-list#showhiddenElements keydown.enter->expandable-list#showhiddenElements' - } - )) { I18n.t('label_show_hide_n_items', count: elements.count - @cutoff_limit) } + scheme: :link, + data: { action: "expandable-list#hideElements" } + )) { I18n.t("label_show_less") } end end end + list.with_row(mt: 2) do + render(Primer::Beta::Button.new( + scheme: :link, + data: { "expandable-list-target": "showButton", + action: "expandable-list#showElements" } + )) { I18n.t("label_show_n_more", count: elements.count - @cutoff_limit) } + end end end end diff --git a/app/components/op_primer/expandable_list_component.rb b/app/components/op_primer/expandable_list_component.rb index 9378b0b479a..ead8cdf208a 100644 --- a/app/components/op_primer/expandable_list_component.rb +++ b/app/components/op_primer/expandable_list_component.rb @@ -2,7 +2,7 @@ #-- copyright # OpenProject is an open source project management software. -# Copyright (C) 2012-2024 the OpenProject GmbH +# 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. diff --git a/app/components/op_primer/form_helpers.rb b/app/components/op_primer/form_helpers.rb new file mode 100644 index 00000000000..fb742d2a5d4 --- /dev/null +++ b/app/components/op_primer/form_helpers.rb @@ -0,0 +1,97 @@ +# frozen_string_literal: true + +#-- 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 OpPrimer + module FormHelpers + # Renders an inline form without needing a dedicated form class. + # + # This method dynamically creates a form class based on the provided block + # and renders it. The form is instantiated with the provided form builder + # which comes from a `primer_form_with` call. + # + # It is meant to avoid boilerplate classes for simple forms. + # + # @example + # primer_form_with(action: :update) do |form_builder| + # render_inline_form(form_builder) do |form| + # form.text_field( + # name: :ultimate_answer, + # label: "Ultimate answer", + # required: true, + # caption: "The answer to life, the universe, and everything" + # ) + # form.submit(name: :submit, label: "Submit") + # end + # end + # + # @param form_builder [Object] The form builder object to be used for the form. + # @param blk [Proc] A block that defines the form structure. + def render_inline_form(form_builder, &blk) + form_class = Class.new(ApplicationForm) do + form(&blk) + end + render(form_class.new(form_builder)) + end + + # Renders an inline settings form without needing a dedicated form class. + # + # This method dynamically creates a form class based on the provided block + # and renders it. The form is instantiated with the provided form builder + # which comes from a `primer_form_with` call, and decorated with the + # `settings_form` method. + # + # The settings form is providing helpers to render settings in a standard + # way by reading their value, rendering labels from their name, and checking + # if they are writable. + # + # It is meant to avoid boilerplate code. + # + # @example + # primer_form_with(action: :update) do |f| + # render_inline_settings_form(f) do |form| + # form.text_field(name: :attachment_max_size) + # form.radio_button_group( + # name: "work_package_done_ratio", + # values: WorkPackage::DONE_RATIO_OPTIONS + # ) + # form.submit + # end + # end + # + # @param form_builder [Object] The form builder object to be used for the form. + # @param blk [Proc] A block that defines the form structure. + def render_inline_settings_form(form_builder, &blk) + form_class = Class.new(ApplicationForm) do + settings_form(&blk) + end + render(form_class.new(form_builder)) + end + end +end diff --git a/app/components/op_primer/relative_time_component.rb b/app/components/op_primer/relative_time_component.rb index 3171ef824cd..109e4df6488 100644 --- a/app/components/op_primer/relative_time_component.rb +++ b/app/components/op_primer/relative_time_component.rb @@ -2,7 +2,7 @@ #-- copyright # OpenProject is an open source project management software. -# Copyright (C) 2012-2024 the OpenProject GmbH +# 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. diff --git a/app/components/op_turbo/frame_component.html.erb b/app/components/op_turbo/frame_component.html.erb index 2d564a06837..fe5c2885888 100644 --- a/app/components/op_turbo/frame_component.html.erb +++ b/app/components/op_turbo/frame_component.html.erb @@ -1,6 +1,6 @@ <%#-- copyright OpenProject is an open source project management software. -Copyright (C) 2012-2024 the OpenProject GmbH +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. diff --git a/app/components/op_turbo/frame_component.rb b/app/components/op_turbo/frame_component.rb index 29eafe07379..b92c1f565db 100644 --- a/app/components/op_turbo/frame_component.rb +++ b/app/components/op_turbo/frame_component.rb @@ -1,6 +1,6 @@ #-- copyright # OpenProject is an open source project management software. -# Copyright (C) 2012-2024 the OpenProject GmbH +# 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. diff --git a/app/components/op_turbo/stream_component.html.erb b/app/components/op_turbo/stream_component.html.erb index 67e4445ee76..bac890e181e 100644 --- a/app/components/op_turbo/stream_component.html.erb +++ b/app/components/op_turbo/stream_component.html.erb @@ -1,6 +1,6 @@ <%#-- copyright OpenProject is an open source project management software. -Copyright (C) 2012-2024 the OpenProject GmbH +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. diff --git a/app/components/op_turbo/stream_component.rb b/app/components/op_turbo/stream_component.rb index 1db75dd0138..2fb2ecef982 100644 --- a/app/components/op_turbo/stream_component.rb +++ b/app/components/op_turbo/stream_component.rb @@ -1,6 +1,6 @@ #-- copyright # OpenProject is an open source project management software. -# Copyright (C) 2012-2024 the OpenProject GmbH +# 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. diff --git a/app/components/open_project/common/attribute_component.rb b/app/components/open_project/common/attribute_component.rb index 97b38a35e7f..b6ddf5ef662 100644 --- a/app/components/open_project/common/attribute_component.rb +++ b/app/components/open_project/common/attribute_component.rb @@ -1,6 +1,6 @@ #-- copyright # OpenProject is an open source project management software. -# Copyright (C) 2012-2024 the OpenProject GmbH +# 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. diff --git a/app/components/open_project/common/divider_component.rb b/app/components/open_project/common/divider_component.rb new file mode 100644 index 00000000000..841af321efe --- /dev/null +++ b/app/components/open_project/common/divider_component.rb @@ -0,0 +1,42 @@ +# frozen_string_literal: true + +# -- 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 OpenProject + module Common + class DividerComponent < Primer::BaseComponent + def initialize(**system_arguments) + system_arguments[:tag] = :hr + system_arguments[:mt] = system_arguments.fetch(:mt, 3) + system_arguments[:mb] = system_arguments.fetch(:mb, 3) + super(**system_arguments) # rubocop:disable Style/SuperArguments + end + end + end +end diff --git a/app/components/open_project/common/duration_component.rb b/app/components/open_project/common/duration_component.rb index 45bd009080f..bbf2b7a16f3 100644 --- a/app/components/open_project/common/duration_component.rb +++ b/app/components/open_project/common/duration_component.rb @@ -1,6 +1,6 @@ #-- copyright # OpenProject is an open source project management software. -# Copyright (C) 2012-2024 the OpenProject GmbH +# 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. diff --git a/app/components/open_project/common/submenu_component.html.erb b/app/components/open_project/common/submenu_component.html.erb index a76df1ea59f..ee79a844bec 100644 --- a/app/components/open_project/common/submenu_component.html.erb +++ b/app/components/open_project/common/submenu_component.html.erb @@ -1,22 +1,22 @@ -
    +
    <% if @searchable %> -