62 Commits

Author SHA1 Message Date
Henriette Darge bd87fd5901 Pass PageHeader information to plugin partial 2024-10-16 08:59:58 +02:00
Ivan Kuchin 4911b8a149 remove years from copyrights (except for COPYRIGHT file) 2024-07-31 15:02:49 +02:00
Henriette Darge 4f2b8d39c2 Replace old icons with Octicons inside the main menu 2024-06-11 12:46:23 +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 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
Oliver Günther 86b03ef805 Disable avatars in tests by default
Leaving it at true results in requests to gravatar, which breaks tests in unstable internet connections
2023-10-16 12:08:04 +02:00
Christophe Bliard 3871a47546 Internationalize plugins name and description 2023-09-04 12:06:15 +02:00
Eric Schubert 4d05975675 [#47362] Replace spot-icon with boxed icons
- https://community.openproject.org/work_packages/47362
- added new icon font for spot icons
- replaced container containing spot-icon with `inline-flex`
2023-04-25 09:43:03 +02:00
Christophe Bliard 21a696ef9b Update copyright information for 2023 2022-12-30 15:51:26 +01:00
Christophe Bliard 48a4f1b6ad lint with rubocop --autocorrect (safe cops only) 2022-06-02 10:40:10 +02:00
Oliver Günther fb6d85d50b Fix reloading avatars by removing the patching 2022-05-24 14:04:49 +02:00
Oliver Günther f45aa936bb Move patch files into app 2022-05-24 09:57:26 +02:00
Oliver Günther 9e3c51299a Remove Setting.protocol in favor of static config 2022-05-18 16:21:55 +02:00
ulferts 92d00affca use active_support hook for patching 2022-04-04 16:46:00 +02: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
Christophe Bliard bc8d423ec2 update copyright information for 2022 2022-03-01 17:05:59 +01:00
ulferts 89cfee203f remove usage of require_dependency
according to the rails 6 migration guide, it should no longer be necessary: https://guides.rubyonrails.org/upgrading_ruby_on_rails.html#require-dependency
2022-01-07 14:46:21 +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
Henriette Darge 2ee3a06c63 * Remove dead links (#9453)
* Use .org website address consistently
* Remove community address as homepage as it does not really offer any value
2021-07-14 15:51:09 +02:00
Oliver Günther e9d7c374cc [37868] Whitelist for attachment mime types and extensions on upload (#9431)
* Add setting for whitelist

* Make attachments API BaseServices compatible

* Add prepare service and contract

* Correctly pass the filename to the UploadedFile

* Add presence check to filename

* Fix expected validation message

* We no longer raise a multipart error when metadata is empty

* Fix filesize validation on prepared uploads

* Add parser error if invalid metadata json

* When attachment is not saved, use filename property

* Return correct error message on JSON parser erroro

* Fix specs

* Use attachment upload representer

* Fix direct uploads mocks with new service layer

* Lint

* Fix export job using attachment service

* Fix IFC controller using attachment prepare service

* Fix export job

* RenameRename params_getter to params_source

* Fix mail handler using attachment service

* Fix usage of attachment create service in documents

* Reuse shared examples for document attachment spec

* Fix stubbed attachment service in export job spec

* Use admin user in backup spec

* Fix export job for bim

* Fix attachment integration spec

* Fix issues_controller spec

* Make budget resource spec reuse common examples

* Fix attachment parsing representer spec

* Replace prepare part of attachment spec into separate service spec

* Clear cache for login spec

* Convert document create/update into services

* Budget services

* Allow options to be passed to property twin

* Remove setting author on budget initialize

* Replace meetings update with services

* Replace ifc models attachment handling with services

* Don't check uploader if changed by system

* Fix uploader being changed by system

* Replace wiki page attach_files with attachable services

* Replace avatar  saving

* Replace snapshot attach_files

* Skip double validation when container present

* Set snapshot through attachment service

* Remove attach_files

* Validate content type in contract

* Enforce writing the content type without accepting user input

* Expect changed content_type

* Fix content of viewpoint image to get correct content type

* Fix tsv spec

* Add create contract spec

* Bypass whitelist in internal services when conflicting with user

* Fix expects in specs after whitelist bypass

* Render contract errors for wiki

* Add before_hook to bodied to allow to pre-authorize permissions

* Budget errors from contract

* Document errors from contract
2021-07-14 14:43:19 +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
Oliver Günther bb27cf9903 [37257] Bust cache on settings name format change (#9276)
* [37257] Bust cache on settings name format change

https://community.openproject.org/wp/37257

* add specs for user representer cache busting & avoid patch

Co-authored-by: ulferts <jens.ulferts@googlemail.com>
2021-05-18 10:59:17 +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
Oliver Günther 34f8e9dff8 Validate admin guard for all settings writers (#9012)
* Validate admin guard for all settings writers

* Add spec to test access to all links under admin

* Fix broken specs

* Keep only UpdateContract and add spec

* Move admin settings under their own namespace for clarity

Move all admin related settings under ::Admin::SettingsController

* Fix more paths and views for settings

Adds another spec to ensure all links in admin can be viewed by admin

* Fix wrongly changed settings path for repositories page

* Use plugin name for plugin settings
2021-02-22 20:46:27 +01:00
Wieland Lindenthal a18954b2c9 Placeholder user services and administration (#8944)
* Adding placeholder user contracts

* Adding create, update, and delete services for placeholder users

* WIP: Adding Placeholder User contract specs [ci skip]

* Extract contract validation into common helper

* Add common validation in BaseContract + common example for admin checks

* Introduce common ModelContract shared context for validations

* WIP: PlaceholderUser controller, i18n, and routes [ci skip]

* Placeholder users index page and query

- moved all group related scopes from User to Principal to make them also available in PlaceholderUser.

* end

* Create PlaceholderUser

* Feature spec for editing a placeholder user

* Manage PlaceholderUser memberships

The managment of memberships is pretty similar for User and PlaceholderUser. This commit extacts the similarities and uses them for both.

* General partial and show view for PlaceholderUser

* Delete obosolete partial

* Allow RequireAdminGuard to be used as a module function

* Fix I18n for confirmation text

* Smaller code improvements

* Fix: Syntax for accessing status enums was wrong.

* Use UpdateService for updating a placeholder user

* Add spec for PlaceholderUsersController

* First code improvements after code review.

- more improvements to come.

* Further code improvements after review

... still more to come

* Correct namespace of delete service

* Fix: Make placeholder user contract validate

* Remove :type attribute from base contract of User and PlaceholerUser

...and add it to the CreateContracts.
Also add type validations.

Further extract shared examples for placeholder user attribute
validation

* Refactor: Extract membership hook calls to helper

* Fix redirect paths for membership controllers

* Specs already present in shared exampels.

* Fix duplicates routes for users and placeholder users

* Fix user path

* Add attribute name and lastname

We don't need a writeable check as both are equally writable

* Replace more references to tab_edit_user_path

* Skip specs for PlaceholderUsers::DeletionService

We will tackle that service in a separate PR.

* Fix module usage of RequireAdminGuard

* Fix group filter for placeholder users

* Fix invalid reference to expect_valid

* Fix: Fix tabbed edit path for placeholder users

* Fix status filtering on users

* Linting

* Improve generalisation of individual principal filter cell

- Check for presence of groups and statuses in order
  to toggle visibility of their UI element.
- Remove groups from placeholder user controller and
  cell initialization and options

* Fix selector on groups assign

* Remove using_shared_fixtures

Co-authored-by: Oliver Günther <mail@oliverguenther.de>
2021-02-12 17:18:55 +01:00
ulferts 1bdd2ab9ae safe automatic fixes by rubocop (#8994) 2021-02-11 16:02:18 +01:00
Oliver Günther cdf3cf4c34 [36136] Rework members page to show name and avatars for principals (#8973)
* Rewrite members page to output name column

* Remove white-space nowrap for long login names in administration

* Extend member specs

* Allow query instance to be used in table cell

* Fix memberships specs with changed columns

* Add order for email

* Review feedback

* Allow x to close add member form

* WIP sort firstname/lastname

* Make status sortable

* Extract order_by_name into the order class

* Re-add but deprecate order_by_name

It's still in use in combination with some special scopes

(custom actions for example) that I don't want to remove right now

* Rewrite order_by_name into scope
2021-02-11 09:33:43 +01:00
Oliver Günther 3c9be3bdbe [35507] Allow global permission to add and edit users (#8937)
* Add global permission for add_user

* Rename fieldset for global roles to "Global"

* Add permission to admin actions

* Add index action to add_user permission

* Redirect to first admin item if only one

* Hide status action for non admins

* Break down user form into partials for easier rendering

* Disable some user form tabs for non-admins

* Make users API and services conformant with endpoints

* Fix references to DeleteService#deletion_allowed?

* Authorize add_user on show as well

* Only show invite user toolbar item with permission

* Fix Delete Service spec

* Fix the way user prefs are handled in service

* Ensure session_id is treated as string

This causes a cast error otherwise as it passes rack session locally

* Fix service call on onboarding controller

* Fix service call on users controller

* Add delete spec for global user

* Hide login attribute again when adding a new user

* Render auth source correctly in simple form

* Fix creating invited users through service

The invitation requires the mail attribute to be present.

Previously, there was a manual error added to the mail.

As the errors are now determined by the contract + model, we now

end up with all missing properties as errors.

* Properly constraint attributes for non-admins

* Add specs for global user

* Start working on how to update password from UsersController

that code is a mess...

* Change permitted_params spec to include non-admin params

* Fix create user service spec

* Remove mail_notification param from users controller

It's not part of the contract/params passed to user

* Remove todos

* Extend docs

* Correct the way backlogs patches into the user settings

* Remove superfluous UpdateUserService

* Rewrite duplicated update service examples into common shared example

* Remove duplicate password writable check

* Base Users::DeleteContract on base delete contract

* Move checks for active users into the UserAllowedService

* Restore password writable check as it is not an attribute

* Fix menus for global user

* Allow global users to add custom fields

* Allow global user add permission to reinvite user

* Fix changed var name in update service spec

* Ensure also invited or registered users can be authroized

This ensure that e.g., invited users can also be set as watchers

* fix typo

Co-authored-by: ulferts <jens.ulferts@googlemail.com>
2021-02-01 10:45:13 +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
ulferts 4dd8e433b4 Fix/bump gems (#8770)
* bump aws-sdk-core

* bump danger

* bump parser

* bump grape - stream related header setting bug has been fixed

* reapply cache headers on stream as grape insists on niling them

* bump aws-partitions

* bump regexp_parser

* bump rubocop

* bump webmock
2020-10-26 21:25:18 +01:00
ulferts f652819e71 replace deprecated URI.encode in gravatar_image_tag 2020-08-31 07:13:13 +02:00
Oliver Günther 623f8c772e Move module assets to frontend 2020-06-29 11:36:39 +02:00
ulferts 64d0f57d85 Feature/aggregated activities (#8221)
* use cte for aggregated journal

* Revert "use cte for aggregated journal"

This reverts commit 5fedefefdd.

* add another subselect that could later on be provided from the outside

* allow passing a nukleous sql to aggregated journals

* wip - using aggregated journal for activity

* new sql for aggregated journals

* start implementing new aggregated query

* additional documentation

* consolidate activity functionality

* simplify by turing into instance methods

* move activity fetcher out of redmine

* remove verb verification made obsolete

Without catchall routes, the dispatching handles it

* remove duplicate authorize check

* refactor activities controller

* refactory activity fetcher

* cache avatar file

* sort choosable events

* remove legacy spec covered by contemporary

* speed up aggregated journals via CTE

* instance var might never have been set

* ensure the event_types are always transmitted

* correctly reset the avatar cache

* fix avatar fetcher expectation regarding wiki pages

* adapt spec

[ci skip]
2020-04-27 08:04:28 +02:00
Oliver Günther c3f0ddf743 [32870] Don't set cache headers for own avatar
The empty seconds end up to `CacheControl: public,max-age=` which means
indefinite caching on outer load balancers

https://community.openproject.com/wp/32870
2020-04-02 10:04:10 +02:00
ulferts 0b6d82c632 cache non avatar attachments for a year 2020-03-05 14:49:33 +01:00
ulferts 399e8c3ed9 rename according to zeitwerk 2020-02-21 20:47:25 +01:00
Henriette Dinger 44058e93d7 Satisfy codeclimate and remove unnecessary stuff from .lsg file 2020-01-20 14:17:23 +01:00
Inga Mai 32079589a0 Admin User tabs 2020-01-20 13:06:26 +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
ulferts 944ce28052 Merge branch 'dev' into housekeeping/avatar-cache 2019-10-21 10:12:49 +02:00
Markus Kahl bfe1e2003f make external avatar URLs valid for 24h 2019-10-18 12:03:22 +01:00
Oliver Günther 05ed8d2e6a Expire only for other users 2019-10-17 11:41:12 +02:00
Oliver Günther 2e9bbd30d5 Set public cache header expires for avatar 2019-10-17 11:17:38 +02:00
Henriette Dinger 21967f3099 Move avatar plugin configuration to users menu node 2019-07-04 10:37:19 +02:00
ulferts a199c94a6a have permission specific schema caching 2019-06-11 10:46:11 +02:00