651 Commits

Author SHA1 Message Date
Kabiru Mwenja f12fc7551f Migrate remaining mailers to format_mail_html / format_mail_text (#23387)
The view-helper migration introduced by the parent PR now covers the
remaining mailer surfaces: UserMailer (`message_posted`, `news_added`,
`news_comment_added`), ProjectMailer (`project_created`),
ProjectArtifactsMailer (`creation_wizard_submitted`), MemberMailer
(`added_project`, `updated_project`, `updated_global`), AnnouncementMailer
(`announce`), DocumentsMailer (`document_added`), and the shared mailer
layout (`localized_emails_header`, `localized_emails_footer`).

Sites drop the `static_html: true` / `only_path: false` / `plain_text: true`
boilerplate; `render_mode:` pinning lives in the helper.

The layout previously called `OpenProject::TextFormatting::Renderer.format_text`
directly, bypassing the helper layer. The empty visibility cache (no
current_user-scoped preload at layout time) is handled by the existing
fallback in `LinkHandlers::WorkPackages#text_only?` — covered by a new
sanity spec in `user_mailer_spec.rb` that exercises the header path with
a WP reference and asserts plain-text formatted_id rendering.

Per-bucket regression coverage added: absolute-URL and formatted_id
assertions across both classic and semantic identifier modes, mirroring
the WorkPackageMailer spec pattern.
2026-05-28 12:48:43 +03:00
Henriette Darge 94dd91476c Merge pull request #22271 from opf/feature/72657-move-banners-to-bottom-right-of-the-screen-so-it-does-not-block-important-content
[72657] Make banners smaller so they do not block important content
2026-03-19 13:39:05 +01:00
Jan Sandbrink 2c4adb8a0a Add special class to move things to the right on mobile
The previous behaviour of op-app-header--center was to not be centered
on mobile, but be right-aligned.

This was confusing and also led to undesired behaviour in the logo_only
layout, where the logo moved to the right unexpectedly.

The behaviour was originally intended for the search bar in the base layout.
To make the behaviour more clear, a new op-app-header--center_mobile-right was introduced,
making it clear that the behaviour of the box in the base layout is to be
centered normally, but right aligned on mobile.
2026-03-16 08:31:09 +01:00
Jan Sandbrink cb2c9ac5a6 Use custom_home_url in no_logo layout as well
Probably another oversight...
2026-03-12 16:31:53 +01:00
Jan Sandbrink e36d7513cc Add mobile logo to logo_only layout
This was omitted previously, resulting in an empty
header. That the logo moves to the right hand side
seems to be a conscious decision that's baked into
the .op-app-header--center class.
2026-03-12 16:30:21 +01:00
Henriette Darge fcc74a738e Make banners smaller so that they do not block important content 2026-03-11 12:10:06 +01:00
Henriette Darge 0029a0fac0 Replace old ajax loading indicator with Primer spinner 2026-02-04 11:13:53 +01:00
Alexander Brandon Coles 12a586d80f Make MainMenuToggleComponent set aria-expanded
For symmetry with navigation toggler (see 2185756ddae).

Also sets `aria-controls` when rendered outside `#main-menu` container.
2026-01-23 05:51:40 -03:00
Alexander Brandon Coles f42ad23d05 Use <nav> with accessible name for left menu
For symmetry with top menu (see f63e644db8).
2026-01-15 23:25:59 -03:00
Alexander Brandon Coles 22865c391a Provide accessible name for top menu navigation
Replaces existing `sr-only` heading.
2026-01-15 23:19:33 -03:00
Behrokh Satarnejad e2e49867c1 [65066] Global search is not usable via keyboard (#21278)
* Dont check the first item in the list of search box, show the list items for screen reader

* highlight the WP if the full id is added and change aria-live message

* feature spec for live region

* use the global live region for announcing changes

* set void for promises
2026-01-08 09:43:58 +01:00
Oliver Günther c9876b1aaf Set body_css_classes 2025-11-17 20:16:40 +01:00
Oliver Günther bf815e7f05 Allow rendering no_menu inside a @project 2025-11-17 20:16:39 +01:00
Oliver Günther 6717b86738 Project wizard to fill out attributes 2025-11-17 20:16:39 +01:00
Oliver Günther 619a3d9817 Presentation mode for meetings 2025-11-10 21:15:56 +01:00
Alexander Brandon Coles e039c640fe Merge branch 'dev' into code-maintenance/rid-jquery 2025-11-05 14:29:33 +00:00
OpenProject Actions CI 91d7307386 Merge branch 'release/16.6' into dev 2025-11-04 12:15:17 +00:00
Alexander Brandon Coles 7be1c25661 [#68459] Hide wrapper on page load on all pages
This should fix a scenario where users briefly see the login page in
light mode on logout before OS display mode detection kicks in.
2025-11-03 14:15:23 +00:00
Alexander Brandon Coles 435268bef1 Merge branch 'dev' into code-maintenance/rid-jquery 2025-11-03 13:03:27 +00:00
Henriette Darge 655756631f [67007] Render the WP full view from rails (#20109)
* Create a FullView::CopyComponent for WorkPackages which is routed from rails

* Remove angular splitCopy route and component as it was overwritten by the angular fullCopy route for quite some time already and nobody complained. So we decided to remove the splitCopy completely

* Create FullView::CreateComponent for WorkPackages which is now routed from rails instead of Angular

* First draft of implementing the FullView route for WorkPackages from rails

* Pass correct tab from the URL to the FullView::ShowComponent

* Do a hard reload to "create" route when we are not routed from Angular

* Adapt routing spec to new WorkPackage routes and to some fine-tuning with the WP routes

* Show correct tab in WP Full view and change URL when clicking a tab entry

* Adapt to new rails based routing

* Fix some routes and redirects

* Make sure, the split screen stil renders correctly

* Remove back button from WP full view

* Fix routing issues

* Start fixing specs

* Attempt to override the browser history to be able to use browser back

* Use helper function to build new WP url string

* Adapt spec that now partially renders backend toasts

* Remove ability to move to fullscreen

Theoretically, we can re-add it by posting to some form endpoint, but
not worth it for the first iteration

* Disable cache-control on angular routed pages, so back links work

* Fix double click to fullscreen

* Adapt navigation and title setting

* Let WP breadcrumb to a hard reload instead of Angular transition

* Redirect when the WP route is incomplete (this is the attempt to re-implement an angular functionality)

* Navigate with Turbo when double clicking a card

* Adapt onboarding tour to new hard reload when switching to WP full view

* Fix some specs

* Fix more tests

* Hide Overview tab on FullView

* Correct check for incomplete routes

* Do a hard refresh when coming from slpit screen to full view

* Fix notification navigation

* Adapt attachment spec as the tab switch cannot be done anymore while dragging

* Fix more tests

* Please rubocop and fix more tests

* Attempt to fix navigation_spec

* Add debian_base for pullpreview

---------

Co-authored-by: Oliver Günther <mail@oliverguenther.de>
2025-11-03 09:02:16 +01:00
Alexander Brandon Coles 722f1d462a Remove jQuery from csp_onclick helper 2025-11-02 20:26:50 +00:00
Behrokh Satarnejad 1846e1686f [65606] Inform users on screen-readers that links will open in a new tab (ARIA-describedby) (#20371)
* [#65606] Apply description to links with blank target

Uses a `ExternalLinksController` Stimulus controller to set
`aria-describedby` on all links with `target="blank"`. Uses a
`MutationObserver` to ensure links that are added to the DOM dynamically
(e.g. via Turbo Drive) are also updated.

Co-Authored-By: Behrokh Satarnejad <62008897+bsatarnejad@users.noreply.github.com>

* add a documentation for the controller

* Add simple feature spec for external links

* Append id to aria-describedby if existing value

* Update the documentations on the lookbook for the links

---------

Co-authored-by: Alexander Brandon Coles <a.coles@openproject.com>
2025-09-19 11:16:30 +02:00
Kabiru Mwenja 9a6aa13289 Rely on AutoThemeSwitcherController#connect() to set initial theme in place of inline head script (#19922)
https://community.openproject.org/work_packages/66588
2025-08-15 10:44:53 +03:00
Kabiru Mwenja 4a973bf44a Code maintenance/66395 Add user current theme inquiry methods (#19903)
* Add theme dynamic inquiry methods
* Add base theme inquiry methods
2025-08-14 09:48:47 +03:00
Kabiru Mwenja 1cab872cf3 Merge pull request #19746 from opf/feature/auto-theme
Add an option to automatically sync the color mode with the operating system preference
2025-08-06 15:40:32 +03:00
Kabiru Mwenja ede66462a5 DRY up theme switching implementation
Address code duplication concern raised in https://github.com/opf/openproject/pull/19746#discussion_r2256365160.

Encapsulate theme utilities into a class, with instances on the `window.OpenProject` and `AutoThemeSwitcher` interfaces.

AFAICT, it's not feasible to group the theme application in `base.html.erb` into the deffered `nonced_javascript_tag` as the
deffered script would run too late for theme application.
2025-08-06 13:34:34 +03:00
Kabiru Mwenja ce689f9386 Automatically detect user contrast setting 2025-08-05 13:29:46 +03:00
Alexander Brandon Coles 930d956270 Remove jQuery from inline anti-flickering script 2025-07-31 15:05:15 +01:00
Alexander Brandon Coles 89d61afe4c Fix loading of inline <script> in base.html.erb
Removes `turbo:load` hack which resulted in rendering issues (white
screens) on form error submission for a number of pages.

`type="module"` rather than `defer` is the correct attribute value in
this case: the script will be also be deferred, but in a synchronous
execution order - after other `<script type="module" src="main.js"/>`.

See also 0e69c9e156
2025-07-31 14:43:09 +01:00
Kabiru Mwenja eca76d9f67 Fix theme flickering for sync_with_system preference
When using sync_with_system theme preference, there was a visible flicker
as the page defaulted to light theme before the Stimulus controller
could detect and apply the correct system theme.

This fix adds inline JavaScript in the layout head that detects the
system theme preference and applies it immediately before the body
renders, eliminating the flickering issue.
2025-07-31 13:04:16 +03:00
Oliver Günther ac159cc5a1 Remove gon service from the core 2025-07-30 14:40:52 +01:00
Behrokh Satarnejad 296da91eab [65547] Close mobile sidebar menu by outside click (#19655)
add togglenavigation method on the content overlay
2025-07-24 10:10:49 +02:00
Alexander Brandon Coles 51213056b0 Replace .hidden-for-sighted with Primer's .sr-only
See (docs): https://primer.style/css/storybook/?path=/story/utilities-layout--screen-reader-only
See (source): https://github.com/primer/css/blob/main/src/utilities/visibility-display.scss#L96
2025-07-21 11:25:24 +01:00
Alexander Brandon Coles aa9febc397 [#64605] First pass migrating to browser-esbuild
* Switches ng build to browser-esbuild builder.
* Fixes static and dynamic imports.
* Switches to relative asset paths.
* Modernizes tsconfig files.
* Vendors jquery-ui. / HT https://gorails.com/episodes/how-to-use-jquery-with-esbuild
* Fixes various out-of-date path references.

See https://angular.dev/tools/cli/build-system-migration\#manual-migration-to-the-compatibility-builder
2025-07-18 08:49:40 +01:00
Oliver Günther a175c84879 Move CSP to Rails 2025-07-08 16:17:29 +02:00
Henriette Darge 17d2349dca Avoid that the menu button floats in the middle of nowhere and align it with the top bar waffle icon 2025-07-07 14:49:04 +02:00
Henriette Darge 5b6886047b Make the PageHeader sticky on mobile 2025-07-02 08:02:37 +02:00
Henriette Darge 0d2e7519b5 Adapt styling of main menu to look closer to the Primer ActionList 2025-07-01 07:49:41 +02:00
Henriette Darge cc90002bef Take care that the main menu resizer toggles when the menu is collapsed/expanded
Clean-up sass code

Avoid that the type selector in the WP from is scrolled two far when being activated. Currently, it is scrolled twice (one time when activating it and once again when selecting an item). Thus the dropdown overlaps the actual input

Move logo to the left side

Make naming consistent for MainMenuToggleComponent and add a component test

Let menu toggle button scroll with the rest of the page

Move modules menu to the left and show it on mobile
2025-06-27 11:10:04 +02:00
Henriette Darge d983851576 Remove main-menu-bg-hover-color from set of configurable design variables. Instead we use the Primer behaviour for ActionLists 2025-06-25 15:47:26 +02:00
Henriette Darge bb66d0d5b4 Move toggleButton for menu into the sidebar 2025-06-25 15:45:38 +02:00
Behrokh Satarnejad a00b1ac13c Remove project selector from top menu left
Move the project selector to side bar menu

It doesn't show project selector in log in page any more, so we don't need to test showing favorite projects

Fix spacing in sidebar menu

Use a smaller header title for projects list modal

remove op-app-menu classes

Show project name on a tooltip and make the text ellipsis in menu

Add a divider between project selector and menu list

Remove border radius

Use spot divider

Undo changes for spec

Fix test by adding view_project permission to anonymous user

Use hr tag instead of spot divider

Add some space around the project selector

Fix spacing around the divider and fix the hover effect width

Reduce spacing to the top to match bottom spacing

remove overflow y for main menu sidebar and use button instead of anchor tag for trigger element

reduce the height of project selector from menu sidebar height, add a scroll for the menu when there is no sub menu
2025-06-25 15:43:28 +02:00
Mir Bhatia 77853f3793 Add trial teaser component 2025-06-24 16:15:56 +02:00
Mir Bhatia 1b6c571e01 Move trial teasers from SaaS 2025-06-24 14:31:05 +02:00
Oliver Günther 000f1061b9 Remove application dynamic target 2025-06-17 15:15:30 +02:00
Behrokh Satarnejad 9b5fedb1ce [62708] Implementing ARIA live regions to communicate contextual changes (#17920)
* check if there is a screen reader active on page load

* hide the flat picker for screen readers

* make the banner focusable

* change the focus color in banner

* change disabled to readonly input fields

* change replace_via_turbo_stream to add a message to it

* add live region of github to out project

* add a method to send the aria message

* make it possible to pass the attributes

* pass type of aria live region to front-end based on the action

* remove focused field from date picker

* focus on tabs when there is no banner

* Revert "remove focused field from date picker"

This reverts commit ab5e3060343860e9c34514818f6d9eee59e91ee1.

* focus on the first element when opening the dialog

* remove auto-focus

* undo changes for adding a message

* add a new input method for adding a date and select today as a date

* remove label and name from form input

* change readonly to disabled

* undo changes for date-form

* delete dateform file

* add aria-live for fields in date pickr

* add a turbo stream to the component to load the messages for aria live regions

* undo changes for check f there is an active screen reader

* use settimeout instead of add event listener, so turbo frame also can be used hare

* undo changes for text with link form input

* remove text with link form input

* add documentation for aria-live region

* add an example for using current method in relation creation

* add aria live region in date-pickr dialog

* add some delay for polite messages to make sure it is caught

* send a message to be gotten by screen reader in date picker while changing inputs

* remove aria-live form inputs in date pickr

* show update message after any change in inputs of date picker

* fix rubocup errors in relation controller

* fix rubocup errors in datepicker controller

* fix eslint error

* update docs

* add some details to the aria live doc

* remove test for aria-live on inputs of date pickr

* remove unnecessary live region polite for date picker

* Update lookbook/docs/patterns/18-aria-live.md.erb

Co-authored-by: Henriette Darge <h.darge@openproject.com>

* Update lookbook/docs/patterns/18-aria-live.md.erb

Co-authored-by: Henriette Darge <h.darge@openproject.com>

* fix comment in preview controller

* remove role: alert

* set correct value for target

* move aria turbo stream below live region

* add missing spaces and a better headline for js handling turbo aria action

* move the exception of modals and dialogs to the end of doc file

* Update lookbook/docs/patterns/accessibility/18-aria-live.md.erb

Co-authored-by: Alexander Brandon Coles <a.coles@openproject.com>

* Update frontend/src/turbo/aria-stream-action.ts

Co-authored-by: Alexander Brandon Coles <a.coles@openproject.com>

* Update lookbook/docs/patterns/accessibility/18-aria-live.md.erb

Co-authored-by: Alexander Brandon Coles <a.coles@openproject.com>

* Update app/controllers/work_packages/date_picker_controller.rb

Co-authored-by: Alexander Brandon Coles <a.coles@openproject.com>

* Update lookbook/docs/patterns/accessibility/18-aria-live.md.erb

Co-authored-by: Alexander Brandon Coles <a.coles@openproject.com>

* Update app/controllers/concerns/op_turbo/component_stream.rb

Co-authored-by: Alexander Brandon Coles <a.coles@openproject.com>

* Update app/controllers/work_packages/date_picker_controller.rb

Co-authored-by: Alexander Brandon Coles <a.coles@openproject.com>

* Update app/controllers/work_packages/date_picker_controller.rb

Co-authored-by: Alexander Brandon Coles <a.coles@openproject.com>

* Update lookbook/docs/patterns/accessibility/18-aria-live.md.erb

Co-authored-by: Alexander Brandon Coles <a.coles@openproject.com>

* Update lookbook/docs/patterns/accessibility/18-aria-live.md.erb

Co-authored-by: Alexander Brandon Coles <a.coles@openproject.com>

* Update lookbook/docs/patterns/accessibility/18-aria-live.md.erb

Co-authored-by: Alexander Brandon Coles <a.coles@openproject.com>

* Update lookbook/docs/patterns/accessibility/18-aria-live.md.erb

Co-authored-by: Alexander Brandon Coles <a.coles@openproject.com>

* change parameter in update_inputs_aria_live_message string

* change type to politeness

* Update lookbook/docs/patterns/accessibility/18-aria-live.md.erb

Co-authored-by: Alexander Brandon Coles <a.coles@openproject.com>

* set delay for polite updates

* use delay in relations tab update and date pickr update

* remove the usage of aria live region update message in relations tab, since we should handle update message here in another way

* use assistive technology instead of screen reader only

* change the stream action to live region

* change the aria action to live region

* remove alert role

* change the string in away that if there is no value for start date, finish date or duration, it shouldn't be part of the string

* remove aria-live from input text fields

* test for updated message in date pickr

* undo changes for relations updates

* check if message is null then return

* add more delay for updating data in date picker

* fix test for adding more delay for updating data in date picker

---------

Co-authored-by: Henriette Darge <h.darge@openproject.com>
Co-authored-by: Alexander Brandon Coles <a.coles@openproject.com>
2025-05-21 13:08:21 +02:00
Henriette Darge f496da2aad Merge release/16.0 into dev 2025-05-16 14:56:25 +02:00
Henriette Darge ee8452282a [63485] Remove show_local_breadcrumb and default_breadcrumb (#18663)
* add a new helper for breadcrumb in wiki page

* set page header in destroy page

* set page header in edit page

* set page header in history and rename and edit parent pages

* change toolbar items into page header items

* add new wiki action to sub header

* remove version edit page which is not in use any more

* add export as a menu item of the header

* fix rubocup errors

* fix failing tests

* replace page header in annotate page

* replace page header in diff page

* add page header in select menu page

* fix rubocup errors

* fix errors on rename test

* fix errors on selecting items from toolbar

* fix errors on tests for child pages

* set correct permission for configure menu item

* replace page header in summary page

* replace page header in summary details page

* edit docs of sub header

* add page header in wiki new page

* remove controller and a route for edit method

* undo changes for docs of sub header

* extract header in show page into a new component

* use helper method in header component

* add wiki module to the breadcrumb

* rename page header component for wiki page

* simplify how lock and lock implemented

* extract sub header

* remove wiki title from header of history page

* fix page header in new page

* use page.find_test_selector in test

* fix failing test for summary page

* fix failing test for wiki child pages

* change the summary test

* use test selector for page header title

* undo changes for activate user in admin

* use test selector in adding editing history test

* use test selector in attachment upload test

* use test selector in child pages tests

* use test selector in wiki menu items tests

* change test selector for breadcrumbs

* extract conditions to show edit button into a method

* extract conditions to show rollback action menu item into a method

* extract conditions to show create button into a method

* fix duplicated code in test

* Remove outdated `show_local_breadcrumb` method which is replaced by the Primer::PageHeader breadcrumb

* Remove `default_breadcrumb` method as it serves no prupose any more

* Remove the old breadcrumb and its hook completely

* remove breadcrumbs path from rename

* fix translations errors in storages

* undo changes on translations

* remove default breadcrumbs in time tracking controller

---------

Co-authored-by: Behrokh Satarnejad <b.satarnejad@openproject.com>
Co-authored-by: Behrokh Satarnejad <62008897+bsatarnejad@users.noreply.github.com>
2025-04-23 10:40:43 +02:00
Oliver Günther 108f8ed609 Fix WP status button preview 2025-02-26 10:00:25 +01:00
Ivan Kuchin ca5f8fb878 erb_lint auto fix trailing commas 2025-02-11 18:49:21 +01:00