103 Commits

Author SHA1 Message Date
Eric Schubert 6c06baa565 [#73440] fixed feature specs 2026-05-05 10:54:55 +02:00
Klaus Zanders 17c29dcdba Merge pull request #22078 from opf/fix/sanitization-clobber-input
Remove name and prefix id for all dom elements in pipeline
2026-02-24 09:48:48 +01:00
Oliver Günther cd8c6eb516 Avoid duplicate anchor links 2026-02-23 16:15:12 +01:00
Oliver Günther 6e8df4ce22 Revert specs changed for external redirect behavior again when not active 2026-02-23 10:24:43 +01:00
Oliver Günther 1857f25b58 Primerize static link helper and use that for external links consistently 2026-02-03 11:41:43 +01:00
Henriette Darge 680ca47fa6 Replace export dialog selection by simple sub menu entries 2025-12-03 14:10:57 +01:00
Alexander Brandon Coles 088da4bd59 Fix features reliant on Capybara hidden heuristics
Capybara, when using #text or similar methods, typically only returns
text that is considered visible on the page. However, the definition of
"visible" depends on both the underlying driver and Capybara's
heuristics.

As such, Capybara + Cuprite consider the following rule in our
`.hidden-for-sighted` implementation's rule as "invisible":

    left: -10000px

However the Primer `.sr-only` implementation is considered "visible":

    clip-path: rect(0 0 0 0)

This commit updates the affected feature specs to account for this
difference in visibility detection. The tests now properly handle
screen reader only text that Capybara considers "visible" when using
Primer's `.sr-only` class instead of the custom `.hidden-for-sighted`
implementation.
2025-07-21 11:55:13 +01:00
Jan Sandbrink 0b87e7543f Freeze string literals in specs
Rolling out frozen string literals further by freezing all
string literals in core specs.
2025-05-05 09:29:55 +02:00
Behrokh Satarnejad ca19fbb55e [59915] Update PageHeaders & SubHeaders in the (rails) project pages (Part 2) (#18600)
* 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

* move show_create to the controller instead of the component

* fix showing history breadcrumbs

* fix showing table of contents breadcrumbs
2025-04-22 11:18:46 +02:00
Oliver Günther b214c61315 Reset some specs 2025-01-14 13:23:57 +01:00
Oliver Günther cd2d0f0e1a Remove primerized_flash prefix in methods 2024-09-30 21:39:36 +02:00
Oliver Günther 1cf49e2c9f Adapt specs 2024-09-30 20:37:00 +02:00
Ivan Kuchin 4911b8a149 remove years from copyrights (except for COPYRIGHT file) 2024-07-31 15:02:49 +02:00
ulferts 3b2121f733 Revert "Merge remote-tracking branch 'origin/release/13.4' into dev"
This reverts commit 40b2bbeb09, reversing
changes made to b4c6cb17cc.
2024-03-21 11:31:17 +01:00
Ivan Kuchin 7787e457a3 Revert "Merge branch 'dev' into release/13.4"
This reverts commit a901541269, reversing
changes made to e573ca00b7.
2024-03-20 20:19:08 +01:00
Ivan Kuchin 9e4934cd0a change quotes using rubocop --only Style/StringLiterals,Style/QuotedSymbols -a 2024-03-20 18:05:22 +01:00
Christophe Bliard 8fa8584538 Run rubocop --autocorrect on all files
Only the safe cops have run. rubocop version is 1.59.0.
2024-01-05 15:27:09 +01:00
Christophe Bliard c795874f7f Update copyright year for 2024
command used: `rg -l 'Copyright \(C\) 2012-202\d the OpenProject' | xargs -n 100 sed -i -r 's/Copyright \(C\) 2012-202. the OpenProject/Copyright (C) 2012-2024 the OpenProject/'`
2024-01-02 16:23:54 +01:00
ulferts 5b2bc41f41 Merge remote-tracking branch 'origin/dev' into easier-factory-role-setup 2023-10-12 12:09:27 +02:00
ulferts 2b2abf864a introduce ProjectRole model 2023-10-09 14:34:20 +02:00
Klaus Zanders 78c1e4fadb Switch all uses of principal factories to use new interface 2023-10-09 10:39:44 +02:00
Oliver Günther 92259181ce Adapt specs to use introduced helpers 2023-09-13 09:02:42 +02:00
bsatarnejad 85411f20c7 change tests due to replacing .flash with .op-toast 2023-07-18 16:47:45 +02:00
Oliver Günther d8b4b830d4 Open external links with window.open using link hook (#12874)
* Open external links with window.open using link hook

* Handle edge case of opening an invalid url in a new page

* Use localhost in external link spec.

---------

Co-authored-by: Dombi Attila <83396+dombesz@users.noreply.github.com>
2023-06-28 08:06:19 +02:00
Oliver Günther e90670fb9d Don't show wrapper and instead style a separate class explicity 2023-06-19 12:08:35 +02:00
Christophe Bliard 4c2a9d0aa8 Enable RSpec zero monkey patching mode
The plan for RSpec 4.0 is to disable monkey patching.

See https://github.com/rspec/rspec-core/blob/main/features/configuration/zero_monkey_patching_mode.feature for details.
2023-05-31 19:22:29 +02:00
ulferts 0a33ee80ad enable editing former versions of wiki page
This is done, so former versions can be rolled back to. The transformation of the view object to it`s wrapped model needs to be prevented.

Once that had been achieved more indirections via content were removable.
2023-05-03 09:54:26 +02:00
ulferts 1cf42e1a93 Merge branch 'dev' into fix/merge_wiki_content_into_page 2023-04-28 09:27:18 +02:00
Christophe Bliard 97600a6c49 refactor: Extract spec uploading code in a class
The flaky test fixed 59eb308cbb was failing because the test was not
waiting for the attachments element to be displayed. In some other
similar tests, the code was waiting for it, and one test ever scrolled
to that element.

If code was properly factored, the above test would never have been
flaky.

This commit is an attempt to factor the interactions with the
attachments list so that the next test written using it will be reliable
by default.
2023-04-06 14:25:55 +02:00
ulferts a328940c3a merge wiki_content into page 2023-04-05 10:05:20 +02:00
Eric Schubert 93a19fd57d [#46150] Fixes for tests
- fix ckeditor drag and drop for upload
- remove attachable mixin unit tests on work package
2023-03-21 10:02:39 +01:00
Christophe Bliard 9e865b4f7b lint: Run rubocop safe autocorrect
Command is `rubocop --safe --autocorrect app lib lib_static modules spec`
2023-03-09 10:25:57 +01:00
Christophe Bliard aa23106c11 lint: autocorrect RSpec/FactoryBot/ConsistentParenthesesStyle
command is

    rubocop -A --only RSpec/FactoryBot/ConsistentParenthesesStyle modules spec
2023-03-07 15:04:32 +01:00
Oliver Günther 6945ff8fa6 Fix anchor links being changed due to base href
Due to having a <base /> tag, links that only contains anchors break as they
reference the application base url + the anchor instead of the current page.

https://community.openproject.org/wp/46351
2023-03-02 14:00:37 +01:00
Christophe Bliard 85b3258a29 Autocorrect with some rubocop cops
RSpec/Rails/InferredSpecType and Style/RedundantConstantBase

rubocop --autocorrect-all --only RSpec/Rails/InferredSpecType,Style/RedundantConstantBase spec modules/*/spec
2023-01-13 14:28:59 +01:00
Eric Schubert 2eb54e073f [#43577] Fix drag and drop by counting drag over and leave (#11896)
* [#43577] Fix drag and drop by counting drag over and leave

- https://community.openproject.org/work_packages/43577
- replace action button text for attaching files
- refactored drag and drop behaviour
  - on any global dragenter increase a counter
  - on any global dragleave decrease counter
  - if counter is 0 -> no global dragging is happening (mouse was moved out of window)
  - this way, we are independent from the order in which the DragEvents are fired by the browser (bigger differences between Firefox and Chrome)

Co-authored-by: Benjamin Bädorf <b.baedorf@openproject.com>
2023-01-11 13:17:17 +01:00
Christophe Bliard 21a696ef9b Update copyright information for 2023 2022-12-30 15:51:26 +01:00
Benjamin Bädorf fecb2805f4 Add drop zone to attachment list (#11606)
* Initial attachment list changes

* Merge attachment list and uploads

* Move upload mechanisms to op-attachment

* Refactoring attachment styles

* Fix state handling of attachments

* Drag and drop works

* Improve drop zone styles

* Small style improvement

* Remove debug log

* Finished wiki attachments upload spec

* Attachments upload spec for forum works

* Add feature spec for document drag & drop

* Add feature spec for budget attachment drag & drop

* Add feature spec for workpackge attachment drag & drop

* Add default value for attachment list to fix specs

* Fix attachment list for work package create page, remove unused styles

* Fix linting errors

* Add extra checks in document attachment uplaod spec

* Adress PR comments

* Fix broken selector in spec

* Make sure to blur in the ckeditor instance

* Fix meeting module attachment spec

* Fix qa selector

* Fix eslint errors

* Fix rubocop errors
2022-11-22 10:44:11 +00:00
luz paz c757e6f60e Fix various typos
Found via `codespell -q 3 -S ./.git,./config/locales,./modules/xls_export/config/locales,./modules/job_status/config/locales,./modules/two_factor_authentication/config/locales,./modules/backlogs/config/locales/crowdin,./**/config/locales,./frontend/src/vendor -L ba,inflight,nd,parms,pullrequest,pullrequests,sur,varius`
2022-11-08 05:34:15 -05:00
ulferts 4a94e03b04 bump rubocop and apply autofixes for new cops 2022-10-21 22:29:12 +02:00
Oliver Günther 0e7a85c958 Restore main wiki item on rendering wiki menu
In case there is no wiki items, even if there should always be one,

the wiki will be unaccessible.

To avoid this, we ensure the main wiki item is always created in case it is missing
2022-08-23 10:37:25 +02:00
Oliver Günther 8f018c0079 Ckeditor: Allow inline resizing of images 2022-07-04 08:22:55 +02:00
Christophe Bliard 48a4f1b6ad lint with rubocop --autocorrect (safe cops only) 2022-06-02 10:40:10 +02:00
Eric Schubert 3bc3106a87 [#41340] migrate attachments to files tab
- https://community.openproject.org/work_packages/41340
- added new files tab to wp details view
- added attachments components to files tab
- removed attachments from wp single view, except for wp creation
- fixed a couple of eslint issues in affected files
- migrated attachments to resource store
- added upload to attachment store
- pull in newly built ckeditor
- removed old, hacky regression test
2022-03-22 14:24:12 +01:00
Christophe Bliard a33524ef6d remove ruby magic comment for utf-8
ruby interprets source encoding as utf-8 since 2.0.0, making magic comment redundant and useless
2022-03-10 19:36:58 +01:00
Oliver Günther 6bb893c9b0 Fix attachment spec 2022-03-07 15:47:10 +01:00
Christophe Bliard bc8d423ec2 update copyright information for 2022 2022-03-01 17:05:59 +01:00
Christophe Bliard 47a297daae Fix argument alignment since f08bea3467 (#10129)
* Fix argument alignment since f08bea3467

The FactoryBot.* prefix has been removed in f08bea3467. Since then
rubocop complains about Layout/ArgumentAlignment. This commit fixes it.

* do not fix alignments for modules/*/spec yet

hoping to be under the limit of 65535 characters for reviewdog to report on rubocop errors
2022-02-02 21:48:06 +01:00
Oliver Günther f08bea3467 Remove FactoryBot.* prefix where applicable 2022-01-25 08:19:06 +01:00
Benjamin Bädorf 3aaac1c7ce Rename most notification to toaster instances (#9765)
* Rename most notification to toaster instances

* Frontend builds

* Fix spec build

* Rename more notification elements to toaster

* Rename toaster-box to op-toast

* Fix op-toast-container

* Rename toasters upload progress

* Try fixing page.rb toaster check

* Fix some specs, break some others

* Correctly overwrite toast_type

* Fix more specs

* Fix one more notification to toaster rename

* Fix linting errors, harmonize naming more

* Remove byebug debugging statement

* Remove byebug debugging statement

* Rename notification in the backend, too

* Rename more instances of notifications to toastService

* Rename backend back to notification since bundle gems expect it there

* expect_toaster -> expect_toast

Co-authored-by: Henriette Darge <h.darge@openproject.com>
2021-11-04 16:25:55 +01:00