141 Commits

Author SHA1 Message Date
Tomas Hykel dd804dcb9c Merge remote-tracking branch 'origin/dev' into feature/71896-change-identifier-with-semantic-identifiers 2026-03-19 01:21:19 +01:00
Tomas Hykel a30973cdc7 [#72855] Add semantic identifier support to "Add Project" 2026-03-12 21:51:01 +01:00
Tobias Dillmann 85b700ca9b [#71250] Add spec for permitted_params 2026-03-09 13:24:50 +01:00
Ivan Kuchin d746efca66 permit custom comments for projects 2026-02-25 16:00:31 +01:00
Ivan Kuchin 34610c9b47 more explicit expectation when params forbidden 2026-02-05 14:15:15 +01:00
Ivan Kuchin 8854a3b406 rename expected_allowed_params to expected_permitted 2026-02-05 14:15:15 +01:00
Ivan Kuchin 39b733fdff to_h not needed after index_with and index_value also accepts value instead of block 2026-02-05 14:15:14 +01:00
Alexander Brandon Coles 4c55748cd8 [#66122] Initial server rendered widgets support
Provides Project Status (BETA) widget as a Reference Implementation -
this widget is currently based on the design of the Status form on the
Project Settings > General page.

In detail:

- introduces a base `WidgetController` from which widget implementations
  should inherit.
- adds `Overviews::Widgets::ProjectStatusComponent` and accompanying
  specs. Reuses existing forms.
- adds `Overviews::Widgets::StatusController`` with custom `#update`
  action, routes and accompanying permissions.
- makes the Project Status (BETA) widget available by registering in ng
  `OpenProjectGridsModule` and Rails grid modules configuration.

N.B. The Project Status (BETA) widget is EXPERIMENTAL - it will require
further visual refinement (in a follow up work package).
2025-09-02 16:59:07 +01:00
ulferts c1fd9520ac pass workspace_type on project creation 2025-08-04 16:43:49 +02:00
Alexander Brandon Coles 974de82cfd Fix submission when no copy options are checked
Ensures no asssocations/dependencies can be checked when the user copies
or creates a project from template.
2025-07-01 12:30:07 +01:00
Alexander Brandon Coles 7266897a15 Update #create action to permit minimal params
Consolidates param filtering in `PermittedParams`.
2025-06-11 23:28:02 +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
Dombi Attila e065e1a4c3 Fix specs 2024-10-28 09:09:57 +01:00
Dombi Attila 9355fa1de3 Test admin-only boolean being saved correctly. 2024-08-07 15:38:28 +03:00
Ivan Kuchin 4911b8a149 remove years from copyrights (except for COPYRIGHT file) 2024-07-31 15:02:49 +02:00
Christophe Bliard c6f332620f Avoid misleading "Unpermitted parameters: xxx" log
When `PermittedParams#settings` was called, it was not permitting any
params, which lead to "Unpermitted parameters: ..." messages being
logged, and then merged the resulting empty params with the controller
params after having filtered them manually. It was ok-ish but the logged
error message was misleading.

The `#settings` method was refactored to permit params that are allowed
in a single step and avoid the misleading log messages.
2024-05-24 17:46:32 +02:00
Christophe Bliard 636746953b Use double-quotes and make Rubocop happier 2024-05-24 17:42:09 +02: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
Klaus Zanders 0c2011216f Rename methods for mocking to allow_xxx schema
Co-authored-by: Christophe Bliard <c.bliard@openproject.com>
2023-10-16 08:41:06 +02:00
Klaus Zanders 706bd8dfbb Remove bang 2023-10-09 10:49:02 +02:00
Klaus Zanders e3257c7667 Change calls using mocks on the user to our new mocking helper 2023-10-09 10:44:42 +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 e32d2d0058 Remove AuthSource base namespace, model 2023-07-27 08:16:43 +02:00
Klaus Zanders 3d5f4e1b29 Start using create_user permission in appropriate places 2023-07-20 08:59:15 +02:00
Christophe Bliard c0a45951f1 Restore some authentication settings in admin
Also makes ckEditorAugmentedTextarea read-only if the wrapped text area
is disabled.

As for the invitation_expiration_days setting, commit 269f9416dd and
commit 286d862c38 got intertwined with merge commit eb63698a3d, and
resulted in hiding the setting when
`OpenProject::Configuration.registration_footer` is set.

As for the registration_footer setting, PR #6321 intent was to prevent
modifying it if it was already set via env var or configuration file.
When `OpenProject::Configuration` and `Settings` were merged, this code
was not updated. With the default value being non-blank, it lead to
hiding the setting from the administration pages.

This commit restores both settings.
2023-06-12 16:22:11 +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
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 48a4f1b6ad lint with rubocop --autocorrect (safe cops only) 2022-06-02 10:40:10 +02:00
Christophe Bliard bc8d423ec2 update copyright information for 2022 2022-03-01 17:05:59 +01:00
Oliver Günther f08bea3467 Remove FactoryBot.* prefix where applicable 2022-01-25 08:19:06 +01:00
ulferts 32a19b622e use current user for wiki content update
Before, the initial author was always used via #add_journal and with a virtual attribute that is already present as journal_notes
2021-10-25 22:11:27 +02: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 9636a08988 [26688] In-app notifications (#9399)
* Add bell icon to icon font

* Add in app notification in top menu

* Add fullscreen modal

* Add notification modal and items

* Style items

* Toggle details of item

* Mark all read

* Add no results box

* wip specification for event api

* Add events table, query and index

* Send out events from WP notification mailer job

There we have the recipients present

* Add cleanup job for older events with a setting

* Hide bell notification when not logged

* Add specs for events API index/show

* Fix setting yml key

* remove pry in event creation

* Fix before hook in events API to after_validation

* Fix polymorphic association raising exception for aggregated journals

* Fix typo in read_ian

* Fix yml entry for mentioned

* Add read/unread post actions to event API and add specs

* Wire up API to frontend

* Fix order on events

* Switch to unread in notification

* Add event query

* rename WPEventService

* route wp mail sending over events

* rename spec methods

* author becomes watcher

* correct message call signature

* rename events to notifications

* renname parameter to reflect notification nature

* create author watcher for existing work packages

* Merge unreadCount from store

* Take a stab at polymorphic representers

* Fix link generation in polymorphic resources

For journals, no title is being generated however

* Fix frontend model for context

* Use timer for polling

* add notification_setting data layer

* Fix show resource spec

* Fix duplicate class in notification bell item

* Add minimal feature spec for notification

* API for notification settings

* Persist notifications

* adapt work package notification creation to notification settings

* extract notified_on_all

* consolidate wp#recipients

* concentrate wp notification in journal service

* simplify methods

* Remove unused patch endpoint

* Add specs for rendering and parsing notification settings

* Contract spec

* Update service spec

* adapt specs

* Angular notifications frontend

commit e29dced64699eb5f2443b9307c78343c9a58d1ee
Author: Wieland Lindenthal <w.lindenthal@forkmerge.com>
Date:   Mon Jun 21 17:34:50 2021 +0200

    Create Akita store and query for notification settings

commit 1a45c26c1a0c147d15393e49d2625aca4851a64d
Author: Wieland Lindenthal <w.lindenthal@forkmerge.com>
Date:   Mon Jun 21 11:09:25 2021 +0200

    Remove tabs from notificaition settings page

commit 0ea21e90c13a197f8bf2cfba1b60ddcff4e5e827
Author: Oliver Günther <mail@oliverguenther.de>
Date:   Sun Jun 20 21:55:48 2021 +0200

    WIP in app settings

* migrate notification data

* add project visible filter to project query

* Add inline-create and table display grouped by project

* Add notifications under admin/users

* Remove notifications partial

* Rename notififcations store to user preferences store

* Add setting for self_notified and hook that up to the backend

* Add aria-label to table checkboxes

* Restyle table and toolbar

* replace remains of mail_notifications attribute

* initialize notification settings for new user

* adapt my_preferences references

* reenable no self notified for documents

* adapt specs

* Avoid has_many :notifcation_settings

Rails magically autosaves the user's preferences when the user gets saved,
which somehow also tries to save the notfifications even when unchanged.

This breaks some specs such as the avatar upload spec. As we can't update the assocation
through rails anyway, just delegate to the user for reading instead.

* Restore update method of notification settings

* Restore update spec

* fix spec syntax

* lint scss

* linting

* Fix content_tag for bell icon

* Add feature specs for notification settings

* Disable ContentTag cop

* use visible filter to get projects for notification

The visible filter will reduce the project list down to the set of projects visible to the user provided as a parameter. This includes public projects.

* test for actual mail sending

* adapt me resource path

this.apiV3Service.users.me changed its type in 0d6c0b6bc7

* Implement changed migration

* Linting

* Add actor to notification representer

* Fix factory creating a duplicate WP journal

* Add work packages loading and journal details to notification entry component

* IAN basic facets, keep and expanded states.

* Fix notification bell spec

* Render body separately and add auto updating relative time

* Add fixedTime title

* Add actor to notification entry

* Fix clicking links on work package and project

* Tiny styling changes on entry row

* Disable count in notification if larger than 99 (wont fit)

* Introduce virtual scrolling to entry table

* allow delaying & prevent mail sending if ain read

Introduces a setting to delay mail sending after a journal aggregation time has expired. That way, users can confirm a notification in app. If they do before the delay expires, no mail is sent out additionally for that user.

* consolidate notifications (in&out) into shared admin menu

Co-authored-by: ulferts <jens.ulferts@googlemail.com>
Co-authored-by: Wieland Lindenthal <w.lindenthal@forkmerge.com>
2021-06-24 14:03:29 +02:00
Wieland Lindenthal c4c2149d98 Fix: 36299 -- Allow to modify login when global permission :manage_users present (#9026)
* Refactoring: Create shared examples for user contracts

* Users::UpdateContract spec added

* Add spec for updating the login of a user

* Add spec for permitted params when global permission to :manage_user

* Remove spec for :login updates for user UpdateContractSpec

The writability of the login attribute is not part of the contract
(yet).

* Use user contract for checking writability of user attributes

* Fixing user contract specs.

* use persisted user in spec

Co-authored-by: ulferts <jens.ulferts@googlemail.com>
2021-03-02 11:54:36 +01:00
ulferts 1bdd2ab9ae safe automatic fixes by rubocop (#8994) 2021-02-11 16:02:18 +01:00
Oliver Günther 109ade62da Allow editing auth_source as a global user (#8954) 2021-02-10 17:55:24 +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 6cce947cbd Chore/rename timestamps (#8765)
* rename timestamps on time entry

* add updated_at filter/order for time entries

* rename on cost entries as well

This will make handling in the cost query easier

* adapt specs

* linting

* adapt project activity

* update references to updated_on

* remove outdated docs/code

* global memberships are just memberships

* rewire global membership creation/update/deletion

* delete no longer required code and patches

* move code to core

* move specs to core

* completely remove global roles in the form of a plugin

* adapt specs

* remove unused methods

* migrate existing data

* adapt membership representer to changed timestamps

* global memberships available via API

* implements created/update_at filters on memberships

* update member on roles being added/removed

* specify default value for created_at

* fix project permission check and validation on members

* adapt membership schema

* adapt usage of sort by on members widget

* support created/updated_on for api sort and filter

* remove outdated model file

* rename timestamps

* allow specifying timestamp column for aaj

* reload column information

* further rename of created_on

* include updated_at into journal creation

* adapt document updated_at calculation

* remove references to JournalVersion
2020-12-03 12:00:19 +01:00
ulferts 6826f90ee2 Feature/remove timelog (#8557)
* rename costs, introduce budgets

* move files from costs to budgets

* rename cost_object to budget

* remove unused code

* move hook - should be turned into standard code in the long run

* move type attributes change over to budgets

* move patch to work_package proper

* move budget menu item up

* combine reporting, time and cost module

* remove rails based time_entries & reports code

* rename cost object filter

* adapt menu spec expectations

* use cost project module name in administration

* include timeline labels in migration

* properly place budget linking method

* fix permitted params

* remove outdated routing spec

* adapt budget request specs

* ensure order of descendent updates

* remove outdated specs

* fix checking for reporting to be enabled

* fix displaying spent units

* fix time entries activity event url

* reenable current rate tab

* fix path on budget page

* allow bulk editing of budgets only in one project scenario

* fix sanitizing reference in controller

* include module required for format_date

* fix reference to correct units from work package spent units

* linting

* remove outdated spec

* remove outdated views and permission references

* remove acts_as_event from time_entries

There is no atom link for time entries

* remove acts_as_event from projects

There are no atom links for projects

* introduce budget filter for cost reports

* remove actions added to removed controller

* move time entries to the costs module

* factor in view_own permission when calculating time entry visibility

* linting

* move mounting of time entries

* include budgets into api v3 documentation
2020-08-18 08:24:34 +02:00
Oliver Günther dab04415c4 Fix indentation from editorconfig 2020-05-05 15:55:22 +02:00
Oliver Günther 80e747e0c6 Fix test by calling service with system user
Adds this to the factory to avoid using the system user all over the
place
2020-05-05 13:10:09 +02:00
ulferts 0b15db3c9a rename fixed_version to version 2020-03-27 09:10:44 +01:00
ulferts 70a29885d5 fix topic attachment upload 2020-03-02 15:49:32 +01:00
Henriette Dinger bd7f4e4814 Update copyright notice 2020-01-15 11:31:26 +01:00
ulferts 7d4a4a19e7 use join table for storing activites active in project 2019-12-19 15:25:17 +01:00
ulferts 5733679291 add project status to project settings page 2019-09-27 08:51:32 +02:00
Oliver Günther 0541a32dfa Fix specs 2019-07-03 22:02:59 +02:00