Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/release/13.2' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverguenther committed Jan 29, 2024
2 parents d4ce6b2 + 2778f95 commit ed34aa5
Show file tree
Hide file tree
Showing 79 changed files with 214 additions and 142,588 deletions.
9 changes: 7 additions & 2 deletions app/services/work_packages/shared/update_ancestors.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,13 @@ def update_ancestors_all_attributes(work_packages)
end

def update_each_ancestor(work_packages, changes)
work_packages.map do |wp|
inherit_to_ancestors(wp, changes)
updated_work_package_ids = Set.new
work_packages.filter_map do |wp|
next if updated_work_package_ids.include?(wp.id)

result = inherit_to_ancestors(wp, changes)
updated_work_package_ids = updated_work_package_ids.merge(result.all_results.map(&:id))
result
end
end

Expand Down
14 changes: 11 additions & 3 deletions frontend/src/app/core/path-helper/apiv3-paths.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { ApiV3FilterBuilder } from 'core-app/shared/helpers/api-v3/api-v3-filter-builder';
import { WorkPackageResource } from 'core-app/features/hal/resources/work-package-resource';
import { HalResource } from 'core-app/features/hal/resources/hal-resource';

export class ApiV3Paths {
readonly apiV3Base:string;
Expand Down Expand Up @@ -35,12 +37,18 @@ export class ApiV3Paths {
* https://github.com/opf/commonmark-ckeditor-build/
*
*/
public principals(workPackageId:string|number, term:string|null) {
public principals(workPackage:WorkPackageResource, term:string|null) {
const filters:ApiV3FilterBuilder = new ApiV3FilterBuilder();
// Only real and activated users:
filters.add('status', '!', ['3']);
// that are members of that project:
filters.add('mentionable_on_work_package', '=', [workPackageId.toString()]);

if (!workPackage.id || workPackage.id === 'new') {
// that are members of that project:
filters.add('member', '=', [(workPackage.project as HalResource).id as string]);
} else {
// that are mentionable on the work package
filters.add('mentionable_on_work_package', '=', [workPackage.id.toString()]);
}
// That are users:
filters.add('type', '=', ['User', 'Group']);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import {
Injectable,
Injector,
} from '@angular/core';
import { Injectable, Injector } from '@angular/core';
import {
CalendarOptions,
DatesSetArg,
Expand All @@ -22,11 +19,10 @@ import { splitViewRoute } from 'core-app/features/work-packages/routing/split-vi
import { StateService } from '@uirouter/angular';
import { WorkPackageCollectionResource } from 'core-app/features/hal/resources/wp-collection-resource';
import { ToastService } from 'core-app/shared/components/toaster/toast.service';
import { firstValueFrom, Observable } from 'rxjs';
import {
firstValueFrom,
Observable,
} from 'rxjs';
import { WorkPackageViewFiltersService } from 'core-app/features/work-packages/routing/wp-view-base/view-services/wp-view-filters.service';
WorkPackageViewFiltersService,
} from 'core-app/features/work-packages/routing/wp-view-base/view-services/wp-view-filters.service';
import { WorkPackagesListService } from 'core-app/features/work-packages/components/wp-list/wp-list.service';
import { IsolatedQuerySpace } from 'core-app/features/work-packages/directives/query-space/isolated-query-space';
import { UntilDestroyedMixin } from 'core-app/shared/helpers/angular/until-destroyed.mixin';
Expand All @@ -40,19 +36,26 @@ import {
import { ApiV3Service } from 'core-app/core/apiv3/api-v3.service';
import { UIRouterGlobals } from '@uirouter/core';
import { TimezoneService } from 'core-app/core/datetime/timezone.service';
import { WorkPackagesListChecksumService } from 'core-app/features/work-packages/components/wp-list/wp-list-checksum.service';
import {
EventReceiveArg,
EventResizeDoneArg,
} from '@fullcalendar/interaction';
import { HalResourceEditingService } from 'core-app/shared/components/fields/edit/services/hal-resource-editing.service';
WorkPackagesListChecksumService,
} from 'core-app/features/work-packages/components/wp-list/wp-list-checksum.service';
import { EventReceiveArg, EventResizeDoneArg } from '@fullcalendar/interaction';
import {
HalResourceEditingService,
} from 'core-app/shared/components/fields/edit/services/hal-resource-editing.service';
import { ResourceChangeset } from 'core-app/shared/components/fields/changeset/resource-changeset';
import * as moment from 'moment';
import { WorkPackageViewSelectionService } from 'core-app/features/work-packages/routing/wp-view-base/view-services/wp-view-selection.service';
import {
WorkPackageViewSelectionService,
} from 'core-app/features/work-packages/routing/wp-view-base/view-services/wp-view-selection.service';
import { isClickedWithModifier } from 'core-app/shared/helpers/link-handling/link-handling';
import { uiStateLinkClass } from 'core-app/features/work-packages/components/wp-fast-table/builders/ui-state-link-builder';
import {
uiStateLinkClass,
} from 'core-app/features/work-packages/components/wp-fast-table/builders/ui-state-link-builder';
import { debugLog } from 'core-app/shared/helpers/debug_output';
import { WorkPackageViewContextMenu } from 'core-app/shared/components/op-context-menu/wp-context-menu/wp-view-context-menu.directive';
import {
WorkPackageViewContextMenu,
} from 'core-app/shared/components/op-context-menu/wp-context-menu/wp-view-context-menu.directive';
import { OPContextMenuService } from 'core-app/shared/components/op-context-menu/op-context-menu.service';
import { OpCalendarService } from 'core-app/features/calendar/op-calendar.service';
import { WeekdayService } from 'core-app/core/days/weekday.service';
Expand All @@ -71,7 +74,7 @@ interface CalendarOptionsWithDayGrid extends CalendarOptions {

@Injectable()
export class OpWorkPackagesCalendarService extends UntilDestroyedMixin {
static MAX_DISPLAYED = 100;
static MAX_DISPLAYED = 500;

tooManyResultsText:string|null;

Expand Down Expand Up @@ -207,6 +210,8 @@ export class OpWorkPackagesCalendarService extends UntilDestroyedMixin {
...(oldQueryProps.f as QueryPropsFilter[]).filter((filter:QueryPropsFilter) => filter.n !== 'datesInterval'),
OpWorkPackagesCalendarService.dateFilter(startDate, endDate),
],
pp: OpWorkPackagesCalendarService.MAX_DISPLAYED,
pa: 1,
};

queryProps = JSON.stringify(newQueryProps);
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,8 @@ import {
TemplateRef,
ViewChild,
} from '@angular/core';
import {
CalendarOptions,
DateSelectArg,
EventApi,
EventDropArg,
EventInput,
} from '@fullcalendar/core';
import {
BehaviorSubject,
combineLatest,
Subject,
} from 'rxjs';
import { CalendarOptions, DateSelectArg, EventApi, EventDropArg, EventInput } from '@fullcalendar/core';
import { BehaviorSubject, combineLatest, Subject } from 'rxjs';
import {
debounceTime,
distinctUntilChanged,
Expand All @@ -73,29 +63,31 @@ import interactionPlugin, {
import { FullCalendarComponent } from '@fullcalendar/angular';
import { I18nService } from 'core-app/core/i18n/i18n.service';
import { ConfigurationService } from 'core-app/core/config/configuration.service';
import { EventViewLookupService } from 'core-app/features/team-planner/team-planner/planner/event-view-lookup.service';
import { WorkPackageViewFiltersService } from 'core-app/features/work-packages/routing/wp-view-base/view-services/wp-view-filters.service';
import {
WorkPackageViewFiltersService,
} from 'core-app/features/work-packages/routing/wp-view-base/view-services/wp-view-filters.service';
import { IsolatedQuerySpace } from 'core-app/features/work-packages/directives/query-space/isolated-query-space';
import { CurrentProjectService } from 'core-app/core/current-project/current-project.service';
import { splitViewRoute } from 'core-app/features/work-packages/routing/split-view-routes.helper';
import { QueryFilterInstanceResource } from 'core-app/features/hal/resources/query-filter-instance-resource';
import { PrincipalsResourceService } from 'core-app/core/state/principals/principals.service';
import {
ApiV3ListFilter,
ApiV3ListParameters,
} from 'core-app/core/apiv3/paths/apiv3-list-resource.interface';
import { ApiV3ListFilter, ApiV3ListParameters } from 'core-app/core/apiv3/paths/apiv3-list-resource.interface';
import { WorkPackageResource } from 'core-app/features/hal/resources/work-package-resource';
import { HalResource } from 'core-app/features/hal/resources/hal-resource';
import { UntilDestroyedMixin } from 'core-app/shared/helpers/angular/until-destroyed.mixin';
import { OpCalendarService } from 'core-app/features/calendar/op-calendar.service';
import { HalResourceEditingService } from 'core-app/shared/components/fields/edit/services/hal-resource-editing.service';
import {
HalResourceEditingService,
} from 'core-app/shared/components/fields/edit/services/hal-resource-editing.service';
import { HalResourceNotificationService } from 'core-app/features/hal/services/hal-resource-notification.service';
import { SchemaCacheService } from 'core-app/core/schemas/schema-cache.service';
import { ApiV3Service } from 'core-app/core/apiv3/api-v3.service';
import { CalendarDragDropService } from 'core-app/features/team-planner/team-planner/calendar-drag-drop.service';
import { StatusResource } from 'core-app/features/hal/resources/status-resource';
import { ResourceChangeset } from 'core-app/shared/components/fields/changeset/resource-changeset';
import { KeepTabService } from 'core-app/features/work-packages/components/wp-single-view-tabs/keep-tab/keep-tab.service';
import {
KeepTabService,
} from 'core-app/features/work-packages/components/wp-single-view-tabs/keep-tab/keep-tab.service';
import { HalError } from 'core-app/features/hal/services/hal-error';
import { ActionsService } from 'core-app/core/state/actions/actions.service';
import {
Expand All @@ -104,10 +96,7 @@ import {
teamPlannerPageRefresh,
} from 'core-app/features/team-planner/team-planner/planner/team-planner.actions';
import { imagePath } from 'core-app/shared/helpers/images/path-helper';
import {
skeletonEvents,
skeletonResources,
} from './loading-skeleton-data';
import { skeletonEvents, skeletonResources } from './loading-skeleton-data';
import { CapabilitiesResourceService } from 'core-app/core/state/capabilities/capabilities.service';
import { ICapability } from 'core-app/core/state/capabilities/capability.model';
import { ToastService } from 'core-app/shared/components/toaster/toast.service';
Expand All @@ -118,10 +107,7 @@ import { RawOptionsFromRefiners } from '@fullcalendar/core/internal';
import { ViewOptionRefiners } from '@fullcalendar/common';
import { ResourceApi } from '@fullcalendar/resource';
import { DeviceService } from 'core-app/core/browser/device.service';
import {
EffectCallback,
registerEffectCallbacks,
} from 'core-app/core/state/effects/effect-handler.decorator';
import { EffectCallback, registerEffectCallbacks } from 'core-app/core/state/effects/effect-handler.decorator';
import {
addBackgroundEvents,
removeBackgroundEvents,
Expand All @@ -136,9 +122,6 @@ export type TeamPlannerViewOptions = { [K in TeamPlannerViewOptionKey]:RawOption
templateUrl: './team-planner.component.html',
styleUrls: ['./team-planner.component.sass'],
changeDetection: ChangeDetectionStrategy.OnPush,
providers: [
EventViewLookupService,
],
})
export class TeamPlannerComponent extends UntilDestroyedMixin implements OnInit, OnDestroy {
@ViewChild(FullCalendarComponent) ucCalendar:FullCalendarComponent;
Expand Down Expand Up @@ -377,7 +360,6 @@ export class TeamPlannerComponent extends UntilDestroyedMixin implements OnInit,
private wpTableFilters:WorkPackageViewFiltersService,
private querySpace:IsolatedQuerySpace,
private currentProject:CurrentProjectService,
private viewLookup:EventViewLookupService,
private I18n:I18nService,
readonly injector:Injector,
readonly calendar:OpCalendarService,
Expand Down Expand Up @@ -602,7 +584,7 @@ export class TeamPlannerComponent extends UntilDestroyedMixin implements OnInit,
([workPackages, projectAssignables]) => {
const events = this.mapToCalendarEvents(workPackages.elements, projectAssignables);

this.viewLookup.destroyDetached();
this.workPackagesCalendar.warnOnTooManyResults(workPackages);

this.removeExternalEvents();

Expand Down
Loading

0 comments on commit ed34aa5

Please sign in to comment.