Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

extract time entries into own module

ulfertsbae6c48d63da
diff --git a/frontend/src/app/modules/calendar/openproject-calendar.module.ts b/frontend/src/app/modules/calendar/openproject-calendar.module.ts
index e631f7230f7..1437b1c3520 100644
--- a/frontend/src/app/modules/calendar/openproject-calendar.module.ts
+++ b/frontend/src/app/modules/calendar/openproject-calendar.module.ts
@@ -34,10 +34,8 @@ import {WorkPackagesCalendarController} from "core-app/modules/calendar/wp-calen
import {OpenprojectWorkPackagesModule} from "core-app/modules/work_packages/openproject-work-packages.module";
import {Ng2StateDeclaration, UIRouterModule} from "@uirouter/angular";
import {TimeEntryCalendarComponent} from "core-app/modules/calendar/te-calendar/te-calendar.component";
-import {TimeEntryEditModal} from "core-app/modules/calendar/te-calendar/edit/edit.modal";
-import {TimeEntryEditService} from "core-app/modules/calendar/te-calendar/edit/edit.service";
import {OpenprojectFieldsModule} from "core-app/modules/fields/openproject-fields.module";
-import { TimeEntryCreateModal } from './te-calendar/create/create.modal';
+import {OpenprojectTimeEntriesModule} from "core-app/modules/time_entries/openproject-time-entries.module";
const menuItemClass = 'calendar-menu-item';
@@ -66,29 +64,25 @@ export const CALENDAR_ROUTES:Ng2StateDeclaration[] = [
// Work Package module
OpenprojectWorkPackagesModule,
+ // Time entry module
+ OpenprojectTimeEntriesModule,
+
// Editable fields e.g. for modals
OpenprojectFieldsModule,
// Calendar component
FullCalendarModule,
],
- providers: [
- TimeEntryEditService,
- ],
declarations: [
// Work package calendars
WorkPackagesCalendarEntryComponent,
WorkPackagesCalendarController,
TimeEntryCalendarComponent,
- TimeEntryEditModal,
- TimeEntryCreateModal,
],
entryComponents: [
WorkPackagesCalendarController,
WorkPackagesCalendarEntryComponent,
TimeEntryCalendarComponent,
- TimeEntryEditModal,
- TimeEntryCreateModal,
],
exports: [
WorkPackagesCalendarController,
diff --git a/frontend/src/app/modules/calendar/te-calendar/te-calendar.component.ts b/frontend/src/app/modules/calendar/te-calendar/te-calendar.component.ts
index 331ceeb4537..768c2f3f7c1 100644
--- a/frontend/src/app/modules/calendar/te-calendar/te-calendar.component.ts
+++ b/frontend/src/app/modules/calendar/te-calendar/te-calendar.component.ts
@@ -17,10 +17,10 @@ import {FilterOperator} from "core-components/api/api-v3/api-v3-filter-builder";
import {TimeEntryResource} from "core-app/modules/hal/resources/time-entry-resource";
import {TimezoneService} from "core-components/datetime/timezone.service";
import {CollectionResource} from "core-app/modules/hal/resources/collection-resource";
-import { TimeEntryEditService } from './edit/edit.service';
import {TimeEntryCacheService} from "core-components/time-entries/time-entry-cache.service";
import interactionPlugin from '@fullcalendar/interaction';
import {HalResourceEditingService} from "core-app/modules/fields/edit/services/hal-resource-editing.service";
+import {TimeEntryEditService} from "core-app/modules/time_entries/edit/edit.service";
interface CalendarViewEvent {
diff --git a/frontend/src/app/modules/calendar/te-calendar/create/create.modal.html b/frontend/src/app/modules/time_entries/create/create.modal.html
similarity index 100%
rename from frontend/src/app/modules/calendar/te-calendar/create/create.modal.html
rename to frontend/src/app/modules/time_entries/create/create.modal.html
diff --git a/frontend/src/app/modules/calendar/te-calendar/create/create.modal.ts b/frontend/src/app/modules/time_entries/create/create.modal.ts
similarity index 100%
rename from frontend/src/app/modules/calendar/te-calendar/create/create.modal.ts
rename to frontend/src/app/modules/time_entries/create/create.modal.ts
diff --git a/frontend/src/app/modules/calendar/te-calendar/edit/edit.modal.html b/frontend/src/app/modules/time_entries/edit/edit.modal.html
similarity index 100%
rename from frontend/src/app/modules/calendar/te-calendar/edit/edit.modal.html
rename to frontend/src/app/modules/time_entries/edit/edit.modal.html
diff --git a/frontend/src/app/modules/calendar/te-calendar/edit/edit.modal.sass b/frontend/src/app/modules/time_entries/edit/edit.modal.sass
similarity index 100%
rename from frontend/src/app/modules/calendar/te-calendar/edit/edit.modal.sass
rename to frontend/src/app/modules/time_entries/edit/edit.modal.sass
diff --git a/frontend/src/app/modules/calendar/te-calendar/edit/edit.modal.ts b/frontend/src/app/modules/time_entries/edit/edit.modal.ts
similarity index 100%
rename from frontend/src/app/modules/calendar/te-calendar/edit/edit.modal.ts
rename to frontend/src/app/modules/time_entries/edit/edit.modal.ts
diff --git a/frontend/src/app/modules/calendar/te-calendar/edit/edit.service.ts b/frontend/src/app/modules/time_entries/edit/edit.service.ts
similarity index 97%
rename from frontend/src/app/modules/calendar/te-calendar/edit/edit.service.ts
rename to frontend/src/app/modules/time_entries/edit/edit.service.ts
index dbe499c8f06..d2415798223 100644
--- a/frontend/src/app/modules/calendar/te-calendar/edit/edit.service.ts
+++ b/frontend/src/app/modules/time_entries/edit/edit.service.ts
@@ -5,12 +5,12 @@ import {I18nService} from "core-app/modules/common/i18n/i18n.service";
import { TimeEntryResource } from 'core-app/modules/hal/resources/time-entry-resource';
import { TimeEntryEditModal } from './edit.modal';
import { take } from 'rxjs/operators';
-import {TimeEntryCreateModal} from "core-app/modules/calendar/te-calendar/create/create.modal";
import {FormResource} from "core-app/modules/hal/resources/form-resource";
import {TimeEntryDmService} from "core-app/modules/hal/dm-services/time-entry-dm.service";
import {ResourceChangeset} from "core-app/modules/fields/changeset/resource-changeset";
import {HalResourceEditingService} from "core-app/modules/fields/edit/services/hal-resource-editing.service";
import { Moment } from 'moment';
+import {TimeEntryCreateModal} from "core-app/modules/time_entries/create/create.modal";
@Injectable()
export class TimeEntryEditService {
diff --git a/frontend/src/app/modules/time_entries/openproject-time-entries.module.ts b/frontend/src/app/modules/time_entries/openproject-time-entries.module.ts
new file mode 100644
index 00000000000..79d79778676
--- /dev/null
+++ b/frontend/src/app/modules/time_entries/openproject-time-entries.module.ts
@@ -0,0 +1,58 @@
+// -- copyright
+// OpenProject is an open source project management software.
+// Copyright (C) 2012-2020 the OpenProject GmbH
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License version 3.
+//
+// OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
+// Copyright (C) 2006-2013 Jean-Philippe Lang
+// Copyright (C) 2010-2013 the ChiliProject Team
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
+// See docs/COPYRIGHT.rdoc for more details.
+// ++
+
+import {OpenprojectCommonModule} from 'core-app/modules/common/openproject-common.module';
+import {NgModule} from '@angular/core';
+import {OpenprojectFieldsModule} from "core-app/modules/fields/openproject-fields.module";
+import {TimeEntryEditService} from "core-app/modules/time_entries/edit/edit.service";
+import {TimeEntryCreateModal} from "core-app/modules/time_entries/create/create.modal";
+import {TimeEntryEditModal} from "core-app/modules/time_entries/edit/edit.modal";
+
+@NgModule({
+ imports: [
+ // Commons
+ OpenprojectCommonModule,
+
+ // Editable fields e.g. for modals
+ OpenprojectFieldsModule,
+ ],
+ providers: [
+ ],
+ declarations: [
+ TimeEntryEditModal,
+ TimeEntryCreateModal,
+ ],
+ entryComponents: [
+ TimeEntryEditModal,
+ TimeEntryCreateModal,
+ ],
+ exports: [
+ ]
+})
+export class OpenprojectTimeEntriesModule {
+}