51 Commits

Author SHA1 Message Date
Oliver Günther 10a59c3f10 Remove fastimage for content type checking 2026-04-15 14:18:42 +02:00
Jan Sandbrink 0728d07ad1 Self-test basic schema compliance for a few API models
Those self-tests are "basic" in the sense that they only validate
their compliance with our documented schema in one representation.

These test cases don't yet cover/validate whether the generated
representation also fulfills the schema under different circumstances,
for example when rendering for a user with fewer privileges, not allowed
to see certain fields.

Where necessary, the schema was changed to reflect the reality, e.g.
when those tests revealed that a "required" field might be missing due to
a lack of permissions.

In a few cases the implementation was adapted to allow for stricter guarantees
of the specified schema, for example links allowed to leave out the title key
already, so its not necessary to emit `title: nil` in cases where a title is
not known.
2025-12-15 11:10:34 +01:00
Ivan Kuchin dfead9fdbe frozen_string_literal in changed specs 2025-03-18 19:35:08 +01:00
Ivan Kuchin 2c1d112aea use require_relative in specs 2025-03-18 19:35:08 +01:00
Tobias Dillmann 263b12cf3f [#61126] remove unneeded hover-card-target logic 2025-02-04 13:55:27 +01:00
Tobias Dillmann b1f000430c [#55581] fix avatar_helper specs 2024-11-29 15:19:54 +01:00
Ivan Kuchin 4911b8a149 remove years from copyrights (except for COPYRIGHT file) 2024-07-31 15:02:49 +02:00
Christophe Bliard a885fef2bd Conform to RSpecRails/HaveHttpStatus cop
With a hack to get `have_http_status` to work with `Rack::MockResponse`.
2024-06-24 17:50:57 +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
Behrokh Satarnejad 17480df26c [50307] Timestamp overflows the BorderBox on Storages index page (#13923)
* add x-scroll when the content is overflew

* exchange the Provider and the Creator columns

* change the layout of file storage list page based on new design for different breakpoints

* remove unnecessary class

* add a new class to hide an element for tablet and mini laptops

* clean style sheet file from unnecessary rules

* add an input for setting classes to the name of principal component

* remove extra avatar component and use a class instead, to hide the name of avatar for mini laptop and tablet

* fix specs for avatar helper

* Update frontend/src/global_styles/layout/_base_mobile.sass

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

* make the class name optional and use two classes for hiding name of avatar for tablet and small screen laptop

* fix eslint errors

* fix spec failing

* use one class for hiding element in tablet and small laptop mode

---------

Co-authored-by: Henriette Darge <h.darge@openproject.com>
2023-11-02 15:40:00 +01:00
Oliver Günther e3f28b9e04 Add Users::AvatarComponent 2023-09-20 09:51:29 +02:00
Aaron Contreras f033a5ecca Address "implicit block expectation syntax" deprecation warning (#13534)
* Fix implicit block syntax deprecation warnings in `user_spec.rb`

```
The implicit block expectation syntax is deprecated, you should pass
a block rather than an argument to `expect` to use the provided block
expectation matcher or the matcher must implement
`supports_value_expectations?`.

e.g  `expect { value }.to change `User#local_avatar_attachment``
not `expect(value).to change `User#local_avatar_attachment``
```

```
The implicit block expectation syntax is deprecated, you should
pass a block rather than an argument to `expect` to use the provided
block expectation matcher or the matcher must implement
`supports_value_expectations?`.

e.g  `expect { value }.to raise Exception`
not `expect(value).to raise Exception`
```

* Adjust context phrasing to adhere to Rubocop guidelines

"^when" instead of "^WHEN"

* Adjust `require` statement to use interpolation

Appeases Rubocop complaint for String concatenation being used instead
of String interpolation.

* Use `specify` instead of `it` for no implicit subject example
2023-08-21 22:58:06 +03:00
Aaron Contreras b82ecf77ff Switch modules/avatars to cuprite 2023-06-28 05:19:12 -05: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
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
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
Christophe Bliard 21a696ef9b Update copyright information for 2023 2022-12-30 15:51:26 +01:00
Christophe Bliard b50855a955 Use ServiceResult factory methods where possible
All was automatic through the use of `rubocop --autocorrect --only
OpenProject/UseServiceResultFactoryMethods app lib lib_static modules
spec`.
2022-06-16 10:01:57 +02:00
Christophe Bliard 48a4f1b6ad lint with rubocop --autocorrect (safe cops only) 2022-06-02 10:40:10 +02:00
Oliver Günther 9e3c51299a Remove Setting.protocol in favor of static config 2022-05-18 16:21:55 +02:00
Christophe Bliard bc8d423ec2 update copyright information for 2022 2022-03-01 17:05:59 +01:00
ulferts a3fc906ff8 ensure using .create for cf representer initialization 2022-01-26 17:10:46 +01:00
Oliver Günther f08bea3467 Remove FactoryBot.* prefix where applicable 2022-01-25 08:19:06 +01:00
Oliver Günther 228a7aa4e2 Make principal component use DataInputs decorator
https://community.openproject.org/work_packages/40035
2021-11-29 21:03:00 +01:00
Oliver Günther ccfa29c728 Move license and copyright docs to root, fix names and references 2021-09-02 21:50:46 +02:00
Oliver Günther 93faf5b5dd [37278] Treat system_user as user type as well (#9287)
https://community.openproject.org/wp/37278
2021-05-20 10:57:03 +02:00
ulferts b813e8b93f Fix/bump gems (#9259)
* bump aws-partitions

* bump database_cleaner-active_record

* bump rb-fsevent

* bump recaptcha

* bump sentry-ruby & sentry-ruby-core

* bump terminal-table

* bump date_validator

* bump factory_bot & factory_bot_rails

* avoid eager loading models via factories
2021-05-12 13:42:21 +02:00
Oliver Günther 6dc662b1e4 [36243][30226] Different avatars for placeholders and groups (#9169)
* Fix members autocompleter to allow hrefs

* Add rendering of different avatar types

* Remove unused code in backend avatar rendering

* Add very basic test that the avatar gets customized per type

* Allow avatar rendering in the CreateAutocompleter

* Restructure avatars into BEM css

* Remove avatar-classes in favor of passing size from backend

* Remove  to avoid confusion

We use tracking with both href and , and  was introduced

to avoid a property called href to be overridden, but that was never a problem before.

So from now we can safely use .href

* Fix broken principal avatar in user activity

* Ensure filters get updated even if the form is not reloaded

There was a bug in conditionallyLoadForm that checked the  property of link (always undefined)

and would thus always reload a form.

What we actually need is a form that gets reloaded only when the query link changes, but still update

services from the updated query, such as filters

* Adapt specs to changes classes

* Rename op-principal-avatar to op-avatar
2021-04-21 14:34:48 +02:00
Benjamin Bädorf beb4e6ba50 Refactor/user avatar to principal (#9069)
* Fix some ium stylings

* Extend create service to also test with empty names

* Add PrincipalLike type to pass around non-created placeholder refs

* Add icon-context

* Move principal rendering to its own module

* Fix emit create new placeholder to principals

* Revert op-principal for now

* Add memberships form API to properly post

* Fix types for returned principals

* Move untilDestroyed in role

* Filter input if not string in role-search

* Pass correct inputs to success component

* Return principal after saving membership

* Fix small stuff around  the ium

* Fix the way HalResources are selected and passed

* Move principal module to be exported by common

* Disable quotemark in tslint until eslint is enabled

* Fix image path in success

* Adapt modal to run all steps in one within the modal helper component

* Several fixes to modals

* Fix ium success component styles,
* Registration modal y-overflow
* Add SMTP parameters to .env.example

* Add disabled option to op-option-list, disabled placeholder users for non-ee instances

* Add correct ee link to placeholder user option

* Fix build

* Removed unused sass files

* Fix principal search not found indicator, added placeholder add image

* Fix enterprise edition url, use dirty instead of touched check

* Use backend class names for frontend principal types

* Fix duplicate import and principal type usage

* Also disable banners if with_ee is present in test

* Extend specs for placeholders

* Fix disabled attribute

* Extend spec WIP

* Improved inline-validation styles, fixed more PrincipalType usages

* Add group happy path test, fix more PrincipalType usage

* Fix a translation

* Revert line deletion

* Rewrite same spec examples into shared examples

* Fix name of shared example

* Dont run assets:clean to remove angular assets

* Output whether assets are there at all

* Update user-avatar usages to principal

* Fix some op-principal usages

* Fix principal typing

* Remove ls of non-existent directory

* Rename more user-avatar instances

* Avatars now render correctly

* Fix an op-principal instance, default to avatar class for avatars

* Always add principal id to default principal tag

* Small fixes to op-principal

* Fix multiline user display

* Dirty fix for capybara click events

* Update avatar sizing

* Fixed some specs

* Fix unit specs

* Added op-link styles

* Fix add placeholder image link

* Remove byebug debugger statements

Co-authored-by: Oliver Günther <mail@oliverguenther.de>
2021-03-16 21:53:47 +01:00
ulferts 1bdd2ab9ae safe automatic fixes by rubocop (#8994) 2021-02-11 16:02:18 +01:00
Cyril Rohr b4086b2968 Standalone CI docker container (#8943) 2021-02-02 15:33:33 +01:00
luz paz e8c2928a12 Fix typo beeing->being in spec/ and modules/ 2021-01-27 13:52:37 +01:00
ulferts 6140f4c7e9 update copyright to 2021 (#8925)
Updates the copyright to 2021 for all files that have a copyright. Files in our source code without the copyright header still do not receive one automatically. Additionally, backlisted files are also excluded.

Previously the copyright of chiliproject which references redmine stated a copyright of redmine up to and including 2017 which is not true for the code we have in here. Because of that I changed that to 2013
2021-01-13 17:47:45 +01:00
Henriette Dinger bd7f4e4814 Update copyright notice 2020-01-15 11:31:26 +01:00
ulferts 817e7918bc let caching of avatar response base on setting 2019-10-21 10:27:46 +02:00
Markus Kahl bfe1e2003f make external avatar URLs valid for 24h 2019-10-18 12:03:22 +01:00
ulferts 53aea10b6e use virtual_attribute on meeting 2019-09-03 15:04:57 +02:00
Oliver Günther 1a16c039a2 Add an avatar endpoint to avoid loading user API
[ci skip]
2019-05-27 09:54:40 +02:00
Oliver Günther 0d5f50395e [29253] Render error message in production on pending migrations
Creates a new warning bar (previously top-shelf item) that renders a
warning when migrations are pending. These did raise exceptions before
in production and would result in users running in internal errors due
to pending migration on some actions on the instance.

https://community.openproject.com/wp/29253
2019-04-24 07:45:09 +02:00
Oliver Günther 8ab4f2a663 Boards module (#7008)
* Hack spike to show D&D use case

[ci skip]

* Add ordered work packages

* Save order on existing work packages

* Boards WIP

* CDK drag

* Add dragula handler

[ci skip]

* Add filter to return all manual sorted work packages

* Print icon on hover

* Boards routing and list components

* Better loading indicator on list with streaming result

[ci skip]

* Add new board and list buttons

[ci skip]

* Post new query

[ci skip]

* Added creation of new board lists with persisted queries

[ci skip]

* Render placeholder row in empty queries

 [ci skip]

* Push boards on grid

* Use base class in scope

[ci skip]

* Extend api for options

* Hack spike to show D&D use case

[ci skip]

* Add ordered work packages

* Save order on existing work packages

* Boards WIP

* CDK drag

* Add dragula handler

[ci skip]

* Add filter to return all manual sorted work packages

* Print icon on hover

* Boards routing and list components

* Better loading indicator on list with streaming result

[ci skip]

* Add new board and list buttons

[ci skip]

* Post new query

[ci skip]

* Added creation of new board lists with persisted queries

[ci skip]

* Render placeholder row in empty queries

 [ci skip]

* Save queries in grids

[ci skip]

* Renaming queries

[ci skip]

* Add existing work packages to board

[ci skip]

* Introduce card view component for work packages

* Extend grids to allow project scope for boards (#7025)

Extends the grid backend to also be able to handle boards. In particular, it adds the ability of boards to be attached to projects and changes the page property of grids to a scope property that better describes that more than one board can belong to the same scope (e.g. /projects/:project_id/boards).

For a fully featured board, though, widgets need to be able to store options, so that they can store queries. Those widgets might also need to have custom processing and validation. That part has not been implemented.

* introduce project association for boards

* have dedicated grid registration classes

* update and create form for board grids

* extract defaults into grid registration


[ci skip]

* Add drag and drop to card view

[ci skip]

* Add options to grid

* Fix option migration name

* Renaming boards

[ci skip]

* Frontend deletion of boards

* Avoid map on NodeList which doesnt exist

[ci skip]

* Add inline create to boards

[ci skip]

* Smaller create button

[ci skip]

* Add navigation for boards

* Make inner grid same height

* Replace index page with table

* Workaround for widget registration

[ci skip]

* Fixed height for cards and tables

[ci skip]

* Implement escape as cancel d&d action

[ci skip]

* Fix and extend grid specs for name and options

* Extend board specs for required name

* Fix migration for MySQL references

https://stackoverflow.com/a/45825566/420614

* Make board list extend from widget

Since we cannot configure widgets yet, it's not yet possible to use a
board-list widget anywhere.

* Fix specs

* Fix escape listener removal

[ci skip]

* Fix renamed to_path in relation spec

[ci skip]

* Allow deletion of grids for boards

* Avoid reloading resource multiple times with replays

* Frontend synchronization on deletion

[ci skip]

* Delete through table

* Use work packages board path

* Use work packages board path

* Fix augmented columns breaking re-rendering

* Fix duplicated permission with forums

* Strengthen tab switch in specs

* Add hidden flag for project-context queries

Allows the API to create a hidden query that will not be rendered to the
user even if it is within a project context.

* private queries

* Add hidden flag for project-context queries

Allows the API to create a hidden query that will not be rendered to the
user even if it is within a project context.

* Move boards below work packages

* Add Board configuration modal

* Fix reloading with onPush

* Saving / Switching of display mode

[ci skip]

* Extract wp-query-selectable-title into common component

* Fix renaming of board-list

* Fix auto-hide notifications in boards

* Add permissions to seeders

* Reorder lists in board

* Linting

* Remove default gravatar from settings

* Show assignees avatar in the card view of WPs

* Fix specs

* Add missing method

* Fix timeline icon

* Use URL as input to be able to show avatars for groups, too

* Fix test

* Add further specs

* Use correct data attribute to avoid unnecessary data base calls

* Add further specs

* Deletion of board lists

* Pass permission via gon to decide whether we can create boards

* Fix rename spec

* Cherry-pick of 7873d59 and 30abc7f
2019-02-18 15:59:54 +01:00
Henriette Dinger 49766d42bd Adapt tests to new default avatar and ng-select in the watchers tab 2019-02-11 15:09:45 +01:00
Henriette Dinger b279b2722b Show default avatar when no gravatar is defined 2019-02-08 14:59:22 +01:00
Oliver Günther 183ad1480e Replace deprecated controller success? with succesful? 2018-12-03 10:31:58 +01:00
Oliver Günther c3226bf2c0 Reload shared_lets by default 2018-12-03 10:31:58 +01:00
Oliver Günther 6e016f072e Bump factory-bot and fix static attributes deprecation 2018-11-21 18:25:23 +01:00