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.
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
* 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>
* 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
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
* 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
* 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
* 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>
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.
* 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