From a8466647bb87f2fbb7c762710fba8c26a8ea812a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Kov=C3=A1=C4=8Dik?= Date: Mon, 6 Oct 2025 14:21:01 +0200 Subject: [PATCH 1/2] [NAE-2217] Single Task View - move task list and padination to new folder - add new injection token to set a task content service - rework of panel for be able to work with multiple tasks for single task view --- .../src/lib/panel/public-api.ts | 4 +- .../task-panel-data/task-panel-data.ts | 4 +- .../abstract-single-task.component.spec.ts | 2 +- .../abstract-single-task.component.ts | 2 +- .../abstract-task-panel.component.spec.ts | 2 +- .../abstract-task-panel.component.ts | 15 ++++++- .../model/task-content-injection-token.ts | 4 ++ .../model/task-content-service-type.ts | 10 +++++ .../src/lib/task-content/public-api.ts | 3 ++ .../services/task-content-service-factory.ts | 28 +++++++++++++ .../src/lib/view/public-api.ts | 2 + .../abstract-single-task-view.component.ts | 2 +- .../lib/view/task-view/abstract-task-view.ts | 2 +- .../abstract-default-task-list.component.ts | 16 +++---- ...abstract-task-list-pagination.component.ts | 10 ++--- .../abstract-task-list.component.spec.ts | 42 +++++++++---------- .../abstract-task-list.component.ts | 12 +++--- .../models/task-page-load-request-result.ts | 2 +- .../service/task-view.service.spec.ts | 2 +- .../task-view/service/task-view.service.ts | 2 +- ...fault-tabbed-single-task-view.component.ts | 18 ++++++++ .../src/lib/panel/panel.module.ts | 4 +- .../src/lib/panel/public-api.ts | 2 - .../single-task.component.ts | 24 ++++++----- .../task-panel/task-panel.component.spec.ts | 5 ++- .../panel/task-panel/task-panel.component.ts | 15 +++++-- .../src/lib/view/public-api.ts | 2 + .../task-list-pagination.component.html | 0 .../task-list-pagination.component.scss | 0 .../task-list-pagination.component.spec.ts | 4 +- .../task-list-pagination.component.ts | 7 +++- .../task-panel-list/task-list.component.html | 0 .../task-panel-list/task-list.component.scss | 0 .../task-list.component.spec.ts | 4 +- .../task-panel-list/task-list.component.ts | 12 +++++- 35 files changed, 181 insertions(+), 82 deletions(-) rename projects/netgrif-components-core/src/lib/panel/{task-panel-list => }/task-panel-data/task-panel-data.ts (54%) create mode 100644 projects/netgrif-components-core/src/lib/task-content/model/task-content-injection-token.ts create mode 100644 projects/netgrif-components-core/src/lib/task-content/model/task-content-service-type.ts create mode 100644 projects/netgrif-components-core/src/lib/task-content/services/task-content-service-factory.ts rename projects/netgrif-components-core/src/lib/{panel/task-panel-list => view/task-view/components}/default-task-panel-list/abstract-default-task-list.component.ts (85%) rename projects/netgrif-components-core/src/lib/{panel/task-panel-list => view/task-view/components}/task-panel-list-pagination/abstract-task-list-pagination.component.ts (81%) rename projects/netgrif-components-core/src/lib/{panel => view/task-view/components}/task-panel-list/abstract-task-list.component.spec.ts (67%) rename projects/netgrif-components-core/src/lib/{panel => view/task-view/components}/task-panel-list/abstract-task-list.component.ts (71%) rename projects/netgrif-components/src/lib/{panel => view/task-view}/task-panel-list-pagination/task-list-pagination.component.html (100%) rename projects/netgrif-components/src/lib/{panel => view/task-view}/task-panel-list-pagination/task-list-pagination.component.scss (100%) rename projects/netgrif-components/src/lib/{panel => view/task-view}/task-panel-list-pagination/task-list-pagination.component.spec.ts (96%) rename projects/netgrif-components/src/lib/{panel => view/task-view}/task-panel-list-pagination/task-list-pagination.component.ts (76%) rename projects/netgrif-components/src/lib/{panel => view/task-view}/task-panel-list/task-list.component.html (100%) rename projects/netgrif-components/src/lib/{panel => view/task-view}/task-panel-list/task-list.component.scss (100%) rename projects/netgrif-components/src/lib/{panel => view/task-view}/task-panel-list/task-list.component.spec.ts (96%) rename projects/netgrif-components/src/lib/{panel => view/task-view}/task-panel-list/task-list.component.ts (61%) diff --git a/projects/netgrif-components-core/src/lib/panel/public-api.ts b/projects/netgrif-components-core/src/lib/panel/public-api.ts index 5e321f0b77..abcceadb52 100644 --- a/projects/netgrif-components-core/src/lib/panel/public-api.ts +++ b/projects/netgrif-components-core/src/lib/panel/public-api.ts @@ -2,8 +2,6 @@ export * from './abstract-panel.component'; export * from './case-panel/abstract-case-panel.component'; export * from './task-panel/abstract-task-panel.component'; -export * from './task-panel-list/abstract-task-list.component'; -export * from './task-panel-list/task-panel-list-pagination/abstract-task-list-pagination.component'; export * from './workflow-panel/abstract-workflow-panel.component'; export * from './abstract/tabbed-virtual-scroll.component'; export * from './immediate/abstract-immediate-filter-text.component'; @@ -12,7 +10,7 @@ export * from './panel-item/abstract-panel-item.component'; export * from './task-panel-single/abstract-single-task.component'; /* DATA */ -export * from './task-panel-list/task-panel-data/task-panel-data'; +export * from './task-panel-data/task-panel-data'; export * from './task-panel/models/disable-functions'; export * from './abstract/featured-value'; export * from './immediate/model/filter-text-injection-token'; diff --git a/projects/netgrif-components-core/src/lib/panel/task-panel-list/task-panel-data/task-panel-data.ts b/projects/netgrif-components-core/src/lib/panel/task-panel-data/task-panel-data.ts similarity index 54% rename from projects/netgrif-components-core/src/lib/panel/task-panel-list/task-panel-data/task-panel-data.ts rename to projects/netgrif-components-core/src/lib/panel/task-panel-data/task-panel-data.ts index 959cbd072b..6ff76a8dbc 100644 --- a/projects/netgrif-components-core/src/lib/panel/task-panel-list/task-panel-data/task-panel-data.ts +++ b/projects/netgrif-components-core/src/lib/panel/task-panel-data/task-panel-data.ts @@ -1,6 +1,6 @@ -import {Task} from '../../../resources/interface/task'; +import {Task} from '../../resources/interface/task'; import {Subject} from 'rxjs'; -import {ChangedFields} from '../../../data-fields/models/changed-fields'; +import {ChangedFields} from '../../data-fields/models/changed-fields'; export interface TaskPanelData { diff --git a/projects/netgrif-components-core/src/lib/panel/task-panel-single/abstract-single-task.component.spec.ts b/projects/netgrif-components-core/src/lib/panel/task-panel-single/abstract-single-task.component.spec.ts index 49e23796f7..89f8acf229 100644 --- a/projects/netgrif-components-core/src/lib/panel/task-panel-single/abstract-single-task.component.spec.ts +++ b/projects/netgrif-components-core/src/lib/panel/task-panel-single/abstract-single-task.component.spec.ts @@ -29,7 +29,7 @@ import {AllowedNetsService} from '../../allowed-nets/services/allowed-nets.servi import {AllowedNetsServiceFactory} from '../../allowed-nets/services/factory/allowed-nets-service-factory'; import {ActivatedRoute} from '@angular/router'; import { AbstractSingleTaskComponent } from './abstract-single-task.component'; -import { TaskPanelData } from '../task-panel-list/task-panel-data/task-panel-data'; +import { TaskPanelData } from '../task-panel-data/task-panel-data'; describe('AbstractSingleTaskComponent', () => { diff --git a/projects/netgrif-components-core/src/lib/panel/task-panel-single/abstract-single-task.component.ts b/projects/netgrif-components-core/src/lib/panel/task-panel-single/abstract-single-task.component.ts index 9a4a2e8b76..e2abb14d85 100644 --- a/projects/netgrif-components-core/src/lib/panel/task-panel-single/abstract-single-task.component.ts +++ b/projects/netgrif-components-core/src/lib/panel/task-panel-single/abstract-single-task.component.ts @@ -1,6 +1,6 @@ import { Component, EventEmitter, Inject, Input, OnDestroy, Optional, Output, TemplateRef } from '@angular/core'; import { Observable, Subject } from 'rxjs'; -import { TaskPanelData } from '../task-panel-list/task-panel-data/task-panel-data'; +import { TaskPanelData } from '../task-panel-data/task-panel-data'; import { MatExpansionPanel } from '@angular/material/expansion'; import { HeaderColumn } from '../../header/models/header-column'; import { TaskEventNotification } from '../../task-content/model/task-event-notification'; diff --git a/projects/netgrif-components-core/src/lib/panel/task-panel/abstract-task-panel.component.spec.ts b/projects/netgrif-components-core/src/lib/panel/task-panel/abstract-task-panel.component.spec.ts index 366a487b0e..0253c05320 100644 --- a/projects/netgrif-components-core/src/lib/panel/task-panel/abstract-task-panel.component.spec.ts +++ b/projects/netgrif-components-core/src/lib/panel/task-panel/abstract-task-panel.component.spec.ts @@ -36,7 +36,7 @@ import {SearchService} from '../../search/search-service/search.service'; import {TestTaskBaseFilterProvider, TestTaskViewAllowedNetsFactory} from '../../utility/tests/test-factory-methods'; import {ErrorSnackBarComponent} from '../../snack-bar/components/error-snack-bar/error-snack-bar.component'; import {SuccessSnackBarComponent} from '../../snack-bar/components/success-snack-bar/success-snack-bar.component'; -import {TaskPanelData} from '../task-panel-list/task-panel-data/task-panel-data'; +import {TaskPanelData} from '../task-panel-data/task-panel-data'; import {AssignPolicy, DataFocusPolicy, FinishPolicy} from '../../task-content/model/policy'; import {ChangedFields} from '../../data-fields/models/changed-fields'; import {HeaderColumn, HeaderColumnType} from '../../header/models/header-column'; diff --git a/projects/netgrif-components-core/src/lib/panel/task-panel/abstract-task-panel.component.ts b/projects/netgrif-components-core/src/lib/panel/task-panel/abstract-task-panel.component.ts index bcd73d4c87..905a5deb69 100644 --- a/projects/netgrif-components-core/src/lib/panel/task-panel/abstract-task-panel.component.ts +++ b/projects/netgrif-components-core/src/lib/panel/task-panel/abstract-task-panel.component.ts @@ -15,7 +15,7 @@ import {MatExpansionPanel} from '@angular/material/expansion'; import {ComponentPortal} from '@angular/cdk/portal'; import {TaskContentService} from '../../task-content/services/task-content.service'; import {LoggerService} from '../../logger/services/logger.service'; -import {TaskPanelData} from '../task-panel-list/task-panel-data/task-panel-data'; +import {TaskPanelData} from '../task-panel-data/task-panel-data'; import {Observable, Subscription} from 'rxjs'; import {TaskViewService} from '../../view/task-view/service/task-view.service'; import {filter, map, take} from 'rxjs/operators'; @@ -53,6 +53,7 @@ import { FinishPolicyService } from '../../task/services/finish-policy.service'; import {NAE_TAB_DATA} from '../../tabs/tab-data-injection-token/tab-data-injection-token'; import {InjectedTabData} from '../../tabs/interfaces'; import {AfterAction} from '../../utility/call-chain/after-action'; +import {UnlimitedTaskContentService} from "../../task-content/services/unlimited-task-content.service"; @Component({ selector: 'ncc-abstract-legal-notice', @@ -251,7 +252,19 @@ export abstract class AbstractTaskPanelComponent extends AbstractPanelWithImmedi @Input() public set taskPanelData(data: TaskPanelData) { + const taskId = this._taskPanelData?.task?.stringId; this._taskPanelData = data; + if (this._taskContentService instanceof UnlimitedTaskContentService && taskId !== this._taskPanelData.task.stringId && this.panelRef) { + this.collapse(); + this._taskContentService.task = this._taskPanelData.task; + if (this._sub) { + this._sub.unsubscribe(); + } + this._sub = this._taskPanelData.changedFields.subscribe(chFields => { + this._taskContentService.updateFromChangedFields(chFields); + }); + this.expand(); + } this.resolveFeaturedFieldsValues(); } diff --git a/projects/netgrif-components-core/src/lib/task-content/model/task-content-injection-token.ts b/projects/netgrif-components-core/src/lib/task-content/model/task-content-injection-token.ts new file mode 100644 index 0000000000..bc5cc1f12a --- /dev/null +++ b/projects/netgrif-components-core/src/lib/task-content/model/task-content-injection-token.ts @@ -0,0 +1,4 @@ +import {InjectionToken} from '@angular/core'; +import {TaskContentServiceType} from './task-content-service-type'; + +export const NAE_TASK_CONTENT_SERVICE_TYPE = new InjectionToken('NaeTaskContentServiceType'); diff --git a/projects/netgrif-components-core/src/lib/task-content/model/task-content-service-type.ts b/projects/netgrif-components-core/src/lib/task-content/model/task-content-service-type.ts new file mode 100644 index 0000000000..614b0abd50 --- /dev/null +++ b/projects/netgrif-components-core/src/lib/task-content/model/task-content-service-type.ts @@ -0,0 +1,10 @@ +export enum TaskContentServiceType { + /** + * Type for creating SingleTaskContentService + */ + SINGLE = 'single', + /** + * Type for creating UnlimitedTaskContentService + */ + UNLIMITED = 'unlimited' +} diff --git a/projects/netgrif-components-core/src/lib/task-content/public-api.ts b/projects/netgrif-components-core/src/lib/task-content/public-api.ts index b5702e0231..b363701f2a 100644 --- a/projects/netgrif-components-core/src/lib/task-content/public-api.ts +++ b/projects/netgrif-components-core/src/lib/task-content/public-api.ts @@ -4,6 +4,7 @@ export * from './services/field-converter.service'; export * from './services/task-content.service'; export * from './services/single-task-content.service'; export * from './services/unlimited-task-content.service'; +export * from './services/task-content-service-factory'; /* MODELS */ export * from './model/policy'; @@ -17,6 +18,8 @@ export * from './model/async-rendering-configuration-injection-token'; export * from './model/subgrid'; export * from './model/split-data-group'; export * from './model/task-fields'; +export * from './model/task-content-service-type'; +export * from './model/task-content-injection-token'; /* MODULES */ export * from './task-content/abstract-task-content.component'; diff --git a/projects/netgrif-components-core/src/lib/task-content/services/task-content-service-factory.ts b/projects/netgrif-components-core/src/lib/task-content/services/task-content-service-factory.ts new file mode 100644 index 0000000000..61e1488036 --- /dev/null +++ b/projects/netgrif-components-core/src/lib/task-content/services/task-content-service-factory.ts @@ -0,0 +1,28 @@ +import {Injectable, Injector} from "@angular/core"; +import {LoggerService} from "../../logger/services/logger.service"; +import {FieldConverterService} from "./field-converter.service"; +import {SnackBarService} from "../../snack-bar/services/snack-bar.service"; +import {TranslateService} from "@ngx-translate/core"; +import {SingleTaskContentService} from "./single-task-content.service"; +import {UnlimitedTaskContentService} from "./unlimited-task-content.service"; + +@Injectable({ + providedIn: 'root' +}) +export class TaskContentServiceFactory { + + constructor(protected _fieldConverterService: FieldConverterService, + protected _snackBarService: SnackBarService, + protected _translate: TranslateService, + protected _log: LoggerService, + protected _injector: Injector) { + } + + public createSingleTaskContentService(): SingleTaskContentService { + return new SingleTaskContentService(this._fieldConverterService, this._snackBarService, this._translate, this._log, this._injector); + } + + public createUnlimitedTaskContentService(): UnlimitedTaskContentService { + return new UnlimitedTaskContentService(this._fieldConverterService, this._snackBarService, this._translate, this._log, this._injector); + } +} diff --git a/projects/netgrif-components-core/src/lib/view/public-api.ts b/projects/netgrif-components-core/src/lib/view/public-api.ts index 1dbd20e931..bd5872ff56 100644 --- a/projects/netgrif-components-core/src/lib/view/public-api.ts +++ b/projects/netgrif-components-core/src/lib/view/public-api.ts @@ -59,3 +59,5 @@ export * from './tree-case-view/tree-component/remove-node/abstract-remove-node. export * from './tree-case-view/tree-task-content/abstract-tree-task-content.component'; export * from './task-view/abstract-single-task-view.component'; export * from './task-view/abstract-tabbed-single-task-view.component'; +export * from './task-view/components/task-panel-list/abstract-task-list.component'; +export * from './task-view/components/task-panel-list-pagination/abstract-task-list-pagination.component'; diff --git a/projects/netgrif-components-core/src/lib/view/task-view/abstract-single-task-view.component.ts b/projects/netgrif-components-core/src/lib/view/task-view/abstract-single-task-view.component.ts index 12390c9b63..879baeba30 100644 --- a/projects/netgrif-components-core/src/lib/view/task-view/abstract-single-task-view.component.ts +++ b/projects/netgrif-components-core/src/lib/view/task-view/abstract-single-task-view.component.ts @@ -1,7 +1,7 @@ import {Component, EventEmitter, Input, Output} from '@angular/core'; import {AbstractViewWithHeadersComponent} from '../abstract/view-with-headers'; import {Observable} from 'rxjs'; -import {TaskPanelData} from '../../panel/task-panel-list/task-panel-data/task-panel-data'; +import {TaskPanelData} from '../../panel/task-panel-data/task-panel-data'; import {TaskViewService} from './service/task-view.service'; import {ActivatedRoute} from '@angular/router'; import {map, tap} from "rxjs/operators"; diff --git a/projects/netgrif-components-core/src/lib/view/task-view/abstract-task-view.ts b/projects/netgrif-components-core/src/lib/view/task-view/abstract-task-view.ts index 281819d7f1..ba36f9668e 100644 --- a/projects/netgrif-components-core/src/lib/view/task-view/abstract-task-view.ts +++ b/projects/netgrif-components-core/src/lib/view/task-view/abstract-task-view.ts @@ -1,6 +1,6 @@ import {Observable} from 'rxjs'; import {Component, OnDestroy} from '@angular/core'; -import {TaskPanelData} from '../../panel/task-panel-list/task-panel-data/task-panel-data'; +import {TaskPanelData} from '../../panel/task-panel-data/task-panel-data'; import {TaskViewService} from './service/task-view.service'; import {AbstractViewWithHeadersComponent} from '../abstract/view-with-headers'; import { ActivatedRoute } from '@angular/router'; diff --git a/projects/netgrif-components-core/src/lib/panel/task-panel-list/default-task-panel-list/abstract-default-task-list.component.ts b/projects/netgrif-components-core/src/lib/view/task-view/components/default-task-panel-list/abstract-default-task-list.component.ts similarity index 85% rename from projects/netgrif-components-core/src/lib/panel/task-panel-list/default-task-panel-list/abstract-default-task-list.component.ts rename to projects/netgrif-components-core/src/lib/view/task-view/components/default-task-panel-list/abstract-default-task-list.component.ts index 39d23a52db..d4530dd00a 100644 --- a/projects/netgrif-components-core/src/lib/panel/task-panel-list/default-task-panel-list/abstract-default-task-list.component.ts +++ b/projects/netgrif-components-core/src/lib/view/task-view/components/default-task-panel-list/abstract-default-task-list.component.ts @@ -1,16 +1,16 @@ import {MatExpansionPanel} from '@angular/material/expansion'; import {ActivatedRoute} from '@angular/router'; import {filter} from 'rxjs/operators'; -import {TabbedVirtualScrollComponent} from '../../abstract/tabbed-virtual-scroll.component'; +import {TabbedVirtualScrollComponent} from '../../../../panel/abstract/tabbed-virtual-scroll.component'; import {AfterViewInit, Component, EventEmitter, Inject, Input, OnDestroy, Optional, Output} from '@angular/core'; import {Observable, Subject, Subscription} from 'rxjs'; -import {TaskPanelData} from '../task-panel-data/task-panel-data'; -import {HeaderColumn} from '../../../header/models/header-column'; -import {TaskEventNotification} from '../../../task-content/model/task-event-notification'; -import {TaskViewService} from '../../../view/task-view/service/task-view.service'; -import {LoggerService} from '../../../logger/services/logger.service'; -import {NAE_TAB_DATA} from '../../../tabs/tab-data-injection-token/tab-data-injection-token'; -import {InjectedTabData} from '../../../tabs/interfaces'; +import {TaskPanelData} from '../../../../panel/task-panel-data/task-panel-data'; +import {HeaderColumn} from '../../../../header/models/header-column'; +import {TaskEventNotification} from '../../../../task-content/model/task-event-notification'; +import {TaskViewService} from '../../service/task-view.service'; +import {LoggerService} from '../../../../logger/services/logger.service'; +import {NAE_TAB_DATA} from '../../../../tabs/tab-data-injection-token/tab-data-injection-token'; +import {InjectedTabData} from '../../../../tabs/interfaces'; @Component({ diff --git a/projects/netgrif-components-core/src/lib/panel/task-panel-list/task-panel-list-pagination/abstract-task-list-pagination.component.ts b/projects/netgrif-components-core/src/lib/view/task-view/components/task-panel-list-pagination/abstract-task-list-pagination.component.ts similarity index 81% rename from projects/netgrif-components-core/src/lib/panel/task-panel-list/task-panel-list-pagination/abstract-task-list-pagination.component.ts rename to projects/netgrif-components-core/src/lib/view/task-view/components/task-panel-list-pagination/abstract-task-list-pagination.component.ts index 96dfff5c94..d18bc00161 100644 --- a/projects/netgrif-components-core/src/lib/panel/task-panel-list/task-panel-list-pagination/abstract-task-list-pagination.component.ts +++ b/projects/netgrif-components-core/src/lib/view/task-view/components/task-panel-list-pagination/abstract-task-list-pagination.component.ts @@ -3,11 +3,11 @@ import {Observable} from 'rxjs'; import {tap} from 'rxjs/operators'; import {ActivatedRoute} from '@angular/router'; import {AbstractDefaultTaskListComponent} from '../default-task-panel-list/abstract-default-task-list.component'; -import {TaskPanelData} from '../task-panel-data/task-panel-data'; -import {TaskViewService} from '../../../view/task-view/service/task-view.service'; -import {LoggerService} from '../../../logger/services/logger.service'; -import {NAE_TAB_DATA} from '../../../tabs/tab-data-injection-token/tab-data-injection-token'; -import {InjectedTabData} from '../../../tabs/interfaces'; +import {TaskPanelData} from '../../../../panel/task-panel-data/task-panel-data'; +import {TaskViewService} from '../../service/task-view.service'; +import {LoggerService} from '../../../../logger/services/logger.service'; +import {NAE_TAB_DATA} from '../../../../tabs/tab-data-injection-token/tab-data-injection-token'; +import {InjectedTabData} from '../../../../tabs/interfaces'; @Component({ selector: 'ncc-abstract-task-list-pagination-component', diff --git a/projects/netgrif-components-core/src/lib/panel/task-panel-list/abstract-task-list.component.spec.ts b/projects/netgrif-components-core/src/lib/view/task-view/components/task-panel-list/abstract-task-list.component.spec.ts similarity index 67% rename from projects/netgrif-components-core/src/lib/panel/task-panel-list/abstract-task-list.component.spec.ts rename to projects/netgrif-components-core/src/lib/view/task-view/components/task-panel-list/abstract-task-list.component.spec.ts index bc9b2d0394..b0b5c29521 100644 --- a/projects/netgrif-components-core/src/lib/panel/task-panel-list/abstract-task-list.component.spec.ts +++ b/projects/netgrif-components-core/src/lib/view/task-view/components/task-panel-list/abstract-task-list.component.spec.ts @@ -7,27 +7,27 @@ import {RouterTestingModule} from '@angular/router/testing'; import {Component, Inject, Optional} from '@angular/core'; import {of} from 'rxjs'; import {AbstractTaskListComponent} from './abstract-task-list.component'; -import {AssignPolicy, DataFocusPolicy, FinishPolicy} from '../../task-content/model/policy'; -import {TaskResourceService} from '../../resources/engine-endpoint/task-resource.service'; -import {MaterialModule} from '../../material/material.module'; -import {AuthenticationMethodService} from '../../authentication/services/authentication-method.service'; -import {MockAuthenticationMethodService} from '../../utility/tests/mocks/mock-authentication-method-service'; -import {AuthenticationService} from '../../authentication/services/authentication/authentication.service'; -import {MockAuthenticationService} from '../../utility/tests/mocks/mock-authentication.service'; -import {UserResourceService} from '../../resources/engine-endpoint/user-resource.service'; -import {MockUserResourceService} from '../../utility/tests/mocks/mock-user-resource.service'; -import {SearchService} from '../../search/search-service/search.service'; -import {TestTaskBaseFilterProvider, TestTaskViewAllowedNetsFactory} from '../../utility/tests/test-factory-methods'; -import {ConfigurationService} from '../../configuration/configuration.service'; -import {TestConfigurationService} from '../../utility/tests/test-config'; -import {TaskViewService} from '../../view/task-view/service/task-view.service'; -import {LoggerService} from '../../logger/services/logger.service'; -import {TranslateLibModule} from '../../translate/translate-lib.module'; -import {NAE_TAB_DATA} from '../../tabs/tab-data-injection-token/tab-data-injection-token'; -import {InjectedTabData} from '../../tabs/interfaces'; -import {NAE_BASE_FILTER} from '../../search/models/base-filter-injection-token'; -import {AllowedNetsService} from '../../allowed-nets/services/allowed-nets.service'; -import {AllowedNetsServiceFactory} from '../../allowed-nets/services/factory/allowed-nets-service-factory'; +import {AssignPolicy, DataFocusPolicy, FinishPolicy} from '../../../../task-content/model/policy'; +import {TaskResourceService} from '../../../../resources/engine-endpoint/task-resource.service'; +import {MaterialModule} from '../../../../material/material.module'; +import {AuthenticationMethodService} from '../../../../authentication/services/authentication-method.service'; +import {MockAuthenticationMethodService} from '../../../../utility/tests/mocks/mock-authentication-method-service'; +import {AuthenticationService} from '../../../../authentication/services/authentication/authentication.service'; +import {MockAuthenticationService} from '../../../../utility/tests/mocks/mock-authentication.service'; +import {UserResourceService} from '../../../../resources/engine-endpoint/user-resource.service'; +import {MockUserResourceService} from '../../../../utility/tests/mocks/mock-user-resource.service'; +import {SearchService} from '../../../../search/search-service/search.service'; +import {TestTaskBaseFilterProvider, TestTaskViewAllowedNetsFactory} from '../../../../utility/tests/test-factory-methods'; +import {ConfigurationService} from '../../../../configuration/configuration.service'; +import {TestConfigurationService} from '../../../../utility/tests/test-config'; +import {TaskViewService} from '../../service/task-view.service'; +import {LoggerService} from '../../../../logger/services/logger.service'; +import {TranslateLibModule} from '../../../../translate/translate-lib.module'; +import {NAE_TAB_DATA} from '../../../../tabs/tab-data-injection-token/tab-data-injection-token'; +import {InjectedTabData} from '../../../../tabs/interfaces'; +import {NAE_BASE_FILTER} from '../../../../search/models/base-filter-injection-token'; +import {AllowedNetsService} from '../../../../allowed-nets/services/allowed-nets.service'; +import {AllowedNetsServiceFactory} from '../../../../allowed-nets/services/factory/allowed-nets-service-factory'; import {ActivatedRoute} from '@angular/router'; diff --git a/projects/netgrif-components-core/src/lib/panel/task-panel-list/abstract-task-list.component.ts b/projects/netgrif-components-core/src/lib/view/task-view/components/task-panel-list/abstract-task-list.component.ts similarity index 71% rename from projects/netgrif-components-core/src/lib/panel/task-panel-list/abstract-task-list.component.ts rename to projects/netgrif-components-core/src/lib/view/task-view/components/task-panel-list/abstract-task-list.component.ts index 279b5c2225..c83369b2d8 100644 --- a/projects/netgrif-components-core/src/lib/panel/task-panel-list/abstract-task-list.component.ts +++ b/projects/netgrif-components-core/src/lib/view/task-view/components/task-panel-list/abstract-task-list.component.ts @@ -1,13 +1,13 @@ import {Component, Inject, Input, Optional, ViewChild} from '@angular/core'; import {CdkVirtualScrollViewport} from '@angular/cdk/scrolling'; -import {TaskViewService} from '../../view/task-view/service/task-view.service'; -import {LoggerService} from '../../logger/services/logger.service'; -import {NAE_TAB_DATA} from '../../tabs/tab-data-injection-token/tab-data-injection-token'; -import {InjectedTabData} from '../../tabs/interfaces'; +import {TaskViewService} from '../../service/task-view.service'; +import {LoggerService} from '../../../../logger/services/logger.service'; +import {NAE_TAB_DATA} from '../../../../tabs/tab-data-injection-token/tab-data-injection-token'; +import {InjectedTabData} from '../../../../tabs/interfaces'; import {ActivatedRoute} from '@angular/router'; -import {AbstractDefaultTaskListComponent} from './default-task-panel-list/abstract-default-task-list.component'; +import {AbstractDefaultTaskListComponent} from '../default-task-panel-list/abstract-default-task-list.component'; import {Observable} from 'rxjs'; -import {TaskPanelData} from './task-panel-data/task-panel-data'; +import {TaskPanelData} from '../../../../panel/task-panel-data/task-panel-data'; @Component({ selector: 'ncc-abstract-task-list', diff --git a/projects/netgrif-components-core/src/lib/view/task-view/models/task-page-load-request-result.ts b/projects/netgrif-components-core/src/lib/view/task-view/models/task-page-load-request-result.ts index 382434687c..bf61474ce0 100644 --- a/projects/netgrif-components-core/src/lib/view/task-view/models/task-page-load-request-result.ts +++ b/projects/netgrif-components-core/src/lib/view/task-view/models/task-page-load-request-result.ts @@ -1,4 +1,4 @@ -import {TaskPanelData} from '../../../panel/task-panel-list/task-panel-data/task-panel-data'; +import {TaskPanelData} from '../../../panel/task-panel-data/task-panel-data'; import {PageLoadRequestContext} from '../../abstract/page-load-request-context'; /** diff --git a/projects/netgrif-components-core/src/lib/view/task-view/service/task-view.service.spec.ts b/projects/netgrif-components-core/src/lib/view/task-view/service/task-view.service.spec.ts index 728cb58e8c..89198b8369 100644 --- a/projects/netgrif-components-core/src/lib/view/task-view/service/task-view.service.spec.ts +++ b/projects/netgrif-components-core/src/lib/view/task-view/service/task-view.service.spec.ts @@ -21,7 +21,7 @@ import {createMockTask} from '../../../utility/tests/utility/create-mock-task'; import {ElementaryPredicate} from '../../../search/models/predicate/elementary-predicate'; import {Query} from '../../../search/models/query/query'; import {Page} from '../../../resources/interface/page'; -import {TaskPanelData} from '../../../panel/task-panel-list/task-panel-data/task-panel-data'; +import {TaskPanelData} from '../../../panel/task-panel-data/task-panel-data'; import {SnackBarModule} from '../../../snack-bar/snack-bar.module'; import {MockAuthenticationMethodService} from '../../../utility/tests/mocks/mock-authentication-method-service'; import {NAE_BASE_FILTER} from '../../../search/models/base-filter-injection-token'; diff --git a/projects/netgrif-components-core/src/lib/view/task-view/service/task-view.service.ts b/projects/netgrif-components-core/src/lib/view/task-view/service/task-view.service.ts index ae245849a3..77e251da3d 100644 --- a/projects/netgrif-components-core/src/lib/view/task-view/service/task-view.service.ts +++ b/projects/netgrif-components-core/src/lib/view/task-view/service/task-view.service.ts @@ -1,6 +1,6 @@ import {Inject, Injectable, OnDestroy, Optional} from '@angular/core'; import {BehaviorSubject, Observable, of, ReplaySubject, Subject, Subscription, timer} from 'rxjs'; -import {TaskPanelData} from '../../../panel/task-panel-list/task-panel-data/task-panel-data'; +import {TaskPanelData} from '../../../panel/task-panel-data/task-panel-data'; import {TaskResourceService} from '../../../resources/engine-endpoint/task-resource.service'; import {UserService} from '../../../user/services/user.service'; import {SnackBarService} from '../../../snack-bar/services/snack-bar.service'; diff --git a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/tabbed/default-tabbed-single-task-view/default-tabbed-single-task-view.component.ts b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/tabbed/default-tabbed-single-task-view/default-tabbed-single-task-view.component.ts index 3577aeaefe..8469621ebf 100644 --- a/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/tabbed/default-tabbed-single-task-view/default-tabbed-single-task-view.component.ts +++ b/projects/netgrif-components/src/lib/navigation/group-navigation-component-resolver/default-components/tabbed/default-tabbed-single-task-view/default-tabbed-single-task-view.component.ts @@ -19,6 +19,12 @@ import { TaskRequestStateService, TaskViewService, ViewIdService, + TaskSearchRequestBody, + DataGroup, + extractFieldValueFromData, + SimpleFilter, + FilterType, + MergeOperator } from '@netgrif/components-core'; import {AsyncPipe} from "@angular/common"; import { @@ -26,6 +32,18 @@ import { } from "../../model/injected-tabbed-task-view-data-with-navigation-item-task-data"; function baseFilterFactory(injectedTabData: InjectedTabbedTaskViewDataWithNavigationItemTaskData) { + const requestBody = injectedTabData.baseFilter.getRequestBody() as TaskSearchRequestBody + if (requestBody.transitionId === undefined) { + const viewDataGroups: Array = injectedTabData.navigationItemTaskData?.slice(4, injectedTabData.navigationItemTaskData.length); + if (viewDataGroups !== undefined) { + const viewTransitionId = extractFieldValueFromData(viewDataGroups, "transition_id"); + if (viewTransitionId !== undefined) { + return { + filter: injectedTabData.baseFilter.merge(new SimpleFilter('', FilterType.TASK, {transitionId: viewTransitionId?.split(",")}), MergeOperator.AND) + }; + } + } + } return { filter: injectedTabData.baseFilter }; diff --git a/projects/netgrif-components/src/lib/panel/panel.module.ts b/projects/netgrif-components/src/lib/panel/panel.module.ts index e2f2234a72..5705ad4756 100644 --- a/projects/netgrif-components/src/lib/panel/panel.module.ts +++ b/projects/netgrif-components/src/lib/panel/panel.module.ts @@ -4,7 +4,7 @@ import {PanelComponent} from './panel.component'; import {FlexModule} from '@ngbracket/ngx-layout'; import {TaskPanelComponent} from './task-panel/task-panel.component'; import {CasePanelComponent} from './case-panel/case-panel.component'; -import {TaskListComponent} from './task-panel-list/task-list.component'; +import {TaskListComponent} from '../view/task-view/task-panel-list/task-list.component'; import {WorkflowPanelComponent} from './workflow-panel/workflow-panel.component'; import {DataFieldsComponentModule} from '../data-fields/data-fields.module'; import { @@ -24,7 +24,7 @@ import { ImmediateFilterTextContentComponent } from './immediate/immediate-filter-text-content/immediate-filter-text-content.component'; import {PanelItemComponent} from './panel-item/panel-item.component'; -import {TaskListPaginationComponent} from './task-panel-list-pagination/task-list-pagination.component'; +import {TaskListPaginationComponent} from '../view/task-view/task-panel-list-pagination/task-list-pagination.component'; import { SingleTaskComponent } from './task-panel-single/single-task.component'; import { SideMenuMultiUserAssignComponentModule diff --git a/projects/netgrif-components/src/lib/panel/public-api.ts b/projects/netgrif-components/src/lib/panel/public-api.ts index 978c1bcf07..802862113a 100644 --- a/projects/netgrif-components/src/lib/panel/public-api.ts +++ b/projects/netgrif-components/src/lib/panel/public-api.ts @@ -7,9 +7,7 @@ export * from './task-panel/task-panel.component'; export * from './case-panel/case-panel.component'; export * from './workflow-panel/workflow-panel.component'; export * from './public-workflow-panel/public-workflow-panel.component'; -export * from './task-panel-list/task-list.component'; export * from './immediate/immediate-filter-text/immediate-filter-text.component'; export * from './immediate/immediate-filter-text-content/immediate-filter-text-content.component'; export * from './panel-item/panel-item.component'; -export * from './task-panel-list-pagination/task-list-pagination.component'; export * from './task-panel-single/single-task.component'; diff --git a/projects/netgrif-components/src/lib/panel/task-panel-single/single-task.component.ts b/projects/netgrif-components/src/lib/panel/task-panel-single/single-task.component.ts index 219c79f84f..6164a9b356 100644 --- a/projects/netgrif-components/src/lib/panel/task-panel-single/single-task.component.ts +++ b/projects/netgrif-components/src/lib/panel/task-panel-single/single-task.component.ts @@ -1,23 +1,25 @@ -import { Component, Inject, Optional } from '@angular/core'; +import {Component, Inject, Optional} from '@angular/core'; import { AbstractSingleTaskComponent, InjectedTabData, LoggerService, - NAE_TAB_DATA + NAE_TAB_DATA, + NAE_TASK_CONTENT_SERVICE_TYPE, TaskContentServiceType } from '@netgrif/components-core'; -import { ActivatedRoute } from '@angular/router'; +import {ActivatedRoute} from '@angular/router'; @Component({ - selector: 'nc-single-task', - templateUrl: './single-task.component.html', - styleUrls: ['./single-task.component.scss'] + selector: 'nc-single-task', + templateUrl: './single-task.component.html', + styleUrls: ['./single-task.component.scss'], + providers: [{provide: NAE_TASK_CONTENT_SERVICE_TYPE, useValue: TaskContentServiceType.UNLIMITED}] }) export class SingleTaskComponent extends AbstractSingleTaskComponent { - constructor(protected _log: LoggerService, - protected _route: ActivatedRoute, - @Optional() @Inject(NAE_TAB_DATA) _injectedTabData: InjectedTabData) { - super(_log, _route, _injectedTabData); - } + constructor(protected _log: LoggerService, + protected _route: ActivatedRoute, + @Optional() @Inject(NAE_TAB_DATA) _injectedTabData: InjectedTabData) { + super(_log, _route, _injectedTabData); + } } diff --git a/projects/netgrif-components/src/lib/panel/task-panel/task-panel.component.spec.ts b/projects/netgrif-components/src/lib/panel/task-panel/task-panel.component.spec.ts index c87863007c..871a6878fa 100644 --- a/projects/netgrif-components/src/lib/panel/task-panel/task-panel.component.spec.ts +++ b/projects/netgrif-components/src/lib/panel/task-panel/task-panel.component.spec.ts @@ -53,7 +53,7 @@ import { AllowedNetsService, TestTaskViewAllowedNetsFactory, AllowedNetsServiceFactory, - CurrencyModule, ChangedFieldsService, OverflowService + CurrencyModule, ChangedFieldsService, OverflowService, TaskContentServiceType, NAE_TASK_CONTENT_SERVICE_TYPE } from '@netgrif/components-core'; import {of, Subject, throwError} from 'rxjs'; import {map} from 'rxjs/operators'; @@ -111,7 +111,8 @@ describe('TaskPanelComponent', () => { AssignPolicyService, FinishPolicyService, {provide: NAE_TASK_OPERATIONS, useClass: SubjectTaskOperations}, - {provide: AllowedNetsService, useFactory: TestTaskViewAllowedNetsFactory, deps: [AllowedNetsServiceFactory]} + {provide: AllowedNetsService, useFactory: TestTaskViewAllowedNetsFactory, deps: [AllowedNetsServiceFactory]}, + {provide: NAE_TASK_CONTENT_SERVICE_TYPE, useValue: TaskContentServiceType.SINGLE} ], declarations: [ PanelComponent, diff --git a/projects/netgrif-components/src/lib/panel/task-panel/task-panel.component.ts b/projects/netgrif-components/src/lib/panel/task-panel/task-panel.component.ts index 241fe5aa37..0696b7d066 100644 --- a/projects/netgrif-components/src/lib/panel/task-panel/task-panel.component.ts +++ b/projects/netgrif-components/src/lib/panel/task-panel/task-panel.component.ts @@ -20,7 +20,6 @@ import { OverflowService, PaperViewService, PermissionService, - SingleTaskContentService, SubjectTaskOperations, TaskContentService, TaskDataService, @@ -29,18 +28,28 @@ import { TaskViewService, FrontActionService, NAE_TAB_DATA, - InjectedTabData + InjectedTabData, SimpleFilter, + TaskContentServiceFactory, + NAE_TASK_CONTENT_SERVICE_TYPE, + TaskContentServiceType } from '@netgrif/components-core'; import {TaskContentComponent} from '../../task-content/task-content/task-content.component'; import {TranslateService} from '@ngx-translate/core'; import {CurrencyPipe} from '@angular/common'; +const taskContentServiceFactory = (serviceFactory: TaskContentServiceFactory, serviceType: TaskContentServiceType) => { + if (serviceType === TaskContentServiceType.SINGLE) { + return serviceFactory.createSingleTaskContentService(); + } + return serviceFactory.createUnlimitedTaskContentService(); +}; + @Component({ selector: 'nc-task-panel', templateUrl: './task-panel.component.html', styleUrls: ['./task-panel.component.scss'], providers: [ - {provide: TaskContentService, useClass: SingleTaskContentService}, + {provide: TaskContentService, useFactory: taskContentServiceFactory, deps: [TaskContentServiceFactory, NAE_TASK_CONTENT_SERVICE_TYPE]}, TaskDataService, FrontActionService, TaskEventService, diff --git a/projects/netgrif-components/src/lib/view/public-api.ts b/projects/netgrif-components/src/lib/view/public-api.ts index aaab3785d4..20d491aca0 100644 --- a/projects/netgrif-components/src/lib/view/public-api.ts +++ b/projects/netgrif-components/src/lib/view/public-api.ts @@ -5,6 +5,8 @@ export * from './case-view/components/create-case-button/create-case-button.comp export * from './case-view/components/case-list-paginator/case-list-paginator.component'; export * from './tree-case-view/tree-component/tree.component'; export * from './tree-case-view/tree-task-content/tree-task-content.component'; +export * from './task-view/task-panel-list-pagination/task-list-pagination.component'; +export * from './task-view/task-panel-list/task-list.component'; /* MODULES */ export * from './workflow-view.module'; diff --git a/projects/netgrif-components/src/lib/panel/task-panel-list-pagination/task-list-pagination.component.html b/projects/netgrif-components/src/lib/view/task-view/task-panel-list-pagination/task-list-pagination.component.html similarity index 100% rename from projects/netgrif-components/src/lib/panel/task-panel-list-pagination/task-list-pagination.component.html rename to projects/netgrif-components/src/lib/view/task-view/task-panel-list-pagination/task-list-pagination.component.html diff --git a/projects/netgrif-components/src/lib/panel/task-panel-list-pagination/task-list-pagination.component.scss b/projects/netgrif-components/src/lib/view/task-view/task-panel-list-pagination/task-list-pagination.component.scss similarity index 100% rename from projects/netgrif-components/src/lib/panel/task-panel-list-pagination/task-list-pagination.component.scss rename to projects/netgrif-components/src/lib/view/task-view/task-panel-list-pagination/task-list-pagination.component.scss diff --git a/projects/netgrif-components/src/lib/panel/task-panel-list-pagination/task-list-pagination.component.spec.ts b/projects/netgrif-components/src/lib/view/task-view/task-panel-list-pagination/task-list-pagination.component.spec.ts similarity index 96% rename from projects/netgrif-components/src/lib/panel/task-panel-list-pagination/task-list-pagination.component.spec.ts rename to projects/netgrif-components/src/lib/view/task-view/task-panel-list-pagination/task-list-pagination.component.spec.ts index 807e2a4e00..98643e3090 100644 --- a/projects/netgrif-components/src/lib/panel/task-panel-list-pagination/task-list-pagination.component.spec.ts +++ b/projects/netgrif-components/src/lib/view/task-view/task-panel-list-pagination/task-list-pagination.component.spec.ts @@ -1,7 +1,7 @@ import {ComponentFixture, TestBed, waitForAsync} from '@angular/core/testing'; import {TaskListPaginationComponent} from './task-list-pagination.component'; import {MatExpansionModule} from '@angular/material/expansion'; -import {PanelComponentModule} from '../panel.module'; +import {PanelComponentModule} from '../../../panel/panel.module'; import { AllowedNetsService, AllowedNetsServiceFactory, AssignPolicy, AuthenticationMethodService, @@ -22,7 +22,7 @@ import { import {NoopAnimationsModule} from '@angular/platform-browser/animations'; import {CommonModule} from '@angular/common'; import {HttpClientTestingModule} from '@angular/common/http/testing'; -import {AuthenticationComponentModule} from '../../authentication/auth.module'; +import {AuthenticationComponentModule} from '../../../authentication/auth.module'; import {RouterTestingModule} from '@angular/router/testing'; import {Component} from '@angular/core'; import {of} from 'rxjs'; diff --git a/projects/netgrif-components/src/lib/panel/task-panel-list-pagination/task-list-pagination.component.ts b/projects/netgrif-components/src/lib/view/task-view/task-panel-list-pagination/task-list-pagination.component.ts similarity index 76% rename from projects/netgrif-components/src/lib/panel/task-panel-list-pagination/task-list-pagination.component.ts rename to projects/netgrif-components/src/lib/view/task-view/task-panel-list-pagination/task-list-pagination.component.ts index 6408ba4559..1cd4449dd9 100644 --- a/projects/netgrif-components/src/lib/panel/task-panel-list-pagination/task-list-pagination.component.ts +++ b/projects/netgrif-components/src/lib/view/task-view/task-panel-list-pagination/task-list-pagination.component.ts @@ -9,7 +9,7 @@ import { NAE_TAB_DATA, TaskViewService, NetgrifPaginatorIntl, - AbstractTaskListPaginationComponent + AbstractTaskListPaginationComponent, NAE_TASK_CONTENT_SERVICE_TYPE, TaskContentServiceType } from '@netgrif/components-core'; import {ActivatedRoute} from '@angular/router'; import {MatPaginatorIntl} from '@angular/material/paginator'; @@ -18,7 +18,10 @@ import {MatPaginatorIntl} from '@angular/material/paginator'; selector: 'nc-task-list-pagination', templateUrl: './task-list-pagination.component.html', styleUrls: ['./task-list-pagination.component.scss'], - providers: [{provide: MatPaginatorIntl, useClass: NetgrifPaginatorIntl}] + providers: [ + {provide: MatPaginatorIntl, useClass: NetgrifPaginatorIntl}, + {provide: NAE_TASK_CONTENT_SERVICE_TYPE, useValue: TaskContentServiceType.SINGLE} + ] }) export class TaskListPaginationComponent extends AbstractTaskListPaginationComponent { constructor(protected _taskViewService: TaskViewService, diff --git a/projects/netgrif-components/src/lib/panel/task-panel-list/task-list.component.html b/projects/netgrif-components/src/lib/view/task-view/task-panel-list/task-list.component.html similarity index 100% rename from projects/netgrif-components/src/lib/panel/task-panel-list/task-list.component.html rename to projects/netgrif-components/src/lib/view/task-view/task-panel-list/task-list.component.html diff --git a/projects/netgrif-components/src/lib/panel/task-panel-list/task-list.component.scss b/projects/netgrif-components/src/lib/view/task-view/task-panel-list/task-list.component.scss similarity index 100% rename from projects/netgrif-components/src/lib/panel/task-panel-list/task-list.component.scss rename to projects/netgrif-components/src/lib/view/task-view/task-panel-list/task-list.component.scss diff --git a/projects/netgrif-components/src/lib/panel/task-panel-list/task-list.component.spec.ts b/projects/netgrif-components/src/lib/view/task-view/task-panel-list/task-list.component.spec.ts similarity index 96% rename from projects/netgrif-components/src/lib/panel/task-panel-list/task-list.component.spec.ts rename to projects/netgrif-components/src/lib/view/task-view/task-panel-list/task-list.component.spec.ts index f3687400e0..bee6a4477e 100644 --- a/projects/netgrif-components/src/lib/panel/task-panel-list/task-list.component.spec.ts +++ b/projects/netgrif-components/src/lib/view/task-view/task-panel-list/task-list.component.spec.ts @@ -25,8 +25,8 @@ import { NAE_BASE_FILTER, TestTaskBaseFilterProvider, AllowedNetsService, TestTaskViewAllowedNetsFactory, AllowedNetsServiceFactory } from '@netgrif/components-core'; import {RouterTestingModule} from '@angular/router/testing'; -import {PanelComponentModule} from '../panel.module'; -import {AuthenticationComponentModule} from '../../authentication/auth.module'; +import {PanelComponentModule} from '../../../panel/panel.module'; +import {AuthenticationComponentModule} from '../../../authentication/auth.module'; describe('TaskListComponent', () => { let component: TaskListComponent; diff --git a/projects/netgrif-components/src/lib/panel/task-panel-list/task-list.component.ts b/projects/netgrif-components/src/lib/view/task-view/task-panel-list/task-list.component.ts similarity index 61% rename from projects/netgrif-components/src/lib/panel/task-panel-list/task-list.component.ts rename to projects/netgrif-components/src/lib/view/task-view/task-panel-list/task-list.component.ts index ec9ad02600..124ba23c7a 100644 --- a/projects/netgrif-components/src/lib/panel/task-panel-list/task-list.component.ts +++ b/projects/netgrif-components/src/lib/view/task-view/task-panel-list/task-list.component.ts @@ -1,11 +1,19 @@ import {Component, Inject, Optional} from '@angular/core'; -import {AbstractTaskListComponent, InjectedTabData, LoggerService, NAE_TAB_DATA, TaskViewService} from '@netgrif/components-core'; +import { + AbstractTaskListComponent, + InjectedTabData, + LoggerService, + NAE_TAB_DATA, + NAE_TASK_CONTENT_SERVICE_TYPE, TaskContentServiceType, + TaskViewService +} from '@netgrif/components-core'; import {ActivatedRoute} from '@angular/router'; @Component({ selector: 'nc-task-list', templateUrl: './task-list.component.html', - styleUrls: ['./task-list.component.scss'] + styleUrls: ['./task-list.component.scss'], + providers: [{provide: NAE_TASK_CONTENT_SERVICE_TYPE, useValue: TaskContentServiceType.SINGLE}] }) export class TaskListComponent extends AbstractTaskListComponent { constructor(protected _taskViewService: TaskViewService, From 862073e5677bdc33ececb550f1774d988f7c0840 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Kov=C3=A1=C4=8Dik?= Date: Mon, 6 Oct 2025 16:12:21 +0200 Subject: [PATCH 2/2] [NAE-2217] Single Task View - remove check id --- .../src/lib/panel/task-panel/abstract-task-panel.component.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/projects/netgrif-components-core/src/lib/panel/task-panel/abstract-task-panel.component.ts b/projects/netgrif-components-core/src/lib/panel/task-panel/abstract-task-panel.component.ts index baacf91300..ffdd166c23 100644 --- a/projects/netgrif-components-core/src/lib/panel/task-panel/abstract-task-panel.component.ts +++ b/projects/netgrif-components-core/src/lib/panel/task-panel/abstract-task-panel.component.ts @@ -257,9 +257,8 @@ export abstract class AbstractTaskPanelComponent extends AbstractPanelWithImmedi @Input() public set taskPanelData(data: TaskPanelData) { - const taskId = this._taskPanelData?.task?.stringId; this._taskPanelData = data; - if (this._taskContentService instanceof UnlimitedTaskContentService && taskId !== this._taskPanelData.task.stringId && this.panelRef) { + if (this._taskContentService instanceof UnlimitedTaskContentService && this.panelRef) { this.collapse(); this._taskContentService.task = this._taskPanelData.task; if (this._sub) {