34 Commits

Author SHA1 Message Date
Alexander Brandon Coles f7a5725386 Rename InjectField decorator to LazyInject
Renames the `InjectField` decorator (and its file) to `LazyInject` to
name its one distinguishing property: it resolves on first access, not
eagerly at construction. After migrating the DI-constructed call sites to
`inject()`, every remaining user keeps it deliberately for lazy
resolution — to break a circular dependency, to work on a manually
instantiated class, or to defer a service whose factory needs loaded
configuration. Mechanical rename, no behaviour change.
2026-06-04 17:45:16 +02:00
Alexander Brandon Coles c32f2f2e26 [#74950] Migrate Angular DI to inject()
Migrates Angular constructor-based dependency injection to the
`inject()` function. The initial pass used the Angular schematic;
manual follow-up handled abstract classes, inheritance-sensitive
constructors, and call sites that still instantiate services
directly.

Schematic command:

  cd frontend && npx ng generate @angular/core:inject-migration \
    --path ./ \
    --migrate-abstract-classes \
    --backwards-compatible-constructors=false \
    --non-nullable-optional=false

https://community.openproject.org/wp/74950
2026-05-18 10:23:52 +02:00
Ivan Kuchin 4911b8a149 remove years from copyrights (except for COPYRIGHT file) 2024-07-31 15:02:49 +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
Christophe Bliard 21a696ef9b Update copyright information for 2023 2022-12-30 15:51:26 +01:00
Christophe Bliard bc8d423ec2 update copyright information for 2022 2022-03-01 17:05:59 +01:00
Benjamin Bädorf b4143f4083 Align casing of Apiv3 services and types (#9968) 2021-12-13 10:13:19 +00:00
Oliver Günther ccfa29c728 Move license and copyright docs to root, fix names and references 2021-09-02 21:50:46 +02:00
Benjamin Bädorf 3a877457ad Feat/frontend linting (#9424)
* Change eslintrc config

* Try esprint fix

* Run linter fix

* Set most of the typescript linting rules to warn, run with --fix

* Fix some linting errors

* Optimize imports

* Build works again

* Remove fixes that didn't fix anything

* Make imports lint-conform again && disable trailing underscores as it is part of Angular and our convention

* Remove wrong automated fix

* Rename components with suffix "Component" for linting

* Linting, refactor reorder-delta-builder to a more functional style

* Update delta reorder specs

* Add exceptions for "++" in loops and bracket expressions in arrow functions

* Some linting fixes

* Fix some more linting

* Optimize imports

Co-authored-by: Henriette Darge <h.darge@openproject.com>
2021-07-08 15:38:01 +00:00
Aleix Suau 7e2e05c88f Feature/36390 code structure (#9319)
* core/shared/features in progress

* shared/components in progress

* Fix rebase errors

* core: added admin + apiv3

* shared: attachments + attirbute-help-text

* core: OpenprojectAugmentingModule

* shared: OpenprojectAutocompleterModule

* shared: Autocompleter

* feature: backlog

* feature: bim

* feature: boards

* shared: calendar

* core: userModule

* feature: dashboards

* shared: editor

* shared: fields

* shared: focus

* core: globalsearch

* shared: grid

* shared: grid fix

* core: hal

* shared: icon

* feature: invite user modal

* feature: job status

* shared: members autocomplete

* shared: modal

* feature: my page

* feature: overview

* shared: principal

* feature: projects

* feature: repoting

* core: routing

* shared: time entries

* shared: OpenprojectWorkPackageGraphsModule

* feature: workpackages

* core: active window

* shared: autofocus

* features: wp: back-button

* core: browser

* shared: collapseible section

* core: config

* shared: copy-to-clipboard

* shared: date-time

* shared: helpers: drag-and-drop

* shared: draggable autocompleter

* shared: dynamic bootstrapper

* shared: dynamic forms

* features: wp: edit actions bar

* shared: EditableToolbarTitleComponent

* core: BannersService

* shared: OpFormFieldComponent

* shared: hide section

* shared: highlight col

* core: I18 + Sanitizer

* shared: isClickedWithModifier

* core: LoadingIndicator

* core: Modal Heading

* core: Model auth

* shared: no results

* shared: notifications

* shared: datepicker

* shared: option-list

* core: path helper

* shared: persistent toggle

* shared: remote field

* shared: set click position

* shared: slide toggle

* shared: tabs

* shared: drag-scroll

* shared: keyCodes

* shared: OPSharedModule

* global styles: common

* core:

* import fixes

* shared: Enterprise banner

* features: wps: filters

* features: home screen

* import fixes

* core: html

* import fixes

* core: main-menu

* features: home screen

* shared: modals

* shared: op-context-menu

* core + shared: current project

* core: schema-cache

* shared: table-pagination

* features: wps: time-entries

* shared: user-link

* features: wps

* features: wps

* features: wps: all wp-* components

* core: states

* Rename: angular4-modules to app.module

* core: expression service

* Modules just with plugins

* Test fixes

* added missing content-tabs.component.sass

* Replaced with .op-ckeditor--wrapper

* Replaced by .op-ckeditor-source-element

* Replaced by the entire wysiwyg_editor.rb with dev version

* Replacements by ckeditor-augmented-textarea

* Fixes ./spec/support/components/work_packages/table_configuration_modal.rb:106

* Fixes ./modules/reporting/spec/features/update_entries_spec.rb:69

* work_packages renamed to work-packages

* TimeEntryChangeset moved to helpers

* 'filters' moved to wps/components

* 'admin' moved to features

* HAL moved to shared

* plugins moved to features

* plugins moved to features

* Test fixes

* Unit test fixes

* plugin generator into /features/plugins

* fix sass rule indentation

* Revert "plugins moved to features"

This reverts commit f65ccbfd4b.

* Import fixes

* Avoid commiting in linked plugins

Co-authored-by: ulferts <jens.ulferts@googlemail.com>
Co-authored-by: Oliver Günther <mail@oliverguenther.de>
2021-06-08 21:10:58 +02:00
Oliver Günther 3b78be087b Migrate tslint to eslint (#9064)
* tslint to eslint migration

* Autofix issues

* Fix codeclimate path to eslintrc

* Extend linter config for use with ng lint

* Change prefix to op in angular lints
2021-03-05 21:34:26 +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
Oliver Günther 73352fe2d4 [34257] Allow localized input of overridden costs (#8656)
* [34257] Allow localized input of overridden costs

https://community.openproject.com/wp/34257

* Add placeholder to cost-unit-subform

* Remove duplicate code from budgets extraction
2020-09-10 10:37:34 +02: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 dfa6bdb456 Extract all access of APIv3 calls into APIv3Service (#8521)
* Move apiv3 path helper into apiv3 service

* Refactor application to use apiv3 service

* Allow caching responses within apiv3 endpoints through state cache

* Fix reference to root service

* Continue refactoring of DM services

* Refactor version DM service

* Refactor order service into v3 paths

* Replace time entry dm and cache service

* Replace QueryFormDmService with nested form resource

* Replace QueryDmService with api paths

* Replace ProjectDM and ProjectCacheService

* Move PayloadDmService into static helper class

* Replace NewsDmService with api paths

* Replace MembershipDmService with api paths

* Replace HelpTextDmService with api paths

* Replace ConfigurationDmService with apiv3 path

* Replace GridDmService with paths

* Remove DmListParameters

This is now Apiv3ListParameters type

* Replace virtual BoardDmService with a virtual path

Boards are not actually their own API resource, but a shallow wrapper
over a grid resource.

To reuse the same API service pattern, we can allow other resources
other than HalResource and make the boards path just reference the grids
paths.

This allows to nicely use the `apiV3Service.boards.id(..).cache`
patterns.

* Refactor cacheState into single method

* Make HalEditingService a v3 cache without loading ability

* Replace usages of WorkPackageCacheService with api-integrated cache

* Fix accessing grid subpath

* Correctly use schema ensureLoaded before inserting into caches

* Fix query not having an ID when updating

* Fix npm tests after removal of wp cache

* Readd missing path helper for APIv3 used from ckeditor

* Correctly save query in widget

* Fix watcher tab

* Fix search path

* Use a promise for the updateImmediately link of time entry

* Make apiv3 independent cache services depend on the base cache service

We had two cache services now, one base service for the apiv3, and the
previous one. Both shared a lot of code, so we can unify them

* Don't use multiState getter in schemaCache

* Correct loading of schema

* Correctly fill state with relations

* Don't render comment until workPackage ready

* Merge the initial loading observable to get error handling

If we only return state.values$(),
we never get the initial http observable and thus no error handling

* Ensure we reload the default query from the current project if any

* Use get() instead of stream

* Load types correctly

* Fix paths in enterprise token urls

* Ensure take(1) in requireAndStream toPromise usage

* Avoid duplicate StateCacheService definition

* Only use project based query when there is no query.id yet

There is no endpoint for /api/v3/projects/:projectIdentifier/queries/:id

* Add isAvailable to filter out filters incorrectly added

The search component always adds a subproject filter when in project scope.
This filter however is only valid/existent in schemas if there is a subproject.

This ensures we only try to access filters that are available

* Refactor embedded table to reuse the loadQueryFromExisting method

We had a few duplicate methods on how to look for a query with params
basing on an existing (saved or unsaved) query.

* Ensure filter schemas are inserted and checked before use

* Better matcher for search spec

* Ensure correct initialization of query states

* Load attribute help text correctly
2020-07-31 14:26:36 +02:00
Henriette Darge b3dd61946e [32880] Display scheduling mode in work package view (full, split & table) (#8410)
* Show icon next to start date depending on the scheduling mode

* Show modal when opening date edit fields which shall be able to change the dates and the scheduling mode

* Introduce flatpickr as a datepicker for the modal of the dateEditField

* Use new datepicker within opDatePickerComponent

* Reuse existing Datepicker class for better code abstraction

* Set dates only when Instance is ready

* Let augmentedDatePicker use generic DatePicker class, too.

* Remove jQuery UI datepicker specific styles as they do not apply any more.

* Use localized strings in new datepicker

* Close datepicker only on click outside

* Allow single and multi selection of dates and save changes

* Update schedulingMode button correctly && remove unused method

* Show combined field for start and end date within the WP single view

* Show normal datepicker for most date fields and the modal with the extended datepicker only for startDate

* Add datepicker edit field and component helper

* Correctly save start and end date

* Show correct default value for dateEditFields  && Adapt some tests to new datepicker and combined date field

* Fix date editor spec

* Fix expecting datepicker for start/due date as milestone

* Prevent overflow on body by using modal-portal class && make edit input for combinedDates visible again to show something in a create form

* Only output one debounced change event for op datepicker

* Show combined datepickerModal for dueDate in table, too && save correct scheduling value

* Hide modal if the showing component gets destroyed

* Correctly check for closed datepicker

* Add spec for toggling scheduling mode

* Fix setting dates to modal

* Avoid too many (unnecessary) close events and use keydown instead

* Fix date setting and add custom field date spec

* Change layout of combined date picker modal

* Switch from a range date picker to a multiple selection in order to be able to set only start or due date && Highlight date field that is changed next

* Highlight range manually

* Highlight dueDate initially when the user clicked on the due date field && handle special case that one of the values is not set yet. In this case we don't want to keep both values but only the newly clicked.

* Move helper functions to own class && Improve the range selection to be able highlight ranges over multiple months && Prevent that a start date > due date can be chosen by setting minDate and maxDate

* Adapt test to new way of changing the scheduling mode

* Handle case that the user clicks on a already selected date and thus deselects it

Co-authored-by: Oliver Günther <mail@oliverguenther.de>
2020-06-16 05:50:51 +02:00
Oliver Günther 5193dcf7cd [32822] Fix parsing budget with non-english locale
https://community.openproject.com/wp/32822
2020-03-31 16:14:37 +02:00
Oliver Günther 54e30cad7d [32664] Fix trying to parse currency string in costs value
https://community.openproject.com/wp/32664
2020-03-18 16:49:01 +01:00
Oliver Günther d57ad09474 Fix singleton services being initialized per module
The `APP_INITIALIZER` only runs for global services on startup, but some
modules are now loaded dynamically.

This will result in services that are not `providedIn: 'root'` being
injected for each lazy loaded module that requires them.
2020-03-05 13:01:42 +01:00
Oliver Günther c7c24daa01 Add more usages 2020-02-21 19:19:07 +01:00
Henriette Dinger bd7f4e4814 Update copyright notice 2020-01-15 11:31:26 +01:00
Oliver Günther 4bd704a3e5 [31739] Use withCredentials: true in budget forms
https://community.openproject.com/wp/31739
2019-11-27 16:09:17 +01:00
Oliver Günther b4ab329c0b Merge remote-tracking branch 'origin/release/10.0' into dev 2019-10-04 13:28:02 +02:00
Oliver Günther a853fe32ae [31247] Fixed updating planned costs due to missing fixed_date
https://community.openproject.com/wp/31247
2019-10-02 10:48:06 +02:00
Henriette Dinger f47a75d153 [31023] Preparation for project edit fields: Generalize edit and display fields currently work package specific (#7726)
* Check edit fields for Work package dependencies

* Make EditForm, NotificationService, EditContext indepenedent of Work Packages

* Make EventsService independent of WorkPackages

* Start renaming WpNotificationService (WiP)

* Fix more references

* Fix typescript errors

* Add basic halEditingService

* Rename to global halResourceEditingService (WiP)

* Move typing from class to methods (WiP)

* Fix typescript errors

* Remove space in type

* Add test project widget && generalize the editFieldGroup

* Rename editing portal service

[ci skip]

* Rename WpEditFieldComponent

* Rename WpDisplayFields

* Rename display-XX-field to XX-display-field

[ci skip]

* Add WP specific ID field to distinguish between resources

* Re-add state in work package resource

* Generalize display field renderer

* Rename spent-time to wp-spent-time and fix highlight specifics

[ci skip]

* Actually load the project schema and make field editable

* Make edit-field-group.component an edit-form.component and subclass EditForm

* Remove edit context in favor of specialized EditForm

* Add special cases for work package editing

* Fix edit actions bar

* Fix codeclimate issues

* Use WorkPackageNotificationService if necessary

* Override NotificationService for WPs to allow WP specififc notifications (WiP)

* Correctly provide wpNotification service

Because the ui-router doesn't seem to correctly use the parent element's
injector, we need to provide the wpNotification service not in the
wp-base, but rather the wp-list component as well as in the isolated
query space.

* Allow to filter halEvents for specific resourceTypes (e.g. WorkPackage)

* Remove superfluous cell class constant

* Start renaming selectors for wp-edit-field into generics

* Remove wp-table--cell-span in favor of display field selector

* Consolidate other display and edit field styles

* Provide specialized service for transitions in active edit forms

* Remove superfluous overflowSelector

* Accept that date field contains some work package specifics

* Ignore unreadable files

* Provide the changeset for work packages as a hook

Since hal resource editing service is provided per query space, we
cannot register them once (would only work globally)

* Fix dangerfile

* Remove another todo in halResourceNotification service

* Fix npm TestBed for changed dependencies

* Show inplace edit field in project details widget

* Fix highlighting in single view

* Provide HalResourceEditingService outside of project context

* Used typedState for single-view

* Also provide wpNotification service in split view

* Correct check for resource type in eventsService

* Fix getSchemaName in display field renderer

* Fix passing ids into `halEditing.stopEditing`

* Do not globally inject the halResourceEditingService

There's a bug(?) in ui-router that gives you the global service before
the parent injected service for a ui-view

* Fix wpCreate service on copying and parallel creation

* Remove test project widget

* Revert changes for project details widget
2019-10-01 16:21:17 +02:00
Oliver Günther b1ca7260a1 Merge pull request #7385 from opf/housekeeping/remove-angularjs
[29554] Remove AngularJS 1.6

[ci skip]
2019-07-06 19:52:28 +02:00
Oliver Günther 352251372d Cache active display fields for the duration of table render passes 2019-07-03 20:33:47 +02:00
Oliver Günther 144c0bb8e7 Merge remote-tracking branch 'origin/dev' into housekeeping/remove-angularjs 2019-07-02 07:37:56 +02:00
Oliver Günther 8e32895ce3 Remove legacy frontend 2019-07-01 20:08:06 +02:00
Oliver Günther 5167f4fca8 Replace costs-subforms with augment service 2019-07-01 13:29:27 +02:00
Henriette Dinger 0e37e2df13 Do not update with old values, but touch state to fire subscribers instead 2019-06-21 15:32:42 +02:00
Oliver Günther 81c7b40b7e [29595] Remove cost_entries page when cost reporting is disabled
This page was broken for some time and is never hit unless cost
reporting is disabled, but costs is enabled.

https://community.openproject.com/wp/29595
2019-02-25 09:38:31 +01:00
Henriette Dinger 97aec94c1f Handle different currency formats with regex 2018-11-27 13:34:42 +01:00
Oliver Günther 5b49b33b21 Prepare for core integration 2018-11-14 13:53:35 +01:00