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

Merge branch 'dev' into implementation/66904-split-up-overview-and-dashboard

Alexander Brandon Coles2107812cf54c
diff --cc frontend/src/app/shared/components/grids/widgets/widgets.service.ts
index ab2b465f402,89068a98f36..faa5272916f
--- a/frontend/src/app/shared/components/grids/widgets/widgets.service.ts
+++ b/frontend/src/app/shared/components/grids/widgets/widgets.service.ts
@@@ -1,37 -1,6 +1,38 @@@
-import { Injectable } from '@angular/core';
+import { inject, Injectable } from '@angular/core';
import { WidgetRegistration } from 'core-app/shared/components/grids/grid/grid.component';
import { HookService } from 'core-app/features/plugins/hook-service';
+import { ApiV3FilterBuilder } from 'core-app/shared/helpers/api-v3/api-v3-filter-builder';
+import {
+ WidgetWpTableQuerySpaceComponent,
+} from 'core-app/shared/components/grids/widgets/wp-table/wp-table-qs.component';
+import { WidgetWpGraphComponent } from 'core-app/shared/components/grids/widgets/wp-graph/wp-graph.component';
+import { WidgetWpCalendarComponent } from 'core-app/shared/components/grids/widgets/wp-calendar/wp-calendar.component';
+import { WidgetWpOverviewComponent } from 'core-app/shared/components/grids/widgets/wp-overview/wp-overview.component';
+import {
+ WidgetTimeEntriesCurrentUserComponent,
+} from 'core-app/shared/components/grids/widgets/time-entries/current-user/time-entries-current-user.component';
+import {
+ WidgetTimeEntriesProjectComponent,
+} from 'core-app/shared/components/grids/widgets/time-entries/project/time-entries-project.component';
+import { WidgetDocumentsComponent } from 'core-app/shared/components/grids/widgets/documents/documents.component';
+import { WidgetMembersComponent } from 'core-app/shared/components/grids/widgets/members/members.component';
+import { WidgetNewsComponent } from 'core-app/shared/components/grids/widgets/news/news.component';
++import { WidgetNewsBetaComponent } from 'core-app/shared/components/grids/widgets/news-beta/news-beta.component';
+import {
+ WidgetProjectDescriptionComponent,
+} from 'core-app/shared/components/grids/widgets/project-description/project-description.component';
+import { WidgetCustomTextComponent } from 'core-app/shared/components/grids/widgets/custom-text/custom-text.component';
+import {
+ WidgetProjectStatusComponent,
+} from 'core-app/shared/components/grids/widgets/project-status/project-status.component';
+import {
+ WidgetProjectStatusBetaComponent,
+} from 'core-app/shared/components/grids/widgets/project-status-beta/project-status-beta.component';
+import { WidgetSubprojectsComponent } from 'core-app/shared/components/grids/widgets/subprojects/subprojects.component';
+import {
+ WidgetProjectFavoritesComponent,
+} from 'core-app/shared/components/grids/widgets/project-favorites/widget-project-favorites.component';
+import { I18nService } from 'core-app/core/i18n/i18n.service';
@Injectable()
export class GridWidgetsService {
@@@ -53,207 -15,4 +54,215 @@@
return registeredWidgets;
}
+
+ private buildDefaultWidgets():WidgetRegistration[] {
+ const defaultColumns = ['id', 'project', 'type', 'subject'];
+
+ const assignedFilters = new ApiV3FilterBuilder();
+ assignedFilters.add('assignee', '=', ['me']);
+ assignedFilters.add('status', 'o', []);
+
+ const assignedProps = {
+ 'columns[]': defaultColumns,
+ filters: assignedFilters.toJson(),
+ };
+
+ const accountableFilters = new ApiV3FilterBuilder();
+ accountableFilters.add('responsible', '=', ['me']);
+ accountableFilters.add('status', 'o', []);
+
+ const accountableProps = {
+ 'columns[]': defaultColumns,
+ filters: accountableFilters.toJson(),
+ };
+
+ const createdFilters = new ApiV3FilterBuilder();
+ createdFilters.add('author', '=', ['me']);
+ createdFilters.add('status', 'o', []);
+
+ const createdProps = {
+ 'columns[]': defaultColumns,
+ filters: createdFilters.toJson(),
+ };
+
+ const watchedFilters = new ApiV3FilterBuilder();
+ watchedFilters.add('watcher', '=', ['me']);
+ watchedFilters.add('status', 'o', []);
+
+ const watchedProps = {
+ 'columns[]': defaultColumns,
+ filters: watchedFilters.toJson(),
+ };
+
+ return [
+ {
+ identifier: 'work_packages_assigned',
+ component: WidgetWpTableQuerySpaceComponent,
+ title: this.I18n.t('js.grid.widgets.work_packages_assigned.title'),
+ properties: {
+ queryProps: assignedProps,
+ name: this.I18n.t('js.grid.widgets.work_packages_assigned.title'),
+ },
+ },
+ {
+ identifier: 'work_packages_accountable',
+ component: WidgetWpTableQuerySpaceComponent,
+ title: this.I18n.t('js.grid.widgets.work_packages_accountable.title'),
+ properties: {
+ queryProps: accountableProps,
+ name: this.I18n.t('js.grid.widgets.work_packages_accountable.title'),
+ },
+ },
+ {
+ identifier: 'work_packages_created',
+ component: WidgetWpTableQuerySpaceComponent,
+ title: this.I18n.t('js.grid.widgets.work_packages_created.title'),
+ properties: {
+ queryProps: createdProps,
+ name: this.I18n.t('js.grid.widgets.work_packages_created.title'),
+ },
+ },
+ {
+ identifier: 'work_packages_watched',
+ component: WidgetWpTableQuerySpaceComponent,
+ title: this.I18n.t('js.grid.widgets.work_packages_watched.title'),
+ properties: {
+ queryProps: watchedProps,
+ name: this.I18n.t('js.grid.widgets.work_packages_watched.title'),
+ },
+ },
+ {
+ identifier: 'work_packages_table',
+ component: WidgetWpTableQuerySpaceComponent,
+ title: this.I18n.t('js.grid.widgets.work_packages_table.title'),
+ properties: {
+ name: this.I18n.t('js.grid.widgets.work_packages_table.title'),
+ },
+ },
+ {
+ identifier: 'work_packages_graph',
+ component: WidgetWpGraphComponent,
+ title: this.I18n.t('js.grid.widgets.work_packages_graph.title'),
+ properties: {
+ name: this.I18n.t('js.grid.widgets.work_packages_graph.title'),
+ },
+ },
+ {
+ identifier: 'work_packages_calendar',
+ component: WidgetWpCalendarComponent,
+ title: this.I18n.t('js.grid.widgets.work_packages_calendar.title'),
+ properties: {
+ name: this.I18n.t('js.grid.widgets.work_packages_calendar.title'),
+ },
+ },
+ {
+ identifier: 'work_packages_overview',
+ component: WidgetWpOverviewComponent,
+ title: this.I18n.t('js.grid.widgets.work_packages_overview.title'),
+ properties: {
+ name: this.I18n.t('js.grid.widgets.work_packages_overview.title'),
+ },
+ },
+ {
+ identifier: 'time_entries_current_user',
+ component: WidgetTimeEntriesCurrentUserComponent,
+ title: this.I18n.t('js.grid.widgets.time_entries_current_user.title'),
+ properties: {
+ name: this.I18n.t('js.grid.widgets.time_entries_current_user.title'),
+ days: [true, true, true, true, true, true, true],
+ },
+ },
+ {
+ identifier: 'time_entries_list',
+ component: WidgetTimeEntriesProjectComponent,
+ title: this.I18n.t('js.grid.widgets.time_entries_list.title'),
+ properties: {
+ name: this.I18n.t('js.grid.widgets.time_entries_list.title'),
+ },
+ },
+ {
+ identifier: 'documents',
+ component: WidgetDocumentsComponent,
+ title: this.I18n.t('js.grid.widgets.documents.title'),
+ properties: {
+ name: this.I18n.t('js.grid.widgets.documents.title'),
+ },
+ },
+ {
+ identifier: 'members',
+ component: WidgetMembersComponent,
+ title: this.I18n.t('js.grid.widgets.members.title'),
+ properties: {
+ name: this.I18n.t('js.grid.widgets.members.title'),
+ },
+ },
+ {
+ identifier: 'news',
+ component: WidgetNewsComponent,
+ title: this.I18n.t('js.grid.widgets.news.title'),
+ properties: {
+ name: this.I18n.t('js.grid.widgets.news.title'),
+ },
+ },
++ {
++ identifier: 'news_beta',
++ component: WidgetNewsBetaComponent,
++ title: this.I18n.t('js.grid.widgets.news_beta.title'),
++ properties: {
++ name: this.I18n.t('js.grid.widgets.news_beta.title'),
++ },
++ },
+ {
+ identifier: 'project_description',
+ component: WidgetProjectDescriptionComponent,
+ title: this.I18n.t('js.grid.widgets.project_description.title'),
+ properties: {
+ name: this.I18n.t('js.grid.widgets.project_description.title'),
+ },
+ },
+ {
+ identifier: 'custom_text',
+ component: WidgetCustomTextComponent,
+ title: this.I18n.t('js.grid.widgets.custom_text.title'),
+ properties: {
+ name: this.I18n.t('js.grid.widgets.custom_text.title'),
+ text: {
+ raw: '',
+ },
+ },
+ },
+ {
+ identifier: 'project_status',
+ component: WidgetProjectStatusComponent,
+ title: this.I18n.t('js.grid.widgets.project_status.title'),
+ properties: {
+ name: this.I18n.t('js.grid.widgets.project_status.title'),
+ },
+ },
+ {
+ identifier: 'project_status_beta',
+ component: WidgetProjectStatusBetaComponent,
+ title: this.I18n.t('js.grid.widgets.project_status_beta.title'),
+ properties: {
+ name: this.I18n.t('js.grid.widgets.project_status_beta.title'),
+ },
+ },
+ {
+ identifier: 'subprojects',
+ component: WidgetSubprojectsComponent,
+ title: this.I18n.t('js.grid.widgets.subprojects.title'),
+ properties: {
+ name: this.I18n.t('js.grid.widgets.subprojects.title'),
+ },
+ },
+ {
+ identifier: 'project_favorites',
+ component: WidgetProjectFavoritesComponent,
+ title: this.I18n.t('js.grid.widgets.project_favorites.title'),
+ properties: {
+ name: this.I18n.t('js.grid.widgets.project_favorites.title'),
+ },
+ },
+ ];
+ }
}
diff --cc modules/overviews/config/routes.rb
index 02ba96b0b74,08032b6db01..3e24165a5ec
--- a/modules/overviews/config/routes.rb
+++ b/modules/overviews/config/routes.rb
@@@ -1,12 -1,10 +1,12 @@@
# frozen_string_literal: true
Rails.application.routes.draw do
- constraints(project_id: Regexp.new("(?!(#{Project::RESERVED_IDENTIFIERS.join('|')})$)(\\w|-)+"), format: :html) do
+ constraints(Constraints::ProjectIdentifier) do
scope "projects/:project_id", as: "project" do
scope module: "overviews" do
- resource :overview, path: "/", only: [:show]
+ resource :overview, path: "/", only: [:show] do
+ get :dashboard, on: :member
+ end
controller :overviews do
get "project_custom_fields_sidebar" => :project_custom_fields_sidebar, as: :custom_fields_sidebar